text
stringlengths
2.85k
2.55M
label
class label
11 classes
Real group orbits on flag ind-varieties of SL(∞, C) arXiv:1601.04326v3 [math.AG] 22 Apr 2017 Mikhail V. Ignatyev, Ivan Penkov, and Joseph A. Wolf Abstract We consider the complex ind-group G = SL(∞, C) and its real forms G0 = SU(∞, ∞), SU(p, ∞), SL(∞, R), SL(∞, H). Our main object of study are the G0 -orbits on an ind-variety G/P for an arbitrary splitting parabolic ind-subgroup P ⊂ G, under the assumption that the subgroups G0 ⊂ G and P ⊂ G are aligned in a natural way. We prove that the intersection of any G0 -orbit on G/P with a finite-dimensional flag variety Gn /Pn from a given exhaustion of G/P via Gn /Pn for n → ∞, is a single (G0 ∩ Gn )-orbit. We also characterize all ind-varieties G/P on which there are finitely many G0 -orbits, and provide criteria for the existence of open and closed G0 -orbits on G/P in the case of infinitely many G0 -orbits. Keywords: homogeneous ind-variety, real group orbit, generalized flag. AMS subject classification: 14L30, 14M15, 22F30, 22E65. 1 Introduction This study has its roots in linear algebra. Witt’s Theorem claims that, given any two subspaces V1 , V2 of a finite-dimensional vector space V endowed with a nondegenerate bilinear or Hermitian form, the spaces V1 and V2 are isometric within V (i.e., one Mikhail V. Ignatyev Department of Mathematics and Mechanics, Samara State Aerospace University, Ak. Pavlova 1, 443011 Samara, Russia, e-mail: [email protected] Ivan Penkov Jacobs University Bremen, Campus Ring [email protected] 1, 28759 Bremen, Germany, e-mail: Joseph A. Wolf Department of Mathematics, University of California Berkeley, Berkeley California 94720-3840, USA, e-mail: [email protected] 1 2 Mikhail V. Ignatyev, Ivan Penkov, and Joseph A. Wolf is obtained from the other via an isometry of V ) if and only if V1 and V2 are isometric. When V is a Hermitian space, this is a statement about the orbits of the unitary group U(V ) on the complex grassmannian Gr(k,V ), where k = dimV1 = dimV2 . More precisely, the orbits of U(V ) on Gr(k,V ) are parameterized by the possible signatures of a, possibly degenerate, Hermitian form on a k-dimensional space of V . A general theory of orbits of a real form G0 of a semisimple complex Lie group G on a flag variety G/P was developed by the third author in [W1] and [W3]. This theory has become a standard tool in semisimple representation theory and complex algebraic geometry. For automorphic forms and automorphic cohomology we mention [WW], [FHW] and [W5]. For double fibration transforms and similar applications to representation theory see [WZ] and [HW2]. For the structure of real group orbits and cycle spaces with other applications to complex algebraic geometry see, for example, [W3], [W4], [W5], [W6], [WZ], [BK], [BLZ], [FH] [KS1], [KS2], [OW] and [FHW]. Finally, applications to geometric quantization are indicated by [RSW] and [SW2]. The purpose of the present paper is to initiate a systematic study of real group orbits on flag ind-varieties or, more precisely, on ind-varieties of generalized flags. The study of the classical simple ind-groups like SL(∞, C) arose from studying stabilization phenomena for classical algebraic groups. By now, the classical ind-groups, their Lie algebras, and their representations have grown to a separate subfield in the vast field of infinite-dimensional Lie groups and Lie algebras. In particular, it was seen in [DP1] that the ind-varieties G/P for classical ind-groups G consist of generalized flags (rather than simply of flags) which are, in general, infinite chains of subspaces subject to two delicate conditions, see Subsection 2.3 below. Here we restrict ourselves to the ind-group G = SL(∞, C) and its real forms G0 . We study G0 -orbits on an arbitrary ind-variety of generalized flags G/P, and establish several foundational results in this direction. Our setting assumes a certain alignment between the subgroups G0 ⊂ G and P ⊂ G. Our first result is the fact that any G0 -orbit in G/P, when intersected with a finite-dimensional flag variety Gn /Pn from a given exhaustion of G/P via Gn /Pn for n → ∞, yields a single G0n -orbit. This means that the mapping {G0n -orbits on Gn /Pn} → {G0n+1-orbits on Gn+1 /Pn+1} is injective. Using this feature, we are able to answer the following questions. 1. When are there finitely many G0 -orbits on G/P? 2. When is a given G0 -orbit on G/P closed? 3. When is a given G0 -orbit on G/P open? The answers depend on the type of real form and not only on the parabolic subgroup P ⊂ G. For instance, if P = B is an upper-triangular Borel ind-subgroup of SL(∞, C) (B depends on a choice of an ordered basis in the natural representation of SL(∞, C)), then G/B has no closed SU(∞, ∞)-orbit and has no open SL(∞, R)-orbit. We see the results of this paper only as a first step in the direction of understanding the structure of G/P as a G0 -ind-variety for all real forms of all classical Real group orbits on flag ind-varieties of SL(∞, C) 3 ind-groups G (and all splitting parabolic subgroups P ⊂ G). Substantial work lies ahead. 2 Background In this section we review some basic facts about finite-dimensional real group orbits. We then discuss the relevant class of infinite-dimensional Lie groups and the corresponding real forms and flag ind-varieties. 2.1 Finite-dimensional case Let V be a finite-dimensional complex vector space. Recall that a real structure on V is an antilinear involution τ on V . The set V 0 = {v ∈ V | τ (v) = v} is a real form of V , i.e., V 0 is a real vector subspace of V such that dimR V 0 = dimC V and the C-linear span hV 0 iC coincides with V . A real form V 0 of V defines a unique real structure τ on V such that V 0 is the set of fixed point of τ . A real form of a complex finite-dimensional Lie algebra g is a real Lie subalgebra g0 of g such that g0 is a real form of g as a complex vector space. Let G be a complex semisimple connected algebraic group, and G0 be a real form of G, i.e., G0 is a real closed algebraic subgroup of G such that its Lie algebra g0 is a real form of the Lie algebra g of G. Let P be a parabolic subgroup of G, and X = G/P be the corresponding flag variety. The group G0 naturally acts on X. In [W1] the third author proved the following facts about the G0 -orbit structure of X, see [W1, Theorems 2.6, 3.3, 3.6, Corollary 3.4] (here we use the usual differentiable manifold topology on X). Theorem 2.1. i) Each G0 -orbit is a real submanifold of X. ii) The number of G0 -orbits on X is finite. iii) The union of the open G0 -orbits is dense in X. iv) There is a unique closed orbit Ω on X. v) The inequality dimR Ω ≥ dimC X holds. Here is how this theorem relates to Witt’s Theorem in the case of a Hermitian form. Let V be an n-dimensional complex vector space and G = SL(V ). Fix a nondegenerate Hermitian form ω of signature (p, n − p) on the vector space V and denote by G0 = SU(V, ω ) the group of all linear operators on V of determinant 1 which preserve ω . Then G0 is a real form of G. Given k ≤ n, the group G naturally acts on the grassmannian X = Gr(k,V ) of all k-dimensional complex subspaces of V . To each U ∈ X one can assign its signature (a, b, c), where the restricted form ω |U has rank a + b with a positive squares and b negative ones, c equals the dimension of the intersection of U and its orthogonal complement, and a + b + c = k. 4 Mikhail V. Ignatyev, Ivan Penkov, and Joseph A. Wolf By Witt’s Theorem, two subspaces U1 , U2 ∈ X belong to the same G0 -orbit if and only if their signatures coincide. Set l = min{p, n − p}. Then one can verify the following formula for the number |X/G0 | of G0 -orbits on X:   (n − k + 1)(n − k + 2)/2, if n − l ≤ k, |X/G0 | = (l + 1)(l + 2)/2, if l ≤ k ≤ n − l,   (k + 1)(k + 2)/2, if k ≤ l. Furthermore, a G0 -orbit of a subspace U ∈ X is open if and only if the restriction of ω to U is nondegenerate, i.e., if c = 0. Therefore, the number of open orbits equals min{k + 1, l + 1}. There is a unique closed G0 -orbit Ω on X, and it consists of all k-dimensional subspaces of V such that c = min{k, l} (the condition c = min{k, l} maximizes the nullity of the form ω |U for k-dimensional subspaces U ⊂ V ). In particular, if k = p ≤ n − p, then Ω consists of all totally isotropic1 k-dimensional complex subspaces of V . See [W1] for more details in this latter case. 2.2 The ind-group SL(∞, C) and its real forms In the rest of the paper, V denotes a fixed countable-dimensional complex vector space with fixed basis E. We fix an order on E via the ordered set Z>0 , i.e., E = {ε1 , ε2 , . . .}. Let V∗ denote the span of the dual system E∗ = {ε1∗ , ε2∗ , . . .}. By definition, the group GL(V, E) is the group of invertible C-linear transformations on V that keep fixed all but finitely many elements of E. It is not difficult to verify that that GL(V, E) depends only on the pair (V,V∗ ) but not on E. Clearly, any operator from GL(V, E) has a well-defined determinant. By SL(V, E) we denote the subgroup of GL(V, E) of all operators with determinant 1. In the sequel G = SL(V, E) and we also write SL(∞, C) instead of G. S Express the basis E as a union E = En of nested finite subsets. Then V is exhausted by the finite-dimensional subspaces Vn = hEn iC , i.e., V = lim Vn . To −→ each linear operator ϕ on Vn one can assign the operator ϕe on Vn+1 such that ϕe(x) = ϕ (x) for x ∈ Vn , ϕe(εm ) = εm for εm ∈ / Vn . This gives embeddings SL(Vn ) ֒→ SL(Vn+1 ), so that G = SL(V, E) = lim SL(Vn ). In what follows we con−→ sider this exhaustion of G fixed, and set Gn = SL(Vn ). Recall that an ind-variety over R or C (resp., an ind-manifold) is an inductive limit of algebraic varieties (resp., of manifolds): Y = lim Yn . Below we always as−→ sume that Yn form an ascending chain Y1 ֒→ Y2 ֒→ . . . ֒→ Yn ֒→ Yn+1 ֒→ . . . , where Yn ֒→ Yn+1 are closed embeddings. Any ind-variety or ind-manifold is endowed with a topology by declaring a subset U ⊂ Y open if U ∩Yn is open for all n 1 In what follows we use the terms isotropic and totally isotropic as synonyms. Real group orbits on flag ind-varieties of SL(∞, C) 5 in the corresponding topologies. A morphism f : Y = lim Yn → Y ′ = lim Yn′ is a map −→ −→ induced by a collection of morphisms { fn : Yn → Yn′ }n≥1 such that the restriction of fn+1 to Yn coincides with fn for all n ≥ 1. A morphism f : Y → Y ′ is an isomorphism if there exists a morphism g : Y ′ → Y for which f ◦ g = idY ′ and g ◦ f = idY , where id is a morphism induced by the collection of the identity maps. S A locally linear algebraic ind-group is an ind-variety G = Gn such that all Gn are linear algebraic groups and the inclusions are group homomorphisms. In what follows we write ind-group for brevity. Clearly, G is an ind-group. By an indsubgroup of G we understand a subgroup of G closed in the direct limit Zariski topology. By definition, a real ind-subgroup G 0Sof G is called a real form of G, if G can be represented as an increasing union G = Gn of its finite-dimensional Zariski closed subgroups such that Gn is a semi-simple algebraic group and G 0 ∩ Gn is a real form of Gn for each n. Below we recall the classification of real forms of G due to A. Baranov [B]. Fix a real structure τ on V such that τ (e) = e for all e ∈ E. Then each Vn is τ invariant. Denote by GL(Vn , R) (resp., by SL(Vn , R)) the group of invertible (resp., of determinant 1) operators on Vn defined over R. Recall that a linear operator on a complex vector space with a real structure is defined over R if it commutes with the real structure, or, equivalently, if it maps the real form to itself. For each n, the map ϕ 7→ ϕe gives an embedding SL(Vn , R) ֒→ SL(Vn+1 , R), so the direct limit G0 = lim SL(Vn , R) is well defined. We denote this real form of G by SL(∞, R). −→ Fix a nondegenerate Hermitian form ω on V . Suppose that its restriction ωn = ω |Vn is nondegenerate for all n, and that ω (em ,Vn ) = 0 for em ∈ / Vn . Denote by pn the dimension of a maximal ωn -positive definite subspace of Vn , and put qn = dimVn − pn . Let SU(pn , qn ) be the subgroup of Gn consisting of all operators preserving the form ωn . For each n, the map ϕ 7→ ϕe induces an embedding SU(pn , qn ) ֒→ SU(pn+1 , qn+1 ), so we have a direct limit G0 = lim SU(pn , qn ). If there exists p −→ such that pn = p for all sufficiently large n (resp., if limn→∞ pn = limn→∞ qn = ∞), then we denote this real form of G by SU(p, ∞) (resp., by SU(∞, ∞)). Finally, fix a quaternionic structure J on V , i.e., an antilinear automorphism of V such that J 2 = −idV . Assume that the complex dimension of Vn is even for n ≥ 1, and that the restriction Jn of J to Vn is a quaternionic structure on Vn . Furthermore, suppose that J(ε2i−1 ) = −ε2i , J(ε2i ) = ε2i−1 for i ≥ 1. Let SL(Vn , H) be the subgroup of Gn consisting of all linear operators commuting with Jn , then, for each n, the map ϕ 7→ ϕe induces an embedding of the groups SL(Vn , H) ֒→ SL(Vn+1 , H), and we denote the direct limit by G0 = SL(∞, H) = lim SL(Vn , H). This group is also a real form of G. −→ The next result is a corollary of [B, Theorem 1.4] and [DP2, Corollary 3.2]. Theorem 2.2. If G = SL(∞, C), then SL(∞, R), SU(p, ∞), 0 ≤ p < ∞, SU(∞, ∞), SL(∞, H) are all real forms of G up to isomorphism. These real forms are pairwise non-isomorphic as ind-groups. 6 Mikhail V. Ignatyev, Ivan Penkov, and Joseph A. Wolf 2.3 Flag ind-varieties of the ind-group G Recall some basic definitions from [DP1]. A chain of subspaces in V is a linearly ordered (by inclusion) set C of distinct subspaces of V . We write C ′ (resp., C ′′ ) for the subchain of C of all F ∈ C with an immediate successor (resp., an immediate predecessor). Also, we write C † for the set of all pairs (F ′ , F ′′ ) such that F ′′ ∈ C ′′ is the immediate successor of F ′ ∈ C ′ . A generalized flag is a chain F of subspaces in V such that F = F′ ∪ F′′ and S V \ {0} = (F ′ ,F ′′ )∈F† F ′′ \ F ′ . Note that each nonzero vector v ∈ V determines a unique pair (Fv′ , Fv′′ ) ∈ F† such that v ∈ F ′′ \ F ′ . If F is a generalized flag, then each S of F′ and F′′ determines F, because if (F ′ , F ′′ ) ∈ F† , then F ′ = G′′ ∈F′′ , G′′ (F ′′ G′′ , T F ′′ = G′ ∈F′ , G′ )F ′ G′ (see [DP1, Proposition 3.2]). We fix a linearly ordered set (A, ) and an isomorphism of ordered sets A → F† : a 7→ (Fα′ , Fα′′ ), so that F can be written as F = {Fα′ , Fα′′ , α ∈ A}. We will write α ≺ β if α  β and α 6= β for α , β ∈ A. A generalized flag F is called maximal if it is not properly contained in another generalized flag. This is equivalent to the condition that dim Fv′′ /Fv′ = 1 for all nonzero vectors v ∈ V . A generalized flag is called a flag if the set of all proper subspaces of F is isomorphic as a linearly ordered set to a subset of Z. We say that a generalized flag F is compatible with a basis E = {e1 , e2 , . . .} of V if there exists a surjective map σ : E → A such that every pair (Fα′ , Fα′′ ) ∈ F† has the form Fα′ = he ∈ E | σ (e) ≺ α iC , Fα′′ = he ∈ E | σ (e)  α iC . By [DP1, Proposition 4.1], every generalized flag admits a compatible basis. A generalized flag F is weakly compatible with E if F is compatible with a basis L of V such that the set E \ (E ∩ L) is finite. Two generalized flags F, G are E-commensurable if both of them are weakly compatible with E and there exist an isomorphism of ordered sets φ : F → G and a finite-dimensional subspace U ⊂ V such that i) φ (F) + U = F + U for all F ∈ F; ii) dim φ (F) ∩U = dim F ∩U for all F ∈ F. Given a generalized flag F compatible with E, denote by X = XF,E = Fℓ(F, E) the set of all generalized flags in V , which are E-commensurable with F. S To endow X with an ind-variety structure, fix an exhaustion E = En of E by its finite subsets and denote Fn = {F ∩ hEn iC , F ∈ F}. Given α ∈ A, denote dα′ ,n = dim Fα′ ∩ hEn iC = |{e ∈ En | σ (e) ≺ α }|, dα′′ ,n = dim Fα′′ ∩ hEn iC = |{e ∈ En | σ (e)  α }|, where | · | stands for cardinality. We define Xn to be the projective varieties of flags in hEn iC of the form {Uα′′ ,Uα′′ , α ∈ A}, where Uα′ , Uα′′ are subspaces of hEn iC of dimensions dα′ ,n , dα′′ ,n respectively, Uα′ ⊂ Uα′′ for all α ∈ A, and Uα′′ ⊂ Uβ′ for all α ≺ β . (If A is infinite, there exist infinitely many α , β ∈ A such that Uα = Uβ .) Define an embedding ιn : Xn → Xn+1 : {Uα′′ ,Uα′′ , α ∈ A} 7→ {Wα′′ ,Wα′′ , α ∈ A} by Real group orbits on flag ind-varieties of SL(∞, C) Wα′ Wα′′ = Uα′ ⊕ he ∈ = Uα′′ ⊕ he ∈ En+1 \ En | σ (e) ≺ α iC , En+1 \ En | σ (e)  α iC . 7 (1) Then ιn is a closed embedding of algebraic varieties, and there exists a bijection from X to the inductive limit of this chain of morphisms, see [DP1, Proposition 5.2] or [FP, Section 3.3]. This bijection endows X with an ind-variety structure which S is independent on the chosen filtration En of the basis E. We will explain this bijection in more detail in Section 3. From now on we suppose that the linear span of En coincides with Vn and V∗ coincides with the span of the dual system E ∗ = {e∗1 , e∗2 , . . .}. We assume also that the inclusion Gn ֒→ Gn+1 induced by this exhaustion of E coincides with the inclusion ϕ 7→ ϕe defined above, i.e., that hEn+1 \ En iC = hEn+1 \ En iC . Denote by H the ind-subgroup of G = SL(∞, C) of all operators from G which are diagonal in E; H is called a splitting Cartan subgroup of G (in fact, H is a Cartan subgroup of G in terminology of [DPW]). We define a splitting Borel (resp., parabolic) subgroup of G to be and ind-subgroup of G containing H such that its intersection with Gn is a Borel (resp., parabolic) subgroup of Gn . Note that if P is a splitting parabolic S subgroup of G and Pn = P ∩ Gn , then G/P = Gn /Pn is a locally projective indvariety, i.e., an ind-variety exhausted by projective varieties. One can easily check that the group G naturally acts on X. Given a generalized flag F in V which is compatible with E, denote by PF the stabilizer of F in G. For the proof of the following theorem, see [DP1, Proposition 6.1, Theorem 6.2]. Theorem 2.3. Let F be a generalized flag compatible with E, X = Fℓ(F, E) and G = SL(∞, C). i)The group PF is a parabolic subgroup of G containing H, and the map F 7→ PF is a bijection between generalized flags compatible with E and splitting parabolic subgroups of G. ii) The ind-variety X is in fact G-homogeneous, and the map g 7→ g · F induces an isomorphism of ind-varieties G/PF ∼ = X. iii) F is maximal if and only if PF is a splitting Borel subgroup of G. Example 2.4. i) A first example of generalized flags is provided by the flag F = {{0} ⊂ F ⊂ V }, where F is a proper nonzero subspace of V . If F is compatible with E, then we can assume that F = hσ iC for some subset σ of E. In this case the ind-variety X is called an ind-grassmannian, and is denoted by Gr(F, E). If k = dim F is finite, then a flag {{0} ⊂ F ′ ⊂ V } is E-commensurable with F if and only if dim F = k, hence Gr(F, E) depends only on k, and we denote it by Gr(k,V ). Similarly, if k = codim V F is finite, then Gr(F, E) depends only on E and k (but not on F) and is isomorphic to Gr(k,V∗ ): an isomorphism Gr(F, E) → {F ⊂ V∗ | dim F = k} = Gr(k,V∗ ) is induced by the map Gr(F, E) ∋ U 7→ U # = {φ ∈ V∗ | φ (x) = 0 for all x ∈ U}. Finally, if F is both infinite dimensional and infinite codimensional, then Gr(F, E) depends on F and E, but all such ind-varieties are isomorphic and denoted by Gr(∞), see [PT] or [FP, Section 4.5] for the details. Clearly, in each case one has F′ = {{0} ⊂ F}, F′′ = {F ⊂ V }. 8 Mikhail V. Ignatyev, Ivan Penkov, and Joseph A. Wolf ii) Our second example is the generalized flag F = {{0} = F0 ⊂ F1 ⊂ . . .}, where e = {{0} = Fe0 ⊂ Fe′ ⊂ . . .} Fi = he1 , . . . , ei iC for all i ≥ 1. This clearly is a flag. A flag F 1 is E-commensurable with F if and only if dim Fi = dim Fei for all i, and Fi = Fei for large enough i. The flag F is maximal, and F′ = F, F′′ = F \ {0}. iii) Put F = {{0} = F0 ⊂ F1 ⊂ F2 ⊂ . . . ⊂ F−2 ⊂ F−1 ⊂ V }, where Fi = he1 , e3 , . . . , e2i−1 iC , F−i = h{e j , j odd} ∪ {e2 j , j > i}iC for i ≥ 1. This generalized flag is clearly not a flag, and is maximal. Here F′ = F \ V , F′′ = F \ {0}. e ∈ X = Fℓ(F, E) does not imply that Fei = Fi for i large enough. For Note also that F e example, let F1 = Ce2 , Fei = he2 , e3 , e5 , e7 , . . . , e2i−1 iC e ∈ X, for i > 1, and Fe−i = h{e j , j odd, j ≥ 3} ∪ {e2} ∪ {e2 j , j > i}iC , i ≥ 1, then F e but Fi 6= Fi for all i. Remark 2.5. In all above examples X = G/PF , where PF is the stabilizer of F in G. The ind-grassmannians in (i) are precisely the ind-varieties G/PF for maximal splitting parabolic ind-subgroups PF ⊂ G. The ind-variety Fℓ(F, E), where F is the flag in (ii), equals G/PF where PF is the upper-triangular Borel ind-subgroup in the realization of G as Z>0 × Z>0 -matrices. 3 G0 -orbits as ind-manifolds In this section, we establish a basic property of the orbits on G/P of a real form G0 of G = SL(∞, C). Precisely, we prove that the intersection of a G0 -orbit with Xn is a single orbit. Consequently, each G0 -orbit is an infinite-dimensional real ind-manifold. We start by describing explicitly the bijection X → lim Xn mentioned in Sub−→ section 2.3. Let F be a generalized flag in V compatible with the basis E, and X = Fℓ(F, E) be the corresponding ind-variety of generalized flags. Recall that we consider X as the inductive limit of flag varieties Xn , where the embeddings ιn : Xn ֒→ Xn+1 are defined in the previous subsection. Put Em′ = {e1 , e2 , . . . , em } and Vm = hEm′ iC . The construction of ιn can be reformulated as follows. The dimensions of the spaces of the flag F ∩ Vm form a sequence of integers 0 = dm,0 < dm,1 < . . . < dm,sm−1 < dsm = dim Vm = m. Let Fℓ(dm , Vm ) be the flag variety of type dm = (dm,1 , . . . , dm,sm−1 ) in Vm . Since either sm+1 = sm or sm+1 = sm + 1, there is a unique jm such that dm+1,i = dm,i + 1 for 0 ≤ i < jm and dm+1, jm > dm, jm . Then, for jm ≤ i < sm , dm+1,i = dm,i + 1 in case sm+1 = sm , and dm+1,i = dm,i−1 + 1 in case sm+1 = sm + 1. In other words, jm ≤ sm is the minimal nonnegative integer for which there is α ∈ A with dim Fα′′ ∩ Vm+1 = dim Fα′′ ∩ Vm + 1. Real group orbits on flag ind-varieties of SL(∞, C) 9 Now, for each m we define an embedding ξm : Fℓ(dm , Vm ) ֒→ Fℓ(dm+1 , Vm+1 ): m m given a flag Gm = {{0} = Gm 0 ⊂ G1 ⊂ . . . ⊂ Gsm = Vm } ∈ Fℓ(dm , Vm ), we set m+1 m+1 ξm (Gm ) = Gm+1 = {{0} = G0 ⊂ G1 ⊂ . . . ⊂ Gm+1 sm+1 = Vm+1 } ∈ Fℓ(dm+1 , Vm+1 ), where  m  if 0 ≤ i < jm ,  Gi , m+1 Gi = Gm (2) ⊕ Ce , if jm ≤ i ≤ sm+1 and sm+1 = sm , m+1 i   m Gi−1 ⊕ Cem+1 , if jm ≤ i ≤ sm+1 and sm+1 = sm + 1. For any G ∈ X we choose a positive integer mG such that F and G are compatible with bases containing {ei | i ≥ mG }, and VmG contains a subspace which makes these generalized flags E-commensurable. In addition, we can assume that mF ≤ mG for all G ∈ X (in fact, we can set mF = 1 because F is compatible with E). Let mF ≤ m1 < m2 < . . . be an arbitrary sequence of integer numbers. For n ≥ 1, denote En = Em′ n , Vn = Vmn . Then Xn = Fℓ(dmn , Vmn ) and, according to (1), ιn = ξmn+1 −1 ◦ ξmn+1 −2 ◦ . . .◦ ξmn . The bijection X → lim Xn from Subsection 2.3 now −→ has the form G 7→ lim Gn , where Gn = {F ∩ Vn , F ∈ G } for n such that mn ≥ mG . −→ By a slight abuse of notation, in the sequel we will denote the canonical embedding Xn ֒→ X by the same letter ιn . Let G0 be a real form of G = SL(∞, C) (see Theorem 2.2). The group Gn = SL(Vn ) naturally acts on Xn , and the map ιn is equivariant: g · ιn (x) = ιn (g · x), g ∈ Gn ⊂ Gn+1 , x ∈ Xn . Put also G0n = G0 ∩ Gn . Then G0n is a real form of Gn . For the rest of the paper we fix some specific assumptions on Vn for different real forms. We now describe these assumptions case by case. Let G0 = SU(p, ∞) or SU(∞, ∞). Recall that the restriction ωn of the fixed nondegenerate Hermitian form ω to Vn is nondegenerate. From now on, we assume that if e ∈ En+1 \ En , then e is orthogonal to Vn with respect to ωn+1 . Next, let G0 = SL(∞, R). Here we assume that mn is odd for each n ≥ 1, and that hEn iR is a real form of Vn . Finally, for G0 = SL(∞, H), we assume that mn is even for all n ≥ 1 and that J(e2i−1 ) = −e2i , J(e2i ) = e2i−1 for all i. These additional assumptions align the real form G0 with the flag variety X. Our main result in this section is as follows. Theorem 3.1. If ιn (Xn ) has nonempty intersection with a G0n+1 -orbit, then that intersection is a single G0n -orbit. P ROOF. The proof goes case by case. C ASE G0 = SU(∞, ∞). (The proof for G0 = SU(p, ∞), 0 ≤ p < ∞, is completely similar.) Pick two flags A = {{0} = A0 ⊂ A1 ⊂ . . . ⊂ Asmn = Vn }, B = {{0} = B0 ⊂ B1 ⊂ . . . ⊂ Bsmn = Vn } e = ιn (B) belong to a given G0 -orbit. in Xn such that Af= ιn (A ) and B n+1 10 Mikhail V. Ignatyev, Ivan Penkov, and Joseph A. Wolf Put e0 ⊂ A e1 ⊂ . . . ⊂ A esm = Vn+1 }, Af= {{0} = A n+1 e = {{0} = Be0 ⊂ Be1 ⊂ . . . ⊂ Bes B mn+1 = Vn+1 }. e i.e., ϕ (A ei ) = Bei for all i There exists ϕ ∈ SU(ωn+1 ,Vn+1 ) satisfying ϕ (Af) = B, from 0 to smn+1 . To prove the result, we must construct an isometry ϕ : Vn → Vn satisfying ϕ (A ) = B. Of course, one can scale ϕ to obtain an isometry of determinant 1. By Huang’s extension of Witt’s Theorem [Hu, Theorem 6.2], such an isometry exists if and only if Ai and Bi are isometric for all i from 1 to smn , and n n dim(Ai ∩ A⊥,V ) = dim(Bi ∩ B⊥,V ) j j (3) for all i < j from 1 to smn . (Here U ⊥,Vn denotes the ωn -orthogonal complement within Vn of a subspace U ⊂ Vn .) Pick i from 1 to smn . Since en+1 is orthogonal to ei and Bei , the first condition is satisfied. Vn and ϕe establishes an isometry between A So it remains to prove (3). To do this, denote Cn = hEn+1 \ En iC . Since Cn is orthogonal to Vn , for given subspaces U ⊂ Vn , W ⊂ Cn one has (U ⊕ W )⊥,Vn+1 = U ⊥,Vn ⊕ W ⊥,Cn . Hence, if ek = Ak ⊕ Wk , Bek = Bk ⊕ Wk for k ∈ {i, j} and some subspaces of Wi , W j ⊂ Cn , A then ei ∩ A e⊥,Vn+1 = (Ai ⊕ Wi ) ∩ (A⊥,Vn ⊕ W ⊥,Cn ) = (Ai ∩ A⊥,Vn ) ⊕ (Wi ∩W ⊥,Cn ), A j j j j j ⊥,V and the similar equality holds for Bei ∩ Be j n+1 . The result follows. C ASE G0 = SL(∞, R). Here we first prove that if A and B are flags in Vn , e are their images in Vn+1 under the map ξn , and there exists Af and B e then there exists an operator ν ∈ GL(Vn , R) ϕ ∈ GL(Vn+1 , R) satisfying ϕ (Af) = B, such that ν (A ) = B. Consider first the case when ϕ (en+1 ) ∈ / Vn . Denote ϕ (en+1 ) = v + ten+1 , v ∈ Vn , e so we can assume that t = 1, t ∈ R, t 6= 0. Then t −1 ϕ ∈ GL(Vn+1 , R) maps Afto B, i.e., ϕ (en+1 ) = v + en+1. Since ϕ (A jn ⊕ Cen+1) = ϕ (Ae jn ) = Be jn = B jn ⊕ Cen+1, the vector v belongs to Bi for all i ≥ jn . Let ψ ∈ GL(Vn+1 , R) be defined by ψ (x + sen+1) = x + s(en+1 − v), x ∈ Vn , s ∈ C. Clearly, ψ (ϕ (en+1 )) = en+1 . If i < jn and x ∈ Ai , then ϕ (x) ∈ Bi ⊂ Vn , so ψ (ϕ (x)) = ϕ (x) ∈ Bi . If i ≥ jn and x ∈ Ar , where r = i for sn+1 = sn and r = i − 1 for sn+1 = sn + 1, then we put ϕ (x) = y + sen+1, y ∈ Bi , s ∈ C. One has Real group orbits on flag ind-varieties of SL(∞, C) 11 ψ (ϕ (x)) = ψ (y + sen+1) = y + s(en+1 − v) ∈ Br ⊕ Cen+1 = Bei . ei to Bei for all i from 0 to sn+1 . Hence In both cases the operator ψ ◦ ϕ maps A we may assume without loss of generality that ϕ (en+1 ) = en+1 . Then the operator ν = π ◦ ϕ |Vn , where π : Vn+1 → Vn is the projection onto Vn along Cen+1 , is invertible, is defined over R, and maps each Ai to Bi , 0 ≤ i ≤ sn , as required. Suppose now that ϕ (en+1 ) = b ∈ Vn . In this case sn+1 = sn because the condition ϕ (A jn −1 ⊕ Cen+1) = ϕ (Ae jn ) = Be jn = B jn −1 ⊕ Cen+1 contradicts the equality sn+1 = sn + 1. Arguing as above, we see that b ∈ Bi for all i ≥ jn . If ϕ −1 (en+1 ) = a ∈ / Vn , then one can construct ν as in the case when b ∈ / Vn with ϕ −1 instead of ϕ . Therefore, we may assume that a ∈ Ai for all i ≥ jn . Let U 0 be an R-subspace of V0n such that V0n = U 0 ⊕ Rb, then Vn = U ⊕ Cb, where U = C ⊗R U 0 . If a, b are linearly independent, we choose U 0 so that a ∈ U 0 . Define ν as follows: if ϕ (x) = y + sb + ren+1 , x ∈ Vn , y ∈ U, s, r ∈ C, then put ν (x) = y + (s + r)b. One can easily check that ν satisfies all required conditions. Now we are ready to prove the result for G0 = SL(∞, R). Namely, let A , B ∈ Xn , and ϕ ∈ SL(Vn , R) satisfy ϕ (ιn (A )) = ιn (B), then ϕ belongs to GL(Vmn+1 , R). Hence there exists ν ′ ∈ GL(Vmn+1 −1 , R) which maps ξmn+1 −2 ◦ . . . ◦ ξmn (A ) to ξmn+1 −2 ◦. . .◦ ξmn (B) because ιn = ξmn+1 −1 ◦ ξmn+1 −2 ◦. . .◦ ξmn . Continuing this process, we see that there exists an operator ν ′′ ∈ GL(Vn , R) such that ν ′′ (A ) = B. Since Vn is odd-dimensional, one can scale ν ′′ to obtain a required operator ν ∈ SL(Vn , R). C ASE G0 = SL(∞, H). Let A , B be two flags in V2n and Af= ξ2n+1 ◦ ξ2n (A ), e = ξ2n+1 ◦ ξ2n (B). Let ϕ ∈ SL(V2n+2 , H) satisfy ϕ (Af) = B. e Our goal is to conB struct ν ∈ SL(V2n , H) such that ν (A ) = B. Then, repeated application of this procedure will imply the result. For simplicity, denote e = e2n+1 , e′ = e2n+2 . Recall that J(e) = −e′ , J(e′ ) = e, and note that b = ϕ (e) ∈ V2n if and only if b′ = ϕ (e′ ) ∈ V2n , because V2n is J-invariant and ϕ commutes with J. First, suppose that both b and b′ do not belong to V2n . The vector b admits a unique representation in the form b = v + te + t ′e′ for v ∈ V2n , t, t ′ ∈ C. Then b′ = ϕ (e′ ) = ϕ (−J(e)) = −J(ϕ (e)) = −J(b) = v′ − t̄ ′e + t¯e′ , where v′ = −J(v) ∈ V2n . Set   t −t¯′ T = ′ ¯ , d = det T = |t|2 + |t ′ |2 ∈ R>0 . t t Let ψ ∈ GL(V2n+2 ) be the operator defined by ψ (x) = x, x ∈ V2n , ψ (e) = −d −1 (t¯(v + e) − t ′(v′ + e′ )), ψ (e′ ) = −d −1 (t¯′ (v + e) + t(v′ + e′ )). 12 Mikhail V. Ignatyev, Ivan Penkov, and Joseph A. Wolf It is easy to see that ψ commutes with J, det ψ = detT −1 ∈ R>0 , and ψ (b) = e, ψ (b′ ) = e′ . Furthermore, one can check that ν = π ◦ ψ ◦ ϕ |V2n : V2n → V2n commutes with J and maps A to B, where π : Vn+1 → Vn is the projection onto Vn along Ce ⊕ Ce′ . Since det ν ∈ R>0 , one can scale ν to obtain an operator from SL(V2n , H), as required. Second, suppose that b, b′ ∈ V2n . If a = ϕ −1 (e) and a′ = ϕ −1 (e′ ) do not belong to Vn , one can argue as in the first case with ϕ −1 instead of ϕ , so we may assume without loss of generality that a, a′ ∈ Vn . (Note that if a, a′ , b, b′ are linearly dependent, then Ca ⊕ Ca′ = Cb ⊕ Cb′.) In this case, denote by U a J-invariant subspace of Vn spanned by some basic vectors ei such that Vn = U ⊕ Cb ⊕ Cb′. (If a, a′ , b, b′ are linearly independent, we choose U such that a, a′ ∈ U.) Define ν by the following rule: if ϕ (x) = y + sb + sb′ + re + r′ e′ , x ∈ Vn , y ∈ U, s, s′ , r, r′ ∈ C, then ν (x) = y + (s + r)b + (s′ + r′ )b′ . One can check that det ν = det ϕ = 1, ν commutes with J (so ν ∈ SL(Vn , H)) and maps each Ai , 0 ≤ i ≤ sn , to Bi . Thus, ν satisfies all required conditions.  The following result is an immediate corollary of this theorem. Corollary 3.2. Let Ω be a G0 -orbit on X, and Ωn = ιn−1 (Ω ) ⊂ Xn . Then i) Ωn is a single G0n -orbit; ii) Ω is an infinite-dimensional real ind-manifold. P ROOF. i) Suppose A , B ∈ Ωn . Then there exists m ≥ n such that images of A and B under the morphism ιm−1 ◦ ιm−2 ◦ . . . ◦ ιn belong to the same G0m -orbit. Applying Theorem 3.1 subsequently to ιm−1 , ιm−2 , . . ., ιn , we see that A and B belong to the same G0n -orbit. ii) By definition, Ω = lim Ωn . Next, (i) implies that Ω is a real ind-manifold. −→ By Theorem 2.1 (v), we have dimR Ωn ≥ dimC Xn . Since limn→∞ dimC Xn = ∞, we  conclude that Ω is infinite dimensional. 4 Case of finitely many G0 -orbits We give now a criterion for X = Fℓ(F, E) to have a finite number of G0 -orbits, and observe that, if this is the case, the degeneracy order on the G0 -orbits in X coincides with that on the G0n -orbits in Xn for large enough n. Recall that the degeneracy order ′ on the orbits is the partial order Ω ≤ Ω ′ ⇐⇒ Ω ⊆ Ω . A generalized flag F is finite if it consists of finitely many (possibly infinitedimensional) subspaces. We say that a generalized flag F has finite type if it consists of finitely many subspaces of V each of which has either finite dimension or finite codimension in V . A finite type generalized flag is clearly a flag. An ind-variety e ∈ X is of X = Fℓ(F, E) is of finite type if F is of finite type (equivalently, if any F finite type). Proposition 4.1. For G0 = SU(∞, ∞), SL(∞, R) and SL(∞, H), the number of G0 orbits on X is finite if and only if X is of finite type. For G0 = SU(p, ∞), 0 < p < ∞, Real group orbits on flag ind-varieties of SL(∞, C) 13 the number of G0 -orbits on X is finite if and only if F is finite. For G0 = SU(0, ∞), the number of G0 -orbits on X equals 1. P ROOF. C ASE G0 = SU(∞, ∞). First consider the case X = Gr(F, E), where F is a subspace of V . Clearly, X is of finite type if and only if dim F < ∞ or codim V F < ∞. Note that for ind-grassmannians, the construction of ιn from (1) is simply the following. Given n, let Wn+1 be the span of En+1 \ En , and Un+1 be a fixed (kn+1 − kn )-dimensional subspace of Wn+1 , where ki = dim F ∩ Vi . Then the embedding ιn : Xn = Gr(kn ,Vn ) → Xn+1 = Gr(kn+1 ,Vn+1 ) has the form ιn (A) = A ⊕ Un+1 for A ∈ Xn . Recall that if codim V F = k, then the map U 7→ U # = {φ ∈ V∗ | φ (x) = 0 for all x ∈ U} induces an isomorphism Gr(F, E) → {F ′ ⊂ V∗ | dim F ′ = k} = Gr(k,V∗ ); we denote this isomorphism by D. To each operator ψ ∈ GL(V, E) one can assign the linear operator ψ∗ on V∗ acting by (ψ∗ (λ ))(x) = λ (ψ (x)), λ ∈ V∗ , x ∈ V . This defines an isomorphism SL(V, E) → SL(V∗ , E ∗ ), and D becomes a G-equivariant isomorphism of ind-varieties. Hence, for X of finite type, we can consider only the case when dim F = k. If dim F = k, then X consists of all k-dimensional subspaces of V . Pick A, B ∈ X. There exists n such that Xn = Gr(k,Vn ) and A, B ∈ ιn (Xn ). Witt’s Theorem shows that, for each m ≥ n, A and B belong to the same G0m -orbit if and only if the signatures of the forms ωm |A and ωm |B coincide. Since ωm |A,B = ω |A,B , we conclude A and B belong to the same G0 -orbit if and only if their signatures coincide. Thus, the number of G0 -orbits on X is finite. On the other hand, if dim F = codim V F = ∞, then lim kn = lim (dimVn − kn ) = ∞. n→∞ n→∞ In this case, the number of possible signatures of the restriction of ωn to a kn dimensional subspace tends to infinity, hence the number of G0n -orbits tends to infinity. By Theorem 3.1, the number of G0 -orbits on X is infinite. Now, consider the general case X = Fℓ(F, E). Let F be of finite type. Then F = A ∪ B where A and B are finite type subflags of F consisting of finitedimensional and finite-codimensional subspaces from F respectively. Note that A and B are compatible with the basis E, hence there exists N such that if n ≥ N, then A ⊆ Vn for all A ∈ A and codim Vn (B ∩Vn) = codim V B for all B ∈ B. Set A = {A1 ⊂ A2 ⊂ . . . ⊂ Ak }, B = {B1 ⊂ B2 ⊂ . . . ⊂ Bl }, and ai = dim Ai , 1 ≤ i ≤ k, bi = codim V Bi , 1 ≤ i ≤ l. Denote by s(U) the signature of ω |U for a finite-dimensional subspace U ⊂ V . According to [Hu, Theorem 6.2], to check that the number of G0 -orbits on X is 14 Mikhail V. Ignatyev, Ivan Penkov, and Joseph A. Wolf finite, it is enough to prove that all of the following sets are finite: SA = {s(A) | A ⊂ Vn , n ≥ N, dim A = ai for some i}, SB = {s(B) | B ⊂ Vn , n ≥ N. codim Vn B = bi for some i}, n PA = {dim A ∩ A⊥,V | A, A0 ⊂ Vn , n ≥ N, 0 dim A = ai , dim A0 = a j for some i < j}, n PB = {dim B ∩ B⊥,V | B, B0 ⊂ Vn , n ≥ N, 0 codim Vn B = bi , codim Vn B0 = b j for some i < j}, PAB = {dim A ∩ B⊥,Vn | A, B ⊂ Vn , n ≥ N, dim A = ai , codim Vn B = b j for some i, j}. The finiteness of SA and PA is obvious. In particular, this implies that the number of G0 -orbits on Fℓ(A , E) is finite. Applying the map U 7→ U # described above, we see that the number of G0 -orbits on Fℓ(B, E) is finite. Consequently, the sets SB and PB are finite. Finally, since ωn = ω |Vn is nondegenerate for each n, we see that if B ⊂ Vn and codim Vn B = bi for some i, then dim B⊥,Vn = codim Vn B = bi . Hence PAB is finite. Thus, if F is of finite type then the number of G0 -orbits on Fℓ(F, E) is finite. On the other hand, suppose that F is not of finite type. If there is a space F ∈ F with dim F = codim V F = ∞, then we are done, because the map X → Gr(F, E) : G 7→ the subspace in G corresponding to F is a G-equivariant epimorphism of ind-varieties, and the number of G0 -orbits on the ind-grassmannian Gr(F, E) is infinite by the above. If all F ∈ F are of finite dimension or finite codimension, there exist subspaces Fn ∈ F of arbitrarily large dimension or arbitrarily large codimension. In the former case the statement follows from the fact that the number of possible signatures of such spaces tends to infinity, and in the latter case the statement gets reduced to the former one via the map U 7→ U # . C ASE G0 = SU(p, ∞), 0 < p < ∞. First suppose that F is finite, i.e., |F| = N < ∞. Given n ≥ 1, denote Sn = {s(A) | A ⊂ Vn } and Pn = {dimA ∩ B⊥,Vn | A ⊂ B ⊂ Vn }. Let s(A) = (a, b, c) for some subspace A of Vn . Then, clearly, a ≤ p and c ≤ p, hence |Sn | ≤ p2 . On the other hand, if A ⊂ B are subspaces of Vn then A⊥,Vn ⊃ B⊥,Vn , so A ∩ B⊥,Vn ⊂ A ∩ A⊥,Vn . But dim A ∩ A⊥,Vn = c ≤ p. Thus |P| ≤ p. Now [Hu, Theorem 6.2] shows that the number of G0n -orbits on Xn is less or equal to N|Sn |N 2 |Pn | ≤ N 3 p3 . Hence, by Theorem 3.1, the number of G0 -orbits on X is finite. Now suppose that F is infinite. In this case, given m ≥ 1, there exists n such that the length of each flag from Xn is not less than m, the positive index of ω |Vn (i.e., the dimension of a maximal positive definite subspace of Vn ) equals p, and codim Vn Fm ≥ p, where Fn = {F1 ⊂ . . . ⊂ Fm ⊂ . . . ⊂ Vn }. It is easy to check that the number of G0n -orbits on Xn is not less than m. Consequently, by Theorem 3.1, the number of G0 -orbits on X is not less than m. The proof for SU(p, ∞), p > 0, is complete. Real group orbits on flag ind-varieties of SL(∞, C) 15 C ASE G0 = SU(0, ∞). Evident. C ASE G0 = SL(∞, R). First, let X = Gr(F,V ) for a subspace F ⊂ V compatible with E. If dim F = k < ∞, then X consists of all k-dimensional subspaces of V . We claim that the number of G0 -orbits on X equals k + 1. Indeed, pick A, B ∈ X and n ≥ k + 1 such that A, B ∈ ιn (Xn ) (recall that dimVn = 2n − 1). Clearly, if A and B belong to the same G0 -orbit, then dim A ∩ τ (A) = dim B ∩ τ (B). (4) Since n ≥ k + 1 and Vn is τ -stable, dim A ∩ τ (A) can be an arbitrary integer number from 0 to k, hence the number of G0 -orbits on X is at least k + 1. On the other hand, suppose that (4) is satisfied. Let A′ , B′ be complex subspaces of A, B respectively such that A = A′ ⊕ (A ∩ τ (A)) and B = B′ ⊕ (B ∩ τ (B)). Clearly, A′ ∩ τ (A′ ) = B′ ∩ τ (B′ ) = 0. Furthermore, it is easy to see that A + τ (A) = (A ∩ τ (A)) ⊕ (A′ ⊕ τ (A′ )), B + τ (B) = (B ∩ τ (B)) ⊕ (B′ ⊕ τ (B′ )). For simplicity, set Aτ = A + τ (A), A′τ = A′ ⊕ τ (A′ ), Aτ = A ∩ τ (A), and define Bτ , B′τ , Bτ similarly. Then Aτ = Aτ ⊕ Aτ′ , Bτ = Bτ ⊕ Bτ′ . Note that all these subspaces are defined over R. By [HS, Lemma 2.1], the SL(A′τ , R)-orbit of A′ is open in the corresponding grassmannian. Furthermore, there are two open SL(A′τ , R)-orbits on this grassmannian, and their union is a single GL(A′τ , R)-orbit. Hence there exists an operator ψ : Aτ → Bτ which is defined over R and maps Aτ′ , A′ , Aτ to B′τ , B′ , Bτ respectively. Since Aτ and Bτ are defined over R (i.e., are τ -invariant), there exist τ -invariant complements A0 , B0 of Aτ , Bτ in Vn . Thus one can extend ψ to an operator ν ∈ GL(Vn , R) such that ν (A) = B. Finally, since dimVn is odd, we can scale ν to obtain an operator from SL(Vn , R) which maps A to B, as required. At the contrary, assume that dim F = ∞. As it was shown above, given m ≥ n, two finite-dimensional spaces A, B ∈ Vn belong to the same G0m -orbit if and only if dim A ∩ τ (A) = dim B ∩ τ (B), so the number of G0m -orbits on the grassmannian of kn -subspaces of Vn equals kn + 1. But we have limn→∞ kn = ∞, so the number of G0 -orbits on X is infinite by Theorem 3.1. Now, consider the general case X = Fℓ(F, E). We claim that, given a type d = (d1 , . . . , dr ), there exists a number u(d) such that the number of G0n -orbits on the flag variety Fℓ(d,Vn ) is less or equal than u(d), i.e., this upper bound depends only on d, but not on the dimension of Vn . To prove this, denote by Kn = SO(Vn ) the subgroup of Gn preserving the bilinear form ∑ i=1 2n−1 2n−1 2n−1 βn (x, y) = xi yi , x = ∑ i=1 xi ei , y = ∑ yi ∈ Vn . i=1 By Matsuki duality [BL], there exists a one-to-one correspondence between the set of Kn -orbits and the set of G0n -orbits on Fℓ(d,Vn ). Hence our claim follows imme- 16 Mikhail V. Ignatyev, Ivan Penkov, and Joseph A. Wolf diately from (3), because [Hu, Theorem 6.2] holds for nondegenerate symmetric bilinear forms. Finally, suppose that F is of finite type. Let A , B, N be as for SU(∞, ∞). Note that the form βn is nondegenerate, hence the βn -orthogonal complement to a subspace B ⊂ Vn is of dimension codim Vn B. Arguing as for SU(∞, ∞) and applying our remark about Matsuki duality, we conclude that there exists a number u(F) such that the number of G0n -orbits on Xn is less or equal to u(F) for every n ≥ N. It follows from Theorem 3.1 that the total number of G0 -orbits on X is also less or equal to u(F). Finally, if F is not of finite type, then, as in the case of SU(∞, ∞), one can use G-equivariant projections from X onto ind-grassmannians to show that the number of G0 -orbits on the ind-variety X is infinite. The proof for G0 = SL(∞, R) is complete. C ASE G0 = SL(∞, H). Denote by κn an antisymmetric bilinear form on Vn defined by κn (e2i−1 , e2i ) = 1, κn (e2i , e2i−1 ) = −1, κn (ei , e j ) = 0 for |i − j| > 1. Let Kn be the subgroup of Gn preserving this form. Then Kn ∩ G0n is a maximal compact subgroup of G0n (see, e.g., [FHW]), so, by duality, given d, there exists a bijection between the set of Kn -orbits and the set of G0n -orbits on the flag variety Fℓ(d,Vn ). Since Kn is isomorphic to Sp2n (C), we can argue as for SL(∞, R) to complete the proof.  Example 4.2. Let X = Gr(k,V ) for k < ∞. Then   (p + 1)(p + 2)/2 for G0 = SU(p, ∞), p ≤ k,    0   (k + 1)(k + 2)/2 for G = SU(p, ∞), k ≤ p, |X/G0 | = (k + 1)(k + 2)/2 for G0 = SU(∞, ∞),    k+1 for G0 = SL(∞, R),    [k/2] + 1 for G0 = SL(∞, H). For SU(p, ∞) and SU(∞, ∞), this follows from the formula for the number of SU(p, n − p)-orbits on a finite-dimensional grassmannian, see Subsection 2.1. For SL(∞, R), this was proved in Proposition 4.1; the proof for SL(∞, H) is similar to the case of SL(∞, R). As a corollary of Theorem 3.1, we describe the degeneracy order on the set X/G0 of G0 -orbits on an arbitrary ind-variety X = Fℓ(F, E) of finite type. By definition, ′ Ω ≤ Ω ′ ⇐⇒ Ω ⊆ Ω . We define the partial order on the set Xn /G0n of G0n -orbits on Xn in a similar way. Corollary 4.3. Suppose the number of G0 -orbits on X = Fℓ(F, E) is finite. Then there exists N such that X/G0 is isomorphic as partially ordered set to Xn /G0n for each n ≥ N. P ROOF. Given a G0 -orbit Ω on X, there exists n such that Ω ∩ ιn (Xn ) is nonempty. Since there are finitely many G0 -orbits on X, there exists N such that Ω ∩ ιN (XN ) is Real group orbits on flag ind-varieties of SL(∞, C) 17 nonempty for each orbit Ω . By Theorem 3.1, given n ≥ N and a G0 -orbit Ω on X, there exists a unique G0n -orbit Ωn on Xn such that ιn−1 (Ω ∩ ιn (Xn )) = Ωn . Hence, the map αn : X/G0 → Xn /G0n , Ω 7→ Ωn is well defined for each n ≥ N. It is clear that this map is bijective. It remains to note that, by the definition of the topology on X, a G0 -orbit Ω is contained in the closure of a G0 -orbit Ω ′ if and only if Ωn is contained in the closure of Ωn′ for all n ≥ N. Thus, αn is in fact an isomorphism of the partially ordered sets X/G0 and Xn /G0n for each n ≥ N.  5 Open and closed orbits In this section we provide necessary and sufficient conditions for a given G0 -orbit on X = Fℓ(F, E) to be open or closed. We also prove that X has both an open and a closed orbit if and only if the number of orbits is finite. First, consider the case of open orbits. Pick any n. Recall [HW1], [W2] that the G0n -obit of a flag A = {A1 ⊂ Ak ⊂ . . . ⊂ Ak } ∈ Xn is open if and only if for G0 = SU(p, ∞) or SU(∞, ∞): all Ai ’s are nondegenerate with respect to ω ; for G0 = SL(∞, R): for all i, j, dim Ai ∩ τ (A j ) is minimal, i.e., equals max{dim Ai + dimA j − dimVn , 0}; for G0 = SL(∞, H): for all i, j, dim Ai ∩ J(A j ) is minimal in the above sense. Note that, for any two generalized flags F1 and F2 in X, there is a canonical identification of F1 and F2 as linearly ordered sets. For a space F ∈ F1 , we call the image of F under this identification the space in F2 corresponding to F. Fix an antilinear operator µ on V . A point G in X = Fℓ(F, E) is in general e for all position with respect to µ if F ∩ µ (H) does not properly contain Fe ∩ µ (H) e e e e F, H ∈ G and all G ∈ X, where F, H are the spaces in G corresponding to F, H respectively. A similar definition can be given for flags in Xn . Note that, for G0 = SL(∞, R) or SL(∞, H), the G0n -orbit of A ∈ Xn is open if and only if A is in general position with respect to τ or J respectively. With the finite-dimensional case in mind, we give the following Definition 5.1. A generalized flag G is nondegenerate if for G0 = SU(p, ∞) or SU(∞, ∞): each F ∈ G is nondegenerate with respect to ω ; for G0 = SL(∞, R) or SL(∞, H) : G is in general position with respect to τ or J respectively. 18 Mikhail V. Ignatyev, Ivan Penkov, and Joseph A. Wolf Remark 5.2. A generalized flag being nondegenerate with respect to ω can be thought of as being “in general position with respect to ω ”. Therefore, all conditions in Definition 5.1 are clearly analogous. Proposition 5.3. The G0 -orbit Ω of G ∈ X is open if and only if G is nondegenerate. P ROOF. By the definition of the topology on X, Ω is open if and only if Ωn = ιn−1 (Ω ∩ ιn (Xn )) is open for each n. First, suppose G0 = SU(p, ∞) or SU(∞, ∞). To prove the claim in this case, it suffices to show that A ∈ G is nondegenerate with respect to ω if and only if ω |A∩Vn is nondegenerate for all n for which mn ≥ mG . This is straightforward. Indeed, if A is degenerate, then there exists v ∈ A such that ω (v, w) = 0 for all w ∈ A. Let v ∈ Vn0 for some n0 with mn0 ≥ mG . Then ω |A∩Vn is degenerate. On the other hand, 0 if v ∈ A ∩ Vn is orthogonal to all w ∈ A ∩ Vn for some n such that mn ≥ mG , then v is orthogonal to all w ∈ A because em is orthogonal to Vn for em ∈ / Vn . The result follows. Second, consider the case G0 = SL(∞, R). Suppose Ω is open, so Ωn is open for each n satisfying mn ≥ mG . Assume G ∈ X is not nondegenerate. Then there exist e Be are the subspaces in e ∩ τ (B) e ( A ∩ τ (B), where A, Ge ∈ X and A, B ∈ G such that A e τ (B)), e and n be such Ge corresponding to A, B respectively. Let v ∈ (A ∩ τ (B)) \ (A∩ e that v ∈ Vn . Since Vn is τ -invariant, we have v ∈ (An ∩ τ (Bn )) \ (An ∩ τ (Ben )) where en = A e ∩ Vn , Ben = Be ∩ Vn . This means that A en ∩ τ (Ben ) is An = A ∩ Vn, Bn = B ∩ Vn, A properly contained in An ∩ τ (Bn ). Hence, Gn is not in general position with respect to τ |Vn , which contradicts the condition that Ωn is open. Now, assume that Ωn is not open for some n with mn ≥ mG . This means that there exist An , Bn ∈ Gn = ιn−1 (G ) and Gen ∈ Xn so that An ∩ τ (Bn ) properly conen ∩ τ (Ben ), where A en and Ben are the respective subspaces in Gen corresponding tains A to An and Bn . Since τ (en+1 ) = en+1 , the space An+1 ∩ τ (Bn+1 ) properly contains en+1 , Ben+1 are the respective images of An , Bn , en+1 ∩ τ (Ben+1 ), where An+1 , Bn+1 , A A e e An , Bn under the embedding Xn ֒→ Xn+1 . Repeating this procedure, we see that G is not nondegenerate. The result follows. The case G0 = SL(∞, H) can be considered similarly.  We say that two generalized flags have the same type if there is an automorphism of V transforming one into the other. Clearly, two E-commensurable generalized flags always have the same type. On the other hand, it is clearly not true that two e e generalized flags having the same type are E-commensurable for some basis E. It turns out that, for G0 = SU(p, ∞) and SU(∞, ∞), the requirement for the existence of an open orbit on an ind-variety of the form Fℓ(F, E) imposes no restriction on the type of the flag F. More precisely, we have Corollary 5.4. If G0 = SU(p, ∞), 0 ≤ p < ∞, then X always has an G0 -open e orbit. If G0 = SU(∞, ∞), then there exist a basis Ee of V and a generalized flag F 0 e e e e such that F and F are of the same type and X = Fℓ(F, E) has an open G -orbit. P ROOF. For SU(p, ∞), let n ≥ mF be a positive integer such that the positive index of ω |Vn equals p. Let Gn ∈ Xb be a flag in Vn consisting of nondegenerate Real group orbits on flag ind-varieties of SL(∞, C) 19 subspaces (i.e., the G0n -orbit of Gn is open in Xn ). Denote by g a linear operator from Gn such that g(Fn ) = Gn , where Fn = ιn−1 (F) ∈ Xn . Then, clearly, g(F) belongs to X and is nondegenerate. Therefore the G0 -orbit of g(F) on X is open. Now consider the case G0 = SU(∞, ∞). Let Ee be an ω -orthogonal basis of V . Fix e the e This bijection defines an automorphism V → V . Denote by F a bijection E → E. generalized flag consisting of the images of subspaces from F under this isomore and F are of the same type, and each space in F e is nondegenerate as phism. Then F 0 e e e it is spanned by a subset of E. Thus the G -orbit of F on X is open.  e E) e having an open Remark 5.5. Of course, in general an ind-variety Xe = Fℓ(F, SU(∞, ∞)-orbit does not equal a given X = Fℓ(F, E). The situation is different for G0 = SL(∞, R). While an ind-grassmannian Gr(F, E) has an open orbit if and only if either dim F < ∞ or codim V F < ∞, an ind-variety e E), e has the same type as the flag F from Exame where F of the form Xe = Fℓ(F, e) = ee for ple 2.4 (ii), cannot have an open orbit as long as the basis Ee satisfies τ (e b e b b e all ee ∈ E. Indeed, suppose F = {{0} = F0 ⊂ F1 ⊂ . . .} ∈ X. As we pointed out in Example 2.4 (ii), there exists N such that Fbn = Fen = he e1 , . . . , een iC for n ≥ N. Pick n e and F b are compate Fb is an integer such that F so that mn ≥ max{2N, m e Fb }, where m bn = ι −1 (F) b ∈ Xen ible with respect to bases containing {e ei , i ≥ m e Fb }. Then the flag F n b n is not in general posicontains the subspace FbN which is defined over R. Thus, F 0 b e tion with respect to τ |Vn , so the Gn -orbit of Fn in Xn is not open. Consequently, the b in Xe is not open. G0 -orbit of F e E) e is a generalized flag having the same type as the e where F Let now Xe = Fℓ(F, generalized flag F from Example 2.4 (iii). Recall that F = {{0} = F0 ⊂ F1 ⊂ F2 ⊂ . . . ⊂ F−2 ⊂ F−1 ⊂ V }, where Fi = he1 , e3 , . . . , e2i−1 iC , F−i = h{e j , j odd} ∪ {e2 j , j > i}iC for i ≥ 1. We b is E-commensurable e claim that Xe also cannot have an open orbit. Indeed, assume F e Then F b is compatible with a basis Eb of V such that Eb \ Ee is finite. This to F. b with ee ∈ F. means that there exists ee ∈ Ee and a finite-dimensional subspace F ∈ F Now, pick n so that F ⊂ Vn and mn ≥ max{2 dim F, m e Fb }. Then F ∩ τ (F) 6= 0, so b ∈ Xn is not in general position with respect to τ | . b n = ι −1 (F) F n Vn Finally, let G0 = SL(∞, H). In this case, clearly, an ind-grassmannian Gr(F, E) may or may not have an open orbit. A similar argument as for SL(∞, R) shows that if F is as in Example 2.4 (ii), then Xe cannot have an open orbit. Surprisingly, for G0 = SL(∞, H) and X as in Example 2.4 (iii), Xe may have an open orbit. Consider first the case of X = Fℓ(F, E) itself. It it easy to check that if dimVn = n then Fn is in general position with respect to J|Vn for each n, so the orbit of F is open. On e and F have the same type and each 2n-dimensional subspace the other hand, if F e in F is spanned by the vectors ee1 , ee2 , ee5 , ee6 , . . . , ee4n−3 , ee4n−2 , then Xe does not e have an open orbit because each generalized flag E-commensurable to Fe contains a finite-dimensional subspace F such that F ∩ J(F) 6= {0}. 20 Mikhail V. Ignatyev, Ivan Penkov, and Joseph A. Wolf We now turn our attention to closed orbits. The conditions for an orbit to be closed are based on the same idea for each of the real forms, but (as was the case for open orbits) the details differ. Suppose G0 = SU(∞, ∞) or SU(p, ∞). We call a generalized flag G in X pseudoe ⊥,V for all F, H ∈ G and isotropic if F ∩ H ⊥,V is not properly contained in Fe ∩ H e H e are the subspaces in Ge corresponding to F, H respectively. all Ge ∈ X, where F, A similar definition can be given for flags in Xn . An isotropic generalized flag, as defined in [DP1], is always pseudo-isotropic, but the converse does not hold. In the particular case when the generalized flag G is of the form {{0} ⊂ F ⊂ V }, G is pseudo-isotropic if and only if the kernel of the form ω |F is maximal over all E-commensurable flags of the form {{0} ⊂ Fe ⊂ V }. Next, suppose G0 = SL(∞, R). A generalized flag G in X is real if τ (F) = F for all F ∈ G . This condition turns out to be equivalent to the following condition: e for all F, H ∈ G and all Ge ∈ X, F ∩ τ (H) is not properly contained in Fe ∩ τ (H) e e e where F, H are the subspaces in G corresponding to F, H respectively. Finally, suppose G0 = SL(∞, H). We call a generalized flag G in X pseudoe for all F, H ∈ G and quaternionic if F ∩ J(H) is not properly contained in Fe ∩ J(H) e H e are the subspaces in Ge corresponding to F, H respectively. all Ge ∈ X, where F, If G is quaternionic, i.e., if J(F) = F for each F ∈ G , then G is clearly pseudoquaternionic, but the converse does not hold. If the generalized flag G is of the form {{0} ⊂ F ⊂ V }, then G is pseudo-quaternionic if and only if codim F (F ∩J(F)) ≤ 1. Proposition 5.6. The G0 -orbit Ω of G ∈ X is closed if and only if G is pseudo-isotropic for G0 = SU(∞, ∞) and SU(p, ∞); G is real for G0 = SL(∞, R); G is pseudo-quaternionic for G0 = SL(∞, H). P ROOF. First consider the finite-dimensional case, where there is a unique closed G0n -orbit on Xn (see Theorem 2.1). For all real forms the conditions of the proposition applied to finite-dimensional flags in Vn are easily checked to be closed conditions on points of Xn . Therefore, the G0n -orbit of a flag in Vn is closed if and only if this flag satisfies the conditions of the proposition at the finite level. Let G0 = SU(∞, ∞) or SU(p, ∞). Suppose Ω is closed, so Ωn is closed for each n satisfying mn ≥ mG . Assume G is not pseudo-isotropic. Then there exist Ge ∈ X e ∩ Be⊥,V ) A ∩ B⊥,V , where A, e Be are the subspaces in Ge and A, B ∈ G such that A ⊥,V e e corresponding to A, B respectively. Let v ∈ (A ∩ B ) \ (A ∩ B⊥,V ), and n be such n n en ∩ Be⊥,V that v ∈ Vn and mn ≥ mG . Then v ∈ (A ) \ (An ∩ B⊥,V ), where An = A ∩Vn , n n n en = A e ∩Vn , Ben = Be ∩Vn , because B⊥,V ∩Vn = B⊥,V Bn = B ∩Vn , A . This means that n ⊥,Vn n e e An ∩ B⊥,V is properly contained in A ∩ B . Hence G is not pseudo-isotropic, n n n n which contradicts the condition that Ωn is closed. Now, assume that Ωn is not closed for some n with mn ≥ mG . This means that n there exist An , Bn ∈ Gn = ιn−1 (G ) and Gen ∈ Xn such that An ∩ B⊥,V is properly conn ⊥,Vn e e e e e tained in An ∩ Bn , where An , Bn are the subspaces in Gn corresponding to An , Bn Real group orbits on flag ind-varieties of SL(∞, C) 21 ⊥,V respectively. Since each e ∈ En+1 \ En is orthogonal to Vn , An+1 ∩ Bn+1n+1 is properly en+1 ∩ Be⊥,Vn+1 , where An+1 , Bn+1 , A en+1 , Ben+1 are the respective imcontained in A n+1 en , Ben under the embedding Xn ֒→ Xn+1 . Repeating this procedure, ages of An , Bn , A we see that G is not pseudo-isotropic. The result follows. Let G0 = SL(∞, R). As above, given n, denote Gn = ιn−1 (G ). Note that, given F ∈ G , τ (F) = F if and only if Fn is defined over R, i.e., τ (Fn ) = Fn where Fn = F ∩Vn , because Vn is τ -invariant. The G0n -orbit Ωn of Gn is closed if and only if each subspace in Gn is defined over R. Hence if τ (F) = F for all F ∈ G , then Ωn is closed for each n (so Ω is closed), and vice versa. The proof for G0 = SL(∞, H) is similar to the case of SU(∞, ∞) and is based on the following facts: if A is a subspace of V , then J(A) ∩Vn = J(A ∩Vn ) for all n; the subspace hEn+1 \ En iC is J-invariant for all n.  Corollary 5.7. If G0 = SL(∞, R), then X = Fℓ(F, E) always has a closed orbit. P ROOF. The G0 -orbit of the generalized flag F is closed because τ (e) = e for all basic vectors e ∈ E.  If G0 = SU(p, ∞) for 0 ≤ p < ∞, then, for some choice of F, X = Fℓ(F, E) clearly may have a closed orbit. On the other hand, assume that F is as in Example 2.4 (ii), b ∈ X, then then there exists N such that and E is an orthogonal basis for ω . If F Fbn = Fn (and so Fbn is nondegenerate) for n ≥ N. But there obviously exists H ∈ X b is not pseudo-isotropic. Thus, X does not contain a such that HN is degenerate, so F closed orbit. Let G0 = SU(∞, ∞). Obviously, the ind-grassmannian Gr(F, E) may have or may e E), e is a generalized flag having the e where F not have a closed orbit. If Xe = Fℓ(F, same type as the generalized flag F from Example 2.4 (ii) and Ee satisfies all reb ∈ X, e then quired conditions, then Xe does not have a closed orbit. Indeed, assume F b b Fn contains Vk for certain n and k. The form ω |Vk is nondegenerate, hence Fn is not isotropic. There exists an isotropic subspace I of V of dimension n = dim Fbn conb 0 ∈ Xe such that I is the taining Fbn ∩ Fbn⊥,V , and it is easy to see that there exists F b b subspace of F0 corresponding to Fbn . Thus, F is not pseudo-isotropic. Now, suppose F is as in Example 2.4 (iii). Here Xe may or may have not a closed b ∈ Xe orbit. For example, assume that Ee is an ω -orthogonal basis of V . Then each F contains a nonisotropic finite-dimensional subspace, and, arguing as in the previb is not pseudo-isotropic. On the other hand, suppose ous paragraph, we see that F ′ ′ that e2i−1 = e2i−1 + e2i and e2i = e′2i−1 − e′2i for all i, where {e′1 , e′2 , . . .} is an ω orthogonal basis with ω (e′2i−1 , e′2i−1 ) = −ω (e2i , e2i ) = 1. In this case, one can easily check that F is pseudo-isotropic, so its G0 -orbit in X is closed. Finally, let G0 = SL(∞, H). Here, in all three cases (i), (ii), (iii) of Example 2.4, e E) e having the same type as F, then Xe may e for a generalized flag F if Xe = Fℓ(F, or may not have a closed orbit. Consider, for instance, case (ii). The flag F itself is pseudo-quaternionic, so its G0 -orbit in X is closed. On the other hand, if each e is spanned by {ei , i ≤ 4n} ∪ {e4n+1 , e4n+3 }, (4n + 2)-dimensional subspace in F e then X does not have a closed orbit. 22 Mikhail V. Ignatyev, Ivan Penkov, and Joseph A. Wolf Combining our results on the existence of open and closed orbits, we now obtain the following corollary. Corollary 5.8. For a given real form G0 of G = SL(∞, C), G0 6= SU(p, ∞), 0 < p < ∞, an ind-variety of generalized flags X = Fℓ(F, E) has both an open and a closed G0 -orbits if, and only if, there are only finitely many G0 -orbits on X. P ROOF. If X has finitely many G0 -orbits, then the existence of an open orbit is obvious, and the existence of a closed orbit follows immediately from Corollary 4.3. Assume that X has both an open and a closed G0 -orbit. Let 0 G = SU(∞, ∞). Fix a nondegenerate generalized flag H ∈ X (lying on an open G0 orbit). Suppose that there exists a subspace F ∈ H satisfying dim F = codim V F = ∞. Since X has a closed G0 -orbit, there exists a pseudo-isotropic generalized flag e ∈ X. Let Fe be the subspace in H e corresponding to F. Since H and H e are EH e ⊕ B, where A, commensurable to F, there exists n such that F = A ⊕ B and Fe = A e are subspaces of Vn and B is the span of a certain infinite subset of E \ En ; in A particular, B is a subspace of V n = hE \ En iC . The restriction of ω to B is nondegenerate, because Vn and V n are orthogonal. e⊥,Vn ⊕ B⊥,V n , hence This implies that B⊥,V n ∩ B = {0}. But Fe⊥,V = A e ∩ Ae⊥,Vn . Clearly, if B 6= V n , then B⊥,V n 6= {0}. In this case, there exists Fe ∩ Fe⊥,V = A b ∈X v ∈ V n \ B contained in Fe⊥,V , and one can easily construct a generalized flag H ⊥,V ⊥,V b corresponding to F, e such that Fe ∩ Fe ( Fb ∩ Fb , where Fb is the subspace in H a contradiction. Thus, B = V n , but this contradicts the condition codim V Fe = ∞. We conclude that H = A ∪ B, where each subspace in A (resp., in B) is of finite dimension (resp., of finite codimension). Assume that F is not finite, then at least one of the generalized flags A and B is infinite. Suppose A is infinite. (The case when B is infinite can be considered using the map U 7→ U # .) Let n be such e are compatible with bases containing E \ En . Let F be a subspace in that H and H A such that F does not belong to Vn . Then, arguing as in the previous paragraph, e cannot be pseudo-isotropic, a contradiction. one can show that H 0 Now, let G = SL(∞, R). Suppose that H ∈ X is in general position with respect e ∈ X is real. As above, pick n so that H and H e are compatible with bases to τ , and H of V containing E \ En . Suppose for a moment that there exists a subspace F ∈ H such that F 6⊂ Vn , then F = A ⊕ B, where A is a subspace of Vn , and B is a nonzero subspace of V n spanned by a subset of E \ En . Similarly, the corresponding subspace e has the form Fe = A e ⊕ B, where τ (A) e =A e and τ (B) = B. Suppose also that Fe ∈ H B 6= V n , then there exist e ∈ E ∩ B and e′ ∈ (E \ En ) \ B. Let B′ ⊂ V n be spanned by b ∈ X such that the ((E ∩ B) \ {e}) ∪ {e + ie′ }. It is easy to check that there exists H ′ b subspace Fb ∈ H corresponding to F has the form A ⊕ B . Thus, F ∩ τ (F) properly b a contradiction. It remains to note that if F is not of finite type, contains Fb ∩ τ (F), then such a subspace F always exists (if necessary, after applying the map U 7→ U # ). Finally, let G0 = SL(∞, H). Suppose that H ∈ X is in general position with ree ∈ X is pseudo-quaternionic. As above, pick n so that H and H e are spect to J, and H compatible with bases of V containing E \ En . Suppose for a moment that there exists a subspace F ∈ H such that F 6⊂ Vn , then F = A⊕ B, where A is a subspace of Vn , and B is a nonzero subspace of V n = hE \ En iC spanned by a subset of E \ En . The Real group orbits on flag ind-varieties of SL(∞, C) 23 e has the form Fe = A⊕ e B, where A e is a subspace of Vn . corresponding subspace Fe ∈ H Suppose also that dim B ≥ 2 and codim V n B ≥ 2. There exist a subspace B′ ⊂ V n and b ∈ X such that the subspace Fb ∈ H b corresponding to F has the form A ⊕ B′ , and H ′ ′ B ∩ J(B ) is either properly contains or is properly contained in B ∩ J(B). Thus, eie is not pseudo-quaternionic, ther H is not in general position with respect to J, or H a contradiction. It remains to note that if F is not of finite type, then such a subspace F always exists (possibly, after applying the map U 7→ U # ).  Acknowledgements The first author was supported in part by the Russian Foundation for Basic Research through grants no. 14–01–97017 and 16–01–00154, by the Dynasty Foundation and by the Ministry of Science and Education of the Russian Federation, project no. 204. A part of this work was done at the Oberwolfach Research Institute for Mathematics (program “Oberwolfach Leibniz Fellows”) and at Jacobs University Bremen, and the first author thanks these institutions for their hospitality. The second and third authors thank Professor V.K. Dobrev for the invitation to speak at the XI International Workshop “Lie Theory and its Applications in Physics” in Varna, 15–21 June 2015. The second author acknowledges continued partial support by the DFG through Priority Program SPP 1388 and grant PE 980/6–1. The third author acknowledges partial support from the Dickson Emeriti Professorship at the University of California and from a Simons Foundation Collaboration Grant for Mathematicians. References [B] A.A. Baranov. Finitary simple Lie algebras. J. Algebra 219 (1999), 299–329. [BLZ] L. Barchini, C. Leslie, R. Zierau. Domains of holomorphy and representations of SL(n, R). Manuscripta Math. 106 (2001), 411–427. [BK] D. Barlet, V. Koziarz. Fonctions holomorphes sur l’espace des cycles: la méthode d’intersection. Math. Research Letters 7 (2000), 537–550. [BL] R.J. Bremigan, J.D. Lorch. Matsuki duality for flag manifolds. Manuscripta Math. 109 (2002), 233–261. [DP1] I. Dimitrov, I. Penkov. Ind-varieties of generalized flags as homogeneous spaces for classical ind-groups. IMRN 2004 (2004), no. 55, 2935–2953. [DP2] I. Dimitrov, I. Penkov. Locally semisimple and maximal subalgebras of the finitary Lie algebras gl(∞), sl(∞), so(∞), and sp(∞). J. Algebra 322 (2009), 2069–2081. [DPW] I. Dimitrov, I. Penkov, J.A. Wolf. A Bott–Borel–Weil theory for direct limits of algebraic groups. Amer. J. Math. 124 (2002), 955–998. [FH] G. Fels, A.T. Huckleberry. Characterization of cycle domains via Kobayashi hyperbolicity. Bull. Soc. Math. de France 133 (2005), 121–144. [FHW] G. Fels, A.T. Huckleberry, J.A. Wolf. Cycle spaces of flag domains: a complex geometric viewpoint. Progr. in Math. 245. Birkhäuser/Springer, Boston, 2005. [FP] L. Fresse, I. Penkov. Schubert decomposition for ind-varieties of generalized flags. Asian J. Math., to appear, see also arXiv: math.RT/1506.08263. [Hu] H. Huang. Some extensions of Witt’s Theorem. Linear and Multilinear Algebra 57 (2009), 321–344. [HS] A.T. Huckleberry, A. Simon. On cycle spaces of flag domains of SLn (R) (Appendix by D. Barlet). J. Reine Angew. Math. 541 (2001), 171–208. [HW1] A.T. Huckleberry, J.A. Wolf. Cycle spaces of real forms of SLn (C). In: Complex geometry. Springer Verlag, Berlin, 2002, p. 111–133. [HW2] A.T. Huckleberry, J.A. Wolf. Injectivity of the double fibration transform for cycle spaces of flag domains. J. Lie Theory 14 (2004), 509–522. 24 Mikhail V. Ignatyev, Ivan Penkov, and Joseph A. Wolf [KS1] B. Krötz, R.J. Stanton. Holomorphic extensions of representations, I, Automorphic functions. Ann. Math. 159 (2004), 1–84. [KS2] B. Krötz, R.J. Stanton. Holomorphic extensions of representations, II, Geometry and harmonic analysis. Geometric and Functional Analysis 15 (2005), 190–245. [OW] B. Ørsted, J.A. Wolf. Geometry of the Borel – de Siebenthal discrete series. J. Lie Theory 20 (2010), 175–212. [PT] I. Penkov, A. Tikhomirov. Linear ind-grassmannians. Pure and Applied Math. Quarterly 10 (2014), 289–323. [RSW] J. Rawnsley, W. Schmid, J.A. Wolf. Singular unitary representations and indefinite harmonic theory. J. Functional Analysis 51 (1983), 1–114. [SW2] W. Schmid, J.A. Wolf. Geometric quantization and derived functor modules for semisimple Lie groups. J. Functional Analysis 90 (1990), 48–112. [WW] R.O. Wells, J.A. Wolf. Poincaré series and automorphic cohomology on flag domains. Ann. Math. 105 (1977), 397–448. [W1] J.A. Wolf. The action of a real semisimple Lie group on a complex flag manifold. I: Orbit structure and holomorphic arc components. Bull. Amer. Math. Soc. 75 (1969), 1121–1237. [W2] J.A. Wolf. Fine structure of Hermitian symmetric spaces. In: W.M. Boothby, G.L. Weiss (eds). Symmetric spaces. Marcel Dekker, New York, 1972, p. 271–357. [W3] J.A. Wolf. The action of a real semisimple group on a complex flag manifold, II. Unitary representations on partially holomorphic cohomology spaces. Memoirs of the American Mathematical Society 138, 1974. [W4] J.A. Wolf. Orbit method and nondegenerate series. Hiroshima Math. J. 4 (1974), 619–628. [W5] J.A. Wolf. Completeness of Poincarè series for automorphic cohomology. Ann. Math. 109 (1979), 545–567. [W6] J.A. Wolf. Admissible representations and the geometry of flag manifolds. Contemp. Math. 154 (1993), 21–45. [WZ] J.A. Wolf, R. Zierau. Holomorphic double fibration transforms. Proceedings of Symposia in pure mathematics 68 (2000), 527–551.
4math.GR
arXiv:1612.03492v1 [math.GR] 11 Dec 2016 Lipschitz 1-connectedness for some solvable Lie groups. David Bruce Cohen February 19, 2018 Abstract A space X is said to be Lipschitz 1-connected if every Lipschitz loop γ : S 1 Ñ X bounds a OpLippγqq-Lipschitz disk f : D2 Ñ X. A Lipschitz 1-connected space admits a quadratic isoperimetric inequality, but it is unknown whether the converse is true. Cornulier and Tessera showed that certain solvable Lie groups have quadratic isoperimetric inequalities, and we extend their result to show that these groups are Lipschitz 1-connected. 1 Introduction. Lipschitz 1-connectedness. Consider a complete, simply connected Riemannian manifold X which is homogeneous in the sense that some Lie group acts on X transitively by isometries. It is well known that in such a manifold, every loop admits a Lipschitz filling (see Proposition 3.5; for a much stronger result see [9, Corollary 1.4]). A classical way to study the large scale geometry of X is by asking how hard it is to fill loops in X. Definition. Let γ : S 1 ÑX be a loop. The filling span of γ denoted Spanpγq, is defined to be inftLippf q|f : D 2 ÑX; f |S 1 “ γu. We say that X is Lipschitz 1-connected if there exists a constant C such that Spanpγq ď C Lippγq for all Lipschitz loops γ : S 1 ÑX. For instance, Euclidean n-dimensional space En is Lipschitz 1-connected because one may “cone off” loops in En : given a loop γ : S 1 ÑX with γp1q “ 0, we may take f preiθ q “ rγpeiθ q to obtain a 1-Lipschitz filling. A similar argument shows that all CAT(0) manifolds are Lipschitz 1-connected. 1 Solvable groups. In this paper, we will be interested in the case where X is some solvable real Lie group G equipped with a left invariant metric. To motivate this, note that Lipschitz 1-connectedness is a QI-invariant (Proposition 3.6), and that every Lie group is quasi isometric to a solvable Lie group. We will further assume that G has the form U ¸ A, where the following conditions hold. • A is abelian Lie group. • U is a closed subgroup of the group of real n ˆ n upper triangular matrices with diagonal entries equal to 1 (for some n). • A and U are contractible. We will now see some examples of groups which are not Lipschitz 1-connected. Groups of Sol type. Fix real numbers t2 ą 1 ą t1 ą 0 and consider the group G of matrices of the form »s fi t1 0 x – 0 ts2 y fl 0 0 1 where s, x, y P R. Note that G decomposes as U ¸ A as above if we take A to be the diagonal matrices of G and U to be the matrices with diagonal entries equal to 1. It is known [5][Theorem 8.1.3] that there exists loops γ in G such that the minimal area of any filling of γ is on the order of exppLippγqq. Hence, G is not Lipschitz 1-connected. Groups of this form are called groups of Sol type. More generally, Cornulier and Tessera have shown that if a group G “ U ¸ A as above surjects onto a group of Sol type, then it has loops of exponentially large area, and hence cannot be Lipschitz 1-connected [4, Theorem 12.C.1]. If G surjects onto a group of Sol type we say that G has the SOL obstruction. Tame groups. On the other hand, if the conjugation action of some a P A contracts U , then G “ U ¸ A will be Lipschitz 1-connected (Proposition 5.2). For a to be a contraction means that there is some compact subset Ω of U such that for any compact subset K of U , some positive power of a conjugates K into Ω. If such a and Ω exist, G is said to be tame. 2 The theorem of Cornulier and Tessera. It is clear that a space which is Lipschitz 1-connected admits a quadratic isoperimetric inequality—i.e., any loop of length ℓ must bound a disk of area Opℓ2 q. Cornulier and Tessera have given a large class of solvable Lie groups admitting quadratic isoperimetric inequalities, and we shall extend their result to show that these groups are Lipschitz 1-connected. Given an action of the abelian group A on a vector space V , let V0 Ă V n v} Ñ0 as nÑ8 for be the subspace consisting of vectors v such that log }a n all a P A. Their theorem [4, Theorem F] states that G “ U ¸ A satisfies a quadratic isoperimetric inequality if the following conditions hold. • pU {rU, U sq0 “ 0. (G is said to be standard solvable if this condition holds.) • G does not surject onto a group of Sol type. • H2 puq0 “ 0, where u is the Lie algebra of U and H2 denotes second Lie algebra homology—see Definition 5.1. • Killpuq0 “ 0, where the killing module Killpuq is the quotient of the symmetric square u d u of u by the A-subrepresentation spanned elements of the form rx, ys d z ´ y d rx, zs. Main Theorem. Our primary objective in this paper is to establish the following theorem, proved as Theorem 6.1, improving Cornulier and Tessera’s result to show Lipschitz 1-connectedness. Theorem 1.1. Let G be a group of the form U ¸ A where U and A are contractible real Lie groups, A is abelian, and U is a real unipotent group (i.e., a closed group of strictly upper triangular real matrices.) If pU {rU, U sq0 , H2 puq0 and Killpuq0 are all trivial and G does not surject onto a group of Sol type, then G is Lipschitz 1-connected. Quadratic isoperimetric inequality versus Lipschitz 1-connectedness. As noted above, if X is Lipschitz 1-connected, then it has a quadratic isoperimetric inequality. It is not known whether the converse is true—that is, there are no known examples where X has a quadratic isoperimetric inequality but is not Lipschitz 1-connected. Recently, Lytchak, Wenger, and Young[8] have shown some results about the existence of Holder fillings in spaces admitting quadratic isoperimetric inequalities. 3 1.1 Organization. This paper is organized as follows. §3 recalls some known results about Lipschitz filling in homogeneous manifolds. §4 develops a combinatorial language for describing fillings in Lie groups. §5 specializes to solvable Lie groups and reviews the theory of tame groups and Abels’s multiamalgam. Finally, we prove our main theorem in §6. 2 Acknowledgments. We wish to thank Robert Young and Yves Cornulier for productive conversations. This work has been supported by NSF award 1148609. 3 Preliminaries. 3.1 Filling. In this section, X will be a complete, simply connected Riemannian manifold admitting a transitive Lie group action by isometries. We will collect several facts about filling loops in X. Everything in this section is both trivial and well known, but it seems easier to write the proofs than to find them in the literature. The key facts we will prove are as follows. • Proposition 3.3 shows that X is Lipschitz 1-connected on a small scale. That is, there is some constant D such that Spanpγq “ OpLippγqq when Lippγq ă D. • Corollary 3.4 shows that all loops in X have Lipschitz fillings. • Proposition 3.5 proves the existence a “filling span function”—meaning that there is a function CpX, Rq such that Spanpγq ă CpX, Lippγqq for all Lipschitz loops γ : S 1 ÑX. • Proposition 3.6 shows that Lipschitz 1-connectedness is a QI-invariant in this setting. 3.2 Templates. Let D 2 be the unit disk, equipped with the Euclidean metric. Purely as a matter of convenience, we will think of D 2 and the unit circle S 1 as subsets of C. We will need some convenient cellular decompositions of D 2 . 4 Figure 1: On the right, a decomposition of the unit disk into Opǫ´2 q triangles uniformly bilipschitz to Dǫ2 as in Proposition 3.1. On the right, a decomposition of D 2 into a central disk together with Opǫ´1 q “sectors” uniformly bilipschitz to Dǫ2 as in Proposition 3.2 Definition. Let Dǫ2 be the Euclidean disk of radius ǫ. Proposition 3.1. There exists a constant C such that for any 0 ă ǫ ă 1 there is a triangulation of D 2 into at most Cǫ´2 triangles which are Cbilipschitz to Dǫ2 . See the left side of Figure 1 for a decomposition of this type. The proof of Proposition 3.1 is left to the reader. Using templates. Proposition 3.1 will help us fill loops in the following way. Suppose that C is a class of loops in X such that Spanpγq “ OpLippγqq for γ P C—typically, C will consist of loops with small Lipschitz constant. Now, given some other loop γ : S 1 ÑX, we may wish to find a OpLippγqqLipschitz filling f : D 2 ÑX of γ. We can often use the following abstract strategy to construct f . • For some sufficiently small ǫ, take a decomposition of D 2 as in Proposition 3.1. For a 2-cell ∆ of this decomposition, let ψ∆ : ∆ÑDǫ2 be a C-bilipschitz map, where C is the universal constant guaranteed by the proposition. • Take f to be γ on BD 2 , and extend f over the 1-skeleton of the decomposition in such a way that Lippf q “ OpLippγqq and the restriction of f to the boundary of each 2-cell represents an element of C. That is, 5 we want f to be such that for every 2-cell ∆, the map γ∆ : S 1 ÑX given by ´1 pǫeiθ q γ∆ : eiθ ÞÑ f |B∆ ˝ ψ∆ satisfies γ∆ P C. • For each 2-cell ∆, observe that Lippγ∆ q “ Opǫ Lippγqq, so there exists a Opǫ Lippγqq-Lipschitz filling f∆ : D 2 ÑX of γ∆ . • Extend f over ∆ with Lipschitz constant OpLippγqq by taking, for each 2-cell ∆, ˆ ˙ 1 f |∆ pzq “ f∆ ψ∆ pzq . ǫ The nontrivial part of this type of argument comes when we try to extend f over the 1-skeleton with the desired properties, so we will typically suppress the other details. Proposition 3.2. There exists a constant C such that, for each 0 ă ǫ ă 1, the unit disk D 2 may be cellularly decomposed into an inner disk of radius 1 ´ ǫ, surrounded by an annular region divided into 2-cells (we call these sectors) with the following properties. • Each sector is bounded by two radial line segments, an arc of BD 2 , and an arc of the boundary of the inner disk. • Sectors are C-bilipschitz to Dǫ2 . • The number of sectors is between 1 Cǫ and C ǫ. See the right side of Figure 1 for a decomposition of this type. The proof of Proposition 3.2 is left to the reader. This proposition will typically used to convert a filling of a loop γ̃ to a filling f of a nearby loop γ, by taking f restricted to the inner disk to be a slightly rescaled filling of γ̃. 3.3 Basic results on filling in homogeneous manifolds. Proposition 3.3. Let X be a simply connected, complete homogeneous Riemannian manifold. There exist constants CpXq and DpXq such that the following hold. • If x, y P X and dpx, yq ď DpXq, then there is a unique geodesic in X connecting x to y. 6 • Suppose γ : S 1 ÑX is such that 0 ă Lippγq ă DpXq. Then Spanpγq ă CpXq Lippγq. Proof. It is clear that there is a uniform upper bound on sectional curvatures of X, since X is homogeneous. Therefore, X is a CAT(κ) space for some κ ě 0 [3][Theorem 1A.6]. This implies [3][Proposition 1.4(1)] that there is some constant Dpκq depending only on κ such that points of X separated by less than Dpκq are connected by a unique geodesic, so taking DpXq ă Dpκq ensures unique geodesics. By the existence of normal coordinates in Riemannian manifolds [7, Proposition 8.2], there exists a bilipschitz map ψ : U ÑV where U is a neighborhood in X and V a neighborhood in RdimpXq . Take D ą 0 small enough that there is some x P U with U Ą BD pxq and ψpBD pXqq Ă V0 Ă V for some convex set V0 . Now let γ : S 1 ÑX be D-Lipschitz with γp1q “ x. Without loss of generality, ψpxq “ 0, and we may fill ψ ˝ γ by coning off– that is, we define a Lippψq Lippγq-Lipschitz filling f0 : D 2 ÑV0 of ψ ˝ γ by letting f0 preiθ q “ rψpγpeiθ qq. If we let f “ ψ ´1 ˝ f0 , then f is a filling of γ and Lippf q ď Lippψ ´1 q Lippψq Lippγq. Taking DpXq ă D and CpXq ą Lippψ ´1 q Lippψq, the result follows. Corollary 3.4. For all Lipschitz maps γ : S 1 ÑX, we have Spanpγq ă 8. Proof. Let f˜ : D 2 ÑX be a (continuous) filling of a Lipschitz γ : S 1 ÑX. We must find a Lipschitz filling f of γ. For ǫ ą 0, let τǫ be the triangulation of D 2 given in Proposition 3.1, and for each 2-cell ∆ of τǫ , let ψ∆ : ∆ Ñ Dǫ2 be the C-bilipschitz map guaranteed by the proposition. Let F pǫq be the largest value of dpf˜pxq, f˜pyqq such that x, y are adjacent vertices of τǫ . If F pǫqÑ0 as ǫÑ0, then Proposition 3.3 lets us produce a Lipschitz filling f of γ as follows. Set f pxq “ f˜pxq for each vertex x of τǫ , where ǫ is small enough that CF pǫq ă DpXq where C is the constant given by Proposition 3.1 and DpXq is the constant given by Proposition 3.3. Set f to be a constant speed geodesic on each edge of τǫ , so that the map S 1 ÑX given by ¯¯ ´ ´ ´1 ǫeiθ eiθ ÞÑ f ψ∆ is DpXq-Lipschitz. By Proposition 3.3, f now admits a Lipschitz extension over 2-cells. On the other hand, if F pǫq does not go to 0 as ǫÑ0, then for every natural number n, we may find points xn , yn P D 2 such that dpxn , yn q ă n1 but dpf˜pxn q, f˜pyn qq ą δ for some fixed δ ą 0. Because D 2 ˆ D 2 is compact, we know that pxn , yn q must subconverge to some point px, xq in the diagonal 7 of D 2 ˆ D 2 . But pf˜pxn q, f˜pyn qq cannot subconverge to pf˜pxq, f˜pxqq because dpf˜pxn q, f˜pyn qq ą δ. This contradicts continuity of f˜. Proposition 3.5. Let X be a simply connected, complete homogeneous Riemannian manifold. For any L ą 0, there exists CpX, Lq ą 0 such that if γ : S 1 ÑX is L-Lipschitz, then Spanpγq ď CpX, Lq. Gromov [6, §5] refers to CpX, Lq as the filling span function of X. Proof. Fix L (all constants from here on will be presumed to depend uncontrollably on L). Let CL denote the L-Lipschitz loops in X with some fixed basepoint x, and equip CL with the uniform metric. By Arzela-Ascoli, CL is compact. Certainly, Span is not continuous on CL , but we will show that it is bounded. Because CL is compact, for every ǫ ą 0, CL may be covered by a finite number of ǫ balls. Hence, it suffices to find a constant C ą 1 such that for γ0 , γ P CL with dpγ, γ0 q ă C1 we have Spanpγq ă C maxt1, Spanpγ0 qu. To do this, let DpXq be as in proposition 3.3 (assuming without loss of generality that DpXq ă 1), and let γ0 , γ P CL with dpγ0 , γq ă DpXq. Let and decompose f0 : D 2 ÑX be a Lipschitz filling of γ0 . Let ǫ “ DpXq L 2 D into an inner disk and sectors as in Proposition 3.2. We will produce 0q a filling f : D 2 ÑX of γ which is Lippf 1´ǫ -Lipschitz on the inner disk and Op1q-Lipschitz on the annular region as desired. Define f |S 1 to be equal to γ. Let R “ 1´ǫ be the radius of the inner disk and define f to be a rescaled copy of f0 on the inner disk—i.e., f preiθ q “ 0q f0 p Rr eiθ q for r ď R. This implies that f is Lippf R -Lipschitz on the inner disk. If x and y are the images under f of the endpoints of a radial segment separating two sectors, then dpx, yq ă DpXq because dpγ, γ0 q ă DpXq. Define f to be a minimal speed geodesic on each of the radial segments separating two sectors, so that f is Op1q-Lipschitz on the boundary of each sector (considering L as fixed). Since sectors are uniformly bilipschitz to Dǫ2 , f admits a Op1q-Lipschitz extension over each sector by Proposition 3.3. 0q We see that f is Op1q-Lipschitz on the annular region and Lippf 1´ǫ -Lipschitz on the inner disk, implying the desired bound for Spanpγq, taking any sufficiently large C. Proposition 3.6. Let X and Y be simply connected, complete, homogeneous Riemannian manifolds, and suppose that X is quasi-isometric to Y . If Y is Lipschitz 1-connected, then so is X. 8 It seems likely that X and Y are bilipschitz if they are quasi-isometric. Proof. Let ψ : XÑY be a quasi isometry, and Ψ : Y ÑX a quasi inverse to ψ. Let γ : S 1 ÑX be an L-Lipschitz loop, where L ą 1 without loss of generality, and let ǫ “ L1 . To obtain a OpLq-Lipschitz filling for γ, we proceed as follows. Using Proposition 3.1, subdivide D 2 into OpL2 q triangles bilipschitz to 2 Dǫ , so that adjacent vertices on the boundary are mapped to within Op1q of each other by ψ ˝ γ. Let γ̃ : S 1 ÑY be a OpLq-Lipschitz loop in Y which agrees with ψ ˝ γ on vertices of our triangulation. By assumption, Y is Lipschitz 1-connected, so γ̃ admits a OpLq-Lipschitz filling f˜ : D 2 ÑY . We wish to convert Ψ ˝ f˜ into a filling f : D2 ÑX of γ. Let f0 : 2 D ÑX be a OpLq-Lipschitz map which agrees with Ψ ˝ f˜ on vertices of our triangulation—such a map exists because we may fill edges with constant speed geodesics and then fill triangles in X by Proposition 3.5, as Ψ ˝ f˜ maps adjacent vertices to within Op1q of each other. This gives us a OpLq-Lipschitz filling of f0 |S 1 . Note that the distance from γ to f0 |S 1 in the uniform metric is Op1q because on f0 |S 1 agrees with Ψ ˝ ψ ˝ γ on vertices. Now we take a new subdivision of D 2 , using Proposition 3.2 to subdivide D 2 into an inner disk surrounded by OpLq sectors which are uniformly bilipschitz to Dǫ2 . We build our filling f of γ as follows. On the inner disk, let f be given by a rescaled copy f0 . On radial segments, take f to be a constant speed geodesic, and fill sectors using Proposition 3.5. 4 Lipschitz moves. We now specialize to the case where X is equal to some simply connected Lie group G equipped with a left-invariant Riemannian metric. Our main goal in this section is to reduce questions about filling loops in G to questions about manipulating words in some compact generating set for G. Notation. Any simply connected Lie group G admits a compact generating set S. The set S ˚ consists of all words s1 s2 . . . sℓ where s1 , . . . , sℓ P S and ℓ P N, together with the empty word ε. The length of a word w P S ˚ will be ´1 denoted ℓpwq. Given w “ s0 . . . sℓ P S ˚ , w´1 denotes the word s´1 ℓ . . . s1 . If w P S ˚ represents the identity element 1G of G, w is said to be a relation. If w, w1 P S ˚ represent the same element of G, we write w “G w1 . The word norm with respect to S will be denoted by | ¨ |S . That is for g P G, we define |g|S to be inftℓpwq : g “G w P S ˚ u. 9 Assumptions. Any time we take a compact generating set S for G, we assume without loss of generality that S is symmetric—meaning s P S ô s´1 P S—and that 1G P S, unless otherwise indicated. It suffices to fill over the unit square. It will be convenient to consider loops as maps r0, 1sÑX rather than S 1 ÑX and fillings as maps from the unit square r0, 1s ˆ r0, 1sÑX rather than D 2 ÑX. Definition. Given β : r0, 1sÑX with βp0q “ βp1q, a filling of β over the unit square is a map f : r0, 1s ˆ r0, 1sÑX with the following properties: • f agrees with β on the bottom edge of the unit square, meaning that f pt, 0q “ βptq for all t P r0, 1s. • f is constant on the set on the other three edges of the unit square, meaning that f px, yq “ βp0q for all px, yq P pr0, 1s ˆ 1q Y p0 ˆ r0, 1sq Y p1 ˆ r0, 1sq. We define Spanpβq to be the infimum of Lippf q as f ranges over Lipschitz fillings of β over the unit square. Similarly, given β, γ : r0, 1sÑX, a homotopy from β to γ is a map r0, 1s ˆ r0, 1sÑX such that f pt, 1q “ γptq, f pt, 0q “ βptq and the restrictions f |0ˆr0,1s and f |1ˆr0,1s are constant. We will now see that it makes no difference whether we consider loops as maps from r0, 1s or S 1 . The key tool is the following lemma. Lemma 4.1. There exists a constant C such that, given loops β : S 1 ÑX and γ : S 1 ÑX such that γ is a reparameterization of β, and given a filling f : D 2 ÑX of γ, we have Spanpβq ď C maxtLippf q, Lippβqu. Proof. An equivalent statement is proved in [10, Lemma 8.13]. Corollary 4.2. There is a universal constant C ą 0 with the following property. Suppose that γ : S 1 ÑX is a Lipschitz loop and β : r0, 1sÑX a Lipschitz path with βptq “ γpe2πit q for all t P r0, 1s. Then Spanpβq ă Spanpγq ă C Spanpβq. C 10 Proof. Let β0 : Bpr0, 1s2 qÑX be equal to β on the bottom edge and βp0q on the other three edges, and fix a bilipschitz map ψ : D 2 Ñr0, 1s ˆ r0, 1s. Observe that γ is a reparameterization of β0 ˝ ψ : S 1 ÑX. If f : D 2 ÑX is a Lipschitz filling of γ, then by Lemma 4.1 there is some OpLippf qq-Lipschitz filling f˜ : D 2 ÑX of β0 ˝ ψ, so f˜ ˝ ψ ´1 is a OpLippf qq-Lipschitz filling of β. We see that Spanpβq “ OpSpanpγqq. The reverse inequality is proved similarly. 4.1 Filling relations. It suffices to fill words. Let S be a compact generating set for G. For each s P S choose a Lipschitz curve γs : r0, 1sÑG connecting 1 to s, such that the following properties hold. • There is some uniform bound on Lippγs q as s ranges over S. • γ1G is constant. • γs p1 ´ tq “ γs´1 ptq for all s P S and t P r0, 1s. Given a word w “ s1 s2 . . . sℓ P S ˚ , let γw : r0, 1sÑG denote the concatenation of the paths γs1 , s1 γs2 , . . . , s1 . . . sℓ´1 γsℓ , reparameterized so that the i i-th of these paths is used on r i´1 ℓ , ℓ s. That is, for 0 ď t ď 1 and i “ 1, . . . ℓ, we have ˙ ˆ i´1`t “ s1 s2 . . . si´1 γsi ptq. γw ℓ Proposition 4.3. Suppose that there exists a constant C such that for every w P S ˚ with w “G 1G , there exists a Cℓpwq-Lipschitz filling of γw over the unit square. Then G is Lipschitz 1-connected. Ť k k Proof. Note that G “ 8 k“1 S , and each S is compact. Hence, by the Baire category theorem, some power S k must contain an open neighborhood, so S 2k contains some open neighborhood of the identity, which in turn contains the r-ball around the identity for some r ą 0. Take K to be a natural number K contains the 1-ball around the identity in G. larger than 2k r , so that S Given a loop γ : r0, 1sÑG, we produce a OpLippγqq-Lipschitz filling f : r0, 1s2 ÑG of γ as follows. Let n “ rLippγqs—by Propositions 3.3 and 3.5 it suffices to only consider γ such that n is“ at least 2. Cellularly decompose ‰ 1 , 1 together with the collection the unit square into the rectangle r0, 1s ˆ n “ i i`1 ‰ “ 1 ‰ of squares n , n ˆ 0, n as i runs from 0 to n ´ 1. Define f to be constant on all the vertical edges. Note that for each i, ` ˘´1 ` i`1 ˘ the element γ ni γ n lies in the 1-ball in G, so it may be represented 11 ` i 1˘ ` i`1 1 ˘ by some wi P S K . On the horizontal edge connecting , to n n n ,n , `i˘ let` f be ˘a copy of γ translated by γ —that is for 0 ď t ď 1, take w i n `i˘ 1 , “ γ γ ptq. Letting w “ w . . . w , observe that f agrees with f i`t wi 1 “ n‰ n n n γw the the bottom of the rectangle r0, 1s ˆ n1 , 1 , so f may be extended over this rectangle with Lippf q “ OpLippγw qq “ Opℓpwqq “ OpLippγqq where the first bound comes from our hypothesis. Finally, f admits a OpLippγqq-Lipschitz extension over each square by Proposition 3.5. Definition. Suppose C is a collection of pairs pv, wq where v, w P S ˚ are words in S. We say that v w for pv, wq P C if there exists some constant C depending only on C with the following property: given pv, wq P C, the map from Bpr0, 1s ˆ r0, 1sq to X which is equal to γv on the bottom edge, γw on the top edge, and constant on the sides admits a Cℓpvq-Lipschitz filling. We now give some basic rules for manipulating fillings. Often, the set C will be inferred from context. Lemma 4.4. The following rules hold in any simply connected Lie group G. • Suppose C Ă S ˚ ˆS ˚ . Then v w for pv, wq P C if and only if vw for pv, wq P C and Lippwq “ OpLippvqq for each pair pv, wq P C. ε • Fix n, and suppose given sets Ci Ă S ˚ ˆ S ˚ for i “ 1 to n. If, for each i “ 1 to n, we have v w for pv, wq P Ci , then v1 . . . vn w1 . . . wn for all pv1 , w1 q P C1 , . . . , pvn , wn q P Cn . • Given C, C 1 Ă S ˚ ˆ S ˚ , if v1 v2 for pv1 , v2 q P C and v2 v3 for 1 pv2 , v3 q P C , then v1 v3 for pairs pv1 , v3 q such that there exists v2 P S ˚ with pv1 , v2 q P C and pv2 , v3 q P C 1 . • ww´1 ε for w P S ˚ . • Let U Ă G be an bounded neighborhood of the identity in G. If D is the collection of relations w “ w1 . . . wℓ P S ˚ such every prefix w1 . . . wi represents an element of U , then w ε for w P D. • G is Lipschitz 1-connected if and only if and v 12 ε for v P S ˚ . Proof. The first item follows immediately from Lemma 4.1. To prove “the second item, subdivide the unit square into rectangles ‰ i of the form i´1 , ˆ r0, 1s for i “ 1, . . . , n. Suppose given pv1 , w1 q P n n C1 , . . . , pvn , wn q P Cn . By hypothesis, there exists a homotopy fi : r0, 1s ˆ r0, 1sÑG from vi to wi with Lippfi q “ OpLippv “ i´1i qq.i ‰ Define a map f : r0, 1s ˆ r0, 1s by putting a rescaled copy of fi in n , n ˆ r0, 1s—that is, for 0 ď t ď 1 and i “ 1, . . . , n, we take ˙ ˆ i´1`t , y “ fi pt, yq. f n Thus Lippf q “ Opmaxtn Lippfi q : i “ 1 . . . nuq “ OpLippvqq because n is fixed. Since f restricted to the top of the unit square is a reparameterization of v1 . . . vn , and f restricted to the bottom of the unit square is a reparameterization of w1 . . . wn , we are done. The proof of the ‰ divide the unit square into two ‰ item is similar: “ “ third rectangles r0, 1s ˆ 0, 21 and r0, 1s ˆ 21 , 1 and put a rescaled copy of the homotopy from v1 to v2 into the bottom rectangle and a rescaled copy of the homotopy from v2 to v3 into the top rectangle to get the desired homotopy v1 to v3 . To prove the fourth item, let w P S ˚ , and let f : r0, 1s ˆ r0, 1s be defined by f pt, sq “ γw p2 maxt0, mintt ´ s, 1 ´ t ´ suuq. The reader may check that f is a Lippγww´1 q-Lipschitz filling of γww´1 . To prove the fifth item, let K be such that S K contains U . Given w P D, let ℓ “ ℓpwq so that we can write w “ s1 . . . sℓ . We will find a Opℓq f of ‰ “ 1 filling , 1 together γw as follows. Subdivide r0, 1sˆr0, 1s into the rectangle r0, 1sˆ ℓ “ i´1 i ‰ “ 1 ‰ , ˆ 0, . Define f to be constant on with the“ squares of the form ℓ ℓ ℓ ‰ r0, 1s ˆ 1ℓ , 1 . For each i, choose wi P“ S K ‰such that wi “G s1 . . . si and take f to be γwi on the vertical edge ℓi ˆ 0, 1ℓ —that is ˆ ˙ i 1´t f , “ γwi ptq ℓ ℓ for 0 ď t ď 1 and i “ 0, . . . , n. We may extend f over each square with Lipschitz constant Opℓq by Proposition 3.5. The sixth item is a consequence of Proposition 4.3. 4.2 Normal form triangles. We now discuss normal forms ω and ω-triangles. Using a technique of Gromov, we shall see that G is Lipschitz 1-connected if ω-triangles are Lipschitz 13 1-connected. Definition. A normal form for a compactly generated group G equipped with compact generating set S is a map ω : GÑS ˚ such that ℓpωpgqq “ Op|g|S q for g P G. If ω is a normal form, then an ω-triangle is a word in S ˚ of the form ωpg1 qωpg2 qωpg3 q where g1 g2 g3 “G 1. Lemma 4.5. Let ω : GÑS ˚ be a normal form. If ∆ ∆, then G is Lipschitz 1-connected. ε for ω-triangles Proof. This is proved in [10, Proposition 8.14]. The proof is sketched in Figure 2. 5 Tame subgroups and the multiamalgam. Assumptions. From here on, we specialize to the case where G “ U ¸ A, where U and A are contractible Lie groups, with A abelian and U a closed group of strictly upper triangular real matrices. Standard solvable groups. Observe that A acts on the abelianization U {rU, U s. Fix a norm on the vector space U {rU, U s. If there is no vector X such that limnÑ8 n1 log }an ¨ X}Ñ0 for all a P A, we say that G is standard solvable. In this section we will be interested in the structure and geometry of standard solvable groups. §5.1 will describe the so-called standard tame subgroups of a standard solvable group. Lemma 5.6 will show that how to find Lipschitz fillings for words which already represent the identity in the free product of the standard tame subgroups. Theorem 5.8—quoted from [4]—will give conditions under which G may be presented as the free product of its standard tame subgroups modulo certain easily understood amalgamation relations. 14 γωpγp 21 qq γωpγp 14 qq γωpγp 12 q´1 q γωpγp 41 q´1 γp 21 qq γωpγp 12 q´1 γp 43 qq γωpγp 43 q´1 q Figure 2: This figure indicates how to fill γ “ γw for an arbitrary relation w P S ˚ given that one knows how to fill ω-triangles. The top edge and all the vertical edges are taken to be constant, and each horizontal edge is understood to be an appropriate translate of its label, so that each rectangle represents an ω-triangle, except the bottom row. The bottom edge is taken to be γw , and there is a row of squares along the bottom which may be filled by Proposition 3.5 5.1 Weights. Let G “ U ¸ A be standard solvable, and let u be the Lie algebra of U , identified as usual with the tangent space of U at 1U , and fix any norm } ¨ } on u. For a P ˇA we denote the conjugation action of a on u by Adpaq, so that dˇ a´1 expptXqa. Observe that HompA, Rq is a vector space. AdpaqX “ dt t“0 Definition. (See [4, §4.B]). For a homomorphism α : AÑ R, define the αweight space uα Ă u to consist of 0 together with all X P u such that for all a P A, 1 lim log } Adpaqn X} “ αpaq. nÑ8 n Define the set of weights W to consist of all α P HompA, Rq for which 15 dim uα ą 0. By a conic subset, we mean the intersection of W with an open, convex cone in HompA, Rq that does not contain 0. Denote the set of all conic subsets by C. For C P À C, let UC denote the closed connected subgroup of U whose Lie algebra is αPC uα , and let GC “ UC ¸ A. These groups GC are referred to as standard tame subgroups of G (see remarks in §5.2). As an exercise, the reader may wish to compute the weights and À weight spaces for a group of Sol type. We have that C is finite, that u “ αPW uα , and that ruα , uβ s Ă uα`β for α, β P W [4, §4.B]. We now define H2 puq and recall the definition of Killpuq so that we will be able to state Theorem 6.1, our main theorem. Ź2 Ź Ź3 uÑu be the maps of AuÑ 2 u and d2 : Definition. Let d3 : modules induced by taking d3 px ^ y ^ zq “ rx, ys ^ z ` ry, zs ^ x ` rz, xs ^ y d2 px ^ yq “ ´rx, ys. Define H2 puq “ kerpd2 q{ imagepd3 q. Define Killpuq to be the quotient of the symmetric square u d u by the subspace spanned by elements of the form rx, ys d z ´ y d rx, zs. H2 puq and ŹKillpuq are A-representations. Observe that the natural Aaction on 3 u descends to an A-action on H2 puq because, by the Jacobi-like identity AdpaqrX, Y s “ rAdpaqX, Y s`rX, AdpaqY s, the subspaces imagepd3 q and kerpd2 q are preserved by the action of A. Similarly, Killpuq is also an A-representation. Recall that, for an A-representation V we define V0 to consist of 0 together with vectors X such that limnÑ8 n1 log }an ¨ X} “ 0 for all a P A. We thus define the subspaces H2 puq0 and Killpuq0 . 5.2 Tame subgroups. Definition. Given a P A, a vacuum subset for a is a compact Ω Ă U such that for every compact K Ă U , there is some n ą 0 with Adpaqn K Ă Ω. We say that G is tame if there exists a P A with a vacuum subset. G is tame if and only if there is some a P A with αpaq ă 0 for all α P W, so GC is tame for C P C [4, Proposition 4.B.5]. We now wish to show that if G is tame, then it is Lipschitz 1-connected. Our starting point is the following. 16 Proposition 5.1. Suppose G is tame, then there is some a P A and a compact generating set S Ă U for U such that AdpaqS 2 Ă S. Proof. By hypothesis, there is some b P A with a vacuum subset Ω. Let S0 be a compact generating set for U . As in the proof of Proposition 4.3, we see that some power of S0 contains an open ball around the identity, hence for some M ą 0, the set S0M contains Ω. As Ω is a vacuum set for b, there exists L such that AdpbqL S02M Ă Ω. Taking a “ bL and S “ S0M , we have that S is a generating set because it contains S0 (because 1 P S0 by our standing assumption that generating sets contain the identity), and AdpaqS 2 “ AdpbqL S02M Ă Ω Ă S as desired. Proposition 5.2. If G “ U ¸ A is tame, then G is Lipschitz 1-connected. Remark. Probably, a tame group G is CAT(0) for some choice of metric, but we do not know how to prove this, so we give a combinatorial proof using Lemma 4.5. Proof. Fix a P A and a compact generating set SU Ă U such that AdpaqSU2 Ă SU as in Proposition 5.1, let SA be a generating set for A with a P SA , and let S “ SU Y SA , so that S is a generating set for G. Note that Adpaqpsq “ s for s P SA , and observe that if ℓ ą rlog2 js ą 0, then ˆ j ˙ ˆ 1 j ˙ ´ ¯ r s r r ss Ă Adpaqℓ SUj Ă Adpaqℓ´1 SU2 Ă Adpaqℓ´2 SU2 2 . . . Ă Adpaqℓ´rlog2 js pSU q Ă SU , because the function f : j ÞÑ r 2j s satisfies f rlog2 js j “ 1 for natural numbers j. In other words, given u P U , there exist k ď rlog2 |u|SU s and s P SU such that u “G ak sa´k . It follows, letting φA : GÑA denote projection, that we may define a normal form ω : GÑS ˚ such that • for any g P G, the word ωpgq is given by ωpφA pgqqωpφA pgq´1 gq, ˚ is a minimal length word representing • for g P A, the word ωpgq P SA g, • and for g P U zt1u, ωpgq is of the form ak sa´k where s P SU and 0 ď k “ Oplog |g|SU q. 17 To check that this is a normal form—i.e., that ℓpωpgqq “ Op|g|S q, note that |φA pgq|S ď |g|S , and |φA pgq´1 g|SU “ Opexp |g|S q, so that |φA pgq´1 pgq|S “ OplogpOpexp |g|S qqq “ Op|g|S q because U is at most exponentially distorted in G [4, Proposition 6.B.2]. It will suffice to show that ∆ ε for ω-triangles ∆ P S ˚ . An ω-triangle ∆ has the form a1 ωpu1 qa2 ωpu2 qa3 ωpu3 q, ˚ with the a and u where for i “ 1, 2, 3, we have ui P U and ai P SA i i satisfying pAdpa3 a2 qu1 qpAdpa3 qu2 qu3 “ 1. To show that ∆ ε, it thus suffices to establish the following two facts. • ωpuqb ˚. bωpb´1 ubq for u P U and b P SA • ωpu1 qωpu2 qωpu3 q ε for u1 , u2 , u3 P U such that u1 u2 u3 “ 1. Lemma 4.4 will be crucial for showing the first fact—in particular, we use the Lemma to provide homotopies between words which stay inside a bounded neighborhood of the identity. ˚, Conjugation. To show that ωpuqb bωpb´1 ubq for u P U and b P SA k ´k note that ωpuq may be written as a sa for some s P SU and k ě 0. Because AdpaqS 2 Ă S, there is some C ě 1 such that, for all a1 P SA , we have AdpaqC Adpa1 qS Ă S. Let K “ Cℓpbq ` k, so that AdpaqK´k Adpb1 qS Ă S ˚ with ℓpb1 q ď ℓpbq, and let s1 , s2 P S be given by for any word b1 P SA 1 K´k s “ Adpaq s and s2 “ b´1 s1 b. We homotope as follows, liberally using Lemma 4.4. ωpuqb “ ak sa´k b aK ak´K saK´k a´K b aK s1 ba´K aK bb´1 s1 ba´K baK s2 a´K bωpb´1 ubq. Filling ω-triangles in U . To show that ωpu1 qωpu2 qωpu3 q ε for u1 , u2 , u3 P U such that u1 u2 u3 “ 1, write ωpui q as aki si a´ki for i “ 1, 2, 3, with ki ě 0 and si P SU . Let K “ k1 ` k2 ` k3 and let s1i “ Adpaki ´K qsi P SU . We homotope as follows. ωpu1 qωpu2 qωpu3 q “ pak1 s1 a´k1 qpak2 s2 a´k2 qpak3 s3 a´k3 q paK ak1 ´K s1 aK´k1 a´K qpaK ak2 ´K s2 aK´k2 a´K qpaK ak3 ´K s3 aK´k3 a´K q paK s11 a´K qpaK s12 a´K qpaK s13 a´K q 18 aK s11 s12 s13 a´K aK a´K ε. 5.3 Filling freely trivial words. We now return to the case where the standard solvable group G “ U ¸ A is not necessarily tame. Recall that the collection of conic subsets C is finite. For C P C, let GC be the tame group UC ¸ A, and let SGC be a compact generating set for this group. Let H “ ˚CPC GC , and let SH Ă H be the union of the SGC . There is a natural map from H to G. Lemma ˚ represents the identity in H, then its image in 5.6 will show that if w P SH G admits a Opℓpwqq-Lipschitz filling. We will need the following auxiliary results first—the reader should probably skip directly to the proof of Lemma 5.6 to understand the point of these propositions. ˚ representing the identity • Proposition 5.3 shows that a word w P SH in H may be reduced to the identity by repeated deletion of subwords ˚ such that rj represents the identity in GCj . rj P SG C j • Proposition 5.5 describes an appropriately Lipschitz rectangular homotopy between words obtained by these deletions. • Proposition 5.4 describes a part of the homotopy given in Proposition 5.5. ˚ such that w “ 1, there exists a Proposition 5.3. Given a word w P SH H ˚ with natural number n ď ℓpwq and, for j “ 0, . . . , n, words aj , rj , bj P SH the following properties. • w “S ˚ a0 r0 b0 . H • an , rn , bn “ ε. ˚ and • For all j “ 0, . . . , n, there is some Cj P C such that rj P SG Cj rj “GCj 1. • aj bj “S ˚ aj`1 rj`1 bj`1 for j “ 0, . . . , n ´ 1. H Proof. Note that each element of SH lies in some GC . If w ‰ ε represents the identity, then by the theory of free products, w has a (nonempty) subword which is comprised of elements of some SGC and represents the identity ˚ in GC . Thus, we may write w “S ˚ a0 r0 b0 where r0 P SG as desired. C0 H Applying this argument recursively, we obtain aj , rj , bj as desired. ˚ Proposition 5.4. Given a natural number ” k andı w P SH , there exists a k Opk ` ℓpwqq Lipschitz map f : r0, 1s ˆ 0, k`ℓpwq ÑG with the following properties. 19 • Along the bottom, f is given by 1k w, meaning f pt, 0q “ γ1k w ptq for 0 ď t ď 1. ´ ¯ k • Along the top, f is given by w1k , meaning f t, k`ℓpwq “ γw1k ptq for 0 ď t ď 1. • f is constant on the sides, so f p0, sq and f p1, sq do not depend on s. Proof. Let γ : R ÑG be given as follows. γptq “ 1G for t ď 0, γptq “ γ1k w ptq for 0 ă t ď 1, and γptq “ γ1k w p1q for t ą 1. Observe that Lippγq “ Opk ` ℓpwqq Then we may take f pt, sq “ γpt ` sq as our desired filling. ˚ , r P S˚ Proposition 5.5. Given a, b P SH GC a relation in GC for some C P C, and any natural number k, let ℓ “ ℓparb1k q and h “ ℓprq ℓ . There exists a Opℓq-Lipschitz map f : r0, 1s ˆ r0, hs ÑG with the following properties. • Along the bottom, f is given by arb1k , meaning f pt, 0q “ γarb1k ptq for t P r0, 1s. • Along the top, f is given by ab1k`ℓprq , meaning f pt, hq “ γab1k`ℓprq ptq for t P r0, 1s. • f is constant on the sides, so f p0, sq and f p1, sq do not depend on s. Proof. (See the right hand side of Figure 3.) Subdivide the rectangle into r0, 1sˆr0, h{2s and r0, 1sˆrh{2, 1s. Define f to be a1ℓprq b1k on r0, 1sˆth{2u— i.e., f pt, h{2q “ γa1ℓprq b1k ptq. First, we extend f over the top rectangle r0, 1s ˆ rh{2, 1s. For   „ „ k ℓpaq ˆ rh{2, 1s Y 1 ´ , 1 ˆ rh{2, 1s pt, sq P 0, ℓ ℓ we have that γa1r b1k ptq “ γab1ℓprq`k ptq, so we can just set f to be constant vertically—i.e., we define f pt, sq “ γab1ℓprq`k ptq for these pt, sq. To extend f to  „ k ℓpaq ,1 ´ ˆ rh{2, 1s, pt, sq P ℓ ℓ 20 we simply apply Proposition 5.4. Thus, we have given a Opℓq-Lipschitz extension of f over the top rectangle. Now we extend over the bottom rectangle r0, 1s ˆ r0, h{2s. For „   „ ℓpaq ℓparq pt, sq P 0, , 1 ˆ r0, h{2s ˆ r0, h{2s Y ℓ ℓ ”define f pt,ısq “ γarb1k ptq. Finally, we apply Proposition 5.2 to extend f over ℓpaq ℓparq ˆ r0, h{2s, since this is equivalent to filling r. ℓ , ℓ Lemma 5.6. Recalling the notation introduced at the start of §5.3, we have ˚ such that w “ 1 w ε (in G) for all w P SH H ˚ be a relation in H and take a sequence of Proof. (See Figure 3.) Let w P SH words aj , rj , bj , j “ 0, . . . , n as in Proposition 5.3. We will define ř a OpℓpwqqLipschitz filling f : r0, 1s ˆ r0, 1sÑG of γw as follows. Let ℓk “ jăk ℓprj q, so that ℓ0 “ 0 and ℓn “ ℓpwq, and subdivide r0, 1s ˆ r0, 1s into rectangles r0, 1s ˆ rℓj , ℓj`1 s for j “ 0, . . . , n ´ 1. Set f pt, ℓj q “ γa ℓj j rj bj 1 ptq, noting that ℓpaj rj bj 1ℓj q “ ℓpwq. Proposition 5.5 now shows that f may be extended over each rectangle r0, 1s ˆ rℓj , ℓj`1 s with Lipschitz constant Opℓpwqq. Distortion. We now see that if G is standard solvable, then elements of U may be expressed much more efficiently in the generators of G than in the generators of U . Proposition 5.7. Suppose G “ U ¸ A is standard solvable, S is a compact generating set for G, and SU is a compact generating set for U . There exists C ą 1 such that if u P U zt1U u, then 1 logp1 ` |u|SU q ď |u|S ď C logp1 ` |u|SU q. C Proof. This follows, with some effort, from [4, Proposition 6.B.2]. 21 1 ℓn rn´1 1k`ℓprq 1ℓn´1 a ... a1 a2 r2 b2 r1 b1 a0 Proposition 5.4 1 ℓ2 1 ℓ1 r0 b a 1r Prop. 5.2 b r b 1k b0 Figure 3: The figure on the left depicts our strategy for filling of the freely trivial word w “ a0 r0 b0 , where the aj , rj , bj are as in Proposition 5.3. The figure on the right depicts the proof of Proposition 5.5 which allows us to fill in each rectangle in the left hand figure. 5.4 The multiamalgam. In this subsection, we will define the multiamalgam Ĝ of a standard solvable group G “ U ¸ A (first introduced by Abels [1]), and quote a key theorem of Cornulier and Tessera, which states that certain conditions under which G – Ĝ—this means that G is put together from its standard tame subgroups in a nice way, which will eventually let us build fillings in G from fillings in standard tame subgroups. In order to state this theorem in the proper generality, we must briefly discuss the theory of unipotent groups. Unipotent groups. For a commutative R-algebra P, and a real unipotent group U (i.e., a closed group of upper triangular real matrices with diagonal entries equal to 1), the theory of algebraic groups allows us to define a group U pPq [2, §1.4]. In particular, if U Ă GLpn; Rq consists of all upper triangular matrices with diagonal entries equal to 1, then U pPq consists of all upper triangular n ˆ n matrices over P with diagonal entries equal to 1—such matrices are certainly invertible, having determinant equal to 1. Suppose P “ RY , so that P consists of all functions f : Y Ñ R. Then there is an obvious bijection U pPq Ø U Y , and for y P Y and ũ P U pPq we may speak of ũpyq P U . 22 Definition. (See [4, §10.B]). Let G “ U ¸ A be real standard solvable. The multiamalgam Ĝ of the standard tame subgroups GC is defined by Ĝ “ ˚CPC GC {xxRG yy where RG “ tiC puq´1 iC 1 puq : u P GC X GC 1 u and iC denotes the inclusion of GC in the direct product. Similarly, the multiamalgam Û is defined by Û “ ˚CPC UC {xxRU yy where RU “ tiC puq´1 iC 1 puq : u P UC X UC 1 u and iC denotes the inclusion of UC in the direct product. For any commutative R-algebra P, we define Û pPq and ĜpPq similarly, where GC pPq is understood to be UC pPq ¸ A. Of course, Û ¸ A – Ĝ. Recall that G admits the SOL obstruction if it surjects onto a group of SOL type. Cornulier and Tessera give conditions under which Û is isomorphic to U . Theorem 5.8. Let G “ U ¸ A be a standard solvable real Lie group. If H2 puq0 “ 0, Kill2 puq0 “ 0, and G does not admit the SOL obstruction then Û pPq – U pPq for all commutative R-algebras P. Proof. This follows from Corollary 9.D.4 of [4]. The 2-tameness hypotheses of the corollary is satisfied because of Proposition 4.C.3 of [4]. 6 Proof of the main theorem. The rest of this paper is devoted to the proof of the following theorem. Theorem 6.1. Let G “ U ¸ A where U and A are contractible real Lie groups, A is abelian, and U is a real unipotent group (i.e., a closed group of strictly upper triangular real matrices.) If G is standard solvable and does not surject onto a group of Sol type, and H2 puq0 and Killpuq0 are trivial, then G is Lipschitz 1-connected. Proof. Lemma 6.2 will show that there exists a generating set S for G and normal form ω : GÑS ˚ with certain properties. Lemma 6.6 will show that if ω has these properties, then ∆ ε for ω-triangles ∆. By Lemma 4.5, this will suffice to prove the theorem. 23 6.1 Defining ω. Standing assumptions. Throughout the rest of this paper, we assume that G satisfies the hypotheses of the theorem. That is, G “ U ¸ A is a standard solvable group such that H2 puq0 “ 0, Kill2 puq0 “ 0, and G does not surject onto a group of Sol type. Notation. Let H “ ˚CPC GC and HU rPs “ ˚CPC UC pPq for any commutative R algebra P, and let iC : UC pPqÑHU rPs denote inclusion. We will write HU for HU rRs. Let SA be a compact generating set Ťfor A. For C P C, let SC be a compact generating set for UC . Let SU “ CPC SC —by Theorem 5.8 this is a compact generating set for U . Let S “ SA Y SU , this is a compact generating set for G. Let SH be a generating set for H which is equal to the union of compact generating sets for GC as C ranges over C, and let SHU Ă HU be the union of the SC —this is a generating set for HU . Given C P C and x P UC , let x P pSA Y SC q˚ be a minimal length word representing x. Let φA : GÑA be projection. Let the set theoretic map φU : GÑU be defined by φU pgq “ φA pgq´1 g, so that g “ φA pgqφU pgq. Lemma 6.2. Under our standing assumptions, there exists a finite sequence C1 . . . Ck of conic subsets and a normal form ω : GÑS ˚ such that ω has the following properties. • For any g P G, ωpgq “ ωpφA pgqqωpφU pgqq. ˚ is a minimal length word representing a. • For a P A, ωpaq P SA • For u P U , ωpuq has the form x1 . . . xk , where xi P UCi . Proof. This follows from Proposition 6.B.2 of [4], but we will now give a different proof in order to introduce a trick that will be used later. The Cornulier-Tessera trick. For a set Y , define the commutative Ralgebra PY as the collection of all functions f : Y ˆr1, 8qÑ R such that there is some β P N with |f py, tq| ă p1 ` tqβ . Note that an element of U pPY q may be identified with a function from Y ˆ r1, 8q to U . Alternatively, one may think of an element of U pPY q as a family of functions r1, 8qÑU , indexed by Y with matrix coefficients uniformly bounded by some polynomial p1 ` tqβ . Choose Y to have at least continuum cardinality, and let g̃ P U pPY q be such that for every g P U , there is some y P Y and t “ Op|g|SU q such that g̃py, tq “ g. It is certainly possible to do this—for instance, one might take Y “ U and set g̃py, tq to be 1U for t ă |y|SU and y for t ě |y|SU . In claiming 24 that g̃ P U pPY q, we have used the fact that the matrix coefficients of g P U are at most polynomial in |g|SU . Since, by Theorem 5.8, U pPY q is generated by the union of the UC pPY q, we may write g̃ “ x̃1 . . . x̃k where each x̃i is an element of some UCi pPY q. Observe that there exists some α P N such that |x̃i py, tq|SCi ď p1 ` tqα for all i “ 1, . . . , k, y P Y , and t ě 1. Now, let g be an element of U . By definition of g̃, there exist y P Y and t “ Op|g|SU q such that g̃py, tq “ g. For i “ 1, . . . , k, let xi “ x̃i py, tq. We have that g “ g̃py, tq “ x̃1 py, tq . . . x̃k py, tq “ x1 . . . xk , and xi P UCi pPY q with |xi |SCi “ Optα q “ Op|g|αSU q. Take ωpgq to be x1 . . . xk , and note that |ωpgq|S “ Oplog |g|SU q because |xi |SA YSCi “ Oplog |xi |SCi q “ Oplog |g|SU q by 5.7. We have thus defined ω on elements of U , with the desired properties. ˚ representing Define ω on A by taking ωpaq to be the shortest word in SA a P A. Extend ω to all of g by setting ωpgq “ ωpφA pgqqωpφU pgqq. We must show that ω is a normal form—i.e., that, for g P G, ℓpωpgqq “ Op|g|S q. We have ℓpωpφA pgqqq “ |φA pgq|S “ Op|g|S q, so it suffices to show that ℓpωpφU pgqqq “ Op|g|S q. If w P S ˚ is a minimal length word representing some g P G, note that ωpφA pgqq´1 w represents φU pgq. By 5.7, there is some constant C ą 1 not depending on g such that 1 log |φU pgq|SU . C Thus, since |ωpφU pgqq|S “ Oplog |φU pgq|SU q, we have that |ωpφA pgqq´1 w|S ě ωpφU pgqq “ Op|φA pgq|S ` |w|S q “ Op|g|S q as desired. 6.2 Filling ω-triangles. We wish to show that we may fill ω triangles, where ω is a normal form produced by Lemma 6.2. Proposition 6.5 will allow us to homotope ωtriangles into relations of the form xi . . . xK where each xi is a word in SA Y SCi efficiently representing an element xi of UCi , where C1 , . . . , CK is some fixed sequence of conic subsets. In order to fill such relations, recall from Theorem 5.8 that under our standing assumptions, U pPq – Û pPq for any commutative R-algebra P. Consequently, the kernel of HU rPsÑU pPq is normally generated by elements of the form iC puq´1 iC 1 puq ru P UC pPq X UC 1 pPq.s 25 In order to fill x1 . . . xK in Corollary 6.4, we will need to factor x1 . . . xK in the free product HU as a product of a bounded number of elements of the form g´1 iC puq´1 iC 1 puqg, where each g P HU is a product of a bounded number of elements living ř in some factors UC , with |g|SU and |u|SU controlled by some polynomial of K j“1 |xj |SCj . Lemma 6.3. (See [4, Lemma 7.B.1]). Suppose that our standing assumptions are satisfied. Given a sequence of conical subsets C1 , . . . CK , there exist natural numbers N, µ, β such that for any sequence xi P UCi with x1 x2 . . . xK “U 1U there is an equality of the form ´1 x1 . . . xK “HU pg1 r1 g1´1 q . . . pgN rN gN q satisfying • gj “HU gj1 . . . gjµ where gjk P UCjk for some Cjk P C. • Each rj is of the form iCj1 puj qiCj2 puj q´1 for some conical subsets Cj1 , Cj2 and some uj P UCj1 X UCj2 . • |gjk |SCjk “ Opℓβ q, |uj |SC 1 “ Opℓβ q, and |uj |SC 2 “ Opℓβ q where ℓ “ j j ř 1` K |x |. i i“1 Proof. This is a special case of [4, Lemma 7.B.1], but we will reprise most of the details here. We will use the same Cornulier and Tessera trick we used to prove Lemma 6.2. Take PY as in the proof of Lemma 6.2. Recall that x̃ P UC pPY q may be thought of as a function from Y ˆ r0, 8q to UC . Let Y be a set with at least continuum cardinality, so that there exists px̃1 , . . . , x̃K q P UC1 pPY q ˆ . . . ˆ UCK pPY q which has the following strong surjectivity property: for any px1 . . . xK q P UC1 pPY q ˆ . . . ˆ UCK pPY q with x1 . . . xK “U 1 there exists y P Y and t “ Op|x1 |SC1 ` . . . ` |xK |SCK q with x̃i py, tq “ xi . By Theorem 5.8, we know that there is some equality of the form ´1 r̃N g̃N q x̃1 . . . x̃K “HU rPY s pg̃1´1 r̃1 g̃1 q . . . pg̃N where g̃ P ˚UC pPY q and each r̃j has the form iCj1 pũj q´1 iCj2 pũj q for some conical subsets Cj1 , Cj2 and ũj P UCj1 pPY q X UCj2 pPY q. Since the UC pPY q generate HU rPY s, there must be some µ such that for all j “ 1, . . . , N , g̃j “ g̃j1 . . . g̃jµ , 26 where each g̃jk lives in UCjk for some Cjk P C. Note that by definition of PY , there is some β such that all |g̃jk py, tq|SU and |ũj py, tq|SC 1 are Optβ q. j ř Given, x1 , . . . , xK P UC1 ˆ . . . ˆ UCK , let ℓ “ K |x | i“1 i SCi and choose y P Y and t “ Opℓq such that x̃i py, tq “ xi for i “ 1, . . . , K. For j “ 1, . . . , N and k “ 1, . . . , µ, let gj “ g̃j py, tq, gjk “ g̃jk py, tq, uj “ ũj py, tq, and rj “ iC 1 puj q´1 iC 2 puj q. It follows that ´1 q, x1 . . . xK “HU pg1 r1 g1´1 q . . . pgN rN gN and the gj and rj satisfy the desired conditions. Corollary 6.4. Suppose that our standing assumptions are satisfied. Given a sequence of conical subsets C1 , . . . CK , we have, in G, that x1 . . . xK ε. for any sequence xi P UCi with x1 x2 . . . xK “U 1U . Proof. By Lemma 6.3, we have (for β, N, µ independent of the xj ), ´1 q x1 . . . xK “HU pg1 r1 g1´1 q . . . pgN rN gN where gj “HU gj1 . . . gjµ for gjk P UCjk , each rj is of the form i1C puj q´1 iC 2 puj q for some conical subsets Cj1 , Cj2 and some uj P UCj1 XUCj2 , and |gjk |SCjk , |uj |SC 1 “ j ř Opℓβ q where ℓ “ 1 ` K |x |. i“1 i For each j “ 1, . . . , N , let gj P S ˚ be gj1 . . . gjµ . Let rj P S ˚ be equal to pu1j q´1 u2j , where u1j P SA Y SCj1 is a minimal length word representing uj in GCj1 and u2j P SA Y SCj2 is a minimal length word representing uj in GCj2 —this implies that rj represents rj in H. First we show that rj ε. Note that Cj1 X Cj2 is itself a conic subset, so there is some uj P pSA Y SCj1 XCj2 q˚ which represents uj in GCj1 XCj2 with ℓpuj q “ Opℓprj qq. Thus we have (by Proposition 5.2), rj “ pu1j q´1 u2j uj ´1 uj ε. Next, observe that ℓpgj q “ µ ÿ k“1 ˜ ˜ µ ÿ ℓpgjk q “ “ O β log 1 ` Oplog |gjk |SCjk q k“1 K ÿ i“1 ¸¸ |xi | 27 “ Opℓpx1 . . . xK qq, by Proposition 5.7, and ℓpri q “ Opℓpx1 . . . xK qq similarly. Because x1 . . . xK “H pg1 r1 g1 ´1 q . . . pgN rN gN ´1 q, and ℓppg1 r1 g1 ´1 q . . . pgN rN gN ´1 qq “ Opℓpx1 . . . xK qq, we have by Lemma 4.4 and Lemma 5.6 that x1 . . . xK pg1 r1 g1 ´1 q . . . pgN rN gN ´1 q pg1 g1 ´1 q . . . pgN gN ´1 q because rj ε ε as noted above. We need one more proposition before we can fill ω-triangles. Given a, x P G, let a x denote axa´1 . Proposition 6.5. Fix a sequence of conical subsets C1 , . . . , CK P C. We have that a x . . . a x ωpaq ωpaqx1 . . . xK 1 2 for all a P A and xi P UCi . Proof. ωpaqx1 . . . xK pωpaqx1 ωpaq´1 qpωpaqx2 ωpaq´1 q . . . pωpaqxK ωpaq´1 qωpaq ax 1... ax K ωpaq, by Proposition 5.2. We now conclude the proof of our main theorem by showing that we may fill ω-triangles. Lemma 6.6. Under our standing assumptions, if g1 , g2 , g3 P G with g1 g2 g3 “G 1G , we have ωpg1 qωpg2 qωpg3 q ε. Proof. Recall that ωpgq has the form ωpaqx1 . . . xk where ui P SA Y SCi for some fixed sequence C1 , . . . Ck of conical subsets. Let g1 , g2 , g3 P G with g1 g2 g3 “ 1G , and let ai “ φA pgi q for i “ 1, 2, 3. Let ωpφU pg1 qq “ x1 . . . xk , ωpφU pg2 qq “ x11 . . . x1k and ωpφU pg3 qq “ x21 . . . x2k . Expanding and applying Proposition 6.5 repeatedly, we slide the a-words to the right to see that ωpg1 qωpg2 qωpg3 q “ ωpa1 qx1 . . . xk ωpa2 qx11 . . . x1k ωpa3 qx21 . . . x2k a1 x 1... a1 x a2 a1 x1 . . . a2 a1 x1 a3 a2 a1 x2 . . . a3 a2 a1 x2 ωpa qωpa qωpa q 1 1 1 2 3 k k k a1 x 1 ... a1 x a2 a1 x1 . . . a2 a1 x1 a3 a2 a1 x2 . . . a3 a2 a1 x2 . 1 1 k k k This resulting word admits a Lipschitz filling by Corollary 6.4. 28 References [1] Herbert Abels. Finite presentability of S-arithmetic groups. Compact presentability of solvable groups, Lecture Notes in Mathematics, 1261, 1985. [2] Armand Borel. Linear algebraic groups, volume 126. Springer Science & Business Media, 2012. [3] Martin R Bridson and André Haefliger. Metric spaces of non-positive curvature, volume 319. Springer Science & Business Media, 2011. [4] Yves Cornulier and Romain Tessera. Geometric presentations of Lie groups and their Dehn functions. arXiv preprint arXiv:1310.5373v2, 2013. [5] David Epstein, Mike S Paterson, James W Cannon, Derek F Holt, Silvio V Levy, and William P Thurston. Word processing in groups. AK Peters, Ltd., 1992. [6] Mikhail Gromov. Geometric group theory, vol. 2: Asymptotic invariants of infinite groups. 1996. [7] Shoshichi Kobayashi and Katsumi Nomizu. Foundations of differential geometry, volume 1. New York, 1963. [8] Alexander Lytchak, Stefan Wenger, and Robert Young. Dehn functions and Hölder extensions in asymptotic cones. arXiv preprint arXiv:1608.00082, 2016. [9] Ayato Mitsuishi and Takao Yamaguchi. Locally lipschitz contractibility of alexandrov spaces and its applications. Pacific Journal of Mathematics, 270(2):393–421, 2014. [10] Robert Young. The dehn function of SLpn, Zq. Annals of Mathematics, 177(3):969–1027, 2013. David Bruce Cohen Department of Mathematics University of Chicago 5734 S. University Avenue, Room 208C Chicago, Illinois 60637 E-mail: [email protected] 29
4math.GR
Simple​ ​Cortex:​ ​A​ ​Model​ ​of​ ​Cells​ ​in​ ​the​ ​Sensory​ ​Nervous​ ​System Simple​ ​Cortex:​ ​A​ ​Model​ ​of​ ​Cells​ ​in​ ​the​ ​Sensory Nervous​ ​System David​ ​Di​ ​Giorgio neuroowl.com/ddigiorg Abstract Neuroscience​ ​research​ ​has​ ​produced​ ​many​ ​ ​theories​ ​and​ ​computational​ ​neural​ ​models​ ​of​ ​sensory nervous​ ​systems.​ ​ ​Notwithstanding​ ​many​ ​different​ ​perspectives​ ​towards​ ​developing​ ​intelligent​ ​machines, artificial​ ​intelligence​ ​has​ ​ultimately​ ​been​ ​influenced​ ​by​ ​neuroscience.​ ​ ​Therefore,​ ​this​ ​paper​ ​provides​ ​an introduction​ ​to​ ​biologically​ ​inspired​ ​machine​ ​intelligence​ ​by​ ​exploring​ ​the​ ​basic​ ​principles​ ​of​ ​sensation and​ ​perception​ ​as​ ​well​ ​as​ ​the​ ​structure​ ​and​ ​behavior​ ​of​ ​biological​ ​sensory​ ​nervous​ ​systems​ ​like​ ​the neocortex.​ ​ ​Concepts​ ​like​ ​spike​ ​timing,​ ​synaptic​ ​plasticity,​ ​inhibition,​ ​neural​ ​structure,​ ​and​ ​neural​ ​behavior are​ ​applied​ ​to​ ​a​ ​new​ ​model,​ ​Simple​ ​Cortex​ ​(SC).​ ​ ​A​ ​software​ ​implementation​ ​of​ ​SC​ ​has​ ​been​ ​built​ ​and demonstrates​ ​fast​ ​observation,​ ​learning,​ ​and​ ​prediction​ ​of​ ​spatio-temporal​ ​sensory-motor​ ​patterns​ ​and sequences.​ ​ ​Finally,​ ​this​ ​paper​ ​suggests​ ​future​ ​areas​ ​of​ ​improvement​ ​and​ ​growth​ ​for​ ​Simple​ ​Cortex​ ​and other​ ​related​ ​machine​ ​intelligence​ ​models. 1​ ​ ​ ​Introduction Artificial​ ​intelligence​ ​research​ ​has​ ​been​ ​built,​ ​to​ ​varying​ ​degrees,​ ​on​ ​a​ ​foundational​ ​understanding​ ​of biological​ ​sensory​ ​nervous​ ​systems.​ ​ ​Popular​ ​machine​ ​learning​ ​techniques​ ​like​ ​artificial​ ​neural​ ​networks (ANNs)​ ​and​ ​deep​ ​learning​ ​were​ ​originally​ ​inspired​ ​using​ ​a​ ​dramatically​ ​simplified​ ​point​ ​neuron​ ​model​ ​[1]​. Although​ ​architecturally​ ​inspired​ ​by​ ​biology,​ ​these​ ​ANNs​ ​use​ ​brute​ ​force​ ​function​ ​optimization​ ​of​ ​a​ ​cost function​ ​and​ ​backpropagation​ ​of​ ​errors​ ​to​ ​modify​ ​neural​ ​weights​ ​and​ ​successfully​ ​learn​ ​data.​ ​ ​Some hypothesize​ ​backpropagation​ ​has​ ​a​ ​basis​ ​in​ ​neuroscience​ ​[2]​ w ​ hile​ ​others​ ​explore​ ​a​ ​similarities​ ​between biological​ ​spike-time-dependant-plasticity​ ​and​ ​unsupervised​ ​learning​ ​mechanism​ ​[3]​.​ ​ ​Due​ ​to​ ​recent hardware​ ​advances​ ​and​ ​refined​ ​algorithms,​ ​math-heavy​ ​optimization​ ​based​ ​machine​ ​learning​ ​has become​ ​very​ ​successful.​ ​ ​Extensive​ ​development​ ​of​ ​the​ ​mathematics​ ​of​ ​efficient​ ​optimization​ ​has yielded,​ ​for​ ​instance,​ ​interesting​ ​AI​ ​projects​ ​like​ ​Deep​ ​Mind’s​ ​AlphaGo​ [​ 4]​ ​(​beating​ ​a​ ​world​ ​champion​ ​in​ ​the game​ ​of​ ​Go),​ ​and​ ​various​ ​self​ ​driving​ ​car​ ​solutions​ ​(along​ ​with​ ​many​ ​other​ ​world​ ​changes​ ​examples). While​ ​these​ ​advancements​ ​and​ ​projects​ ​have​ ​thus​ ​far​ ​facilitated​ ​a​ ​booming​ ​machine​ ​learning​ ​industry, leading​ ​experts​ ​like​ ​Geoffrey​ ​Hinton​ ​have​ ​begun​ ​to​ ​doubt​ ​math​ ​based​ ​learning​ ​methods​ ​like backpropagation​ ​will​ ​continue​ ​to​ ​significantly​ ​advance​ ​the​ ​AI​ ​field​ ​[5]​. David​ ​Di​ ​Giorgio​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​1/22 Simple​ ​Cortex:​ ​A​ ​Model​ ​of​ ​Cells​ ​in​ ​the​ ​Sensory​ ​Nervous​ ​System Others​ ​researchers​ ​have​ ​a​ ​more​ ​neuroscientific​ ​focused​ ​perspective​ ​towards​ ​understanding​ ​and​ ​applying intelligence.​ ​ ​A​ ​machine​ ​intelligence​ ​company,​ ​Numenta,​ ​heavily​ ​applies​ ​neuroscience​ ​research​ ​towards building​ ​a​ ​theoretical​ ​framework​ ​of​ ​the​ ​neocortex,​ ​Hierarchical​ ​Temporal​ ​Memory​ ​(HTM)​ ​[6]​​ ​[7]​​ ​[8]​. Numenta​ ​has​ ​built​ ​a​ ​software​ ​suite,​ ​NuPIC​ [​ 9]​,​ ​that​ ​yields​ ​strong​ ​results​ ​in​ ​high-order​ ​sequence​ ​learning [10]​ ​compared​ ​to​ ​standard​ ​machine​ ​learning​ ​long​ ​short-term​ ​memory​ ​(LSTM)​ ​systems.​ ​ ​HTM’s development​ ​has​ ​yielded​ ​capable​ ​spatial​ ​and​ ​temporal​ ​anomaly​ ​detection​ ​in​ ​noisy​ ​domains​ ​[11]​​ ​as​ ​well as​ ​a​ ​growing​ ​community​ ​of​ ​neuroscience​ ​and​ ​AI​ ​researchers.​ ​ ​Many​ ​of​ ​the​ ​ideas​ ​and​ ​concepts​ ​regarding the​ ​neocortex​ ​consolidated​ ​by​ ​Numenta​ ​are​ ​discussed​ ​in​ ​section​ ​2​ ​The​ ​Neocortex. Other​ ​researchers​ ​take​ ​a​ ​more​ ​unique​ ​approach​ ​towards​ ​understanding​ ​the​ ​computational​ ​processes​ ​of the​ ​brain.​ ​ ​Ogma​ ​Intelligent​ ​Systems​ ​Corp​ ​introduces​ ​a​ ​model,​ ​Feynman​ ​Machine,​ ​that​ ​links​ ​neuroscience and​ ​mathematics​ ​by​ ​developing​ ​a​ ​learning​ ​architecture​ ​based​ ​on​ ​neuroscience​ ​and​ ​the​ ​applied mathematics​ ​of​ ​interacting​ ​dynamical​ ​systems​ ​[12]​.​ ​ ​Ogma​ ​has​ ​developed​ ​a​ ​library,​ ​OgmaNeo​ ​[13]​,​ ​which has​ ​successfully​ ​been​ ​applied​ ​towards​ ​a​ ​simple​ ​self​ ​driving​ ​car​ ​solution​ ​[14]​​ ​on​ ​a​ ​raspberry​ ​pi. Not​ ​only​ ​are​ ​companies​ ​developing​ ​software​ ​models,​ ​others​ ​are​ ​extending​ ​neuroscience​ ​knowledge towards​ ​hardware​ ​solutions.​ ​ ​Intel’s​ ​self-learning​ ​neuromorphic​ ​chip,​ ​Loihi,​ ​is​ ​inspired​ ​by​ ​neural​ ​spikes, sparsity,​ ​and​ ​synaptic​ ​plasticity​ ​that​ ​can​ ​be​ ​modulated​ ​based​ ​on​ ​timing​ ​[15]​.​ ​ ​Intel​ ​plans​ ​to​ ​start manufacturing​ ​these​ ​chips​ ​and​ ​share​ ​it​ ​with​ ​university​ ​and​ ​research​ ​institutions. Finally,​ ​there​ ​are​ ​researchers​ ​who​ ​are​ ​not​ ​associated​ ​with​ ​academia​ ​or​ ​industry​ ​that​ ​provide​ ​interesting insights​ ​into​ ​neuroscience​ ​and​ ​intelligence​ ​research.​ ​ ​Louis​ ​Savian’s​ ​Rebel​ ​Cortex​ ​[16]​​ ​and​ ​his​ ​blog​ ​[17] state​ ​that​ ​the​ ​brain​ ​senses,​ ​learns,​ ​and​ ​perceives​ ​the​ ​world​ ​based​ ​on​ ​precise​ ​timing​ ​of​ ​neural​ ​spikes,​ ​a concept​ ​discussed​ ​in​ ​sections​ ​1.1​ ​Sensation​ ​and​ ​1.2​ ​Perception​ ​and​ ​used​ ​by​ ​Simple​ ​Cortex. At​ ​their​ ​core,​ ​all​ ​of​ ​the​ ​researchers​ ​and​ ​their​ ​ideas​ ​discussed​ ​in​ ​this​ ​introduction​ ​have​ ​been​ ​influenced​ ​to varying​ ​degrees​ ​by​ ​the​ ​principles​ ​of​ ​intelligence​ ​found​ ​in​ ​biology.​ ​ ​As​ ​our​ ​understanding​ ​of​ ​sensory nervous​ ​systems​ ​like​ ​the​ ​brain​ ​become​ ​more​ ​sophisticated,​ ​we​ ​can​ ​apply​ ​that​ ​knowledge​ ​towards building​ ​more​ ​general​ ​and​ ​capable​ ​intelligent​ ​machines. 1.1​ ​ ​ ​Sensation An​ ​intelligent​ ​entity​ ​exists,​ ​observes,​ ​and​ ​interacts​ ​in​ ​an​ ​environment,​ ​a​ ​place​ ​where​ ​concepts​ ​have​ ​causal relationship​ ​to​ ​each​ ​other.​ ​ ​Humans​ ​call​ ​our​ ​environment​ ​the​ ​“Universe",​ ​where​ ​energy​ ​and​ ​matter​ ​exist and​ ​behave​ ​through​ ​natural​ ​laws​ ​applied​ ​to​ ​concepts​ ​like​ ​"space",​ ​"time",​ ​"gravity",​ ​"electromagnetism", “quantum​ ​physics”,​ ​etc.​ ​ ​These​ ​laws​ ​give​ ​rise​ ​to,​ ​cause,​ ​or​ ​explain​ ​relatively​ ​stable​ ​spatial​ ​structures​ ​and recurring​ ​temporal​ ​events​ ​within​ ​the​ ​Universe.​ ​ ​Due​ ​to​ ​this​ ​causal​ ​natural​ ​order​ ​of​ ​the​ ​environment, David​ ​Di​ ​Giorgio​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​2/22 Simple​ ​Cortex:​ ​A​ ​Model​ ​of​ ​Cells​ ​in​ ​the​ ​Sensory​ ​Nervous​ ​System biological​ ​nervous​ ​systems​ ​are​ ​able​ ​to​ ​witness​ ​and​ ​react​ ​to​ ​recurring​ ​knowledge​ ​(patterns​ ​and sequences)​ ​in​ ​the​ ​environment.​ ​ ​Therefore​ ​intelligent​ ​entities​ ​use​ ​large​ ​networks​ ​of​ ​sensors​ ​to​ ​sense, perceive,​ ​predict,​ ​and​ ​learn​ ​patterns​ ​and​ ​sequences​ ​from​ ​the​ ​environment​ ​as​ ​well​ ​as​ ​influence​ ​the environment​ ​through​ ​patterns​ ​and​ ​sequences​ ​of​ ​motor​ ​actions.​ ​ ​Thus​ ​a​ ​fundamental​ ​understanding​ ​of sensation​ ​is​ ​a​ ​good​ ​starting​ ​point​ ​for​ ​understanding​ ​the​ ​basic​ ​principles​ ​of​ ​intelligence. Figure​ ​1.1​​ ​-​ (​ A)​​ ​When​ ​a​ ​receptor​ ​receives​ ​a​ ​specific​ ​stimulus​ ​(i.e.​ ​green​ ​light)​ ​it​ ​outputs​ ​a​ ​response​ ​signal (i.e.​ ​a​ ​spike​ ​of​ ​electrical​ ​potential).​ ​ ​(B)​​ C ​ oncurrent​ ​stimuli​ ​are​ ​changes​ ​that​ ​occur​ ​within​ ​the​ ​same​ ​time range​ ​causing​ ​a​ ​receptor​ ​to​ ​respond.​ ​ ​(C)​​ S ​ equential​ ​stimuli​ ​are​ ​changes​ ​that​ ​occur​ ​during​ ​different​ ​time ranges,​ ​usually​ ​proceeding​ ​one​ ​after​ ​another,​ ​causing​ ​a​ ​receptor​ ​to​ ​respond. Sensation​ ​is​ ​simply​ ​the​ ​detection​ ​of​ ​stimulation​ ​in​ ​an​ ​environment.​ ​ ​A​ ​stimulus​ ​(plural​ ​stimuli)​ ​is​ ​a detectable​ ​phenomenon.​ ​ ​Examples​ ​include​ ​light​ ​frequency​ ​(color),​ ​sound​ ​frequency​ ​(pitch),​ ​chemicals (tastes​ ​and​ ​smells),​ ​and​ ​spikes​ ​of​ ​voltage​ ​(electrical​ ​action​ ​potentials).​ ​ ​A​ ​receptor​ ​is​ ​a​ ​structure​ ​that receives​ ​streams​ ​of​ ​stimuli​ ​and​ ​outputs​ ​a​ ​signal​ ​when​ ​it​ ​detects​ ​specific​ ​stimuli.​ ​ ​Examples​ ​include photoreceptors​ ​(vision),​ ​mechanoreceptors​ ​(hearing​ ​and​ ​touch),​ ​chemoreceptors​ ​(taste​ ​and​ ​smell),​ ​and David​ ​Di​ ​Giorgio​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​3/22 Simple​ ​Cortex:​ ​A​ ​Model​ ​of​ ​Cells​ ​in​ ​the​ ​Sensory​ ​Nervous​ ​System synapses​ ​(electrical​ ​action​ ​potentials).​ ​ ​A​ ​receptor’s​ ​output​ ​signal​ ​is​ ​a​ ​discrete​ ​temporal​ ​marker​ ​[16] indicating​ ​the​ ​occurrence​ ​of​ ​specific​ ​phenomenon​ ​in​ ​a​ ​stream​ ​within​ ​a​ ​range​ ​of​ ​time.​ ​ ​For​ ​example,​ ​take​ ​a receptor​ ​that​ ​receives​ ​one​ ​stream​ ​of​ ​stimuli​ ​and​ ​only​ ​outputs​ ​a​ ​signal​ ​when​ ​it​ ​detects​ ​blue​ ​light.​ ​ ​Initially the​ ​receptor​ ​receives​ ​red​ ​light​ ​for​ ​a​ ​time,​ ​but​ ​eventually​ ​it​ ​receives​ ​a​ ​burst​ ​of​ ​blue​ ​light.​ ​ ​This​ ​color​ ​change causes​ ​the​ ​receptor​ ​to​ ​output​ ​a​ ​signal,​ ​announcing​ ​the​ ​blue​ ​stimulus​ ​was​ ​recognized.​ ​ ​Thus​ ​the​ ​most basic​ ​unit​ ​of​ ​sensory​ ​systems​ ​are​ ​sensory​ ​receptors​ ​that​ ​output​ ​a​ ​signal​ ​when​ ​they​ ​detect​ ​specific stimuli. Receptors​ ​that​ ​receive​ ​multiple​ ​sensory​ ​streams​ ​operate​ ​purely​ ​on​ ​temporal​ ​relationships.​ ​ ​They​ ​do​ ​so​ ​in two​ ​ways:​ ​concurrently​ ​or​ ​sequentially​ [​ 16]​.​ ​ ​Concurrent​ ​stimuli​ ​are​ ​multiple​ ​detectable​ ​phenomena​ ​in​ ​an environment​ ​that​ ​occur​ ​within​ ​a​ ​single​ ​time​ ​range.​ ​ ​For​ ​example,​ ​a​ ​computer​ ​screen​ ​is​ ​a​ ​2D​ ​array​ ​of pixels.​ ​ ​The​ ​light​ ​emitted​ ​from​ ​this​ ​array​ ​hits​ ​your​ ​retina​ ​within​ ​a​ ​very​ ​narrow​ ​range​ ​in​ ​time,​ ​allowing​ ​the brain​ ​to​ ​recognize​ ​spatial​ ​objects.​ ​ ​Sequential​ ​stimuli​ ​are​ ​multiple​ ​detectable​ ​phenomena​ ​in​ ​an environment​ ​that​ ​occur​ ​during​ ​different​ ​time​ ​ranges,​ ​usually​ ​proceeding​ ​one​ ​after​ ​another.​ ​ ​Continuing​ ​the example​ ​of​ ​the​ ​computer​ ​screen,​ ​the​ ​changes​ ​of​ ​a​ ​pixel​ ​from​ ​red​ ​to​ ​green​ ​to​ ​blue​ ​are​ ​sequential​ ​stimuli. 1.2​ ​ ​ ​Perception Perception​ ​is​ ​the​ ​basis​ ​of​ ​prediction,​ ​expectation,​ ​sophisticated​ ​object​ ​recognition​ ​(occlusion,​ ​invariance, and​ ​discrimination),​ ​and​ ​attention.​ ​ ​Perception​ ​functions​ ​like​ ​sensation​ ​(response​ ​to​ ​detected phenomenon),​ ​however​ ​it​ ​utilizes​ ​stimuli​ ​from​ ​the​ ​memories​ ​of​ ​the​ ​sensory​ ​nervous​ ​system​ ​to​ ​make sense​ ​of​ ​the​ ​observed​ ​stimuli.​ ​ ​For​ ​example,​ ​perception​ ​(“top-down”​ ​processing)​ ​is​ ​understanding​ ​you​ ​are seeing​ ​a​ ​chair,​ ​but​ ​sensation​ ​(“bottom-up”​ ​processing)​ ​is​ ​simply​ ​your​ ​eyes​ ​detecting​ ​light​ ​waves.​ ​ ​Other intuitive​ ​examples​ ​of​ ​perception​ ​are​ ​found​ ​in​ ​optical​ ​illusions,​ ​which​ ​demonstrate​ ​the​ ​brain​ ​uses memories​ ​to​ ​make​ ​sense​ ​of​ ​the​ ​environment,​ ​as​ ​shown​ ​in​ ​Figure​ ​1.2.​ ​ ​Thus​ ​a​ ​receptor​ ​“perceives”​ ​rather than​ ​“senses”​ ​when​ ​it​ ​receives​ ​stimuli​ ​from​ ​an​ ​internal​ ​sensory​ ​receptor​ ​that​ ​doesn’t​ ​directly​ ​observe​ ​the external​ ​environment. Figure​ ​1.2​​ ​-​ ​Neon​ ​color​ ​spreading​ ​optical​ ​illusion.​ ​ ​The​ ​light​ ​cyan​ ​circle​ ​does​ ​not​ ​exist,​ ​however​ ​the​ ​brain perceives​ ​it​ ​is​ ​there​ ​based​ ​on​ ​the​ ​pattern​ ​created​ ​by​ ​the​ ​cyan​ ​arc​ ​stimuli. David​ ​Di​ ​Giorgio​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​4/22 Simple​ ​Cortex:​ ​A​ ​Model​ ​of​ ​Cells​ ​in​ ​the​ ​Sensory​ ​Nervous​ ​System 2​ ​ ​ ​The​ ​Neocortex The​ ​mammalian​ ​neocortex​ ​is​ ​considered​ ​the​ ​highest​ ​seat​ ​of​ ​intelligence​ ​and​ ​is​ ​primarily​ ​responsible​ ​for producing​ ​humanity’s​ ​great​ ​technological,​ ​philosophical,​ ​and​ ​cultural​ ​works.​ ​ ​The​ ​human​ ​neocortex​ ​is​ ​a sheet​ ​of​ ​neural​ ​tissue​ ​occupying​ ​about​ ​75%​ ​of​ ​the​ ​brain’s​ ​volume,​ ​is​ ​around​ ​2-4​ ​mm​ ​thick,​ ​and​ ​is​ ​about 2,500​ ​square​ ​cm​ ​in​ ​area​ ​(roughly​ ​the​ ​size​ ​of​ ​a​ ​dinner​ ​napkin)​ ​[6]​.​ ​ ​It​ ​is​ ​wrapped​ ​around​ ​older​ ​brain structures​ ​and​ ​the​ ​wrinkles,​ ​its​ ​defining​ ​physical​ ​characteristic​ ​,​ ​help​ ​increase​ ​the​ ​neocortical​ ​surface area​ ​within​ ​the​ ​skull.​ ​ ​Just​ ​one​ ​square​ ​mm​ ​of​ ​this​ ​neural​ ​sheet​ ​has​ ​about​ ​100​ ​thousand​ ​neurons​ ​and​ ​1 billion​ ​synapses.​ ​ ​The​ ​neocortex​ ​is​ ​distributed​ ​in​ ​six​ ​layers,​ ​containing​ ​additional​ ​sublayers,​ ​based​ ​on differences​ ​in​ ​the​ ​relative​ ​density​ ​of​ ​neurons,​ ​axons,​ ​and​ ​synapses​ ​as​ ​well​ ​as​ ​interconnections​ ​to​ ​the​ ​rest of​ ​the​ ​brain​ ​[6]​.​ ​ ​Despite​ ​structural​ ​differences​ ​found​ ​in​ ​neocortical​ ​regions​ ​(mostly​ ​different​ ​neuron​ ​types and​ ​more​ ​or​ ​less​ ​layers/sublayers)​ ​the​ ​neocortex​ ​is​ ​remarkably​ ​homogeneous​ ​in​ ​the​ ​behavioral​ ​principles of​ ​cells​ ​and​ ​cortical​ ​areas​ ​[6]​.​ ​ ​By​ ​understanding​ ​how​ ​sensation​ ​and​ ​perception​ ​work​ ​within​ ​these​ ​areas, we​ ​gain​ ​valuable​ ​insight​ ​into​ ​building​ ​more​ ​capable​ ​models​ ​and​ ​explaining​ ​how​ ​existing​ ​models​ ​work. 2.1​ ​ ​ ​Neocortical​ ​Structures Sensory​ ​nervous​ ​systems​ ​are​ ​complex​ ​networks​ ​of​ ​interlinked​ ​sensors​ ​called​ ​“cells”,​ ​which​ ​are collections​ ​of​ ​receptors​ ​forming​ ​a​ ​single​ ​sophisticated​ ​sensor​ ​that​ ​detects​ ​stimuli.​ ​ ​The​ ​cells​ ​thought​ ​to be​ ​primarily​ ​responsible​ ​for​ ​intelligent​ ​behavior​ ​in​ ​the​ ​neocortex​ ​are​ ​called​ ​“neurons”.​ ​ ​A​ ​neuron​ ​has​ ​a​ ​cell body​ ​called​ ​the​ ​“soma”,​ ​one​ ​or​ ​more​ ​branching​ ​structures​ ​called​ ​“dendrites”​ ​containing​ ​receptors​ ​called “synapses”,​ ​and​ ​a​ ​tubular​ ​structure​ ​called​ ​the​ ​“axon”​ ​for​ ​outputting​ ​action​ ​potentials.​ ​ ​A​ ​diagram​ ​of​ ​these structures​ ​are​ ​found​ ​in​ ​Figure​ ​2.1.​ ​ ​The​ ​most​ ​common​ ​type​ ​of​ ​neuron​ ​in​ ​the​ ​neocortex​ ​is​ ​the​ ​pyramidal neuron​ [​ 7]​​ ​which​ ​has​ ​thousands​ ​of​ ​dendrites​ ​forming​ ​synaptic​ ​connections​ ​to​ ​axons​ ​of​ ​other​ ​cells​ ​in various​ ​areas​ ​internal​ ​or​ ​external​ ​to​ ​the​ ​cortical​ ​hierarchy​ ​[7]​.​ ​ ​Synapses​ ​are​ ​receptors​ ​that​ ​detect​ ​stimuli, covering​ ​dendrites​ ​much​ ​like​ ​the​ ​leaves​ ​of​ ​a​ ​tree.​ ​ ​These​ ​structures​ ​are​ ​thought​ ​to​ ​be​ ​the​ ​most fundamental​ ​memory​ ​storage​ ​and​ ​learning​ ​unit​ ​of​ ​the​ ​neocortex​ ​[6]​.​ ​ ​Thus​ ​dynamically​ ​interacting stimulus-receptor​ ​networks​ ​like​ ​the​ ​sensory​ ​nervous​ ​system​ ​are​ ​built​ ​from​ ​these​ ​axon-synapse connections. Dendrites​ ​are​ ​the​ ​physical​ ​inputs​ ​of​ ​a​ ​neuron​ ​(the​ ​word​ ​“dendrite”​ ​comes​ ​from​ ​the​ ​Greek​ ​word​ ​“dendros” meaning​ ​“tree”,​ ​describing​ ​its​ ​branch-like​ ​structure).​ ​ As​ ​found​ ​in​ ​pyramidal​ ​neurons​ ​and​ ​other​ ​types​ ​of neurons,​ ​dendrites​ ​branch​ ​towards​ ​many​ ​areas​ ​of​ ​the​ ​sensory​ ​nervous​ ​system​ ​both​ ​within​ ​and​ ​outside​ ​of the​ ​neocortex​ ​ ​These​ ​different​ ​areas​ ​will​ ​contain​ ​stimuli​ ​representing​ ​different​ ​contextual​ ​information about​ ​the​ ​environment​ ​or​ ​an​ ​observed​ ​phenomenon. ​ ​Take​ ​V1​ ​for​ ​example,​ ​the​ ​primary​ ​visual​ ​processing area​ ​of​ ​the​ ​neocortex​ ​found​ ​near​ ​the​ ​back​ ​of​ ​the​ ​skull.​ ​ ​V1​ ​neurons​ ​have​ ​dendrites​ ​forming​ ​connections within​ ​the​ ​thalamus,​ ​a​ ​structure​ ​that​ ​receives​ ​information​ ​from​ ​environment-observing​ ​sensory​ ​systems David​ ​Di​ ​Giorgio​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​5/22 Simple​ ​Cortex:​ ​A​ ​Model​ ​of​ ​Cells​ ​in​ ​the​ ​Sensory​ ​Nervous​ ​System like​ ​the​ ​retina​ ​and​ ​cochlea​ ​[7]​.​ ​ ​V1​ ​neurons​ ​also​ ​have​ ​dendrites​ ​forming​ ​connections​ ​to​ ​higher​ ​brain regions​ ​like​ ​V2​ ​and​ ​V3,​ ​which​ ​contain​ ​more​ ​sophisticated​ ​perceptual​ ​information.​ ​ ​This​ ​is​ ​true​ ​within other​ ​areas​ ​of​ ​the​ ​neocortex.​ ​ ​Generally,​ ​pyramidal​ ​neurons​ ​found​ ​in​ ​layer​ ​3b​ ​of​ ​many​ ​brain​ ​areas​ ​have three​ ​types​ ​of​ ​dendrites:​ ​proximal,​ ​basal​ ​(or​ ​distal),​ ​and​ ​apical​ ​[7]​.​ ​ Proximal​ ​dendrites​ ​respond​ ​to bottom-up​ ​stimuli​ ​from​ ​the​ ​thalamus.​ ​ ​Basal​ ​dendrites​ ​respond​ ​to​ ​lateral​ ​stimuli​ ​from​ ​neurons​ ​in​ ​the same​ ​cortical​ ​area​ [​ 7]​,​ ​which​ ​is​ ​thought​ ​to​ ​be​ ​the​ ​basis​ ​of​ ​cortical​ ​sequence​ ​learning.​ ​ Apical​ ​dendrites, responding​ ​to​ ​top-down​ ​stimuli​ ​from​ ​higher​ ​cortical​ ​areas​ ​[7]​,​ ​provide​ ​more​ ​sophisticated​ ​context, expectation,​ ​perception,​ ​and​ ​prediction​ ​about​ ​an​ ​observed​ ​phenomenon.​ ​ ​Thus​ ​by​ ​branching​ ​dendrites​ ​to various​ ​areas​ ​of​ ​the​ ​sensory​ ​nervous​ ​system,​ ​a​ ​neuron​ ​can​ ​observe​ ​and​ ​recognize​ ​extremely​ ​complex patterns​ ​of​ ​stimuli,​ ​forming​ ​a​ ​sophisticated​ ​understanding​ ​of​ ​the​ ​environment. Figure​ ​2.1​​ ​-​ ​The​ ​mammalian​ ​neocortex​ ​consists​ ​of​ ​a​ ​hierarchy​ ​of​ ​interacting​ ​cell​ ​clusters​ ​called​ ​“cortical areas”​ ​or​ ​“brain​ ​regions”.​ ​ ​These​ ​areas​ ​are​ ​subdivided​ ​by​ ​6​ ​layers​ ​and​ ​consist​ ​of​ ​structures​ ​called​ ​“cortical columns”​ ​(or​ ​“macrocolumns”,​ ​"minicolumns",​ ​and​ ​“cells”.​ ​ ​The​ ​cells​ ​that​ ​make​ ​up​ ​these​ ​columns​ ​have input​ ​structures​ ​called​ ​“dendrites”​ ​and​ ​“synapses”​ ​and​ ​an​ ​output​ ​structure​ ​called​ ​the​ ​“axon”. 2.2​ ​ ​ ​Neural​ ​Behavior A​ ​neuron​ ​operates​ ​on​ ​the​ ​principles​ ​described​ ​in​ ​section​ ​1.1​ ​Sensation.​ ​ ​A​ ​synapse​ ​is​ ​a​ ​receptor​ ​that receives​ ​streams​ ​of​ ​excitatory​ ​or​ ​inhibitory​ ​neurotransmitter​ ​stimuli​ ​from​ ​other​ ​neural​ ​axons.​ ​ ​Dendrites are​ ​a​ ​collection​ ​of​ ​synapses​ ​whose​ ​responses​ ​within​ ​a​ ​time​ ​range​ ​sum​ ​up​ ​to​ ​a​ ​single​ ​input​ ​dendritic response​ ​which​ ​affects​ ​the​ ​parent​ ​neuron’s​ ​state.​ ​ ​When​ ​a​ ​single​ ​dendrite​ ​receives​ ​enough​ ​excitatory neurotransmitters​ ​through​ ​its​ ​synapses​ ​it​ ​depolarizes​ ​the​ ​parent​ ​neuron’s​ ​soma,​ ​putting​ ​the​ ​neuron​ ​in​ ​an “predictive”​ ​or​ ​“expective”​ ​state.​ ​ ​As​ ​the​ ​neuron​ ​continues​ ​to​ ​receive​ ​more​ ​excitatory​ ​dendritic​ ​responses, the​ ​soma​ ​depolarizes​ ​to​ ​a​ ​point​ ​where​ ​it​ ​fires​ ​action​ ​potentials​ ​(spikes​ ​or​ ​pulses​ ​of​ ​electrical​ ​potential) along​ ​the​ ​neuron’s​ ​axon.​ ​ ​These​ ​action​ ​potentials​ ​are​ ​the​ ​neuron’s​ ​output​ ​response​ ​signal,​ ​temporal markers​ ​indicating​ ​the​ ​occurrence​ ​of​ ​enough​ ​specific​ ​stimuli​ ​within​ ​a​ ​time​ ​range.​ ​ ​Conversely​ ​when​ ​a David​ ​Di​ ​Giorgio​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​6/22 Simple​ ​Cortex:​ ​A​ ​Model​ ​of​ ​Cells​ ​in​ ​the​ ​Sensory​ ​Nervous​ ​System neuron​ ​receives​ ​enough​ ​inhibitory​ ​synaptic​ ​neurotransmitter​ ​input,​ ​it​ ​is​ ​repolarized​ ​and​ ​put​ ​in​ ​an​ ​inactive state​ ​(no​ ​spikes​ ​or​ ​spiking​ ​very​ ​slowly).​ ​ ​Neural​ ​inhibition​ ​is​ ​an​ ​important​ ​principle​ ​of​ ​sensory​ ​nervous systems.​ ​ ​It​ ​has​ ​been​ ​observed​ ​among​ ​all​ ​areas​ ​within​ ​the​ ​neocortex​ ​the​ ​activity​ ​of​ ​neurons​ ​is​ ​“sparse”​ ​[6] (i.e.,​ ​from​ ​a​ ​population​ ​of​ ​neurons​ ​only​ ​a​ ​very​ ​small​ ​percentage​ ​are​ ​ ​active​ ​in​ ​a​ ​given​ ​moment​ ​while​ ​the rest​ ​are​ ​inactive).​ ​ ​Thus​ ​inhibition​ ​is​ ​how​ ​sensory​ ​nervous​ ​systems​ ​process​ ​and​ ​learn​ ​only​ ​the​ ​most important​ ​information​ ​from​ ​a​ ​complex​ ​dynamic​ ​environment. Figure​ ​2.3​​ ​-​ ​Example​ ​of​ ​neural​ ​sensation.​ ​ ​Excitatory​ ​(cyan)​ ​and​ ​Inhibitory​ ​(magenta)​ ​neurotransmitters are​ ​released​ ​from​ ​pre-synaptic​ ​axons​ ​within​ ​a​ ​time​ ​range.​ ​(A)​​ ​A​ ​single​ ​dendrite​ ​has​ ​received​ ​enough excitatory​ ​input​ ​to​ ​depolarize​ ​the​ ​neuron,​ ​putting​ ​it​ ​in​ ​a​ ​“predictive”​ ​state.​ ​ ​(B)​​ ​Multiple​ ​dendrites​ ​have received​ ​enough​ ​excitatory​ ​input​ ​to​ ​activate​ ​the​ ​neuron​ ​which​ ​outputs​ ​action​ ​potentials.​ ​ ​(C)​​ ​Enough dendrites​ ​have​ ​received​ ​enough​ ​inhibitory​ ​input​ ​to​ ​suppress​ ​the​ ​neuron’s​ ​activation. David​ ​Di​ ​Giorgio​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​7/22 Simple​ ​Cortex:​ ​A​ ​Model​ ​of​ ​Cells​ ​in​ ​the​ ​Sensory​ ​Nervous​ ​System 2.3​ ​ ​ ​Synaptic​ ​Plasticity Synapses​ ​form​ ​memories​ ​from​ ​observed​ ​knowledge​ ​simply​ ​by​ ​growing​ ​towards​ ​active​ ​stimuli​ ​and shrinking​ ​away​ ​from​ ​inactive​ ​stimuli​ ​[7]​.​ ​ ​This​ ​effect​ ​is​ ​called​ ​Hebbian​ ​Learning,​ ​a​ ​dendritic​ ​and​ ​synaptic behavior​ ​much​ ​like​ ​plants​ ​that​ ​grow​ ​towards​ ​light​ ​for​ ​sustenance​ ​and​ ​shrink​ ​away​ ​from​ ​darkness.​ ​ ​As stimuli​ ​evolves​ ​over​ ​time,​ ​synapses​ ​connected​ ​to​ ​constantly​ ​recurring​ ​active​ ​stimuli​ ​strengthen​ ​and become​ ​more​ ​permanent​ ​while​ ​synapses​ ​connected​ ​to​ ​rarely​ ​recurring​ ​active​ ​stimuli​ ​weaken​ ​and​ ​become more​ ​easily​ ​forgotten.​ ​ ​It​ ​has​ ​been​ ​observed​ ​that​ ​synapses​ ​form​ ​and​ ​reform​ ​within​ ​a​ ​span​ ​of​ ​milliseconds (short​ ​term​ ​memory)​ ​[6]​​ ​while​ ​some​ ​synaptic​ ​connections​ ​last​ ​an​ ​entire​ ​lifetime​ ​(long​ ​term​ ​memory).​ ​ ​It​ ​is from​ ​this​ ​simple​ ​behavior​ ​that​ ​biological​ ​sensory​ ​nervous​ ​systems​ ​adapt​ ​their​ ​memories​ ​to​ ​a​ ​dynamically changing​ ​complex​ ​environment. Figure​ ​2.4​​ ​-​ ​Example​ ​of​ ​synaptic​ ​learning​ ​between​ ​neurons.​ ​ (​ A)​​ ​The​ ​synapses​ ​of​ ​the​ ​post-synaptic neuron​ ​have​ ​previously​ ​formed​ ​connections​ ​with​ ​the​ ​axons​ ​of​ ​pre-synaptic​ ​neurons.​ ​ ​The​ ​thickness​ ​of​ ​the connection,​ ​indicated​ ​by​ ​the​ ​line​ ​between​ ​axon​ ​and​ ​synapse,​ ​represents​ ​the​ ​connective​ ​permanence​ ​(or strength)​ ​of​ ​the​ ​synapse.​ ​ (​ B)​​ ​When​ ​the​ ​pre-synaptic​ ​neurons​ ​activate​ ​and​ ​output​ ​action​ ​potentials,​ ​the post-synaptic​ ​neuron’s​ ​synapses​ ​grow​ ​towards​ ​active​ ​axons​ ​and​ ​shrink​ ​away​ ​from​ ​inactive​ ​axons. 3​ ​ ​ ​Simple​ ​Cortex​ ​Model The​ ​Simple​ ​Cortex​ ​model​ ​of​ ​neurons​ ​is​ ​based​ ​on​ ​the​ ​sensory-receptor​ ​concepts​ ​discussed​ ​in​ ​Section​ ​1.1 Sensation​ ​and​ ​neocortical​ ​structures​ ​and​ ​behavior​ ​discussed​ ​in​ ​Section​ ​2​ ​The​ ​Neocortex.​ ​ ​Concepts​ ​like spike​ ​timing,​ ​synaptic​ ​plasticity,​ ​inhibition,​ ​and​ ​neural​ ​structures​ ​are​ ​applied​ ​to​ ​SC.​ ​ ​The​ ​following​ ​terms are​ ​used​ ​in​ ​the​ ​architecture​ ​of​ ​this​ ​model​ ​in​ ​Section​ ​3.7​ ​Architecture. David​ ​Di​ ​Giorgio​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​8/22 Simple​ ​Cortex:​ ​A​ ​Model​ ​of​ ​Cells​ ​in​ ​the​ ​Sensory​ ​Nervous​ ​System 3.1​ ​ ​ ​Stimuli A​ ​SC​ ​stimuli​ ​is​ ​simply​ ​the​ ​input(s)​ ​and/or​ ​output​ ​of​ ​SC​ ​neurons.​ ​ ​Examples​ ​include​ ​data​ ​from​ ​sensors, motor/actuators,​ ​and​ ​action​ ​potentials​ ​(active​ ​neurons)​ ​or​ ​depolarized​ ​somas​ ​(predicted​ ​neurons). Stimuli​ ​data​ ​is​ ​stored​ ​and​ ​processed​ ​using​ ​one​ ​data​ ​vector: ● sStates​:​ ​“Stimuli​ ​States”​ ​is​ ​a​ ​binary​ ​vector​ ​where​ ​each​ ​value​ ​represents​ ​whether​ ​a​ ​stimulus​ ​is “active”​ ​or​ ​“inactive”. 3.2​ ​ ​ ​Synapse A​ ​SC​ ​synapse​ ​is​ ​a​ ​receptor​ ​that​ ​responds​ ​to​ ​stimulus​ ​and​ ​has​ ​memory.​ ​ ​A​ ​synapse​ ​behaves​ ​using Hebbian-like​ ​synaptic​ ​learning​ ​rules​ ​(inspired​ ​by​ ​HTM)​ ​found​ ​in​ ​Section​ ​4​ ​Algorithms​ ​of​ ​this​ ​paper. Because​ ​neuroscience​ ​suggests​ ​the​ ​synapse​ ​is​ ​the​ ​most​ ​fundamental​ ​memory​ ​storage​ ​of​ ​the​ ​neocortex, the​ ​synaptic​ ​data​ ​is​ ​a​ ​model​ ​of​ ​observed​ ​stimuli​ ​over​ ​time.​ ​ ​ ​Synapse​ ​data​ ​is​ ​stored​ ​and​ ​processed​ ​using two​ ​vectors: ● sAddrs​:​ ​“Synapse​ ​Addresses”​ ​is​ ​vector​ ​where​ ​each​ ​value​ ​represents​ ​where​ ​a​ ​synapse​ ​is connected​ ​to​ ​a​ ​stimulus​ ​location. ● sPerms​:​ ​“Synapse​ ​Permanences”​ ​is​ ​a​ ​vector​ ​where​ ​each​ ​value​ ​represents​ ​how​ ​strongly​ ​a​ ​synapse is​ ​connected,​ ​from​ ​0​ ​to​ ​99. 3.3​ ​ ​ ​Dendrite A​ ​SC​ ​dendrite​ ​is​ ​a​ ​collection​ ​of​ ​synapses​ ​with​ ​a​ ​threshold​ ​value.​ ​ ​When​ ​enough​ ​synapses​ ​are​ ​connected to​ ​active​ ​stimuli​ ​the​ ​dendrite​ ​activates,​ ​representing​ ​the​ ​occurrence​ ​of​ ​a​ ​recognized​ ​pattern.​ ​ ​The threshold​ ​value​ ​is​ ​a​ ​user-defined​ ​percentage​ ​of​ ​the​ ​total​ ​number​ ​of​ ​synapses​ ​on​ ​the​ ​dendrite.​ ​ ​Threshold percentages​ ​below​ ​100%​ ​allow​ ​for​ ​pattern​ ​recognition​ ​in​ ​noisy​ ​environments​ ​because​ ​only​ ​a​ ​subset​ ​of learned​ ​stimuli​ ​needs​ ​to​ ​be​ ​present​ ​to​ ​activate​ ​the​ ​dendrite.​ ​ ​Dendrite​ ​data​ ​is​ ​stored​ ​and​ ​processed​ ​using one​ ​vector​ ​and​ ​one​ ​value: ● dOverlap​:​ ​“Dendrite​ ​Overlaps”​ ​is​ ​a​ ​vector​ ​where​ ​each​ ​value​ ​represents​ ​how​ ​many​ ​synapses​ ​on​ ​a dendrite​ ​are​ ​connected​ ​to​ ​active​ ​stimuli​ ​during​ ​a​ ​time​ ​step. ● dThresh​:​ ​“Dendrite​ ​Threshold”​ ​is​ ​an​ ​value​ ​that​ ​represents​ ​the​ ​minimum​ ​dendrite​ ​overlap​ ​value required​ ​to​ ​activate​ ​the​ ​dendrite. David​ ​Di​ ​Giorgio​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​9/22 Simple​ ​Cortex:​ ​A​ ​Model​ ​of​ ​Cells​ ​in​ ​the​ ​Sensory​ ​Nervous​ ​System 3.4​ ​ ​ ​Forest A​ ​SC​ ​forest​ ​is​ ​a​ ​collection​ ​of​ ​one​ ​dendrite​ ​from​ ​all​ ​neurons​ ​in​ ​a​ ​SC​ ​area.​ ​ It​ ​is​ ​used​ ​to​ ​organize​ ​data buffers​ ​for​ ​more​ ​efficient​ ​computational​ ​parallelization​ ​and​ ​storage​ ​of​ ​synaptic​ ​memories.​ ​ SC​ ​forests represent​ ​dendrites​ ​in​ ​a​ ​cortical​ ​area​ ​that​ ​respond​ ​to​ ​stimuli​ ​that​ ​share​ ​the​ ​same​ ​receptive​ ​field.​ ​ For example,​ ​a​ ​SC​ ​area​ ​may​ ​have​ ​100​ ​neurons​ ​with​ ​5​ ​dendrites​ ​each.​ ​ In​ ​this​ ​example,​ ​all​ ​first​ ​dendrites​ ​of​ ​the 100​ ​neurons​ ​form​ ​a​ ​forest​ ​where​ ​these​ ​dendrites​ ​only​ ​respond​ ​to​ ​a​ ​window​ ​of​ ​pixels​ ​in​ ​the​ ​top​ ​left​ ​of​ ​an input​ ​space.​ ​ The​ ​synapse​ ​addresses​ ​and​ ​permanences​ ​of​ ​these​ ​dendrites​ ​would​ ​be​ ​stored​ ​in​ ​one​ ​sAddrs buffer​ ​and​ ​one​ ​sPerms​ ​vector​ ​and​ ​these​ ​vectors​ ​would​ ​respond​ ​to​ ​and​ ​learn​ ​from​ ​one​ ​stimuli​ ​buffer. Continuing​ ​the​ ​example,​ ​all​ ​second​ ​dendrites​ ​of​ ​the​ ​100​ ​neurons​ ​would​ ​form​ ​another​ ​forest,​ ​and​ ​so​ ​on. 3.5​ ​ ​ ​Neuron A​ ​SC​ ​neuron​ ​is​ ​a​ ​collection​ ​of​ ​dendrites​ ​with​ ​a​ ​threshold​ ​and​ ​models​ ​the​ ​output​ ​of​ ​action​ ​potentials (neuron​ ​activations)​ ​and​ ​soma​ ​depolarization​ ​(neuron​ ​predictions).​ ​ ​A​ ​SC​ ​neuron​ ​learns​ ​and​ ​responds​ ​to dendrite​ ​activation​ ​patterns​ ​that​ ​happen​ ​coincidentally​ ​or​ ​sequentially.​ ​ ​An​ ​example​ ​of​ ​neuron​ ​activation due​ ​to​ ​coincident​ ​stimuli​ ​is​ ​shown​ ​in​ ​the​ ​Encode​ ​and​ ​Learn​ ​steps​ ​in​ ​Figure​ ​4.1​ ​found​ ​in​ ​section​ ​4 Algorithms.​ ​ ​Once​ ​a​ ​coincidence​ ​or​ ​sequence​ ​has​ ​been​ ​learned,​ ​a​ ​neuron​ ​can​ ​use​ ​the​ ​occurrence​ ​of​ ​one or​ ​more​ ​learned​ ​dendrite​ ​activations​ ​to​ ​enter​ ​a​ ​predictive​ ​state.​ ​ ​A​ ​neuron​ ​in​ ​a​ ​predictive​ ​state​ ​implies​ ​the occurrence​ ​a​ ​dendritic​ ​pattern,​ ​even​ ​if​ ​that​ ​dendrite​ ​was​ ​not​ ​activated​ ​through​ ​observed​ ​stimuli.​ ​ ​An example​ ​of​ ​neuron​ ​prediction​ ​is​ ​also​ ​shown​ ​in​ ​the​ ​Predict​ ​and​ ​Decode​ ​steps​ ​in​ ​Figure​ ​4.1.​ ​ ​Neuron​ ​data​ ​is stored​ ​and​ ​processed​ ​using​ ​three​ ​vectors​ ​and​ ​one​ ​(or​ ​more)​ ​value(s): ● nOverlaps​:​ ​“Neuron​ ​Overlaps”​ ​is​ ​a​ ​vector​ ​where​ ​each​ ​value​ ​represents​ ​how​ ​many​ ​dendrites​ ​on​ ​a neuron​ ​are​ ​active​ ​during​ ​a​ ​time​ ​step. ● nStates​:​ ​“Neuron​ ​States”​ ​is​ ​a​ ​binary​ ​vector​ ​where​ ​each​ ​value​ ​represents​ ​whether​ ​a​ ​neuron​ ​is “active”​ ​or​ ​“inactive”. ● nBoosts​:​ ​“Neuron​ ​Boosts”​ ​is​ ​a​ ​vector​ ​where​ ​each​ ​value​ ​represents​ ​how​ ​often​ ​a​ ​neuron​ ​is​ ​inactive. In​ ​the​ ​SC​ ​algorithms,​ ​neurons​ ​activated​ ​less​ ​frequently​ ​are​ ​more​ ​likely​ ​to​ ​become​ ​active​ ​when learning​ ​new​ ​patterns. ● nThresh​:​ ​“Neuron​ ​Threshold”​ ​is​ ​a​ ​value​ ​that​ ​represents​ ​the​ ​minimum​ ​neuron​ ​overlap​ ​value required​ ​to​ ​activate​ ​the​ ​neuron.​ ​ ​Additionally,​ ​there​ ​may​ ​be​ ​another​ ​threshold​ ​value​ ​that represents​ ​the​ ​minimum​ ​neuron​ ​overlap​ ​value​ ​required​ ​to​ ​predict​ ​the​ ​neuron. David​ ​Di​ ​Giorgio​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​10/22 Simple​ ​Cortex:​ ​A​ ​Model​ ​of​ ​Cells​ ​in​ ​the​ ​Sensory​ ​Nervous​ ​System 3.6​ ​ ​ ​Area A​ ​SC​ ​area​ ​is​ ​a​ ​collection​ ​of​ ​neurons​ ​governed​ ​by​ ​activation,​ ​inhibition,​ ​and​ ​boosting​ ​rules​ ​found​ ​in​ ​section 4​ ​Algorithms.​ ​ ​Confident​ ​neurons,​ ​those​ ​that​ ​have​ ​many​ ​active​ ​dendrites,​ ​inhibit​ ​the​ ​activation​ ​of uncertain​ ​neurons,​ ​those​ ​that​ ​have​ ​few​ ​to​ ​no​ ​active​ ​dendrites.​ ​ ​If​ ​there​ ​are​ ​no​ ​confident​ ​neurons,​ ​a completely​ ​new​ ​pattern​ ​has​ ​been​ ​observed.​ ​ ​Therefore​ ​the​ ​neuron​ ​with​ ​the​ ​largest​ ​boost​ ​value, representing​ ​the​ ​neuron​ ​activated​ ​the​ ​least​ ​frequently,​ ​is​ ​activated​ ​so​ ​that​ ​it​ ​may​ ​apply​ ​the​ ​synaptic learning​ ​rules​ ​to​ ​memorize​ ​the​ ​new​ ​pattern.​ ​ ​Eventually​ ​every​ ​synapse​ ​in​ ​a​ ​SC​ ​area​ ​will​ ​have​ ​memories.​ ​ ​In this​ ​situation​ ​when​ ​a​ ​new​ ​pattern​ ​is​ ​observed,​ ​a​ ​SC​ ​area​ ​simply​ ​activates​ ​the​ ​neuron​ ​with​ ​the​ ​largest boost​ ​value​ ​and​ ​applies​ ​the​ ​synaptic​ ​learning​ ​rules.​ ​ ​Thus​ ​in​ ​SC​ ​only​ ​the​ ​most​ ​commonly​ ​recurring observed​ ​coincident​ ​or​ ​sequential​ ​patterns​ ​will​ ​be​ ​remembered​ ​while​ ​rare​ ​and​ ​irrelevant​ ​knowledge​ ​is forgotten. 3.7​ ​ ​ ​Simple​ ​Cortex​ ​Architecture The​ ​data​ ​vectors​ ​explained​ ​in​ ​this​ ​section​ ​use​ ​similar​ ​nomenclature​ ​found​ ​in​ ​neuroscience.​ ​ ​Figure​ ​3.1 provides​ ​a​ ​visual​ ​example​ ​of​ ​a​ ​SC​ ​sequence​ ​learning​ ​model​ ​via​ ​neural​ ​output​ ​feedback. David​ ​Di​ ​Giorgio​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​11/22 Simple​ ​Cortex:​ ​A​ ​Model​ ​of​ ​Cells​ ​in​ ​the​ ​Sensory​ ​Nervous​ ​System Figure​ ​3.1​​ ​-​ (​ A)​​ ​A​ ​visual​ ​example​ ​of​ ​SC​ ​area​ ​containing​ ​a​ ​flow​ ​diagram​ ​of​ ​stimuli,​ ​synapses,​ ​dendrites, forests,​ ​and​ ​neurons.​ ​ ​Synapses​ ​contained​ ​in​ ​the​ ​blue​ ​and​ ​red​ ​colored​ ​forests​ ​respond​ ​to​ ​stimulus​ ​in​ ​the their​ ​respective​ ​stimuli​ ​vector.​ ​ ​If​ ​the​ ​dendritic​ ​overlap​ ​value​ ​exceeds​ ​the​ ​dendritic​ ​threshold​ ​(enough synapses​ ​detect​ ​their​ ​stimulus),​ ​the​ ​dendrite​ ​is​ ​considered​ ​“active”.​ ​ ​The​ ​same​ ​overlap​ ​process​ ​is​ ​done for​ ​neuron​ ​selection,​ ​but​ ​with​ ​inhibition​ ​and​ ​boosting​ ​rules​ ​explained​ ​in​ ​Section​ ​3.5​ ​Neuron.​ ​ ​Note,​ ​neuron states​ ​are​ ​fed​ ​back​ ​into​ ​stimuli​ ​1.​ ​ ​This​ ​feedback​ ​is​ ​not​ ​required​ ​in​ ​every​ ​SC​ ​implementation,​ ​but​ ​its​ ​use​ ​is crucial​ ​to​ ​learning​ ​sequences​ ​of​ ​neuron​ ​activations.​ ​ ​Additionally,​ ​SC​ ​is​ ​not​ ​limited​ ​to​ ​the​ ​amount​ ​of structures​ ​shown​ ​in​ ​the​ ​example​ ​and​ ​therefore​ ​may​ ​have​ ​as​ ​many​ ​stimuli,​ ​synapses​ ​per​ ​dendrite, dendrites​ ​per​ ​neuron,​ ​and​ ​neurons​ ​as​ ​required.​ ​ ​(B)​​ ​For​ ​comparison,​ ​a​ ​visual​ ​example​ ​of​ ​biological neurons​ ​has​ ​been​ ​provided. 4​ ​ ​ ​Simple​ ​Cortex​ ​Algorithms The​ ​Simple​ ​Cortex​ ​algorithms​ ​are​ ​based​ ​on​ ​the​ ​sensory-receptor​ ​concepts​ ​discussed​ ​in​ ​Section​ ​1 Introduction​ ​and​ ​neocortical​ ​structures​ ​and​ ​behavior​ ​discussed​ ​in​ ​Section​ ​2​ ​The​ ​Neocortex.​ ​ ​Concepts like​ ​spike​ ​timing,​ ​synaptic​ ​plasticity,​ ​inhibition,​ ​and​ ​neural​ ​structures​ ​are​ ​applied​ ​to​ ​SC.​ ​ ​The​ ​following terms​ ​are​ ​used​ ​in​ ​Section​ ​3.7​ ​Behavior. 4.1​ ​ ​ ​Set​ ​Stimuli The​ ​SC​ ​Set​ ​Stimuli​ ​algorithm​ ​is​ ​equivalent​ ​to​ ​HTM​ ​Theory’s​ ​Encode​ ​algorithms.​ ​ ​Both​ ​simply​ ​convert scalar​ ​arrays​ ​or​ ​numbers​ ​like​ ​pixel​ ​values​ ​or​ ​audio​ ​frequency​ ​to​ ​binary​ ​vectors​ ​representing​ ​“active”​ ​and “inactive”​ ​states. 4.2​ ​ ​ ​Encode The​ ​SC​ ​Encode​ ​algorithm​ ​is​ ​fundamentally​ ​a​ ​pattern​ ​recognizer.​ ​ ​It​ ​outputs​ ​a​ ​binary​ ​vector​ ​representing “active”/”inactive”​ ​neuron​ ​states​ ​by​ ​observing​ ​stimuli​ ​vectors​ ​and​ ​comparing​ ​them​ ​with​ ​the​ ​architecture’s synaptic​ ​memories​ ​stored​ ​in​ ​forests.​ ​ ​Encode​ ​consists​ ​of​ ​four​ ​steps: 1. For​ ​every​ ​forest,​ ​overlap​ ​synapses​ ​with​ ​stimuli.​ ​ ​See​ ​“overlapSynapses”​ ​in​ ​Supporting​ ​Information section​ ​for​ ​pseudocode​ ​details. 2. Activate​ ​neurons​ ​using​ ​the​ ​previously​ ​calculated​ ​dendrite​ ​overlap​ ​values.​ ​ ​Increment​ ​all​ ​boost values.​ ​ ​See​ ​“activateNeurons”​ ​in​ ​Supporting​ ​Information​ ​section​ ​for​ ​pseudocode​ ​details. David​ ​Di​ ​Giorgio​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​12/22 Simple​ ​Cortex:​ ​A​ ​Model​ ​of​ ​Cells​ ​in​ ​the​ ​Sensory​ ​Nervous​ ​System 3. If​ ​there​ ​are​ ​no​ ​confident​ ​neurons,​ ​meaning​ ​no​ ​inhibition​ ​occurs,​ ​activate​ ​neurons​ ​with​ ​highest boost​ ​value. 4. Zero​ ​active​ ​neuron(s)​ ​boost​ ​values. 4.3​ ​ ​ ​Learn The​ ​SC​ ​Learn​ ​algorithm​ ​occurs​ ​after​ ​the​ ​Encode​ ​step​ ​activates​ ​neurons.​ ​ ​It​ ​uses​ ​a​ ​modified​ ​Hebbian Learning​ ​style​ ​rules​ ​inspired​ ​by​ ​HTM​ ​Theory​ ​by​ ​updating​ ​synapse​ ​address​ ​and​ ​permanence​ ​values​ ​from the​ ​observed​ ​stimuli​ ​in​ ​the​ ​Encode​ ​step.​ ​ ​See​ ​“learnSynapses”​ ​in​ ​Supporting​ ​Information​ ​section​ ​for pseudocode​ ​details.​ ​ ​ ​Learn​ ​consists​ ​of​ ​one​ ​involved​ ​step: 1. For​ ​every​ ​active​ ​neuron,​ ​perform​ ​the​ ​following​ ​learning​ ​rules: ● Grow​ ​Synapses​:​ ​Increment​ ​the​ ​synapse​ ​permanence​ ​if​ ​the​ ​synapse​ ​address​ ​of​ ​its​ ​connected stimulus​ ​is​ ​active.​ ​ ​Synapses​ ​that​ ​“grow”​ ​are​ ​connected​ ​to​ ​a​ ​stimulus​ ​that​ ​occurred​ ​when expected.​ ​ ​Larger​ ​permanence​ ​values​ ​represent​ ​a​ ​more​ ​lasting​ ​connection​ ​with​ ​the​ ​stimulus stored​ ​in​ ​the​ ​synapse​ ​address. ● Shrink​ ​Synapses​:​ ​Decrement​ ​the​ ​synapse​ ​permanence​ ​if​ ​the​ ​the​ ​synapse​ ​address​ ​of​ ​its connected​ ​stimulus​ ​is​ ​inactive.​ ​ ​Synapses​ ​that​ ​“shrink”​ ​are​ ​connected​ ​to​ ​a​ ​stimulus​ ​that​ ​did​ ​not occur​ ​when​ ​expected.​ ​ ​Smaller​ ​permanence​ ​values​ ​represent​ ​a​ ​synapse​ ​connection​ ​highly susceptible​ ​to​ ​moving​ ​to​ ​a​ ​new​ ​stimulus. ● Move​ ​Synapses​:​ ​If​ ​a​ ​synapse​ ​permanence​ ​is​ ​0​ ​(representing​ ​an​ ​unconnected​ ​synapse),​ ​set​ ​the stimulus​ ​address​ ​to​ ​an​ ​unused​ ​stimulus​ ​and​ ​reset​ ​the​ ​synapse​ ​permanence​ ​to​ ​1.​ ​ ​Therefore, synapses​ ​“move”​ ​towards​ ​recurring​ ​active​ ​stimulus​ ​and​ ​away​ ​from​ ​inactive​ ​stimulus. 4.4​ ​ ​ ​Predict The​ ​SC​ ​Predict​ ​algorithm​ ​functions​ ​like​ ​the​ ​Encode​ ​algorithm,​ ​but​ ​without​ ​the​ ​neuron​ ​inhibition​ ​and boosting​ ​rules.​ ​ ​It​ ​outputs​ ​a​ ​binary​ ​vector​ ​representing​ ​“predict”/”inactive”​ ​neuron​ ​states​ ​by​ ​observing​ ​one or​ ​more​ ​stimuli​ ​vectors​ ​and​ ​comparing​ ​them​ ​with​ ​the​ ​architecture’s​ ​synaptic​ ​memories​ ​stored​ ​in​ ​forests. Predict​ ​consists​ ​of​ ​two​ ​steps: 1. For​ ​each​ ​specified​ ​forest,​ ​overlap​ ​synapses​ ​with​ ​stimuli.​ ​ ​See​ ​“overlapSynapses”​ ​in​ ​Supporting Information​ ​section​ ​for​ ​pseudocode​ ​details. David​ ​Di​ ​Giorgio​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​13/22 Simple​ ​Cortex:​ ​A​ ​Model​ ​of​ ​Cells​ ​in​ ​the​ ​Sensory​ ​Nervous​ ​System 2. Predict​ ​neurons​ ​using​ ​the​ ​previously​ ​calculated​ ​dendrite​ ​overlap​ ​values.​ ​ ​See​ ​“predictNeurons”​ ​in Supporting​ ​Information​ ​section​ ​for​ ​pseudocode​ ​details. 4.5​ ​ ​ ​Decode The​ ​SC​ ​Decode​ ​algorithm​ ​converts​ ​neuron​ ​activations​ ​or​ ​predictions​ ​back​ ​to​ ​stimuli​ ​patterns​ ​using synapse​ ​memories.​ ​ ​Decode​ ​consists​ ​of​ ​one​ ​step: 1. Activate​ ​stimuli​ ​based​ ​on​ ​the​ ​synapse​ ​addresses​ ​of​ ​active​ ​neurons.​ ​ ​See​ ​“decodeNeurons”​ ​in Supporting​ ​Information​ ​section​ ​for​ ​pseudocode​ ​details. 4.6​ ​ ​ ​Simple​ ​Cortex​ ​Behavior David​ ​Di​ ​Giorgio​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​14/22 Simple​ ​Cortex:​ ​A​ ​Model​ ​of​ ​Cells​ ​in​ ​the​ ​Sensory​ ​Nervous​ ​System Figure​ ​4.1​​ -​ ​ ​Example​ ​of​ ​SC​ ​algorithms​ ​using​ ​an​ ​architecture​ ​with​ ​2​ ​stimuli,​ ​2​ ​dendrites​ ​per​ ​neuron,​ ​and​ ​1 neuron​ ​per​ ​area.​ ​(A)​​ S ​ timuli​ ​0​ ​is​ ​a​ ​binary​ ​vector​ ​representing​ ​a​ ​picture​ ​of​ ​a​ ​duck​ ​and​ ​stimuli​ ​1​ ​is​ ​a​ ​binary vector​ ​representing​ ​a​ ​duck’s​ ​“quack”​ ​sound.​ ​ Encode​ ​algorithm​ ​is​ ​run​ ​on​ ​a​ ​neuron​ ​with​ ​no​ ​memories (unconnected​ ​address​ ​and​ ​zero​ ​permanence).​ ​ Neurons​ ​are​ ​activated​ ​based​ ​on​ ​the​ ​rules​ ​discussed below..​ (​ B)​​ L ​ earn​ ​algorithm​ ​modifies​ ​the​ ​synapses​ ​of​ ​active​ ​neurons​ ​based​ ​on​ ​the​ ​rules​ ​discussed​ ​below (C)​​ P ​ redict​ ​algorithm​ ​selects​ ​neurons​ ​based​ ​on​ ​learned​ ​knowledge.​ ​ ​(D)​​ D ​ ecode​ ​algorithm​ ​activates stimuli​ ​from​ ​the​ ​synapse​ ​addresses​ ​of​ ​predicted​ ​neurons. 5​ ​ ​ ​Results The​ ​Simple​ ​Cortex​ ​architecture​ ​and​ ​algorithms​ ​detailed​ ​in​ ​this​ ​paper​ ​have​ ​been​ ​implemented​ ​in​ ​C++​ ​using OpenCL​ ​1.2​ ​for​ ​use​ ​on​ ​both​ ​CPU​ ​and​ ​CPU/GPU​ ​platforms.​ ​ ​The​ ​implementation​ ​runs​ ​on​ ​Windows​ ​and Linux​ ​machines​ ​and​ ​is​ ​available​ ​at​ ​https://github.com/ddigiorg/simple-cortex. A​ ​demo​ ​has​ ​been​ ​created​ ​to​ ​demonstrate​ ​Simple​ ​Cortex’s​ ​ability​ ​to​ ​recognize,​ ​learn,​ ​and​ ​predict sequences​ ​of​ ​observed​ ​patterns.​ ​ ​It​ ​contains​ ​a​ ​100x100​ ​pixel​ ​environment​ ​with​ ​a​ ​circular​ ​ball​ ​made​ ​of​ ​49 pixels.​ ​ ​The​ ​ball​ ​is​ ​governed​ ​by​ ​simple​ ​2D​ ​physics​ ​rules:​ ​acceleration​ ​towards​ ​the​ ​ground​ ​due​ ​to​ ​gravity and​ ​energy​ ​loss​ ​due​ ​to​ ​bouncing​ ​off​ ​the​ ​ground​ ​and​ ​side​ ​walls.​ ​ ​The​ ​ball​ ​may​ ​have​ ​random​ ​(X,​ ​Y)​ ​initial start​ ​positions​ ​across​ ​the​ ​screen​ ​and​ ​random​ ​(X,​ ​ ​Y)​ ​initial​ ​velocities​ ​within​ ​a​ ​specified​ ​range​ ​of​ ​values. A​ ​SC​ ​architecture​ ​has​ ​been​ ​created​ ​in​ ​the​ ​ball​ ​demo​ ​containing​ ​1.5​ ​million​ ​neurons​ ​with​ ​2​ ​dendrites​ ​each. The​ ​first​ ​dendrite​ ​of​ ​every​ ​neuron​ ​has​ ​50​ ​synapses​ ​each,​ ​is​ ​contained​ ​in​ ​Forest​ ​0,​ ​and​ ​observes​ ​and learns​ ​from​ ​the​ ​input​ ​scene​ ​state​ ​stimuli​ ​vector.​ ​ ​The​ ​second​ ​dendrite​ ​of​ ​every​ ​neuron​ ​has​ ​1​ ​synapse each,​ ​is​ ​contained​ ​in​ ​Forest​ ​1,​ ​learns​ ​from​ ​the​ ​previous​ ​active​ ​neurons​ ​stimuli​ ​vector,​ ​and​ ​predicts​ ​the next​ ​time​ ​step’s​ ​active​ ​neurons​ ​from​ ​the​ ​current​ ​active​ ​neurons​ ​stimuli​ ​vector.​ ​ ​For​ ​every​ ​time​ ​step​ ​after Encode​ ​and​ ​Learn​ ​user​ ​may​ ​enable​ ​Forecast​ ​which​ ​loops​ ​Predict​ ​and​ ​Decode​ ​up​ ​to​ ​a​ ​specified​ ​amount. The​ ​length​ ​of​ ​the​ ​Forecast​ ​loop​ ​determines​ ​how​ ​far​ ​into​ ​the​ ​future​ ​SC​ ​predicts​ ​the​ ​ball’s​ ​potential trajectory.​ ​ ​See​ ​“Ball​ ​Demo”​ ​in​ ​Supporting​ ​Information​ ​section​ ​for​ ​pseudocode​ ​details. David​ ​Di​ ​Giorgio​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​15/22 Simple​ ​Cortex:​ ​A​ ​Model​ ​of​ ​Cells​ ​in​ ​the​ ​Sensory​ ​Nervous​ ​System Figure​ ​5.1​​ ​-​ ​Sample​ ​frames​ ​of​ ​Ball​ ​Demo​ ​showing​ ​Simple​ ​Cortex​ ​algorithms​ ​in​ ​action.​ ​ ​Green​ ​pixels represent​ ​input​ ​stimuli​ ​and​ ​blue​ ​pixels​ ​represent​ ​decoded​ ​predictions​ ​of​ ​ball​ ​trajectories​ ​up​ ​to​ ​20​ ​time steps​ ​into​ ​the​ ​future.​ ​ ​In​ ​the​ ​first​ ​example​ ​frame​ ​SC​ ​has​ ​no​ ​context​ ​where​ ​the​ ​ball​ ​is​ ​traveling​ ​so​ ​it predicts​ ​all​ ​trajectories​ ​it​ ​has​ ​observed​ ​based​ ​on​ ​past​ ​experience.​ ​ ​The​ ​2nd​ ​example​ ​frame​ ​shows​ ​that​ ​SC has​ ​more​ ​temporal​ ​context​ ​about​ ​the​ ​ball’s​ ​travel​ ​direction,​ ​so​ ​the​ ​predicted​ ​trajectories​ ​are​ ​refined.​ ​ ​By the​ ​3rd​ ​example​ ​frame​ ​SC​ ​is​ ​predicting​ ​only​ ​1​ ​trajectory,​ ​which​ ​turns​ ​out​ ​to​ ​be​ ​accurate​ ​based​ ​on​ ​the​ ​3rd and​ ​4th​ ​example​ ​frames. Ball​ ​Demo​ ​is​ ​benchmarked​ ​for​ ​speed​ ​using​ ​these​ ​parameters: ● Compute​ ​Device​:​ ​Nvidia​ ​GTX​ ​1070​ ​GPU ● Samples​:​ ​Mean​ ​and​ ​Standard​ ​Deviation​ ​values​ ​used​ ​100,000​ ​time​ ​step​ ​samples ● Neurons​:​ ​1.5​ ​million​ ​with​ ​2​ ​dendrites​ ​each ● Forest​ ​0​:​ ​50​ ​synapses​ ​per​ ​dendrite,​ ​25%​ ​activation​ ​threshold​ ​(13​ ​active​ ​stimuli​ ​required​ ​to activate​ ​dendrite) ● Forest​ ​1​:​ ​1​ ​synapse​ ​per​ ​dendrite ● Total​ ​Synapses​:​ ​76.5​ ​million ● Forecasting​:​ ​20​ ​predicts/decodes​ ​per​ ​time​ ​step Executed​ ​Algorithms Mean​ ​(ms) Std.​ ​Dev.​ ​(ms) Encode 6.72 0.00​1 Encode,​ ​Learn 7.44 4.24​2 21.76 4.47​2 Encode,​ ​Learn,​ ​x20​ ​Predict,​ ​x20​ ​Decode Table​ ​5.1​:​ ​Computation​ ​speeds​ ​(mean​ ​and​ ​standard​ ​deviation)​ ​per​ ​frame.​ ​(1)​​ ​Encode​ ​algorithm​ ​had​ ​S.D. less​ ​than​ ​1/100th​ ​of​ ​a​ ​millisecond​ ​and​ ​therefore​ ​written​ ​as​ ​0.00​ ​ms.​ (​ 2)​​ ​Learn​ ​algorithm​ ​causes​ ​high standard​ ​deviation​ ​due​ ​to​ ​unoptimized​ ​"move​ ​synapse"​ ​algorithm. Based​ ​on​ ​the​ ​numbers​ ​in​ ​Table​ ​1,​ ​Simple​ ​Cortex​ ​can​ ​encode​ ​and​ ​learn​ ​~10​ ​billion​ ​synapses/second according​ ​to​ ​compute​ ​speed​ ​benchmark​ ​(76.5​ ​million​ ​synapses​ ​in​ ​7.44​ ​ms).​ ​ ​The​ ​speed​ ​of​ ​recognizing patterns​ ​each​ ​frame​ ​is​ ​very​ ​consistent,​ ​however​ ​updating​ ​the​ ​synapses​ ​may​ ​cause​ ​slowdowns,​ ​probably due​ ​to​ ​the​ ​“move​ ​synapses”portion​ ​of​ ​the​ ​Learn​ ​algorithm. David​ ​Di​ ​Giorgio​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​16/22 Simple​ ​Cortex:​ ​A​ ​Model​ ​of​ ​Cells​ ​in​ ​the​ ​Sensory​ ​Nervous​ ​System 6​ ​ ​ ​Conclusions​ ​&​ ​Future​ ​Work This​ ​paper​ ​has​ ​discussed​ ​the​ ​principles​ ​of​ ​sensation​ ​and​ ​neocortical​ ​intelligence.​ ​ ​Additionally,​ ​it​ ​has presented​ ​a​ ​new​ ​straightforward​ ​neural​ ​model​ ​based​ ​on​ ​the​ ​architecture​ ​and​ ​behavior​ ​of​ ​the​ ​neocortex. A​ ​Simple​ ​Cortex​ ​implementation​ ​has​ ​been​ ​built​ ​to​ ​observe,​ ​learn​ ​and​ ​predict​ ​spatio-temporal sensory-motor​ ​patterns​ ​and​ ​sequences.​ ​ ​Simple​ ​Cortex​ ​is: ● Simple​:​ ​No​ ​sophisticated​ ​knowledge​ ​of​ ​mathematics​ ​required ● Unsupervised​:​ ​Stores​ ​knowledge​ ​through​ ​observation​ ​with​ ​no​ ​labeled​ ​data​ ​necessary ● On-line​:​ ​Observes​ ​and​ ​learns​ ​continuously​ ​like​ ​biological​ ​intelligence ● Dynamic​:​ ​memories​ ​adapt​ ​to​ ​new​ ​observations,​ ​prioritizing​ ​commonly​ ​recurring​ ​knowledge ● Predictive​:​ ​SC​ ​is​ ​able​ ​to​ ​predict​ ​neuron​ ​states​ ​many​ ​time​ ​steps​ ​into​ ​the​ ​future.​ ​It​ ​can​ ​also translate​ ​these​ ​neuron​ ​states​ ​back​ ​to​ ​observable​ ​data. ● Fast​:​ ​GPU​ ​parallel​ ​processing​ ​encodes​ ​and​ ​learns​ ​billions​ ​of​ ​synapses​ ​per​ ​second. However,​ ​Simple​ ​Cortex​ ​is​ ​still​ ​in​ ​its​ ​infancy​ ​and​ ​has​ ​a​ ​lot​ ​of​ ​room​ ​for​ ​growth.​ ​ ​Here​ ​are​ ​a​ ​few​ ​ideas, among​ ​many,​ ​for​ ​improvement​ ​and​ ​future​ ​investigation: ● It​ ​would​ ​be​ ​extremely​ ​beneficial​ ​to​ ​benchmark​ ​SC​ ​to​ ​NuPIC,​ ​OgmaNeo,​ ​and​ ​LSTM​ ​on​ ​sequence learning​ ​tasks.​ ​ ​Additionally,​ ​SC​ ​should​ ​be​ ​compared​ ​to​ ​traditional​ ​Deep​ ​Learning​ ​techniques​ ​on well​ ​known​ ​benchmarks​ ​like​ ​MNIST​ ​for​ ​handwritten​ ​digit​ ​recognition. ● Modify​ ​SC​ ​to​ ​process​ ​scalar​ ​stimuli​ ​data​ ​vectors​ ​like​ ​images​ ​with​ ​color​ ​pixel​ ​values.​ ​ ​In​ ​its​ ​current implementation​ ​SC​ ​only​ ​observes,​ ​learns,​ ​and​ ​predicts​ ​binary​ ​input​ ​stimuli.​ ​ ​This​ ​limits​ ​the implementation​ ​only​ ​to​ ​binary​ ​data​ ​sets. ● Create​ ​demos​ ​applied​ ​to​ ​stimuli​ ​like​ ​movement-receptive​ ​retinal​ ​ganglion​ ​cell​ ​models​ ​for advanced​ ​biologically-based​ ​object​ ​tracking. ● SC​ ​algorithms​ ​and​ ​it’s​ ​code​ ​implementation​ ​would​ ​benefit​ ​from​ ​optimization​ ​improvements, especially​ ​in​ ​the​ ​“move​ ​synapses”​ ​portion​ ​of​ ​the​ ​Learn​ ​algorithm,​ ​the​ ​biggest​ ​speed​ ​bottleneck. David​ ​Di​ ​Giorgio​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​17/22 Simple​ ​Cortex:​ ​A​ ​Model​ ​of​ ​Cells​ ​in​ ​the​ ​Sensory​ ​Nervous​ ​System Supporting​ ​Information Simple​ ​Cortex​ ​Basic​ ​Functions overlapSynapses​​ ​-​ ​This​ ​function​ ​modifies​ ​neuron​ ​overlap​ ​buffer.​ ​ ​For​ ​each​ ​neuron,​ ​every​ ​dendrite’s overlap​ ​is​ ​calculated​ ​by​ ​determining​ ​if​ ​enough​ ​synapses​ ​are​ ​connected​ ​to​ ​active​ ​stimuli.​ ​ ​If​ ​the​ ​dendrite overlap​ ​value​ ​beats​ ​the​ ​dendrite​ ​threshold​ ​value,​ ​then​ ​increment​ ​the​ ​neuron​ ​overlap​ ​value. 00​ ​ ​for​ ​n​ ​in​​ ​neurons 01​ ​ ​ ​ ​dendriteOverlap​ ​=​ ​0 02 03​ ​ ​ ​ ​for​​ ​s​ ​in​​ ​neuronSynapses 04​ ​ ​ ​ ​ ​ ​if​​ ​synapsePermanances[s]​ ​>​ ​0​ ​and​​ ​stimuliStates[synapseAddresses[s]]​ ​>​ ​0 05​ ​ ​ ​ ​ ​ ​ ​ ​dendriteOverlap++ 06 07​ ​ ​ ​ ​if​​ ​dendriteOverlap​ ​>=​ ​dendriteThreshold 08​ ​ ​ ​ ​ ​ ​neuronOverlaps[n]++ activateNeurons​​ ​-​ ​This​ ​function​ ​modifies​ ​neuron​ ​states​ ​buffer,​ ​neuron​ ​boosts​ ​buffer​ ​and​ ​inhibition​ ​flag value.​ ​ ​For​ ​each​ ​neuron,​ ​increment​ ​the​ ​boost​ ​value.​ ​ ​If​ ​the​ ​neuron​ ​overlap​ ​value​ ​beats​ ​the​ ​neuron activation​ ​threshold​ ​value​ ​(and​ ​therefore​ ​is​ ​considered​ ​a​ ​confident​ ​neuron),​ ​then​ ​zero​ ​the​ ​neuron​ ​boost value,​ ​set​ ​the​ ​neuron​ ​state​ ​to​ ​“active”,​ ​and​ ​set​ ​inhibition​ ​flag​ ​true. 00​ ​ ​for​​ ​n​ ​in​​ ​neurons 01​ ​ ​ ​ ​if​​ ​neuronBoosts[n]​ ​<​ ​synapseAddressMaximum 02​ ​ ​ ​ ​ ​ ​neuronBoosts[n]++ 03 04​ ​ ​ ​ ​if​​ ​neuronOverlaps[n]​ ​>=​ ​neuronThresholds 05​ ​ ​ ​ ​ ​ ​neuronBoosts[n]​ ​=​ ​0 06​ ​ ​ ​ ​ ​ ​neuronStates[n]​ ​=​ ​1 07​ ​ ​ ​ ​ ​ ​inhibitionFlag​ ​=​ ​true David​ ​Di​ ​Giorgio​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​18/22 Simple​ ​Cortex:​ ​A​ ​Model​ ​of​ ​Cells​ ​in​ ​the​ ​Sensory​ ​Nervous​ ​System learnSynapses​​ ​-​ ​This​ ​function​ ​modifies​ ​synapse​ ​address​ ​buffer​ ​and​ ​synapse​ ​permanence​ ​buffer​ ​by​ ​using the​ ​synaptic​ ​learning​ ​rules​ ​explained​ ​in​ ​section​ ​4.3​ ​Learn.​ ​ ​This​ ​function​ ​only​ ​applies​ ​to​ ​active​ ​neurons. Note:​ ​the​ ​move​ ​portion​ ​of​ ​this​ ​function​ ​is​ ​unoptimized. 00​ ​ ​for​​ ​n​ ​in​​ ​neurons 01​ ​ ​ ​ ​if​​ ​neuronStates[n]​ ​>​ ​0 02 03​ ​ ​ ​ ​ ​ ​//​ ​Grow​ ​and​ ​or​ ​Shrink 04​ ​ ​ ​ ​ ​ ​for​​ ​s​ ​in​​ ​neuronSynapses 05​ ​ ​ ​ ​ ​ ​ ​ ​if​​ ​synapsePermanences[s]​ ​>​ ​0 06​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​if​​ ​synapseStates[synapseAddresses[s]]​ ​>​ ​0 07​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​if​​ ​synapsePermenences[s]​ ​<​ ​synapsePermenenceMaximum 08​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​synapsePermenences[s]++ 09​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​else 10​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​synapsePermenences[s]-11 12​ ​ ​ ​ ​ ​ ​//​ ​Move 13​ ​ ​ ​ ​ ​ ​j​ ​=​ ​0 14 15​ ​ ​ ​ ​ ​ ​for​​ ​s​ ​in​​ ​neuronSynapses 16​ ​ ​ ​ ​ ​ ​ ​ ​if​​ ​synapsePermenences[s]​ ​==​ ​0 17​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​for​​ ​i​ ​starting​ ​at​​ ​j​ ​in​​ ​numStimuli 18​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​if​​ ​stimuliStates[i]​ ​>​ ​0 19​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​usedStimulusFlag​ ​=​ ​true 20 21​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​for​​ ​s2​ ​in​​ ​neuronSynapses 22​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​if​​ ​synapseaddresses[s2]​ ​==​ ​i 23​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​usedStimulusFlag​ ​=​ ​false 24​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​break 25 26​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​if​​ ​usedStimulusFlag​ ​==​ ​true 27​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​synapseAddresses[s]​ ​=​ ​i 28​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​synapsePermenences[s]​ ​=​ ​1 29​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​j​ ​=​ ​i​ ​+​ ​1 30​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​break David​ ​Di​ ​Giorgio​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​19/22 Simple​ ​Cortex:​ ​A​ ​Model​ ​of​ ​Cells​ ​in​ ​the​ ​Sensory​ ​Nervous​ ​System predictNeurons​​ ​-​ ​This​ ​function​ ​modifies​ ​the​ ​neuron​ ​states​ ​buffer.​ ​ ​For​ ​each​ ​neuron,​ ​if​ ​the​ ​neuron​ ​overlaps value​ ​beats​ ​the​ ​neuron​ ​predicted​ ​threshold​ ​value,​ ​set​ ​the​ ​neuron​ ​states​ ​to​ ​“predicted”. 00​ ​ ​for​​ ​n​ ​in​​ ​neurons 01​ ​ ​ ​ ​if​​ ​neuronOverlaps[n]​ ​>=​ ​neuronThreshold 03​ ​ ​ ​ ​ ​ ​neuronStates[n]​ ​=​ ​1 decodeNeurons​​ ​-​ ​This​ ​function​ ​modifies​ ​a​ ​specified​ ​stimuli​ ​states​ ​vector​ ​by​ ​setting​ ​the​ ​stimulus​ ​address “active”​ ​for​ ​every​ ​synapse​ ​address​ ​in​ ​a​ ​forest​ ​as​ ​long​ ​as​ ​its​ ​neuron​ ​is​ ​predicted. 00​ ​ ​for​​ ​n​ ​in​​ ​neurons 01​ ​ ​ ​ ​if​​ ​neuronStates[n]​ ​>​ ​0 01​ ​ ​ ​ ​ ​ ​for​​ ​s​ ​in​​ ​neuronSynapses 02​ ​ ​ ​ ​ ​ ​ ​ ​if​​ ​synapsePermanances[s]​ ​>​ ​0 03​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​stimuliStates[synapseAddresses[s]]​ ​=​ ​1 Ball​ ​Demo Use​ ​the​ ​example​ ​SC​ ​area​ ​in​ ​Figure​ ​3.1​ ​as​ ​a​ ​reference.​ ​ ​Stimuli​ ​0​ ​is​ ​a​ ​binary​ ​data​ ​vector​ ​representing “active”​ ​or​ ​“inactive”​ ​ball​ ​scene​ ​pixels​ ​(line​ ​3).​ ​It​ ​is​ ​encoded​ ​and​ ​learned​ ​in​ ​forest​ ​0​ ​(lines​ ​5​ ​and​ ​6).​ ​ ​Stimuli 1​ ​is​ ​a​ ​binary​ ​vector​ ​representing​ ​the​ ​previous​ ​“active”​ ​or​ ​“inactive”​ ​neuron​ ​states​ ​(line​ ​8).​ ​ ​It​ ​is​ ​encoded and​ ​learned​ ​in​ ​forest​ ​1,​ ​(lines​ ​5​ ​and​ ​6).​ ​ ​The​ ​code​ ​then​ ​loops​ ​for​ ​as​ ​many​ ​future​ ​time​ ​steps​ ​as​ ​specified (line​ ​10).​ ​ ​Stimuli​ ​2​ ​stores​ ​the​ ​current​ ​neuron​ ​states​ ​(line​ ​11),​ ​which​ ​is​ ​used​ ​with​ ​forest​ ​1​ ​to​ ​predict​ ​the next​ ​time​ ​step’s​ ​neuron​ ​states​ ​(line​ ​13).​ ​ ​Stimuli​ ​3​ ​stores​ ​the​ ​next​ ​time​ ​steps​ ​active​ ​stimuli,​ ​which​ ​is decoded​ ​from​ ​the​ ​synapses​ ​of​ ​predicted​ ​neuron​ ​states​ ​of​ ​forest​ ​0​ ​(line​ ​14).​ ​ ​These​ ​predictions​ ​are​ ​stored and​ ​remembered​ ​(lines​ ​16​ ​-​ ​18)​ ​for​ ​each​ ​forecast​ ​loop. 00​ ​ ​loop 01​ ​ ​ ​ ​ballScene.update() 02 03​ ​ ​ ​ ​stimuli[0].set(ballScene.data) 04 05​ ​ ​ ​ ​area.encode({stimuli[0],​ ​stimuli[1]},​ ​{forest[0],​ ​forest[1]}) 06​ ​ ​ ​ ​area.learn({stimuli[0],​ ​stimuli[1]},​ ​{forest[0],​ ​forest[1]}) 07 David​ ​Di​ ​Giorgio​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​20/22 Simple​ ​Cortex:​ ​A​ ​Model​ ​of​ ​Cells​ ​in​ ​the​ ​Sensory​ ​Nervous​ ​System 08​ ​ ​ ​ ​stimuli[1].set(area.nStates) 01 10​ ​ ​ ​ ​for​​ ​f​ ​in​​ ​numForecasts 11​ ​ ​ ​ ​ ​ ​stimuli[2].set(area.nStates) 12 13​ ​ ​ ​ ​ ​ ​area.predict({stimuli[2]},​ ​{forest[1]}) 14​ ​ ​ ​ ​ ​ ​area.decode({stimuli[3]},​ ​{forest[0]}) 15 16​ ​ ​ ​ ​ ​ ​for​​ ​p​ ​in​​ ​numPixels 17​ ​ ​ ​ ​ ​ ​ ​ ​if​​ ​stimuli[3].sStates​ ​>​ ​0 18​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​prediction[p]​ ​=​ ​1 Acknowledgements I​ ​thank​ ​Jeff​ ​Hawkins​1​​ ​and​ ​Numenta​ ​for​ ​their​ ​work​ ​on​ ​neocortical​ ​intelligence​ ​and​ ​NuPIC.​ ​ ​I​ ​thank​ ​Jacob Everist​3​,Jake​ ​Bruce​3​​ ​and​ ​other​ ​collaborators​ ​for​ ​their​ ​comments​ ​and​ ​ideas.​ ​ ​I​ ​thank​ ​Fergal​ ​Byrne​2​​ ​and​ ​Eric Laukien​2​​ ​for​ ​answering​ ​questions​ ​about​ ​Feynman​ ​Machine.​ ​ ​I​ ​thank​ ​Louis​ ​Savien​4​​ ​for​ ​our​ ​discussions​ ​on neocortical​ ​intelligence.​ ​ ​Finally​ ​I​ ​thank​ ​my​ ​friend​ ​and​ ​mentor,​ ​Frank​ ​Foote,​ ​for​ ​helping​ ​improve​ ​this​ ​paper. 1​ Numenta,​ 2​​ Ogma​ ​Intelligent​ ​Systems​ ​Corp.,​ 3​​ HTM​ ​Forum​ ​(discourse.numenta.org),​ 4​​ Rebel​ ​Science References [1] McCulloch,​ ​W.​ ​S.,​ ​and​ ​Pitts,​ ​W.​ ​(1943).​ ​A​ ​logical​ ​calculus​ ​of​ ​the​ ​ideas​ ​immanent​ ​in​ ​nervous activity.​ ​The​ ​bulletin​ ​of​ ​mathematical​ ​biophysics​ ​5(4):115–133. [2] Marblestone,​ ​A.​ ​H.​ ​,​ ​Wayne​ ​G.,​ ​and​ ​Kording​ ​K.​ ​P.​ ​(2016).​ ​ ​Toward​ ​an​ ​Integration​ ​of​ ​Deep​ ​Learning and​ ​Neuroscience.​ ​ ​Frontiers.​ ​doi:​ ​10.3389/fncom.2016.00094 [3] Bengio,​ ​Y.,​ ​Lee,​ ​D-H.,​ ​Bornschein,​ ​J.,​ ​Mesnard,​ ​T.,​ ​Lin,​ ​Z.​ ​(2016).​ ​ ​Towards​ ​Biologically​ ​Plausible Deep​ ​Learning.​ ​ ​arXiv:1502.04156v3 [4] Silver,​ ​D.,​ ​Huang,​ ​A.,​ ​Maddison​ ​C.​ ​J.,​ ​Guez,​ ​A.,​ ​Sifre,​ ​L.,​ ​Driessch​ ​G.,​ ​et.​ ​al.​ ​(2016)​ ​ ​Mastering​ ​the game​ ​of​ ​Go​ ​with​ ​deep​ ​neural​ ​networks​ ​and​ ​tree​ ​search.​ ​ ​Nature​ ​529,​ ​484​ ​-​ ​489.​ ​ ​doi: 10.1038/nature16961 David​ ​Di​ ​Giorgio​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​21/22 Simple​ ​Cortex:​ ​A​ ​Model​ ​of​ ​Cells​ ​in​ ​the​ ​Sensory​ ​Nervous​ ​System [5] Geoffry​ ​Hinton’s​ ​quote​ ​found​ ​online​ ​at: https://www.axios.com/ai-pioneer-advocates-starting-over-2485537027.html [6] Hawkins,​ ​J.​ ​et​ ​al.​ ​(2016).​ ​Biological​ ​and​ ​Machine​ ​Intelligence.​ ​ ​ ​Release​ ​0.4.​ ​Accessed​ ​at http://numenta.com/biological-and-machine-intelligence/ [7] Hawkins,​ ​J.,​ ​Ahmad,​ ​S.​ ​(2016).​ ​ ​Why​ ​Neurons​ ​Have​ ​Thousands​ ​of​ ​Synapses,​ ​a​ ​Theory​ ​of Sequence​ ​Memory​ ​in​ ​Neocortex.​ ​ ​Frontiers.​ ​ ​doi:​ ​10.3389/fncir.2016.00023 [8] Hawkins,​ ​J.,​ ​Ahmad,​ ​S.,​ ​Cui,​ ​Y.​ ​(2017).​ ​ ​Why​ ​Does​ ​the​ ​Neocortex​ ​Have​ ​Layers​ ​and​ ​Columns,​ ​A Theory​ ​of​ ​Learning​ ​the​ ​3D​ ​Structure​ ​of​ ​the​ ​World.​ ​ ​bioRxiv.​ ​doi: https://doi.org/10.1101/162263 [9] [10] NuPIC​ ​implementation​ ​found​ ​online​ ​at:​ ​https://github.com/numenta/nupic Cui,​ ​Y.,​ ​Ahmad,​ ​S.,​ ​Hawkins,​ ​J.​ ​(2016).​ ​ ​Continuous​ ​Online​ ​Sequence​ ​Learning​ ​with​ ​an Unsupervised​ ​Neural​ ​Network​ ​Model.​ ​ ​The​ ​MIT​ ​Press​ ​Journals,​ ​Volume:​ ​28,​ ​Issue:​ ​11,​ ​pp. 2474-2504​ ​ ​doi:​ ​10.1162/NECO_a_00893 [11] Ahmad,​ ​S.,​ ​Lavin,​ ​A.,​ ​Purdy,​ ​S.,​ ​Agha,​ ​Z.​ ​(2017).​ ​ ​Unsupervised​ ​real-time​ ​anomaly​ ​detection​ ​for streaming​ ​data.​ ​ ​ScienceDirect​ ​Volume​ ​262,​ ​pp.​ ​134-147.​ ​doi: 10.1016/j.neucom.2017.04.070 [12] Laukien,​ ​E.​ ​Crowder,​ ​R.,​ ​Byrne,​ ​F.​ ​(2016).​ ​ ​Feynman​ ​Machine:​ ​The​ ​Universal​ ​Dynamical​ ​Systems Computer.​ ​ ​arXiv:1609.03971v1 [13] OgmaNeo​ ​implementation​ ​found​ ​online​ ​at:​ ​https://github.com/ogmacorp/OgmaNeo [14] Self​ ​Driving​ ​Car​ ​demo​ ​found​ ​online​ ​at: https://ogma.ai/2017/06/self-driving-car-learns-online-and-on-board-on-raspberry-pi-3/ [15] Intel​ ​Loihi​ ​article​ ​found​ ​online​ ​at: https://newsroom.intel.com/editorials/intels-new-self-learning-chip-promises-accelerate-arti ficial-intelligence/ [16] Savien,​ ​L.​ ​(2011).​ ​ ​Rebel​ ​Cortex​ ​1.0​ ​A​ ​Visual​ ​Recognition​ ​Software​ ​Project.​ ​ ​Rebel​ ​Science. Available​ ​online​ ​at:​ ​http://www.rebelscience.org/download/rebelcortex.pdf David​ ​Di​ ​Giorgio​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​22/22
2cs.AI
arXiv:1704.06068v1 [math.GR] 20 Apr 2017 Coleman automorphisms of finite groups and their minimal normal subgroups Arne Van Antwerpen Abstract In this paper, we show that all Coleman automorphisms of a finite group with self-central minimal non-trivial characteristic subgroup are inner; therefore the normalizer property holds for these groups. Using our methods we show that the holomorph and wreath product of finite simple groups, among others, have no non-inner Coleman automorphisms. As a further application of our theorems, we provide partial answers to questions raised by M. Hertweck and W. Kimmerle. Furthermore, we characterize the Coleman automorphisms of extensions of a finite nilpotent group by a cyclic p-group. Lastly, we note that class-preserving automorphisms of 2-power order of some nilpotent-by-nilpotent groups are inner, extending a result by J. Hai and J. Ge. Introduction Let G be a finite group and let ZG denote the integral group ring of G. Denote by Z(U (ZG)) the center of the unit group U (ZG) of ZG and by NU(ZG) (G) the normalizer of G in U (ZG). The well known normalizer problem asks whether NU(ZG) (G) = GZ(U (ZG)). This problem is posed as question 43 in S.K. Sehgal [22]. The first results for p-groups, nilpotent groups and groups with normal Sylow 2-subgroups are due (respectively) to D. Coleman [2], A. Saksonov [21], S. Jackowski and Z. Marciniak [16]. Further work by, among others, S. Sehgal, M. Parmenter, Y. Li [1], E. Jespers and M. Hertweck [13], M. Hertweck [11, 12, 9] and M. Hertweck and W. Kimmerle [14] enlarged the class of groups with a positive answer greatly. M. Mazur [19, 20] showed that the question is closely related to the Isomorphism problem. It poses the question whether an isomorphism between two integral group rings ZG ∼ = ZH implies that the groups are isomorphic G ∼ = H. In 2001 M. Hertweck [10] discovered a counterexample to the isomorphism problem by first constructing a counterexample to the normalizer problem. All counterexamples to the normalizer problem, known to date, are obtained using M. Hertweck’s construction [10]. Hence, it opens the question whether there are still large classes of groups which have a positive answer to the normalizer problem (we say they satisfy the normalizer property). S. Jackowski and Z. Marciniak [16] realized, by Coleman’s result, that the normalizer property is closely related to automorphisms of the underlying finite group 1 G. Later, M. Hertweck and W. Kimmerle [14] initiated the study of Coleman automorphisms, which are a generalization of the automorphisms obtained in the study of the normalizer property [16]. Using the alternative characterization of the normalizer problem from [16], it is obvious that finite groups with no non-inner Coleman automorphisms have the normalizer property. In the first section we give the necessary background on the automorphisms in play. In the second section we show that the Coleman automorphisms of groups with a self-centralizing minimal non-trivial characteristic subgroup are trivial. Using the same techniques, we show that the holomorph of finite simple groups has no non-inner Coleman automorphisms. Also, we partially answer questions 2 and 3 posed by M. Hertweck and W. Kimmerle in [14]. Moreover, we show that if question 2 is answered positively, then so is question 3. Furthermore, the theorems proven in this section show that certain semi-direct products with simple groups, p-groups or symmetric groups as normal base group have no non-inner Coleman automorphisms. In particular, the recent results of J. Hai and J. Guo in [8] are easy consequences of our theorems. In the third section, Coleman automorphisms of extensions of nilpotent groups by cyclic p-groups are characterized. As a nice consequence, this provides an easier and different proof of E.C. Dade’s result (in [3]) that any finite abelian group can be realized as the group of outer Coleman automorphisms of some metabelian group G. Furthermore, the recent results of Y. Li and Z. Li in [18] are straightforward applications of our characterization. It also shows that the theorems of the previous sections can not be naively adapted to the case of a semi-direct product with a nilpotent group as a normal base group. In the last section, we note that a recent result of J. Hai and S. Ge ( in [17]) can easily be generalized. It is shown that the class-preserving Coleman automorphisms of p-power order of certain nilpotent-by-cyclic groups are inner. As a Corollary we then prove that the class-preserving Coleman automorphisms of p-power order of certain nilpotent-by-nilpotent groups are inner. 1 Preliminary results In this section we give the definition of the investigated automorphisms. We also include crucial known results on these automorphisms. By Aut(G) (respectively Inn(G)) we denote the automorphisms (respectively inner automorphisms) of a group G. By conj(g) we denote the inner conjugation x 7→ g −1 xg on G. The group of outer automorphisms is Out(G) = Aut(G)/Inn(G). The set consisting of the prime divisors of the order of a finite group G is denoted by π(G). The cyclic group of order n will be denoted Cn for a positive integer n. The commutator of two elements x, y ∈ G is denoted [x, y]. We begin with the definition of Coleman automorphism, which was introduced by M. Hertweck and W. Kimmerle in [14]. Definition 1.1. Let G be a finite group and σ ∈ Aut(G). If for any prime p 2 dividing the order of G and any Sylow p-subgroup P of G, there exists a g ∈ G such that σ|P = conj(g)|P , then σ is said to be a Coleman automorphism. The group of Coleman automorphisms is denoted Autcol (G) and its image in Out(G) is denoted Outcol (G) = Autcol (G)/Inn(G). Definition 1.2. Let G be a finite group and σ ∈ Aut(G). If the conjugacy classes of G are invariant under σ, i.e. for any g ∈ G there exists an x ∈ G such that σ(g) = x−1 gx, then σ is called a class-preserving automorphism. The group of class-preserving automorphisms is denoted Autc (G) and its image in Out(G) is denoted Outc (G) = Autc (G)/Inn(G). The following proposition shows that the prime divisors of the orders of the groups of class-preserving automorphisms and Coleman automorphisms are restricted to the prime divisors of |G|. This is well known for the class-preserving automorphisms, a proof can be found in [16, Proposition 2.4]. A proof for the Coleman automorphisms may be found in [14, Proposition 1]. Theorem 1.3. Let G be a finite group. The prime divisors of |Autcol (G)| and |Autc (G)| are also prime divisors of |G|. The following well-known theorem shows that Coleman automorphisms behave well with respect to direct products. Proposition 1.4. Let G and H be finite groups. Then Autcol (G × H) ∼ = Autcol (G) × Autcol (H) and Outcol (G × H) ∼ = Outcol (G) × Outcol (H). The following lemma shows that Coleman automorphisms are ”close” to being class-preserving (this result appeared implicitly in [14]). Lemma 1.5. Let N be a normal subgroup of a finite group G. If σ ∈ Autcol (G), then σ|N ∈ Aut(N ). Proof. Let x ∈ N and σ ∈ Autcol (G). Let p1 , ..., pk be the distinct prime divisors of the order of x and write x = xp1 ...xpk , where each xpi is the pi -part of x. As σ ∈ Autcol (G), there exist gi ∈ G such that σ(xpi ) = gi−1 xpi gi . Thus, σ(x) = g1−1 xp1 g1 ...gk−1 xpk gk and therefore σ(x) ∈ N . A proof of the following lemma can be found in [9, Lemma 2]. Lemma 1.6. Let p be a prime number and α ∈ Aut(G) of p-power order. Assume that there exists a normal subgroup N of G, such that α|N = idN and α induces identity on G/N . Then α induces identity on G/Op (Z(N )). Moreover, if α also fixes a Sylow p-subgroup of G elementwise, then α is conjugation by an element of Op (Z(N )). The following result was proven by M. Hertweck and W. Kimmerle in [14]. Theorem 1.7. Let N be a normal subgroup of a finite group G and p a prime number which does not divide the order of G/N . Then the following properties hold. 3 1. If σ ∈ Aut(G) is a class-preserving or a Coleman automorphism of G of p-power order, then σ induces a class-preserving or a Coleman automorphism of N respectively. 2. If Outc (N ) or Outcol (N ) is a p′ -group, then so is Outc (G) or Outcol (G) respectively. The second part of the theorem can be extended as follows. The proof is similar and is included for completeness’ sake. Theorem 1.8. Let N be a normal subgroup of a finite group G and p a prime number which does not divide the order of G/N . If Outc (N ) ∩ Outcol (N ) is a p′ -group, then so is Outc (G) ∩ Outcol (G). Proof. Assume Outc (N ) ∩ Outcol (N ) is a p′ -group. Let σ be a class-preserving Coleman automorphism of G of p-power order. By Theorem 1.7, σ induces a class-preserving Coleman automorphism of N of p-power order. Hence, there exists x ∈ N such that σ|N = conj(x)|N . Put σ1 = σ ◦ conj(x−1 ). Let m be the p′ -part of the order of σ1 and put σ2 = σ1m . Then σ2 differs from σ only by an inner automorphism and a p′ -power. Thus it is sufficient to prove that σ2 is inner. Hence, we may assume that σ is a class-preserving Coleman automorphism of p-power order such that σ|N = idN . So, by Theorem 1.3, σ induces identity on G/N . As the Sylow p-subgroups of G are contained in N , it follows, by Lemma 1.6, that σ is an inner automorphism of G. An analogue to Coleman automorphims was introduced by F. Gross in [5]. Definition 1.9. Let G be a finite group and let σ ∈ Aut(G) be an automorphism. If for some prime divisor p of |G| the automorphism σ centralizes a Sylow p-subgroup P of G, i.e. σ|P = id|P , then σ is said to be a p-central automorphism of G. Note that every Coleman automorphism of a group G is, upto an inner automorphism, a p-central automorphism for any prime p ∈ π(G). In [5, Theorem B] F. Gross showed the following useful theorem (note that the formulation differs somewhat from the original). Theorem 1.10. Let G be a finite non-abelian simple group and let p be an odd prime dividing the order of G. Then every p-central automorphism of G of p-power order is inner. M. Hertweck and W. Kimmerle continued in [14] the study of these p-central automorphisms for simple groups and they proved the following interesting result. Theorem 1.11. For any finite simple group G, there is a prime p dividing |G| such that p-central automorphisms of G are inner automorphisms. 4 2 Groups with a self-centralizing characteristic subgroup In this section Coleman automorphisms of finite groups with a self-centralizing minimal non-trivial characteristic subgroup are investigated. Our results on these groups will partially answer several questions posed by M. Hertweck and W. Kimmerle in [14]. Furthermore, these results will imply several results showing that the Coleman automorphisms of certain semi-direct products, in particular wreath products, have no non-inner Coleman automorphisms. The results in the recent paper [8], on wreath products of symmetric groups, are straightforward applications of our results. Moreover, it is shown that a result of F. Gross, Corollary 2.4 in [5], can be slightly generalized. Theorem 2.1. Let G be a normal subgroup of a finite group K. Let N be a minimal non-trivial characteristic subgroup of G. If CK (N ) ⊆ N , then every Coleman automorphism of K is inner. In particular, the normalizer problem holds for these groups. Proof. Note that a minimal non-trivial characteristic subgroup of G is necessarily characteristically simple. Hence, N is the direct product Πni=1 Si of finite simple groups Si each isomorphic with a fixed simple group, say S. Abusing notation, we identify each Si with S. By Theorem 1.11, there exists a prime number q ∈ π (S) such that all q-central automorphisms of S are inner. Let σ ∈ Aut(K) be a Coleman automorphism of p-power order. First, we show that we may assume this automorphism to be q-central. Let Q be a Sylow q-subgroup of S. Then there exists a Sylow q-subgroup P of K such that Πni=1 Qi ⊆ P , where Qi denotes the image of Q under the canonical isomorphism from S to Si . Put ρ1 = σ ◦ conj(h−1 ). As σ|P = conj(h)|P for some h ∈ K, it follows that ρ1 is a Coleman automorphism which restricts to the identity on P . Let m denote the p′ -part of the order of ρ1 . Put ρ2 = ρm 1 . Then ρ2 is a Coleman automorphism of p-power order and ρ2 |P = idP . As ρ2 σ −m ∈ Inn(G) and p ∤ m, we may replace σ by ρ2 . Hence, without loss of generality, we may assume that σ|P = id|P . So, indeed, σ is q-central. In particular, for any 1 ≤ i ≤ n, σ|Qi = idQi . Note that the normal subgroup generated by Qi in Si is precisely Si . By Lemma 1.5, σ|N ∈ Aut(N ). Hence, for any 1 ≤ i ≤ n, x ∈ Si and g ∈ Qi , σ(x−1 gx) = σ(x)−1 gσ(x) ∈ Si . As σ(x) ∈ N , this shows, for any 1 ≤ i ≤ n, that σ|Si ∈ Aut(Si ). Thus, each σ|Si is a q-central automorphism. Hence, there exists, for any 1 ≤ i ≤ n, a gi ∈ Si such that σ|Si = conj(gi )|Si . Thus, σ|N = conj(Πni=1 gi ). The proof now continues for two mutually exclusive cases. 5  First we consider the case that S is non-abelian. Put σ1 = σ◦conj Πni=1 gi−1 . This is a Coleman automorphism of K and σ1 |N = idN . Let m denote the p′ part of the order of σ1 . Put σ2 = σ1m , a Coleman automorphism of p-power order such that σ2 |N = idN . As σ2 σ −m ∈ Inn(G) and p ∤ m, we may replace σ by σ2 σ −m . Hence, without loss of generality, we may assume, except that σ may not be q-central anymore, that σ|N = idN . As N is characteristic in G it follows, for any x ∈ K, n ∈ N , that x−1 nx = σ(x−1 nx) = σ(x)−1 nσ(x). Hence, σ(x)x−1 ∈ CK (N ). Since S is non-abelian, it follows that Z(N ) = 1. This shows that σ = idK , as desired. Second, we consider the case that S is abelian, and thus S = Cq , a cyclic group of order q. As S and N are abelian and σ|N is inner, it follows that σ|N = idN . Moreover, as N is characteristic, it follows, for any x ∈ K, n ∈ N , that x−1 nx = σ(x−1 nx) = σ(x)−1 nσ(x). Hence, σ(x)x−1 ∈ CK (N ) ⊆ N . This shows that σ|N = idN and σ|G/N = idG/N . If q = p, it follows, by Lemma 1.6 and q-centrality of σ, that σ is inner. Assume q 6= p. Then, for any x ∈ K, there exists an n ∈ N such that σ(x) = xn. Let pr be the order of σ, then r r x = σ p (x) = xnp . As N is a q-group, this implies that n = e and hence σ = id. So we have shown that any p-power order σ ∈ Autcol (K) is inner. Hence, the result follows. Similar arguments are used to prove the following theorem. This theorem is similar to F. Gross’ Corollary 2.4 in [5]. Theorem 2.2. Let P be a normal p-subgroup of a finite group G. If CG (P ) ⊆ P , then G has no non-inner p-central automorphisms. In particular, G has no noninner Coleman automorphisms. Proof. Let q be a prime number. Let σ be a p-central automorphism of q-power order. Hence, because P is normal by the assumptions, σ|P = idP . Therefore, for any g ∈ G and x ∈ P , g −1 xg = σ(g −1 xg) = σ(g)−1 xσ(g). Thus, because of the assumption, σ(g)g −1 ∈ CG (P ) ⊆ P . 6 Again we consider two cases. First, suppose q 6= p. Then, by the above, for any g ∈ G, there exists an h ∈ P such that σ(g) = hg. If q n is the order of σ, then this shows that n n g = σ q (g) = hq g. As h is a p-element, it follows that h = e. So we have shown that σ = idG . Second, assume q = p. Because σ|P = idP , σG/P = idG/P and since σ fixes a Sylow p-subgroup, it follows, by Lemma 1.6, that σ is an inner automorphism of G. In both cases we have shown that any p-central automorphism of G of prime power order is inner. As any Coleman automorphism is p-central upto an inner automorphism, the result follows. As immediate consequence of Theorem 2.2 we get the following. Corollary 2.3. Let P be a finite p-group and let H be a finite group. Let G = P ⋊ H be the associated semidirect product. If CG (P ) ⊆ P , then G has no non-inner Coleman automorphisms. Recall that the wreath product G ≀ H of two finite groups G, H is defined as the semidirect product Πh∈H S ⋊ H, where H acts by left multiplication on the indices. An immediate consequence of Theorem 2.1 is the following. Corollary 2.4. Let S be a finite simple group, I a finite set of indices, and H any finite group. If G = Πi∈I S⋊H is a group such that CG (Πi∈I S) ⊆ Z(Πi∈I S), then G has no non-inner Coleman automorphism, and thus, the normalizer problem holds for G. In particular, the wreath product S ≀ H has no non-inner Coleman automorphisms. As straightforward applications of our theorems, we mention a recent result by J. Hai and S. Ge. Corollary 2.5. Let k, n be positive integers. Then Sk ≀ Sn has no non-inner Coleman automorphisms. In particular, Sk ≀Sn satisfies the normalizer property. Another application of the reasoning in our theorems is in the holomorph of groups. Recall that, for a finite group G, the holomorph of G is defined as Hol(G) = G ⋊ Aut(G), where the action of Aut(G) is by evaluating the automorphisms. Theorem 2.6. Let S be a non-abelian finite simple group. Then Hol(S) has no non-inner Coleman automorphisms. Proof. Let p be a prime number. Let σ ∈ Autcol (Hol(S)) of p-power order. By Theorem 1.11, there exists a prime number q such that q-central automorphisms of S are inner. We may assume σ to be q-central of p-power order, by modifying 7 σ by an inner automorphism as in the proof of Theorem 2.1 and taking a suitable power. By Lemma 1.5, σ|S⋊S ∈ Aut(S ⋊ Inn(S)) and σ|S ∈ Aut(S). Hence, σ induces a q-central automorphism of p-power order on S ⋊Inn(S)/S ∼ = Inn(S) ∼ = S. Because of Theorem 1.11, σ induces an inner automorphism conj(conj(x)) on S ⋊ Inn(S)/S, where x ∈ CS (Q) is of p-power order for some Sylow q-subgroup Q of S. Hence, σ1 = σ ◦ conj(conj(x−1 )) is still q-central, as it fixes Q ⋊ conj(Q) elementwise and induces the identity on S ⋊ Inn(S)/S. Thus, by Theorem 1.11, σ1 |S = conj(s) for some s ∈ CS (Q). Hence, σ2 = σ1 ◦ conj(s−1 ) is a q-central automorphism of S ⋊ Inn(S), σ2 restricts to the identity on S and σ2 induces identity on S ⋊ Inn(S)/S. Write σ2 as σ for convenience. Let w, r ∈ S and q ∈ S, then σ(wconj(r))−1 qσ(wconj(r)) = σ(conj(r−1 )w−1 qwconj(r)) = conj(r−1 )w−1 qwconj(r). Hence, and because σ|S⋊Inn(S)/S = IdS⋊Inn(S)/S , wconj(r)σ(wconj(r))−1 ∈ CS⋊Inn(S) (S) ∩ S = 1. Thus, σ|S⋊Inn(S) = IdS⋊Inn(S) . A similar argument shows that, for g ∈ Hol(S), σ(g)g −1 ∈ CHol(S) (S ⋊ Inn(S)). Clearly, CHol(S) (S ⋊ Inn(S)) = 1. Hence, σ = IdHol(S) . A last and easy application of our theorems is an alternative proof and extension of a recent result of J. Hai, S. Ge and W. He [7]. Corollary 2.7. Let N be a finite nilpotent group. Then Hol(N ) has no noninner Coleman automorphism. In particular, Hol(N ) has no non-inner Coleman automorphisms. Proof. Put N = P1 × ... × Pk in its Sylow decomposition. Then Hol(N ) ∼ = Πki=1 Hol(Pi ). By Proposition 1.4, it is sufficient to show the result in the case that N is a p-group for some prime number p. Clearly, N ⋊ Inn(N ) is a selfcentral normal p-subgroup of Hol(N ). Thus, by Theorem 2.2, Hol(N ) has no non-inner Coleman automorphisms. The following lemma easily follows from the fact that the automorphism group of the direct product of characteristic subgroups is the direct product of the automorphism groups. Lemma 2.8. Let S1 , ..., Sn be non-isomorphic finite simple groups and k1 , ..., kn positive integers. Then Aut(S1k1 × ... × Snkn ) = Aut(S1k1 ) × ...Aut(Snkn ). Recall that the generalized Fitting subgroup F ∗ (G) of a finite group G is defined as F ∗ (G) = F (G)E(G), where F (G) is the Fitting subgroup (the maximal nilpotent normal subgroup) and E(G) is the layer, i.e. the maximal semisimple 8 normal subgroup. It is well known that F ∗ (G) is self-centralizing and the elements of the layer and Fitting subgroup commute. For more in depth results, we refer to [15, Section X.13]. As an application of the main results of this section we give some partial answers to the following questions posed by M. Hertweck and W. Kimmerle in [14]; where p is a prime number and G is a finite group. 1. Is Outcol (G) a p′ -group if G does not have Cp as a chief factor? 2. Is Outcol (G) trivial if Op′ (G) is trivial? 3. Is Outcol (G) trivial if G has a unique minimal non-trivial normal subgroup? M. Hertweck and W. Kimmerle showed that all these questions have affirmative answers in case G is p-constrained, for example if G is solvable. Recall that every finite solvable group has abelian minimal non-trivial normal subgroups. Concerning the third question, as the minimal non-trivial normal subgroups are abelian, it follows that under the extra assumption that this minimal normal subgroup is abelian, a partial answer was given by M. Hertweck and W. Kimmerle. In the next theorem we show that if this minimal normal subgroup is non-abelian, the statement always has a positive answer. Theorem 2.9. Let G be a finite group with a unique minimal non-trivial normal subgroup N . If N is non-abelian, then Outcol (G) = 1. Proof. As CG (N ) is a normal subgroup of G and N is non-abelian, the minimality assumption yields that CG (N ) = 1. Obviously, the assumptions yield that N is a self-centralizing minimal non-trivial characteristic subgroup of G. Thus, the result follows from Theorem 2.1. Thus to answer question 3, only groups with an abelian minimal non-trivial normal subgroup need to be checked. Moreover, these groups may be assumed to be not p-constrained. We will show now that a positive answer to the second question implies a positive answer to the third question. Proposition 2.10. If Question 2 has a positive answer, then so does Question 3. Proof. By Theorem 2.9, it is sufficient to consider finite groups G with an abelian unique minimal non-trivial normal subgroup, say N . Then N is a characteristically simple group. Hence, N is an elementary abelian p-group for some prime p. Thus N ⊆ Op (G). As N is the unique minimal normal subgroup, it follows that Op′ (G) = 1. So,the result follows. Denote by Op (G) the maximal normal p-subgroup of a group G. The following theorem serves to provide a partial answer to question 3 under the additional assumption that Op (G) = 1. 9 Theorem 2.11. Let K be a finite group and p be an odd prime number. Suppose K has a normal subgroup E, which is the direct product of non-abelian simple groups, such that CK (E) ⊆ E. If p divides the order of every simple group in the decomposition of E, then Outcol (K) is a p′ -group. Proof. Let σ be a Coleman automorphism of p-power order. Put E = S1k1 × ... × Snkn with Si ∼ 6 Sj if i 6= j. By Lemma 1.5, σ|E ∈ Aut(E). Let, for any = 1 ≤ i ≤ n, Qi be a Sylow p-subgroup of Si . Then Q = Qk11 × ... × Qknn is a p-subgroup of E. By the same reasoning as in the proof of Theorem 2.1, we may assume, without loss of generality, that σ|Q = id|Q . Each Siki is a characteristic subgroup in S1k1 × ... × Snkn , thus σ|S ki ∈ Aut(Siki ). Let us identify the l’th copy i (l) of Si (denoted Si ) in Siki with Si . Then for any x ∈ Si and for any q ∈ Qi , it follows that σ(x−1 qx) = σ(x)−1 qσ(x). Because of the assumption, each Qi is non-trivial and, clearly, the normal subgroup generated by Qi (in E) is Si . As σ(x) ∈ E, this shows that σ|S (l) ∈ i (l) Aut(Si ). Since σ|S (l) is p-central and p is odd, it follows by Theorem 1.10 that (l) i (l) there exists xi ∈ Si such that (l) σ|S (l) = conj(xi ). i As this holds for any l ≤ ki and any i ≤ n, there exists x ∈ E such that σ|E = conj(x). Hence, as in previous proofs, modification by an inner automorphism and taking a suitable power, we may assume, without loss of generality, that σ|E = idE , but here we possibly sacrifice p-centrality. Thus, for any g ∈ E and x ∈ K, it follows that x−1 gx = σ(x−1 gx) = σ(x)−1 gσ(x). This shows, for any x ∈ K, that σ(x)x−1 ∈ CK (E) ⊆ E. So σ(x)x−1 = e and thus σ = idK . Theorem 2.12. Let G be a finite group and p an odd prime number. If Op (G) = Op′ (G) = 1 and p divides the order of every simple subgroup of E, then Outcol (G) is a p′ -group. Proof. Clearly, the assumptions implies that F (G) = 1. Hence, F ∗ (G) = E(G). This shows that CG (E(G)) ⊆ E(G). Moreover, as Z(E(G)) ⊆ F (G) = 1, it follows that E(G) is the direct product of non-abelian simple groups. The result then follows from Theorem 2.11. 10 3 Coleman automorphisms of Nilpotent-by-cyclic groups In this section we obtain a characterization of the Coleman automorphisms of finite nilpotent-by-(p-power cyclic) groups. Apart from giving concrete examples of groups with known non-trivial outer Coleman automorphisms, we obtain an easy second proof of E.C. Dade’s result [3, 4], which shows that any finite abelian group can be realized as the group of outer Coleman automorphisms of some finite metabelian group. Furthermore, our results show that the results of the previous section are not to be expected for semi-direct products of a nilpotent group and an arbitrary finite group (with faithful action). To give some more insight in the matter, as the proof is quite technical, we first show the result for a semi-direct product of a finite abelian group by a cyclic group of prime power order. Our work is inspired by recent work of Z. Li and Y. Li [18]. They studied the group of Coleman automorphisms of a finite generalized dihedral group and obtained a concrete characterization of this group. First, we define the automorphisms, which will induce the only outer Coleman automorphisms. Definition 3.1. Let A ∗ Cq be the free product of a finite abelian group A and a cyclic group Cq = hxi of order q = pr , with p a prime number. Write A = Ap1 × ... × Apn , its Sylow decomposition. Then, for any 1 ≤ i ≤ n and non-negative integers ki , define the group homomorphisms φk1 ...kn : A ∗ Cq → A ∗ Cq where, for gi ∈ Api ,, gi 7→ x−ki gi xki and x 7→ x It easily is verified that these maps induce Coleman automorphisms Φk1 ...kn−1 kn on all possible semi-direct products. Theorem 3.2. Let G = A ⋊ Cq , with notation as in the definition above. For any 1 ≤ i ≤ n, let ri be the smallest positive integer such that conj(xri )|Api = id|Api . Assume that the Sylow subgroups are ordered such that r1 ≤ ... ≤ rn . Then, Autcol (G) = Inn(G) ⋊ K, with Thus,  K = Φk1 ...kn−1 0 | ki ∈ Zri . K∼ = Cr1 × ... × Crn−1 . Proof. Clearly, K is a subgroup of Autcol (G). First, we study when the automorphisms Φk1 ...kn and Φj1 ...jn determine the same outer automorphism of G. For this, let ji , ki ∈ Zri and g ∈ G be such that Φj1 ...jn = Φk1 ...kn ◦ conj(g). 11 Write g = bxl , with b ∈ A and l a non-negative number. Then, for any 1 ≤ i ≤ n and ai ∈ Api , x−ji ai xji = x−ki −l b−1 ai bxl+ki , Equivalently, xki −ji +l ai x−ki +ji −l = ai . This shows that xki −ji +l ∈ Chxi (Ai ) and thus ki − ji + l ≡ 0 mod ri . Furthermore, as Φj1 ...jn |hxi = Φk1 ...kn |hxi = idhxi , g −1 xg = x. Thus, b ∈ CA (hxi) = Z(G)∩A. These calculations show that Φj1 ...jn and Φk1 ...kn determine the same outer automorphism of G if and only if the differences ki −li are constant modulo ri . As ri | rn for all 1 ≤ i ≤ n, because ri ≤ rn and the ri ’s are p-powers, it follows that the elements in K induce different elements of Outcol (G). It remains to show that every Coleman automorphism induces the same outer automorphism as some element in K. Let σ ∈ Autcol (G). As hxi is a p-group, there exists an a ∈ A such that σ|hxi = conj(a)|hxi . Define the automorphism σ e = σ ◦ conj(a−1 ). Clearly, σ e is a Coleman automorphism of G. Moreover, for every 1 ≤ i ≤ n, there exists a positive integer ji such that σ e |Api = conj(xji )|Api Hence, σ e = Φj1 ...jn and σ̃ ◦ conj(x−jn ) = Φk1 ,...,kn−1 ,0 ∈ K for some nonnegative integers k1 , ..., kn−1 . As σ and Φk1 ,...,kn−1 ,0 induce the same element in Outcol (G), it follows that, Autcol (G) = Inn(G) ⋊ K. An application we can now give an alternative proof of E.C. Dade’s result in [3]. The proof makes use of the well known fact that if p is a prime number and r is a non-negative number. Then there exist infinitely many prime numbers q such that there is a primitive pr -th root of unity in Zq . Theorem 3.3. If H is a finite abelian group, then there exists a semi-direct product A ⋊ B of finite finite abelian groups A and B such that Outcol (A ⋊ B) ∼ = H. Proof. First, we deal with the case that H = Πni=1 Cpri , for some prime number p and positive integers r1 ≤ ... ≤ rn . Define rn+1 = rn and let s ≥ rn be a non-negative integer. By the above remark, there exist different prime numbers 12 q1 , ..., qn , qn+1 and k1 , ..., kn+1 positive integers, whose images in Zqi is a primiWrite Cps = hxi and Cqi = hyi i. Define the semi-direct tive pri -th root of unity.  product Πn+1 C ⋊ C ps by i=1 qi x−1 yi x = yiki   ∼ By Theorem 3.2, Outcol Πn+1 i=1 Cqi ⋊ Cps = H. Second, let H be any finite abelian group. Write H = Hp1 × ... × Hpn , its decomposition into Sylow subgroups. Then there exist abelian groups A1 , ..., An and positive integers s1 , ..., sn such that Outcol (Ai ⋊ Cpsi ) ∼ = Hpi Denote Gi = i Ai ⋊ Cpsi i . Define the group G = Πni=1 Gi . Clearly, G ∼ = (A1 × ... × An ) ⋊ (Cps1 × ... × Cpsn ), where the elements of Cpsi i act trivially on all Aj except on Ai , where it acts like in Gi . Then, by Theorem 1.4, Outcol (G) ∼ = H. We will now tackle the main theorem of this section. As this proof is quite technical, crucial steps are treated in lemmas. Lemma 3.4. Let p be a prime number. Let N be a normal subgroup of a finite group G. Assume N is nilpotent and G/N = hxN i ∼ = Cpn for some positive integer n and p-element x. Suppose P is a Sylow q-subgroup of N and suppose σ ∈ Autcol (G) is such that σ|hxi = idhxi . If w ∈ N is a q-element and n j j is a positive integer such thatσ|P = conj(wx ), then w and xp commute.  Furthermore, for any integer k, xk , w−1 ∈ CG (N ). Proof. Of course, if q 6= p, the result follows from the nilpotency of G. So assume n q = p. Then, x is a p-element by assumption and thus we have that xp ∈ P .  n n n n Hence, x−j w−1 xp wxj = σ(xp ) = xp . This shows that w, xp = 1. To show the second statement, we note that it is sufficient to show that w−1 , xk centralizes P . To do so, let a, b ∈ P . Then, σ(axk bx) = σ(a)σ(xk )σ(b)σ(x), and thus σ(axk bx−k )σ(xk+1 ) = σ(a)σ(xk )σ(b)σ(x). Applying the definition of σ on P and hxi seperately, x−j w−1 axk bx−k wxj xk+1 = x−j w−1 awxj xk x−j w−1 bwxj x. This can be rewritten as xk bx−k wxk = wxk w−1 bw. Which is equivalent to  −1 k  w , x ∈ CG (P ).   This shows that x−k , w ∈ CG (P ). 13 Lemma 3.5. Let p, G, N and x be as in the previous Let P1 , ...,  lemma.  Pk be the n Sylow subgroups of N . Let wi ∈ Pi be such that wi , xp = 1 and wi−1 , xl ∈ Z(Pi ) for any 1 ≤ i ≤ kand positive integer l. Let j1 , ..., jk be positive integers. 1 ...wk Then there exists Φw ∈ Autcol (G) defined via ai 7→ x−ji wi−1 ai wi xji for j1 ...jk ai ∈ Pi and x 7→ x. Proof. First, we check that the proposed mapping is well-defined. To do so, suppose axj = bxt with a, b ∈ N and j, t positive integers. Then xt−j = b−1 a ∈ n n N ∩ hxi = xp . Thus there exists an integer l such that b−1 a = xlp . If p does not divide |N |, then N ∩ hxi = 1. Thus, a = b and j ≡ t mod pn . Thus we only need to consider the case that p divides |N |. Without loss of generality, we may assume that Pk is the Sylow p-subgroup of N . Thus we need to show n n that axj = (bxlp )xj and b(xlp xj ) = bxt have the same image after applying the relations. Let b = b1 ...bk be the decomposition of b into its pi -parts. As wk n and xp commute, we find that n n (bxlp )xj 7→x−j1 w1−1 b1 w1 xj1 ...x−jk wk−1 bk xlp wk xjk xj n =x−j1 w1−1 b1 w1 xj1 ...x−jk wk−1 bk wk xjk xlp xj . On the other hand, n n b(xlp xj ) 7→ x−j1 w1−1 b1 w1 xj1 ...x−jk wk−1 bk wk xjk xlp xj . 1 ...wk This shows that these relations induce a well-defined map Φw j1 ...jk on G. w1 ...wk Second, we show that Φj1 ...jk is a homomorphism. Let a, b ∈ N with a = a1 ...ak and b = b1 ...bk their decompositions into its pi -parts. We should show that w1 ...wk w1 ...wk j l j l 1 ...wk Φw j1 ...jk (ax bx ) = Φj1 ...jk (ax )Φj1 ...jk (bx ). A quick calculation shows that this is equivalent to the equality  x−j1 w1−1 a1 xj b1 x−j w1 xj1 ...x−jk wk−1 ak xj bk x−j wk xjk xj+k  = x−j1 w1−1 a1 w1 xj w1−1 b1 w1 x−j xj1 ...x−jk wk−1 ak wk xj wk−1 bk wk x−j xjk xj+k . Thus we find that for any 1 ≤ i ≤ k, we need the following equalities xj bi x−j wi = wi xj wi−1 bi wi xj . This can be rewritten as    −1 j  wi , x bi = bi wi−1 , xj . 1 ...wk Thus, by the assumptions of the theorem, Φw j1 ...jk is a homomorphism. Clearly, w1 ...wk Φj1 ...jk is a Coleman automorphism of G. Using the notation of the previous lemmas, we define the following subgroup of Pi ; i o n h n   Di = wi ∈ Pi | xp , wi = 1, xt , wi−1 ∈ CG (N ) for all positive integers t . 14 Theorem 3.6. Let p be a prime number and G a nilpotent-by-(p-power cyclic) group. Let N be a nilpotent normal subgroup of G such that G/N ∼ = Cpn for some positive integer n. Let x ∈ G be a p-element such that G/N ∼ = hxi. Let P1 , ..., Pk be the Sylow subgroups of N . Let ri denote the smallest positive integer such that conj(xri )|Pi = conj(hi )|Pi for some hi ∈ Pi . Renumber  such that r1 ≤ ... ≤ rk . Put Tj a transversal of Dj / Z(Pj )CPj (hxi) hhj i ∩ Dj , where Pj is the Sylow p-subgroup of N (if it is non-trivial) and put Ti a transversal of Di / (Z(Pi )CPi (hxi) ∩ Di ). Then, Autcol (G) = Inn(G) ⋊ K, with o n 1 ...wk . | 0 ≤ j < r , w ∈ T K = Φw i i i i j1 ...jk−1 0 Furthermore, Outcol (G) ∼ = K. Proof. Note that hj is the only non-trivial of the hi . Clearly, K is a subgroup of Autcol (G). We will now show that Autcol (G) = Inn(G)K. Let σ ∈ Autcol (G). There exists a w ∈ N and k a positive integer such that σ acts as conj(wxk ) on the Sylow p-subgroup containing hxi. Denote σ̃ = σ ◦ conj(w−1 ), then σ̃|hxi = idhxi . As σ̃ is a Coleman automorphism, it follows that there exists wk ∈ Pk and a positive integer l such that σ̃|Pk = conj(wk xl ). Put σ1 = conj(x−l )◦ σ̃. Clearly, 1 ...wk σ1 = Φw j1 ...jk−1 0 for some positive integers j1 , ..., jk−1 and w1 ∈ P1 , ..., wk−1 ∈ Pk−1 . Note that, by Lemma 3.4, it follows that wi ∈ Di . Second, we show that each element of K is different from the rest. Let g ∈ G, w1 , s1 ∈ P1 , ..., wk , sk ∈ Pk and j1 , ..., jk , l1 , ..., ln positive integers. Suppose that s1 ...sk 1 ...wk Φw j1 ...jk = conj(g) ◦ Φl1 ...lk . Clearly, g ∈ CG (hxi) and for any ai ∈ Pi we have −ji −1 li wi ai wi xji . g −1 x−li s−1 i ai si x g = x Equivalently, denoting a′i = g −1 s−1 i ai si g, xji −li a′i xli −ji = wi−1 si ga′i g −1 s−1 i wi . Put g = axf , where a ∈ N . Its Sylow decomposition is a = a1 ...ak . Hence, a ∈ CN (hxi). Thus, the previous equation is equivalent with f x−f +ji −li a′i xli −ji +f = x−f wi−1 si xf aa′i a−1 x−f s−1 i wi x . Hence, −f + ji − li ≡ 0 mod pri and for the Sylow p-subgroup Pj (if it exists) of N it follows that xlj −jj wj−1 sj xf aj ∈ CG (Pj ). As this is a normal −1 subgroup of G, it follows that xlj −jj +f a−1 j wj sj ∈ CG (Pj ). Or equivalently, −1 wj sj ∈ Z(Pj )CPj (hxi) hhj i. As x is a p-element, we find for the other Sylow subgroups Pi that x−f wi−1 si xf ai ∈ Z(Pi ). As both Z(Pi ) and CPi (hxi) remain invariant under conjugation by x, it follows that this is equivalent to 15 wi−1 si ∈ Z(Pi )CPi (hxi). This shows that all elements of K are different even up to an inner automorphism and that for every Coleman automorphism σ of G, there exist positive integers f1 , ..., fk−1 and y1 , ..., yk ∈ N such that σ and ...yk Φyf11...f induce the same outer automorphism. Together with the first parak−1 graph of this proof, this shows that Autcol (G) = Inn(G)K. Furthermore, it shows that Inn(G) ∩ K = 1. Thus Autcol (G) = Inn(G) ⋊ K. 4 Meta-nilpotent groups with abelian-by-cyclic Sylow 2-subgroup In this section a slight generalization of J. Hai and S. Ge’s recent paper [6] is shown using earlier stated results. Note that the concept of Coleman automorphism in their paper includes among others the restriction that it has to be class-preserving as well. For completeness’ sake, we include the statement of J. Hai and S. Ge’s theorem. Theorem 4.1. Let G be a finite group and let N be a nilpotent normal subgroup of G such that G/N is cyclic. If the Sylow 2-subgroup of N is abelian, then every class-preserving Coleman automorphism of G of 2-power order is inner. First, we will show that in this theorem the number 2 can be replaced any prime number. For this, one can easily adapt the proof of J. Hai and S. Ge to the more general case. However, we first need to formulate the following Corollary to Lemma 1.6. Corollary 4.2. Let G be a finite group and let N be a normal subgroup of G for which the quotient group G/N is abelian. Let σ be a class-preserving Coleman automorphism of G. Then σ is an inner automorphism of G if and only if σ|N P = conj(g)|N P for some g ∈ G and some Sylow p-subgroup P of G. To show the above result, one only needs to modify σ as before such that σ|N P = idN P . This can be done by considering σ ◦ conj(g −1 ) and taking a suitable p′ -power. Moreover, it is clear that σ induces the identity on G/N , by Theorem 1.7. The result then follows from Lemma 1.6. Theorem 4.3. Let G be a finite group and let N be a nilpotent normal subgroup of G such that G/N is cyclic. Let p be a prime number. If the Sylow p-subgroup of N is abelian, then every class-preserving Coleman automorphism of G of p-power order is inner. The previous result can be extended to nilpotent-by-nilpotent groups. We show that the general theorem for nilpotent-by-nilpotent groups can be reduced to the general theorem for nilpotent-by-cyclic groups. Theorem 4.4. Let G be a nilpotent-by-nilpotent group. Let N be a nilpotent normal subgroup of G such that G/N is nilpotent. If the Sylow p-subgroup of N is abelian and the Sylow p-subgroup of G/N is cyclic, then G has no non-inner class-preserving Coleman automorphisms of order a power of p. 16 Proof. Let G be as in the statement of the Theorem. Hence, there exists a p-element x ∈ G such that N hxi /N is the Sylow p-subgroup of G/N . Put M = N hxi. Clearly, M is a normal subgroup of G and p ∤ |G/M |. So, by Theorem 1.8, the theorem is shown if Outcol (M ) ∩ Outc (M ) is a p′ -group. As M satisfies all conditions in Theorem 4.3, this clearly holds. References [1] N. Blackburn. Finite groups in which the normal subgroups have nontrivial intersection. Journal of Algebra, 3:30 – 37, 1966. [2] D.B. Coleman. On the modular group ring of a p-group. Proc. Amer. Math. Soc., 15:511 – 514, 1963. [3] E.C. Dade. Locally trivial outer automorphisms of finite groups. Math.Z., 114:57–76, 1970. [4] E.C. Dade. Correction to ”locally trivial outer automorphisms of finite groups”. Math.Z., 124:259–260, 1972. [5] F. Gross. Automorphisms which centralize a Sylow p-subgroup. Journal of Algebra, 77:202–233, 1982. [6] J. Hai and S. Ge. On Coleman automorphisms of finite nilpotent groups by cyclic groups. Acta Mathematica Sinica, English series, 32(12):1459–1464, 2016. [7] J. Hai, S. Ge, and W. He. The normalizer property for integral group rings of holomorphs of finite nilpotent groups and the symmetric groups. J. Algebra Appl., 16(2), 2017. [8] J. Hai and J. Guo. The normalizer property for the integral group ring of the wreath product of two symmetric groups Sk and Sn . Comm.Algebra, 45(3):1278 – 1283, 2017. [9] M. Hertweck. Class-preserving automorphisms of finite groups. Journal of Algebra, 241(1):1–26, 2001. [10] M. Hertweck. A counterexample to the isomorphism problem for integral group rings of finite groups. Annals of Mathematics, pages 115 – 138, 2001. [11] M. Hertweck. Local analysis of the normalizer problem. Journal of Pure and applied Algebra, 163:259 – 276, 2001. [12] M. Hertweck. Class-preserving coleman automorphisms of finite groups. Monatsh. Math., 136:1–7, 2002. [13] M. Hertweck and E. Jespers. Class-preserving automorphisms and the normalizer property for Blackburn groups. Journal of Group Theory, 12:157 – 169, 2009. [14] M. Hertweck and W. Kimmerle. Coleman automorphisms of finite groups. Math.Z., 242:203 – 215, 2001. [15] B. Huppert. Endliche Gruppen I. Springer, 1967. [16] S. Jackowski and Z. Marciniak. Group automorphisms inducing the identity map on cohomology. J. Pure Appl. Algebra, 44:241 – 250, 1987. [17] Z. Li and J. Hai. The normalizer property for integral group rings of wreath products of finite nilpotent groups by cyclic groups. Communications in Algebra, 39:521 – 533, 2011. [18] Z. Li and Y. Li. Coleman automorphisms of generalized dihedral groups. Acta Mathematica Sinica, 32(2):251–257, 2016. [19] M. Mazur. On the isomorphism problem for integral group rings of infinite groups. Expo.Math., 13:433–445, 1995. [20] M. Mazur. The normalizer of a group in the unit group of its group ring. Journal of Algebra, 212:175 – 189, 1999. 17 [21] A.I. Saksonov. Group rings of finite groups.i. Publ.Math.Debrecen, 18:187–209, 1971. [22] S.K. Sehgal. Units in integral group rings. Longman, 1993. 18
4math.GR
1 Rate-Distortion Bounds on Bayes Risk in Supervised Learning arXiv:1605.02268v2 [cs.IT] 17 Nov 2017 Matthew Nokleby∗ , Ahmad Beirami† , Robert Calderbank‡ ∗ Wayne State University, Detroit, MI, email: [email protected] † MIT, Cambridge, MA, email: [email protected] ‡ Duke University, Durham, NC, email: [email protected] Abstract We present an information-theoretic framework for bounding the number of labeled samples needed to train a classifier in a parametric Bayesian setting. Using ideas from rate-distortion theory, we derive bounds on the average Lp distance between the learned classifier and the true maximum a posteriori classifier—which are well-established surrogates for the excess classification error due to imperfect learning. We provide lower and upper bounds on the rate-distortion function, using Lp loss as the distortion measure, of a maximum a priori classifier in terms of the differential entropy of the posterior distribution and a quantity called the interpolation dimension, which characterizes the complexity of the parametric distribution family. In addition to expressing the information content of a classifier in terms of lossy compression, the rate-distortion function also expresses the minimum number of bits a learning machine needs to extract from training data in order to learn a classifier to within a specified Lp tolerance. Then, we use results from universal source coding to express the information content in the training data in terms of the Fisher information of the parametric family and the number of training samples available. The result is a framework for computing lower bounds on the Bayes Lp risk. This framework complements the well-known probably approximately correct (PAC) framework, which provides minimax risk bounds involving the Vapnik-Chervonenkis dimension or Rademacher complexity. Whereas the PAC framework provides upper bounds the risk for the worst-case data distribution, the proposed rate-distortion framework lower bounds the risk averaged over the data distribution. We evaluate the bounds for a variety of data models, including categorical, multinomial, and Gaussian models. In each case the bounds are provably tight orderwise, and in two cases we prove that the bounds are tight up to multiplicative constants. Index Terms Supervised learning; Rate-distortion theory; Bayesian methods; Parametric statistics. I. I NTRODUCTION A central problem in statistics and machine learning is supervised learning, in which a learning machine must choose a classifier using a sequence of labeled training samples drawn from an unknown distribution. The effectiveness of the learned classifier is measured by its accuracy in classifying future test samples drawn from the same distribution. Standard approaches to this problem include support vector machines, [1]–[3], random forests [4], and deep neural networks [5], [6]. In supervised learning, a fundamental question is the sample complexity: how many training samples are necessary to learn an effective classifier? The prevailing approach to characterizing the sample complexity This work was presented in part at the IEEE Machine Learning in Signal Processing Workshop, Boston, MA, Oct. 2015, and the IEEE Symposium on Information Theory, Barcelona, Spain, Jul. 2016. 2 is the probably approximately correct (PAC) framework, which provides almost sure bounds on the sample complexity of families of classifiers irrespective of the data distribution. These bounds are expressed in terms of the Vapnik-Chervonenkis (VC) dimension, which captures combinatorially the complexity of families of classifiers [7], [8]. A typical result goes as follows: for a classifier family with VC dimension h and given n training samples, the excess error probability of the learned classifier over that of the best p classifier in the family is with high probability O( h/n). The PAC framework leads to the empirical risk minimization (ERM) and structural risk minimization (SRM) frameworks for model selection: The system designer considers sequence of classifier families with increasing VC dimension, and chooses the family that minimizes the PAC bound over the available training set. PAC bounds are available for many popular classifiers, including SVMs and neural networks [1], [9], [10]. Refinements to the PAC bounds provide tighter bounds on the risk. Data-dependent bounds based on the fat-shattering dimension and Rademacher complexity were developed in [11]–[13], and more recently, local Rademacher averages, margin-dependent, and concentration-free bounds tighten the results further, in some cases offering an order-wise improvement in predicted sample complexity [14]–[16]. PAC-Bayes bounds, in which one imposes a prior over the set of classifiers, were developed in [17], [18]. A limitation of PAC bounds is that they characterize the minimax performance over the distribution family. This may lead to pessimistic predictions relative to practical peformance [19], [20]. Indeed, the authors of [21] put it this way: “The assumption that the adversary is capable of choosing a worstcase parameter is sometimes over-pessimistic. In practice, the parameter that incurs a worst-case risk may appear with very small probability.” To go around this, many researchers have studied average-case bounds. Rissanen proposed the minimum description length (MDL) criterion for model selection [22], which leverages results from universal source coding to select the complexity of the model class and to avoid overfitting. The MDL framework has since seen wide use in machine learning (see [23] and [24] and the references therein for a recent survey). Information-theoretic connections to model-order selection have also been studied, resulting in the Akaike and Bayes information criteria [25], [26] and information bottleneck methods [27], [28] In this paper, we develop a framework for computing bounds on the Bayes risk for estimating the posterior in supervised learning. In particular, we are concerned with the “soft” classification performance of the learning machine. That is, rather than measure performance strictly in terms of the error probability of the learned classifier, we measure how well a learning machine can estimate the posterior function, which in turn is used to classify test samples via the MAP rule. The quality of the estimated posterior measures not only how well one can classify future test samples, but also how well one can estimate the confidence level of the learned classifier each time it encounters a test point. We develop the framework of this paper in a Bayesian parametric setting. The joint distribution on data points X and labels Y belongs to a known parametric family p(x, y|θ), and the parameters that index the distribution are drawn from a known prior q(θ). An example is Gaussian classification, where for each class y, p(x|y, θ) is a multivariate Gaussian with fixed covariance and mean taken as a subvector of θ. A suitable prior q(θ) for computational purposes is the conjugate prior, which in this case is itself a Gaussian. The proposed framework provides lower bounds on the average Lp distance between the true posterior p(y|x, θ) and the posterior estimated from n i.i.d. samples drawn from p(x, y|θ). Because the bounds are 3 averaged over the prior q(θ), they do not exhibit the pessimism of minimax bounds. The Lp risk is a well-known surrogate for the excess classification error [29], [30], so bounds on these errors give insight into the performance of the learned classifier. Furthermore, this approach connects the problem of learning a classifier to the problem of learning a distribution from samples—for a fixed x, the posterior is merely a distribution to learn from training samples. The problem of learning a distribution has a rich history, dating back to the Good-Turing estimator [31] and continuing to recent results [32]–[35]. The proposed framework identifies a relationship between supervised learning and lossy source coding. In the parametric Bayesian setting, the posterior distribution is a function of the random parameters θ and therefore is a random object. If we take the Lp distance as the distortion function, we can bound the number of nats needed to describe the posterior to within a specified tolerance.1 What follows is the main result of this paper: In order to drive the average Lp error below a threshold , the mutual information between the training samples and the parameters θ must be at least as great as the differential entropy of the posterior plus a penalty term that depends on  and a sample-theoretic quantity, called the interpolation dimension, which measures the number of data points from the posterior distribution needed to uniquely interpolate the entire function. The resulting framework is complementary to the PAC framework. Whereas the PAC framework considers families of classifiers and provides generalization bounds that hold for any data distribution, the rate-distortion framework considers families of data distributions and provides generalization bounds that hold for any classifier. Whereas the VC dimension characterizes the combinatorial complexity of a family of classifiers, the interpolation dimension characterizes the sample complexity of a parametric family of data distributions. The larger the interpolation dimension, the more training samples are needed to guarantee classifier performance. We also emphasize that Bayes risk lower bounds are derived in terms of f -divergences, which generalize the usual KL-divergence, in [21]. An explicit connection between rate-distortion theory and learning is investigated in [36], where PAC-style bounds on generalization error are derived when samples are subject to lossy compression. Along similar lines, lower bounds on the distributed learning of a function over a network are derived in [37]. The contributions of this paper are as follows. After formally laying out the problem statement in Section II, we present bounds on the rate-distortion functions of Bayes classifiers in Section III. These rate-distortion functions take the posterior p(y|x, θ) as the random source to be represented, and the Lp risk as the distortion measure. We consider two definitions of the Lp Bayes risk: one which averages the Lp risk over the parameter θ and the test point X, and one which averages over the parameter θ but considers the worst case Lp over test points X that live in a pre-defined subset. The first definition characterizes the average performance overall, whereas the second definition allows one to focus on a particular region of test points. The bounds on the rate-distortion function are in terms of an object called an interpolation set and a related quantity called the interpolation dimension. It is difficult to directly analyze the information content in the posterior of a continuous distribution, as it is a set of uncountably many random vectors. To address this issue, we define a sufficient set of points x to describe the posterior, called a (sufficient) interpolation set. When the interpolation set has finite cardinality, one can more easily bound the rate1 Note that information and entropy are measured in nats throughout this paper. 4 distortion function by considering only the finite samples of the posterior. The resulting bounds involve the differential entropy of the posterior evaluated at the elements of the interopolation set, the Lp distortion criterion, and the cardinality of the interpolation set, termed the interpolation dimension. In Section IV, we translate the bounds on the rate-distortion bounds into bounds on the sample complexity. Applying a Bayesian version of the capacity-redundancy theorem, [38], we find that the mutual information between the training set and the parameters θ, which are random in our Bayesian setup, scales as log(n) and depends on the determinant of the Fisher information matrix averaged over the distribution family. Using this fact, we derive bounds on the number of samples needed to ensure small Lp error. We also discuss the challenges and opportunities for deriving matching Bayes risk outer bounds. In Section V, we consider several case studies. First, we consider the simple problem of estimating a discrete distribution from n i.i.d. samples. In this case, derive closed-form bounds on the Lp rate-distortion function of the distribution and lower bounds on the Lp Bayes risk. These bounds are tight order-wise, and in the asymptote they agree almost exactly with the minimax error. Then, we consider learning a binary multinomial classifier, a model popular in document classification. Again we derive closed-form bounds on the rate-distortion function and Lp Bayes risk, which are provably order optimum. We carry out a similar analysis for binary Gaussian classifiers. Finally, we consider a simple “zero-error” classification p problem. In this case, the resulting Lp risk falls off as 1/n instead of the 1/n obtained in the previous cases; we also show that the rate-distortion bounds are nearly tight. We give our conclusions in Section VI. Notation: Let R and Z denote the fields of real numbers and integers, respectively, and let R+ denote the set of non-negative reals.. Let capital letters X denote random variables and vectors, and lowercase letters x denote their realizations. For x ∈ Rk , let diag(x) denote the k × k matrix with the elements of x on its diagonal. We let E[·] denote the expectation, with the subscript indicating the random variable over which the expectation is taken when necessary. Let | · | denote the cardinality of a set. For a function f (x) and a finite set S, let {f (x)}S denote the |S|-length vector of function evaluations of f at the points in S, suppressing the arguments when clarity permits. Let [M ] = {1, . . . , M } for integer M . Let I(· ; ·) denote the mutual information and h(·) denote the differential entropy. We use the natural logarithm throughout, so these quantities are measured in nats. Let ∆k denote the k-dimensional unit simplex ( ) k+1 X ∆k = x ∈ Rk+1 : xi = 1 . + i=1 For z ∈ R+ , let Γ(z) denote the gamma function: Z Γ(z) = ∞ xz−1 e−x dx. 0 For z ∈ R+ , let ψ(z) denote the digamma function: ψ(z) = d log Γ(z). dz 5 For two scalars x, y ∈ R+ , let B(x, y) denote the beta function: B(x, y) = Γ(x)Γ(y) . Γ(x + y) For a vector γ ∈ RM + , let B(γ) denote the multivariate Beta function: QM Γ(γi ) B(γ) = i=1 PM  . Γ i=1 γi Let N (µ, Σ) denote the normal distribution with mean µ and (co)variance Σ. Let Beta(α, β) denote the beta distribution with shape parameters α, β > 0, which has the density function p(x) = xα−1 (1 − x)β−1 . B(α, β) For γ ∈ Rk+ , let Dir(γ) denote the Dirichlet distribution, which has the density function M 1 Y γi −1 x . p(x) = B(γ) i=1 i II. P ROBLEM S TATEMENT We consider the problem of supervised learning in a parametric statistical framework. Let each data point X ∈ X ⊂ Rd and its label Y ∈ [M ] be distributed according to p(x, y|θ), where θ ∈ Λ ⊂ Rk indexes a parametric family of distributions D = {p(x, y|θ) : θ ∈ Λ}. The alphabet X may be discrete or continuous. In the former case, p(x, y|θ) is the joint probability mass function of the data point and its label. In the latter case, we abuse notation slightly and refer to p(x, y|θ) as the joint probability density function even though Y is a discrete random variable. Suppose that “nature” selects θ ∈ Λ. The learning machine obtains a sequence of n samples, denoted n Z = (X n , Y n ), where each pair Zi = (Xi , Yi ), 1 ≤ i ≤ n is drawn i.i.d. according to p(x, y|θ). The learning task is to select a classifier ŷ = w(x) from the training samples Z n . In principle, the classifier may be any function w : X → [M ]. If θ were known, one could choose the the maximum a posteriori (MAP) classifier, which minimizes the classification error: wMAP (x) = arg max p(y|x, θ), y where p(y|x, θ) is calculated according to Bayes’ rule. Of course, in supervised learning the data distribution is unknown, so the MAP classifier is unavailable. Instead, we suppose that the learning machine knows the parametric family D, but not the specific distribution p(x, y; θ). The objective of supervised learning is to characterize the performance of the learned classifier w(x) as a function of the number of training samples n. A natural performance metric is the gap between the misclassification error of the learned classifier and that of wMAP : Lc (x, θ; w, wMAP ) = Pr(Y 6= w(x)) − Pr(Y 6= wMAP (x)), (1) 6 where the probabilities are computed according to the joint distribution p(x, y|θ). As discussed in the introduction, the minimax loss with respect to Lc is characterized by the PAC framework. For a family of p classifiers containing the MAP classifier and having with VC dimension h, Lc (x, θ; w, wMAP ) = O( h/n) for any distribution over X and Y and with high probability over the distribution p(x, y; θ). Instead of the misclassification error gap, we analyze the Bayes risk in learning the posterior to analyze the soft classification capability of the learning machine, where performance is averaged over the distributions indexed by θ. Let q(θ) be a prior distribution over the parametric family. The proposed framework presents performance bounds averaged over the family of distributions according to q(θ). We can view the Bayes error in a few different ways. First, if q(θ) represents the true distribution over the parameters space, then the Bayes risk is simply the average loss over many instances of the learning problem. Second, for any q(θ), the Bayes risk represents a lower bound on the minimax risk, and depending on the strength of the prior distribution q(θ) the Bayes risk may be much smaller. Furthermore, rather than study the classification error gap, we study the Lp loss. We define these losses in terms of the posterior distribution p(y|x, θ), also called the regression function. That is, rather than choose a classifier w(x) directly, the learning machine estimates the regression function, which is later used to classify test points according to the MAP rule. To underscore this point, let W (y|x, θ) := p(y|x, θ) denote the true regression function, which takes as input x ∈ X and produces as output the M -dimensional vector of probabilities that x belongs to class y. Also let δ(Z n ) = Ŵ (y|x) be a learning rule that maps the training samples to an estimate2 of the regression function W . Then, for every x, the loss is defined as the Lp distance between the M -dimensional vector formed by W (·|x; θ) and Ŵ (·|x): Lp (x, θ; W, Ŵ ) = M X y=1 ! p1 |W (y|x, θ) − Ŵ (y|x)|p . (2) Bounds on the Lp loss, rather than the classification error Lc , are valuable for several reasons. First, The Lp loss is related to Lc . A well-known fact (see, e.g. [29]) is that L1 , averaged over X , bounds the classification loss Lc from above. A somewhat less well-known fact is that this relationship holds pointwise (see [30] for a discussion). A classifier using the regression function Ŵ (y|x) has classification error satisfying Lc ≤ L1 both for any point x and averaged over X. Via norm equivalence, one can derive similar bounds for any Lp . Second, the Lp loss gives a comprehensive sense of classifier performance. When classifying signals, one wants to know not only the most probable class, but the confidence one has in the classification. Small Lp risk not ensures not only near-optimum classification error, but also good estimates on the accuracy of each classification decision. Similarly, if one wants to use a classifier to minimize an arbitrary expected loss—in which each type of misclassification incurs a different penalty— one needs an accurate estimate of the regression function itself. Finally, we point out the well-known relationship between L1 and the Kullbeck-Leibler (KL) divergence. 2 We omit any dependence on θ in Ŵ (y|x) to indicate that the regression function estimate is made in ignorance of θ. 7 Let LKL (x, θ; W, Ŵ ) = M X W (y|x, θ) log y=1 W (y|x, θ) ! (3) Ŵ (y|x) be the KL divergence between the W and Ŵ , evaluated at each test point x ∈ X . Pinsker’s inequality L2 [39], [40] states that LKL ≥ 21 . Therefore, lower bounds on the L1 Bayes risk can be translated into bounds on the KL divergence between W and Ŵ , averaged over θ. The KL divergence has an important place in modern machine learning in the guise of the cross-entropy loss or log loss, which is a popular criterion for the training of learning models, including deep learning [41]. The Bayes risk of a learning rule δ is computed by taking the average over the point-wise loss functions defined above. There are three variables over which to take averages: the data point X, the training set Z n , and the parameterization index θ. It is illustrative to parse out the impact of averaging over different random variables. To this end, we consider two definitions of the Bayes risk. The first definition, termed the X 0 -Bayes risk, involves averages over θ and Z n only. We suppose that the test point x lives in a set X 0 ⊂ X , over which set we consider the worst-case Lc or Lp loss. If X is compact, we may consider the worst-case Bayes risk for all x ∈ X ; otherwise, it may be beneficial to consider the worst-case performance of some compact subset X . That is, we consider the Lc or Lp loss averaged over θ and Z n , in the worst case over x ∈ X 0 . We formalize this with the following definition. Definition 1. Define the X 0 -Bayes risk of a learning rule δ with respect to the Lp loss as " 0 LX p (δ) = sup x∈X 0 EZ n ,θ M X y=1 #! p1 |W (y|x; θ) − Ŵ (y|x)|p . (4) An analogous definition holds with respect to the Lc loss. The worst-case Bayes risk over points x ∈ X 0 may be pessimistic, especially if the set X 0 is large. We also consider the Lp loss averaged over θ, Z n , and X, which we term simply the Bayes risk. Definition 2. Define the Bayes risk with respect to the Lp loss as Lp (δ) = EX,Z n ,θ "M X y=1 #! p1 |W (y|x; θ) − Ŵ (y|x)|p . (5) Again, an analogous definition holds with respect to the Lc loss. The Bayes risk L is simply the average performance, measured in terms of Lc or Lp loss, averaged over the data distribution θ, the data point X and the training set Z n . Note that in each case the normalizing power 1/p is taken outside the expectation. The basic ingredient of our results is a rate-distortion analysis of the Bayes risk. In essence, we characterize the minimum number of nats that the learning machine must extract from the training set in order to obtain a representation of the regression function up to a specified Bayes risk tolerance. To this end, we characterize the rate-distortion function of the posterior that the learning machine hopes to learn from Z n . Suppose Ŵ is the “compressed” or lossy version of the posterior W . Then, define the rate distortion functions with respect to the Bayes risk functions from Definitions 1 and 2. Definition 3. The rate-distortion function of the regression function W with respect to the X 0 -Bayes risk 8 and the Lp loss is 0 RpX (D) = inf I(W ; Ŵ ), (6) p(Ŵ |W ) 0 LX p ≤D where I(W ; Ŵ ) is the mutual information between the true and approximated regression function. With respect to the Bayes risk, the rate-distortion function is Rp (D) = inf I(W ; Ŵ ). (7) p(Ŵ |W ) Lp ≤D The challenge in computing the rate-distortion functions defined above is that the regression function is a collection of many random variables—uncountably many if X is an uncountable alphabet. While the mutual information I(W ; Ŵ ) between them is well-defined, analyzing I(W ; Ŵ ) requires care. Much of Section III is given over to the development of techniques for such analysis. The rate-distortion function is interesting in its own right in the usual information-theoretic sense. Indeed, if one has learned a regression function for a parametric model, one might ask how much information is required to encode the posterior to transmit to another party. Per the rate-distortion and source-channel 0 separation theorems, one needs RpX (D) or Rp (D) nats in order to ensure that the reconstructed posterior has X 0 -Bayes or Bayes risk, respectively, no more than D. Therefore, the following rate-distortion analysis has implications for distributed learning over networks, which is a subject to be taken up in future work. Nevertheless, our main motivation in studying the rate-distortion function of W is to derive lower bounds on the Bayes risk. In addition to quantifying how many nats one needs to encode the regression function up to a Bayes risk tolerance D, the rate-distortion function quantifies how many nats a learning machine needs to extract from the training set in order to learn the regression function up to the same tolerance. Furthermore, one can quantify the maximum number of nats one can extract from the training set via the mutual information between Z n and the distribution index θ. Putting the two ideas together, one can derive necessary conditions on the Bayes risk. We formalize this notion in the following lemma. Lemma 1. Whenever a learning rule δ(Z n ) has X 0 -Bayes risk or Bayes risk less than or equal to D, the conditions 0 I(Z n ; θ) ≥ RpX (D) I(Z n ; θ) ≥ Rp (D) (8) (9) hold, respectively. See Appendix D for the proof. The intuition behind Lemma 1 is the number of nats required to learn W with Bayes risk no greater than D is given by Rp (D), and the number of nats provided by the training set Z n is no greater than the mutual information I(Z n ; θ). The number of nats provided must satisfy the number of nats required. We further illustrate the analogy between the proposed framework and standard rate-distortion theory in Figure 1. 9 p(x) X n = (X1 , . . . , Xn ) q(θ) p(x, y; θ) W (y|x; θ) Encoder i ∈ {1, . . . , 2nR } Decoder X̂ n (Z1 , . . . , Zn ) Learning Machine Ŵ (y|x) Fig. 1: The analytical framework in this paper is by a connection to rate-distortion theory. In rate distortion, a source distribution p(x) gives rise to an n-length sequence X n , which is encoded to one of 2nR indices. The decoder infers from this index a noisy reconstruction X n , and the average distortion depends on the encoding rate via the rate-distortion function. In this paper, the prior distribution q(θ) gives rise to the data distribution p(x, y; θ) and its associated regression function W (y|x, θ), and we treat the training samples Z n drawn from p(x, y|θ) as an imperfect encoding of the regression function. The learning machine infers from Z n a noisy estimate Ŵ (y|x), and the Lp estimation error depends on the number of samples. III. M AIN R ESULTS This section is devoted to developing bounds on the rate-distortion functions, and by extension the Bayes risk functions, defined in the previous section. We first define a few necessary concepts. The regression function W (y|x, θ) is a potentially uncountable collection of random variables, one for each point (x, y) ∈ X × [M ]. The mutual information between, or the joint entropy of, uncountably many random variables is difficult to analyze directly, which makes it difficult to compute the rate-distortion functions of W . Therefore, we will analyze the informationtheoretic quantities of a sampled version of W (y|x; θ), which acts as a sufficient statistic for the entire function. We capture this notion by defining the interpolation set and the interpolation dimension. Definition 4. Let S ⊂ X be a finite set, and let W (S) be the M − 1 × |S|  W (1|x1 ; θ) ... W (1|x|S| )  . ... ... .. W (S) =  W (M − 1|x1 ; θ) . . . matrix   . (10) W (M − 1|x|S| ) That is, W (S) is a matrix where the columns are evaluations of the first M − 1 points of the regression function at the points in S. We say that S is an interpolation set for the regression function W (y|x; θ) if the differential entropy h(W (S)) is well-defined and finite. In other words, S is an interpolation set if sampling the regression function at each point x ∈ S does not over-determine the regression function with respect to the randomness in q(θ). For example, in Section V we consider a binary classification problem over X = Rd where the regression function is has the logistic form: 1 . W (y = 1|x, θ) = 1 + exp(−xT θ) Recall that θ is the unknown parameter, here playing the role of the regression coefficients. If one chooses S to be a set of d linearly independent vectors x1 , . . . , xd in Rd , it is straightforward to verify that the joint density on the random variables W (S) exists, and the joint differential entropy h(W (S)) is finite as long as q(θ) is well-behaved. However, if one adds another point to S, the first d points completely 10 determine the regression function value at the (d + 1)-th point; the resulting joint distribution is singular, and the joint entropy is, depending on one’s definitions, undefined or equal to −∞. For an interpolation set S, W (S) provides a finite-dimensional representation of the (perhaps) infinitedimensional regression function. Even when X is discrete, W (S) gives a compact representation of W . It follows from the data-processing inequality that, for any learning rule, I(W (S); Ŵ (S)) ≤ I(W ; Ŵ ). (11) An important special case is when this inequality holds with equality. Definition 5. An interpolation set S is said to be sufficient if I(W (S); Ŵ (S)) = I(W ; Ŵ ). Equivalently, an interpolation set is sufficient if I(W ; Ŵ |W (S)) = I(W ; Ŵ |Ŵ (S)) = 0. Roughly speaking, an interpolation set is sufficient if one can recover the entire regression function W (y|x; θ) from the samples W (S). Indeed, in the logistic regression example considered above, a set of d linearly independent points for S is a sufficient interpolation set. From the d function evaluations, one can solve for θ exactly and recover the regression function for all values of x. The cardinality of a sufficient interpolation set will play a prominent role in the analysis. Definition 6. The interpolation dimension, denoted dI is the cardinality of the smallest sufficient interpolation set S. The interpolation dimension characterizes the number of distinct evaluations of the regression function are needed to reconstruct it. In this sense, it is akin to the Nyquist rate in sampling theory, expressing how many function evaluations it takes to characterize a function having known structure. The interpolation dimension is a characteristic of the parametric family D. Indeed, it measures the complexity of D in a manner similar to the VC dimension. Whereas the VC dimension characterizes the complexity of a family of classifiers by how many points it can shatter, the interpolation dimension characterizes the complexity of a family of distributions by how many sample points of the regression function are needed to reconstruct it. We emphasize that the number of function evaluations of the regression function needed for an interpolation set is distinct from the number of independent samples drawn from the distribution needed to learn the regression function. The learning machine never sees regression function evaluations during supervised learning, only samples Z n drawn from the source distribution. The interpolation set and dimension are tools to facilitate the analysis of the rate-distortion functions and the Bayes risk associated with a parametric family. Nevertheless, we will show that, although they are distinct concepts, the number of training samples needed to learn the regression function is related to the interpolation dimension. Before presenting the bounds, we need a final technical condition on S and the parametric family. Definition 7. An interpolation set S is said to be onto if, for every matrix Q ∈ M − 1 × |S| in the set Q = {Q ∈ M − 1 × |S| : there is at least one θ ∈ Λ such that W (S) = Q. M −1 X i=1 qij ≤ 1∀j, qij ≥ 0, ∀i, j}, 11 In other words, an interpolation set S defines a mapping W (S) : Λ → Q, and the S is onto if this mapping is onto. The set Q is just the set of all valid probability vectors truncated to their first M − 1 elements. An interpolation set is onto if we can realize any valid probability vector by choosing θ. For all of the examples we consider in this paper, the interpolation sets are onto. However, one can define parametric models where the regression function takes on only a subset of all possible probability vectors. Consider the trivial example X = {0}, M = 2, Λ = [0, 0.5), and the Bernoulli parametric family  D = p(x, y; θ) = θy−1 : θ ∈ Λ . In this case, the set of regression functions is restricted, and no onto interpolation set exists. 0 A. Bounds involving LX p (δ) 0 The first result is a bound on the rate-distortion function RpX (D) in terms of the interpolation dimension and the entropy of the regression function. Theorem 2. Let dI (W ) < ∞ be the interpolation dimension of W (y|x; θ), and suppose there exists an onto, sufficient interpolation set with cardinality dI . Let S ⊂ X 0 be an interpolation set (not necessarily 0 sufficient or onto) with |S| = d∗ such that S ⊂ X 0 . Then, the rate-distortion function RpX (D) for all p ≥ 1 is bounded by   +     1 pe 1 X0 + log , (12) Rp (D) ≥ h(W (S)) − d∗ (M − 1) log D + log 2Γ 1 + p p M −1    1 X0 Rp (D) ≤ −dI (M − 1) log min D, . (13) M −1 The proof is provided in Appendix A. The content of Theorem 2 is that the rate distortion function is at least as great as the differential entropy of the regression function evaluated at the interpolation set, less a penalty term that involves the expected Lp distortion and the cardinality of the interpolation set. The higher the cardinality of the interpolation dimension, the larger the rate-distortion function and the more nats are needed to describe the regression function on average. We emphasize that the lower bound holds for any interpolation set. If its cardinality is less than the interpolation dimension, one simply obtains a 0 looser bound on RpX (D). However, the upper bound depends on the interpolation dimension, and in fact is invariant to the choice of interpolation set. In this sense, the interpolation dimension is a fundamental quantity, figuring prominently in both upper and lower bounds on the rate-distortion function. 0 Corollary 3. Under the same assumptions as in Theorem 2, the rate-distortion function RpX (D) for p ∈ {1, 2, ∞} is bounded from below by +    2e X0 R1 (D) ≥ h(W (S)) − d∗ (M − 1) log D , (14) M −1 " !#+ r 2πe 0 R2X (D) ≥ h(W (S) − d∗ (M − 1) log D , (15) M −1 0 X R∞ (D) ≥ [h(W (S) − d∗ (M − 1) log (2D)]+ . (16) 12 B. Bounds involving Lp (δ) The bounds presented in Theorem 2 are worst-case over a set X 0 of test points, so a single poorperforming point forces a high value of the X 0 -Bayes risk. This worst-case performance is a useful metric, but we are also interested in knowing the average-case performance over the test points. To bound this performance, we carry out an analysis of the mutual information between W and Ŵ averaged over an ensemble of interpolation sets. This requires additional machinery. Definition 8. Let V be an index set, either countable or uncountable. We say that the function S : V → X d∗ is an interpolation map if: (1) every S(v) is an interpolation set, and (2) S(v) ∩ S(v 0 ) = ∅ for all v 6= v 0 ∈ V. In other words, an interpolation map defines a collection of disjoint interpolation sets, each having d∗ elements. The interpolation sets need not be sufficient interpolation sets, and the size d∗ of each interpolation set need not be the interpolation dimension dI . Not every x ∈ X is found in an interpolation set S(v), but we will see that an interpolation map that “covers” more of X is more useful for analysis. Definition 9. Let the range of S(v) be W(S) = {x : ∃v ∈ Vs.t.x ∈ S(v)}. Then, let the probability of S(v) be Z p(x)dx, γ(S) = W(S) where the integral becomes a sum if X is countable. We will find it convenient to work with interpolation maps that are isotropic with respect to the probability distribution p(x). Definition 10. We say an interpolation map S(v) is isotropic if, for every v ∈ V and x, x0 ∈ S(v), p(x) = p(x0 ). In other words, an interpolation map is isotropic if the points in the interpolation set lie on level sets of the probability distribution p(x). When one can define an isotropic interpolation map, one can bound the Bayes risk with expressions similar to those of Theorem 2. Theorem 4. Suppose either that X is countable or that X is uncountable and the density p(x) is Riemann integrable. Suppose also there exists an onto, sufficient interpolation set with cardinality dI . Let S be an isotropic interpolation map with dimension d∗ and probability γ(S). Then, the rate distortion function Rp (D) for all p ≥ 1 is bounded by      +    1 1 pe D + log 2Γ 1 + + log , Rp (D) ≥ EV [h(W (S(V )))] − d∗ (M − 1) log γ(S) p p M −1 (17)    1 Rp (D) ≤ −dI (M − 1) log min D, , (18) M −1 13 where the expectation is taken over the distribution p(v) = p(S−1 (v)), for S−1 (v) denoting any point in the inverse image of S(v). Furthermore, the lower bound on R∞ (D) holds for any interpolation map, regardless of whether or not it is isotropic. 0 See Appendix B for the proof. The content of Theorem 4 is that, similar to the bounds on RpX , the rate-distortion function depends on the entropy of the interpolation set and a penalty term associated with the permissible Lp risk. Here, however, the entropy is averaged over the interpolation map. This allows us to account for the average Lp error over all of the points in the range of the interpolation map S, whereas the previous result accounted for the worst-case Lp error over the subset X 0 . Corollary 5. Under the same assumptions as in Theorem 4, the rate distortion function Rp (D) for p ∈ {1, 2, ∞} is lower bounded by +   2e D , (19) R1 (D) ≥ EV [h(W (S(V )))] − d∗ (M − 1) log (M − 1)γ(S) s " !#+ 2πe R2 (D) ≥ EV [h(W (S(v)))] − d∗ (M − 1) log D , (20) (M − 1)γ(S) R∞ (D) ≥ [EV [h(W (S(v)))] − d∗ (M − 1) log (2D)]+ . (21) IV. S AMPLE C OMPLEXITY B OUNDS Combining Lemma 1 and Theorems 2 and 4, one can compute lower bounds on the Bayes risk Lp 0 and LX p , and turn them into sample complexity lower bounds. These bounds incorporate the interpolation dimension, the differential entropy of the posterior, and the mutual information between the training samples and the distribution index θ. To this end, one must evaluate two quantities: the mutual information I(Z n ; θ) between the training set and the parameterization θ, and the differential entropy h(W (S)) of the regression function evaluated at points in the interpolation set, perhaps averaged over an interpolation map S. Under appropriate conditions, these quantities can be expressed in simpler terms, permitting the explicit computation of sample complexity bounds. We present the expressions for I(Z n ; θ) and h(W (S)), respectively, after which we derive sample complexity bounds. A. An Expression for I(Z n ; θ) for a Smooth Posterior Using results from universal source coding, we express I(Z n ; θ) in terms of the differential entropy of θ and the Fisher information matrix of the distribution family. Let α = s(θ) be a minimal sufficient statistic of θ, meaning both that we have that p(x, y|α, θ) = p(x, y|α) and that α is a function of any other sufficient statistic. Then, let let I(α) denote the Fisher information matrix with respect to α:   ∂2 I(α)i,j , −EX,Y log(p(X, Y ; θ)) . ∂αi ∂αj The Fisher information roughly quantifies the amount of information, on the average, that each training sample conveys about θ. Under appropriate regulatory conditions, we can make this notion precise and bound the mutual information in terms of the number of training samples n. 14 Theorem 6. Let the parametric family p(x, y; θ) have minimal sufficient statistic α ∈ Rt . Suppose that the Fisher information matrix I(α) exists, is non-singular, and has finite determinant. Further suppose √ that the maximum-likelihood estimator of α from Z n is asymptotically efficient. That is, (α̂(Z n ) − α) n converges to a normal distribution with zero mean and covariance matrix I −1 (α). Then, the following expression holds 1 n t + Eα [log |I(α)| 2 ] + h(α) + on (1). (22) I(Z n ; θ) = log 2 2πe Proof. This follows from the celebrated redundancy-capacity theorem (see [42]–[44]). Averaging the bounds derived by Clarke and Barron [38] over q(α) yields the result. The upshot is that the information conveyed by the training set grows as (1/2) log(n) times the effective dimension of the parameter space. Further constants are determined by the sensitivity of the distribution to the parameters, as quantified by the Fisher information matrix, and the prior uncertainty of the parameters, as expressed by h(α). The expression is intuitive in light of the assumption that the central limit theorem holds. The maximum-likelihood estimator of α approaches a Gaussian distribution in the limit of increasing n, and the resulting mutual information includes a term with the associated differential entropy. However, this result holds only for smooth distributions p(x, y; θ), for which the Fisher information matrix is also well-defined. In Section V-D, we consider a case where the smoothness assumption does not hold, which changes the scaling on I(Z n ; θ). B. Expressions for h(W (S) The differential entropy h(W (S)) is an unusual quantity. To compute it, we must evaluate the density of the posterior distribution W (y|x; θ), evaluated at finitely many points, and take the expected logarithm. This “density of a distribution” will often be difficult to evaluate in closed form, and evaluating the expected logarithm will be more difficult still. Therefore, we cannot expect that a closed-form expression for h(W (S)) will always be available for problems of interest. Nevertheless, we can develop intuition for h(W (S)). Consider an interpolation set S with |S| = dI . For example, for the binary Gaussian classifier, the interpolation set is a basis of Rd evaluated at y = 1. Indeed, a common case is where l = d, and where the set of vectors xi form a basis of Rm . In this case, the differential entropy has the following expression. Theorem 7. Define the random variables Niy = p(xi , y|θ), for every 1 ≤ i ≤ dI and every 1 ≤ y ≤ M . Then, under the preceding assumptions, the differential entropy of the regression function is    X    dI dI X 1 + 2Si Si h(W (S)) = − (M − 1)E log − E log 1 + + h(N ), (23) 1 + Si (1 + Si )(1 + 2Si ) i=1 i=1 where Si = exists. PM y=1 Niy , and where N is the matrix of the random variables Niy , supposing that h(N ) The proof is given in Appendix C. We make a few remarks about the preceding expression. First, it is a function of both the parametric family p(x, y; θ) and the prior q(θ). If the resulting distribution p(N ) is simple, then one can compute h(W (S)) relatively easily; otherwise, one may need to resort to 15 numerical techniques. Whether or not it is simpler to estimate numerically the terms in the expression or to directly estimate h(W (S)) depends on the specific distributions in question. Second, as M → ∞, for continuous distributions the first two terms converge with probability one on dI (M − 1) log(2). Finally, even if the expression is difficult to compute, it establishes scaling laws on h(W (S)), showing that it increases linearly in dI for parametric families satisfying the preceding conditions and corresponding to continuous distributions. We also can bound the entropy from above. Theorem 8. For an interpolation set satisfying the conditions stated above, the posterior entropy satisfies h(W (S)) ≤ −dI (M − 1) log (M − 1) . (24) See Appendix C for the proof. A fortiori, this expression bounds the expected entropy over an interpolation map S(v). As before, the entropy grows linearly with the interpolation dimension. Further, here we see that the entropy decays at least as fast as −M log(M ). While this bound is not necessarily tight, it is useful for rule-of-thumb estimation of the bounds when the true entropy is difficult to obtain. For example, in the multi-class Gaussian case, considered in Section V, we find that substituting the preceding bound in place of the exact differential entropy only negligibly impacts the resulting bounds. Finally, once an interpolation map S(v) is identified, the expected entropy can be computed numerically via Monte Carlo methods, such as those presented in [45]. As long as one can sample easily from q(θ), one can produce arbitrarily many samples of W (y|x; θ) with which to estimate the entropy, and one can further average over an appropriate interpolation map. We emphasize that this computation need only be carried out once for a given distribution model. Then, the risk bounds can be evaluated for any n. C. Sample Complexity Bounds From Theorem 6 we can derive explicit sample complexity bounds for the Lp Bayes risk. Substituting (22) into Lemma 1 and the lower bound (12) of Theorem 2, we obtain a necessary condition  n  t log ≥ − Eα [log |I(α)−1 |] + (h(W (S)) − h(α)) 2 2πe       1 1 pe X0 − d∗ (M − 1) log Lp + log 2Γ 1 + + log + o(1) (25) p p M −1 0 0 for any interpolation set S, where LX p is the permissible Lp loss on X . Similar bounds hold for the Bayes risk Lp using (17) in Theorem 4. We can describe intuitively the terms in this more complicated expression. The expression involving the Fisher information matrix describes how many samples are needed on average to learn the minimal sufficient statistic α and thus θ. However, the objective is to learn W , and it is sufficient but perhaps not necessary to learn θ in order to learn W . The second term captures this notion with the difference between the entropies h(W (S)) and h(α); when h(α) is bigger, the term corrects the number of samples needed. The following term is the slack term associated with the Lp Bayes risk, and the final o(1) term arises from the approximation of I(Z n ; θ). Further, if we impose regularity conditions on the eigenvalues of I(α) and the differential entropies h({W }S ) and h(α), we derive the following bounds on the sample complexity. 16 Proposition 1. In addition to the conditions of Theorem 6, suppose that Eα [log |I(α)−1 |] ≤ c1 , and h(W (S)) − h(α) ≥ c2 , for positive constants c1 and c2 . Then,   !t/(d∗ (M −1)) r c2 −c1 exp d (M −1) 2πe 0 ∗ (1 + o(1)), (26) LX p ≥ c3,p n   1 1 where c3,p = 2Γ 1 + p Mpe−1 p . Proof. Algebraic manipulation on Theorem 6. For the special case t = d∗ (M − 1), in which the dimensionality of the minimal sufficient statistic 0 α is equal to the interpolation dimension times the alphabet size, we obtain the order-wise rule LX p = p Ω( 1/n). This agrees with the known scaling on the sample complexity in this case, which one can derive from the PAC framework. That is, in this case, it is both necessary and sufficient for the number √ of training samples to grow quadratically in the required precision. We emphasize that the Ω(1/ n) scaling is particular both to the choice of the Lp loss and the assumption of smoothness. Indeed, for the classification loss Lc or the KL divergence LKL , there exist learning problems for which one can derive PAC error bounds that decay as O(1/n) [14]–[16]. Furthermore, there exist classification problems for which one can derive O(1/n) error bounds even for the Lp loss. An important, albeit extreme, example is the so-called error free learning problem, in which there exists a classifier that perfectly classifies test samples. In Section V we derive rate-distortion bounds for a simple error-free setting; the resulting bounds imply a Ω(1/n) scaling on the Lp loss as expected. D. Achievability A natural question is whether matching upper bounds on the Bayes risk hold. The random coding and joint typicality arguments that prove achievability bounds for rate distortion do not apply to the supervised learning setting. Joint typicality arguments depend on repeated i.i.d. draws from the source distribution. The analogous situation in supervised learning would be to encode multiple i.i.d. posteriors, each associated with a different draw from q(θ). Of course, we consider only a single draw from p(θ). Furthermore, random coding arguments presuppose design control over the source code, which would correspond to design control over the distribution of the labeled data. We do not have such control, so these arguments do not apply. As stated in Proposition 1, under mild assumptions one can derive lower bounds on the Lp error that p p scale as 1/n. One can further apply the PAC framework to derive upper bounds that scale as 1/n. In this case, the rate-distortion bounds are order optimum. However, the constants and higher order terms of the rate-distortion and PAC bounds differ significantly, primarily because PAC bounds are distribution agnostic while Bayes risk bounds take the prior distribution q(θ) into account. Finally, one can derive asymptotic achievability bounds on the Lp Bayes risk via analysis of the plug-in estimate of the posterior. Suppose the posterior is Lipschitz continuous in the Lp norm with respect to θ and the conditions of Theorem 6 hold. Then central limit theorem implies that the estimation error of θ̂ has variance scaling as 1/n and depending on the Fisher information matrix. By the Lipschitz assumption, 17 √ the Bayes risk scales as 1/ n, with constants and higher-order terms depending on the Fisher information matrix and the Lipschitz constant. V. C ASE S TUDIES A. Categorical Distribution We consider first a comparatively simple learning problem: learning a discrete probability distribution from samples drawn i.i.d. from the distribution. As mentioned in the introduction, this problem has been studied extensively. We model this problem in our framework by posing a multi-class learning problem where the alphabet X is trivial. That is, let X = {0}, let M be the number of values the random variable may take, and let the family of distributions be indexed by Λ = ∆M −1 , the M − 1-dimensional unit simplex. That is, the “posterior” distribution p(y|x, θ) is simply the distribution of the categorical random variable Y , with probabilities indicated by θ: (27) p(y|x, θ) = θy . To compute the Bayes risk, we suppose a Dirichlet prior over θ, with hyperparameter γ ∈ RM . In particular, PL + if each γi = 1, then θ is uniformly distributed over the unit simplex. Define γ0 := i=1 γi . Trivially, there is a single sufficient interpolation set S = {0}, and the interpolation dimension of the categorical distribution is dI = 1. Therefore an interpolation map is trivial, with V = {0} and S(0) = {0}. Since X is a singleton, Rp (D) = RpX (D) and hence we use Rp (D) to refer to both. The entropy of the Dirichlet distribution is well-known, so we can evaluate the differential entropy of the posterior h(W (S)) at the unique interpolation set: h(W (S)) = h(γ1 , . . . , γM −1 ) = log(B(γ)) − (M − γ0 )ψ(γ0 ) − M X i=1 (γi − 1)ψ(γi ), (28) where B(γ) is the multivariate Beta function and ψ(z) is the digamma function. This allows us to compute the Lp rate-distortion functions. Theorem 9. For a categorical distribution, the rate distortion function Rp (D) is bounded by " M X Rp (D) ≥ log(B(γ)) − (M − γ0 )ψ(γ0 ) − (γi − 1)ψ(γi ) i=1      + 1 1 pe −(M − 1) log D + log 2Γ 1 + + log , p p M −1    1 Rp (D) ≤ − (M − 1) log min D, . M −1 (29) (30) Proof: Evaluating the bounds in Theorem 2 for the differential entropy in (28) yields the result. In particular, we are interested in the L1 lower bounds given as Corollary 10. For a categorical distribution, the rate distortion function R1 (D) is lower bounded by "   #+ M X 2e R1 (D) ≥ log(B(γ)) − (M − γ0 )ψ(γ0 ) − (γi − 1)ψ(γi ) − (M − 1) log D . (31) M −1 i=1 18 The lower bound on rate-distortion functions depend on the cardinality M of the alphabet for Y and the prior p(θ). For the uniform case, i.e. γi = 1, the differential entropy of the posterior simplifies to h(γ1 , . . . , γM −1 ) = log(B(γ)) = − log((M − 1)!). In this case, the upper and lower bound differ only by this term, the magnitude of which grows in M without bound. Using Lemma 1, we can translate the rate-distortion bounds to lower bounds on the Bayes risk. This requires the evaluation of the mutual information I(Z n ; θ). This mutual information is difficult to compute in closed form, so we apply the approximation from Theorem 6. Lemma 11. For learning a categorical distribution the mutual information I(Z n ; θ) is I(Z n ; θ) = M −1  n  M −1 1X M −1 log + ψ(γ0 ) − ψ(γi ) + h(θ1 , . . . , θM −1 ) + on (1). 2 2πe 2 2 i=1 (32) The proof appears in Appendix D. These results imply the following bound on the Lp Bayes risk. Theorem 12. For learning a categorical distribution, the Lp Bayes risk is bounded below as ! r M −1 X π 1 L1 ≥ (M − 1) exp ψ(γi ) − ψ(γ0 ) (1 + on (1)) 2en 2(M − 1) i=1 ! r M −1 X 1 πe exp ψ(γi ) − ψ(γ0 ) (1 + on (1)) L∞ ≥ 2n 2(M − 1) i=1 ! r M −1 X M −1 1 L2 ≥ exp ψ(γi ) − ψ(γ0 ) (1 + on (1)). n (M − 1) i=1 (33) (34) (35) Proof: Manipulation on Theorem 9 and Lemma 11. p In other words, the Lp Bayes risk decays no faster than 1/n, with a constant that depends on the prior distribution, p, and an unspecified on (1) term. Furthermore, we can derive a lower bound on the minimax L1 error by choosing γ = (κ, κ, . . . , κ, 0), i.e. all but the M th element is a constant. Using the fact that limx→∞ exp(ψ(x)) = x − 1/2, we obtain r   1 π L1 ≥ lim (M − 1) exp (ψ(κ) − ψ((M − 1)κ)) (1 + on (1)) (36) κ→∞ 2en 2 r π(M − 1) = (1 + on (1)). (37) 2en For comparison, [33] gives upper and lower bounds on the L1 minimax error, where the lower bounds result from bounds on the Bayes risk. In particular, [33] shows that r   2(M − 1) M 4M 1/2 (M − 1)1/4 M (1 − M κ) − 1− − ≤ L1 ≤ πn 2(M − 1)κ n3/4 n + Mκ r 2(M − 1) 4M 1/2 (M − 1)1/4 + , (38) πn n3/4 for symmetric priors γq i = κ for γ ≥ 1. For large κ, the lower and upper bounds agree suggesting the 2(M −1) . Furthermore, the constant in (37) is quite close to the the constant in sample complexity of πn 19 q pπ the first term of the bounds of (38). Numerically, π2 − 2e ≈ 0.0377. It is somewhat remarkable that our proposed method leads to a bound that is so close to the actual minimax bound given that it is not adapted and optimized for the problem at hand. An open question is whether further optimization over the prior q(θ) can eliminate this gap. We point out a few advantages of the bounds proven in Theorem 1. First of all, the lower bounds of Theorem 12 hold for any prior, while the lower bound in (38) is only applicable for γ ≥ 1. Furthermore, the negative terms in (38) lead to a negative bound on the L1 risk for many values of n. On the other hand, the rate-distortion bounds are asymptotic in that there is an unspecified multiplicative constant of (1 + on (1)) owing to the approximation to the mutual information I(Z n ; θ). Therefore, we emphasize that the objective of this exercise is not to derive bounds that outperform or are tighter than those in the literature, but to illustrate the effectiveness of the proposed framework. With relatively little effort, the framework provides risk bounds that are tight order-wise and nearly tight to within a small multiplicative constant. B. Multinomial Classifier Here we consider binary classification under the multinomial model. For this model, we will derive rate-distortion and Bayes risk bounds on the LX P error, i.e. the worst-case Bayes risk over test points X. Under the multinomial model, the alphabet is X = Zd+ , we suppose M = 2, and the observation X has the class-conditional distribution Y k! xi , (39) θiy p(x|y, θ) = Qd x ! i i=1 i=1 where θ ∈ Rd×2 y ∈ {1, 2}, k ∈ Z is a known constant, and the distribution is supported over the set of P non-negative vectors x ∈ X such that di=1 xi = k. The multinomial distribution is a generalization of the binomial distribution. Given k variates drawn from a d-ary categorical distribution, Xi counts the number of times the variate has the value i. The multinomial model is ubiquitous in text and document classification, where word or part-of-speech counts are used to identify document types. Essentially, each class is modeled by a different categorical distribution, and the task of the classifier is to determine from which categorical distribution the k test samples were drawn. Let θ1 ∈ Rd and θ2 ∈ Rd denote the categorical distribution parameters for each class-conditional distribution. Suppose also uniform priors, i.e. Pr(Y = 1) = Pr(Y = 2) = 1/2. The resulting posterior is p(y = 1|x, θ) = 1 1+ Qd 2 1 xi i=1 (θi /θi ) . (40) Similar to the previous subsection, we suppose a Dirichlet prior, which is the conjugate prior. SpecifiP cally, let θ2 ∼ Dir(γ), where γ ∈ Rd+ and where γ0 := i γi . We also choose θ1 = (θ2 − 1), and we let θ := θ2 . This choice allows for a more straightforward derivation of the rate-distortion function and the accompanying sample complexity bounds. With these choices, the posterior has the form p(y = 1|x, θ) = 1+ 1 Qd i=1 Rixi , (41) 20 where Ri = θi /(1 − θi ). Because Ri ∈ [0, ∞), this parameterization does not cost any generality in terms of posterior functions; any posterior of the form of (40) can be put in the form of (41). Thus, the distribution over θ induces a prior over all multinomial Bayes classifiers, and the Bayes risk bounds for any prior are lower bounds on the minimax risk. To compute the rate-distortion function, we find an interpolation set for the posterior W . It is straightforward to see that S = {ke1 , ke2 , . . . , ked−1 } is a sufficient interpolation set. Evaluating the posterior at each point x = kei yields 1 , (42) W (kei ) = 1 + Rik which allows one to recover the ratio Ri and therefore the parameter θi ; since each categorical distribution lies on the unit simplex, one can recover the entire parameter vector θ. It is also straightforward to see that any smaller interpolation set is not sufficient; hence dI = d − 1. Using this interpolation set, we bound the rate-distortion function over the worst-case data point x ∈ X . To do so, we first need to compute h(W (S)), which requires the following lemma. Lemma 13. For the scalar function g(r) = exists. Then, h(V ) ≥ h(R) + log(k) − 1 , 1+rk let V := g(R) for a random variable R such that h(R) 2 log(2) − 2E[[log(R)]+ ] + (k − 1)E[log(R)]. k (43) See Appendix D for the proof. From this, we can bound h(W (S)). Lemma 14. For the multinomial classification problem described and the interpolation set S = {ke1 , . . . , ked−1 }, the differential entropy h(W (S)) is upper bounded by   2 h(W (S)) ≥ (d − 1) log(k) − log(2) + k d−1 X (log(B(γi , γ0 − γi )) + (γ0 + γi + 2 − k)ψ(γ0 − γi ) − (γ0 − 2)ψ(γ0 ) + (k − γi )ψ(γi )) . (44) i=1 The proof appears in Appendix D. From this result, we can state bounds on the rate-distortion function for the multinomial classifier. Theorem 15. For binary multinomial classification, the rate-distortion functions RX 1 (D) is bounded by      1 1 X + log (pe) , (45) Rp (D) ≥ h(W (S)) − (d − 1) log D + log 2Γ 1 + p p RpX (D) ≤ −(d − 1) log(min{D, 1}). (46) Note that this bound is for the worst-case distortion over all test points x ∈ X . In order to bound the distortion averaged over x, we would need to construct an interpolation map S that spans a sufficiently P large portion of X . Because the alphabet X involves the constraint that i xi = k, it is difficult to construct such an interpolation map. Therefore, for now we let the bound on RpX (D) suffice, and we relegate average-case bounds to future work. Finally, from the rate-distortion bounds, we can derive Bayes risk bounds. Again it is difficult to compute 21 I(Z n ; θ) directly, so we resort to the approximation of Theorem 6. Lemma 16. For the multinomial classification problem described, the mutual information I(Z n ; θ) is d I(Z n ; θ) =  n  X d−1 log + log(B(γ)) − (d − γ0 )ψ(γ0 ) − (γi − 1)ψ(γi )+ 2 2πe i=1 d−1 d−1 1X log(k/2) − (ψ(γi ) + ψ(γ0 − γi ) − 2ψ(γ0 )) + on (1). (47) 2 2 i=1 Putting these results together yields a bound on the X -Bayes risk. For brevity, we state only the bounds for LX 1 ; it is easy to infer the other bounds by analogy. Theorem 17. For the multinomial binary classification problem, the X -Bayes risk for any learning rule is bounded below by r    2πe 1 d − γ0 γd − 1 X − 2+k L1 ≥ k2 k × exp − B(γ) + 1 − γ0 + ψ(γ0 ) + ψ(γd )+ n d−1 d−1 d−1 ! d−1 1 X [(k − 1/2)ψ(γi ) + (γ0 + γi + 2 − k)ψ(γ0 − γi ) . (48) d − 1 i=1 Proof: Manipulation on Theorem 9 and Lemma 11. The resulting bounds are somewhat involved, but one can glean an intuition from them. As k increases, the family of classifiers becomes more rich, and the Bayes risk increases. However, the error decays as p 1/n. As mentioned earlier in the paper, the VC dimension bounds imply that the risk cannot decay p more slowly that 1/n. This lower bound establishes that this scaling is order-optimum for the Lp Bayes risk. However, we cannot prove tightness of constants as we could in the categorical case. C. Binary Gaussian Classifier Next, we consider a binary Gaussian setting. Let M = 2 and p(y) = 1/2, y ∈ {1, 2}, and let Λ = Rd parameterize the data distributions. The class-conditional densities are Gaussian with antipodal means: p(x|y = 1; θ) = N (θ, σ 2 I) p(x|y = 2; θ) = N (−θ, σ 2 I), (49) where σ 2 > 0 is the known variance. We choose the prior q(θ) = N (0, (1/d)I). The MAP classifier for this problem is a hyperplane passing through the origin and normal to θ. For this model, the regression function is 1 W (y = 1|x, θ) = . (50) 1 + exp(−2/σ 2 xT θ) This model is the continuous-valued analogue to the multinomial case in that the posterior has the form of a logistic function. For this model, however, we can derive closed-form bounds on the rate-distortion function Rp (D) averaged over test points X. To see this, we first observe that any orthogonal basis of Rd is a sufficient interpolation set for W . For a basis set S = {x1 , . . . , xd }, each function evaluation W (y = 1|x = xi , θ) allows one to recover the inner product xTi θ; d independent inner products allows 22 one to recover θ and interpolate the entire regression function. Furthermore, choosing an orthogonal basis guarantees that the elements of W (S) are statistically independent. Next, we define an interpolation map. Let the index set be the positive orthant of Rd : V = {x ∈ Rd : xi < 0}. Then, let the interpolation map be S(v) = {an orthogonal basis S : v ∈ S, kxk = kvk , ∀x ∈ S}. It is straightforward to verify that one can choose the basis such that the sets S(v) are disjoint for different choices of v ∈ V. It is also straightforward to verify that the range of the interpolation map is W(S) = R \ {0} and that the probability of the interpolation map is γ(S) = 1. In order to bound the rate-distortion function, we compute the expected entropy of the regression function averaged over the interpolation map. Lemma 18. The expected differential entropy of the posterior evaluated at the interpolation map is bounded by   d 16π(1/(dσ 2 ) + 1) d − EV [h(W (S(V )))] ≥ ψ(d/2) + log 2 2 dσ 2 r dΓ((d + 1)/2) 4(1/(dσ 2 ) + 1) 3d − − 2d log(2), Γ(d/2) πdσ 2 2 where Γ(·) is the Gamma function, and ψ(·) is the digamma function, and where ν(d, σ 2 ) is defined as the lower bound divided by d. Let ν(d, σ 2 ) denote the preceding bound divided by d. Then, we have a bound on the rate-distortion function. For brevity we state the result only for L1 . Theorem 19. For binary Gaussian classification, the rate-distortion function is bounded by    d 16π(1/(dσ 2 ) + 1) d ψ(d/2) + log − 2 2 dσ 2 #+ r dΓ((d + 1)/2) 4(1/(dσ 2 ) + 1) 3d − − 2d log(2) − d log(2eD) ≤ R1 (D) ≤ −d log(min{D, 1}). Γ(d/2) πdσ 2 2 (51) Proof: Evaluation of the bounds of Theorem 4 for the differential entropy of Lemma 18. Furthermore, we can bound the Bayes risk. Again we state the results for the L1 risk only for brevity. Theorem 20. For the binary classification problem, the L1 Bayes risk is bounded by r σ2d L1 ≥ exp(ν(d, σ 2 ) − 1). σ2d + n (52) Proof: First, we bound I(Z n ; θ). First, one can verify that θ is itself a minimal sufficient statistic, and I(θ) = 1/σ 2 I. It is also immediate that h(θ) = d/2 log(2πe/d). Combining these facts with Theorem 23 6, we obtain I(Z n ; θ) =  n  d log + o(1). 2 dσ 2 (53) However, in this case we can evaluate the mutual information in closed form. Because the prior q(θ) is Gaussian, the posterior is not only asymptotically Gaussian but also Gaussian for any n. Let Ti = θ + Ni , where Ni ∼ N (0, σ 2 I). Simple calculation shows that I(Z n ; θ) = I(T n ; θ) = h(θ) − h(θ|T n )  n  d = log 1 + 2 . 2 dσ The discrepancy between the estimated and exact mutual information is negligible unless n  dσ 2 . Applying this to the bound in Theorem 19 yields the result. p In this case we obtain a scaling law of 1/n. One can again invoke the PAC bounds based on the VC dimension to see that this scaling also upper bounds the Bayes risk. Therefore this bound is order-optimum, although its tightness under more strict definitions remains an open question. D. Zero-error Classification Finally, we present an example of a zero-error binary classification problem. In this experiment, the samples are generated such that they are truly linearly separable, where it is well known that the required √ sample complexity drastically changes to merely O(1/n) as opposed to the usual O(1/ n) in the case of noisy samples (see [46] and the references therein). We consider a parametric distribution with a single parameter (i.e., a one-dimensional parameter vector). Let Θ = [0, 1], and let θ ∼ U[0, 1]. We let X = [0, 1] and Y = {−1, 1}. We let Pθ (z) be defined as follows. ( 1 if (x − θ)y > 0 Pθ (x, y) = . (54) 0 if (x − θ)y < 0 Note that the joint distribution defined in (54) does not satisfy Clarke and Barron’s smoothness condition as it is clearly not continuous. Hence, we will need to calculate the mutual information directly, and we need to calculate P (θ|Z n ). We show that in fact the mutual information follows a different scaling in this case leading to a different sample complexity scaling law as expected. To compute I(Z n ; θ), we first focus on Pθ (z n ). We have ( ( 1 if (xi − θ)yi > 0 for all i ∈ [n] 1 if θl < θ < θr Pθ (z n ) = = , (55) 0 otherwise 0 otherwise where θl := max {xi } yi =−1 and θr := min{xi }. yi =1 (56) Note that when no sample xi exists such that yi = −1, we define θl = 0, and similarly when so sample 24 xi exists such that yi = 1, we define θr = 1. By using the Bayes’ rule, we get ( 1 if θl < θ < θr θr −θl . P (θ|z n ) = 0 otherwise (57) Thus, we have I(θ; Z n ) = h(θ) − h(θ|Z n ) = −h(θ|Z n ). (58) We have n Z Pθ (z n )P (θ) log P (θ|z n )dz n dθ Z = − Pθ (z n ) log(θr − θl )1θl <θ<θr (θ)dz n dθ. I(Z ; θ) = (59) (60) Hence, integrating θ over [0, 1], we have n I(Z ; θ) = − n Z X i=0 (x(i+1) − x(i) ) log(x(i+1) − x(i) )dz n , (61) where {x(i) }ni=1 are the order statistics of xn , and x(0) := 0 and x(n+1) := 1. Note that due to the linearity of expectation and symmetry the above can be written as Z n I(Z ; θ) = −(n + 1) x(1) log x(1) dz n (62) Z = −(n + 1)n x(1) (1 − x(1) )n−1 log x(1) dx(1) (63) (64) = Hn+1 − 1, where Hn is the n’th harmonic number defined as Hn := X1 . i (65) i∈[n] Hence, it is evident that asymptotically as n → ∞, I(Z n ; θ) = log n + O(1). (66) In other words, I(Z n ; θ) scales as log n. This is in contrast to the rest of the case studies where Clarke and Barron would apply, and the mutual information between the samples and the unknown parameter would scale as 12 log n. Rather than constructing an interpolation map, in this case, it is more straightforward to bound the rate-distortion function directly. First, note that " 2 # X Lp (δ)p = EX,Z n ,θ |W (y|x; θ) − Ŵ (y|x)|p (67) y=1 h i = 2EX,Z n ,θ |W (1|x; θ) − Ŵ (1|x)|p . (68) It is straightforward to show that the procedure that minimizes Lp (δ) is Ŵ (y|x) = W (y|x; θ̂) where 25 θ̂ = θ̂(Z n ) is the maximum-likelihood estimate of θ. Hence, without loss of generality, we only focus on such strategies h i Lp (δ)p = 2EX,Z n ,θ |W (1|x; θ) − W (1|x; θ̂)|p (69) i h (70) = 2EZ n ,θ |θ − θ̂|p (71) = 2Eu [|u|p ] , where u = θ − θ̂. Hence, the rate-distortion function is calculated by  + Rp (D) ≥ − maxp p h(u) . p(u):2Eu [|u| ]<D The above is maximized by pu (u) = where λ = 2 . pDp 2Γ λ1/p p   e−λ|u| , p+1 p The value of the R is hence given by     + p+1 1 Rp (D) = − log 2Γ − log(pe) − log D . p p (72) (73) (74) Hence, combining (64), (66), and (74), the sample complexity lower bound that we arrive at in this √ example has a fundamentally different scaling of O(1/n) as opposed to the O(1/ n) in all of the previous examples. Note that this bound is order-wise tight as it is consistent with matching upper bounds [46]. Let us further enumerate this bound and analyze the tightness of the sample complexity bounds using this framework. Considering the L1 Bayes risk, we consider the following estimator: 1 θ̂ = θ̂(z n ) = (θr + θl ), 2 where θl and θr are defined in (56). Thus, due to the uniform prior, 1 1 E[|θ − θ̂|] = E [θr − θl ] = . 4 4(n + 1) (75) Hence, to satisfy an L1 risk of L1 = 2E[|θ − θ̂|] < 12 , it would suffice to have: n≤ 1 − 1. 2L1 (76) On the other hand, the rate-distortion bounds suggest the following lower bound, Hn+1 −1 ≥ − log L1 −1, which in turn is equivalent to the following n ≥ e−γ 1 − 1 + o(1), 2L1 (77) where γ is the Euler’s constant, and e−γ ≈ 0.56. As suggested by the upper bound given by this scheme, the lower bound is tight within a multiplicative factor of 2. 26 VI. C ONCLUSION We have presented a rate-distortion framework for analyzing the learnability of Bayes classifiers in supervised learning. Treating the regression function as a random object, we derived bounds on its ratedistortion function under average Lp loss. We showed that the rate distortion function is bounded above and below by expressions involving the interpolation dimension, a new quantity that characterizes in a sample-theoretic fashion the complexity of a parametric family. In addition to characterizing the amount of information needed to describe a Bayes classifier up to a specified Lp loss, we showed that the ratedistortion function permits the derivation on lower bounds on the Lp Bayes risk in terms of the number of samples. We evaluated these bounds for several statistical models, in some cases showing that the bounds are nearly tight. An important future application of this work is in distributed learning. The rate-distortion bounds characterize both how much information is required to learn a classifier and how much information is required to describe a classifier that one has already learned. As a result, we expect that they will prove useful in characterizing how much information a network of classifiers, connected by rate-limited links, will need to exchange in order to learn collaboratively a Bayes classifier from their distributed samples. A PPENDIX A P ROOF OF T HEOREM 2 The proof of Theorem 2 involves the maximization of the entropy of the posterior estimation error 0 U (y|x) := W (y|x; θ) − Ŵ (y|x) subject to the LX p constraint, for which we prove a lemma. Lemma 21. Let S ⊂ X 0 be an interpolation set with cardinality |S| = d∗ . Then, if p(Ŵ |W ) satisfies the 0 constraint LX p ≤ D, the differential entropy U (S) = W (S) − Ŵ (S) satisfies       1 pe 1 h(U (S)) ≤ d∗ (M − 1) log D + log 2Γ 1 + + log . p p M −1 Proof: We start by bounding h(U (S)) ≤ −1 XM X h(U (y|x)), (78) x∈S y=1 which holds with equality if and only if each U (y|x) is independent for all (x, y). By hypothesis, U (y|x) has Lp norm no greater than D for every x ∈ X 0 and in expectation over the remaining random variables, or M X E[|U (y|x)|p ] ≤ Dp . (79) y=1 This leads to the optimization problem maximize p(U ) subject to M −1 X h(U (y|x)), y=1 M X y=1 (80) E[|U (y|x)|p ] ≤ Dp . 27 The preceding formulation suggests that U (y|x) does not impact the objective function for y = M . Therefore, it is clearly optimal to set U (y = M |x) = 0 with probability one, and the resulting optimization problem is M −1 X h(U (y|x)), maximize p(U ) y=1 M −1 X subject to y=1 (81) E[|U (y|x)|p ] ≤ Dp . This is a convex program, and writing down the Lagrangian, we get that the optimizer is such that U (y|x) is independent and identically distributed for all y ∈ {1, . . . , M − 1}. Further, p (82) pU (y|x) (u) ∝ e−λ|u| , where λ has to be set such that the expectation constraint, E[|U (y|x)|p ] ≤ Dp /(M − 1), is satisfied for each y ∈ {1, . . . , M − 1}. The claim of the lemma is the established by the calculation of h(U (y|x) for this distribution. Now we are ready to prove Theorem 2. Proof of Theorem 2: Lower bound: By the data-processing inequality, Rp (D) ≥ inf h(W (S)) − h(U (S)), p(U ) where recall that U (S) = W (S) − Ŵ (S). Applying Lemma 21 yields the lower bound. 0 Upper bound: By the definition of RpX (D), for any sufficient interpolation set we have Rp (D) = = inf I(W ; Ŵ ) p(Ŵ |W ) inf I(W (S); Ŵ (S)) p(Ŵ |W ) = inf h(Ŵ ) − h(Ŵ (S)|W (S)) p(Ŵ |W ) = inf h(Ŵ ) − h(W (S) + U (S)|W (S)) p(U ) ≤ inf −h(U (S)|W (S)), p(U ) where the inequality follows because Ŵ is a posterior function, so each element is a member of [0, 1], thus the joint differential entropy is bounded above by zero. Finally, choose U (y|x) for all y ∈ {1, . . . , M − 1} to be jointly independent of W , and choose the distribution of its elements to be i.i.d. with the following distribution: For a given W (y|x), if D < 1, each U (y|x) follows   DW (y|x) D(1 − W (y|x)) U (y|x) ∼ U − , , (83) M −1 M −1 and if D > 1,  U (y|x) ∼ U W (y|x) (1 − W (y|x)) − , M −1 M −1  . (84) 28 The constraint is set up to ensure that |U (M |x)| ≤ 1 and 0 ≤ Ŵ (y|x) ≤ 1, which in turn will ensure the expectation constraint. Note that the actual value of W (y|x) does not play a role in the differential entropy of U as it is merely a translation, and hence the value of h(U (y|x)) does not depend on W (y|x). The upper bound is achieved by evaluating the differential entropy of this choice of U (y|x). A PPENDIX B P ROOF OF T HEOREM 4 Lower Bound: By the data-processing inequality and the fact the supremum dominates any average, Rp (D) ≥ sup inf h(W (S(v))) − h(U (S(v))) v∈V p(U ) ≥ inf EV [h(W (S(V ))) − h(U (S(V )))], p(U ) where again U = W − Ŵ , and where the expectation is over any distribution p(v) over the set V; that is, p(v) is a mass function if V is countable and a density function if V is uncountable. We will specify p(v) presently. For a given p, each U (y|x) is subject to the expectation constraint E|U (y|x)|p , and the objective is to maximize the differential entropy term h(U (S(v))). As was shown in the proof of Theorem 2, the optimizing distribution is given in (82), where we have to set D = D(y|x) to be a function of (x, y) for each U (y|x). Then, we have   −1 X M X (85) (log(D(y|x)) + Cp ) , Rp (D) ≥ EV [h(W (S(V )))] − sup EV  D(y|x) where Cp is defined as x∈S(V ) y=1      1 pe 1 Cp = log 2Γ 1 + + log . p p M −1 (86) It remains to take the supremum of the sum of logarithm terms while respecting the distortion constraint. To simplify the optimization problem, we suppose that X and V are countable; thus p(x) and p(v) are probability mass functions. For uncountable X , the result follows by taking the limit of countable partitions. Note that the term D(y = M |x) does not show up in the RHS of (85), so, similar to the proof of Lemma 21, it is optimum to set D(y = M |x) = 0. Further, it follows from the concavity of log(·) that it is optimal that D(y|x) = D0 is a constant for all x ∈ W(S) and all y ∈ {1, . . . , M − 1}. For every x∈ / W(S), it is clearly optimal to set D(y|x) = 0. Then, the constraint on L1 becomes M −1 X X p(x)D(y|x) = D (87) =⇒ (M − 1)γ(S)D(y|x) = D (88) y=1 x∈W(S) =⇒ D(y|x) = D , (M − 1)γ(S) (89) 29 recalling that γ(S) is the probability of the range of S. Substituting this into (85) yields (90) Rp (D) ≥ EV [h(W (S(V )))] − d∗ (M − 1)(log(D/γ(S)) + Cp ), as was to be shown. 0 Upper Bound: The upper bound follows from the same argument as the bound on RpX (D). A PPENDIX C P ROOFS OF T HEOREMS 7 AND 8 Proof of Theorem 7: By Bayes’ rule, the posterior at each pair in the interpolation set is Niy W (xi |yi , θ) = PM i . y=1 Niy In order to compute h(W (S)), we need to compute the density p(W (S)). A standard result [47] is that the density is pW (W (S)) = |J|pN (f (W (S))), (91) where f is the one-to-one function mapping the samples W (S) to the terms Niy , and were J is the Jacobian matrix of f −1 . Wi = (Wi1 , . . . WiM −1 ) and Ni = (Ni1 , . . . , NiM −1 ). Because of the normalization constraint, the random variables Wiy are overdetermined by the random variables Niy . Therefore, without loss of generality we can take NiM = 1 for every i. Then, it is straightforward to show that the mapping between Wi and Ni is   Si Ni = Wi 1 + , g(Wi ), (92) 1 + Si P −1 where Si = M y=1 Wiy . Taking derivatives, the determinant of the Jacobian, denoted |Ji |, is  M −1   1 + 2Si Si |Ji | = 1+ . (93) 1 + Si (1 + Si )(1 + 2Si ) Now, let W be the matrix of all vectors Wi and N be the matrix of all vectors Ni . Clearly the Jacobian is block diagonal, thus the Jacobian of the entire mapping, denoted |J|, is M −1   k  Y 1 + 2Si Si |J| = 1+ . (94) 1 + S (1 + S )(1 + 2S ) i i i i=1 The density of the matrix W is thus |J|p(N ), where p(N ) is the density of the matrix N . The resulting entropy is therefore k X    1 + 2Si h(W (S)) = −E[log p(W )] = − (M − 1)E log − 1 + Si i=1   k X E log 1 + i=1 Next, we prove Theorem 8. Si (1 + Si )(1 + 2Si )  + h(N ). (95) 30 Proof of Theorem 8: The proof follows the same structure as the proof of Lemma 21. The entropy h(W (S)) is bounded above by the sum of the individual entropies. Furthermore, as W (y|x, θ) is normalized and non-negative, the sum of the regression function over y for a fixed x must be equal to one. The entropy is maximized by letting each random variable be uniformly distributed across [0, 1/(M −1)], and the result follows. A PPENDIX D P ROOFS OF L EMMAS Proof of Lemma 1: Suppose there is a learning rule δ(Z n ) that satisfies the Bayes risk constraint 0 LpX ≤ D or Lp ≤ D, respectively, and let p(θ, Z n , W, Ŵ ) be the joint probability distribution on the distribution index, training set, true posterior, and learned posterior. Because Ŵ is a function of the training set Z n , we have the Markov chain: W → θ → Z n → Ŵ . Therefore, repeated applications of the data-processing inequality yield I(Z n ; θ) ≥ I(W ; Ŵ ), where the latter mutual information is computed according to p(W, Ŵ ) = p(Ŵ |W )p(W ), which is obtained by marginalizing the joint distribution. Furthermore, we can take the infimum over all distributions p(Ŵ |W ) that satisify the Bayes risk constraint: I(Z n ; θ) ≥ inf I(W ; Ŵ ). p(Ŵ |W ) The RHS of the preceding is the definition of the rate-distortion function for the appropriate Bayes risk. Proof of Lemma 11: Observe that while θ overdetermines the distribution and is not a minimal sufficient statistic, α = (θ1 , . . . , θM −1 ) is minimal and sufficient. Straightforward calculation demonstrates that the Fisher information matrix for α is I(α) = diag(1/θ1 , . . . , 1/θM −1 ). (96) Therefore, M −1 1 1X E[log |I(α)|] = − E[log(θi )] 2 2 i=1 M −1 M −1 1X = ψ(γ0 ) − ψ(γi ), 2 2 i=1 (97) (98) where the latter equality holds because the marginal components θi of a Dirichlet distribution follow a Beta distribution, i.e. θi ∼ Beta(γi , γ0 − γi ), and the expected logarithm of a Beta random variable is E[log(θi )] = ψ(γi ) − ψ(γ0 ). Substituting the preceding into Theorem 6 yields the result. 31 Proof of Lemma 13: It is straightforward to verify that g is invertible with g −1 (v) = the Jacobian method, the density of V is fV (v) = fR (g −1 (v)) and the differential entropy is bounded by  1−v 1/k . v d −1 (1/v − 1)1/k g (v) = fR (g −1 (v)) , dv k(1 − v)v By (99) 1 h(V ) = −E[log fR (g −1 (V ))] − E[log((1 − V )/V )] + E[log(V (1 − V )] + log(k) k k+1 k−1 = h(R) + log(k) + E[log(V )] + E[log(1 − V )] k k       1 Rk k+1 k−1 E log E log = h(R) + log(k) + + k 1 + Rk k 1 + Rk 2 = h(R) + log(k) − E[log(1 + Rk )] + (k − 1)E[log(R)] k 2 ≥ h(R) + log(k) − E[log(2 max{1, Rk })] + (k − 1)E[log(R)] k 2 = h(R) + log(k) − log(2) − 2E[[log(R)]+ ] + (k − 1)E[log(R)]. k Pd−1 h(W (kei ). By Lemma 13, we need to compute Proof of Lemma 14: We have that h(W (S)) = i=1 h(Ri ). Since Ri = θi /(1 − θi ), it has a beta distribution of the second kind, with density fRi (r) = It therefore has differential entropy rγi −1 (1 + r)γ0 . B(γi , γ0 − γi ) (100) h(Ri ) = log(B(γi , γ0 − γi )) − (γi − 1)E[log(Ri )] − γ0 E[log(1 + Ri )] = log(B(γi , γ0 − γi )) − (γi − 1)E[log(θi )] + (γi − 1)E[log(1 − θi )] + γ0 E[log(1 − θi )] = log(B(γi , γ0 − γi )) + (γ0 + γi − 1)E[log(1 − θi )] − (γi − 1)E[log(θi )] = log(B(γi , γ0 − γi )) + (γ0 + γi − 1)(ψ(γ0 − γi ) − ψ(γ0 )) − (γi − 1)(ψ(γi ) − ψ(γ0 )), where the final equalities are due to the expression of the logarithm of a beta-distributed random variable. Similarly, we have that E[log(Ri )] = E[log(θi )] − E[log(1 − θi )] = (ψ(γi ) − ψ(γ0 )) − (ψ(γ0 − ψ(γi ) − γ0 ) = ψ(γi ) − ψ(γ0 − γi ). It remains to calculate E[[log(Ri )]+ ]: E[[log(R)]+ ] = E[max{0, log(θi ) − log(1 − θi )}] ≥ E[max{0, − log(1 − θi )}] = −E[log(1 − θi )] = ψ(γ0 ) − ψ(γ0 − γi ). Invoking Lemma 13 and combining terms yields the result 32 Proof of Lemma 16: First, we observe that α = (θ1 , . . . , θd−1 ) is a minimal sufficient statistic for the joint distribution. Then, it is straightforward to show that the Fisher information matrix is   k k ,..., . (101) I(α) = diag 2θ1 (1 − θ1 ) 2θd−1 (1 − θd−1 ) By Theorem 6, the mutual information is  n  d−1 1 I(Z n ; θ) = log + h(α) + E[log |I(α)|] + on (1) 2 2πe 2 d   X d−1 n = log + log(B(γ)) − (d − γ0 )ψ(γ0 ) − (γi − 1)ψ(γi )+ 2 2πe i=1 d−1 d−1 1X log(k/2) − (ψ(γi ) + ψ(γ0 − γi ) − 2ψ(γ0 )) + on (1), 2 2 i=1 which is the desired result. Proof of Lemma 18: For the interpolation set S(x, y), let c = kxk, and let Wi = W (si (x, y)) denote the posterior evaluated at the ith element of the set determined by the interpolation map. Without loss of generality, suppose y = 1. Further, let Zi = (2xTi θ)/σ 2 . Straightforward computation shows that   4c2 , (102) Zi ∼ N 0, 4 σ d and Wi = 1 . 1 + exp(−Zi ) (103) Our first objective is to find the density p(Wi ). Using the Jacobian formula, p(Wi ) = J(f ) · pNi (f (Wi )), where  f (Wi ) = log Wi 1 − Wi  (104) (105) is the mapping from Wi to Ni , and J(f ) is the Jacobian of f , which is equal to J(f ) = Therefore, ∂ 1 f (Wi ) = . ∂Wi Wi (1 − Wi ) (106) 4c2 f (Wi ), 4 σ d (107)  p(Wi ) = J(f ) · N = 1 q 2 Wi (1 − Wi ) 8πc dσ 4   2   σ d Wi 2 exp − 2 log . 8c 1 − Wi (108) 33 Next, the differential entropy is Observe that h(Wi ) = −E[log(p(Wi ))]    2   8πc2 σ d Wi 1 2 + E[log(Wi (1 − Wi ))] + E . log = log 2 dσ 4 8c2 1 − Wi Wi (1 − Wi ) = and exp(−Zi ) , (1 + exp(−Zi ))2 h(Wi ) = = ≥ = (110) (111) Wi = exp(Zi ). 1 − Wi Therefore, (109) (112)   1 8πc2 σ4d log − E[Z ] + E[Zi2 ] − 2E[log(1 + exp(−Zi ))] i 2 dσ 4 8c2   8πc2 1 1 log + − 2E[log(1 + exp(−Zi ))] 4 2 dσ 2   2 8πc 1 1 log + − 2 log(2) − E[[Zi ]+ ] 4 2 dσ 2 r   1 8πc2 2c2 3 log − 2 log(2) − − 2 dσ 4 2 πdσ 4 (113) (114) (115) (116) where (115) follows from the fact that 1 + e−x < 2e−x for any x < 0 and 1 + e−x ≤ 2 for any x ≥ 0. Furthermore, (116) follows from the fact that E[[Zi ]+ ] is exactly half the expectation of the “folded” Gaussian, which is well known. This bound is tight to within a constant gap of log(2). Our final step is to take the expectation over V , which has a white Gaussian distribution with perelement variance 1/d + σ 2 . Define the random variables C = kV k and K = C 2 /(1/d + σ 2 ), which yields " #   r 1 8π(1/(dσ 2 ) + 1)K 2(1/(dσ 2 ) + 1)K 3 EV [h(Wi )] ≥ E log − − 2 log(2). (117) − 2 dσ 2 πdσ 2 2 By definition, K ∼ χ2 (d), so in order to evaluate the preceding expectation we need to compute the mean of a χ-distributed random variable and the expected logarithm of a χ2 random variable. These quantities are well-known, and applying them yields   1 16π(1/(dσ 2 ) + 1) 1 − EV [h(Wi )] ≥ ψ(d/2) + log 2 2 dσ 2 r Γ((d + 1)/2) 4(1/(dσ 2 ) + 1) 3 − − 2 log(2), (118) Γ(d/2) πdσ 2 2 where Γ(·) is the Gamma function, and ψ(·) is the digamma function. R EFERENCES [1] V. Vapnik, “The support vector method of function estimation,” in Nonlinear Modeling. Springer, 1998, pp. 55–85. 34 [2] ——, The nature of statistical learning theory. springer, 2000. [3] K. Muller, S. Mika, G. Ratsch, K. Tsuda, and B. Scholkopf, “An introduction to kernel-based learning algorithms,” Neural Networks, IEEE Transactions on, vol. 12, no. 2, pp. 181–201, 2001. [4] L. Breiman, “Random forests,” Machine learning, vol. 45, no. 1, pp. 5–32, 2001. [5] G. Hinton, S. Osindero, and Y.-W. Teh, “A fast learning algorithm for deep belief nets,” Neural computation, vol. 18, no. 7, pp. 1527–1554, 2006. [6] Y. Bengio, P. Lamblin, D. Popovici, and H. Larochelle, “Greedy layer-wise training of deep networks,” Advances in neural information processing systems, vol. 19, p. 153, 2007. [7] V. N. Vapnik and A. Y. Chervonenkis, “On the uniform convergence of relative frequencies of events to their probabilities,” Theory of Probability & Its Applications, vol. 16, no. 2, pp. 264–280, 1971. [8] V. Vapnik, “An overview of statistical learning theory,” IEEE Transactions on Neural Networks, vol. 10, no. 5, pp. 988–999, Sep 1999. [9] J. Shawe-Taylor, P. L. Bartlett, R. C. Williamson, and M. Anthony, “Structural risk minimization over data-dependent hierarchies,” Information Theory, IEEE Transactions on, vol. 44, no. 5, pp. 1926–1940, 1998. [10] A. R. Barron, “Approximation and estimation bounds for artificial neural networks,” Machine Learning, vol. 14, no. 1, pp. 115–133, 1994. [11] P. L. Bartlett, P. M. Long, and R. C. Williamson, “Fat-shattering and the learnability of real-valued functions,” Journal of Computer and System Sciences, pp. 299–310, 1996. [12] N. Alon, S. Ben-David, N. Cesa-Bianchi, and D. Haussler, “Scale-sensitive dimensions, uniform convergence, and learnability,” Journal of the ACM, vol. 44, no. 4, pp. 615–631, 1997. [13] P. L. Bartlett and S. Mendelson, “Rademacher and gaussian complexities: Risk bounds and structural results,” The Journal of Machine Learning Research, vol. 3, pp. 463–482, 2003. [14] P. L. Bartlett, O. Bousquet, S. Mendelson et al., “Local rademacher complexities,” The Annals of Statistics, vol. 33, no. 4, pp. 1497–1537, 2005. [15] P. Massart and É. Nédélec, “Risk bounds for statistical learning,” The Annals of Statistics, pp. 2326–2366, 2006. [16] S. Mendelson, “Learning without concentration,” Journal of the ACM (JACM), vol. 62, no. 3, p. 21, 2015. [17] D. A. McAllester, “PAC-Bayesian model averaging,” in Proceedings of the Twelfth Annual Conference on Computational Learning Theory. ACM, 1999, pp. 164–170. [18] M. Seeger, “PAC-Bayesian generalisation error bounds for Gaussian process classification,” The Journal of Machine Learning Research, vol. 3, pp. 233–269, 2003. [19] D. Cohn and G. Tesauro, “How tight are the Vapnik-Chervonenkis bounds?” Neural Computation, vol. 4, no. 2, pp. 249–269, 1992. [20] D. Haussler, M. Kearns, H. S. Seung, and N. Tishby, “Rigorous learning curve bounds from statistical mechanics,” Machine Learning, vol. 25, no. 2-3, pp. 195–236, 1996. [21] X. Chen, A. Guntuboyina, and Y. Zhang, “On bayes risk lower bounds,” arXiv preprint arXiv:1410.0503, 2016. [22] J. Rissanen, “Modeling by shortest data description,” Automatica, vol. 14, no. 5, 1978. [23] A. Barron, J. Rissanen, and B. Yu, “The minimum description length principle in coding and modeling,” IEEE Transactions on Information Theory, vol. 44, no. 6, pp. 2743–2760, 1998. [24] G. I. Shamir, “Minimum description length ({MDL}) regularization for online learning,” in Proceedings of The 1st International Workshop on Feature Extraction: Modern Questions and Challenges, NIPS, 2015, pp. 260–276. [25] H. Akaike, “Information theory and an extension of the maximum likelihood principal,” in International Symposium on Information Theory. Akademiai Kiado, 1973. [26] K. P. Burnham and D. R. Anderson, “Multimodel inference: understanding aic and bic in model selection,” Sociological methods & research, vol. 33, no. 2, pp. 261–304, 2004. [27] N. Tishby, F. C. Pereira, and W. Bialek, “The information bottleneck method,” arXiv preprint physics/0004057, 2000. [28] O. Shamir, S. Sabato, and N. Tishby, “Learning and generalization with the information bottleneck,” in ALT, vol. 8. Springer, 2008, pp. 92–107. [29] L. Devroye and L. Györfi, Nonparametric density estimation: the L1 view. John Wiley & Sons Inc, 1985. [30] H. Ney, “On the relationship between classification error bounds and training criteria in statistical pattern recognition,” in Pattern Recognition and Image Analysis. Springer, 2003, pp. 636–645. [31] I. J. Good, “The population frequencies of species and the estimation of population parameters,” Biometrika, vol. 40, no. 3-4, pp. 237–264, 1953. [32] M. Drmota and W. Szpankowski, “Precise minimax redundancy and regret,” Information Theory, IEEE Transactions on, vol. 50, no. 11, pp. 2686–2707, 2004. [33] S. Kamath, A. Orlitsky, D. Pichapati, and A. T. Suresh, “On learning distributions from their samples.” 35 [34] Y. Han, J. Jiao, and T. Weissman, “Minimax estimation of discrete distributions under loss,” Information Theory, IEEE Transactions on, vol. 61, no. 11, pp. 6343–6354, 2015. [35] G. Valiant and P. Valiant, “Instance optimal learning,” arXiv preprint arXiv:1504.05321, 2015. [36] M. Raginsky, “Learning from compressed observations,” in Information Theory Workshop, 2007. ITW’07. IEEE. IEEE, 2007, pp. 420–425. [37] A. Xu and M. Raginsky, “Information-theoretic lower bounds for distributed function computation,” IEEE Transactions on Information Theory, vol. 63, no. 4, pp. 2314–2337, 2017. [38] B. Clarke and A. Barron, “Information-theoretic asymptotics of Bayes methods,” IEEE Trans. Inf. Theory, vol. 36, no. 3, pp. 453 –471, May 1990. [39] M. S. Pinsker, “Information and information stability of random variables and processes,” 1960. [40] I. Csiszar, “Information-type measures of difference of probability distributions and indirect observations,” Studia Sci. Math. Hungar., vol. 2, pp. 299–318, 1967. [41] I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning. MIT Press, 2016, http://www.deeplearningbook.org. [42] R. G. Gallager, “Source coding with side information and universal coding,” unpublished, 1979. [43] N. Merhav and M. Feder, “A strong version of the redundancy-capacity theorem of universal coding,” IEEE Trans. Inf. Theory, vol. 41, no. 3, pp. 714 –722, May 1995. [44] A. Beirami and F. Fekri, “Results on the redundancy of universal compression for finite-length sequences,” in 2011 IEEE International Symposium on Information Theory (ISIT ’11), Jul. 2011, pp. 1604–1608. [45] A. Kraskov, H. Stögbauer, and P. Grassberger, “Estimating mutual information,” Physical review E, vol. 69, no. 6, p. 066138, 2004. [46] A. Ehrenfeucht, D. Haussler, M. Kearns, and L. Valiant, “A general lower bound on the number of examples needed for learning,” Information and Computation, vol. 82, no. 3, pp. 247–261, 1989. [47] A. Gelman, J. Carlin, H. Stern, D. Dunson, A. Vehtari, and D. Rubin, Bayesian Data Analysis. CRC Press, 2013.
7cs.IT
Sorting with Recurrent Comparison Errors∗ Barbara Geissmann, Stefano Leucci, Chih-Hung Liu, and Paolo Penna Department of Computer Science, ETH Zürich, Switzerland {name}.{surname}@inf.ethz.ch arXiv:1709.07249v1 [cs.DS] 21 Sep 2017 Abstract We present a sorting algorithm for the case of recurrent random comparison errors. The algorithm essentially achieves simultaneously good properties of previous algorithms for sorting n distinct elements in this model. In particular, it runs in O(n2 ) time, the maximum dislocation of the elements in the output is O(log n), while the total dislocation is O(n). These guarantees are the best possible since we prove that even randomized algorithms cannot achieve o(log n) maximum dislocation with high probability, or o(n) total dislocation in expectation, regardless of their running time. 1998 ACM Subject Classification F.2.2 Sorting and Searching Keywords and phrases sorting, recurrent comparison error, maximum and total dislocation 1 Introdution We study the problem of sorting n distinct elements under recurrent random comparison errors. In this classical model, each comparison is wrong with some fixed probability p, and correct with probability 1 − p. The probability of errors are independent over all possible pairs of elements, but errors are recurrent: If the same comparison is repeated at any time during the computation, the result is always the same, i.e., always wrong or always correct. In such a scenario not all sorting algorithms perform equally well in terms of the output, as some of them are more likely to produce “nearly sorted” sequences than others. To measure the quality of an output permutation in terms of sortedness, a common way is to consider the dislocation of an element, which is the difference between its position in the permutation and its true rank among all elements. Two criteria based on the dislocations of the elements are the total dislocation of a permutation, i.e., the sum of the dislocations of all n elements, and the maximum dislocation of any element in the permutation. Naturally, the running time remains an important criteria for evaluating sorting algorithms. To the best of our knowledge, for recurrent random comparison errors, the best results with respect to running time, maximum, and total dislocation are achieved by the following two different algorithms: Braverman and Mossel [2] give an algorithm which guarantees maximum dislocation O(log n) and total dislocation O(n), both with high probability. The main drawback of this algorithm seems to be its running time, as the constant exponent can be rather high; Klein et al. [11] give a much faster O(n2 )-time algorithm which guarantees maximum dislocation O(log n), with high probability. They however do not provide any upper bound on the total dislocation, which by the previous result is obviously O(n log n). ∗ Research supported by SNSF (Swiss National Science Foundation, project number 200021_165524). © Barbara Geissmann, Stefano Leucci, Chih-Hung Liu, and Paolo Penna; licensed under Creative Commons License CC-BY Leibniz International Proceedings in Informatics Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl Publishing, Germany XX:2 Sorting with Recurrent Comparison Errors # Steps Maximal Dislocation Total Dislocation Braverman and Mossel [2] O(n3+24c ) w.h.p. O(log n) w.h.p. O(n) Klein et al [11] O(n2 ) w.h.p. O(log n) w.h.p. O(n log n) Ours O(n2 ) w.h.p. O(log n) in exp. O(n) Table 1 Our and previous results. The constant c in [2] depends on both the error probability p, and the success probability of the algorithm. For example, for a success probability of 1 − 1/n, the 110525 analysis in [2] yields c = (1/2−p) 4 . The total dislocation in [11] follows trivially by the maximum dislocation, and no further analysis is given. In this paper we investigate whether it is possible to guarantee all of these bounds together, that is, if there is an algorithm with running time O(n2 ), maximum dislocation O(log n), and total dislocation O(n). 1.1 Our contribution We propose a new algorithm whose performance guarantees are essentially the best of the two previous algorithms (see Table 1). Indeed, our algorithm Window Sort takes O(n2 ) time and guarantees the maximum dislocation to be O(log n) with probability 1 − 1/n and the expected total dislocation to be O(n). The main idea is to iteratively sort n elements by comparing each element with its neighbouring elements lying within a window and to halve the window size after every iteration. In each iteration, each element is assigned a rank based on the local comparisons, and then they are placed according to the computed ranks. Our algorithm is inspired by Klein et al.’s algorithm [11] which distributes elements into buckets according to their computed ranks, compares each element with elements in neighboring buckets to obtain a new rank, and halves the range of a bucket iteratively. Note however that the two algorithms operate in a different way, essentially because of the following key difference between bucket and window. The number of elements in a bucket is not fixed, since the computed rank of several elements could be the same. In a window, instead, the number of elements is fixed. This property is essential in the analysis of the total dislocation of Window Sort, but introduces a potential offset between the computed rank and the computed position of an element. Our analysis consists in showing that such an offset is sufficiently small, which we do by considering a number of “delicate” conditions that the algorithm should maintain throughout its execution with sufficiently high probability. We first describe a standard version of our algorithm which achieves the afore mentioned bounds for any error probability p < 1/32. We then improve this result to p < 1/16 by using the idea of shrinking the window size at a different rate. Experimental results (see Appendix A) show that the performance of the standard version is significantly better than the theoretical guarantees. In particular, the experiments suggest that the expected total dislocation is O(n) for p < 1/5, while the maximum dislocation is O(log n) for p < 1/4. In addition, we prove that no sorting algorithm can guarantee the maximum dislocation to be o(log n) with high probability, and no sorting algorithm can guarantee the expected total dislocation to be o(n). 1.2 Further Related Work on Sorting with Comparison Errors Computing with errors is often considered in the framework of a two-person game called Rényi-Ulam Game: The responder thinks of an object in the search space, and the questioner B. Geissmann, S. Leucci, Ch. Liu and P. Penna has to find it by asking questions to which the responder provides answers. However, some of the answers are incorrect on purpose; the responder is an adversarial lier. These games have been extensively studied in the past on various kinds of search spaces, questions, and errors; see Pelc’s survey [13] and Cicalese’s monograph [3]. Feige et al. [6] studied several comparison based algorithms with independent random errors where the error probability of a comparison is less than half, the repetitions of an comparison can obtain different outcomes, and all the comparisons are independent. They required the reported solution to be correct with a probability 1 − q, where 0 < q < 1/2, and proved that for sorting, O(n log(n/q)) comparisons suffice, which gives also the running time. In the same model, sorting by random swaps represented as Markovian processes have been studied under the question of the number of inversions (reversed pairs) [7, 8], which is within a constant factor of the total dislocation [14]. Karp and Kleinberg [10] studied a noisy version of the classic binary search problem, where elements cannot be compared directly. Instead, each element is associated with a coin that has an unknown probability of observing heads when tossing it and these probabilities increase when going through the sorted order. For recurring errors, Coppersmith and Rurda [4] studied a simple algorithm that gives a 5-approximation on the weighted feedback arc set in tournaments (FAST) problem if the weights satisfy probability constraints. The algorithm consists of ordering the elements based on computed ranks, which for unweighted FAST are identical to our computed ranks. Alonso et al. [1] and Hadjicostas and Lakshamanan [9] studied Quicksort and recursive Mergesort, respectively, with random comparison errors. Paper organization The rest of this paper is organized as follows. We present the Window Sort algorithm in Section 2 and analyze the maximum and total dislocation in Section 3 and Section 4, respectively. Then, we explain how to modify Window Sort to allow larger error probabilities in Section 5 and show some experimental results in Appendix A. Additionally, we prove lower bounds on both the maximum and average dislocation for any sorting algorithm in Section 6. 2 Window Sort Window Sort consists of multiple iterations of the same procedure: Starting with a permutation σ and a window size w, we compare each element x in σ with its left 2w and right 2w adjacent elements (if they exist) and count its wins, i.e., the number of times a comparison outputs x as the larger element. Then, we obtain the computed rank for each element based on its original position in σ and its wins: if σ(x) denotes the original position of x in σ, the computed rank of x equals max{0, σ(x) − 2w} plus the number of its wins. And we get a new permutation σ 0 by placing the elements ordered by their computed ranks. Finally, we set w0 = w/2 and start a new iteration on σ 0 with window size w0 . In the very first iteration, w = n/2. We formalize Window Sort in Algorithm 1. In the following, w.l.o.g. we assume to sort elements {1, . . . , n}, i.e., we refer to both an element x and its rank by x. Let σ denote the permutation of the elements at the beginning of the current iteration of Window Sort and let σ 0 denote the permutation obtained after this iteration (i.e., the permutation on which the next iteration performs). Similarly, let w and w0 = w/2 denote the window size of the current and the next iteration. Furthermore, let π denote the sorted permutation. We define four important terms for an element x in σ: Current/Original position: The position of x in σ: σ(x) XX:3 XX:4 Sorting with Recurrent Comparison Errors Algorithm 1: Window Sort (on a permutation σ on n elements) Initialization: The initial window size is w = n/2. Each element x has two variables wins(x) and computed_rank(x) which are set to zero. repeat 1. foreach x at position l = 1, 2, 3, . . . , n in σ do foreach y whose position in σ is in [l − 2w, l − 1] or in [l + 1, l + 2w] do if x > y then wins(x) = wins(x) + 1 computed_rank(x) = max{l − 2w, 0} + wins(x) 2. Place the elements into σ 0 ordered by non-decreasing computed_rank, break ties arbitrarily. 3. Set all wins to zero, σ = σ 0 , and w = w/2. until w < 1; Computed rank: The current position of x minus 2w (zero if negative) plus its number of wins: computed_rank(x) Computed position: The position of x in σ 0 : σ 0 (x) I Theorem 1. Window Sort takes O(n2 ) time. Proof. Consider the three steps in Algorithm 1. The number of comparisons in an iteration in the outer loop is 4w, for w the current size of the window. Therefore, the first step needs O(nw) time. For the second step we could apply for instance Counting Sort (see e.g. [5]), which takes O(n) time, since all computed ranks lie between zero and n. Thus, the total P∞ 2 2 running time is upper bounded by i=0 O( 4n J 2i ) = O(8n ). 2.1 Preliminaries We first introduce a condition on the errors in comparisons between an element x and a fixed subset of elements which depends only on the window size w. I Definition 2. We define ERRORS(x, w) as the set of errors among the comparisons between x and every y ∈ [x − 4w, x + 4w]. I Theorem 3. Window Sort returns a sequence of maximum dislocation at most 9w? whenever the initial comparisons are such that |ERRORS(x, w)| ≤ w/4 (1) hold for all elements x and for all w = n/2, n/4, . . . , 2w? . The proof of this theorem follows in the end of this section. In the analysis, we shall prove the following: If the computed rank of each element is close to its (true) rank, then the dislocation of each elements is small (Lemma 6). The computed rank of each element is indeed close to its (true) rank if the number of errors involving the element under consideration is small (Lemma 4). The number of positions an element can move in further iterations is small (Lemma 7). B. Geissmann, S. Leucci, Ch. Liu and P. Penna XX:5 We now introduce a condition that implies Theorem 3: Throughout the execution of Window Sort we would like every element x to satisfy the following condition: (∗) For window size w, the dislocation of x is at most w. We also introduce two further conditions, which essentially relax the requirement that all elements satisfy (∗). The first condition justifies the first step of our algorithm, while the second condition restricts the range of elements that get compared with x in some iteration: (•) For window size w, element x is larger (smaller) than all the elements lying apart by more than 2w positions left (right) of x’s original position. (◦) For window size w, x and its left 2w and right 2w adjacent elements satisfy condition (∗). Note that if (∗) holds for all elements, then (•) and (◦) also hold for all elements. For elements that satisfy both (•) and (◦), the computed rank is close to the true rank if there are few errors in the comparisons: I Lemma 4. For every window size w, if an element x satisfies satisfy both (•) and (◦), then the absolute difference between the computed rank and its true rank is bounded by |computed_rank(x) − x| ≤ |ERRORS(x, w)| . Proof. This follows immediately from condition (•). J We now consider the difference between the computed rank and the computed position of an element, which we define as the offset of this element. Afterwards, we consider the difference between the original position and the computed position of an element. I Fact 1. Observe that by Step 1 of the algorithm it holds that, for every permutation σ, every window size w and every element x, the difference between σ(x) and the computed rank of x is at most 2w, |computed_rank(x) − σ(x)| ≤ 2w . I Lemma 5. For any permutation of n elements and for each element x, if the difference between the computed rank and x is at most m for every element, then the difference between the computed position and x is at most 2m for every element. The proof of this lemma is analogue to the proof of Lemma 6 below. I Lemma 6. For every permutation σ and window size w, the offset of every element x is at most 2w, |computed_rank(x) − σ 0 (x)| ≤ 2w . Proof. Let the computed rank of x be k. The computed position σ 0 (x) is larger than the number of elements with computed rank smaller than k, and at most the number of elements with computed ranks at most k. By Fact 1, every element y with σ(y) < k − 2w has a computed rank smaller than k, and every element y with σ(y) > k + 2w has a computed rank larger than k. J I Lemma 7. Consider a generic iteration of the algorithm with permutation σ and a window size w. In this iteration, the position of each element changes by at most 4w. Moreover, the position of each element changes by at most 8w until the algorithm terminates. XX:6 Sorting with Recurrent Comparison Errors Proof. By Fact 1, Lemma 6 and triangle inequality, |σ(x)−σ 0 (x)| ≤ |computed_rank(x)−σ(x)|+|computed_rank(x)−σ 0 (x)| ≤ 2w +2w = 4w. P∞ Since w is halved after every iteration, the final difference is at most i=0 4w J 2i = 8w. Finally, we conclude Theorem 3 and show that the dislocation of an element is small if the number of errors is small: Proof of Theorem 3. Consider an iteration of the algorithm with current window size w. We show that, if (∗) holds for all elements in the current iteration, then (1) implies that (∗) also holds for all elements in the next iteration, i.e., when the window size becomes w/2. In order for (∗) to hold for the next iteration, the computed position of each element should differ from the true rank by at most w/2, |σ 0 (x) − x| ≤ w/2 . By Lemma 5, it is sufficient to require that the computed rank of each element differs from its true rank by at most w/4, |computed_rank(x) − x| ≤ w/4 By Lemma 4, the above inequality follows from the hypothesis |ERRORS(x, w)| ≤ w/4. We have thus shown that after the iteration with window size 2w∗ , all elements have dislocation at most w∗ . By Lemma 7, the subsequent iterations will move each element by at most 8w∗ positions. J I Remark. If we care only about the maximum dislocation, then we could obtain a better bound of w by simply stopping the algorithm at the iteration where the window size is w (for a w which guarantees the condition above with high probability). In order to bound also the total dislocation, we let the algorithm continue all the way until window size w = 1. This will allow us to show that the total dislocation is linear in expectation. 3 Maximum Dislocation In this section we give a bound on the maximum dislocation of an element after running Window Sort on n elements. We prove that it is a function of n and of the probability p that a single comparison fails. Our main result is the following: I Theorem 8. For a set of n elements, with probability 1 − 1/n, the maximum dislocation after running Window Sort is 9 · f (p) · log n where  400p  for 1/64 < p < 1/32,   (1−32p)2 4 for 1/192 < p ≤ 1/64, f (p) = 1 ln( 32p )−(1−32p)    6 for p ≤ 1/192. It is enough to prove that the condition in Theorem 3 holds for all w ≥ 2f (p) log n with probability at least 1 − 1/n. I Lemma 9. For every fixed element x and for every fixed window size w ≥ 2f (p) log n, the probability that |ERRORS(x, w)| > w/4 is at most 1/n3 . (2) B. Geissmann, S. Leucci, Ch. Liu and P. Penna XX:7 By the union bound, the probability that (2) holds for some x and for some w is at most 1/n. That is, the condition of Theorem 3 holds with probability at least 1 − 1/n for all w ≥ 2w? = 2f (p) log n, which then implies Theorem 8. 3.1 Proof of Lemma 9 Since each comparison fails with probability p independently of the other comparisons, the probability that the event in (2) happens is equal to the probability that at least w/4 errors occur in 8w comparisons. We denote such probability as Pr(w), and show that Pr(w) ≤ 1/n3 . We will make use of the following standard Chernoff Bounds (see for instance in [12]): I Theorem 10 (Chernoff Bounds). Let X1 , · · · , Xn be independent Poisson trials with Pn Pr(Xi ) = pi . Let X = i=1 Xi and µ = E[X]. Then the following bounds hold: µδ 2 (i) For 0 < δ < 1, (ii) For any δ > 0, (iii) For R ≥ 6µ, Pr(X ≥ (1 + δ)µ) ≤ e− 3 , µ  eδ Pr(X ≥ (1 + δ)µ) < , (1 + δ)(1+δ) (3) Pr(X ≥ R) ≤ 2−R . (5) (4) I Lemma 11. The probability Pr(w) (at least w/4 errors occur in 8w comparisons) satisfies  w(1−32p)2   e− 384p for 1/64 < p < 1/32,      1−32p 8wp e 32p Pr(w) ≤ for 1/192 < p ≤ 1/64, 1 1  32p  ( 32p )     2− w4 for p ≤ 1/192. Proof. Let the random variable X denote the number of errors in the outcome of 8w comparisons. Clearly, E[X] = 8wp, and       h E[X] 1 − 32p wi = Pr X ≥ = Pr X ≥ 1 + E[X] . Pr(w) = Pr X ≥ 4 32p 32p Let δ = 1−32p 32p . If 1/64 < p < 1/32, then 0 < δ < 1, and by Theorem 10, case (i), we have 1 Pr(w) ≤ e− 3 δ 2 µ ≤ e− w·(1−32p)2 384p . Similarly, if p ≤ 1/64, then δ ≥ 1, and by Theorem 10, case (ii), we have  Pr(w) < eδ (1 + δ)(1+δ) µ  ≤ e 1−32p 32p 1 8wp . 1 ( 32p ) 32p w If p ≤ 1/192, then w/4 ≥ 48wp = 6 E[X], and by Theorem 10 case (iii), Pr(w) ≤ 2− 4 . J I Lemma 12. If w ≥ 2 f (p) log n, with n ≥ 1 and f (p) as in Theorem 8, then Pr(w) ≤ 1/n3 . Proof. We show the first case, the other two are similar. If 1/64 < p < 1/32, by Lemma 11, Pr(w) ≤ e− w·(1−32p)2 384p 800 ≤ e− 384 log n ≤ e−3 lg n ≤ 1/n3 . J XX:8 Sorting with Recurrent Comparison Errors 4 Total Dislocation In this section, we prove that Window Sort orders n elements such that their total dislocation is linear in n times a factor which depends only on p: I Theorem 13. For a set of n elements, the expected total dislocation after running Window Sort is at most n · 60 f (p) log f (p). The key idea is to show that for an element x, only O(w) elements adjacent to its (true) rank matter in all upcoming iterations. If this holds, it is sufficient to keep the following weak invariant for an element x throughout all iterations: (♣) This invariant consists of three conditions that have to be satisfied: (a) x satisfies condition (∗). (b) All elements with original position in [x − 12w, x + 12w] satisfy condition (∗). (c) All elements with original position in [x − 10w, x + 10w] satisfy condition (•). Note that if x satisfies (♣), all elements lying in [x − 10w, x + 10w] satisfy both (•) and (◦). The rest of this section is structured as follows: First we derive several properties of the weak invariant, then we prove an n log log n bound on the expected total dislocation, and finally we extend the proof to achieve the claimed linear bound. 4.1 Properties of the Weak Invariant We start with the key property of the weak invariant (♣) for some element x. I Lemma 14. Let σ be the permutation of n elements and w be the window size of some iteration in Window Sort. If the weak invariant (♣) holds for an element x in σ and the computed rank of every element y with σ(y) ∈ [x − 10w, x + 10w] differs from y by at most w/4, then (♣) still holds for x in the permutation σ 0 of next iteration with window size w/2. Proof. Consider the set X of all elements y with computed_rank(y) ∈ [x − 8w, x + 8w]. Their computed ranks differ from their original positions by at most 2w. Thus, all these elements are in the set Y ⊇ X of all elements whose original positions are in [x−10w, x+10w]. By the assumption of the lemma, for each element y ∈ Y , |computed_rank(y) − y| ≤ w/4. Using the same reasoning as in the proof of Lemma 6, we conclude that for each element y ∈ X, |σ 0 (y) − y| ≤ w/2. (A) Consider the set Z of all elements y with σ 0 (y) ∈ [x − 6w, x + 6w]. By Lemma 6, their computed ranks lie in [x − 8w, x + 8w], thus Z ⊆ X, and by (A), |σ 0 (y) − y| ≤ w/2 for each y ∈ Z. Thus, the second condition of (♣) holds for the next iteration. We continue with the third condition. Consider the set T ⊆ Z of all elements y with 0 σ (y) ∈ [x − 5w, x + 5w]. By the assumptions of the lemma, y ∈ [x − 5w − w/2, x + 5w + w/2] and σ(y) ∈ [x − 5w − 3w/2, x + 5w + 3w/2] for all y ∈ T . It is sufficient to show that every element in T is larger (or smaller) than all elements whose computed positions are smaller than x − 6w (or larger than x + 6w), the rest follows from the second condition. We show the former case, the latter is symmetric. We distinguish three subcases: elements y ∈ T with σ 0 (y) < x − 6w and with σ(y) (i) smaller than x − 12, (ii) between x − 12 and x − 10w − 1, or (iii) between x − 10w and x − 4w − 1. (i) This case follows immediately from the third condition of (♣). (ii) This case follows immediately from the second condition of (♣). B. Geissmann, S. Leucci, Ch. Liu and P. Penna (iii) By the assumption of our lemma, |computed_rank(y) − y| ≤ w/4. Thus, if the computed rank r of such an element y is smaller than x − 6w, then y < x − 6w + w/4. Otherwise, if r ≥ kx − 6w, then by (A), |y − σ 0 (y)| ≤ w/2. Thus, y < x − 6w + w/2. Since we assume (♣) for x, σ(x) ∈ [x−w, x+w] and computed_rank(x) ∈ [x−3w, x+3w]. By Lemma 6, σ 0 (x) ∈ [k − 5w, k + 5w], and thus x ∈ Z, which implies that the first condition of (♣) will still be satisfied for x for the next iteration. This concludes the proof. J Next, we adopt Lemma 12 to analyze the probability of keeping the weak invariant for an element x and an arbitrary window size through several iteration of Window Sort. I Lemma 15. Consider an iteration of Window Sort on a permutation σ on n elements such that the window size is w ≥ 2 f (p) log w, where f (p) is defined as in Theorem 8. If the weak invariant (♣) for an element x holds, then with probability at least 1 − 42/w2 , (♣) still holds for x when the window size is f (p) log w (after some iterations of Window Sort). Proof. By Lemma 14, the probability that (♣) fails for x before the next iteration is w (20w + 1) · Pr(w). Let r = log( 2 f (p)logw ), then the probability that (♣) fails for x during the iterations from window size w to window size f (p) · log w is   r  r  w X X 20w 21w + 1 · Pr i ≤ · Pr (2 f (p) log w) ≤ 42w · Pr (2 f (p) log w) , 2i 2 2i i=0 i=0 where the first inequality is by fact that Pr(w) increases when w decreases. By Lemma 12, Pr(2 f (p) log w) ≤ 1/w3 , leading to the statement. J 4.2 Double Logarithmic Factor (Main Idea) Given that Window Sort guarantees maximum dislocation at most 9 f (p) log n with probability at least (1 − 1/n) (Theorem 8), this trivially implies that the expected total dislocation is at most O(f (p) log n). More precisely, the expected dislocation is at most (1/n) · n · n + (1 − 1/n) · n · 9 f (p) log n ≤ n · (1 + 9 f (p) log n) , since a fraction 1/n of the elements is dislocated by at most n, while the others are dislocated by at most 9 · f (p) log n. We next describe how to improve this to O(f (p) log log n) by considering in the analysis two phases during the execution of the algorithm: Phase 1: The first phase consists of the iterations up to window size w = f (p) log n. With probability at least (1 − 1/n) all elements satisfy (∗) during this phase. Phase 2: The second phase consists of the executions up to window size w0 = f (p) log w. If all elements satisfied (∗) at the end of the previous phase, then the probability that a fixed element violates (♣) during this second phase is at most 42/w2 . More precisely, by Theorem 8 and the proof of Theorem 3, the probability that (∗) holds for all elements when the window size is f (p) log n is at least (1 − 1/n). We thus restart our analysis with w = f (p) log n and the corresponding permutation σ. Assume an element x satisfies (♣). By Lemma 15, the probability that (♣) fails for x before the window size is f (p) log w is at most 42/w2 . By Lemma 7, an element moves by at most 8w positions from its original position, which is at most w apart from its true rank. Therefore, the expected dislocation of an element x is at most (1/n) · n + 42/w2 · 9w + 9 f (p) log w = O(1) + 9 f (p) log(f (p) log n) , where the equality holds for sufficiently large n because w = f (p) log n. XX:9 XX:10 Sorting with Recurrent Comparison Errors 4.3 Linear Dislocation (Proof of Theorem 13) In this section, we apply a simple idea to decrease the upper bound on the expected total dislocation after running Window Sort on n elements to 60 f (p) log f (p). We recurse the analysis from the previous Section 4.2 for several phases: Roughly speaking, an iteration in Window Sort halves the window size, a phase of iterations logarithmizes the window size. Phase 1: Iterations until the window size is f (p) log n. Phase 2: Subsequent iterations until the window size is f (p) · log(f (p) log n). Phase 3: Subsequent iterations until the window size is f (p) · log(f (p) · log(f (p) log n)). ... We bound the expected dislocation of an element x, and let wi denote the window size after the i-th phase. We have w0 = n, w1 = f (p) log n, w2 = f (p) log(f (p) log n), and wi+1 = f (p) log wi , (6) if i ≥ 1 and wi ≥ 2 f (p) log wi . Any further phase would just consist of a single iteration. In the remaining of this section, we only consider phases i for which Equation (6) is true, and we call them the valid phases. By Lemma 15, if the weak invariant (♣) holds for x and window size wi−1 , the probability 2 that it still holds for window size wi is at least 1 − 42/wi−1 . Similarly to the analysis in the Section 4.2, we get that a valid phase i ≥ 1 contributes to the expected dislocation of x by 2 42/wi−1 · 9wi−1 = 378/wi−1 . (7) If we stop our analysis after c valid phases, then by (7) and Lemma 7, the expected dislocation of any element x is at most c−1 X 378/wi + 9wc ≤ 378/wc + 9wc . (8) i=0 The inequality holds since wwi−1 ≤ 2 for 1 < i < c. We next define c such that phase c is valid i i−1 and wc only depends on f (p). The term f (p)wlog wi−1 ≥ 2 holds for every valid phase i and decreases with increasing i. For instance for w = 6f (p) log f (p): w 6 f (p) log f (p) 6 log f (p) = ≥ ≥ 2. f (p) log w f (p) log(6 f (p) log f (p)) 3 log f (p) Therefore, if we choose c such that wc−1 ≥ 6 f (p) log f (p) > wc , we can use that f (p) ≥ 6 and upper bound wc by wc = f (p) log wc−1 ≥ f (p) log(6 f (p) log f (p)) ≥ 6 log(36 log 6) ≥ 39 . (9) Equations (8) and (9) and Lemma 7 imply the following: I Lemma 16. The expected dislocation of each element x after running Window Sort is at most 378/wc + 9wc < 10 + 9wc ≤ 10wc ≤ 60 f (p) log f (p) . This immediately implies Theorem 13. B. Geissmann, S. Leucci, Ch. Liu and P. Penna 5 Extension The reason why we require the error probability p to be smaller than 1/32 is to analyze the probability that at most w/4 errors occur in 8w comparisons, for w ≥ 1. This bound on the number of errors appears since we halve the window size in every iteration. If we let the window size shrink by another rate 1/2 < α < 1, the limit of p will also change: 1 First, the running time of the adapted Window Sort will become O( 1−α n2 ). Second, for any permutation σ and window size w, in order to maintain condition (∗) for an element x, its computed position should differ from x by at most αw, and thus computed_rank(x) should differ from x by at most αw/2. Our new issue is thus the probability that at most αw/2 errors occur in 8w comparisons: Since the expected number of errors is 8wp, we have αw α α − 16p = · 8wp = (1 + ) · 8wp , 2 16p 16p and by the reasoning of Lemma 11, we have α−16p 16p > 0, thus p < α/16. (Note that f (p) should change accordingly.) Finally, the number of windows for the weak invariant should also change accordingly. Let m be the number of windows that matter for the weak invariant (m = 12 when α = 1/2). 6 According to the analysis in Section 4.1, we have m − 6 ≥ αm, implying that m ≥ 1−α . Of course, the constant inside the linear expected total dislocation will also change accordingly. I Theorem 17. For an error probability p < α/16, where 1/2 < α < 1, modified Window 1 Sort on n elements takes O( 1−α n2 ) time, has maximum dislocation 9 g(p, α) log n with 2 probability 1 − 1/n, and expected total dislocation n · (9 + 1−α ) · 6 g(p, α) log g(p, α), where g(p, α) = 6  100p    (α−16p)2 for α/32 < p < α/16 , for α/96 < p ≤ α/32 ,  6 for p ≤ α/96 . 4  (ln(α/16p))−(α−16p) A lower bound on the maximum dislocation In this section we prove a lower bound on both the maximum and the average dislocation that can be achieved w.h.p. by any sorting algorithm. Let S = {1, 2, . . . , n} be the set of elements to be sorted. We can think of an instance of our sorting problem as a pair hπ, Ci where π is a permutation of S that represents the order of the element in the input collection and C = (ci,j )i,j is a n × n matrix that encodes the result of the comparisons as seen by the algorithm. More precisely, ci,j is “<” if i is reported to be smaller than j when comparing i and j and ci,j = “<” otherwise. Notice that ci,j = “<” iff cj,i = “>” and hence in what follows we will only define ci,j for i < j. The following lemma – whose proof is moved to Appendix B – is a key ingredient in our lower bounds: I Lemma 18. Let x, y ∈ S with x < y. Let A be any (possibly randomized) algorithm. On a random instance, the probability that A returns a permutation in which elements x and y  2(y−x)−1 p appear the wrong relative order is at least 12 1−p . As a first consequence of the previous lemma, we obtain the following: XX:11 XX:12 Sorting with Recurrent Comparison Errors I Theorem 19. No (possibly randomized) algorithm can achieve maximum dislocation o(log n) with high probability. Proof. By Lemma 18, any algorithm, when invoked on a random instance, must return a n permutation ρ in which elements 1 and h = 2 loglog1−p/p appear in the wrong order with a 1 probability larger than n . When this happens, at least one of the following two conditions holds: (i) the position of element 1 in ρ is at least d h2 e; or (ii) the position of element h in ρ is at most b h2 c. In any case, the maximum dislocation must be at least h2 − 1 = Ω(log n). J Finally, we are also able to prove a lower bound to the total dislocation (whose proof is given in Appendix B). I Theorem 20. No (possibly randomized) algorithm can achieve expected total dislocation o(n). References 1 2 3 4 5 6 7 8 9 10 11 12 13 14 L. Alonso, P. Chassaing, F. Gillet, S. Janson, E. M. Reingold, and R. Schott. Quicksort with unreliable comparisons: a probabilistic analysis. Combinatorics, Probability and Computing, 13(4-5):419–449, 2004. M. Braverman and E. Mossel. Noisy Sorting Without Resampling. In Proceedings of the 19th Annual Symposium on Discrete Algorithms, pages 268–276, 2008. F. Cicalese. Fault-Tolerant Search Algorithms - Reliable Computation with Unreliable Information. Monographs in Theoretical Computer Science. An EATCS Series. Springer, 2013. D. Coppersmith, L. K. Fleischer, and A. Rurda. Ordering by weighted number of wins gives a good ranking for weighted tournaments. ACM Trans. Algorithms, 6(3):55:1–55:13, July 2010. T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein. Introduction to Algorithms (3. ed.). MIT Press, 2009. U. Feige, P. Raghavan, D. Peleg, and E. Upfal. Computing with Noisy Information. SIAM Journal on Computing, 23(5):1001–1018, 1994. T. Gavenčiak, B. Geissmann, and J. Lengler. Sorting by swaps with noisy comparisons. In To appear in: Proceedings of the Genetic and Evolutionary Computation Conference 2016, GECCO ’17, 2017. B. Geissmann and P. Penna. Sort well with energy-constrained comparisons. ArXiv e-prints, Oct. 2016. P. Hadjicostas and K. Lakshmanan. Recursive merge sort with erroneous comparisons. Discrete Applied Mathematics, 159(14):1398–1417, 2011. R. M. Karp and R. Kleinberg. Noisy binary search and its applications. In Proceedings of the Eighteenth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2007, New Orleans, Louisiana, USA, January 7-9, 2007, pages 881–890, 2007. R. Klein, R. Penninger, C. Sohler, and D. P. Woodruff. Tolerant Algorithms. In Proceedings of the19th Annual European Symposium on Algorithm, pages 736—-747, 2011. M. Mitzenmacher and E. Upfal. Probability and computing - randomized algorithms and probabilistic analysis. Cambridge University Press, 2005. A. Pelc. Searching games with errors - fifty years of coping with liars. Theor. Comput. Sci., 270(1-2):71–109, 2002. R. L. G. Persi Diaconis. Spearman’s footrule as a measure of disarray. Journal of the Royal Statistical Society. Series B (Methodological), 39(2):262–268, 1977. B. Geissmann, S. Leucci, Ch. Liu and P. Penna A XX:13 Experimental Results In this section, we discuss some experimental results on the performance of Window Sort for increasing error probability p (see Tables 2 and 3). Our results suggest that in practice, the probability of error can be much higher than in our theoretical analysis (i.e. p < 1/32). In these experiments we measure the average dislocation (which gives us an estimate of the expected total dislocation) and the maximum dislocation among all elements. Note that in all the experiments, Window Sort performs significantly better than the theoretical guarantees (see Theorem 8 and 13 for the corresponding values of p). Also, the experiments suggest that the expected total dislocation is O(n) for p < 1/5, since the average dislocation seems to not increase with n in these cases. Analogously, the maximum dislocation seems to be O(log n) for p < 1/4. We consider five different values for the input-size n and ten different values for the error probability p. Each setting consists of one-hundred instances. We use the error probability to generate a comparison table among the n elements for simulating recurrent comparison errors. Moreover, we set α to be 1/2 as in the standard version of Window Sort. H HH p HH n 1024 2048 4096 8192 16384 Table 2 H HH p HH n 1024 2048 4096 8192 16384 Table 3 B 1/3 1/4 1/5 14.160 4.873 2.870 15.993 4.984 2.884 17.494 5.075 2.904 19.030 5.105 2.898 20.377 5.123 2.902 The average dislocation of 1/3 1/4 1/5 15.600 5.400 3.900 17.000 4.909 2.818 17.917 5.333 2.833 18.923 6.462 3.077 22.714 5.071 3.929 The maximum dislocation 1/8 1/12 1/16 1/20 1/24 1/28 1/32 1.377 0.881 1.397 0.895 1.390 0.893 1.395 0.894 1.390 0.892 one element. 0.670 0.674 0.673 0.675 0.673 0.536 0.541 0.545 0.545 0.545 0.454 0.464 0.460 0.460 0.460 0.390 0.394 0.398 0.397 0.398 0.346 0.348 0.351 0.351 0.349 1/16 1/20 1/24 1/28 1/32 1.200 0.900 1.091 0.818 1.083 0.833 1.154 0.769 1.071 0.857 by log n. 0.900 0.818 0.917 0.692 0.643 0.600 0.636 0.667 0.769 0.643 0.600 0.636 0.583 0.538 0.571 0.600 0.636 0.667 0.538 0.571 1/8 2.100 1.545 1.500 1.769 1.786 divided 1/12 Omitted Proofs Proof of Lemma 18 We prove that, for any running time t > 0, no algorithm A can compute, within t steps, a sequence in which x and y are in the correct relative order with a probability larger than  2(y−x)−1 p 1 − 12 1−p . First of all, let us focus a deterministic version of algorithm A by fixing a sequence λ ∈ {0, 1}t of random bits that can be used be the algorithm. We call the resulting algorithm Aλ and we let pλ denote the probability of generating the sequence λ of random bits (i.e., 2−t XX:14 Sorting with Recurrent Comparison Errors if the random bits come from a fair coin).1 Notice that A might already be a deterministic algorithm, in this case A = Aλ for every λ ∈ {0, 1}t . Consider an instance I = hπ, Ci, and let φI be the permutation of the elements in S returned by Aλ (I), i.e., φI (i) = j if the element i ∈ S is the j-th element of the sequence returned by Aλ . We define a new instance Iπ,C = hπ 0 , C 0 i by “swapping” elements x and y of I along with the results of all their comparisons. More formally we define: π 0 (i) = π(i) for all i ∈ S \ {x, y}, π 0 (x) = π(y), and π 0 (y) = π(x); We define the comparison matrix C 0 = (c0i,j )i,j accordingly, i.e.: c0i,j = ci,j if i, j ∈ S \ {x, y} and j > i, c0i,x = ci,y if i < x, c0x,j = cy,j if j > x and j 6= y, c0i,y = ci,x if i < y and i 6= x, c0y,j = cx,j if j > y, c0x,y = cy,x . Letting R = (ri,j )i,j be a random variable over the space of all comparison matrices, we get: Pr(R = C 0 ) = Y Pr(ri,j = c0i,j ) i<j = Y Pr(ri,j = ci,j ) · i<j i,j6∈{x,y} Y Y Pr(ri,y = ci,x ) · Pr(ri,j = ci,j )· i<j i,j6∈{x,y} Y = Y Pr(ri,x = ci,x )· Pr(ri,j = ci,j ) Pr(ry,j = cx,j ) · Pr(rx,y = cy,x ) Y Pr(ri,y = ci,y )· (1−Pr(rx,j = cj,y ))· x<j<y (1−Pr(ri,y = cx,i ))· x<i<y  Y Y Pr(ry,j = cy,j )· j>y Pr(rx,j = cx,j )·(1−Pr(rx,y = cx,y )) j>y   Y Pr(rx,j = cx,j ) ·  i<j Y Y Y Pr(rx,j = cy,j )· j>y j>y i<x i<x Y Pr(ri,y = ci,x ) · Y Pr(rx,j = cy,j ) · x<j<y x<i<y Y Y Pr(ri,x = ci,y ) · i<x i<x = Y x<j<y x<j<y Pr(ri,y = ci,y ) · Pr(rx,y = cx,y ) · x<i<y Y (1 − Pr(rx,j = cj,y )) · Y (1 − Pr(ri,y = cx,i )) · (1 − Pr(rx,y = cx,y )) x<i<y  ≥ P (R = C) · 1 1−p 2(y−x)−1 2(y−x)−1 ·p  = Pr(R = C) · p 1−p 2(y−x)−1 where we used the fact that ri,j and ri0 ,j 0 with i < j and i0 < j 0 have the same probability distribution. Let π e be a random variable whose value is chosen u.a.r. over all the permutations of S. Let Pr(I) be the probability that instance I = hπ, Ci is to be solved and notice that Pr(I) = Pr(e π = π) Pr(R = C). It follows from the above discussion that Pr(Iπ,c ) ≥  2(y−x)−1 p Pr(I) · 1−p . Let XI be an indicator random variable that is 1 iff algorithm Aλ on instance I either does not terminates within t steps, or it terminates returning a sequence in which x appears after y. Let U be the set of all the possible instances and U 0 be the set of the instances I ∈ U such that XI = 0 (i.e., x and y appear in the correct order in the output of A on I). Notice that there is a bijection between the instances in I = hπ, Ci and their corresponding instances 1 Notice that Aλ can use less than t random bits, but not more (due to the limit on its running time). B. Geissmann, S. Leucci, Ch. Liu and P. Penna XX:15 Iπ,C (i.e., our transformation is injective). Moreover, since I and Iπ,C are indistinguishable by Aλ , we have that either (i) Aλ does not terminate within t steps on both instances, or (ii) σI (x) < σI (y) ⇐⇒ σIπ,C (x) > σIπ,C (y). As a consequence, if XI = 0 then XIπ,C = 1. Now, P P either I∈U XI Pr(I) ≥ 21 or we must have I∈U 0 Pr(I) ≥ 12 , which implies: X X XI Pr(I) ≥ I∈U XIπ,C Pr(Iπ,C ) ≥ ≥  Pr(I) · I∈U 0 p 1−p 2(y−x)−1 X XIπ,C Pr(Iπ,C ) = hπ,Ci∈U 0 hπ,Ci∈U X X 1 ≥ 2 Pr(Iπ,C ) hπ,Ci∈U 0  p 1−p 2(y−x)−1 . We let Y (resp. Yλ ) be an indicator random variable which is 1 iff either the execution of A (resp. Aλ ) on a random instance does not terminate within t steps, or it terminates returning a sequence in which x and y appear in the wrong relative order. By the above  2(y−x)−1 P p calculations we know that Pr(Yλ = 1) = I∈U XI Pr(I) ≥ 12 1−p ∀λ ∈ {0, 1}t . We are now ready to bound the probability that Y = 1, indeed: X Pr(Y = 1) = Pr(Yλ = 1)pλ ≥ λ∈{0,1}t 1 2  p 1−p 2(y−x)−1 X λ∈{0,1}t pλ = 1 2  p 1−p 2(y−x)−1 , where the last equality follows from the fact that pλ is a probability distribution over the P elements λ ∈ {0, 1}t , and hence λ∈{0,1}t pλ = 1. J Proof of Theorem 20 Let A be any algorithm and let hπ, Ci be a random instance on an even number of elements n. We define Xk for 0 ≤ k < n/2 to be an indicator random variable that is 1 iff A(hπ, Ci) returns a permutation of the elements in S in which elements 2k + 1 and 2k + 2 appear in the wrong order. p By Lemma 18 we know that Pr(Xk = 1) ≥ 12 1−p . We can hence obtain a lower bound on the expected total dislocation ∆ achieved by A as follows: n/2−1 E[∆] ≥ X k=0 n/2−1 E[Xk ] ≥ X 1 p n p ≥ = Ω(n). 21−p 4 1−p k=0 J
8cs.DS
arXiv:1604.01486v2 [math.RA] 1 Oct 2016 On n-trivial Extensions of Rings D. D. Anderson1 , Driss Bennis2,a , Brahim Fahid2,b and Abdulaziz Shaiea2,c 1: Department of Mathematics, The University of Iowa, Iowa City, IA 52242-1419, USA. [email protected] 2: Department of Mathematics, Faculty of Sciences, Mohammed V University in Rabat, Morocco. a: [email protected]; driss [email protected] b: [email protected] c: [email protected]; [email protected] Abstract. The notion of trivial extension of a ring by a module has been extensively studied and used in ring theory as well as in various other areas of research like cohomology theory, representation theory, category theory and homological algebra. In this paper we extend this classical ring construction by associating a ring to a ring R and a family M = (Mi )ni=1 of n R-modules for a given integer n ≥ 1. We call this new ring construction an n-trivial extension of R by M . In particular, the classical trivial extension will be just the 1-trivial extension. Thus we generalize several known results on the classical trivial extension to the setting of n-trivial extensions and we give some new ones. Various ring-theoretic constructions and properties of n-trivial extensions are studied and a detailed investigation of the graded aspect of n-trivial extensions is also given. We end the paper with an investigation of various divisibily properties of n-trivial extensions. In this context several open questions arise. 2010 Mathematics Subject Classification. primary 13A02, 13A05, 13A15, 13B99, 13E05, 13F05, 13F30; secondary 16S99, 17A99. Key Words. trivial extension; n-trivial extension; graded rings; homogeneous ideal. 2 1 D. D. Anderson et al. Introduction Except for a brief excursion in Section 2, all rings considered in this paper are assumed to be commutative with an identity; in particular, R denotes such a ring, and all modules are assumed to be unitary left modules. Of course left-modules over a commutative ring R are actually Rbimodules with mr := rm. Let Z (resp., N) denotes the set of integers (resp., natural numbers). The set N ∪ {0} will be denoted by N0 . The ring Z/nZ of the residues modulo an integer n ∈ N will be noted by Zn . Recall that the trivial extension of R by an R-module M is the ring denoted by R ⋉ M whose underlying additive group is R⊕M with multiplication given by (r, m)(r ′ , m′ ) = (rr ′ , rm′ +mr ′ ). Since its introduction by Nagata in [40], the trivial extension of rings (also called idealization since it reduces questions about modules to ideals) has been used by many authors and in various contexts in order to produce examples of rings satisfying preassigned conditions (see, for instance, [9] and [38]). It is known that the trivial extension R ⋉ M is related to the following two ring constructions (see for instance [9, Section 2]): Generalized triangular matrix ring. Let R := (Ri )ni=1 be a family of rings and M := (Mi,j )1≤i<j≤n be a family of modules such that for each 1 ≤ i < j ≤ n, Mi,j is an (Ri , Rj )bimodule. Assume for every 1 ≤ i < j < k ≤ n, there exists an (Ri , Rk )-bimodule homomorphism Mi,j ⊗Rj Mj,k −→ Mi,k denoted multiplicatively such that (mi,j mj,k )mk,l = mi,j (mj,k mk,l ) for every (mi,j , mj,k , mk,l ) ∈ Mi,j × Mj,k × Mk,l . Then the set   R1 M1,2 · · · · · · M1,n−1 M1,n  0 R2 ··· ··· M2,n−1 M2,n     ..  .. .. .. .. ..  .  . . . . .    ..  .. .. .. .. ..  .  . . . . .    0 0 ··· 0 Rn−1 Mn−1,n  0 0 ··· 0 0 Rn consisting of matrices  m1,1 m1,2 · · · · · ·  0 m2,2 · · · · · ·   .. .. .. ..  . . . .   .. .. .. ..  . . . .   0 0 ··· 0 0 0 ··· 0 m1,n−1 m2,n−1 .. . .. . mn−1,n−1 0 m1,n m2,n .. . .. . mn−1,n mn,n      , mi,i ∈ Ri and mi,j ∈ Mi,j (1 ≤ i < j ≤ n),     n-Trivial Extensions of Rings 3 with the usual matrix addition and multiplication is a ring called a generalized (or formal) triangular matrix ring and denoted also by Tn (R, M ) (see [16]  and[17]). Then the trivial R M extension R ⋉ M is naturally isomorphic to the subring of consisting of matrices 0 R   r m where r ∈ R and m ∈ M (note that, since R is commutative rm = mr). 0 r Symmetric algebra. Recall that the symmetric algebra associated to M is the graded ring quotient SR (M ) := TR (M )/H where TR (M ) is the graded tensor R-algebra with TRn (M ) = M ⊗n and H is the homogeneous ideal of TR (M ) generated by {m ⊗ n − n ⊗ m|m, n ∈ M }. Note that ∞ n (M ) is a graded R-algebra with S 0 (M ) = R and S 1 (M ) = M and, in general, SR (M ) = ⊕ SR R R n=0 i (M ) is the image of T i (M ) in S (M ). Then R ⋉ M and S (M )/ ⊕ S n (M ) are naturally SR R R R R n≥2 isomorphic as graded R-algebras. It is also worth recalling that when M is a free R-module with a basis B, the trivial extension R ⋉ M is also naturally isomorphic to R[{Xb }b∈B ]/({Xb }b∈B )2 where {Xb }b∈B is a set of indeterminates over R. In particular, R ⋉ R ∼ = R[X]/(X 2 ). Inspired by the facts above, we introduce an extension of the classical trivial extension of rings to extensions associated to n modules for any integer n ≥ 1. In the literature, particular cases of such extensions have been used to solve some open questions. In [10] the authors introduced an extension for n = 2 and they used it to give a counterexample of the so-called Faith conjecture. Also, in the case n = 2, an extension is introduced in [33] to give an example of a ring which has a non-self-injective injective hull with compatible multiplication. This gave a negative answer of a question posed by Osofsky. In [43] the author introduced and studied a particular extension for the case n = 3 to obtain a Galois coverings for the enveloping algebras of trivial extension algebras of triangular algebras. Also, there is a master’s thesis [39] which introduced and studied factorization properties of an extension of the trivial extension of a ring by itself (i.e., self-idealization). In this paper, we introduce the following extension ring construction for an arbitrary integer n ≥ 1. Let M = (Mi )ni=1 be a family of R-modules and ϕ = {ϕi,j } i+j≤n be a family of bilinear 1≤i,j≤n−1 maps such that each ϕi,j is written multiplicatively: ϕi,j : Mi × Mj (mi , mj ) −→ Mi+j 7−→ ϕi,j (mi , mj ) := mi mj . In particular, if all Mi are submodules of the same R-algebra L, then the bilinear maps, if they are not specified, are just the multiplication of L (see examples in Section 2). The n-ϕ-trivial extension of R by M is the set denoted by R ⋉ϕ M1 ⋉ · · · ⋉ Mn or simply R ⋉ϕ M whose 4 D. D. Anderson et al. underlying additive group is R ⊕ M1 ⊕ · · · ⊕ Mn with multiplication given by X (m0 , ..., mn )(m′0 , ..., m′n ) = ( mj m′k ) j+k=i for all (mi ), (m′i ) ∈ R ⋉ϕ M . We could also define the product ϕi,j : Mi × Mj −→ Mi+j as an R-bimodule homomorphism ϕ ei,j : Mi ⊗ Mj −→ Mi+j ; see Section 2 for details. For the sake of simplicity, it is convenient to set M0 = R. In what follows, if no ambiguity arises, the n-ϕ-trivial extension of R by M will be simply called an n-trivial extension of R by M and denoted by R ⋉n M1 ⋉ · · · ⋉ Mn or simply R ⋉n M . While in general R⋉n M need not to be a commutative ring, in Section 2, we give conditions on the maps ϕi,j that force R ⋉n M to be a ring. Unless otherwise stated, we assume the maps ϕi,j have been defined so that R ⋉n M is a commutative associative ring with identity. Thus R ⋉n M is a commutative ring with identity (1, 0, ..., 0). Moreover, R ⋉n M is naturally isomorphic to the subring of the generalized triangular matrix ring   R M1 M2 · · · · · · Mn  0 R M1 ··· Mn−1     .. . . ..  .. .. . . . . .    0 0 0 ··· M1  0 0 0 ··· R consisting of matrices1  r m1 m2 · · · · · · 0 r m1 ···   .. . . . .. .. . . .  0 0 0 ··· 0 0 0 ···  mn mn−1   ..  .   m1  r where r ∈ R and mi ∈ Mi for every i ∈ {1, ..., n}. k (M ), the ring R ⋉ M is naturally isomorphic When, for L every k ∈ {1, ..., n}, Mk = SR 1 n k (M ). In particular, if M = F is a free R-module with a basis B, to SR (M1 )/ k≥n+1 SR 1 1 2 (F ) ⋉ · · · ⋉ S n (F ) is also naturally isomorphic to then the n-trivial extension R ⋉ F ⋉ SR R R[{Xb }b∈B ]/({Xb }b∈B )n+1 where {Xb }b∈B is a set of indeterminates over R. Namely, when F ∼ = R, R ⋉n R ⋉ · · · ⋉ R ∼ = R[X]/(X n+1 ). 1 When R is a field and Mi = R for every i ∈ {1, ..., n}, these matrices are well-known as upper triangular Toeplitz matrices. In [39], the author used the same terminology for such matrices with entries in a commutative ring. n-Trivial Extensions of Rings 5 Also, in [13], the trivial extension of a ring R by an ideal I is connected to the Rees algebra R+ associated to R and I which is precisely the following graded subring of R[t] (where t is an indeterminate over R): M R+ := I n tn . n≥0 Using [13, Lemma 1.2 and Proposition 1.3], we get, similar to [13, Proposition 1.4], the following diagram of extensions and isomorphisms of rings: R // R+ /(I n+1 tn+1 )    // R[t]/(tn+1 ) ∼ = R   // R ⋉n I ⋉ I 2 ⋉ · · · ⋉ I n   ∼ =  // R ⋉n R ⋉ · · · ⋉ R In this paper, we study some properties of the ring R ⋉n M , extending well-known results on the classical trivial extension of rings. The paper is organized as follows. In Section 2, we carefully define the n-trivial extension R ⋉n M giving conditions on the maps ϕi,j so that R ⋉n M is actually a commutative ring with identity. Actually, we investigate the situation in greater generality where R is not assumed to be commutative and Mi is an R-bimodule for i = 1, ..., n. We end the section with a number of examples. In Section 3, we investigate some ring-theoretic constructions of n-trivial extensions. We begin by showing that R ⋉n M may be considered as a graded ring for three different grading monoids, in particular, R ⋉n M may be considered as N0 -graded ring or Zn+1 -graded ring. We then show how R ⋉n M behaves with respect to polynomials (Corollary 3.4) and power series (Theorem 3.5) extensions and localization (Theorem 3.7). In Theorem 3.9, we show that the n-trivial extension of a finite direct product of rings is a finite direct product of n-trivial extensions. We end with two results on inverse limits and direct limits of n-trivial extensions (Theorems 3.10 and 3.11). In Section 4, we present some natural ring homomorphisms related to n-trivial extensions (see Proposition 4.3). Also, we study some basic properties of R ⋉n M . Namely, we extend the characterization of prime and maximal ideals of the classical trivial extension to R ⋉n M (see Theorem 4.7). As a consequence, the nilradical and the Jacobson radical are determined (see Corollary 4.8). Finally, as an extension of [9, Theorems 3.5 and 3.7], the set of zero divisors, the set of units and the set of idempotents of R ⋉n M are also characterized (see Proposition 4.9). In Section 5, we investigate the graded aspect of n-trivial extensions. The motivation behind this study is that, in the classical case (where n = 1), the study of trivial extensions as Z2 -graded rings has lead to some interesting properties (see [9]) and has shed more light on the structure of ideals of the trivial extensions. In Section 5, we extend some of results given in [9] and we 6 D. D. Anderson et al. give some new ones. Namely, among other results, we characterize the homogeneous ideals of R ⋉n M (Theorem 5.1) and we investigate some of their properties (Propositions 5.2 and 5.3). We devote the remainder of Section 5 to investigate the question “When is every ideal of a given class I of ideals of R ⋉n M homogeneous?” (see the discussion after Proposition 5.3). In this context various results and examples are established. Section 6 is devoted to some classical ring-theoretic properties. Namely, we characterize when R ⋉n M is, respectively, Noetherian, Artinian, (Manis) valuation, Prüfer, chained, arithmetical, a π-ring, a generalized ZPI-ring or a PIR. We end the section with a remark on a question posed in [2] concerning m-Boolean rings. Finally, in Section 7 we study divisibility properties of n-trivial extensions. We are mainly interested in showing how one could extend results on the classical trivial extension presented in [9, Section 5] to the context of n-trivial extensions. 2 The general n-trivial extension construction and some examples The purpose of this section is to formally define the n-trivial extension (n ≥ 1) R⋉n M1 ⋉· · ·⋉Mn where R is a commutative ring with identity and each Mi is an R-module, and to give some interesting examples of n-trivial extensions. However, to better understand the construction and the underlying multiplication maps ϕi,j : Mi × Mj −→ Mi+j , we begin in the more general context of R being an associative ring (not necessarily commutative) with identity and the Mi ’s being R-bimodules. Also, as there is a significant difference in the cases n = 1, n = 2 and n ≥ 3, we handle these three cases separately. Let R be an associative ring with identity and M1 ,...,Mn be unitary R-bimodules (in the case where R is commutative we will always assume that rm = mr unless stated otherwise). Case n = 1. R ⋉1 M1 = R ⋉ M1 = R ⊕ M1 is just the trivial extension with multiplication (r, m)(r ′ , m′ ) = (rr ′ , rm′ + mr ′ ). Here R ⋉1 M1 is an associative ring with identity where the associative and distributive laws follow from the ring and R-bimodule axioms. For R commutative, we write (r, m)(r ′ , m′ ) = (rr ′ , rm′ +r ′ m) as r ′ m = mr ′ . Now R⋉1 M1 is an N0 -graded or a Z2 -graded ring i (M ) and to the matrix ring representation isomorphic to TR (M1 )/ ⊕ TRi (M1 ) or SR (M1 )/ ⊕ SR 1 i≥2 i≥2 mentioned in the introduction. Note that we could drop the assumption that R has an identity and M1 is unitary. We then get that R ⋉1 M1 has an identity (namely (1, 0)) if and only if R has an identity and M1 is unitary. n-Trivial Extensions of Rings 7 Case n = 2. Here R ⋉2 M1 ⋉ M2 = R ⊕ M1 ⊕ M2 with coordinate-wise addition and multiplication (r, m1 , m2 )(r ′ , m′1 , m′2 ) = (rr ′ , rm′1 + m1 r ′ , rm′2 + m1 m′1 + m2 r ′ ) where m1 m′1 := ϕ1,1 (m1 , m′1 ) with the map ϕ1,1 : M1 × M1 −→ M2 . We readily see that R ⋉2 M1 ⋉ M2 satisfying the distributive laws is equivalent to ϕ1,1 being additive in each coordinate. Since R is assumed to be associative and M1 and M2 to be R-bimodules, R ⋉2 M1 ⋉ M2 is associative precisely when (rm1 )m′1 = r(m1 m′1 ), (m1 r)m′1 = m1 (rm′1 ), and (m1 m′1 )r = m1 (m′1 r) for r ∈ R and m1 , m′1 ∈ M1 . This is equivalent to ϕ1,1 (rm1 , m′1 ) = rϕ1,1 (m1 , m′1 ), ϕ1,1 (m1 r, m′1 ) = ϕ1,1 (m1 , rm′1 ), and ϕ1,1 (m1 , m′1 )r = ϕ1,1 (m1 , m′1 r). For R-bimodules M , N and L, we call a function f : M × N −→ L a pre-product map if it is additive in each coordinate, is middle linear (i.e., f (mr, m′ ) = f (m, rm′ )) and is left and right homogeneous (i.e., f (rm, m′ ) = rf (m, m′ ) and f (m, m′ r) = f (m, m′ )r). Note that a pre-product map f : M × N −→ L uniquely corresponds to an R-bimodule homomorphism f˜ : M ⊗R N −→ L with f (m, n) = f˜(m ⊗ n). Thus a pre-product map ϕ1,1 : M1 × M1 −→ M2 corresponds to an R-bimodule homomorphism ϕ̃1,1 : M1 ⊗R M1 −→ M2 . So we could equivalently define m1 m′1 := ϕ̃1,1 (m1 ⊗ m′1 ). So R⋉2 M1 ⋉M2 is an (associative) ring with identity precisely when ϕ1,1 is a pre-product map or ϕ̃1,1 : M1 ⊗R M1 −→ M2 is an R-bimodule homomorphism. We can identify R ⋉2 M1 ⋉ M2 with the matrix representation given in the introduction: (r, m1 , m2 ) is identified with   r m1 m2  0 r m1  0 0 r But the relationship with a tensor algebra or symmetric algebra is more difficult. When R ⋉2 M1 ⋉ M2 is an associative ring, we can define a ring epimorphism TR (M1 ⊕ M2 )/ ⊕ TRi (M1 ⊕ M2 ) −→ R ⋉2 M1 ⋉ M2 i≥3 by l l X X ′ ′ i m1,i m′1,i ). (m1,i , m2,i ) ⊗ (m1,i , m2,i )) + ⊕ TR (M1 ⊕ M2 ) 7−→ (r, m1 , m2 + (r, (m1 , m2 ), i=1 i≥3 i=1 i (M ⊕M ) −→ For the commutative case, we get a similar ring epimorphism SR (M1 ⊕M2 )/ ⊕ SR 1 2 i≥3 R ⋉2 M1 ⋉ M2 . For R ⋉2 M1 ⋉ M2 to be a commutative ring with identity we need R to be commutative with identity and m1 m′1 = m′1 m1 for m1 , m′1 ∈ M1 , or ϕ1,1 (m1 , m′1 ) = ϕ1,1 (m′1 , m1 ). Thus for R 8 D. D. Anderson et al. commutative, R ⋉2 M1 ⋉ M2 is a commutative ring if and only if ϕ1,1 is a symmetric R-bilinear map, or equivalently, ϕ̃1,1 (m1 ⊗ m′1 ) = ϕ̃1,1 (m′1 ⊗ m1 ). Case n ≥ 3. Here again R is an associative ring with identity and M1 ,...,Mn (n ≥ 3) are R-bimodules. So R ⋉n M1 ⋉ · · · ⋉ Mn = R ⊕ M1 ⊕ · · · ⊕ Mn with coordinate-wise addition. Assume we have pre-product maps ϕi,j : Mi × Mj −→ Mi+j , or equivalently, the corresponding R-bimodule homomorphism ϕ̃i,j : Mi ⊗R Mj −→ Mi+j for 1 ≤ i, j ≤ n − 1 with i + j ≤ n. As usual set mi mj := ϕi,j (mi , mj ) = ϕ̃i,j (mi ⊗ mj ) for mi ∈ Mi and mj ∈ Mj . Setting R = M0 , we can write the in R⋉n M1 ⋉· · ·⋉Mn P multiplication mj m′k . Then R ⋉n M1 ⋉ · · · ⋉ Mn as (m0 , ..., mn )(m′0 , ..., m′n ) = (m′′0 , ..., m′′n ) where m′′i = j+k=i satisfies the distributive laws because the maps ϕi,j are additive in each coordinate. So R ⋉n M1 ⋉ · · · ⋉ Mn is a not necessarily associative ring with identity (1, 0, ..., 0) (see Example 2.2 for a case where R ⋉n M1 ⋉ · · · ⋉ Mn is not associative). Note that R ⋉n M1 ⋉ · · · ⋉ Mn is associative precisely when (mi mj )mk = mi (mj mk ) for mi ∈ Mi , mj ∈ Mj and mk ∈ Mk with 1 ≤ i, j, k ≤ n − 2 and i + j + k ≤ n. In terms of the pre-product maps, this says that ϕi+j,k (ϕi,j (mi , mj ), mk ) = ϕi,j+k (mi , ϕj,k (mj , mk )), or equivalently, ϕ ei+j,k ◦ (ϕ ei,j ⊗ idMk ) = ϕ ei,j+k ◦ (idMi ⊗ ϕ ej,k ) where idMl is the identity map on Ml for l ∈ {1, ..., n}. In other words, the diagram below commutes: idMi ⊗ϕ ej,k Mi ⊗ Mj ⊗ Mk // Mi ⊗ Mj+k ϕ ei,j ⊗idMk ϕ ei,j+k  Mi+j ⊗ Mk Let us call a family {ϕi,j } i+j≤n 1≤i,j≤n−1 ϕ ei+j,k (or {ϕ ei,j } i+j≤n //  Mi+j+k ) of pre-product maps satisfying the pre- 1≤i,j≤n−1 viously stated associativity condition a family of product maps. So, when {ϕi,j } equivalently {ϕ ei,j } i+j≤n 1≤i,j≤n−1 i+j≤n (or 1≤i,j≤n−1 ) is a family of product maps, R ⋉n M1 ⋉ · · · ⋉ Mn is an associative ring with identity. Further, for R ⋉n M1 ⋉ · · · ⋉ Mn to be a commutative ring with identity we need R to be commutative with identity and ϕi,j (mi , mj ) = ϕj,i (mj , mi ) for every 1 ≤ i, j ≤ n−1 with i + j ≤ n, or equivalently, ϕ ei,j = ϕ ej,i ◦ τi,j where τi,j : Mi ⊗ Mj → Mj ⊗ Mi is the ‘flip’ map defined by τi,j (mi ⊗ mj ) = mj ⊗ mi for every mi ⊗ mj ∈ Mi ⊗ Mj . In other words, the diagram n-Trivial Extensions of Rings 9 below commutes: ϕ ei,j // Mi+j t99 t t tt tt ϕej,i t t Mi ⊗ Mj τi,j  Mj ⊗ Mi In this case, the family {ϕi,j } i+j≤n 1≤i,j≤n−1 (or {ϕ ei,j } ) will be called a family of commutative i+j≤n 1≤i,j≤n−1 product maps. So, when R is commutative and {ϕi,j } i+j≤n 1≤i,j≤n−1 (or equivalently {ϕ ei,j } i+j≤n ) is 1≤i,j≤n−1 a family of commutative product maps, R ⋉n M1 ⋉ · · · ⋉ Mn is a commutative ring with identity. As in the case n = 2, when R ⋉n M1 ⋉ · · · ⋉ Mn is an (associative) ring with identity, we can identify R ⋉n M1 ⋉ · · · ⋉ Mn with the matrix representation given in the introduction: (r, m1 , ..., mn ) is identified with  r m1 m2 · · · · · · 0 r m1 ···   .. . . . .. .. . . .  0 0 0 ··· 0 0 0 ···  mn mn−1   ..  .   m1  r Also, as in the case n = 2, when R ⋉n M1 ⋉ · · · ⋉ Mn is an associative ring, we can define a ring epimorphism TR (M1 ⊕ · · · ⊕ Mn )/ ⊕ TRi (M1 ⊕ · · · ⊕ Mn ) −→ R ⋉n M1 ⋉ · · · ⋉ Mn and we have i≥n+1 a similar result concerning the symmetric algebra when R ⋉n M1 ⋉ · · · ⋉ Mn is commutative. Remark 2.1 1. Let R1 and R2 be two rings and H an (R1 , R2 )-bimodule. It is well-known that every generalized triangular matrix ring is naturally isomorphic to the trivial extension of R1 × R2 by H where the actions of R1 × R2 on H are defined as follows: (r1 , r2 )h = r1 h and h(r1 , r2 ) = hr2 for every (r1 , r2 ) ∈ R1 × R2 and h ∈ H. Below we see that an observation on the product of two matrices of the generalized triangular matrix ring shows that this fact can be extended to n-trivial extensions. Consider the generalized triangular matrix ring   R1 M1,2 · · · · · · M1,n−1 M1,n  0 R2 ··· ··· M2,n−1 M2,n     ..  .. .. .. .. ..  .  . . . . .  Tn (R, M ) =   ..  . . .. .. .. .. ..  .  . . .    0 0 ··· 0 Rn−1 Mn−1,n  0 0 ··· 0 0 Rn 10 D. D. Anderson et al. where (Ri )ni=1 is a family of rings and (Mi,j )1≤i<j≤n is a family of modules such that for each 1 ≤ i < j ≤ n, Mi,j is an (Ri , Rj )-bimodule. Assume, for every 1 ≤ i < j < k ≤ n, there exists an (Ri , Rk )-bimodule homomorphism Mi,j ⊗Rj Mj,k −→ Mi,k denoted multiplicatively such that (mi,j mj,k )mk,l = mi,j (mj,k mk,l ) for every (mi,j , mj,k , mk,l ) ∈ Mi,j × Mj,k × Mk,l . Consider the finite direct product of rings R = R1 × · · · × Rn and set, for 2 ≤ i ≤ n, Mi = M1,i × M2,i+1 × · · · × Mn−(i−1),n (for i = n, Mn = M1,n ). We need to define an action of R on each Mi and a family of product maps so that R ⋉n−1 M2 ⋉ · · · ⋉ Mn is an n − 1-trivial extension isomorphic to Tn (R, M ). First, note that, for every matrix A = (ai,j ) of Tn (R, M ) and for every 2 ≤ i ≤ n, the i-th diagonal above the main diagonal of A naturally corresponds to the following (n − i + 1)tuple (a1,i , a2,i+1 , ..., an−(i−1),n ) of Mi . On the other hand, consider two matrices A = (ai,j ) and B = (bi,j ) of Tn (R, M ), and denote the product AB by C = (ci,j ). Then using the above correspondence for 2 ≤ i ≤ n, the i-th diagonal above the main diagonal of C can be seen as the (n − i + 1)-tuple ci = (cj,i+j−1)j ∈ Mi such that, for every 1 ≤ j ≤ n − i + 1, i+j−1 P aj,k bk,i+j−1 cj,i+j−1 = k=j i P = aj,k+j−1bk+j−1,i+j−1 . k=1 Then ci = ( = i P aj,k+j−1bk+j−1,i+j−1)j k=1 i P (aj,k+j−1 bk+j−1,i+j−1)j . k=1 Thus the cases k = 1 and k = i allow us to define the left and right actions of R on Mi as follows: For every (rl )l ∈ R and (mj,i+j−1 )j ∈ Mi , (rl )l (mj,i+j−1 )j := (rj mj,i+j−1)j and (mj,i+j−1)j (rl )l := (mj,i+j−1 ri+j−1 )j . n-Trivial Extensions of Rings 11 The other cases of k can be used to define the product maps Mk × Mi−k −→ Mi as follows: Fix k, 1 < k < i, and consider ek = (ej,k+j−1 )1≤j≤n−k+1 ∈ Mk and fi−k = (fj,i−k+j−1)1≤j≤n−i+k+1 ∈ Mi−k . Then ek fi−k := (ej,k+j−1fk+j−1,i+j−1)1≤j≤n−i+1 . Therefore, endowed with these products, R ⋉n−1 M2 ⋉ · · · ⋉ Mn is an n − 1-trivial extension naturally isomorphic to the generalized triangular matrix ring Tn (R, M ). 2. It is known that the generalized triangular matrix ring Tn (R, M ) can be seen as a generalized triangular 2 × 2 matrix ring2 . Namely, there is a natural ring isomorphism between Tn (R, M ) and T2 (S, N ) where n−1 S = (Tn−1 ((Ri )i=1 , (Mi,j )1≤i<j≤n−1 ), Rn ) and    N =  M1,n M2,n .. . Mn−1,n      However, an n-trivial extension is not necessarily a 1-trival extension. For that consider, for instance, the 2-trivial extension S = Z/2Z ⋉2 Z/2Z ⋉ Z/2Z. One can check easily that S cannot be isomorphic to any 1-trival extension. We end this section with a number of examples. Example 2.2 Suppose that R is a commutative ring and consider R ⋉n R ⋉ · · · ⋉ R (n ≥ 1) with a family of product maps ϕi,j : Rei × Rej −→ Rei+j where, for k ∈ {1, ..., n}, ek = (0, ..., 0, 1, 0, ..., 0) with 1 in the k + 1’th place. ∼ R[X]/(X 2 ). For n = 1, R ⋉1 R = Suppose, n = 2 and e21 = r1,1 e2 . Then R ⋉2 R ⋉ R ∼ = R[X, Y ]/(X 2 − r1,1 Y, XY, Y 2 ) where X and Y are commuting indeterminates. So in the case where r1,1 = 1, we get R ⋉2 R ⋉ R ∼ = R[X, Y ]/(X 2 − Y, XY, Y 2 ) ∼ = R[X]/(X 3 ). The case n = 3 is more interesting. Now, for 1 ≤ i, j ≤ 2 with i + j ≤ 3, ϕi,j : R × R −→ R with ϕi,j (r, s) = rϕi,j (1, 1)s. Put ϕi,j (1, 1) = ri,j ; so (rei )(sej ) = rri,j sei+j . Now, R⋉3 R⋉R⋉R is commutative if and only if e1 e2 = e2 e1 or r1,2 = r2,1 . And R ⋉3 R ⋉ R ⋉ R is associative if and only if (e1 e1 )e1 = e1 (e1 e1 ) or r1,1 r2,1 = r1,2 r1,1 . Thus if R ⋉3 R ⋉ R ⋉ R is commutative, it is also associative. However, if R is a commutative integral domain and r1,1 6= 0, R ⋉3 R ⋉ R ⋉ R 2 We are indebted to J. R. Garcı́a Rozas (Universidad de Almerı́a, Spain) who pointed out this remark. 12 D. D. Anderson et al. is associative if and only if it is commutative. Thus if we take R = Z, r1,1 = 1, r1,2 = 1 and r2,1 = 2, R ⋉3 R ⋉ R ⋉ R is a non-commutative and non-associative ring. For n = 4, the reader can easily check that R ⋉4 R ⋉ R ⋉ R ⋉ R is commutative if and only if ri,j = rj,i for 1 ≤ i, j ≤ 3 with i + j ≤ 4, and that R ⋉4 R ⋉ R ⋉ R ⋉ R is associative if and only if r1,1 r2,1 = r1,2 r1,1 , r2,1 r3,1 = r2,2 r1,1 , r1,2 r3,1 = r1,3 r2,1 , and r1,1 r2,2 = r1,3 r1,2 . Thus if R is a commutative integral domain with r1,1 6= 0, then r1,1 r2,1 = r1,2 r1,1 if and only if r2,1 = r1,2 . So if r1,1 6= 0 and r1,2 6= 0, then r1,2 r3,1 = r1,3 r2,1 if and only if r3,1 = r1,3 . Thus if r1,1 6= 0 and r1,2 6= 0, then R ⋉4 R ⋉ R ⋉ R ⋉ R is associative forces R ⋉4 R ⋉ R ⋉ R ⋉ R to be commutative and in this case R ⋉4 R ⋉ R ⋉ R ⋉ R is associative if and only if r1,1 r2,2 = r1,3 r1,2 . Thus if three of the numbers r1,1 , r2,2 , r1,3 and r1,2 are given and nonzero, then there is only one possible choice for the remaining ri,j for R ⋉4 R ⋉ R ⋉ R ⋉ R to be associative. If we take R = Z and r1,1 = 1, r2,1 = r1,2 = 2, r2,2 = 3 and r1,3 = r3,1 = 4, then the resulting ring is commutative but not associative. For n ≥ 5, the reader can easily write conditions on the ri,j = ϕi,j (1, 1) for R ⋉n R ⋉ · · · ⋉ R to be commutative or associative. Example 2.3 Let R be a commutative ring and N1 ,...,Nn be R-submodules of an R-algebra T with Ni Nj ⊆ Ni+j for 1 ≤ i, j ≤ n − 1 with i + j ≤ n. Then, using the multiplication from T , R ⋉n N1 ⋉ · · · ⋉ Nn is a ring which is commutative if T is commutative. The following are some interesting special cases: (a) Let R be a commutative ring and I an ideal of R. Then R ⋉n I ⋉ I 2 ⋉ · · · ⋉ I n is the quotient of the Rees ring R[It]/(I n+1 tn+1 ) mentioned in the introduction. (b) Let R be a commutative ring, T an R-algebra and J1 ⊆ · · · ⊆ Jn ideals of T . Then R ⋉n J1 ⋉ · · · ⋉ Jn is an example of n-trivial extension since Ji Jj ⊆ Ji ⊆ Ji+j for i + j ≤ n. For example, we could take R ⋉2 XR[X] ⋉ R[X]. (c) Suppose that R1 ⊆ · · · ⊆ Rn are R-algebras where R is a commutative ring. Let N be an Rn−1 -submodule of Rn (in particular, we could take N = Rn ). Then R ⋉n R1 ⋉ · · · ⋉ Rn−1 ⋉ N with the multiplication induced by Rn is a ring. For example, we could take Z ⋉3 Q ⋉ R ⋉ N where N is the R-submodule of R[X] of polynomials of degree ≤ 5. Example 2.4 Let R be a commutative ring and M an R-module. Let S := R⋉n R⋉· · ·⋉R⋉M with ϕi,j : R × R −→ R the usual ring product in R for i + j ≤ n − 1, but, for i + j = n and i, j ≥ 1, ϕi,j is the zero map. So ′ ′ (r0 , ..., rn−1 , mn )(r0′ , ..., rn−1 , m′n ) = (r0 r0′ , r0 r1′ + r1 r0′ , ..., r0 rn−1 + · · · + rn−1 r0′ , r0 m′n + r0′ mn ). Then S ∼ = R[X]/(X n ) ⋉ M where M is considered as an R[X]/(X n )-module with f (X)m = f (0)m. n-Trivial Extensions of Rings 13 Example 2.5 Let R be a commutative ring and T an R-algebra. Let J1 ⊆ · · · ⊆ Jn be ideals of T . Then take R ⋉n T /J1 ⋉ · · · ⋉ T /Jn where the product T /Ji × T /Jj −→ T /Ji+j is given by (ti + Ji )(tj + Jj ) = ti tj + Ji+j for i + j ≤ n. Example 2.6 Let R be a commutative ring, N1 ,..., Nn−1 ideals of R and Nn = Ra a cyclic R-module. Then consider R ⋉n N1 ⋉ · · · ⋉ Nn where the products Ni × Nj −→ Ni+j are the usual products for R when i + j ≤ n − 1, and for i + j = n define ni nj = ni nj a. In what follows we adopt the following notation. Notation. Unless specified otherwise, R denotes a non-trivial ring and, for an integer n ≥ 1, M = (Mi )ni=1 is a family of R-modules with bilinear maps as indicated in the definition of the n-trivial extension defined so that R ⋉n M is a commutative associative ring with identity. So R ⋉n M is indeed a commutative ring with identity. Let S be a nonempty subset of R and N = (Ni )ni=1 be a family of sets such that, for every i, Ni ⊆ Mi . Then as a subset of R ⋉n M , S × N1 × · · · × Nn will be denoted by S ⋉n N1 ⋉ · · · ⋉ Nn or simply S ⋉n N . 3 Some ring-theoretic constructions of n-trivial extensions In this section we investigate some ring-theoretic constructions of n-trivial extensions. First we investigate the graded aspect of n-trivial extensions. For the convenience of the reader we recall the definition of graded rings. Let Γ be a commutative additive monoid. Recall that a ring S is said to be a Γ-graded ring, if there is a family of subgroups of S, (Sα )α∈Γ , such that S = ⊕ Sα as an abelian group, with Sα Sβ ⊆ Sα+β for all α∈Γ α, β ∈ Γ. And an S-module N is said to be Γ-graded if N = ⊕ Nα (as an abelian group) and α∈Γ Sα Nβ ⊆ Nα+β for all α, β ∈ Γ. Note that S0 is a subring of S and each Nα is an S0 -module. When Γ = N0 , a Γ-graded ring (resp., a Γ-graded module) will simply be called a graded ring (resp., a graded module). See, for instance, [41] and [42] for more details about graded rings although [41] deals with group graded rings. Now, R ⋉n M1 ⋉ · · · ⋉ Mn = R ⊕ M1 ⊕ · · · ⊕ Mn may be considered as a graded ring for the following three different grading monoids: As an N0 -graded ring. In this case we set Mk = 0 for all k ≥ n + 1 and we extend the definition of ϕi,j to all i, j ≥ 0 as follows: For i or j = 0, ϕ0,j : R × Mj (r, mj ) −→ Mj ϕ : Mi × R −→ Mi and i,0 7−→ ϕ0,j (r, mj ) := rmj (mi , r) 7−→ ϕi,0 (mi , r) := mi r 14 D. D. Anderson et al. are just the multiplication of R when i = j = 0 or the R-actions on Mj and Mi respectively when j > 0 and i > 0 rerspectively. For i, j ≥ 0 such that i + j ≥ n + 1, we define ϕi,j : Mi × Mj −→ Mi+j by ϕi,j (mi , mj ) = 0 for all (mi , mj ) ∈ Mi × Mj . Thus R ⋉n M1 ⋉ · · · ⋉ Mn ∞ is an N0 -graded ring ⊕ Ri where R0 = R and Ri = Mi for i ∈ N. i=0 As a Zn+1 -graded ring. In this case we consider, for a ∈ Z, the least nonnegative integer b a with b a ≡ a mod(n + 1), and we set Ma := Mba . Then for a, b ∈ Z, we define maps ϕa,b : Ma × M −→ M by ϕ = ϕ b when b a + bb ≤ n and ϕ to be the zero map when b a + bb > n. b a+b a,b b a,b a,b Then R ⋉n M1 ⋉ · · · ⋉ Mn is a Zn+1 -graded ring R0 ⊕ R1 ⊕ · · · ⊕ Rn where R0 = R and Ra = Ma for a = 1, ..., n. As a Γn+1 -graded ring. Here Γn+1 = {0, 1, ..., n} is a commutative monoid with addition b := i + j if i + j ≤ n and i+j b := 0 if i + j > n (so Z2 and Γ2 are isomorphic). In this i+j b 6= 0 and case, we define maps ϕ bi,j , for i, j ∈ Γn+1 , by ϕ bi,j = ϕi,j when i = j = 0 or i+j b = 0. Then R ⋉n M1 ⋉ · · · ⋉ Mn is a ϕ bi,j : Mi × Mj −→ M0 = R to be the zero map when i+j Γn+1 -graded ring R0 ⊕ R1 ⊕ · · · ⊕ Rn where R0 = R and Ri = Mi for 1 ≤ i ≤ n. Note that each of these gradings have the same set of homogeneous elements. ∞ We have observed that R ⋉n M1 ⋉ · · · ⋉ Mn is an N0 -graded ring ⊕ Ri where R0 = R, Ri = Mi i=0 for i = 1, ..., n and Ri = 0 for i > n. So R ⋉n M1 ⋉ · · · ⋉ Mn is a graded ring isomorphic to ∞ ⊕ Ri / ⊕ Ri . The following result presents the converse implication. Namely, it shows that i=0 i≥n+1 the n-trivial extensions can be realised as quotients of graded rings. ∞ Proposition 3.1 Let ⊕ Si be an N0 -graded ring and m ∈ N. Then S0 ⋉m S1 ⋉ · · · ⋉ Sm with i=0 ∞ ∞ i=0 i=0 the product induced by ⊕ Si is naturally an N0 -graded ring isomorphic to ⊕ Si / ⊕ i≥m+1 Si . Proof. Obvious. The following result presents a particular case of Proposition 3.1. Proposition 3.2 For an R-module N , we have the following two natural ring isomorphisms: TR (N )/ SR (N )/ ⊕ TRi (N ) ∼ = R ⋉n N ⋉ TR2 (N ) ⋉ · · · ⋉ TRn (N ), and i≥n+1 i (N ) ∼ R ⋉ N ⋉ S 2 (N ) ⋉ · · · ⋉ S n (N ). ⊕ SR = n R R i≥n+1 2 (N )⋉· · ·⋉S n (N ) Moreover, suppose that N is a free R-module with a basis B, then R⋉n N ⋉SR R n+1 is (graded) isomorphic to R[{Xb }b∈B ]/({Xb }b∈B ) . In particular, R ⋉n R ⋉ · · · ⋉ R with the natural maps is isomorphic to R[X]/(X n+1 ). Proof. Obvious. n-Trivial Extensions of Rings 15 Our next result shows that the n-trivial extension of a graded ring by graded modules has a natural grading. It is an extension of [9, Theorem 4.5]. Theorem 3.3 Let Γ be a commutative additive monoid. Assume that R = ⊕ Ri is Γ-graded α∈Γ and Mi = ⊕ Mαi is Γ-graded as an R-module for every i ∈ {1, ..., n}, such that ϕi,j (Mαi , Mβj ) ⊆ α∈Γ i+j Mα+β . Then R ⋉n M1 ⋉ · · · ⋉ Mn is a Γ-graded ring with (R ⋉n M1 ⋉ · · · ⋉ Mn )α = Rα ⊕ Mα1 ⊕ · · · ⊕ Mαn . Proof. Similar to the proof of [9, Theorem 4.5]. In the case where R is either a polynomial ring or a Laurent polynomial ring we get the following result in which the first assertion is an extension of [9, Corollary 4.6 (1)]. Corollary 3.4 The following statements are true. 1. (R ⋉n M1 ⋉ · · · ⋉ Mn )[{Xα }] ∼ = R[{Xα }] ⋉n M1 [{Xα }] ⋉ · · · ⋉ Mn [{Xα }] for any set of indeterminates {Xα } over R. 2. (R ⋉n M1 ⋉ · · · ⋉ Mn )[{Xα±1 }] ∼ = R[{Xα±1 }] ⋉n M1 [{Xα±1 }] ⋉ · · · ⋉ Mn [{Xα±1 }] for any set of indeterminates {Xα } over R. Also, as in the classical case, we get the related (but not graded) power series case. It is a generalization of [9, Corollary 4.6 (2)]. First recall that, for a given set of analytic indeterminates {Xα }α∈Λ over R, we can consider three types of power series rings (see [44] for further details about generalized power series rings): R[[{Xα }α∈Λ ]]1 ⊆ R[[{Xα }α∈Λ ]]2 ⊆ R[[{Xα }α∈Λ ]]3 . Here R[[{Xα }α∈Λ ]]1 = ∪{R[[{X α1 , ..., Xαn }]]|{α1 , ..., αn } ⊆ Λ}, P R[[{Xα }α∈Λ ]]2 = {P∞ f i=0 i |fi ∈ R[{Xα }α∈Λ ] is homogeneous of degree i} and ∞ R[[{Xα }α∈Λ ]]3 = { i=0 fi |fi is a possibly inf inite sum of monomials of degree i with at most one monomial of the f orm rα1 ,...,αn Xαi11 · · · Xαinn f or each set {α1 , ..., αn } with i1 + · · · + in = i}. More generally, given a partially ordered additive monoid (S, +, ≤), the generalized power P s ≤ as X where supp(f ) = {s ∈ S|as 6= 0} series ring R[[X, S ]] consists of all formal sums f = s∈S is Artinian and narrow (i.e., has no infinite family of incomparable elements) where addition and multiplication are carried out in the usual way. If Λ is a well-ordered set, S = ⊕ N0 and λ∈Λ ∼ R[[{Xα }]]3 . ≤ is the reverse lexicographic order on S, then R[[X, S ≤ ]] = Note, that in a similar manner we can define three types of power series over a module. The routine proof of the following theorem is left to the reader. 16 D. D. Anderson et al. Theorem 3.5 1, 2, 3, 1. Let {Xα }α∈Λ be a set of analytic indeterminates over R. Then, for i = (R⋉n ⋉M1 ⋉· · ·⋉Mn )[[{Xα }α∈Λ ]]i ∼ = R[[{Xα }α∈Λ ]]i ⋉n M1 [[{Xα }α∈Λ ]]i ⋉· · ·⋉Mn [[{Xα }α∈Λ ]]i . 2. Let (S, +, ≤) be a partially ordered additive monoid. Then (R ⋉n ⋉M1 ⋉ · · · ⋉ Mn )[[X, S ≤ ]] ∼ = R[[X, S ≤ ]] ⋉n M1 [[X, S ≤ ]] ⋉ · · · ⋉ Mn [[X, S ≤ ]]. Now, we give, as an extension of [9, Theorem 4.1], the following result which investigates the localization of an n-trivial extension. For this we need the following technical lemma. Lemma 3.6 For every (mi ) ∈ R ⋉n M and every k ∈ {1, ..., n}, (m0 , 0, ..., 0, mk , mk+1 , ..., mn )(m0 , 0, ..., 0, −mk , 0, ..., 0) = (m20 , 0, ..., 0, ek+1 , ..., en ) where el = m0 ml − mk ml−k for every l ∈ {k + 1, ..., n}. Consequently, there is an element (fi ) of R ⋉n M , such that n (mi )(fi ) = (m20 , 0, ..., 0). n We will denote the element (fi ) in Lemma 3.6 by (f mi ) so (mi )(f mi ) = (m20 , 0, ..., 0). Theorem 3.7 Let S be a multiplicatively closed subset of R and N = (Ni ) be a family of Rmodules where Ni is a submodule of Mi for each i ∈ {1, ..., n} and Ni Nj ⊆ Ni+j for every 1 ≤ i, j ≤ n − 1 and i + j ≤ n. Then the set S ⋉n N is a multiplicatively closed subset of R ⋉n M and we have a ring isomorphism (R ⋉n M )S⋉n N ∼ = RS ⋉n MS where MS = (MiS ). Proof. It is trivial to show that S ⋉n N is a multiplicatively closed subset of R ⋉n M . Now in order to show the desired isomorphism, we need to make, as done in the proof of [9, Theorem 4.1 (1)], the following observation: Let (mi ) ∈ R ⋉n M and (si ) ∈ S ⋉n N . Then using the notation of Lemma 3.6, (mi )(sei ) (m′i ) (mi ) = = (si ) (S0 , 0, ..., 0) (S0 , 0, ..., 0) n where (m′i ) = (mi )(sei ) and S0 = s20 . Then the map f : (R ⋉n M )S⋉n N (mi ) (si ) is the desired isomorphism. −→ RS ⋉n MS ′ m′ m′ n 7−→ ( S00 , S01 , ..., m S0 ) n-Trivial Extensions of Rings 17 As a simple but important particular case of Theorem 3.7, we get the following result which extends [9, Theorem 4.1 and Corollary 4.7]. In Theorem 4.7, we will show that if P is a prime ideal of R, then P ⋉n M is a prime ideal of R ⋉n M . This fact is used in the next result to show that the localization of an n-trivial extension at a prime ideal is isomorphic to an n-trivial extension. In what follows, we use T (A) to denote the total quotient ring of a ring A. In Proposition 4.9, we will prove that S ⋉n M , where S = R − (Z(R) ∪ Z(M1 ) ∪ · · · ∪ Z(Mn )), is the set of all regular elements of R ⋉n M . Thus T (R ⋉n M ) = (R ⋉n M )S⋉n M . Corollary 3.8 The following assertions are true. 1. Let P be a prime ideal of R. Then we have a ring isomorphism (R ⋉n M )P ⋉n M ∼ = RP ⋉n MP where MP = (MiP ). 2. We have a ring isomorphism T (R ⋉n M ) ∼ = RS ⋉n MS where S = R − (Z(R) ∪ Z(M1 ) ∪ · · · ∪ Z(Mn )). 3. For an indeterminate X over R, we have a ring isomorphism (R ⋉n M1 ⋉ · · · ⋉ Mn )(X) ∼ = R(X) ⋉n M1 (X) ⋉ · · · ⋉ Mn (X). Proof. All the proofs are similar to the corresponding ones for the classical case. Our next result generalizes [9, Theorem 4.4]. It shows that the n-trivial extension of a finite direct product of rings is a finite direct product of n-trivial extensions. For the reader’s convenience we recall here some known facts on the structure of modules over a finite direct product s Y Ri be a finite direct product of rings where s ∈ N. For j ∈ {1, ..., s}, we set of rings. Let R = i=1 R̄j := 0 × · · · × 0 × Rj × 0 × · · · × 0 and, for an R-module N , Nj := R̄j N . Then Nj is a submodule of N and we have N = N1 ⊕ · · · ⊕ Ns . Namely, every element x in N can be written in the form x = x1 + · · · + xs where xj = ej x ∈ Nj for every j ∈ {1, ..., s} (here ej = (0, ..., 0, 1, 0, ..., 0) with 1 in the j’th place). Note that each Nj is also an Rj -module and N1 × · · · × Ns is an R-module ismorphic to N via the following R-isomorphism: −→ N1 × · · · × Ns P N ej x = x 7−→ (e1 x1 , ..., es xs ) and N1 × · · · × Ns −→ P N (y1 , ..., ys ) 7−→ yj 18 D. D. Anderson et al. Now, consider the family of commutative product maps ϕ = {ϕi,j } i+j≤n and define the 1≤i,j≤n−1 following maps: ϕj,i,k : Mj,i × Mj,k −→ Mj,i+k (mj,i , mj,k ) 7−→ ϕj,i,k (mj,i , mj,k ) = ej ϕi,k (mj,i , mj,k ) where Mj,i := R̄j Mi for j ∈ {1, ..., s} and i ∈ {1, ..., n}. It is easily checked that, for every j ∈ {1, ..., s}, ϕj = {ϕj,i,k } i+k≤n is a family of commutative product maps and Rj ⋉ϕj Mj,1 ⋉ 1≤i,k≤n · · · ⋉ Mj,n is a n-ϕj -trivial extension. Furthermore, ϕi,k : Mi × Mk −→ Mi+k (mi , mk ) 7−→ ϕi,k (mi , mk ) = s P ϕj,i,k (mj,i , mj,k ). j=1 With this notation in mind, we are ready to give the desired result. Theorem 3.9 Let R = s Y i=1 Ri be a finite direct product of rings where s ∈ N. Then R ⋉ϕ M1 ⋉ · · · ⋉ Mn ∼ = (R1 ⋉ϕ1 M1,1 ⋉ · · · ⋉ M1,n ) × · · · × (Rs ⋉ϕs Ms,1 ⋉ · · · ⋉ Ms,n ). Proof. It is easily checked that the map (r, m1 , ..., mn ) 7−→ ((rj , mj,1 , ..., mj,n ))1≤j≤s is an isomorphism. We end this section with two results which investigate the inverse limit and direct limit of a system of n-trivial extensions. Namely, we show that, under some conditions, the inverse limit or direct limit of a system of n-trivial extensions is isomorphic to an n-trivial extension. The inverse limit case is a generalization of [9, Theorem 4.11]. Let Γ be a directed set and {Mα ; fαβ } be an inverse system of abelian groups over Γ (so for α ≤ β, fαβ : Mβ → Mα ). We know that the inverse limit limMα is isomorphic to the following ←− Q subset of the direct product Mα : α M∞ := {(xα )α∈Γ |λ ≤ µ ⇒ xλ = fλµ (xµ )}. In the next result, by limMα we mean exactly the set M∞ . ←− Theorem 3.10 Let Γ be a directed set and n ≥ 1 be an integer. Consider a family of inverse systems {Mi,α ; fi,α,β } over Γ (for i ∈ {0, ..., n}) which satisfy the following conditions: 1. For every α ∈ Γ, M0,α = Rα is a ring, n-Trivial Extensions of Rings 19 2. For every α ∈ Γ and every i ∈ {1, ..., n}, Mi,α is an Rα -module, and 3. For every α ∈ Γ, Rα ⋉n M1,α ⋉ · · · ⋉ Mn,α is an n-trivial extension with a family of commutative product maps: ϕi,j,α : Mi,α × Mj,α −→ Mi+j,α which satisfy, for every α ≤ β, ϕi,j,α (fi,α,β (mi,β ), fj,α,β (mj,β )) = fi+j,α,β (ϕi,j,β (mi,β , mj,β )). Then limRα ⋉n limM1,α ⋉ · · · ⋉ limMn,α is an n-trivial extension with the following family of ←− ←− ←− well-defined commutative product maps: ϕi,j,α : limMi,α × limMj,α → ←− ←− ((mi,α )α , (mj,α )α ) limMi+j,α ←− 7→ (ϕi,j,α (mi,α , mj,α ))α . Moreover, there is a natural ring ismorphism: lim(Rα ⋉n M1,α ⋉ · · · ⋉ Mn,α ) ∼ = limRα ⋉n limM1,α ⋉ · · · ⋉ limMn,α . ←− ←− ←− ←− Proof. The result follows using a standard argument. Let Γ be a directed set and {Mγ ; fγλ } a direct system of abelian groups over Γ (so for γ ≤ λ, fγλ : Mγ → Mλ ). We know that the direct limit lim Mγ is isomorphic to ⊕Mγ /S where S is −→ γ generated by all elements λβ (fαβ (aα )) − λα (aα ) where α ≤ β and λλ : Mλ −→ ⊕Mγ is the γ natural inclusion map for λ ∈ Γ. Since Γ is directed, every element of ⊕Mγ /S has the form γ λα (aα ) + S for some α ∈ Γ and aα ∈ Mα . Theorem 3.11 Let Γ be a directed set and n ≥ 1 be an integer. Consider a family of direct systems {Mi,α ; fi,α,β } over Γ (for i ∈ {0, ..., n}) which satisfy the following conditions: 1. For every α ∈ Γ, M0,α = Rα is a ring, 2. For every α ∈ Γ and every i ∈ {1, ..., n}, Mi,α is an Rα -module, and 3. For every α ∈ Γ, Rα ⋉n M1,α ⋉ · · · ⋉ Mn,α is an n-trivial extension with a family of commutative product maps: ϕi,j,α : Mi,α × Mj,α −→ Mi+j,α which satisfy, for every β ≤ α, ϕi,j,α (fi,β,α(mi,β ), fj,β,α (mj,β )) = fi+j,β,α(ϕi,j,β (mi,β , mj,β )). 20 D. D. Anderson et al. Then limRα ⋉n limM1,α ⋉ · · · ⋉ limMn,α is an n-trivial extension with the following family of −→ −→ −→ well-defined commutative product maps: ϕi,j,α : limMi,α × limMj,α → −→ −→ ((mi,α )α , (mj,α )α ) limMi+j,α −→ 7→ (ϕi,j,α (mi,α , mj,α ))α . Moreover, there is a natural ring ismorphism: lim(Rα ⋉n M1,α ⋉ · · · ⋉ Mn,α ) ∼ = limRα ⋉n limM1,α ⋉ · · · ⋉ limMn,α . −→ −→ −→ −→ Proof. The result follows using a standard argument. 4 Some basic algebraic properties of R ⋉n M In this section we give some basic properties of n-trivial extensions. Before giving the first result, we make the following observations on situations where a subfamily of M is trivial. Observation 4.1 1. If there is an integer i ∈ {1, ..., n − 1} such that Mj = 0 for every j ∈ {i + 1, ..., n}, then there is a natural ring isomorphism R ⋉n M1 ⋉ · · · ⋉ Mi ⋉ 0 ⋉ · · · ⋉ 0 ∼ = R ⋉i M1 ⋉ · · · ⋉ Mi . If M1 = · · · = Mn−1 = 0, then R ⋉n M can be represented as R ⋉1 Mn . However, if n ≥ 3 and there is an integer i ∈ {1, ..., n − 2} such that, for j ∈ {1, ..., n}, Mj = 0 if and only if j ∈ {1, ..., i}, then in general R ⋉n 0 ⋉ · · · ⋉ 0 ⋉ Mi+1 ⋉ · · · ⋉ Mn cannot be represented as an n − i-trivial extension as above. Indeed, if for example, i satisfies 2i + 2 ≤ n, then R ⋉n−i Mi+1 ⋉ · · · ⋉ Mn makes no sense (since ϕi+1,i+1 (Mi+1 , Mi+1 ) is a subset of M2i+2 not of Mi+2 ). 2. If M2k = 0 for every k ∈ N with 1 ≤ 2k ≤ n, then R ⋉n M can be represented as the trivial extension of R by the R-module M1 × M3 × · · · × M2n′ +1 where 2n′ + 1 is the biggest odd integer in {1, ..., n}. Namely, there is a natural ring isomorphism R ⋉n M ∼ = R ⋉1 (M1 × M3 × · · · × M2n′ +1 ). 3. If M2k+1 = 0 for every k ∈ N with 1 ≤ 2k+1 ≤ n, then there is a natural ring isomorphism R ⋉n M ∼ = R ⋉n′′ M2 ⋉ M4 ⋉ · · · ⋉ M2n′′ n-Trivial Extensions of Rings 21 where 2n′′ is the biggest even integer in {1, ..., n}. In general, for every cyclic submonoid G of Γn+1 generated by an element g ∈ {1, ..., n}, if Mi = 0 if and only if i 6∈ G, then there is a natural ring isomorphism R ⋉n M ∼ = R ⋉s Mg ⋉ M2g ⋉ · · · ⋉ Msg where sg is the biggest integer in G ∩ {1, ..., n}. As observed above, if one would discuss according to whether a subfamily of M is trivial or not, then various situations may occur. Thus, for the sake of simplicity, we make the following convention. Convention 4.2 Unless explicitly stated otherwise, when we consider an n-trivial extension for a given n, then we implicitly suppose that Mi 6= 0 for every i ∈ {1, ..., n}. This will be used in the sequel without explicit mention. Note also that the nature of the maps ϕi,j can affect the structure of the n-trivial extension. For example, in case where n = 2, if ϕ1,1 = 0, then R ⋉2 M1 ⋉ M2 ∼ = R ⋉ (M1 × M2 ). For example, if I ⊆ J is an extension of ideals of R, then R ⋉2 I ⋉ R/J ∼ = R ⋉ (I × R/J). Let us start with the following result which presents some relations (easily established) between n-trivial extensions. Proposition 4.3 The following assertions are true. 1. Let G be a submonoid of Γn+1 and consider the family of R-modules M ′ = (Mi′ )ni=1 such that Mi′ = Mi if i ∈ G and Mi′ = 0 if i 6∈ G. Then we have the following (natural) ring extensions: R ֒→ R ⋉n M ′ ֒→ R ⋉n M. In particular, for every m ∈ {1, ..., n}, we have the following (natural) ring extensions: R ֒→ R ⋉n 0 ⋉ · · · ⋉ 0 ⋉ Mm ⋉ · · · ⋉ Mn ֒→ R ⋉n M1 ⋉ · · · ⋉ Mn . The extension R ֒→ R ⋉n M1 ⋉ · · · ⋉ Mn will be denoted by in . 2. For every m ∈ {1, ..., n}, 0 ⋉n 0 ⋉ · · · ⋉ 0 ⋉ Mm ⋉ · · · ⋉ Mn is an ideal of R ⋉n M and an R ⋉j M1 ⋉ · · · ⋉ Mj -module for every j ∈ {n − m, ..., n} via the action (x0 , x1 , ..., xj )(0, ..., 0, ym , ..., yn ) := (x0 , x1 , ..., xj , 0, ..., 0)(0, ..., 0, ym , ..., yn ) = (x0 , x1 , ..., xn−m , 0, ..., 0)(0, ..., 0, ym , ..., yn ). Moreover, the structure of 0 ⋉n 0 ⋉ · · · ⋉ 0 ⋉ Mm ⋉ · · · ⋉ Mn as an ideal of R ⋉n M is the same as the R ⋉j M1 ⋉ · · · ⋉ Mj -module structure for every j ∈ {n − m, ..., n}. In particular, the structure of the ideal 0 ⋉n 0 ⋉ · · · ⋉ 0 ⋉ Mn is the same as the one of the R-module Mn . 22 D. D. Anderson et al. 3. For every m ∈ {1, ..., n}, we have the following natural ring isomorphisms: R ⋉n M1 ⋉ · · · ⋉ Mn /0 ⋉n 0 ⋉ · · · ⋉ 0 ⋉ Mm ⋉ · · · ⋉ Mn ∼ = R ⋉m−1 M1 ⋉ · · · ⋉ Mm−1 obtained from the natural ring homomorphism: πm−1 : R ⋉n M1 ⋉ · · · ⋉ Mn −→ R ⋉m−1 M1 ⋉ · · · ⋉ Mm−1 (r, x1 , ..., xn ) 7−→ (r, x1 , ..., xm−1 ) where for m = 1, R ⋉m−1 M1 ⋉ · · · ⋉ Mm−1 = R. To give another example for the assertion (1), one can show that, for n = 3, {0, 2} is a submonoid of Γ4 . Then we have the following (natural) ring extensions: R ֒→ R ⋉ M2 ֒→ R ⋉3 M1 ⋉ M2 ⋉ M3 . Remark 4.4 We have seen that, in the case of n = 1, the ideal structure of 0 ⋉1 M1 is the same as the R-module structure of 0 ⋉1 M1 . Actually, Nagata [40] used this to reduce proofs of module-theoretic results to the ideal case. However, for n ≥ 2, the R-module structure of 0 ⋉n M1 ⋉ · · · ⋉ Mn need not be the same as the ideal structure. For instance, consider the 2trivial extension Z⋉2 Z⋉Z (with the maps induced by the multiplication in Z). Then Z(0, 1, 1) = {(0, m, m)|m ∈ Z} while the ideal of Z ⋉2 Z ⋉ Z generated by (0, 1, 1) is 0 ⋉2 Z ⋉ Z. However, according to Proposition 4.3 (2), (Z ⋉1 Z)(0, 1, 1) = (Z ⋉2 Z ⋉ Z)(0, 1, 1). The notion of extensions of ideals under ring homomorphisms is a natural way to construct examples of ideals. In this context, we use the ring homomorphism im (indicated in Proposition 4.3) to give such examples. Proposition 4.5 For an ideal I of R, we have the following assertions: 1. The ideal I ⋉n IM1 ⋉ · · · ⋉ IMn of R ⋉n M is the extension of I under the ring homomorphism in , and we have the following natural ring isomorphism: (R ⋉n M )/(I ⋉n IM1 ⋉ · · · ⋉ IMn ) ∼ = (R/I) ⋉n (M1 /IM1 ) ⋉ · · · ⋉ (Mn /IMn ) where the multiplications are well-defined as follows: ϕi,j : Mi /IMi × Mj /IMj (mi , mj ) −→ Mi+j /IMi+j 7−→ mi mj := ϕi,j (mi , mj ) := ϕi,j (mi , mj ) = mi mj . 2. The ideal I ⋉n IM1 ⋉ · · · ⋉ IMn is finitely generated if and only if I is finitely generated. Proof. 1. The proof is straightforward. 2. Using π0 it is clear that if I ⋉n IM1 ⋉· · ·⋉IMn is generated by elements (rj , mj,1 , ..., mj,n ) with j ∈ E for some set E, then I is generated by the rj ’s. Conversely, if I is generated by elements rj with j ∈ E for some set E, then I ⋉n IM1 ⋉ · · · ⋉ IMn is generated by the (rj , 0, ..., 0)’s. n-Trivial Extensions of Rings 23 Now, we determine the radical, prime and maximal ideals of R ⋉n M . As in the classical case, we show that these ideals are particular cases of the homogenous ones, which are characterized in the next section. However, we give these particular cases here because of their simplicity which is reflected, using the following lemma, on the fact that they contain the nilpotent ideal 0 ⋉n M (of index n + 1). Lemma 4.6 Every ideal of R ⋉n M which contains 0 ⋉n M has the form I ⋉n M for some ideal I of R. In this case, we have the following natural ring isomorphism: R ⋉n M/I ⋉n M ∼ = R/I. Proof. Let J be an ideal of R ⋉n M which contains 0 ⋉n M and consider the ideal I = π0 (J) of R where π0 is the surjective ring homomorphism used in Proposition 4.3. Then J ⊆ I ⋉n M and by the fact that 0 ⋉n M ⊆ J, we deduce that J = I ⋉n M . Finally, using π0 and the fact that π0−1 (I) = J, we get the desired isomorphism. The following result is an extension of [9, Theorem 3.2]. Theorem 4.7 Radical ideals of R ⋉n M have the form I ⋉n M where I is a radical ideal of R. In particular, the maximal (resp., the prime) ideals of R ⋉n M have the form M ⋉n M (resp, P ⋉n M ) where M (resp., P ) is a maximal (resp., a prime) ideal of R. Proof. Using Lemma 4.6, it is sufficient to note that every radical ideal contains 0 ⋉n M since (0 ⋉n M )n+1 = 0. Theorem 4.7 allows us to easily determine both the Jacobson radical and the nilradical of R ⋉n M . Corollary 4.8 The Jacobson radical J(R ⋉n M ) (resp., the nilradical Nil(R ⋉n M )) of R ⋉n M is J(R) ⋉n M (resp., Nil(R) ⋉n M ) and the Krull dimension of R ⋉n M is equal to that of R. We end this section with an extension of [9, Theorems 3.5 and 3.7] which determines, respectively, the set of zero divisors Z(R ⋉n M ), the set of units U (R ⋉n M ) and the set of idempotents Id(R ⋉n M ) of R ⋉n M . It is worth noting that trivial extensions have been used to construct examples of rings with zero divisors that satisfies certain properties. As mentioned in the introduction, particular 2-trivial extensions are used to settle some questions. Recently, in [14], a 2-trivial extension is used in the context of zero-divisor graphs to give an appropriate example. Proposition 4.9 The following assertions are true. 1. The set of zero divisors of R ⋉n M is Z(R⋉n M ) = {(r, m1 , ..., mn )|r ∈ Z(R)∪Z(M1 )∪· · ·∪Z(Mn ), mi ∈ Mi f or i ∈ {1, ..., n}}. 24 D. D. Anderson et al. Hence S ⋉n M where S = R − (Z(R) ∪ Z(M1 ) ∪ · · · ∪ Z(Mn )) is the set of regular elements of R ⋉n M . 2. The set of units of R ⋉n M is U (R ⋉n M ) = U (R) ⋉n M . 3. The set of idempotents of R ⋉n M is Id(R ⋉n M ) = Id(R) ⋉n 0. Proof. All the proofs are similar to the corresponding ones for the classical case. For completeness, we give a proof of the first assertion. Let (r, m1 , ..., mn ) ∈ R ⋉n M such that r ∈ Z(R) ∪ Z(M1 ) ∪ · · · ∪ Z(Mn ). If r = 0, then (0, m1 , ..., mn )(0, ..., m′n ) = (0, ..., 0) for every m′n ∈ Mn . Hence (r, m1 , ..., mn ) ∈ Z(R ⋉n M ). Suppose r 6= 0. If r ∈ Z(R), there exists a nonzero element s ∈ R such that rs = 0, so (r, 0, ..., 0)(s, 0, ..., 0) = (0, ..., 0) and hence (r, 0, ..., 0) ∈ Z(R ⋉n M ). If r ∈ Z(Mi ), for some i ∈ {1, ..., n}, there exists a nonzero element m′′i of Mi such that rm′′i = 0, so (r, 0, ..., 0)(0, ..., 0, m′′i , 0, ..., 0) = (0, ..., 0). Hence (r, 0, ..., 0) ∈ Z(R⋉n M ). Now, since Z(R⋉n M ) is a union of prime ideals and Nil(R⋉n M ) is contained in each prime ideal and using the fact that (0, m1 , ..., mn ) ∈ Nil(R ⋉n M ), we conclude that (r, m1 , ..., mn ) = (r, 0, ..., 0) + (0, m1 , ..., mn ) ∈ Z(R ⋉n M ). This gives the first inclusion. Conversely, let (r, m1 , ..., mn ) ∈ Z(R⋉n M ). Then there is (s, m′1 , ..., m′n ) ∈ R⋉n M −{(0, ..., 0)} such ..., 0) = (r, m1 , ..., mn )(s, m′1 , ..., m′n ) = (rs, rm′1 +sm1 , rm′2 +m1 m′1 +sm2 , ..., rm′n + P that (0, mi m′j + smn ). If s 6= 0, then r ∈ Z(R), and if s = 0, we get r ∈ Z(M1 ) if m′1 6= 0, otherwise i+j=n we pass to m′2 and so on we continue until we arrive at s = 0 and m′i = 0 for all i ∈ {1, ..., n − 1}. Then rm′n = 0 and m′n 6= 0, so r ∈ Z(Mn ). This gives the desired inclusion. 5 Homogeneous ideals of n-trivial extensions The study of the classical trivial extension as a graded ring established some interesting properties (see, for instance, [9, Section 3]). Namely, in [9], studying homogeneous ideals of the trivial extension shed more light on the structure of their ideals. Then naturally one would like to extend this study to the context of n-trivial extensions. In this section we extend this study to the context of n-trivial extensions, where here R ⋉n M is a (N0 -)graded ring with, as indicated in Section 3, (R ⋉n M )0 = R, (R ⋉n M )i = Mi , for every i ∈ {1, ..., n}, and (R ⋉n M )i = 0 for every i ≥ n + 1. Note that we could also consider R ⋉n M as a Zn+1 -graded ring or Γn+1 -graded ring as mentioned in Section 3. For that, it is convenient to recall the following definitions: Let Γ be a commutative additive monoid and S = ⊕ Sα be a Γ-graded ring. Let N = ⊕ Nα be a Γ-graded S-module. For every α∈Γ α∈Γ n-Trivial Extensions of Rings 25 α ∈ Γ, the elements of Nα are said to be homogeneous of degree α. A submodule N ′ of N is said to be homogeneous if one of the following equivalent assertions is true. (1) N ′ is generated by homogeneous elements, P (2) If nα ∈ N ′ , where G′ is a finite subset of Γ and each nα is homogeneous of degree α, α∈G′ then nα ∈ N ′ for every α ∈ G′ , or (3) N ′ = ⊕ (N ′ ∩ Nα ). α∈Γ In particular, an ideal J of R ⋉n M is homogeneous if and only if J = (J ∩ R) ⊕ (J ∩ M1 ) ⊕ · · · ⊕ (J ∩ Mn ). Note that I := J ∩ R is an ideal of R and, for i ∈ {1, ..., n}, Ni := J ∩ Mi is an R-submodule of Mi which satisfies IMi ⊆ Ni and Ni Mj ⊆ Ni+j for evey i, j ∈ {1, ..., n}. The next result extends [9, Theorem 3.3 (1)]. Namely, it determines the structure of the homogeneous ideals of n-trivial extensions. In what follows, we use the ring homomorphism Π0 := π0 (used in Proposition 4.3) and, for i ∈ {1, ..., n}, the following homomorphism of R-modules: Πi : R ⋉n M1 ⋉ · · · ⋉ Mn −→ Mi (r, m1 , ..., mn ) 7−→ mi . Theorem 5.1 The following assertions are true. 1. Let I be an ideal of R and let C = (Ci )i∈{1,...,n} be a family of R-modules such that Ci ⊆ Mi for every i ∈ {1, ..., n}. Then I ⋉n C is a (homogeneous) ideal of R ⋉n M if and only if IMi ⊆ Ci and Ci Mj ⊆ Ci+j for all i, j ∈ {1, ..., n} with i + j ≤ n. Thus if I ⋉n C is an ideal of R⋉n M , then Mi /Ci is an R/I-module for every i ∈ {1, ..., n}, and we have a natural ring isomorphism (R ⋉n M1 ⋉ · · · ⋉ Mn )/(I ⋉n C1 ⋉ · · · ⋉ Cn ) ∼ = (R/I) ⋉n (M1 /C1 ) ⋉ · · · ⋉ (Mn /Cn ) where the multiplications are well-defined as follows: ϕi,j : Mi /Ci × Mj /Cj (mi , mj ) −→ Mi+j /Ci+j 7−→ mi mj . In particular, (R ⋉n M1 ⋉ · · · ⋉ Mn )/(0 ⋉n C1 ⋉ · · · ⋉ Cn ) ∼ = R ⋉n (M1 /C1 ) ⋉ · · · ⋉ (Mn /Cn ). 2. Let J be an ideal of R ⋉n M and consider K := Π0 (J) and Ni := Πi (J) for every i ∈ {1, ..., n}. Then, 26 D. D. Anderson et al. (a) K is an ideal of R and Ni is a submodule of Mi for every i ∈ {1, ..., n} such that KMi ⊆ Ni and Ni Mj ⊆ Ni+j for every j ∈ {1, ..., n} with i + j ≤ n. Thus K ⋉n N1 ⋉ · · · ⋉ Nn is a homogeneous ideal of R ⋉n M1 ⋉ · · · ⋉ Mn . (b) J ⊆ K ⋉n N1 ⋉ · · · ⋉ Nn . (c) The ideal J is homogeneous if and only if J = K ⋉n N1 ⋉ · · · ⋉ Nn . Proof. 1. If I ⋉n C1 ⋉· · ·⋉Cn is an ideal of R⋉n M , then (R⋉n M1P ⋉· · ·⋉Mn )(I ⋉n C1 ⋉· · ·⋉Cn ) = I ⋉n (IM1 + C1 ) ⋉ (IM2 + C2 + C1 M1 ) ⋉ · · · ⋉ (IMn + Cn + Ci Mj ). Thus IMi ⊆ Ci and i+j=n Ci Mj ⊆ Ci+j for every i, j ∈ {1, ..., n}. Conversely, suppose that we have IMi ⊆ Ci and Ci Mj ⊆ Ci+j for all i, j ∈ {1, ..., n} with i + j ≤ n. Then Mi /Ci is an R/I-module for every i ∈ {1, ..., n} and the map f : R ⋉n M1 ⋉ · · · ⋉ Mn −→ (R/I) ⋉n (M1 /C1 ) ⋉ · · · ⋉ (Mn /Cn ) (r, m1 , ..., mn ) 7−→ (r + I, m1 + C1 , ..., mn + Cn ) is a well-defined surjective homomorphism with Kerf = I ⋉n C1 ⋉ · · · ⋉ Cn , so I ⋉n C1 ⋉ · · · ⋉ Cn is an ideal of R ⋉n M1 ⋉ · · · ⋉ Mn and (R ⋉n M1 ⋉ · · · ⋉ Mn )/(I ⋉n C1 ⋉ · · · ⋉ Cn ) ∼ = (R/I) ⋉n (M1 /C1 ) ⋉ · · · ⋉ (Mn /Cn ). In particular, (R ⋉n M1 ⋉ · · · ⋉ Mn )/(0 ⋉n C1 ⋉ · · · ⋉ Cn ) ∼ = R ⋉n (M1 /C1 ) ⋉ · · · ⋉ (Mn /Cn ). 2. All of the three statements are easily checked. The following result presents some properties of homogeneous ideals of R ⋉n M . It is an extension of both [9, Theorem 3.2 (3)] and [9, Theorem 3.3 (2) and (3)]. In particular, we determine, as an extension of [9, Theorem 3.3 (3)], the form of homogeneous principal ideals. In fact, the characterization of homogeneous principal ideals plays a key role in studying homogeneous ideals. This is due to (the easily checked) fact that an ideal I of a graded ring is homogeneous if every principal ideal generated by an element of I is homogeneous. Proposition 5.2 The following assertions are true. 1. Let I ⋉n N1 ⋉ · · · ⋉ Nn and I ′ ⋉n N1′ ⋉ · · · ⋉ Nn′ be two homogeneous ideals of R ⋉n M . Then we have the following homogeneous ideals of R ⋉n M : (a) (I ⋉n N1 ⋉ · · · ⋉ Nn ) + (I ′ ⋉n N1′ ⋉ · · · ⋉ Nn′ ) = (I + I ′ ) ⋉n (N1 + N1′ ) ⋉ · · · ⋉ (Nn + Nn′ ), (b) (I ⋉n N1 ⋉ · · · ⋉ Nn ) ∩ (I ′ ⋉n N1′ ⋉ · · · ⋉ Nn′ ) = (I ∩ I ′ ) ⋉n (N1 ∩ N1′ ) ⋉ · · · ⋉ (Nn ∩ Nn′ ), ′ ′ ′ ′ ′ ′ (c) (I ⋉n N1 ⋉ · · · ⋉ Nn )(I ′ ⋉n N1′ ⋉ P· · · ⋉ N′ n ) = II ⋉n (IN1 + I N1 ) ⋉ (IN2 + I N2 + ′ ′ ′ Ni Nj ), and N1 N1 ) ⋉ · · · ⋉ (INn + I Nn + i+j=n n-Trivial Extensions of Rings 27 (d) (I ⋉n N1 ⋉ · · · ⋉ Nn ) : (I ′ ⋉n N1′ ⋉ · · · ⋉ Nn′ ) = ((I :R I ′ ) ∩ (N1 :R N1′ ) ∩ · · · ∩ (Nn :R ′ )) ⋉ · · · ⋉ (Nn :Mn I ′ ) where Nn′ )) ⋉n ((N1 :M1 I ′ ) ∩ (N2 :M1 N1′ ) ∩ · · · ∩ (Nn :M1 Nn−1 (Ni+j :Mi Nj′ ) := {mi ∈ Mi |mi Nj′ ⊆ Ni+j } for every i, j ∈ {0, ..., n} with i + j ≤ n (here M0 = R, N0 = I and N0′ = I ′ ). 2. A principal ideal h(a, m1 , ..., mn )i of R⋉n M is homogeneous if and only if P h(a, m1 , ..., mn )i = aR ⋉n (Rm1 + aM1 ) ⋉ (Rm2 + aM2 + m1 M1 ) ⋉ · · · ⋉ (Rmn + aMn + mi Mj ). i+j=n √ p 3. For an ideal J of R ⋉n M , J = Π√0 (J) ⋉n M . In particular, √ if I ⋉n C1 ⋉ · · · ⋉ Cn is a homogeneous ideal of R ⋉n M , then I ⋉n C1 ⋉ · · · ⋉ Cn = I ⋉n M . Proof. 1. The proof for each of the first three statements is similar to the corresponding one of [38, Theorem 25.1 (2)]. The last statement easily follows from the fact that the residual of two homogeneous ideals is again homogeneous. 2. Apply assertion (1) and Theorem 5.1 (1). 3. The proof is similar to the one of [9, Theorem 3.2 (3)]. It is a known fact that, in case where n = 1, even if a homogeneous ideal I ⋉ C is finitely generated, the R-module C is not necessarily finitely generated (you can consider Z ⋉ Q and the principal ideal h(2, 0)i = 2Z ⋉ Q as an example). The following result presents, in this context, some particular cases obtained using standard arguments. Proposition 5.3 The following assertions are true. 1. The ideal 0 ⋉n M of R ⋉n M is finitely generated if and only if each R-module Mi is finitely generated. 2. If a homogeneous ideal I ⋉n C1 ⋉ · · · ⋉ Cn of R ⋉n M is finitely generated, then I is a finitely generated ideal of R. The converse implication is true when Ci is a finitely generated R-module for every i ∈ {1, ..., n}. From the previous section, we note that every radical (hence prime) ideal of R ⋉n M is homogeneous. However, it is well-known that the ideals of the classical trivial extensions are not in general homogeneous (see [9]). Then natural questions arise: Question 1: When every ideal of a given class I of ideals of R ⋉n M is homogeneous? Question 2: For a given ring R and a family of R-modules M = (Mi )ni=1 , what is the class of all homogeneous ideals of R ⋉n M ? It is clear that these questions depend on the structure of both R and each Mi . For instance, for n = 1, if R is a quasi-local ring with maximal m, then a proper homogeneous ideal of R⋉R/m 28 D. D. Anderson et al. has either the form I ⋉ R/m or I ⋉ 0 where I is a proper ideal of R. And a proper homogeneous principal ideal of R ⋉ R/m has either the form 0 ⋉ R/m or I ⋉ 0 where I is a principal ideal of R. Then, for instance, a principal ideal of R ⋉ R/m generated by an element (a, e) where a and e are both nonzero with a ∈ m, is not homogeneous. Question 1 was investigated in [9] for the case where I is the class of regular ideals of R ⋉1 M [9, Theorem 3.9]. Also, under the condition that R is an integral domain, a characterization of trivial extension rings over which every ideal is homogeneous is given (see [9, Theorem 3.3 and Corollary 3.4]). Our aim in the remainder of this section is to extend this study to ntrivial extensions. It is worth noting that in the classical case (where n = 1), ideals J with Π0 (J) = 0 are homogeneous. This shows that the condition that all ideals J with Π0 (J) 6= 0 are homogeneous implies that all ideals of R ⋉1 M are homogeneous. In the context of R ⋉n M for n ≥ 2 we show that more situations can occur. Let us begin with the class of ideals J of R ⋉n M with Π0 (J) ∩ S 6= ∅ for a given subset S of regular elements of R. Recall that a ring S is said to be présimplifiable if, for every a and b in S: ab = a implies a = 0 or b ∈ U (S). Présimplifiable rings were introduced and studied by Bouvier in a series of papers (see references) and they have also been investigated in [7, 8]. In [9], the notion of a présimplifiable ring is used when homogeneous ideals of the classical trivial extensions were studied. For example, we have that if R is présimplifiable but not an integral domain, then every ideal of R ⋉1 M is homogeneous if and only if M1 = 0 (see [9, Theorems 3.3 (4)]). This is why we first consider just subsets of regular elements. Theorem 5.4 Let S be a nonempty subset of R − Z(R) and let I be the class of ideals J of R ⋉n M with Π0 (J) ∩ S 6= ∅. Then the following assertions are equivalent. 1. Every ideal in I is homogeneous. 2. Every principal ideal in I is homogeneous. 3. For every s ∈ S and i ∈ {1, ..., n}, sMi = Mi . 4. Every principal ideal h(s, m1 , ..., mn )i with s ∈ S has the form I ⋉n M where I is a principal ideal of R with I ∩ S 6= ∅. 5. Every ideal in I has the form I ⋉n M where I is an ideal of R with I ∩ S 6= ∅. Proof. (1) ⇒ (2). Obvious. (2) ⇒ (3). Let s ∈ S and i ∈ {1, ..., n}. We only need to prove that Mi ⊆ sMi . Consider an element mi of Mi . Since s ∈ S, h(s, 0, ..., 0, mi , 0, ..., 0)i is homogeneous. Then (s, 0, ..., 0) ∈ h(s, 0, ..., 0, mi , 0, ..., 0)i, so there is (x, e1 , ..., en ) ∈ R ⋉n M1 ⋉ · · · ⋉ Mn such that (s, 0, ..., 0, mi , 0, ..., 0)(x, e1 , ..., en ) = (s, 0, ..., 0). n-Trivial Extensions of Rings 29 Since s is regular, x = 1. Then mi = (−s)ei , as desired. (3) ⇒ (4). Let h(s, m1 , ..., mn )i be a principal ideal of R ⋉n M with s ∈ S. By (3), (s, m1 , ..., mn )(0 ⋉n 0 ⋉ · · · ⋉ 0 ⋉ Mn ) = 0 ⋉n 0 ⋉ · · · ⋉ 0 ⋉ Mn . This implies that 0 ⋉n 0 ⋉ · · · ⋉ 0 ⋉ Mn ⊂ h(s, m1 , ..., mn )i. Using this inclusion and (3), we get 0 ⋉n 0 ⋉ · · · ⋉ 0 ⋉ Mn−1 ⋉ 0 ⊂ h(s, m1 , ..., mn )i. Then inductively we get 0 ⋉n 0 ⋉ · · · ⋉ 0 ⋉ Mi ⋉ 0 ⋉ · · · ⋉ 0 ⊂ h(s, m1 , ..., mn )i for every i ∈ {1, ..., n}. Thus 0 ⋉n M1 ⋉ · · · ⋉ Mn ⊂ h(s, m1 , ..., mn )i. Therefore by Lemma 4.6 and Proposition 5.2 (2), h(s, m1 , ..., mn )i has the form I ⋉n M where I = sR. (4) ⇒ (5). Consider an ideal J in I . Then there is an element (s, m1 , ..., mn ) ∈ J such that s ∈ Π0 (J) ∩ S. Therefore using (4) and Lemma 4.6, we get the desired result. (5) ⇒ (1). Obvious. As an example, we can consider the trivial extension S := Z ⋉2 ZW ⋉ Q where ZW is the ring of fractions of Z with respect to the multiplicatively closed subset W = {2k |k ∈ N} of Z. Then the principal ideal h(3, 1, 0)i of S is not homogeneous. Deny, we must have (3, 0, 0) ∈ h(3, 1, 0)i. Thus there is (a, e, f ) ∈ S such that (3, 0, 0) = (3, 1, 0)(a, e, f ). But this implies that a = 1 and then e = −1 3 , which is absurd. The following result is an extension of [9, Theorem 3.9]. Recall that an ideal is said to be regular if it contains a regular element. Here, from Proposition 4.9, an ideal of R ⋉n M is regular if and only if it contains an element (s, m1 , ..., mn ) with s ∈ R − (Z(R) ∪ Z(M1 ) ∪ · · · ∪ Z(Mn )). Corollary 5.5 Let S = R − (Z(R) ∪ Z(M1 ) ∪ · · · ∪ Z(Mn )). Then the following assertions are equivalent. 1. Every regular ideal of R ⋉n M is homogeneous. 2. Every principal regular ideal of R ⋉n M is homogeneous. 3. For every s ∈ S and i ∈ {1, ..., n}, sMi = Mi (or equivalently, MiS = Mi ). 4. Every principal ideal h(s, m1 , ..., mn )i with s ∈ S has the form I ⋉n M where I is a principal ideal of R with I ∩ S 6= ∅. 5. Every regular ideal of R⋉n M has the form I ⋉n M where I is an ideal of R with I ∩S 6= ∅. Consequently, if R ⋉n M is root closed (in particular, integrally closed), then every regular ideal of R ⋉n M has the form given in (5). Proof. The proof is similar to the one of [9, Theorem 3.9]. 30 D. D. Anderson et al. Compare the following result with [9, Corollary 3.4]. Corollary 5.6 Assume that R is an integral domain. Then the following assertions are equivalent. 1. Every ideal J of R ⋉n M with Π0 (J) 6= 0 is homogeneous. 2. Every principal ideal J of R ⋉n M with Π0 (J) 6= 0 is homogeneous. 3. For every i ∈ {1, ..., n}, Mi is divisible. 4. Every principal ideal h(s, m1 , ..., mn )i of R ⋉n M with s 6= 0 has the form I ⋉n M where I is a nonzero principal ideal of R. 5. Every ideal J of R ⋉n M with Π0 (J) 6= 0 has the form I ⋉n M where I is a nonzero ideal of R. 6. Every ideal of R ⋉n M is comparable to 0 ⋉n M . Proof. The equivalence (5) ⇔ (6) is a simple consequence of Lemma 4.6. The proof of Theorem 5.4 shows that another situation can be considered. This is given in the following result. We use AnnR (H) to denote the annihilator of an R-module H. Theorem 5.7 Let I be the class of ideals J of R ⋉n M with Π0 (J) ∩ S 6= ∅ where S is a nonempty subset of R − {0} such that, for every s ∈ S, AnnR (s) ⊆ AnnR (Mi ). Then the following assertions are equivalent. 1. Every ideal in I is homogeneous. 2. Every principal ideal in I is homogeneous. 3. For every s ∈ S and i ∈ {1, ..., n}, sMi = Mi . 4. Every principal ideal h(s, m1 , ..., mn )i with s ∈ S has the form I ⋉n M where I is a principal ideal of R with I ∩ S 6= ∅. 5. Every ideal in I has the form I ⋉n M where I is an ideal of R with I ∩ S 6= ∅. Proof. We only need to prove the implication (2) ⇒ (3). Let s ∈ S and i ∈ {1, ..., n} and consider an element mi of Mi − {0}. Since s ∈ S, h(s, 0, ..., 0, mi , 0..., 0)i is homogeneous. Then (s, 0, ..., 0) ∈ h(s, 0, ..., 0, mi , 0..., 0)i, so there is (x, e1 , ..., en ) ∈ R ⋉n M1 ⋉ · · · ⋉ Mn such that (s, 0, ..., 0, mi , 0..., 0)(x, e1 , ..., en ) = (s, 0, ..., 0). Then sx = s and, by the hypothesis on S, (x − 1)mi = 0. Therefore mi = xmi = (−s)ei , as desired. n-Trivial Extensions of Rings 31 For an example of a ring that satisfies the condition of the previous result, consider a ring R with an idempotent e ∈ R − {1, 0} and set S = {e} and Mi = Re for every i ∈ {1, ..., n}. Thus, since eMi = Mi for every i ∈ {1, ..., n}, every ideal J of R ⋉n M with e ∈ Π0 (J) is homogeneous. Unlike the classical case (where n = 1), the fact that, for every i ∈ {1, ..., n}, Mi is divisible does not necessarily imply that every ideal is homogeneous. For that, we consider the 2-trivial extension S := k ⋉2 (k × k) ⋉ (k × k) where k is a field. Then the principal ideal h(0, (1, 0), (0, 1))i of S is not homogeneous. Indeed, if it were homogeneous, we must have (0, (1, 0), (0, 0)) ∈ h(0, (1, 0), (0, 1))i. Thus there is (a, (e, f ), (e′ , f ′ )) ∈ S such that (0, (1, 0), (0, 0)) = (0, (1, 0), (0, 1))(a, (e, f ), (e′ , f ′ )). But this implies that (a, 0) = (1, 0) and (0, 0) = (e, a), which is absurd. This example naturally leads us to investigate when every ideal J of R ⋉n M with Π0 (J) = 0 is homogeneous. In this context, the notion of a présimplifiable module is used. For that, recall that an R-module H is called R-présimplifiable if, for every r ∈ R and h ∈ H, rh = h implies h = 0 or r ∈ U (R). For example, over an integral domain, every torsion-free module is présimplifiable (see [7] and also [3]). In studying the question when every ideal J of R ⋉n M with Π0 (J) = 0 is homogeneous, several different cases occur. For this we use the following lemma. Lemma 5.8 Let J be an ideal of R⋉n M such that, for i ∈ {1, ..., n}, Π0 (J) = 0,...,Πi−1 (J) = 0, Πi (J) 6= 0. Then the following assertions are true. 1. For i = n, the ideal J is homogeneous and it has the form 0 ⋉n 0 ⋉ · · · ⋉ 0 ⋉ Πn (J). 2. For i 6= n, if 0 ⋉n 0 ⋉ · · · ⋉ 0 ⋉ Mi+1 ⋉ · · · ⋉ Mn ⊂ J, then J is homogeneous and it has the form 0 ⋉n 0 ⋉ · · · ⋉ 0 ⋉ Πi (J) ⋉ Mi+1 ⋉ · · · ⋉ Mn . Proof. Straightforward. Theorem 5.9 Assume that n ≥ 2 and Mj is présimplifiable for a given j ∈ {1, ..., n − 1}. Let I be the class of ideals J of R ⋉n M with Πi (J) = 0 for every i ∈ {0, ..., j − 1} and Πj (J) 6= 0. Then the following assertions are equivalent. 1. Every ideal in I is homogeneous. 2. Every principal ideal in I is homogeneous. 3. For every k ∈ {j + 1, ..., n} and every mj ∈ Mj − {0}, Mk = mj Mk−j . 4. Every principal ideal h(0, 0, ..., 0, mj , ..., mn )i with mj 6= 0 has the form 0 ⋉n 0 ⋉ · · · ⋉ 0 ⋉ N ⋉ Mj+1 ⋉ · · · ⋉ Mn where N is a nonzero cyclic submodule of Mj . 32 D. D. Anderson et al. 5. Every ideal in I has the form 0 ⋉n 0 ⋉ · · · ⋉ 0 ⋉ N ⋉ Mj+1 ⋉ · · · ⋉ Mn where N is a nonzero submodule of Mj . 6. Every ideal in I contains 0 ⋉n 0 ⋉ · · · ⋉ 0 ⋉ Mj+1 ⋉ · · · ⋉ Mn . Proof. The implication (3) =⇒ (4) is proved similarly to the implication (3) ⇒ (4) of Theorem 5.4. The implication (6) =⇒ (1) is a simple consequence of Lemma 5.8. Then only the implication (2) =⇒ (3) needs a proof. Let k ∈ {j + 1, ..., n}, mj ∈ Mj − {0} and mk ∈ Mk − {0}. Then the principal ideal p = h(0, ..., 0, mj , 0, ..., 0, mk , 0, ..., 0)i is homogeneous. This implies that (0, ..., 0, mj , 0, ..., 0) ∈ p and so there exists (r, e1 , ..., en ) ∈ R ⋉n M such that (0, ..., 0, mj , 0, ..., 0) = (r, e1 , ..., en )(0, ..., 0, mj , 0, ..., 0, mk , 0, ..., 0). Then rmj = mj and rmk + ek−j mj = 0. Since Mj is présimplifiable, r is invertible and then mk = −r −1 ek−j mj , as desired. For examples of rings that satisfy the conditions of the previous result, we can consider the following two 2-trivial extensions: Z ⋉2 ZW ⋉ Q and Z ⋉2 ZW ⋉ ZW where ZW is the ring of fractions of Z with respect to the multiplicatively closed subset W = {2k |k ∈ N} of Z. The following particular cases are of interest. Corollary 5.10 Assume that n ≥ 2 and Mn−1 is présimplifiable. Let I be the class of ideals J of R ⋉n M with Πi (J) = 0 for every i ∈ {0, ..., n − 2}. Then the following assertions are equivalent. 1. Every ideal in I is homogeneous. 2. For every mn−1 ∈ Mn−1 − {0}, Mn = mn−1 M1 . 3. Every ideal in I is comparable to 0 ⋉n 0 ⋉ · · · ⋉ 0 ⋉ Mn . Proof. (1) =⇒ (2). This is a particular case of the corresponding one in Theorem 5.9. (2) =⇒ (3). Let I be an ideal of R ⋉n M in I . If Πn−1 (I) 6= 0, then Theorem 5.9 shows that I contains 0 ⋉n 0 ⋉ · · · ⋉ 0 ⋉ Mn . Otherwise, Πn−1 (I) = 0 which means that 0 ⋉n 0 ⋉ · · · ⋉ 0 ⋉ Mn contains I. (3) ⇒ (1). Let I be a nonzero ideal of R ⋉n M in I . If Πn−1 (I) 6= 0, then Theorem 5.9 shows that I is homogeneous. The other case is a consequence of the assertion (1) of Lemma 5.8. When n = 2, we get the following particular case of Corollary 5.10. Corollary 5.11 Assume that M1 is présimplifiable and n = 2. Let I be the class of ideals J of R ⋉2 M with Π0 (J) = 0. Then the following assertions are equivalent. n-Trivial Extensions of Rings 33 1. Every ideal in I is homogeneous. 2. For every m1 ∈ M1 − {0}, M2 = m1 M1 . 3. Every ideal in I is comparable to 0 ⋉2 0 ⋉ M2 . When j = 1 in Theorem 5.9, there are additional conditions equivalent to (1)-(6). The study of this case leads us to introduce the following notion in order to avoid trivial situations. Definition 5.12 Assume that n ≥ 2. For i ∈ {1, ..., n − 1} and j ∈ {2, ..., n} with product ij ≤ n, Mi is said to be ϕ-j-integral (where ϕ = {ϕi,j } i+j≤n is the family of multiplications) 1≤i,j≤n−1 if, for any j elements mi1 , ..., mij of Mi , if the product mi1 · · · mij = 0, then at least one of the mik ’s is zero. If no ambiguity arises, Mi is simply called j-integral. Corollary 5.13 Assume that n ≥ 2, M1 is présimplifiable and k-integral for every k ∈ {2, ..., n− 1}. Let I be the class of ideals J of R ⋉n M with Π0 (J) = 0 and Π1 (J) 6= 0. Then the following assertions are equivalent. 1. Every ideal in I is homogeneous. 2. Every principal ideal in I is homogeneous. 3. For every k ∈ {2, ..., n} and every m1 ∈ M1 − {0}, Mk = m1 Mk−1 . 4. For every k ∈ {2, ..., n} and every nonzero elements m11 , ..., m1k−1 ∈ M1 − {0}, Mk = m11 · · · m1k−1 M1 . 5. For every k ∈ {2, ..., n} and every nonzero element m ∈ M1 − {0}, Mk = mk−1 M1 . 6. Every principal ideal h(0, m1 , ..., mn )i with m1 6= 0 has the form 0 ⋉n N ⋉ M2 · · · ⋉ Mn where N is a nonzero cyclic submodule of M1 . 7. Every ideal in I has the form 0 ⋉n N ⋉ M2 · · · ⋉ Mn where N is a nonzero submodule of M1 . 8. Every ideal in I contains 0 ⋉n 0 ⋉ M2 ⋉ · · · ⋉ Mn . Proof. The equivalences (3) ⇔ (4) ⇔ (5) are easily proved. The following result shows that, in fact, the conditions of Corollary 5.13 above are necessary and sufficient to show that every ideal J of R ⋉n M with Π0 (J) = 0 is homogeneous. Note that Corollary 5.11 presents the case n = 2. Thus in the following result we may assume that n ≥ 3. Corollary 5.14 Assume that n ≥ 3 and M1 is présimplifiable and k-integral for every k ∈ {2, ..., n − 1}. Then the following assertions are equivalent. 34 D. D. Anderson et al. 1. Every ideal J of R ⋉n M with Π0 (J) = 0 and Π1 (J) 6= 0 is homogeneous. 2. For every j ∈ {1, ..., n − 1}, Mj is présimplifiable and every ideal J of R ⋉n M with Π0 (J) = 0 is homogeneous. Proof. We only need to prove that (1) ⇒ (2). Let j ∈ {1, ..., n − 1} and consider mj ∈ Mj − {0}. Let r ∈ R such that rmj = mj . By Corollary 5.13 (4), there are m11 , ..., m1j ∈ M1 − {0} such that mj = m11 · · · m1j . Then rm11 · · · m1j = m11 · · · m1j which implies that (rm11 − m11 )m12 · · · m1j = 0. Now, since M1 is k-integral for every k ∈ {2, ..., n − 1}, rm11 − m11 = 0. Therefore r is invertible since M1 is présimplifiable. So Mj is présimplifiable. Now, to prove that every ideal J of R⋉n M with Π0 (J) = 0 is homogeneous, it suffices to prove that Mk = mj Mk−j for every k ∈ {2, ..., n}, every j ∈ {1, ..., k − 1} and every mj ∈ Mj − {0} (by Theorem 5.9). The case where k = 2 is trivial. Thus fix k ∈ {3, ..., n} and j ∈ {1, ..., k − 1}. Consider mj ∈ Mj − {0} and mk ∈ Mk − {0}. We prove that mk = mj mk−j for some mk−j ∈ Mk−j − {0}. By Corollary 5.13 (5), mj = mj−1 m1 for some m, m1 ∈ M1 − {0}. And, by Corollary 5.13 (3), mk = m1 mk−1 for some mk−1 ∈ Mk−1 − {0}. Also, by Corollary 5.13 (5), mk−1 = mk−2 m′1 for some m′1 ∈ M1 − {0}. Then mk = mk−2 m1 m′1 = (mj−1 m1 )(mk−j−1 m′1 ) = mj mk−j where mk−j = mk−j−1 m′1 ∈ Mk−j − {0}, as desired. Finally, we give a case when we can characterize rings in which every ideal is homogeneous. Note that, when R is a ring with aMi = Mi for every i ∈ {1, ..., n − 1} and every a ∈ R − {0}, and Mi = mi−1 M1 for every i ∈ {2, ..., n} and every nonzero element m ∈ M1 − {0}, then R is an integral domain and Mi must be torsion-free for every i ∈ {1, ..., n − 1}. Corollary 5.15 Suppose that n ≥ 2 and R is an integral domain. Assume that Mi is torsionfree, for every i ∈ {1, ..., n − 1}, and that M1 is k-integral for every k ∈ {2, ..., n − 1}. Then the following assertions are equivalent. 1. Every ideal of R ⋉n M is homogeneous. 2. The following two conditions are satisfied: i. For every i ∈ {1, ..., n}, Mi is divisible, and ii. For every i ∈ {2, ..., n} and every m1 ∈ M1 − {0}, Mi = m1 Mi−1 . Proof. Simply use Corollaries 5.6 and 5.13 and Theorem 5.9. It is easy to show that the two n-trivial extensions Z ⋉n Q ⋉ · · · ⋉ Q and Z ⋉n Q ⋉ · · · ⋉ Q ⋉ Q/Z satisfy the conditions of the above result and so every ideal of these rings is homogeneous. We end this section with the following particular case. n-Trivial Extensions of Rings 35 Corollary 5.16 Suppose that n ≥ 2. Consider the n-trivial extension S := k ⋉n E1 ⋉ · · · ⋉ En where k is a field and, for i ∈ {1, ..., n}, Ei is a k-vector space. Suppose that E1 is k-integral for every k ∈ {2, ..., n − 1}. Then the following assertions are equivalent. 1. Every ideal of S is homogeneous. 2. For every k ∈ {2, ..., n}, every j ∈ {1, ..., k − 1} and every ej ∈ Ej − {0}, Ek = ej Ek−j . As a particular case, we can consider a field extension K ⊆ F , then every ideal of S := K ⋉n F ⋉ · · · ⋉ F is homogeneous. Namely, every proper ideal of S has the form 0 ⋉n 0 ⋉ · · · ⋉ 0 ⋉ N ⋉ F ⋉ · · · ⋉ F where N is a K-subspace of F . 6 Some ring-theoritic properties of R ⋉n M In this section, we determine when R ⋉n M has certain ring properties such as being Noetherian, Artinian, Manis valuation, Prüfer, chained, arithmetical, a π-ring, a generalized ZPI-ring or a PIR. We end the section with a remark on a question posed in [2] concerning m-Boolean rings. We begin by characterizing when the n-trivial extensions are Noetherian (resp., Artinian). The following result extends [9, Theorem 4.8]. Theorem 6.1 The ring R ⋉n M is Noetherian (resp., Artinian) if and only if R is Noetherian (resp., Artinian) and, for every i ∈ {1, ..., n}, Mi is finitely generated. Proof. Similar to the proof of [9, Theorem 4.8]. The following result is an extension of [9, Theorem 4.2 and Corollary 4.3]. It investigates the integral closure of R ⋉n M in the total quotient ring T (R ⋉n M ) of R ⋉n M . Theorem 6.2 Let S = R − (Z(R) ∪ Z(M1 ) ∪ · · · ∪ Z(Mn )). If R′ is the integral closure of R in T (R), then (R′ ∩ RS ) ⋉n M1S ⋉ · · · ⋉ MnS is the integral closure of R ⋉n M in T (R ⋉n M ). In particular, 1. If R is an integrally closed ring, then R ⋉n M1S ⋉ · · · ⋉ MnS is the integral closure of R ⋉n M1 ⋉ · · · ⋉ Mn in T (R ⋉n M1 ⋉ · · · ⋉ Mn ), and 2. If Z(Mi ) ⊆ Z(R) for all i ∈ {1, ..., n}, then R ⋉n M1S ⋉ · · · ⋉ MnS is integrally closed if and only if R is integrally closed. Proof. All statements can be proved similarly to the corresponding ones of [9, Theorem 4.2 and Corollary 4.3]. 36 D. D. Anderson et al. It is worth noting as in the classical case that R ⋉n M can be integrally closed without R being integrally closed (see the example given after [9, Corollary 4.3]). Similar to the classical case [9, Theorem 4.16 (1) and (2)], as a consequence of Theorem 6.2 and Corollary 5.5, we give the following result which characterizes when R ⋉n M is (Manis) valuation and when it is Prüfer. First, recall these two notions. Let S be a subring of a ring T , and let P be a prime ideal of S. Then (S, P ) is called a valuation pair on T (or just S is a valuation ring on T ) if there is a surjective valuation v : T −→ G ∪ {∞} (v(xy) = v(x) + v(y), v(x + y) ≥ min{v(x), v(y)}, v(1) = 0 and v(0) = ∞) where G is a totally ordered abelian group, with S = {x ∈ T |v(x) ≥ 0} and P = {x ∈ T |v(x) > 0}. This is equivalent to if x ∈ T − S, then there exists x′ ∈ P with xx′ ∈ S − P . A valuation ring S is called a (Manis) valuation ring if T = T (S). Also, S is called a Prüfer ring if every finitely generated regular ideal of S is invertible. This is equivalent to every overring of S being integrally closed (see [38] for more details). Corollary 6.3 Let S = R − (Z(R) ∪ Z(M1 ) ∪ · · · ∪ Z(Mn )). 1. R⋉n M is a Manis valuation ring if and only if R is a valuation ring on RS and Mi = MiS for every i ∈ {1, ..., n}. 2. R ⋉n M is a Prüfer ring if and only if, for every finitely generated ideal I of R with I ∩ S 6= ∅, I is invertible and Mi = MiS for every i ∈ {1, ..., n}. Now, as an extension of [9, Theorem 4.16 (3)], we characterize when R ⋉n M is a chained ring. Recall that a ring S is said to be chained if the set of ideals of S is totally ordered by inclusion. As an exception to Convention 4.2, in the following results (Lemma 6.4, Theorem 6.5, Corollary 6.6, Lemma 6.7 and Theorem 6.8), a module in the family associated to an n-trivial extension can be zero. The proof of the desired result uses the following lemma which gives another characterization of a particular n-trivial extension with the property that every ideal is homogeneous. Lemma 6.4 Assume that R is quasi-local with maximal ideal m. Suppose also that at least one of the modules of the family M is nonzero. Then every ideal of R ⋉n M is homogeneous if and only if the following three conditions are satisfied: 1. R is an integral domain. 2. For every i ∈ {1, ..., n}, Mi is divisible. 3. For every 1 ≤ i ≤ j ≤ n (when n ≥ 2), if Mi 6= 0 and Mj 6= 0, then Mj−i 6= 0 and eMi = Mj for every e ∈ Mj−i . In this case, each ideal has one of the forms I ⋉n M , for some ideal I of R, or 0 ⋉n 0 ⋉ · · · ⋉ 0 ⋉ N ⋉ Mj+1 ⋉ · · · ⋉ Mn where N is a nonzero submodule of Mj for some j ∈ {1, ..., n}. n-Trivial Extensions of Rings 37 Proof. =⇒ Clearly the first assertion is a simple consequence of the second one. Then we only need to prove the second and the third assertions. (2). Let r ∈ R − {0} and i ∈ {1, ..., n}. Consider an element mi ∈ Mi . If r 6∈ m, the maximal ideal of R, then r is invertible and trivially we get the result. Next assume r ∈ m. By hypothesis, the ideal h(r, 0, ..., 0, mi , 0, ..., 0)i is homogeneous, so there is (r ′ , m′1 , ..., m′n ) such that (r, 0, ..., 0) = (r, 0, ..., 0, mi , 0, ..., 0)(r ′ , m′1 , ..., m′n ). Then rr ′ = r and 0 = rm′i + r ′ mi . Thus r ′ cannot be in m, so r ′ is invertible and thus mi = −(r ′ )−1 rm′i , as desired. (3). Let 1 ≤ i ≤ j ≤ n such that Mi 6= 0 and Mj 6= 0. Consider mi ∈ Mi − {0} and mj ∈ Mj − {0}. By hypothesis, h(0, ..., 0, mi , 0, ..., 0, mj , 0, ..., 0)i is homogeneous. Then (0, ..., 0, mj , 0, ..., 0) = (0, ..., 0, mi , 0, ..., 0, mj , 0, ..., 0)(r ′ , m′1 , ..., m′n ) for some (r ′ , m′1 , ..., m′n ) ∈ R ⋉n M . This implies that r ′ mi = 0 and r ′ mj + mi m′j−i = mj . If Mj−i = 0, we get r ′ mi = 0 and (r ′ − 1)mj = 0. This is impossible since either r ′ or r ′ − 1 is invertible. Then Mj−i 6= 0. Now, suppose that r ′ 6= 0. By (2), there exists m′′j−i ∈ Mj−i such that m′j−i = r ′ m′′j−i . Hence using the fact that r ′ mi = 0, the equality r ′ mj + mi m′j−i = mj becomes r ′ mj = mj . As in the previous case, this is impossible. Therefore r ′ = 0 and this gives the desired result. ⇐= We only need to prove that every principal ideal h(s, m1 , ..., mn )i of R ⋉n M is homogeneous. For this, distinguish two cases s 6= 0 and s = 0 and follow an argument similar to that of (3) ⇒ (4) of Theorem 5.4. Theorem 6.5 Assume that n ≥ 2 and that at least one of the modules of the family M is nonzero. Then the ring R ⋉n M is chained if and only if the following conditions are satisfied: 1. R is a valuation domain, 2. For every i ∈ {1, ..., n}, Mi is divisible, 3. For every 1 ≤ i ≤ j ≤ n, if Mi 6= 0 and Mj 6= 0, then Mj−i 6= 0 and eMi = Mj for every e ∈ Mj−i , and 4. For every i ∈ {1, ..., n}, the set of all (cyclic) submodules of Mi is totally ordered by inclusion. 38 D. D. Anderson et al. Proof. =⇒ First, we prove that R is a chained ring. Consider two ideals I and J of R. Then I ⋉n M and J ⋉n M are two ideals of R ⋉n M . Then they are comparable and so are I and J as desired. A similar argument can be used to prove the last assertion. Now, we prove that every ideal of R ⋉n M is homogeneous. Then by Lemma 6.4, we get the other assertions. Consider a nonzero ideal K of R ⋉n M . If Π0 (K) 6= 0, then necessarily 0 ⋉n M ⊂ K. Then by Lemma 4.6, K is homogeneous. Now, let i ≥ 1 be the smallest integer such that Πi (K) 6= 0. If i = n, then by the first assertion of Lemma 5.8, K is homogeneous. If i 6= n, then necessarily 0 ⋉n · · · ⋉ 0 ⋉ Mi+1 ⋉ · · · ⋉ Mn ⊂ K. Thus by the second assertion of Lemma 5.8, K is homogeneous, as desired. ⇐= Using Lemma 5.8, we deduce that any two ideals I and J of R ⋉n M have the forms I = 0 ⋉n · · · ⋉ 0 ⋉ Ii ⋉ Mi+1 ⋉ · · · ⋉ Mn and J = 0 ⋉n · · · ⋉ 0 ⋉ Jj ⋉ Mj+1 ⋉ · · · ⋉ Mn for some i, j ∈ {0, ..., n} where Ii and Jj are submodules of Mi and Mj respectively (here M0 = R). If i 6= j, then obviously I and J are comparable. If i = j, then using the first and the last assertion, we can show that Ii and Jj are comparable and so are I and J, as desired. Using Theorem 6.5 and Corollary 3.8, we get an extension of [9, Theorem 4.16 (4)] which characterizes when R ⋉n M is arithmetical. Recall that a ring S is arithmetical if and only if SP is chained for each prime (maximal) ideal P of S. Also, recall that, for a ring S, an S-module H is called arithmetical if, for each prime (maximal) ideal P of S, the set of submodules of HP is totally ordered by inclusion. Finally, recall the support of an S-module H, supp(H), over a ring S is the set of all prime ideals P of S such that HP 6= 0. Corollary 6.6 The ring R ⋉n M is arithmetical if and only if the following conditions are satisfied: 1. R is arithmetical, 2. For every i ∈ {1, ..., n}, Mi is an arithmetical R-module, 3. For every P ∈ ∪supp(Mi ), RP is a valuation domain, i 4. For every i ∈ {1, ..., n} and every P ∈ supp(Mi ), MiP is a divisible RP -module, and 5. For every 1 ≤ i ≤ j ≤ n, if P ∈ supp(Mi ) ∩ supp(Mj ), then P ∈ supp(Mj−i ) and eMiP = MjP for every e ∈ M(j−i)P . Recall that a ring S is called a generalized ZPI-ring (resp., a π-ring) if every proper ideal (resp., proper principal ideal) of S is a product of prime ideals. An integral domain which is a π-ring is called a π-domain. Clearly, a generalized ZPI-domain is nothing but a Dedekind domain. It is well known (for example, see [28, Sections 39 and 46]) that S is a π-ring (resp., a generalized ZPI-ring, a principal ideal ring (PIR)) if and only if S is a finite direct product n-Trivial Extensions of Rings 39 of the following types of rings: (1) π-domains (resp., Dedekind domains, PIDs) which are not fields, (2) special principal ideal rings (SPIRs) and (3) fields. Our next results extend [9, Lemma 4.9 and Theorem 4.10]. They characterize when R ⋉n M is a π-ring, a generalized ZPI-ring or a PIR. Lemma 6.7 If R ⋉n M is a π-ring (resp., a generalized ZPI-ring, a PIR), then R is a π-ring (resp., a generalized ZPI-ring, a PIR). Hence R = R1 × · · · × Rs where Ri is either (1) a πdomain (resp., a Dedekind domain, a PID) but not a field, (2) an SPIR, or (3) a field. Let Mj,i = (0 × · · · 0 × Rj × 0 × · · · × 0)Mi where 1 ≤ i ≤ n and 1 ≤ j ≤ s. If Ri is a domain or SPIR, but not a field, then Mj,i = 0 while if Ri is a field, Mj,i = 0 or Mj,i ∼ = Ri . Conversely, if R = R1 × · · · × Rs and Mi = M1,i × · · · × Ms,i are as above and R is a π-ring (resp., a generalized ZPI-ring, a PIR), then R ⋉n M is a π-ring (resp., a generalized ZPI-ring, a PIR). Proof. Using Theorem 3.9, the proof is similar to that of [9, Lemma 4.9]. Theorem 6.8 R ⋉n M is a π-ring (resp., a generalized ZPI-ring, a PIR) if and only if R is a π-ring (resp., a generalized ZPI-ring, a PIR) and Mi is cyclic with annihilator Pi1 · · · Pis where Pi1 , ...,Pis are some idempotent maximal ideals of R (if is = 0, Ann(Mi ) = R, that is, Mi = 0). Proof. Similar to the proof of [9, Theorem 4.10]. We end the section with a remark on a question posed in [2]. Recall that a ring R is called m-Boolean for some m ∈ N, if char R = 2 and x1 x2 · · · xm (1 + x1 ) · · · (1 + xm ) = 0 for all x1 , ..., xm ∈ R. Thus Boolean rings are just 1-Boolean rings. It is shown in [2, Theorem 10] that 2-Boolean rings can be represented as trivial extensions. Namely, it is proved that if R is 2-Boolean, then R ∼ = B ⋉ Nil(R) where B = {b ∈ R|b2 = b} ([2, Theorem 10]). Based on this result the following natural question is posed (see [2, page 74]): Whether [2, Theorem 10] can be extended to m-Boolean rings for m ≥ 2? One can ask whether the n-trivial extension is the suitable construction to solve this question. Using [2, Theorem 6], one can show that the amalgamated algebras along an ideal (introduced in [34]) resolve partially this question. Recall that, given a ring homomorphism f : A −→ B and an ideal J of B, the amalgamation of A with B along J with respect to f is the following subring of A × B: A ⊲⊳f B = {(a, f (a) + j)|a ∈ A, j ∈ J}. ˙ where A⊕J ˙ ⊆ A× B is the ring whose underlying group is A⊕ J with Note that A ⊲⊳f B ∼ = A⊕J ′ ′ multiplication given by (a, x)(a , x ) = (aa′ , ax′ + a′ x + xx′ ) for all a, a′ ∈ A and x, x′ ∈ J. Here J is an A-module via f and then ax′ := f (a)x′ and a′ x := f (a′ )x (see [34] for more details). Now, if R is m-Boolean for m ≥ 2, then from [2, Theorems 6 and 7], R = B ⊕ Nil(R) where B = {b ∈ R|b2 = b}. Then ∼ ˙ R∼ = B ⊕Nil(R) = B ⊲⊳i Nil(R) 40 D. D. Anderson et al. where i : B ֒→ R is the canonical injection. Actually any n-trivial extension R ⋉n M can be seen as the amalgamation of R with R ⋉n M along 0 ⋉n M with respect to the canonical injection. This leads to pose the following question for every m ≥ 2: Is any m-Boolean ring an m-trivial extension? 7 Divisibility properties of R ⋉n M Factorization in commutative rings with zero divisors was first investigated in a series of papers by Bouvier, Fletcher and Billis (see References), where the focus had been on the unicity property. The papers [1, 7, 8] marked the start of a systematic study of factorization in commutative rings with zero divisors. Since then, this theory has attracted the interest of a number of authors. The study of divisibility properties of the classical trivial extension has lead to some interesting examples and then to answering several questions (see [9, Section 5]). In this section we are interested in extending a part of this study to the context of n-trivial extensions. First, we recall the following definitions. Let S be a commutative ring and H an S-module. Two elements e, f ∈ H are said to be associates (written e ∼ f ) (resp., strong associates (written e ≈ f ), very strong associates (written e ∼ = f )) if Se = Sf (resp., e = uf for some u ∈ U (S), e ∼ f and either e = f = 0 or e = rf implies r ∈ U (S)). Taking H = S gives the notions of “associates” in S. We say that H is strongly associate if for every e, f ∈ H, e ∼ f ⇒ e ≈ f . When S is strongly associate as an S-module, we also say that S is strongly associate. Finally, recall that H is said to be S-présimplifiable if for r ∈ S and e ∈ H, re = e ⇒ r ∈ U (S) or e = 0. If S is S-présimplifiable we only say that S is présimplifiable. We begin with an extension of [9, Theorem 5.1]. Proposition 7.1 Let R ⊆ S be a ring extension such that U (S) ∩ R = U (R). 1. If S is présimplifiable, then every R-submodule of S is présimplifiable. In particular, R is présimplifiable. 2. Suppose that S = R ⊕ N as an R-module where N is a nilpotent ideal of S which satisfies either N 2 = 0 or N = ⊕ Ni as an R-module where S = R ⊕ N1 ⊕ N2 ⊕ · · · is a graded i∈N ring. Then S is présimplifiable if R is présimplifiable and N is R-présimplifiable. Proof. 1. Let H be an R-submodule of S. Consider e = xe with e ∈ H − {0} and x ∈ R − {0}. Since S is présimplifiable, x ∈ U (S) and so x ∈ U (S) ∩ R = U (R). 2. Let x = rx + nx 6= 0 and y = ry + ny be two elements of R ⊕ N = S where rx , ry ∈ R and nx , ny ∈ N , such that x = yx. Assume that rx 6= 0. Then rx = ry rx implies that ry ∈ U (R) ⊆ U (S), and, since N is nilpotent, y = ry + ny is invertible in S, as desired. Next, assume now that rx = 0. Then nx 6= 0 and so nx = ry nx + ny nx . In the case N 2 = 0, we have n-Trivial Extensions of Rings 41 nx = ry nx . Hence ry ∈ U (R) since N is présimplifiable, and as above y ∈ U (S). Finally, in the case where S = R ⊕ N1 ⊕ N2 ⊕ · · · is a graded ring, we may set nx = ni1 + · · · + nim with {i1 , ..., im } ⊂ N and m ∈ N such that i1 ≤ · · · ≤ im and ni1 6= 0. Then ni1 = ry ni1 which implies that ry ∈ U (R) and similarly as above y ∈ U (S). Proposition 7.2 Let R = ⊕ Ri be a graded ring. i∈N0 1. If R is strongly associate, then R0 is a strongly associate ring and Ri is a strongly associate R0 -module for every i ∈ N. 2. Suppose there exists n ∈ N such that Ri = 0 for every i ≥ n + 1, that is, R = R0 ⋉n R1 ⋉ · · · ⋉ Rn , and assume that R0 is a présimplifiable ring and R1 , ..., Rn−1 are présimplifiable R0 -modules. Then R is strongly associate if and only if Rn is strongly associate. Proof. 1. Let xi , yi ∈ Ri − {0} for i ∈ N0 such that R0 xi = R0 yi . Then Rxi = Ryi . Hence there is u = u0 + u1 + · · · ∈ U (R) such that xi = uyi . Then u0 ∈ U (R0 ) and xi = u0 yi , as desired. 2. Let x = xm +· · ·+xn and y = ym +· · ·+yn be two associate elements of R where m ∈ {0, ..., n} and xi , yi ∈ Ri for i ∈ {m, ..., n} such that xm and ym are nonzero. Then xm ∼ ym . In particular, there is α = α0 + · · · + αn such that x = αy. Then xm = α0 ym . Hence two cases occur. Case m 6= n. Since Rm is présimplifiable, α0 ∈ U (R0 ). Then α ∈ U (R), as desired. Case m = n (i.e., x = xm and y = ym ). Here, the result follows since Rn is strongly associate. Now we can give the extension of [9, Theorem 5.1] to the context of n-trivial extensions. Corollary 7.3 The following assertions are true. 1. R ⋉n M1 ⋉ · · · ⋉ Mn is présimplifiable if and only if R, M1 , ..., Mn are présimplifiable. 2. If R ⋉n M1 ⋉ · · · ⋉ Mn is strongly associate, then R, M1 , ..., Mn are strongly associate. 3. Suppose that R, M1 , ..., Mn are présimplifiable. Then R ⋉n M1 ⋉ · · · ⋉ Mn is strongly associate if and only if Mn is strongly associate. Now we investigate the extension of [9, Theorem 5.4]. It is convenient to recall the following definitions. Let S be a commutative ring. A nonunit a ∈ S is said to be irreducible or an atom (resp., strongly irreducible, very strongly irreducible) if a = bc implies a ∼ b or a ∼ c (resp., a ≈ b or a ≈ c, a ∼ = b or a ∼ = c) and a is said to be m-irreducible if Sa is a maximal element of the set of proper principal ideals of S. Note that, for a nonzero nonunit a ∈ S, a very strongly irreducible ⇒ a is m-irreducible ⇒ a is strongly irreducible ⇒ a is irreducible, but none of these implications can be reversed. In the case of an S-module H, we say that e ∈ H is S-primitive (resp., strongly S-primitive, very strongly S-primitive) if for a ∈ S and f ∈ H, e = af ⇒ e ∼ f (resp., e ≈ f , e ∼ = f ). And e is S-superprimitive if be = af for a, b ∈ S and 42 D. D. Anderson et al. f ∈ H, implies a | b. Note that (1) e is S-primitive ⇔ Se is a maximal cyclic S-submodule of H, (2) e is S-superprimitive ⇒ e is very strongly S-primitive ⇒ e is strongly S-primitive ⇒ e is S-primitive, (3) if Ann(e) = 0, e is S-primitive ⇒ e is very strongly S-primitive, and (4) e is S-superprimitive ⇒ Ann(e) = 0. In the following results the homogeneous element (0, ..., 0, mi , 0, ..., 0) ∈ R ⋉n M where i ∈ {1, ..., n} and mi ∈ Mi − {0}, is denoted by mi . The following result extends [9, Theorem 5.4 (1)]. Proposition 7.4 Let i ∈ {1, ..., n} and mi , ni ∈ Mi − {0}. Then mi ∼ ni (resp., mi ≈ ni , mi ∼ = ni ) in Mi if and only if mi ∼ ni (resp., mi ≈ ni , mi ∼ = ni ) in R ⋉n M . Proof. The assertion is proved similarly to the corresponding classical one. It is worth noting that the analogue of the assertion (4) of [9, Theorem 5.4] does not hold in the context of n-trivial extensions with n ≥ 2. Indeed, consider the 2-trivial extension S = Z4 ⋉2 Z4 ⋉ Z4 . It is easy to show that 1̄ is superprimitive in the Z4 -module Z4 . However, (0̄, 0̄, 1̄) is not very strongly irreducible in S (since (2̄, 1̄, 2̄)2 = (0̄, 0̄, 1̄)). Moreover, even if we assume that R is an integral domain, we still don’t have the desired analogue. For this, take S = Z ⋉2 Z ⋉ Z. We have 1 is superprimitive in the Z-module Z. However, (0, 0, 1) is not very strongly irreducible in S (since (0, 1, 0)2 = (0, 0, 1)). The last example also shows that the assertion (2) of [9, Theorem 5.4] does not hold in the context of n-trivial extensions with n ≥ 2. Namely, if 0 6= mi = mj mk where (mi , mj , mk ) ∈ Mi × Mj × Mk , i ≥ 2 and j, k ∈ {1, ..., i − 1} with j + k = i, then mi cannot be irreducible. Indeed, mi = mj mk but neither mj nor mk are in hmi i ⊆ 0 ⋉n · · · ⋉ 0 ⋉ Mi ⋉ · · · ⋉ Mn . To extend [9, Theorem 5.1 (2)], we need to introduce the following definitions. Definition 7.5 Assume n ≥ 2 and each multiplication in the family ϕ = {ϕi,j } i+j≤n is 1≤i,j≤n−1 not trivial. Let i ∈ {2, ..., n}. An element mi ∈ Mi − {0} is said to be ϕ-indecomposable (or indecomposable relative to the family of multiplications ϕ) if, for every (mj , mk ) ∈ Mj × Mk (where j, k ∈ {1, ..., i − 1} with j + k = i), mi 6= mj mk . If no ambiguity can arise, ϕindecomposable elements are simply called indecomposables. For example, in Z ⋉2 Z ⋉ Q, every element in Q − Z is indecomposable. However, every element x ∈ Z (Z as a submodule of Q) is decomposable (since (0, 1, 0)(0, x, 0) = (0, 0, x)). Definition 7.6 Let i ∈ {2, ..., n}. The R-module Mi is said to be ϕ-integral (or integral relative to the family of multiplications ϕ) if, for every (mj , mk ) ∈ Mj × Mk (where j, k ∈ {1, ..., i − 1} with j + k = i), mj mk = 0 implies that mj = 0 or mk = 0. If no ambiguity can arise, a ϕ-integral R-module is simply called integral. n-Trivial Extensions of Rings 43 For example, for Z ⋉2 Z ⋉ Z, M2 = Z is integral. And, for Z ⋉2 Z ⋉ Z/2Z, Z/2Z is not integral since, for instance, ϕ1,1 (1, 2) = 1 2 = 0. Proposition 7.7 Assume n ≥ 2. Let i ∈ {1, ..., n} and mi ∈ Mi − {0}. If mi is irreducible (resp., strongly irreducible, very strongly irreducible) in R ⋉n M , then mi is primitive (resp., strongly primitive, very strongly primitive) in Mi . Conversely, three cases occur: Case i = 1. The reverse implication holds if R is an integral domain and Mj is torsion-free for every j ∈ {2, ..., n}. Case i = 2 (here n ≥ 2). The reverse implication holds if R is an integral domain, Mj is torsion-free for every j ∈ {1, ..., n} − {2} and m2 is indecomposable. Case i ≥ 3 (here n ≥ 3). The reverse implication holds if R is an integral domain, Mj is torsion-free for every j ∈ {1, ..., n} − {i}, Mj is integral for every j ∈ {2, ..., i − 1}, and mi is indecomposable. Proof. We only prove the primitive (irreducible) case. The two other cases are proved similarly. =⇒ Suppose that mi is irreducible and let mi = ani for some a ∈ R and ni ∈ Mi . Then mi = (a, 0, ..., 0)ni and so (R ⋉n M )mi = (R ⋉n M )ni . This implies that Rmi = Rni , as desired. ⇐= Let mi = (aj )(nj ) for some (aj ), (nj ) ∈ R ⋉n M . Then a0 n0 = 0. First, we show that the case a0 = 0 and n0 = 0 is impossible. Cases i = 1, 2 are easy and are left to the reader. So assume i ≥ 3. Suppose that a0 = 0 and n0 = 0. Then we have the following equalities: For j ∈ {2, ..., i− 1}, a1 nj−1 + a2 nj−2 + · · ·+ aj−1 n1 = 0 and a1 ni−1 + a2 ni−2 + · · ·+ ai−1 n1 = mi . A recursive argument on these equalities shows that, for l ∈ {2, ..., i}, there is k ∈ {0, ..., l − 1} such that (a0 , ..., ak ) = (0, ..., 0) and (n0 , ..., nl−(k+1) ) = (0, ..., 0). Indeed, it is clear this is true for l = 2. Then suppose this is true for a given l ∈ {2, ..., i−1}. So the equality a1 nl−1 +a2 nl−2 + · · · + al−1 n1 = 0 becomes ak+1 nl−(k+1) = 0. Then since Ml is integral, we get the desired result for l + 1. Thus for l = i, we get ak+1 ni−(k+1) = mi which is absurd since mi is indecomposable. Now, we may assume that a0 6= 0 and n0 = 0, so a0 n1 = 0. Since M1 is torsion-free, n1 = 0. Recursively we get nj = 0 for j ∈ {1, ..., i − 1}. Then a0 ni = mi , and since mi is primitive, there exists b0 ∈ R such that ni = b0 mi . It remains to show that there is bj ∈ Mj for j ∈ {1, ..., n − i} such that ni+j = bj mi and this implies that (ni ) = (0, ..., 0, ni , ni+1 , ...) = (b0 , ..., bn−i , 0, ..., 0)mi , as desired. We have a0 ni+1 + a1 ni = 0. Then using both a0 ni = mi and ni = b0 mi , we get a0 ni+1 + a1 b0 a0 ni = 0. Then a0 (ni+1 + a1 b0 ni ) = 0, so ni+1 + a1 b0 ni = 0 (since Mi+1 is torsionfree). Then ni+1 = −a1 b20 mi . Then we set b1 = −a1 b20 and so ni+1 = b1 mi . Similarly, using the equality a0 ni+2 + a1 ni+1 + a2 ni = 0 with the equalities a0 ni = mi and ni = b0 mi , we get a0 ni+2 + a1 b1 a0 ni + a2 b0 a0 ni = 0. So ni+2 + a1 b1 ni + a2 b0 ni = 0, then ni+2 = b2 mi where b2 = −a1 b1 b0 − a2 b20 . Finally, a recursive argument gives the desired result. 44 D. D. Anderson et al. The following result extends [9, Theorem 5.4 (3)]. Proposition 7.8 Suppose that R has a nontrivial idempotent. Then for every i ∈ {1, ..., n} and mi ∈ Mi − {0}, mi is not irreducible in R ⋉n M . Proof. The assertion is proved similarly to the corresponding classical one. Now we are interested in some factorization properties. Recall that a ring S is called atomic if every (nonzero) nonunit of S is a product of irreducible elements (atoms) of S. Note that, as in the domain case, the ascending chain condition on principal ideals (ACCP) implies atomic. We begin with an extension of [9, Theorem 5.5 (2)] which characterizes when a trivial extension of a ring satisfies ACCP. For this, we need the following lemma. Lemma 7.9 Let i ∈ {0, ..., n} and consider two elements a = (0, ..., 0, ai , ai+1 , ..., an ) and b = (0, ..., 0, bi , bi+1 , ..., bn ) of R ⋉n M with ai 6= 0. Then the implication “hai ( hbi ⇒ bi 6= 0 and hai i ( hbi i” is true if either (1) 0 ≤ i ≤ n − 1 and Mi is présimplifiable (here M0 = R) or (2) i = n. Proof. Since hai ( hbi, there is c = (c0 , ..., cn ) ∈ R ⋉n M − U (R ⋉n M ) such that a = cb. Then ai = c0 bi and c0 ∈ / U (R). This shows that hai i ( hbi i in both cases. Theorem 7.10 Assume n ≥ 2. Suppose that Mi is présimplifiable for every i ∈ {0, ..., n − 1} (here M0 = R). Then R ⋉n M satisfies ACCP if and only if R satisfies ACCP and, for every i ∈ {1, ..., n}, Mi satisfies ACC on cyclic submodules. Proof. The proof of the direct implication is easy. Let us prove the converse. Suppose that R ⋉n M admits a strictly ascending chain of principal ideals h(a1,i )i ( h(a2,i )i ( · · · If there exists j0 ∈ N such that aj0 ,0 6= 0. Then for every k ≥ j0 , ak,0 6= 0. Then by Lemma 7.9, we get the following strictly ascending chain of principal ideals of R: haj0 ,0 i ( haj0 +1,0 i ( · · · This is absurd since R satisfies ACCP. Now, suppose that aj,0 = 0 for every j ∈ N and that there exists j1 ∈ N such that aj1 ,1 6= 0. Also, by Lemma 7.9, we obtain the following strictly ascending chain of cyclic submodules of M1 : haj1 ,1 i ( haj1 +1,1 i ( · · · This is absurd since M1 satisfies ACC on cyclic submodules. We continue in this way until the case where we may suppose that aj,i = 0 for every i ∈ {1, ..., n − 1} and every j ∈ N. Therefore, by Lemma 7.9, we get the desired result. n-Trivial Extensions of Rings 45 Now, we investigate when R ⋉n M is atomic. Namely, we give an extension of [9, Theorem 5.5 (4)]. Recall that an R-module N is said to satisfy MCC if every cyclic submodule of N is contained in a maximal (not necessarily proper) cyclic submodule of N . Theorem 7.11 Assume n ≥ 2. Suppose that Mi is présimplifiable for every i ∈ {0, ..., n − 1} (here M0 = R). Then R ⋉n M is atomic if R satisfies ACCP, Mi satisfies ACC on cyclic submodules, for every i ∈ {1, ..., n − 1}, and Mn satisfies MCC. Proof. The proof is slightly more technical than the one of [9, Theorem 5.5 (4)]. Here, we need to break the proof into the following n + 1 steps such that in the step number k ∈ {1, ..., n + 1} we prove that every nonunit element (mi ) ∈ R ⋉n M with m0 = 0,..., mk−2 = 0 and mk−1 6= 0 is a product of irreducibles. We use an inductive argument for the first n steps. Step 1. Suppose there is a nonunit element (mi ) of R ⋉n M with m0 6= 0 and such that (mi ) cannot be factored into irreducibles. Then there exist (a1,i ), (b1,i ) ∈ R ⋉n M − U (R ⋉n M ) such that (mi ) = (a1,i )(b1,i ) and neither (mi ) and (a1,i ) nor (mi ) and (b1,i ) are associate. Since 0 6= m0 = a1,0 b1,0 , a1,0 6= 0 and b1,0 6= 0. Clearly (a1,i ) or (b1,i ) must be reducible, say (a1,i ). Also, for (a1,i ) there are (a2,i ), (b2,i ) ∈ R ⋉n M − U (R ⋉n M ) such that (a1,i ) = (a2,i )(b2,i ) and neither (a1,i ) and (a2,i ) nor (a1,i ) and (b2,i ) are associate. As above, a2,0 6= 0 and b2,0 6= 0 and say (a2,i ) is reducible. So we continue and then we obtain a strictly ascending chain h(mi )i ( h(a1,i )i ( h(a2,i )i ( · · · Using Lemma 7.9, we get a strictly ascending chain of principal ideals of R hm0 i ( ha1,0 i ( ha2,0 i ( · · · This is absurd since R satisfies ACCP. Step j (1 ≤ j ≤ n). Suppose there is a nonunit element (mi ) ∈ R ⋉n M with m0 = 0,..., mj−2 = 0 and mj−1 6= 0 that is not a product of irreducibles. Then there are (a1,i ), (b1,i ) ∈ R ⋉n M − U (R ⋉n M ) such that (mi ) = (a1,i )(b1,i ) and neither (mi ) and (a1,i ) nor (mi ) and (b1,i ) are associate. Then a1,0 b1,j−1 + a1,1 b1,j−2 + · · · + a1,j−2 b1,1 + a1,j−1 b1,0 = mj−1 6= 0. If a1,k = 0 for every k ∈ {0, ..., j − 2}, then necessarily b1,0 6= 0. Hence by the preceding steps, (b1,i ) is a product of irreducibles and then by hypothesis on (mi ), (a1,i ) is reducible. If a1,k 6= 0 for some k ∈ {0, ..., j − 2}, then (a1,i ) is a product of irreducibles and (b1,i ) is reducible. Thus, by symmetry, we may assume that (a1,i ) is reducible and it is not a product of irreducibles. So, necessarily a1,0 = 0,..., a1,j−2 = 0 and a1,j−1 6= 0. We repeat the last argument so that we obtain a strictly ascending chain of principal ideals of R ⋉n M h(mi )i ( h(a1,i )i ( h(a2,i )i ( · · · 46 D. D. Anderson et al. such that, for every k ∈ N, ak,0 = 0,..., ak,j−2 = 0 and ak,j−1 6= 0. Then, by Lemma 7.9, we get a strictly ascending chain of cyclic submodules of Mj−1 hmj−1 i ( ha1,j−1 i ( ha2,j−1 i ( · · · which is absurd by hypothesis on Mj−1 , as desired. Step n + 1. It remains to prove that every element of R ⋉n M of the form (0, ..., 0, mn ) with mn 6= 0 is a product of irreducibles. Since Mn satisfies MCC, Rmn ⊆ Rm where Rm is a maximal cyclic submodule of Mn . Then mn = am for some a ∈ R − {0} and so (0, ..., 0, mn ) = (a, 0, ..., 0)(0, ..., 0, m). Now, a 6= 0 shows that (a, 0, ..., 0) is a product of irreducibles (by Step 1) and Rm is maximal shows that either (0, ..., 0, m) is irreducible or (0, ..., 0, m) = (ai )(bi ) where ak 6= 0 and bl 6= 0 for some k, l ∈ {0, ..., n − 1}. Then by the preceding steps, (ai ) and (bi ) are products of irreducibles and hence so is (0, ..., 0, m). This concludes the proof. A ring S is said to be a bounded factorial ring (BFR) if, for each nonzero nonunit x ∈ S, there is a natural number N (x) so that for any factorization x = x1 · · · xs where each xi is a nonunit, we have s ≤ N (x). For domains we say BFD instead of BFR. Recall that an S-module H is said to be a BF-module if, for each nonzero h ∈ H, there exists a natural number N (h) so that h = a1 · · · as−1 hs (each ai a nonunit) ⇒ s ≤ N (h). Our next theorem, which is a generalization of [9, Theorem 5.5 (4)], investigates when R ⋉n M is BFR. It is based on the following lemma. Lemma 7.12 For j ∈ N − {1}, a product of j elements of R ⋉n M of the form (0, x1 , ..., xn ) is of the form (0, ..., 0, yj , ..., yn ) (where, if j ≥ n + 1 the product is zero). Theorem 7.13 Assume that n ≥ 2, R is an integral domain and Mi is torsion-free for every i ∈ {1, ..., n − 1}. Then R ⋉n M is a BFR if and only if R is a BFD and Mi is a BF-module for every i ∈ {1, ..., n}. Proof. =⇒ Clear. ⇐= Let (mi ) be a nonzero nonunit element of R ⋉n M and suppose we have a factorization into nonunits (mi ) = (a1,i ) · · · (as,i ) for some s ∈ N. If m0 6= 0, m0 = a1,0 · · · as,0 implies that s ≤ N (m0 ). Otherwise, there is j ∈ {1, ..., n} such that m0 = 0,..., mj−1 = 0 and mj 6= 0. We may assume that s ≥ j + 1. Since R is an integral domain and by Lemma 7.12, we may assume there is k ∈ {1, ..., j} such that al,0 = 0 for every l ∈ {1, ..., k} and al,0 6= 0 for every k s Q Q l ∈ {k + 1, ..., s}. Let (0, ..., 0, bk , ..., bn ) = (al,i ) and (c0 , ..., cn ) = (al,i ). Since Mi is l=1 torsion-free for every i ∈ {1, ..., j − 1} and c0 = Then mj = c0 bj = s Q s Q l=k+1 al,0 6= 0, bk = 0,...,bj−1 = 0 and bj 6= 0. l=k+1 al,0 bj . Therefore s ≤ N (mj ) + k − 1 (since Mj is a BF-module). l=k+1 n-Trivial Extensions of Rings 47 Now we investigate the notion of a U -factorization. It was introduced by Fletcher [35, 36] and developed by Axtell et al. in [11] and [12]. Let S be a ring and consider a nonunit a ∈ S. By a factorization of a we mean a = a1 · · · as where each ai is a nonunit. Recall from [35] that, for a ∈ S, U (a) = {r ∈ S | ∃s ∈ S with rsa = a} = {r ∈ S | r(a) = (a)}. A U -factorization of a is a factorization a = a1 · · · as b1 · · · bt where, for every 1 ≤ i ≤ s, ai ∈ U (b1 · · · bt ) and, for every 1 ≤ i ≤ t, bi ∈ / U (b1 · · · bˆi · · · bt ). We denote this U -factorization by a = a1 · · · as ⌈b1 · · · bt ⌉ and call a1 ,...,as (resp., b1 ,...,bt ) the irrelevant (resp., the relevant) factors. Our next result investigates when an n-trivial extension is a U -FFR. First, recall the following definitions. A ring S is called a finite factorization ring (FFR) (resp., a U -finite factorization ring (U -FFR)) if every nonzero nonunit of S has only a finite number of factorizations (resp., U -factorizations) up to order and associates (resp., associates on the relevant factors). A ring S is called a weak finite factorization ring (WFFR) (resp., a U -weak finite factorization ring (U -WFFR)) if every nonzero nonunit of R has only a finite number of nonassociate divisors (resp., nonassociate relevant factors). We have FFR ⇒ WFFR and the converse holds in the domain case. But Z2 × Z2 is a WFFR that is not an FFR. However, from [11, Theorem 2.9], U -FFR ⇔ U -WFFR. The study of the notions above on the classical trivial extensions has lead to consider the following notion (see [11]). Let N be an S-module. For a nonzero element x ∈ N , we say that Sd1 d2 · · · ds x is a reduced submodule factorization if, for every j ∈ {1, ..., s}, dj 6∈ U (S) and for no cancelling and reordering of the dj ’s is it the case that Sd1 d2 · · · ds x = Sd1 d2 · · · dt x where t < s. The module N is said to be a U -FF module if for every nonzero element x ∈ N , there exist only finitely many reduced submodule factorizations Sx = Sd1 d2 · · · dt xk , up to order and associates on the di , as well as up to associates on the xk . In our context, we introduce the following definition. Definition 7.14 Assume n ≥ 2 and consider i ∈ {1, ..., n}. 1. Let mi ∈ Mi −{0}, s ∈ N and (di1 , ..., dis ) ∈ Mi1 ×· · ·×Mis where {i1 , i2 , ..., is } ⊆ {0, ..., n} with i1 + · · · + is = i. We say that Rdi1 di2 · · · dis mi ⊆ Mi is a ϕ-reduced submodule factorization if, for every j ∈ {1, ..., s} such that ij = 0, dij 6∈ U (R) and for no cancelling and reordering of the dj ’s is it the case that Rdi1 di2 · · · dis = Rdi1 di2 · · · dit where t < s. If no ambiguity can arise, a ϕ-reduced submodule factorization is simply called a reduced submodule factorization. 2. The R-module Mi is said to be a ϕ-U -FF module (or simply U -FF module) if, for every nonzero element x ∈ Mi , there exist only finitely many reduced submodule factorizations Rx = Rdi1 di2 · · · dis , up to order and associates on the dij . It is clear that, for i = 1, the notion of U -FF module defined here is the same as the Axtell’s one. 48 D. D. Anderson et al. Based on the proof of [11, Theorem 4.2], it is asserted in [12, Theorem 3.6] that, if R ⋉1 M1 is a U -FFR, then for every nonzero nonunit d ∈ R, there are only finitely many distinct principal ideals h(d, m)i in R ⋉1 M1 . However, a careful reading of this proof shows that the case of ideals h(d, m)i with dM1 = 0 should be also treated. One can confirm the validity of this assertion for reduced rings. However, the context of n-trivial extensions seems to be more complicated. Nevertheless, under some certain conditions, we next investegate when R ⋉n M is a U -FFR. Lemma 7.15 Assume n ≥ 2 and Mn is integral. Then for every nonzero nonunit d ∈ R, the following assertions are true. 1. For every i ∈ {1, ..., n − 1}, the following assertions are equivalent: 1.a. dMi = 0. 1.b. dmi = 0 for some mi ∈ Mi − {0}. 1.c. dMn−i = 0. 1.d. dmn−i = 0 for some mn−i ∈ Mn−i − {0}. 2. The following assertions are equivalent: 2.a. dMi = 0 for some i ∈ {1, ..., n − 1}. 2.b. dMi = 0 for every i ∈ {1, ..., n − 1}. 3. If dMn = 0, then dMi = 0 for every i ∈ {1, ..., n − 1}. 4. If Mn is torsion-free, then Mi is torsion-free for every i ∈ {1, ..., n − 1}. Proof. (1). For the implications (1.a) ⇒ (1.b) and (1.c) ⇒ (1.d) there is nothing to prove. (1.b) ⇒ (1.c). Let m ∈ Mn−i . Then dmi m = 0 ∈ Mn . Therefore dm = 0 (since Mn is integral and mi 6= 0). (1.d) ⇒ (1.a). Similar to the previous proof. (2). For the implication (2.b) ⇒ (2.a) there is nothing to prove. (2.a) ⇒ (2.b). First, we prove that dM1 = 0. For every m1 ∈ M1 − {0}, dmi1 = 0 ∈ Mi and so dmn1 = 0 ∈ Mn . Therefore dm1 = 0 (since Mn is integral and m1 6= 0). Now, consider any j ∈ {1, ..., n − 1} and any mj ∈ Mj − {0}. Then for every m1 ∈ M1 − {0}, dmj m1n−j = 0 ∈ Mn which shows that dmj = 0. (3). This is proved as above. (4). If there is m1 ∈ M1 − {0} and r ∈ R − {0} such that rm1 = 0, then rmn1 = 0 ∈ Mn . Since Mn is torsion-free and r 6= 0, mn1 = 0 ∈ Mn so m1 = 0 (since Mn is integral). This is absurd since m1 6= 0. Finally, by assertions (1) and (2), we conclude that Mi is torsion-free for every i ∈ {1, ..., n − 1}. n-Trivial Extensions of Rings 49 Theorem 7.16 Assume n ≥ 2. If R ⋉n M is a U -FFR (equivalently, a U -WFFR), then the following conditions are satisfied: 1. R is an FFR. 2. Mi is a U -FF module for every i ∈ {1, ..., n}. Moreover, if R is an integral domain and Mn is integral and torsion-free, then 3. For every nonzero nonunit d ∈ R, there are only finitely many distinct principal ideals h(d, m1 , ..., mn )i in R ⋉n M . 4. For every i ∈ {1, ..., n − 1} and every m ∈ Mi − {0}, there are only finitely many distinct principal ideals h(0, ..., 0, m, mi+1 , ..., mn )i in R ⋉n M . Conversely, if R is an integral domain and Mn is integral and torsion-free, then the assertions (1)-(4) imply that R ⋉n M is a U -FFR. Proof. The proof of the “converse” part is similar to the corresponding one of [11, Theorem 4.2]. =⇒ The proof of each (1) and (2) is similar to that given in [11, Theorem 4.2]. 3. Suppose, by contradiction, there exists a nonzero nonunit d ∈ R for which there is a family of distinct principal ideals of the form h(d, mj,1 , ..., mj,n )i where j is in an infinite indexing set Γ. We prove this is impossible by showing that, for every j 6= k in Γ, there exists (1, x1 , ..., xn ) ∈ R ⋉n M such that (d, mj,1 , ..., mj,n ) = (1, x1 , ..., xn )(d, mk,1 , ..., mk,n ). A recursive argument shows that the fact that every equation dX = bi , with bi ∈ Mi admits a solution X ∈ Mi implies the existence of the desired (1, x1 , ..., xn ). Note that, from Lemma 7.15, Mi is torsion-free for every i ∈ {1, ..., n}. First, consider an element bn ∈ Mn − {0}. For every j ∈ Γ, (d, mj,1 , ..., mj,n )(0, ..., 0, bn ) = (0, ..., 0, dbn ). Then (0, ..., 0, dbn ) = (d, mj,1 , ..., mj,n )⌈(0, ..., 0, bn )⌉ is the only possible corresponding U -factorization of (0, ..., 0, dbn ) (since R ⋉n M is a U -FFR), so there exists r ∈ R such that bn = drbn . This shows that the above equation admits a solution for i = n. Now consider k ∈ {1, ..., n−1} and any bk ∈ Mk . For every bn−k ∈ Mn−k − {0}, bk bn−k ∈ Mn − {0} and so there is r ∈ R such that bk bn−k = drbk bn−k . Then (bk − drbk )bn−k = 0. Therefore bk = drbk (since Mn is integral). 4. Let i ∈ {1, ..., n − 1}. Suppose, by contradiction, there exists m ∈ Mi − {0}, for which there is a family of distinct principal ideals of the form h(0, ..., 0, m, mj,i+1 , ..., mj,n )i where j is in an infinite indexing set Γ. Let mn−i ∈ Mn−i − {0}. Necessarily, mmn−i 6= 0. Then (0, ..., 0, m, mj,i+1 , ..., mj,n )(0, ..., 0, mn−i , 0..., 0) = (0, ..., 0, mmn−i ). Then (0, ..., 0, mmn−i ) = (0, ..., 0, m, mj,i+1 , ..., mj,n )⌈(0, ..., 0, mn−i , 0..., 0)⌉ is the only possible corresponding U -factorization of (0, ..., 0, mmn−i ) (since R ⋉n M is a U -FFR), so there exists (r0 , r1 , ..., rn ) such that (0, ..., 0, m, mj,i+1 , ..., mj,n )(r0 , r1 , ..., rn )(0, ..., 0, mn−i , 0..., 0) = (0, ..., 0, mn−i , 0..., 0), 50 D. D. Anderson et al. equivalently (0, ..., 0, r0 mmn−i ) = (0, ..., 0, mn−i , 0..., 0), which is absurd. A ring S is called a U -bounded factorization ring (U -BFR) if, for each nonzero nonunit x ∈ S, there is a natural number N (x) so that, for any factorization x = a⌈b1 · · · bt ⌉, we have t ≤ N (x). An S-module H is said to be a U -BF module if for every h ∈ H − {0} there exists a natural number N (h) so that if Sh = Sd1 · · · dt h′ where dj 6∈ U (S), t > N (h) and h′ ∈ H, then, after cancellation and reordering of some of the dj ’s we have Sh = Sd1 · · · ds h′ for some s ≤ N (h). The question of when the classical trivial extension is a U -BFR is still open. However, there is an answer to this question for an integral domain D [11, Theorem 4.4]: For a D-module N , D ⋉ N is a U -BFR if and only if D is a BFD and N is a U -BF R-module. Two more general results for the direct implication were established in [12, Theorem 3.7 and Lemma 3.8]. Here, we extend these results to our context. For this we need to introduce the following definition. Definition 7.17 Assume n ≥ 2 and consider i ∈ {1, ..., n}. The R-module Mi is said to be a ϕ-U -BF module (or simply a U -BF module) if, for every nonzero element x ∈ Mi , there exists a natural number N (x) so that if Rx = Rdi1 di2 · · · dit where t ∈ N, (di1 , ..., dit ) ∈ Mi1 × · · · × Mit for some {i1 , i2 , ..., it } ⊆ {0, ..., n} with i1 + · · · + it = i, dij 6∈ U (R) when ij = 0, and t > N (x), then, after cancellation and reordering of some of the dij ’s in R, we have Rx = Rdi1 di2 · · · dis for some s ≤ N (h). Theorem 7.18 If R ⋉n M is a U -BFR, then R is a U -BFR and Mi is a U -BF module for every i ∈ {1, ..., n}. Moreover, if R is présimplifiable, then R is a BFR. Conversely, assume R to be an integral domain. If R is a BFD and for every i ∈ {1, ..., n}, Mi is a U -BF module, then R ⋉n M is a U -BFR. Proof. Similar to the classical case. A ring S is called U -atomic if every nonzero nonunit element of S has a U -factorization in which all the relevant factors are irreducibles. The question of when the classical trivial extension is U -atomic is still unsolved. In [11, Theorem 4.6], Axtell gave an answer to this question for an integral domain D with ACCP: For a D-module N , D ⋉ N is atomic if and only if D ⋉ N is U -atomic. In [12, Theorem 3.15], it is shown that the condition that the ring is an integral domain could be replaced by the ring is présimplifiable. The following result gives an extension of [12, Theorem 3.15] to the context of n-trivial extensions. Theorem 7.19 Assume n ≥ 2. Suppose that Mi is is présimplifiable for every i ∈ {0, ..., n − 1} (here M0 = R), R satisfies ACCP and Mi satisfies ACC on cyclic submodules for every i ∈ {1, ..., n − 1}. Then R ⋉n M is atomic if and only if R ⋉n M is U -atomic. Proof. =⇒ Clear. ⇐= Suppose that R ⋉n M is not atomic. Then by the proof of Theorem 7.11, there exists mn := (0, ..., 0, mn ) ∈ R ⋉n M with mn 6= 0 which is not a product of irreducibles. Since R ⋉n M n-Trivial Extensions of Rings 51 is U -atomic, mn admits a U -factorization of the form mn = a1 · · · as ⌈b1 · · · bt ⌉ such that the bl ’s are irreducibles. Since mn cannot be a product of irreducibles and by the proof of Theorem 7.11, necessarily s = 1 and a1 has the form xn := (0, ..., 0, xn ). But xn hb1 · · · bt i = hb1 · · · bt i and so b1 · · · bt has the form yn := (0, ..., 0, yn ). This is impossible since mn = xn yn = 0. References [1] A. G. Aḡargüm, D. D. Anderson and S. Valdes-Leon, Factorization in commutative rings with zero divisors, III, Rocky Mountain J. Math. 31 (2001), 1–21. [2] D. D. Anderson, Generalizations of Boolean rings, Boolean-like rings and von Neumann regular rings, Comment. Math. Univ. St. Paul. 35 (1986), 69–76. [3] D. D. Anderson, M. Axtell, S. J. Forman and J. Stickles, When are associates unit multiples?, Rocky Mountain J. Math. 34 (2004), 811-828. [4] D. D. Anderson and R. Markanda, Unique factorization rings with zero divisors, Houston J. Math. 11 (1985), 15–30. [5] D. D. Anderson and R. Markanda, Unique factorization rings with zero divisors: Corrigendum, Houston J. Math. 11 (1985), 423–426. [6] D. D. Anderson and J. Pascual, Regular ideals in commutative rings, sublattices of regular ideals, and Prüfer rings, J. Algebra 111 (1987), 404–426. [7] D. D. Anderson and S. Valdes-Leon, Factorization in commutative rings with zero divisors, Rocky Mountain J. Math. 26 (1996), 439–480. [8] D. D. Anderson and S. Valdes-Leon, Factorization in commutative rings with zero divisors, II, Factorization in integral domains, Lecture Notes in Pure and Appl. Math., 189, Marcel Dekker, New York, (1997), 197–219. [9] D. D. Anderson and M. Winders, Idealization of a module, J. Commut. Algebra 1 (2009), 3–56. [10] P. Ara, W. K. Nicholson and M. F. Yousif, A look at the Faith-Conjecture, Glasgow Math. J. 42 (2001), 391–404. [11] M. Axtell, U-factorizations in commutative rings with zero divisors, Comm. Algebra 30 (2002), 1241–1255. [12] M. Axtell, S. Forman, N. Roersma, and J. Stickles, Properties of U-factorizations, Int. J. Commut. Rings 2 (2003), 83–99. 52 D. D. Anderson et al. [13] V. Barucci, M. D’Anna and F. Strazzanti, A family of quotients of the Rees algebra, Comm. Algebra 43 (2015), 130–142. [14] D. Bennis, J. Mikram and F. Taraza, On the extended zero divisor graph of commutative rings, Turk. J. Math. 40 (2016), 376–388. [15] M. Billis, Unique factorization in the integers modulo n, Amer. Math. Monthly 75 (1968), 527. [16] G. F. Birkenmeier, H. E. Heatherly, J. Y. Kim and J. K. Park, Triangular matrix representations, J. Algebra 230 (2000), 558–595. [17] G. F. Birkenmeier, J. K. Park and S. T. Rizvi, Extensions of Rings and Modules, Springer Science+Business Media, New York, 2013. [18] A. Bouvier, Demi-groupes de type (R). Demi-groupes commutatifs à factorisation unique, C. R. Acad. Sci. Paris 268 (1969), 372–375. [19] A. Bouvier, Demi-groupes de type (R), C. R. Acad. Sci. Paris 270 (1969), 561–563. [20] A. Bouvier, Factorisation dans les demi-groupes de fractions, C. R. Acad. Sci. Paris 271 (1970), 924–925. [21] A. Bouvier, Factorisation dans les demi-groupes, C. R. Acad. Sci. Paris 271 (1970), 533– 535. [22] A. Bouvier, Anneaux présimplifiables et anneaux atomiques, C. R. Acad. Sci. Paris Sér. A-B 272 (1971), 992–994. [23] A. Bouvier, Sur les anneaux de fractions des anneaux atomiques présimplifiables, Bull. Sci. Math. 95 (1971), 371–377. [24] A. Bouvier, Sur les anneaux de fractions des anneaux atomiques présimplifiables, Bull. Sci. Math. 95 (1971), 371–377. [25] A. Bouvier, Anneaux de Gauss, C. R. Acad. Sci. Paris 273 (1971), 443–445. [26] A. Bouvier, Remarques sur la facatorisation dans les anneaux commutatifs, Pub. Dépt. Math. Lyon 8 (1971), 1–18. [27] A. Bouvier, Résultats nouveaux sur les anneaux présimplifiables, C. R. Acad. Sci. Paris 275 (1972), 955–957. [28] A. Bouvier, Anneaux présimplifiables, C. R. Acad. Sci. Paris Sér. A-B 274 (1972), 1605– 1607. n-Trivial Extensions of Rings 53 [29] A. Bouvier, Résultats nouveaux sur les anneaux présimplifiables, C. R. Acad. Sci. Paris Sér. A-B 275 (1972), 955–957. [30] A. Bouvier, Anneaux présimplifiables, Rev. Roumaine Math. Pures Appl. 19 (1974), 713– 724. [31] A. Bouvier, Structure des anneaux à factorisation unique, Pub. Dépt. Math. Lyon 11 (1974), 39–49. [32] A. Bouvier, Sur les anneaux principaux, Acta. Math. Sci. Hung. 27 (1976), 231–242. [33] V. Camillo, I. Herzog and P. P. Nielsen, Non-self-injective injective hulls with compatible multiplication, J. Algebra 314 (2007), 471–478. [34] M. D’Anna, C. A. Finocchiaro, M. Fontana, Amalgamated algebras along an ideal, in Commutative Algebra and Applications, Proceedings of the Fifth International Fez Conference on Commutative Algebra and Applications, Fez, Morocco, 2008, W. de Gruyter Publisher, Berlin 2009, 155–172. [35] C. R. Fletcher, Unique factorization rings, Proc. Camb. Phil. Soc. 65 (1969), 579–583. [36] C. R. Fletcher, The structure of unique factorization rings, Proc. Camb. Phil. Soc. 67 (1970), 535–540. [37] C. R. Fletcher, Euclidean rings, J. London Math. Soc. 41 (1971), 79–82. [38] J. A. Huckaba, Commutative Rings with Zero Divisors, Monographs and Textbooks in Pure and Applied Mathematics 117, Marcel Dekker, Inc., New York, 1988. [39] A. McQueen, Factorization in rings of upper-triangular Toeplitz matrices, Master’s thesis, University of Central Missouri, 2014. [40] M. Nagata, Local Rings, Interscience Publishers, New York-London-Sydney, 1962. [41] C. Nastasescu and F. Van Oystaeyen, Methods of Graded Rings, Lecture Notes in Math. 1836, Springer-Verlag, Berlin, 2004. [42] D. G. Northcott, Lessons on Rings, Modules, and Multiplicities, Cambridge Univ. Press, Cambridge, 1968. [43] Z. Pogorzaly, A generalization of trivial extension algebras, J. Pure Appl. Algebra 203 (2005), 145–165. [44] P. Ribenboim, Rings of generalized power series. II. Units and zero-divisors, J. Algebra 168 (1994), 71–89.
0math.AC
FFT Algorithm for Binary Extension Finite Fields and its Application to Reed-Solomon Codes arXiv:1503.05761v3 [cs.IT] 14 Aug 2016 Sian-Jheng Lin, Member, IEEE, Tareq Y. Al-Naffouri, Member, IEEE, and Yunghsiang S. Han, Fellow, IEEE specifically, since the practical implementations of RS codes are typically over binary extension finite fields, the complexity of RS codes over those fields has received more attentions than that over others [6][7]. Abstract—Recently, a new polynomial basis over binary extension fields was proposed such that the fast Fourier transform (FFT) over such fields can be computed in the complexity of order O(n lg(n)), where n is the number of points evaluated in FFT. In this work, we reformulate this FFT algorithm such that it can be easier understood and be extended to develop frequencydomain decoding algorithms for (n = 2m , k) systematic ReedSolomon (RS) codes over F2m , m ∈ Z+ , with n − k a power of two. First, the basis of syndrome polynomials is reformulated in the decoding procedure so that the new transforms can be applied to the decoding procedure. A fast extended Euclidean algorithm is developed to determine the error locator polynomial. The computational complexity of the proposed decoding algorithm is O(n lg(n − k) + (n − k) lg2 (n − k)), improving upon the best currently available decoding complexity O(n lg2 (n) lg lg(n)), and reaching the best known complexity bound that was established by Justesen in 1976. However, Justesen’s approach is only for the codes over some specific fields, which can apply Cooley-Tucky FFTs. As revealed by the computer simulations, the proposed decoding algorithm is 50 times faster than the conventional one for the (216 , 215 ) RS code over F216 . The conventional syndrome-based RS decoding algorithm has quadratic complexities. Some fast approaches [8][9] are based on FFTs or fast polynomial arithmetic techniques. However, the structures of FFTs over finite fields vary with the sizes of fields Fq . When q−1 is a smooth number, meaning that q−1 can be factorized into many small primes, the Cooley-Tucky FFT in O(n lg(n)) field additions and field multiplications can be applied. A conventional case involves choosing Fermat primes q ∈ {2m + 1|m = 1, 2, 4, 8, 16}. Based on such FFTs, Justesen [8] gave an O(n lg2 (n)) approach for decoding (n, k) RS code over F2m +1 . Another approach to solve the key equations of BCH codes was proposed by Pan [10], and it reduces a factor of lg n when the characteristic of the field is large enough. However, the algorithm [10] does not have improvement for the codes over binary extension fields. If q − 1 is not smooth, Cooley-Tucky FFTs are inapplicable. In this case, the FFTs over arbitrary fields [11][12] can be applied and it requires O(n lg(n) lg lg(n)) field operations. Gao [9] presented an O(n lg2 (n) lg lg(n)) RS decoding algorithm over arbitrary fields, by utilizing fast polynomial multiplications [13]. Further, for the codes over F2m , the additive FFT [14], that requires O(n lg(n) lg lg(n)) operations, can be applied to reduce the leading constant further. To authors’ knowledge, the additive FFT [14] is the fastest algorithm over F2m so far. I. I NTRODUCTION Reed-Solomon (RS) codes are a class of block errorcorrecting codes that were invented by Reed and Solomon [1] in 1960. An (n, k) RS code is constructed over Fq , for n = q − 1. Its extended version, called extended ReedSolomon codes [2], admits a codeword length of up to n = q or n = q + 1. The systematic version of (n, k) RS code appends n − k parity symbols to the k message symbols, forming a codeword of length n. RS codes are maximum distance separable (MDS). (n, k) RS codes can correct up to b(n − k)/2c erroneous symbols. Nowadays, RS codes have numerous important applications, including barcodes (such as QR codes), storage devices (such as Blu-ray Discs), digital television (such as DVB and ATSC), and data transmission technologies (such as DSL and WiMAX). RS codes are also used to design other forward error correction codes, such as regenerating codes [3][4] and local reconstruction codes [5]. The wide range of applications of RS codes raises an important issue concerning their computational complexity. More As RS codes are typically constructed over binary extension fields, we consider this case in this paper. Clearly, if one wants to remove the extra factor lg lg(n) in the RS algorithms over binary extension fields, the FFTs in O(n lg(n)) are required. Recently, Lin et al. [15] showed a new way to solve aforementioned FFT problem. The paper [15] defined a new polynomial basis based on subspace polynomials over F2m . For a polynomial of degree less than h in this new basis, the h-point multipoint evaluations can be made in O(h lg(h)) field operations. Based on the multipoint evaluation algorithm, encoding/erasure decoding algorithms for (n, k) RS codes [15] were proposed to achieve O(n lg(n)). However, the errorcorrection RS decoding algorithm based on the new basis was not yet provided. This work was supported in part by CAS Pioneer Hundred Talents Program and the National Science of Council (NSC) of Taiwan under Grants NSC 1022221-E-011-006-MY3, NSC 101-2221-E- 011-069-MY3. S.-J. Lin is with the School of Information Science and Technology, University of Science and Technology of China (USTC), Hefei, China and the Electrical Engineering Department, King Abdullah University of Science and Technology (KAUST), Kingdom of Saudi Arabia (e-mail: [email protected]), Tareq Y. Al-Naffouri is with the Electrial Engineering Department at King Abdullah University of Science and Technology (KAUST), Thuwal, Makkah Province, Kingdom of Saudi Arabia. (e-mail: [email protected]), and Y. Han is with the Department of Electrical Engineering, National Taiwan University of Science and Technology, Taipei, Taiwan. (e-mail: [email protected]). This paper develops an error correction decoding algorithm for (n = 2m , k) RS codes over F2m , for k/n ≥ 0.5 and (n−k) 1 a power of two.1 In practice RS codes usually have rates k/n ≥ 0.5. The complexity of the proposed algorithm is given by O(n lg(n − k) + (n − k) lg2 (n − k)). Holding constant the code rate k/n yields a complexity O(n lg2 (n)), which is better than the best existing complexity of O(n lg2 (n) lg lg(n)), that was achieved by Gao [9] in 2002. The algorithm is based on the non-standard polynomial basis [15]. To embed the new basis into the decoding algorithm, we reformulate the decoding formulas such that all arithmetics are performed on the new basis. The key equation is solved by the Euclidean algorithm, and thus the fast polynomial divisions, as well as the Euclidean algorithm in the new basis are proposed. Finally, we combine those algorithms, resulting in a fast errorcorrection RS decoding algorithm. The major contributions of this paper are summarized as follows. 1) An alternative description of the algorithms [15] for the new polynomial basis is presented. 2) An O(h lg(h)) fast polynomial division in the new basis is derived. 3) An O(h lg2 (h)) fast half-GCD algorithm in the new basis is presented. 4) An O(n lg(n − k)) RS encoding algorithm is presented, for n − k a power of two. 5) A syndrome-based RS decoding algorithm that is based on the new basis is demonstrated. 6) An O(n lg(n − k) + (n − k) lg2 (n − k)) RS decoding algorithm is presented, for n − k a power of two. Notably, [15] gave the encoding algorithms for RS codes with the complexity O(n lg(k)), for k a power of two. The encoding algorithm [15] is suitable for coding rate k/n ≤ 0.5; however, the proposed encoding algorithm in this work is suitable for k/n ≥ 0.5. The rest of this paper is organized as follows. Section II reviews the definitions of the polynomial basis. The multipoint evaluation algorithm is provided in Sec. III. Section IV provides an alternative polynomial basis that is constructed using monic polynomials. The polynomial operations that are used in the encoding/decoding of RS codes are explicated. Section V presents the fast extended Euclidean algorithm that is based on the half-GCD method. Section VI and Section VII introduce the algorithms for encoding and decoding RS codes. Section VIII presents simulations and draws conclusions. where v k = (v0 , v1 , . . . , vk−1 ) is a basis of space Vk , and k ≤ m. We can form a strictly ascending chain of subspaces given by {0} = V0 ⊂ V1 ⊂ V2 ⊂ · · · ⊂ Vm = F2m . m Let {ωi }2i=0−1 denote the elements of F2m . Each element is defined as ωi = i0 · v0 + i1 · v1 + · · · + im−1 · vm−1 , where ij ∈ {0, 1} is the binary representation of i. That is, i = i0 + i1 · 2 + · · · + im−1 · 2m−1 , ∀ij ∈ {0, 1}. k This implies that Vk = {ωi }2i=0−1 , for k = 0, 1, . . . , m. Note that ω0 = 0 is the additive identity in the filed. In this work, ω0 and 0 will be used interchangeably when there is no confusion. The subspace polynomial [14, 16, 17] of Vk is defined as Y sk (x) = (x − a), (2) a∈Vk and it is clear to see that deg(sk (x)) = 2k . For example, s0 (x) = x, and s2 (x) = x(x − v0 )(x − v1 )(x − v0 − v1 ). The properties of sk (x) are given in [16, 18]. Theorem 1 ([16, 18]). (i). sk (x) is an F2 -linearlized polynomial for which k X i sk (x) = sk,i x2 , (3) i=0 with each sk,i ∈ F2m . This implies that sk (x + y) = sk (x) + sk (y), ∀x, y ∈ F2m . (4) (ii). The formal derivative of sk (x) is a constant Y s0k (x) = a. (5) a∈Vk \{0} The recursive form [16] of subspace polynomials is given by s0 (x) = x; sj (x) = sj−1 (x)sj−1 (x − vj−1 ) =(sj−1 (x))2 − sj−1 (vj−1 )sj−1 (x) j = 1, 2, . . . , m. m Let X̄ = {X̄0 (x), X̄1 (x), . . . , X̄2m −1 (x)} denote a basis of m F2m [x]/(x2 − x). Each X̄i (x) is defined as This section reviews the subspace polynomials over F2m , and the polynomial basis defined in [15]. X̄i (x) = Xi (x)/pi , A. Subspace polynomial (8) where Let F2m denote an extension finite field with dimension m over F2 . Let v = (v0 , v1 , . . . , vm−1 ) denote a basis of F2m . That is, all vi ∈ F2m are linearly independent over F2 . A k-dimensional space Vk of F2m is defined as ={i0 · v0 + i1 · v1 + · · · + ik−1 · vk−1 |∀ij ∈ {0, 1}}, (7) B. Polynomial basis II. P OLYNOMIAL BASIS IN F2m [x]/x2 − x Vk = Span(v k ) (6) Xi (x) = m−1 Y j=0 (sj (x))ij , pi = m−1 Y (sj (vj ))ij , (9) j=0 and each ij ∈ {0, 1} is the binary representation of i. Notice that (sj (x))0 = (sj (vj ))0 = 1. For example, X̄0 (x) = 1, and X̄3 (x) = X3 (x)/p3 = (s0 (x)s1 (x))/(s0 (v0 )s1 (v1 )). It can be seen that deg(X̄i (x)) = i, and thus the basis X̄ can represent m all elements in F2m [x]/(x2 − x). (1) 1 There are many (n, k) can be chosen when n = 2m , k = 2m −2t , where t < m. 2 Algorithm 1 Transform of the basis X̄ Input: FFTX̄ (D̄2k , k, β): D̄2k = (d¯0 , d¯1 , . . . , d¯2k −1 ), k is the binary logarithm of size, and β ∈ F2m Output: 2k evaluations D2k = (d0 , d1 , . . . , d2k −1 ), where each di = D̄2k (ωi + β) 1: if k = 0 then return d¯0 2: end if 3: for i = 0, . . . , 2k−1 − 1 do (0) 4: g ← d¯i + sk−1 (β) d¯i+2k−1 i Algorithm 2 Inverse transform of the basis X̄ Input: IFFTX̄ (D2k , k, β): D2k = (d0 , d1 , . . . , d2k −1 ), where each di = D̄2k (ωi + β), k is the binary logarithm of size, and β ∈ F2m Output: D̄2k = (d¯0 , d¯1 , . . . , d¯2k −1 ), the coefficients of D̄2k (x) 1: if k = 0 then return d0 2: end if (0) 3: Call D̄2k−1 ← IFFTX̄ (V0 , k − 1, β), where V0 = (0) (0) (0) (d0 , . . . , d2k−1 −1 ) and D̄2k−1 = (g0 , . . . , g2k−1 −1 ) (1) 4: Call D̄2k−1 ← IFFTX̄ (V1 , k − 1, vk−1 + β), where V1 = (1) (1) (1) (d2k , . . . , d2k −1 ) and D̄2k−1 = (g0 , . . . , g2k−1 −1 ) 5: for i = 0, . . . , 2k−1 − 1 do (0) (1) 6: d¯i+2k−1 ← gi + gi (0) s (β) k−1 7: d¯i ← gi + sk−1 (vk−1 ) d¯i+2k−1 8: end for 9: return D̄2k = (d¯0 , d¯1 , . . . , d¯2k −1 ) sk−1 (vk−1 ) (1) (0) gi ← gi + d¯i+2k−1 end for (0) (0) Call V0 ← FFTX̄ (D̄2k−1 , k − 1, β), where D̄2k−1 = (0) (0) (g0 , . . . , g2k−1 −1 ) and V0 = (d0 , . . . , d2k−1 −1 ) (1) (1) 8: Call V1 ← FFTX̄ (D̄2k−1 , k−1, vk−1 +β), where D̄2k−1 = (1) (1) (g0 , . . . , g2k−1 −1 ) and V1 = (d2k , . . . , d2k −1 ) 9: return D 2k = (d0 , d1 , . . . , d2k −1 ) 5: 6: 7: A polynomial D̄h (x) of degree h in the basis X̄ is represented as h−1 X D̄h (x) = d¯i X̄i (x), (10) divided into two subsets D̄2k (Vk +β) = D̄2k (Vk−1 +β)∪ D̄2k (Vk−1 +vk−1 +β). (11) The algorithm relied on the following lemma. i=0 with each d¯i ∈ F2m . Throughout this paper, D̄h = (d¯0 , d¯1 , . . . , d¯h−1 ) is used to indicate the vector of the coefficients of D̄h (x). Due to the fact deg(X̄i (x)) = i, the new basis possesses the following properties. Corollary 1. Given a polynomial f (x) ∈ F2m [x]/(x respectively expressed in the monmial basis and X̄ 2X −1 i=0 D̄2k (a + γ) − x) = (0) fi xi = 2X −1 2k−1 X−1 (d¯i + i=0 sk−1 (γ) ¯ d k−1 )X̄i (a + γ), sk−1 (vk−1 ) i+2 (12) for each a ∈ Vk−1 . m m f (x) = 2m Lemma 1. Given γ ∈ F2m and a polynomial D̄2k (x) ∈ m F2m [x]/(x2 − x) in the basis X̄, we have (1) fi X̄i (x), Based on Lemma 1, the algorithm to compute (11) is described below. By substituting γ = β into (12), we obtain i=0 the following properties hold. (0) (1) 1) fi = fi = 0, for i ≥ h + 1. (1) (0) 2) fh = fh · ph . (1) (1) (1) 3) For 0 ≤ j ≤ h, (fj , fj+1 , . . . , fh ) is determined by (0) (0) (0) (fj , fj+1 , . . . , fh ), and vice versa. D̄2k (a + β) 2k−1 X−1 (d¯i + = i=0 2k−1 X−1 = sk−1 (β) ¯ d k−1 )X̄i (a + β) sk−1 (vk−1 ) i+2 (0) (0) gi X̄i (a + β) = D2k−1 (a + β) ∀a ∈ Vk−1 , i=0 III. M ULTIPOINT EVALUATIONS AT Vk (13) where each For any polynomial f (x) and a set V , let the notation f (V ) denote a set of evaluation values f (V ) = {f (a)|∀a ∈ V }. [15] gave a recursive algorithm in O(2k lg(2k )) to calculate D̄2k (Vk + β), where (0) gi = d¯i + sk−1 (β) ¯ d k−1 sk−1 (vk−1 ) i+2 i = 0, 1, . . . , 2k−1 − 1. (14) (0) This converts D̄2k (Vk−1 + β) into D2k−1 (Vk−1 + β). Furthermore, by substituting γ = vk−1 + β into (12), we obtain (15), where each (1) (0) g = g + d¯i+2k−1 i = 0, 1, . . . , 2k−1 − 1. (16) Vk + β = {a + β|a ∈ Vk } for any β ∈ F2m . In this section, we describe the algorithm [15] in another viewpoint, which helps us to develop encoding/decoding algorithm for RS codes. The set of evaluation points can be divided into two individual subsets i i (1) This converts D̄2k (Vk−1 +vk−1 +β) into D2k−1 (Vk−1 +vk−1 + β). From (13) (15), the set of evaluation points (11) can be expressed as Vk + β = (Vk−1 + β) ∪ (Vk−1 + vk−1 + β), D̄2k (Vk + β) where (Vk−1 + vk−1 + β) is the coset of (Vk−1 + β) by adding vk−1 . Accordingly, the set of polynomial evaluations can be (0) (1) =D̄2k−1 (Vk−1 + β) ∪ D̄2k−1 (Vk−1 + vk−1 + β). 3 (17) By comparing (11) and (17), the degrees of both polynomials are reduced one-half (the number of terms are reduced from 2k to 2k−1 ). The complexity of obtaining both polynomials are discussed below. In (13), each coefficient gi takes an addition and a multiplication, except if sk−1 (β) = 0, then gi = d¯i without any arithmetic operations. However, we do not consider this exception here, because the reduction from those (0) exceptions is limited. As D2k−1 (x) has 2k−1 coefficients, it k−1 takes a total of 2 additions and 2k−1 multiplications to obtain them. In (15), calculating each coefficient gi + d¯i+2k−1 takes an addition, so it takes a total of 2k−1 additions to obtain (1) the coefficients of D̄2k−1 (x). This procedure can be applied recursively to each set (0) (1) D̄2k−1 (Vk−1 + β) and D̄2k−1 (Vk−1 + vk−1 + β) until the size of each set is one. With the divide-and-conquer strategy, the additive complexity and the multiplicative complexity are respectively written as D0 d0 𝑠0 (𝛽) 𝑠0 (𝑣0 ) 𝑠1 (𝛽) 𝑠1 (𝑣1 ) D1 d1 𝑠1 (𝛽) 𝑠1 (𝑣1 ) D2 d2 𝑠0 (𝛽 + 𝑣1 ) 𝑠0 (𝑣0 ) D3 d3 A(h) = 2 × A(h/2) + h, (a) The transform D0 𝑠1 (𝛽) 𝑠1 (𝑣1 ) 𝑠0 (𝛽) 𝑠0 (𝑣0 ) D1 D2 and the result is A(h) = h lg(h) and M (h) = h/2 lg(h). Algorithm 1 depicts the details of the recursive approach, denoted as FFTX̄ (•, k, β). The inverse FFT can be obtained by backtracking FFT given above. As opposite to (17), the inverse transform get (0) (1) the coefficients of D̄2k−1 (x) and D̄2k−1 (x), and the objective is to find the coefficients of D̄2k (x). We reformulate (16) and (14) as d0 d1 d2 𝑠0 (𝛽 + 𝑣1 ) 𝑠0 (𝑣0 ) (0) (1) d¯i+2k−1 = gi + gi , sk−1 (β) ¯ (0) d k−1 d¯i = gi + sk−1 (vk−1 ) i+2 𝑠1 (𝛽) 𝑠1 (𝑣1 ) i = 0, 1, . . . , 2k−1 − 1. (18) From (18), we can compute the coefficients of D̄2k (x). The (1) (0) coefficients of D̄2k−1 (x) and D̄2k−1 (x) can be obtained by applying the inverse transform recursively. The details are shown in Algorithm 2. Note that IFFTX̄ (•, k, β) denotes the inverse transform. Algorithms 1 and 2 use the same notations such that one can follow them easily. It is clear that both algorithms have the same number of arithmetic operations. Figure 1 showed an example of the proposed algorithm and inversion. The Pits 3 input polynomial is defined as D̄(x) = i=0 di X̄i (x), and the output is given by Di = D̄(ωi + β), for i = 0, 1, 2, 3. d3 D3 M (h) = 2 × M (h/2) + h/2, (b) The inverse transform Fig. 1. Data flow diagram of proposed 4-poiont transform and its inversion. D̄2k (a + vk−1 + β) = 2k−1 X−1 (d¯i + i=0 = 2k−1 X−1 (d¯i + i=0 = 2k−1 X−1 (0) (gi sk−1 (vk−1 + β) ¯ di+2k−1 )X̄i (a + vk−1 + β) sk−1 (vk−1 ) sk−1 (β) ¯ d k−1 + d¯i+2k−1 )X̄i (a + vk−1 + β) sk−1 (vk−1 ) i+2 + d¯i+2k−1 )X̄i (a + vk−1 + β) i=0 = 2k−1 X−1 (1) (1) gi X̄i (a + vk−1 + β) = D̄2k−1 (a + vk−1 + β) i=0 4 ∀a ∈ Vk−1 , (15) IV. P OLYNOMIAL BASIS WITH MONIC POLYNOMIALS AND (45). The objective of these multiplications are to align the results such that the desired polynomial can be extracted properly. Let Q(A(x), i) denote the quotient of dividing A(x) by si (x), where A(x) is in the basis X and deg(A(x)) < 2i+1 . Precisely, for a polynomial of degree h < 2i+1 , ITS OPERATIONS In this section, we define an alternative version of the polynomial basis, and its algorithms to perform multiplications, formal derivatives, and divisions on the new basis. All these operations will be used in the coding algorithms. The alternative basis is defined as A(x) = X = {X0 (x), X1 (x), . . . , X2m −1 (x)} m Dh−1 (x) = i=0 di · X̄i (x) = h−1 X i=0 di Xi (x). pi = =(D2k (ω0 + β), D2k (ω1 + β), . . . , D2k (ω2k −1 + β)), IFFTX (D2k , k, β) = IFFTX̄ (D2k , k, β) P2k , al Xl (x) + al Xl (x) l=2i l=0 al Xl (x) + si (x) h−1 X h−1 X (22) al Xl−2i (x). l=2i The quotient of dividing A(x) by si (x) is then (19) Q(A(x), i) = i h−1−2 X al+2i Xl (x). l=0 In general, given a dividend a(x) and a divisor b(x), the division is to determine the quotient Q(x) and the remainder r(x) such that a(x) = Q(x) · b(x) + r(x), (23) where deg(r(x)) ≤ deg(b(x)) − 1. Without loss of generality, we consider the case (20) deg(a(x)) > deg(b(x)) ≥ 0. and the inversion is denoted as IFFTX (D2k , k, β). Based on Algorithm 1, the transforms are defined as FFTX (D2k , k, β) = FFTX̄ (D2k ⊗ P2k , k, β), i 2X −1 i 2X −1 l=0 With the linear-time basis conversion, the multipoint evaluation in X̄ (Algorithm 1) can also be applied on X, and the complexity is unchanged. To simplify the notations, in the rest of this paper, the polynomials are represented in X. For D2k (x) in X, the k evaluations at Vk + β = {ωi + β}2i=0−1 is denoted as FFTX (D2k , k, β) al Xl (x) = l=0 in F2m [x]/(x2 − x), where each Xi (x) is given in (9). This implies that each Xi (x) is a monic polynomial. For any m Dh−1 (x) ∈ F2m [x]/(x2 − x), the basis conversion between X and X̄ requires only h multiplications/divisions: h−1 X h−1 X (24) The proposed algorithm firstly finds out the quotient Q(x), and then the remainder is calculated by (21) r(x) = a(x) − Q(x) · b(x). (25) In the following, we focus on the algorithm to determine Q(x). Let y = 2D` − deg(b(x)) − 1, (26) where P2k = (p0 , p1 , . . . , p2k −1 ). The operation ⊗ is the pairwise multiplication on two vectors, and the operation is the pairwise division. Since the multiplication and formal derivative in X are similar to those given in [15], we summarize them in Appendix A for completeness. Next we present the algorithm for polynomial division that is essential for decoding of RS codes. where D` = dlg(deg(a(x)) + 1)e. (27) To begin with, (25) is multiplied by Xy (x) to obtain r(x) · Xy (x) = a(x) · Xy (x) − Q(x) · b(x) · Xy (x). A. Polynomial Division (28) To simplify the notations, let In this subsection, we proposed an O(h lg(h)) polynomial division in the basis X. The proposed algorithm is based on Newton iteration approach that was used by the fast division algorithms in the standard basis [13] with O(h lg(h)), if O(h lg(h)) FFT exists. However, since our basis is different from the standard basis, some moderate modifications are required. As compared with the conventional fast division [13], the proposed approach has two major differences. First, the conventional fast division shall reverse the coefficients of the divisor B(x) upon performing the Newton iteration. However, in our basis X, the polynomial reversion cannot be applied. Thus, the proposed algorithm does not reverse the polynomials, and all operations are performed on the polynomials without reversions. Second, the proposed algorithm includes some specific multiplications that are not required in the conventional approach, such as Xy (x) in (28) and s1 (x) in R(x) = r(x) · Xy (x), A(x) = a(x) · Xy (x), (29) B(x) = b(x) · Xy (x). Then we have R(x) = A(x) − Q(x) · B(x). (30) Next we present a method to determine Q(x) from (30). Assume that there exists a polynomial Λ(x) such that Λ(x) · s1 (x) · B(x) = sDa (x) + H(x), (31) deg(H(x)) ≤ deg(B(x)) + 1 = 2D` , (32) Da = dlg(deg(A(x)) + 1)e. (33) where and 5 Algorithm 3 Polynomial divisions in X Input: A dividend a(x) and a divisor b(x), with deg(a(x)) > deg(b(x)) ≥ 0 Output: A quotient Q(x) and a remainder r(x), such that The algorithm to find out Λ(x) will be addressed in Section IV-B. Before determining Q(x), we first present two lemmas whose proofs are given in Appendix B. Lemma 2. Da = D` + 1. a(x) = Q(x) · b(x) + r(x). (34) From (31) and Lemma 2, the degree of Λ(x) is thus 1: Compute A(x) = a(x) · Xy (x), deg(Λ(x)) = deg(sDa (x)) − deg(B(x)) − deg(s1 (x)) Da =2 D` − (2 D` − 1) − 2 = 2 B(x) = b(x) · Xy (x), (35) − 1. 2: 3: 4: 5: After obtaining Λ(x), (30) is multiplied by Λ(x) · s1 (x) to obtain R(x) · Λ(x) · s1 (x) (36) =A(x) · Λ(x) · s1 (x) − Q(x) · B(x) · Λ(x) · s1 (x) where y is defined as (26). Find Λ(x) such that (31) holds. Compute Q(x) by (39). Compute r(x) by (25). return Q(x) and r(x). By (31), we have the updated polynomial Λi (x) of degree 2i − 1 is calculated from Λi−1 (x). The initial polynomial is R(x) · Λ(x) · s1 (x) =A(x) · Λ(x) · s1 (x) − Q(x) · (sDa (x) + H(x)) Λ0 (x) = b−1 dB . and then Q(x) · H(x) + R(x) · Λ(x) · s1 (x) =A(x) · Λ(x) · s1 (x) − Q(x) · sDa (x). Let BD` (x) = B(x), and (37) i = 0, 1, . . . , D` − 1. Bi (x) = Q(Bi+1 (x), i) Lemma 3. The left-hand side of (37) has degree (42) (42) can be rewritten as deg(Q(x) · H(x) + R(x) · Λ(x) · s1 (x)) ≤ 2Da − 1. (38) Bi+1 (x) = Bi (x) · si (x) + B̄i (x), In (37), Q(x)·sDa (x) is a polynomial where the coefficients of Q(x) starts from X2Da (x) = sDa (x). By Lemma 3, the degree of the left-hand side is no more than 2Da − 1. Thus, A(x) · Λ(x) · s1 (x) has quotient Q(x) starting on degree 2Da , and hence the quotient can be obtained by Q(x) = Q(A(x) · Λ(x) · s1 (x), Da ), (41) (43) where B̄i (x), deg(B̄i ) ≤ 2i − 1, is the residual. Clearly, deg(Bi (x)) = 2i − 1. For i = 1, 2, . . . , D` , Λi (x) is defined as (39) Λi (x) = Q((si−1 (x))2 · Λ̄i (x), i + 1), (44) Λ̄i (x) = (Λi−1 (x))2 · Bi (x) · s1 (x). (45) where In (39), we have It can be verified that deg(Λ̄i (x)) = 2i+1 − 1 and deg(Λi (x)) = 2i − 1 holds. The validity of Λ(x) = ΛD` (x) is supported as follows, where all proofs are given in Appendix B. deg(A(x)·Λ(x)·s1 (x)) ≤ 2Da +2D` −1 +2 = 3·2D` +1. (40) Algorithm 3 shows the steps of the division algorithm. The complexity is analyzed below. In Step 1, as deg(A(x)) = deg(a(x)) + deg(y(x)) < 2D` +1 and deg(B(x)) = deg(b(x)) + deg(y(x)) = 2D` − 1, the complexity is O(2D` +1 lg(2D` +1 )) = O(2D` lg(2D` )). In Step 2, we will show that O(2D` lg(2D` )) suffice in Section IV-B. In Step 3, (40) shows that the complexity is O(2D` lg(2D` )). In Step 4, as the degrees of polynomials are less than 2D` , the complexity is no more than O(2D` lg(2D` )). In summary, Algorithm 3 has the complexity O(2D` lg(2D` )) = O(deg(a(x)) lg(deg(a(x)))). Lemma 4. Λi (x) possesses the following equality: Λi (x) · Bi (x) · s1 (x) = si+1 (x) + r̄i (x), (46) with deg(r̄i (x)) ≤ 2i . The following reformulation of (44), that contains no polynomial multiplications, can be used to determine the complexity of calculating (44). Lemma 5. (44) can be rewritten as (1) B. Determining Λ(x) given in (31) PdB Given B(x) = j=0 bj Xj (x) with bdB 6= 0, this subsection presents a method to find out Λ(x) in (31). Notice that dB = deg(Λ(x)) = 2D` − 1. The proposed method can be seen as a modified version of the division with Newton iterations [13][19]. The method iteratively computes the coefficients of Λ(x) from highest degree to lowest degree. For i = 0, 1, . . . , D` , (1) Λi (x) = Λi (x) + Q(Λi (x), i − 1) · si−1 (vi−1 ), (47) where (1) Λi (x) = Q(Λ̄i (x), i). Algorithm 4 depicts the steps. The algorithm repeats performing (45) and (44) (or (47)) to obtain ΛD` (x), which is the desired output Λ(x). For the complexity, each iteration (lines 3-4) calculates (45) and (44). In (45), as deg(Λi−1 (x)) = 6 Algorithm 5 Half-GCD algorithm Input: HGCD(a(x), b(x), g), where a(x), b(x) ∈ m F2m [x]/x2 − x in basis X, and deg(b(x)) ≤ deg(a(x)), 2g−1 ≤ deg(a(x)) ≤ 2g − 1 Output: Two matrices (Z, M ) given in (58) 1: if deg(b(x)) < 2g−1 then return     a(x) 1 0 Z= , M= . (48) b(x) 0 1 Algorithm 4 Λ(x) computation Input: A polynomial B(x) Output: A polynomial Λ(x) such that (31) holds, where deg(Λ(x)) = deg(B(x)) = 2D` − 1. −1 1: Let Λ0 (x) = bd . B 2: for i = 1, 2, . . . , D` do 3: Compute (45). 4: Compute (44) (or (47), equivalently). 5: end for 6: return ΛD` (x). 2: 3: 4: 2i−1 − 1, deg(Bi (x)) = 2i − 1 and deg(si (x)) = 2, the multiplications (45) requires O(2i lg(2i )). In (44), Lemma 5 showed that the computation can be reduced to O(2i ) without polynomial multiplications. Thus, each iteration takes O(2i lg(2i )) operations, and the complexity for the loop (line 2-5) takes D X̀ O(2i lg(2i )) = O(2D` lg(2D` )). end if (ZH , MH ) ← HGCD(aH (x), bH (x), g − 1) Compute     zM0 (x) a (x) = ZH · sg−1 (x) + MH L . zM1 (x) bL (x) 5: if deg(zMl (x)) ≤ 2g−1 − 1 then return   z (x) (ZM = M0 , MH ). zMl (x) 6: 7: end if zM0 (x) is divided by zM1 (x) to get (49) i=1 zM0 (x) = qM (x) · zM1 (x) + rM (x) g−1 V. E XTENDED E UCLIDEAN A LGORITHM BASED ON H ALF -GCD A PPROACH 8: This section introduces the extended Euclidean algorithm that will be used in the decoding of RS codes. Given two polynomials a(x) = r−1 (x), b(x) = r0 (x), and g deg(b(x)) ≤ deg(a(x)) < 2 , with deg(rM (x)) < deg(zM1 (x)) ≤ 2 +2 − 1. zM1 (x) and rM (x) are divided into three polynomials, denoted as zM1 (x) =zM1LL (x) + sg−2 (x)zM1LH (x) + sg−1 (x)zM1H (x), rM (x) (52) =rMLL (x) + sg−2 (x)rMLH (x) + sg−1 (x)rMH (x). Euclidean algorithm is a procedure to recursively divide rk−2 (x) by rk−1 (x) to get Compute zM1M (x) rk−2 (x) = qk (x) · rk−1 (x) + rk (x), =zM1LH (x) + (sg−2 (x) + sg−2 (vg−2 ))zM1H (x), with deg(rk ) < deg(rk−1 ). The procedure stops at rN (x) = 0, and rN −1 (x) is the greatest common divisor (gcd) of a(x) and b(x). An extension version, namely extended Euclidean algorithm, calculates rk (x) with a pair of polynomials (uk (x), vk (x)) in each iteration such that rMM (x) =rMLH (x) + (sg−2 (x) + sg−2 (vg−2 ))rMH (x). 9: 10: a(x) · uk (x) + b(x) · vk (x) = rk (x). The (k − 1)-th step of extended Euclidean algorithm can be expressed as a matrix form       rk−2 (x) uk−2 (x) vk−2 (x) a(x) = · . (53) rk−1 (x) uk−1 (x) vk−1 (x) b(x) The next step is shown as         rk−1 (x) 0 1 uk−2 (x) vk−2 (x) a(x) = · · . rk (x) 1 −qk (x) uk−1 (x) vk−1 (x) b(x) (54) The half-GCD algorithm [20][13] calculates the temporal result of extended Euclidean algorithm at s-th step such that deg(rs (x)) ≤ 2g−1 − 1. (50) g−2 (YM , MM ) ← HGCD(zM1M (x), rMM (x), g − 1) return (ZR , MR ), where   0 1 M R = MM MH , 1 −qM (x)   z (x) ZR = YM · sg−2 (x) + MM M1LL . rMLL (x) (51) For polynomials in the monomial basis, there exist fast approaches in O(M (h) lg(h)) operations, where M (h) denotes the complexity of multiplying two polynomials of degrees h/2 (see [13, Algorithm 11.6] or [19, Figure 8.3]). The idea comes from an observation that, the quotient qk (x) in (54) is determined by the upper degree part of rk−1 (x) and rk (x), and the lower degree part of rk−1 (x) and rk (x) are not necessary. Fortunately, this observation is also applicable to our basis X. From the observation, we partition the inputs a(x) (and b(x)) into several portions, so that the procedure can be applied (55) In this section, we present a half-GCD algorithm in basis X. This approach will be performed to solve the error locator polynomial (see (76)) in the decoding procedure of RS codes. 7 polynomial division, and this requires O(h lg(h)) by using the fast division approach in Sec. IV. Line 4 and line 10 have polynomial additions and polynomials multiplications. As those polynomials have degrees less than h, the complexity is O(h lg(h)) by the results given in Appendix A. In summary, the overall complexity is on the portions of higher degrees. For the algorithms on monomial basis, it is simple to make such partitions. For basis X, we have to choose partition points at degrees X2g−2 (x) and X2g−1 (x). Precisely, a(x) is divided into three polynomials aLL (x), aLH (x) and aH (x) at sg−2 (x) and sg−1 (x), respectively. The representation is given by a(x) =aL (x) + sg−1 (x)aH (x) =aLL (x) + sg−2 (x)aLH (x) + sg−1 (x)aH (x). T (h) = 2T (h/2) + O(h lg(h)), and T (h) = O(h lg2 (h)). (56) VI. R EED -S OLOMON ENCODING ALGORITHM Similarly, b(x) is partitioned in the same manner: b(x) =bL (x) + sg−1 (x)bH (x) =bLL (x) + sg−2 (x)bLH (x) + sg−1 (x)bH (x). This section introduces an O(n lg(n − k)) encoding algorithm for (n = 2m , k) RS codes over F2m , with T = 2t = n − k a power of two. There exist two viewpoints for the constructions of RS codes, termed as the polynomial evaluation approach and the generator polynomial approach. For the polynomial evaluation approach, the message is interpreted as m a polynomial u(x) ∈ F2m [x]/(x2 − x) of degree less than k. The codeword v = (v0 , v1 , . . . , vn−1 ) is defined as the evaluations of u(x) at n distinct points. u(x) is in the basis X̄, and thus u(x) = PAssume k−1 i=0 ui X̄i (x). The vector of coefficients is denoted as (57) Algorithm 5 depicts the proposed algorithm HGCD(a(x), b(x), g), with deg(b(x)) ≤ deg(a(x)) and 2g−1 ≤ deg(a(x)) ≤ 2g − 1. The algorithm outputs two matrices     z (x) m00 (x) m01 (x) Z= 0 and M = (58) z1 (x) m10 (x) m11 (x) such that 1)   a(x) Z=M· ; b(x) 2) g−1 deg(z0 (x)) ≥ 2 g−1 deg(z1 (x)) ≤ 2 u = (u0 , u1 , . . . , uk−1 , ω0 , ω0 , . . . , ω0 ), {z } | (59) T with T ω0 s in the high degree part. Then the codeword can be computed via Algorithm 1: , − 1; (60) v = FFTX̄ (u, m, ω0 ). 3) deg(m11 (x)) ≤ deg(a(x)) − deg(z0 (x)); deg(mi0 (x)) ≤ deg(mi1 (x)), i = 0, 1. (64) However, (64) requires O(n lg(n)) operations, and the generated codeword is not systematic. In the following, another formula with complexity O(n lg(n − k)) is given, and the generated codeword is systematic. The inversion of (64) is given by (65) u = IFFTX̄ (v, m, ω0 ). (61) 4) deg(m0i (x)) ≤ deg(m1i (x)), (63) (62) Note that, in (65), u has T ω0 s in the high degree part (see (63)). To begin with, v is divided into a number of sub-vectors Before proving the validity of Algorithm 5, we give the following Lemmas whose proofs are given in Appendix B. v = (v0 , v1 , . . . , vn/T −1 ), Lemma 6. Algorithm 5 always outputs Z and M given in (58) that satisfy (59). (66) where each vi has T elements defined as Lemma 7. The recursive calls in HGCD(a(x), b(x), g) meet the requirements deg(b(x)) < deg(a(x)) and 2g−1 ≤ deg(a(x)) ≤ 2g − 1. vi = (vi·T , v1+i·T , . . . , vT −1+i·T ) i = 0, 1, . . . , n/T − 1. Those sub-vectors can be proved to possess the equality given in the following lemma, whose proof is given in Appendix B. Lemma 8. Algorithm 5 always outputs Z and M given in (58) that satisfies (60). Lemma 10. The following equality is hold: ω0 =IFFTX̄ (v0 , t, ω0 ) + IFFTX̄ (v1 , t, ωT ) + . . . Lemma 9. Algorithm 5 always outputs Z and M given in (58) that satisfy (61) and (62). + IFFTX̄ (vn/T −1 , t, ωk ), (67) where + is the addition for vectors. By the above Lemmas, we have (67) plays the core transform of the proposed algorithm. n/T −1 Assume v0 includes the parity symbols, and others {vi }i=1 are the message symbols. From (67), the parity is computed via Theorem 2. Algorithm 5 is valid. That is, Algorithm 5 always outputs Z and M given in (58) that satisfy the above four conditions. We determine the computational complexity as follows. The algorithm complexity is denoted as T (h) of polynomial degrees h = 2g . In step 3 and step 9, the algorithm shall call the routine twice, and it takes 2 · T (h/2). line 7 is the v00 =IFFTX̄ (v1 , t, ωT ) + IFFTX̄ (v2 , t, ω2T ) + . . . + IFFTX̄ (vn/T −1 , t, ωk ), v0 =FFTX̄ (v00 , t, ω0 ). 8 (68) This algorithm requires a T -point FFT and (n/T − 1) times of T -point IFFT. Hence, the complexity of the encoding algorithm is In (75), the degree of each term is less than k = n − T = 2m − 2t , except for the last term X2m −2t (x)st (x). Thus, the quotient of dividing sm (x) by Xk (x) would be st (x). Based on above results, the new key formula is O(T lg(T )) + (n/T − 1)O(T lg(T )) = O(n lg(n − k)). z0 (x) = s(x)λ(x) + q(x)st (x), VII. R EED -S OLOMON DECODING ALGORITHM with deg(z0 (x)) ≤ T /2. (76) is the key equation to find the error locator polynomial. To find λ(x), extended Euclidean algorithm is applied on st (x) and s(x). The extended Euclidean algorithm stops when the remainder has degree less than T /2. After obtaining λ(x), the next step is to find out the locations of errors E defined in (70), that is the set of roots of λ(x). After obtaining E, the final step is to calculate the error values. The formal derivative of (73) is This section shows a decoding algorithm for (n = 2m , k) RS codes over F2m , where the codeword v = (v0 , . . . , vn−1 ) = (u(ω0 ), . . . , u(ωn−1 )) is generated by Section VI. The proposed algorithm follows the syndrome-based decoding process. Let r = (r0 , r1 , . . . , rn−1 ) = v + e denote the received vector with error pattern e = (e0 , e1 , . . . , en−1 ). Hence, ri = u(ωi ) + ei . (69) u0 (x) · λ(x) + u(x) · λ0 (x) If ei 6= 0, ri is an erroneous symbol. Suppose e contains v ≤ (n − k)/2 = T /2 non-zero symbols. Let E = {ωi ∈ F2m |ei 6= 0} =r̄0 (x) · λ(x) + r̄(x) · λ0 (x) + q0 (x) · sm (x) + q(x). u(ωi ) · λ0 (ωi ) = r̄(ωi ) · λ0 (ωi ) + q(ωi ) q(ωi ) , ∀ωi ∈ E. ⇒u(ωi ) − r̄(ωi ) = 0 λ (ωi ) m Let r̄(x) denote a polynomial of degree less than 2 , with r̄(ωi ) = ri , ∀ωi ∈ F2m . It is clear to see that  0 if ωi ∈ E; r̄(ωi ) · λ(ωi ) = ri · λ(ωi ) if ωi ∈ F2m \ E. The above formula leads to u(ωi ) · λ(ωi ) = r̄(ωi ) · λ(ωi ) Due to 2m −1 Y ∀ωi ∈ F2m . (72) m (x − ωi ) = x2 − x = sm (x), i=0 (72) implies that u(x) · λ(x) ≡ r̄(x) · λ(x) (mod sm (x)) ⇒u(x) · λ(x) = r̄(x) · λ(x) + q(x) · sm (x), (73) s =IFFTX (r0 , t, ω0 ) + IFFTX (r1 , t, ωT ) + . . . + IFFTX (rn/T −1 , t, ωk ). with deg(q(x)) < v ≤ T /2. Given r̄(x), (73) is the key equation [21][9] to find out λ(x), by applying the Euclidean algorithm on sm (x) and r̄(x). However, though (73) is similar to the key equation of the syndrome decoding, r̄(x) is not the syndrome polynomial. To obtain the syndrome decoding, the new key formula is the quotients of dividing λ(x) and sm (x) by Xk (x). In this case, r̄(x) is divided into two parts r̄(x) = r̄0 (x) + Xk (x)s(x), (78) Notice that (78) uses q(x) to compute the error values, rather than z0 (x) used in Forney’s formula. In summary, the decoding algorithm consists of four steps: 1) Calculate syndrome polynomial s(x). 2) Determine the error-locator polynomial λ(x) from (76) by extended Euclidean algorithm. 3) Find the error locations E. 4) Calculate the error values via (78). The details of each step is described below. In the first step, s(x) is the high degree part of applying IFFT on the received codeword r. However, since the high degree part is required only, we follow the same idea of the encoding formula (67). In particular, the received codeword is divided into several individual parts r = (r0 , r1 , . . . , rn/T −1 ), where each ri has T = 2t = n − k elements. Then the syndrome polynomial is calculated by ωi ∈E (mod x − ωi ) (77) By substituting ωi ∈ E into (77), the error value is given by (70) denote the set of ωi corresponding to locations of errors. Then, error-locator polynomial is defined as Y λ(x) = (x − ωi ). (71) ⇒u(x) · λ(x) = r̄(x) · λ(x) (76) In the second step, the fast Euclidean algorithm (Algorithm 5) is applied on st (x) and s(x). Upon performing the Euclidean algorithm, we go a step by dividing st (x) with s(x), resulting in st (x) = qt (x) · s(x) + rt (x). Then call Algorithm 5 with inputs s(x) and rt (x) to obtain     z (x) u (x) v0 (x) ( 0 , 0 ) ← HGCD(s(x), rt (x), T ). z1 (x) u1 (x) v1 (x) (74) where r̄0 (x) denotes the residual. Notably, if no error occurs, r̄(x) = u(x) of degree less than k, and hence s(x) = 0. Thus we can take s(x) as the syndrome polynomial. For sm (x), the polynomial is recursively decomposed by (7) to obtain (75). Then we have z1 (x) = u1 (x)s(x) + v1 (x)rt (x) ⇒z1 (x) = u1 (x)s(x) + v1 (x)(st (x) − qt (x) · s(x)) ⇒z1 (x) = v1 (x)st (x) + (u1 (x) − v1 (x)qt (x))s(x), 9 (79) and thus the error locator polynomial is given by Euclidean algorithm was also given in this paper. Combining these algorithms, a fast RS decoding algorithm is proposed, to achieve the complexity O(n lg(n − k) + (n − k) lg2 (n − k)). By letting k/n a constant, the complexity can be written as O(n lg2 (n)), that improves upon the best currently available decoding complexity of O(n lg2 (n) lg lg(n)) [9]. Although Justesen [8] had given the algorithm with the same complexity in 1976, it does not include the field F2m , that can be recognized as the most important case in the real applications. The following we address some potential future works: 1. To remove the constraint (n − k) a power of two in the encoding/decoding algorithms. This will increase the values of n and k to be selected. 2. To generalize the algorithm to handle both errors and erasures. 3. To reduce the leading constant of the FFT approach. This will make the proposed algorithm more competitive for short codes. λ(x) = u1 (x) − v1 (x)qt (x). In the third step, the roots of λ(x) can be searched via FFTs. The transform FFTX (λ, T, ωi·T ) (80) is to evaluate λ(x) at Vt + ωi·T . If the result vector contains zeros, then λ(x) has some roots at the corresponding points. (80) is performed at i = 0, 1, . . . , n/T − 1 to search the roots in F2m . Notably, if deg(λ(x)) is larger than the number of found roots, the decoding procedure shall be terminated. This situation occurs when the number of errors exceeds T /2. In the final step, we compute FFTX (q, T, ωi·T ) and FFTX (λ0 , T, ωi·T ) (computing λ0 (x) is given in Appendix A), for i = 0, 1, . . . , n/T − 1. Then the error values are calculated via (78). To determine the computational complexity, the first step requires (n/T ) times of T -point IFFT such that the complexity is n/T · O(T lg(T )) = O(n lg(n − k)). The second step takes O((n−k) lg2 (n−k)) operations. The third step requires (n/T ) times of T -point FFT, and thus the complexity is O(n lg(n − k)). The final step requires a formal derivative of polynomial degree T , and at most 2(n/T ) times of T -point FFT. Thus, the complexity is O(n lg(n − k)). In summary, the proposed decoding algorithm requires O(n lg(n−k)+(n−k) lg2 (n−k)). R EFERENCES [1] I. S. Reed and G. Solomon, “Polynomial codes over certain finite fields,” Journal of the Society for Industrial and Applied Mathematics, vol. 8, no. 2, pp. 300–304, 1960. [2] J. K. Wolf, “Adding two information symbols to certain nonbinary bch codes and some applications,” Bell System Technical Journal, vol. 48, no. 7, pp. 2405–2424, Sept 1969. [3] K. V. Rashmi, N. Shah, and P. Kumar, “Optimal exactregenerating codes for distributed storage at the MSR and MBR points via a product-matrix construction,” IEEE Trans. Inf. Theory, vol. 57, no. 8, pp. 5227–5239, Aug 2011. [4] S.-J. Lin, W.-H. Chung, Y. S. Han, and T. Y. Al-Naffouri, “A unified form of exact-msr codes via product-matrix frameworks,” IEEE Trans. Inf. Theory, vol. 61, no. 2, pp. 873–886, Feb 2015. [5] C. Huang, H. Simitci, Y. Xu, A. Ogus, B. Calder, P. Gopalan, J. Li, and S. Yekhanin, “Erasure coding in windows azure storage,” in Presented as part of the 2012 USENIX Annual Technical Conference (USENIX ATC 12). Boston, MA: USENIX, 2012, pp. 15–26. [6] N. Chen and Z. Yan, “Complexity analysis of reedsolomon decoding over GF (2m ) without using syndromes,” EURASIP J. Wirel. Commun. Netw., vol. 2008, pp. 16:1–16:11, Jan. 2008. [7] T. Truong, P. Chen, L. Wang, and T. Cheng, “Fast transform for decoding both errors and erasures of reedsolomon codes over GF (2m ) for 8 ≤ m ≤ 10,” IEEE VIII. C ONCLUDING REMARKS In the simulations, we implemented the algorithm in C and compiled it in 64-bit GCC compiler on Intel Xeon X5650 and Windows 7 platform. For (n, k) = (216 , 215 ) RS codes over F216 , the program took about 2.22 × 10−3 second to produce a codeword. We tested a codeword with (n − k)/2 errors, and the decoding takes about 0.401 seconds. As for a comparison, we also ran the standard RS decoding algorithm [22], that took about 22.014 seconds to decode a codeword. Thus, the proposed decoding is around 50 times faster than the traditional approach under the parameter configurations described above. In our simulations, the proposed RS algorithm is suitable for long RS codes. In this paper, we developed fast decoding algorithms for (n = 2m , k) systematic Reed-Solomon (RS) codes over fields F2m , m ∈ Z+ . The proposed algorithms are formed on a new basis X [15]. We reformulated the formulas of the syndromebased decoding algorithm, such that the FFTs for the new basis can be applied. Further, the fast polynomial division algorithm is proposed. We made some modifications such that the Newton iteration can be applied to the new basis. The fast sm (x) =sm−1 (x) (sm−1 (vm−1 ) + sm−1 (x)) =sm−1 (x) (sm−1 (vm−1 ) + sm−2 (x) (sm−2 (vm−2 ) + sm−2 (x))) =··· =sm−1 (x)sm−1 (vm−1 ) + sm−1 (x)sm−2 (x)sm−2 (vm−2 ) + . . . + sm−1 (x)sm−2 (x) . . . st (x)st (vt ) + sm−1 (x)sm−2 (x) . . . st (x)st (x) =X2m −2m−1 (x)sm−1 (vm−1 ) + X2m −2m−2 (x)sm−2 (vm−2 ) + · · · + X2m −2t (x)st (vt ) + X2m −2t (x)st (x). 10 (75) [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] Trans. Veh. Commun., vol. 54, no. 2, pp. 181–186, Feb 2006. J. Justesen, “On the complexity of decoding ReedSolomon codes (corresp.),” IEEE Trans. Inf. Theory, vol. 22, no. 2, pp. 237–238, Mar 1976. S. Gao, “A new algorithm for decoding Reed-Solomon codes,” in Communications, Information and Network Security. Kluwer, 2002, pp. 55–68. V. Y. Pan, “Faster solution of the key equation for decoding bch error-correcting codes,” in Proceedings of the Twenty-ninth Annual ACM Symposium on Theory of Computing, ser. STOC ’97. New York, NY, USA: ACM, 1997, pp. 168–175. A. Schönhage, “Schnelle multiplikation von polynomen über körpern der charakteristik 2,” Acta Informatica, vol. 7, no. 4, pp. 395–398, 1977. [Online]. Available: http://dx.doi.org/10.1007/BF00289470 D. G. Cantor and E. Kaltofen, “On fast multiplication of polynomials over arbitrary algebras,” Acta Informatica, vol. 28, no. 7, pp. 693–701, 1991. J. V. Z. Gathen and J. Gerhard, Modern Computer Algebra, 3rd ed. New York, NY, USA: Cambridge University Press, 2013. S. Gao and T. Mateer, “Additive fast fourier transforms over finite fields,” IEEE Trans. Inf. Theory, vol. 56, no. 12, pp. 6265–6272, Dec 2010. S. J. Lin, W. H. Chung, and Y. S. Han, “Novel polynomial basis and its application to reed-solomon erasure codes,” in Foundations of Computer Science (FOCS), 2014 IEEE 55th Annual Symposium on, Oct 2014, pp. 316–325. O. Ore, “On a special class of polynomials,” Trans. Amer. Math. Soc., vol. 35, no. 11, pp. 559–584, Nov 1933. D. G. Cantor, “On arithmetical algorithms over finite fields,” Journal of Combinatorial Theory, Series A, vol. 50, no. 2, pp. 285–300, 1989. J. von zur Gathen and J. Gerhard, “Arithmetic and factorization of polynomial over F2 ,” in Proceedings of the 1996 International Symposium on Symbolic and Algebraic Computation, Zurich, Switzerland, 1996, pp. 1–9. T. Mateer, “Fast Fourier transform algorithms with applications,” Ph.D. dissertation, Clemson, SC, USA, 2008. R. T. Moenck, “Fast computation of GCDs,” in ACM Symposium on Theory of Computing (STOC), 1973, pp. 142–151. A. Shiozaki, “Decoding of redundant residue polynomial codes using euclid’s algorithm,” IEEE Trans. Inf. Theory, vol. 34, no. 5, pp. 1351–1354, Sep 1988. S. Rockliff. (1989) Reed-Solomon (RS) codes. [Online]. Available: http://www.eccpage.com/ A PPENDIX A P OLYNOMIAL MULIPLICATION AND FORMAL DERIVATIVE ON NEW BASIS [15] showed the polynomial multiplication and formal derivative in X̄. We take the similar procedure to show the corresponding operations in X. A. Muliplication To multiply two polynomials, there exists a well-known fast approach based on FFT techniques. This approach can also be applied finite fields F2m . Let a(x) = Ph−1 on the basis X overP h−1 a · X (x) and b(x) = i i i=0 i=0 bi · Xi (x) denote the two polynomials in X. Its product a(x) · b(x) (mod si (x)) can be computed as IFFTX (FFTX (a, β) ⊗ FFTX (b, β), β), where a = (a0 , a1 , . . . , ah−1 , 0, . . . , 0) is a 2i -point vector represents the coefficients of a(x) up to degree 2i − 1. Similarly, b is defined accordingly. The operation ⊗ performs pairwise multiplication on two vectors. This requires one 2i point IFFT, two 2i -point FFTs and 2i multiplications, and thus the complexity is O(2i lg(2i )). B. Formal derivative For a polynomial D2k (x) in X, we have D2k (x) = k 2X −1 di Xi (x) i=0 = 2k−1 X−1 k 2X −1 di Xi (x) + i=0 di Xi (x) k−1 2 = X−1 (81) i=2k−1 k−1 2 di Xi (x) + sk−1 (x) i=0 (0) =D2k−1 (x) X−1 di+2k−1 Xi (x) i=0 (1) + sk−1 (x)D2k−1 (x). The formal derivative of D2k (x) is given by (0) (1) D20 k (x) =[D2k−1 ]0 (x) + s0k−1 (x)D2k−1 (x) (1) + sk−1 (x)[D2k−1 ]0 (x). (0) (82) From Theorem 1, s0k−1 (x) is a constant. [D2k−1 ]0 (x) and (1) sk−1 (x)[D2k−1 ]0 (x) can be computed recursively. Let h = 2k , and the recursive form of the complexity is written by T (h) = 2 · T (h/2) + O(h) and then T (h) = O(h lg(h)). 11 A PPENDIX B P ROOF OF L EMMAS C. Proof of Lemma 3 Proof. (38) is a summation of two terms. For the first term, we have A. Proof of Lemma 1 deg(Q(x) · H(x)) Proof. From the definition, D̄2k (x) can be reformulated as k 2X −1 D̄2k (x) = d¯i X̄i (x) i=0 = 2k−1 X−1 i=0 = 2k−1 X−1 2k−1 X−1 i=0 k−1 (83) 2 i=0 − 1. = deg(r(x)) + (2D` − deg(b(x)) − 1) + 2D` + 1 Da + deg(r(x)) − deg(b(x)) Da − 1. ≤2 ∀a ∈ Vk−1 . (From (27)) = deg(r(x)) + y + 2D` + 1 (From (26)) (89) (84) This completes the proof. D. Proof of Lemma 4 Proof. The proof follows mathematical induction. For the based case i = 0, (41) shows the following holds. sk−1 (a + γ) ¯ d k−1 )X̄i (a + γ) sk−1 (vk−1 ) i+2 Λ0 (x) · B0 (x) · s1 (x) = s1 (x), (85) and r̄0 (x) = 0. Assume (46) holds at i = j. That is, k−1 X−1 (d¯i + (88) deg(R(x) · Λ(x) · s1 (x)) D̄2k (a + γ) = (From (26)) For the second term, we have From (83) and (84), we have i=0 (From (29)) = deg(a(x)) + 2D` − deg(b(x)) =2 sk−1 (a + γ) =sk−1 (a) + sk−1 (γ) (d¯i + = deg(a(x)) + y + 1 =2 From Theorem 1, given γ ∈ F2m , we have = (From (30)) Da sk−1 (x) ¯ d k−1 )X̄i (x). (d¯i + sk−1 (vk−1 ) i+2 2k−1 X−1 = deg(A(x)) + 1 ≤2D` − 1 + 2D` 2X −1 sk−1 (x) d¯ k−1 X̄i (x) d¯i X̄i (x) + sk−1 (vk−1 ) i=0 i+2 =sk−1 (γ) (From (32)) ≤ deg(a(x)) + 2D` d¯i X̄i (x) i=2k−1 i=0 = k 2X −1 d¯i X̄i (x) + ≤ deg(Q(x)) + deg(B(x)) + 1 sk−1 (γ) ¯ d k−1 )X̄i (a + γ), sk−1 (vk−1 ) i+2 Λj (x) · Bj (x) · s1 (x) = sj+1 (x) + r̄j (x), (90) which is multiplied by (sj (x))2 to get for each a ∈ Vk−1 . This completes the proof. (sj (x))2 · Λj (x) · Bj (x) · s1 (x) =(sj (x))2 · sj+1 (x) + (sj (x))2 · r̄j (x). B. Proof of Lemma 2 (91) From (7), we have (sj (x))2 · sj+1 (x) + (sj (x))2 · r̄j (x) Proof. From (33), we have =(sj+1 (x))2 + sj (vj )sj (x)sj+1 (x) + (sj (x))2 · r̄j (x) Da =sj+2 (x) + sj+1 (vj+1 )sj+1 (x) + sj (vj )sj (x)sj+1 (x) =dlg(deg(a(x)) + y + 1)e =dlg(deg(a(x)) + 2 D` ≥dlg(2 D` + (sj (x))2 · r̄j (x). − deg(b(x)))e + 1)e (92) (86) By (92)(43), (91) can be rewritten as (From (24)) sj (x) · Λj (x) · Bj+1 (x) · s1 (x) = sj+2 (x) + r̂j (x), =D` + 1. (93) where Moreover, r̂j (x) =sj+1 (vj+1 )sj+1 (x) + sj (vj )sj (x)sj+1 (x) Da =dlg(deg(a(x)) + 2 D` ≤dlg(deg(a(x)) + 2 D` D` ≤dlg(2 +2 D` − deg(b(x)))e + (sj (x))2 · r̄j (x) )e + sj (x) · Λj (x) · B̄j (x) · s1 (x). (87) )e = D` + 1. The degree of each term of r̂j (x) is deg(sj+1 (vj+1 )sj+1 (x)) = 2j+1 , (86)(87) concludes that Da = D` + 1. This completes the proof. deg(sj (vj )sj (x)sj+1 (x)) = 2j + 2j+1 , 12 (94) deg((sj (x))2 · r̄j (x)) ≤ 2j+1 + 2j , From (99), the first term in (98) can be reformulated as (1) Q(si (x)Λ̄i (x), i + 1) = Λi (x) = Q(Λ̄i (x), i). deg(sj (x) · Λj (x) · B̄j (x) · s1 (x)) ≤2j + (2j − 1) + (2j − 1) + 2. With the similar step, it can be shown that the second stem can be formulated as Thus, we have deg(r̂j (x)) ≤ 2j+1 + 2j . When i = j + 1, from (45)(44), we have si−1 (vi−1 )Q(si−1 (x)Λ̄i (x), i + 1) Λj+1 (x) = Q((sj (x) · Λj (x))2 · Bj+1 (x) · s1 (x), j + 2). (1) =Q(Λi (x), i − 1) · si−1 (vi−1 ). The above equation can be rewritten as This completes the proof. Λj+1 (x) · sj+2 (x) + řj+2 (x) (95) 2 =(sj (x) · Λj (x)) · Bj+1 (x) · s1 (x), where deg(řj+2 (x)) ≤ 2j+2 − 1. We then multiply (95) by Bj+1 (x) · s1 (x) to obtain F. Proof of Lemma 6 Proof. For the based case deg(b(x)) < 2g−1 (see Algorithm 5, line 1), it is clear that (48) holds. Assume Algorithm 5 is valid for HGCD(a(x), b(x), j) with j ≤ g − 1. When j = g, the degree of a(x) is between 2g−1 ≤ deg(a(x)) ≤ 2g − 1. In this case, both a(x) and b(x) are divided into three individual polynomials as expressed in (56) and (57). In line 3, HGCD(aH (x), bH (x), g − 1) is called to obtain (ZH , MH ), that possesses   aH (x) Z H = MH · . (100) bH (x) Λj+1 (x) · Bj+1 (x) · s1 (x) · sj+2 (x) + řj+2 (x) · Bj+1 (x) · s1 (x) =(sj (x) · Λj (x) · Bj+1 (x) · s1 (x))2 =(sj+2 (x) + r̂j (x)) 2 (96) (By (93)) =(sj+2 (x))2 + (r̂j (x))2 . (96) is then divided by sj+2 (x) to get Λj+1 (x) · Bj+1 (x) · s1 (x) = sj+2 (x) + r̄j+1 (x), (97) where r̄j+1 (x) = (r̂j (x))2 − řj+2 (x) · Bj+1 (x) · s1 (x) . sj+2 (x) Multiplying (100) by sg−1 (x) to obtain ZH · sg−1 (x) = MH · sg−1 (x) In (97), the degree of each term of deg(r̄j+1 (x)) is as follows: deg((r̂j )2 (x)) ≤ 2 · (2j+1 + 2j ),   a (x) ZH · sg−1 (x) + MH L bL (x)   sg−1 (x) · aH (x) + aL (x) =MH . sg−1 (x) · bH (x) + bL (x) ≤(2j+2 − 1) + (2j+1 − 1) + 2, deg(sj+2 (x)) = 2j+2 . Thus, deg(r̄j+1 (x)) ≤ 2j+1 . This completes the proof. By (56) and (57), (102) becomes     aL (x) a(x) ZH · sg−1 (x) + MH = MH . bL (x) b(x) E. Proof of Lemma 5 Proof. From (44), we have Λi (x) =Q((si−1 (x))2 · Λ̄i (x), i + 1) Then we have       zM0 (x) a(x) a(x) = MH and ZM = MH . zM1 (x) b(x) b(x) (From (7)) =Q(si (x)Λ̄i (x), i + 1) + si−1 (vi−1 ) · Q(si−1 (x)Λ̄i (x), i + 1) (98) (98) has two terms, and we recalled that deg(Λ̄i (x)) = 2i+1 − 1. Let (0) (1) Λ̄i (x) = Λi (x) + si (x)Λi (x), (0) (101) which is equivalent to deg(řj+2 (x) · Bj+1 (x) · s1 (x)) =Q((si (x) + si−1 (vi−1 )si−1 (x)) · Λ̄i (x), i + 1)   aH (x) bH (x) (102) (103) (104) Note that zM0 (x) and zM1 (x) are computed in line 4. (104) shows that (ZM , MH ) satisfies the equality, and thus the return in line 5 is valid. In line 7, zM0 (x) is divided by zM1 (x) to get (1) where both Λi (x) and Λi (x) have degrees no more than 2i − 1. Then si (x)Λ̄i (x) (0) (1) =si (x)(Λi (x) + si (x)Λi (x)) (0) (1) =si (x)Λi (x) + (si (x))2 Λi (x) (0) (1) =si (x)Λi (x) + si (vi )si (x)Λi (x) (1) + si+1 (x)Λi (x). zM0 (x) = qM (x) · zM1 (x) + rM (x), (105) deg(rM (x)) < deg(zM1 (x)). (106) with (99) The matrix form of (105) can be reformulated as      zM1 (x) 0 1 zM0 (x) = . rM (x) 1 −qM (x) zM1 (x) 13 (107) Then zM1 (x) and rM (x) are decomposed into several polynomials as zM1 (x) G. Proof of Lemma 7 Proof. Assume HGCD(a(x), b(x), i) is valid for i ≤ g − 1, i.e., the recursive calls in line 3 (and line 9) are valid. Assume i = q. It is clear that the call at line 3 satisfies the condition, since aH (x) and bH (x) are the high degree portions of a(x) and b(x), respectively. For the call at line 9, we first consider the degree of zM1 (x). For simplicity, (ZH , MH ) is denoted as     zH0 (x) mH00 (x) mH01 (x) ZH = , MH = . zH1 (x) mH10 (x) mH11 (x) =zM1LL (x) + sg−2 (x)zM1LH (x) + sg−1 (x)zM1H (x) =zM1LL (x) + sg−2 (x)zM1LH (x) (108) + sg−2 (x)(sg−2 (x) + sg−2 (vg−2 ))zM1H (x) =zM1LL (x) + sg−2 (x)zM1M (x), where zM1M (x) =zM1LH (x) + (sg−2 (x) + sg−2 (vg−2 ))zM1H (x). (109) Because deg(aL (x)) ≤ 2q−2 − 1, deg(bL (x)) ≤ 2q−2 − 1, and deg(zH1 (x)) ≤ 2q−2 − 1, from the assumption, we have Similarly, rM (x) = rMLL (x) + sg−2 (x)rMM (x), (110) deg(zM1 (x)) ≤ max{(2q−2 − 1) + 2g−1 , where deg(mH10 (x)) + (2q−2 − 1), rMM (x) =rMLH (x) + (sg−2 (x) + sg−2 (vg−2 ))rMH (x). deg(mH11 (x)) + (2 (111) As deg(aH (x)) ≤ 2q−1 −1 and deg(zH0 (x)) ≥ 2q−2 , we have deg(mH10 (x)) ≤ deg(mH11 (x)) ≤ 2q−2 − 1. Then (120) gives deg(zM1 (x)) ≤ max{(2g−2 − 1) + 2g−1 , (2q−2 − 1) + (2q−2 − 1)} Multiplying (112) by sg−2 (x) to obtain   z (x) YM · sg−2 (x) = MM · sg−2 (x) M1M (113) rMM (x).   z (x) By adding M1LL to both side of (113), we have rMLL (x)   zM1LL (x) YM · sg−2 (x) + MM rMLL (x)   (114) z (x) + zM1M (x) · sg−2 (x) =MM M1LL rMLL (x) + rMM (x) · sg−2 (x) =(2g−2 − 1) + 2g−1 . (121) Thus, the inequality deg(rM (x)) < deg(zM1 (x)) ≤ 2g−1 + 2g−2 − 1 in line 7 is valid. In line 8, zM1M (x) and rMM (x) are the quotients of dividing rM (x) and zM1 (x) by sg−2 (x), and then deg(rMM (x)) < deg(zM1M (x)) ≤ 2g−1 − 1. where (122) Further, due to the if condition in line 5, we have which is equivalent to Hence, we have − 1)}. deg(mH10 (x)) ≤ deg(mH11 (x)) ≤ deg(aH (x))−deg(zH0 (x)). Line 9 calls HGCD(zM1M (x), rMM (x), g − 1) to obtain (YM , MM ) possessing   z (x) YM = MM M1M . (112) rMM (x) deg(zM1 (x)) ≥ 2g−1     zM1LL (x) z (x) = MM M1 . (115) rMLL (x) rM (x) Substituting (107) and (104) into (115) to obtain   zM1LL (x) YM · sg−2 (x) + MM rMLL (x)     0 1 a(x) =MM MH . 1 −qM (x) b(x) (120) From the assumption, zM1M (x) (and rMM (x)) can be treated as the quotient of dividing zM1 (x) (and rM (x)) by sg−2 (x). By (106), this implies deg(rMM (x)) < deg(zM1M (x)). YM · sg−2 (x) + MM q−2 after line 7. This implies deg(zM1M (x)) ≥ 2g−2 . (123) By (122) and (123), the requirements of the call in line 9 are verified. (116) H. Proof of Lemma 8   a(x) Z R = MR , b(x)  0 MR = MM 1 Proof. Algorithm 5 has three returns at lines 1, 5 and 10. Assume that the recursive call HGCD in line 3 and line 10 outputs the valid results. For line 1, it is clear to see it. For line 5, (101)-(104) show that the degree of zM0 (x) is at least (117)  1 −qM (x) MH (118) deg(zM0 (x)) ≥ deg(zH0 ) + 2g−1 . and  ZR = YM · sg−2 (x) + MM  zM1LL (x) rMLL (x) (119) By the assumption, deg(zH0 ) ≥ 2g−2 and we have deg(zM0 (x)) ≥ 2g−2 + 2g−1 . are the return results in Line 10. 14 (124) This verifies (127). Let us consider line 10. ZR , YM MM , and MR can be denoted as     z (x) y (x) ZR = R0 , YM = M0 , zR1 (x) yM1 (x)     mM00 (x) mM01 (x) mR00 (x) mR01 (x) MM = .MR = . mM10 (x) mM11 (x) mR10 (x) mR11 (x) By (124) and the if condition in line 5, the first condition holds. Let us consider line 10. ZR , YM and MM can be denoted as     zR0 (x) yM0 (x) ZR = , YM = , zR1 (x) yM1 (x)   mM00 (x) mM01 (x) MM = . mM10 (x) mM11 (x) The objective is to prove The degree of zR0 (x) is at least deg(mR11 (x)) ≤ deg(a(x)) − deg(zR0 (x)), deg(zR0 (x)) ≥ deg(yM0 (x)) + 2g−2 and ≥2g−2 + 2g−2 = 2g−1 . deg(mRi0 (x)) ≤ deg(mRi1 (x)), Further, deg(zR1 (x)) = max{ deg(yM1 (x)) + 2 g−2 deg(mR0i (x)) ≤ deg(mR1i (x)), , deg(mM10 (x)zM1LL (x)), deg(mM11 (x)) ≤ deg(zM1M (x)) − deg(yM0 (x)), By assumptions, we have deg(mM10 (x)) ≤ deg(mM11 (x)) deg(mMi0 (x)) ≤ deg(mMi1 (x)), ≤ deg(zM1M (x)) − deg(yM0 (x)) deg(mM0i (x)) ≤ deg(mM1i (x)), ≤ (2q−1 − 1) − 2q−2 = 2q−2 − 1. To verify (133), (118) can be reformed as ≤ max{(2g−2 − 1) + 2g−2 , (2q−2 − 1) + (2q−2 − 1)} − 1, (126) as, by assumptions, deg(zM1LL (x)) ≤ 2q−2 − 1 and deg(rMLL (x)) ≤ 2q−2 − 1, and deg(yM1 (x)) ≤ 2g−2 − 1. This verifies (60). deg(mHi0 (x)) ≤ deg(mHi1 (x)), i = 0, 1. deg(mR10 (x)) = deg(qM (x)) + deg(mM11 (x)) + deg(mH10 (x)), deg(mR11 (x)) = deg(qM (x)) + deg(mM11 (x)) + deg(mH11 (x)). (137) From the assumptions deg(mM01 (x)) ≤ deg(mM11 (x)) and deg(mH10 (x)) ≤ deg(mH11 (x)), (133) can be verified. The verification of (132) is considered as follows. From (111), (134) can be reformed as (127) deg(mM11 (x)) (128) ≤ deg(zM1M (x)sg−2 (x)) − deg(yM0 (x)sg−2 (x)) i = 0, 1. = deg(zM1 (x)) − deg(zR0 (x)). (138) is summed by (131), resulting in (139), and thus (132) is verified. (130) J. Proof of Lemma 10 Proof. The proof follows mathematical induction. We pick T = n/2 as the base case. Then from (63), u = (u0 , ω0 ) has n/2 ω0 s in the high degree part. From (66), v = (v0 , v1 ) is divided into two equal sub-vectors. Then (65) can be written as (u0 , ω0 ) = IFFTX̄ ((v0 , v1 ), m, ω0 ). (130) verifies that (128) is true. Further, (101)-(104) show that (129) can be reformed as deg(mH11 (x)) ≤ deg(aH (x)sg−1 (x)) − deg(zH0 (x)sg−1 (x)) (138) (129) and deg(mHi0 (x)) ≤ deg(mHi1 (x)), (136) deg(mR01 (x)) = deg(qM (x)) + deg(mM01 (x)) + deg(mH11 (x)), By assumptions, line 3 of the algorithm gives deg(mH11 (x)) ≤ deg(aH (x)) − deg(zH0 (x)), (135) deg(mR00 (x)) = deg(qM (x)) + deg(mM01 (x)) + deg(mH10 (x)), and deg(mH0i (x)) ≤ deg(mH1i (x)), (134) Based on assumptions (130) and (133), it can be seen that the degrees of the elements of MR are determined by the second term. Precisely, I. Proof of Lemma 9 Proof. Assume that the recursive call HGCD in line 3 and line 10 outputs the valid results. For the base case in line 1, it is clear that the condition holds. Notice that deg(0) is a special case, we can treat deg(0) = 0 in this case. For line 5, the objective is to prove deg(mH11 (x)) ≤ deg(a(x)) − deg(zM0 (x)), i = 0, 1. MR    mM00 (x) mM01 (x) mH10 (x) mH11 (x) = mM10 (x) mM11 (x) mH00 (x) mH01 (x)    mM01 (x)  mH10 (x) mH11 (x) . − qM (x) mM11 (x) deg(zR1 (x)) deg(mH0i (x)) ≤ deg(mH1i (x)), (133) and Then (125) becomes =2 i = 0, 1. By assumptions, line 9 of the algorithm gives (125) deg(mM11 (x)rMLL (x))}. g−1 (132) (131) = deg(a(x)) − deg(zM0 (x)). 15 In Algorithm 2, Line 3 computes D(0) = IFFTX̄ (v0 , m − 1, ω0 ), and Line 4 computes D(1) = IFFTX̄ (v1 , m − 1, ωn/2 ). The vector ω0 is calculated by line 6, and u0 is computed by line 7. As line 6 only requires pointwise additions, which can be written as a vector addition: ω0 = D(0) + D(1) =IFFTX̄ (v0 , m − 1, ω0 ) + IFFTX̄ (v1 , m − 1, ωn/2 ). (140) Assume (67) holds at T = S = 2s , and thus ω0 =IFFTX̄ (v0 , s, ω0 ) + IFFTX̄ (v1 , s, ωS ) + . . . + IFFTX̄ (vn/S−1 , s, ωn−S ). (141) When T = S/2 = 2s−1 , (141) becomes (un/(S/2)−2 , ω0 ) =IFFTX̄ (v0 , s, ω0 ) + IFFTX̄ (v1 , s, ωS ) + . . . (142) + IFFTX̄ (vn/S−1 .s, ωn−S ). We can extract the computations regarding ω0 in (142). Similarly, this decomposes each s-point IFFT into two (s/2)point IFFTs, resulting in ω0 =IFFTX̄ (v0 , s − 1, ω0 ) + IFFTX̄ (v1 , s − 1, ωS/2 ) + . . . + IFFTX̄ (vn/S−1 , s − 1, ωn−S/2 ), (143) This completes the proof. deg(mM11 (x)) + deg(mH11 (x)) ≤ deg(zM1 (x)) − deg(zR0 (x)) + deg(a(x)) − deg(zM0 (x)) ⇒ deg(mM11 (x)) + deg(mH11 (x)) + deg(zM0 (x)) − deg(zM1 (x)) ≤ deg(a(x)) − deg(zR0 (x)) ⇒ deg(mM11 (x)) + deg(mH11 (x)) + deg(qM (x)) ≤ deg(a(x)) − deg(zR0 (x)) (By (105)) ⇒ deg(mR11 (x)) ≤ deg(a(x)) − deg(zR0 (x)) (By (137)), 16 (139)
8cs.DS
Modeling and control of permanent-magnet synchronous generators under open-switch converter faults Christoph M. Hackl‡,? , Urs Pecha† and Korbinian Schechner‡ Abstract arXiv:1802.00182v1 [cs.SY] 1 Feb 2018 The mathematical modeling of open-switch faults in two-level machine-side converters and the fault-tolerant current control of isotropic permanent-magnet synchronous generators are discussed. The proposed converter model is generic for any open-switch fault and independent of the operation mode of the electrical machine. The proposed fault-tolerant current control system gives improved control performance and reduced torque ripple under open-switch faults by (i) modifying the anti-windup strategy, (ii) adapting the space-vector modulation scheme and (iii) by injecting additional reference currents. The theoretical derivations of model and control are validated by comparative simulation and measurement results. Index Terms Permanent-magnet synchronous generator, current control, fault-tolerance, fault-tolerant control, open-switch fault, anti-windup, field-oriented control, flat-top modulation, d-current injection, wind turbine systems Statement: This paper has been submitted for publication in IEEE Transactions on Power Electronics. C ONTENTS I Introduction II Modelling II-A Model of PMSM . . . . . . . . . . . . . . . . . . . . . . II-B Model of converter . . . . . . . . . . . . . . . . . . . . . II-B1 Model of converter without faults . . . . . . . II-B2 Model of converter with one open-switch fault . . . . 3 3 4 4 4 III Current Control System III-A Standard control system (field-oriented control) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . III-A1 PI controllers with anti-windup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . III-A2 Cross-coupling feedforward compensation . . . . . . . . . . . . . . . . . . . . . . . . . . . . III-A3 Reference voltage saturation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . III-A4 Space-vector modulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . III-A5 Control performance of standard control system under an open-switch fault in S1 (phase a) . III-B Proposed fault-tolerant control system (modified field-oriented control) . . . . . . . . . . . . . . . . . . III-B1 Extension of anti-windup strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . III-B2 Modification of SVM (flat-top modulation) . . . . . . . . . . . . . . . . . . . . . . . . . . . III-B3 Injection of optimal d-current . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 6 6 7 7 8 8 8 8 9 10 IV Implementation and experimental verification IV-A Experimental setup and implementation IV-B Discussion of experiments . . . . . . . IV-B1 Experiment (E1 ) . . . . . . . IV-B2 Experiment (E2 ) . . . . . . . IV-B3 Experiment (E3 ) . . . . . . . 12 12 12 12 14 15 V Conclusion 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 ‡ C.M. Hackl and K. Schechner are with the research group “Control of renewable energy systems” (CRES) at the Munich School of Engineering (MSE), Technische Universität München (TUM), Germany. † U. Pecha is with the Institute of Electrical Energy Conversion, University of Stuttgart, Germany. ∗ Authors are in alphabetical order and contributed equally to the paper. Corresponding author is C.M. Hackl ([email protected]). 1 References 16 N OTATION N, R, C: natural, real and complex numbers. R>α := (α, ∞), (R≥α := [α, ∞)): real numbers greater than (and equal to) α ∈ R. <(s), =(s) ∈ R: real, imaginary part of s ∈ C. x := (x1 , . . . , xn )> ∈ Rn : column vector, n ∈ N where ‘> ’ and ‘:=’ mean ‘transposed’ and ‘is defined as’. diag(a1 , . . . , an ) ∈ Rn×n : diagonal matrix with entries a1 , . . . , an ∈ R, n ∈ N. (#1) I n := diag(1, . . . , 1) ∈ Rn×n : identity matrix. O n×p ∈ Rn×p : zero matrix, n, p ∈ N. ξ = ζ: equivalence of ξ and ζ (#2) follows by invoking Eq. (#1) and Eq. (#2). x ∈ Rn (in X)n : physical quantity x where each of the n elements has SI-unit X. mod (x, y): remainder of the division x/y, x ∈ R, y ∈ R\{0}. atan2: R2 → [−π, π)," (x, y) → #atan2(y, x) is the extension 2 h i 0 3 √ 1 −1 −1 3 −1 3 of the inverse tangent function to a whole circle. T c = 32 0 √23 − √23 and T −1 = : Clarke and inverse Clarke 3 3 √ c 2 2 2 −1 − 3 3 3   cos(φ) − sin(φ) transformation matrix. T p (φ) = sin(φ) cos(φ) = T p (−φ)−1 : Park transformation matrix. J = 01 −1 0 : rotation matrix. I. I NTRODUCTION Open-switch faults in converters for electric drives have gained increasing attention in the last years. Especially, the detection of faults in the converter and the identification of the faulty switch have been the focus of research. Various detection methods have been presented [1], [2], [3], [4], [5], [6], [7], [8] and, hence, fault detection is not the topic of this paper. In particular in off-shore wind turbine systems, it is desirable to continue their operation even in presence of open-switch faults in the machine-side converter. However, the faulty converter causes increased losses and oscillations in the torque which harm the mechanical components and the generator of the wind turbine [9]. To analyze the impact of open-switch faults, a model of the faulty converter has been proposed in [10], [11], [12]. The model determines the phase voltages of the electric machine connected to the faulty converter by using so called pole voltages of the converter. If there is an open-switch fault in one of the switching devices, a deviation in the pole voltage of the respective phase occurs which affects all three phase voltages. The pole voltages are, however, a rather unintuitive quantity compared to, for example, the switching state of the power electronic devices or the phase voltages of the machine. Moreover, the use of pole voltages in simulations makes the converter model unnecessarily complicated. To ensure a safe and uninterrupted operation of the electrical drive, a fault-tolerant control strategy has to be implemented. In [13], [14], [15], [16], a modified space vector modulation (SVM) is proposed for two-level converters. These contributions adapt the switching patterns and replace those space vectors which cannot be applied due to the open-switch fault. However, these papers do neither consider optimal phase shift angles between applied voltage and current vector nor adapt their current controllers to the post-fault operation, although – as will be shown later – these measures additionally and significantly improve the overall control performance. For three-level converters using NPC or T-type configurations the redundancy in the switching states can be used to compensate for the infeasible switching states and to generate the desired voltage output nevertheless, see [3], [5], [17], [18]. In addition, [18] proposes to inject an additional d-axis current to shift the phase angle between reference voltage and current to 0◦ if an open-switch fault occurs in one of the outer switches. This helps to avoid infeasible switching states, and therefore reduces the current distortion in the faulty phase of the generator. However, the use of redundant switching vectors can not be used for two-level converters, since there is no sufficient redundancy in the available switching states. The impact of an open switch fault reduces the feasible voltage area in the voltage hexagon of a two-level converter significantly. Moreover, in [3], [5], [17], [18], the current control system and its impact on the control performance during faults are not discussed in detail. [19] proposes to consider converters with open-switch faults as three-switch three-phase rectifiers (all upper or lower switches are assumed to be simply diodes). It investigates the possible avoidance of infeasible zero switching vectors in space vector modulation (SVM). To achieve a minimal current distortion, a phase shift of 180◦ between current and voltage vector is proposed. This phase shift is achieved by injecting an appropriate d-current. Further investigations in this paper will show, that, for the considered PMSM, 180◦ is not the optimal phase shift angle to guarantee a minimal current distortion. Moreover, in [19], the impact of the open-switch fault on the control performance of the current controller (such as windup effects) is neither addressed nor tackled, and a generic converter model covering open-switch faults for e.g. simulation purposes is not provided. Another possibility to ensure a continued operation of the electric machine is the use of fault-tolerant converter configurations. Different topologies and methods to control faulty converters are described in [19], [20], [21], [22]. For example, in case of open-switch faults, a fourth inverter leg can be used, or the neutral point of the machine can be connected to the midpoint of the DC bus. Both solutions can compensate for the loss of the phase with the faulty switch. However, additional and costly hardware components or reconfigurations are required in contrast to standard converter configurations. In this paper, a fault-tolerant current control system for PMSM-based wind turbine systems is proposed where the machineside two-level converter exhibits open-switch faults. The proposed control system does not require any hardware modifications 2 and is easy to implement, since the required extensions to the standard control system are straightforward and non-complex. Furthermore, a generic mathematical (phase) model of the faulty converter is proposed. The model relies on the switching states of the upper (or lower) switches and determines the phase voltages of the generator depending on the sign (direction) of the current in the faulty phase. Therefore, this model can be implemented quickly and efficiently. It is simple and easy to understand and allows very precise simulations which give almost identical results as the conducted experiments in the laboratory. Based on this precise but simple model, the impacts of the open-switch fault on the current control performance of a standard field-oriented control system are analyzed and a fault-tolerant control system is proposed. The proposed control system combines different modifications like (i) an improved anti-windup strategy, (ii) a modified SVM and (iii) an optimal d-axis current reference bringing the phase angle between voltage and current in the generator to an optimal value (which is neither 180◦ nor 0◦ for the considered machine). All modifications and their positive effects on the control performance under open-switch faults are discussed in detail. The effectiveness of the proposed modifications is finally illustrated and validated by comparative simulation and measurement results. II. M ODELLING In this section, the models of the permanent-magnet synchronous machine (PMSM) and the machine-side inverter/converter with open-switch faults are introduced. The models are derived in the generic three-phase (a, b, c)-reference frame. A. Model of PMSM The three-phase stator voltages of an isotropic PMSM are given by [23, Example 14.24] uabc = Rs iabc + s s abc abc d dt ψ s (is , φm ) (1) with stator voltage (vector) uabc := (uas , ubs , ucs )> (in V)3 , stator resistance Rs (in Ω), stator current (vector) iabc := s s a b c > 3 a b c > 3 (is , is , is ) (in A) and stator flux linkage (vector) ψ abc := (ψ , ψ , ψ ) (in V s) . Note that the stator phase currents s s s s sum up to zero (i.e. ias + ibs + ics = 0) due to the star connection of the stator windings. The stator flux linkage ! " #    Ls,m Ls,m abc ψ abc s (is , φm ) = | Ls,m + Ls,σ Ls,m − 2 Ls,m − 2 − 2 Ls,m + Ls,σ Ls,m − 2 {z − − 2 Ls,m 2 Ls,m + Ls,σ abc =:Ls iabc + ψ̂pm s } | cos np φm + φpm    cos np φm + φpm −    cos np φm + φpm − {z abc =:ψ pm (φm )  2π 3  4π 3 , (2) } (in VAs )3 with stator main inductance Ls,m & stator leakage inductance Ls,σ (both depends on the inductance matrix Labc s abc abc in VAs ), stator currents is and permanent-magnet (PM) flux linkage R vector ψ pm with PM-flux linkage amplitude ψ̂pm (in V s), number np of pole pairs, machine (mechanical) angle φm := ωm (τ )dτ (in rad) and (initial) angle φpm (in rad) of the permanent magnet. Inserting (2) into (1) yields the current dynamics combined with the mechanical dynamics in the (a, b, c)-reference frame (see Fig. 1) as follows        !       −1    sin np φm (t) + φpm        abc abc abc abc  d 2π sin n φ (t) + φ − Ls us (t) − Rs is (t) + np ωm (t)ψ̂pm   pm   3   p m dt is (t) =  4   sin np φm (t) + φpm − π 3   (3) | {z }  abc a b c >   =:−e =−(e ,e ,e ) s s s s       abc 1 d    dt ωm (t) = Θ mm is (t), φm (t) + mt (t)   d φ (t) = ω (t), m dt m abc 3 rad with initial currents iabc s (0) = is,0 (in A) , initial angular velocity ωm (0) = ωm,0 (in s ), initial machine angle φm (0) = φm,0 abc a b c > 3 (in rad), induced back-emf voltage vector es = (es , es , es ) (in V) , total inertia Θ (in kg m2 ) of the drive train, machine torque mm and turbine torque mt (both in N m). The machine torque mm can be computed as follows [23, Example 14.24] !    a i is sin np φm (t) + φpm np  abc > h 1√ 1 − √3 1 + √     √3 abc abc abc b 2 1 + √3 1√ 1− 3 ψ mm (is , φm ) = is (4) s (is , φm ) = −np ψ̂pm ics sin np φm (t) + φpm  − 3 π  . 1− 3 1+ 3 1 3 is sin np φm (t) + φpm − 4 π 3 Remark II.1 (Field orientation). Aligning the synchronously rotating (d, q)-reference R frame with the PM-flux linkage, i.e. applying the Clarke and Park transformation xk = T p (φk )−1 T c xabc with φk = ωk + φpm and ωk = np ωm to machine 3 grid-side converter machine-side converter DC link electrical machine a us a es S1 S2 S3 a is b es udc A Cdc B C b is c es S1 S2 S3 c is Fig. 1: Back-to-back converter with permanent-magnet synchronous machine. dynamics (3) and machine torque (4) yields the machine dynamics    0 k k k abc 1 d k us (t) − Rs is (t) − ωk (t)Ls J is (t) − ωk (t)ψ̂pm , iks (0) = T −1 p (φk (0))T c is,0 dt is (t) = Ls 1    k 1 d ωm (0) = ωm,0 dt ωm (t) = Θ mm is (t) + mt (t) , d dt φm (t) = ωm (t) φm (0) = φm,0          (5) in the PM-flux linkage orientation (or, simply, field orientation; see e.g. [23, Chapter 14] or [24, Sect. 3.2.2]) with stator voltages uks := (uds , uqs )> (in V)2 , stator currents iks := (ids , iqs ) (in A)2 , stator inductance Ls := 32 Ls,m + Ls,σ (in VAs ) and flux linkage ψ ks := (ψsd , ψsq )> (in V s)2 , and the machine torque mm (iks ) = 32 np (iks )> J ψ ks = 32 np ψ̂pm iqs . (6) B. Model of converter 1) Model of converter without faults: Figure 1 shows a back-to-back converter with permanent-magnet synchronous machine. The output voltage of the machine-side converter is the stator voltage, given by [25] h 2 −1 −1i abc abc udc −1 2 −1 s ) = (u , s uabc (7) s dc s s , 3 −1 −1 2 and depends in the fault free case for a star-connected, symmetrical electrical machine only on the actual switching vector means that the upper switch = (sas , sbs , scs )> and the actual dc-link voltage udc (in V). A ”1” in the switching vector sabc sabc s s > is closed. A ”0” represents a closed lower switch. For example, a switching vector sabc = (1, 1, 0) yields the closed switches s abc S1 , S2 , and S 3 (S3 is open). Applying the Clarke transformation to the two-dimensional stator to (7) allows to transform u s β > abc , u = T u . fixed (α, β)-reference frame as follows uss := uα s s c s 2) Model of converter with one open-switch fault: At first, the model is derived for an open-switch fault in S1 . Afterwards, the generalization of the faulty converter model is presented. Without loss of generality, the open-switch fault is assumed to appear in switch S1 . Hence, switch S1 is always open independent of the switching vector sabc of the converter. With this s does not solely depend on the dc-link voltage u and the switching vector sabc fault present, the voltage uabc s dc s , but also on a the sign (direction) of the current is in phase a. Figure 2(a) illustrates the different connection possibilities of the windings of the electrical machine taking the sign of the current into account and whether the free-wheeling diode of S1 is conducting or not (compare also with Fig. 1). The resulting (shifted) voltage hexagon for this case is shown in Fig. 2(b). The following observations can be made: a s 1 • For is = 0, the voltage vectors (see blue symbols) are shifted by ∆uia =0 = − 3 udc in negative a-direction (see s s s e.g. u110,ias =0 or u101,ias =0 in Fig. 2(b)). Normal operation is not feasible. a s 2 • For is > 0, the voltage vectors (see magenta symbols) with a “1” for S1 are shifted by ∆uia >0 = − 3 udc in negative s s s a-direction (see e.g. u101,ias >0 or u101,ias >0 in Fig. 2(b)). Normal operation is not feasible. a s s • For is < 0, the voltage vectors (see green symbols) are not shifted (see e.g. u101,ia <0 or u110,ia <0 in Fig. 2(b)). Normal s s operation is feasible. In Fig. 3, the feasible voltage areas in the voltage hexagon and the feasible voltage vectors uss for open-switch faults in S1 are shown depending on the direction of current ias . For ias < 0, the full voltage hexagon can be used. For ias = 0 or ias > 0, the feasible areas in the voltage hexagon become smaller. Most critical case occurs for ias > 0, where only the sectors III and IV are feasible. Combining the observations above, the converter model (7) must be extended for an open-switch fault in S1 4 β B ias = 0 A: uas udc b ubs 2udc 3 us110,ias =0 us110,ias >0 A ∆usias =0 us110,ias <0 ucs C B ias > 0 A: ubs ias udc us111,ias >0 uas ucs A ias < 0 A: us100,ias =0 us111,ias <0 = us100,ias >0 = us000 − 2u3dc C A us111,ias =0 us100,ias <0 2udc 3 a α B uas udc ias ubs ∆usias >0 us101,ias >0 ucs us101,ias =0 c us101,ias <0 − 2u3dc C abc (a) Electrical equivalent circuit for ss = (1, 1, 0) > abc . (b) Voltage hexagon with shifted voltage vectors for all possible ss . Fig. 2: Illustration of impact of open-switch fault in S1 on (a) electrical equivalent circuit of machine-side converter and PMSM (for s a a simplicity, the windings are shown as inductances) and on (b) voltage hexagon with shifted voltage vectors us for is = 0 and is > 0. β b ias < 0 A 2 udc 3 ias = 0 A ias > 0 A III a − 2 u3dc α 2 udc 3 IV − 2 u3dc c a Fig. 3: Voltage hexagon with feasible sectors and voltage vectors under an open-switch fault in S1 depending on the current is . as follows uabc s u = dc 3  h  2  −1  −1  | −1 2 −1 i −1 −1 2 +            O 3×3 ,  −1 0  1 0  2 1 0 2  −2  1 1 {z 0 0 0 a if is < 0 A  0 0 , 0  0 0 , 0 a if is = 0 A a if is > 0 A a =:S S (is ) 1        abc  ss .        (8) } The switching matrix S S1(ias ) ∈ R3×3 exclusively models the converter for an open-switch fault in S1 and changes with the direction of the phase current ias . Generalizing the observations above to an arbitrary open-switch fault in one of the six switches S1 , S2 , S3 , S 1 , S 2 and S 3 , and introducing the negated switching vector sabc := 13 − sabc where 13 := (1, 1, 1)> , s s 5 (9) TABLE I: Complete model of a faulty converter with switching matrices S y and S z for faulty switches S1 , S2 , S3 and S 1 , S 2 , S 3 , resp. u abc x abc Converter output phase voltage us = dc S y (is ) ss for faults in the upper switches 3 y = S1 , x = a Sy  x  is < 0 A Sy  x  is = 0 A  x  S y is > 0 A  2 −1 −1  1 − 1  2 −1  2 0 0 0 −1 2 −1 −1 2 −1 −1 2 −1 y = S2 , x = b  −1 −1 2  −1 −1  2  −1 −1 2  2 −1 −1  2 −1  −1  2 −1 −1 −1 2 −1 −1 2 1 −1 2 0 0 0 y = S3 , x = c  −1 −1 2  −1 −1  2  −1 −1 2  2 −1 −1  2  −1 −1  2 −1 −1 −1 2 −1 −1 2 −1 −1 2 −1  −1 −1 2  −1 2 −1 2 1  0 0 0 u abc x abc Converter output phase voltage us = dc S z (is ) ss for faults in the lower switches 3 z = S1 , x = a Sz  x  is < 0 A Sz  x  is = 0 A  x  S z is > 0 A  0 0 0  −1 1   2 1  2 −2  1 1 1 −2 1 1 −2 1 1 −2 1 z = S2 , x = b  1 1  −2  1 1   −2  1 1  −2  −2  1 1  −2   1 1 −2  1 1  0 0 0 1 2 −1 1 2 1 −2 1 z = S3 , x = c   −2  1 1  −2   1 1 1  −2  1 1   −2  1 1  −2 1 −2  1 1  1 −2 1 1 −2 1 1 −2 1  0 0 0 1  2  1  2 −1  1 1  −2 leads to different switching matrices S y (ixs ) and S z (ixs ) with x ∈ {a, b, c}, y ∈ {S1 , S2 , S3 } and z ∈ {S 1 , S 2 , S 3 }, respectively. Finally, the switching matrices for all possible faults in the six switches S1 , S2 , S3 , S 1 , S 2 and S 3 and the respective phase current directions are collected in Table I (details are omitted due to space limitations). III. C URRENT C ONTROL S YSTEM PI controllers and field-oriented control are a common choice for the current control system in electrical drives (see [26, Sect. 14.6] or [24, Sect. 3.2.2]). In most cases, the PI controllers are equipped with an anti-windup strategy and cross-coupling feedforward compensation terms to compensate for the cross-coupling between d− and q−currents. In this section, at first, standard field-oriented control is briefly revisited. Afterwards, the crucial modifications to improve the control performance under open-switch faults are proposed. The impact of an open-switch fault on the standard control system and the improvements achieved by the proposed fault-tolerant control system are illustrated and analyzed in simulations (see Sect. III-A5 and Sect. III-B, resp.). Finally, the simulation results are validated by comparative measurement results in Sect. IV. A. Standard control system (field-oriented control) In Fig. 4, the block diagram of the standard control system consisting of 1) PI controllers with anti wind-up, 2) cross-coupling feedforward compensation, 3) reference voltage saturation and 4) modulation is depicted. In the following subsections, each block will be explained briefly. 1) PI controllers with anti-windup: The PI controllers weight and integrate the current control error   d  d d e (t) (t) − is (t) ekis (t) := eqis (t) := iis,ref , (10) q q (t) − i (t) is s,ref s defined as the difference between reference currents (coming e.g. from outer control loops) and the actual currents. Output uks,PI = (uds,PI , uqs,PI )> and dynamics of integrator ξ ki = (ξid , ξiq )> of the PI controllers with anti-windup decision function faw (·) are as follows hd i hd i ) uks,PI (t) = k0p k0q ekis (t) + k0i k0q ξ ki (t) p i (11)  k d k ξ (t) = f û (t) · e (t), ξ ki (0) = 02 . s,ref aw is dt i with proportional and integral controller gains kpd & kpq and kid & kiq , respectively. For example, a model-based tuning is according to the magnitude optimum (see e.g. [25]) which leads the following controller gains kpd = kpq = Ls3fsw and kid = kiq = Rs3fsw where fsw (in Hz) is switching frequency of the converter/inverter. Any other reasonable tuning rule might also be applicable. The anti-windup decision function (  1 , if ûs,ref ≤ ûmax (udc , θ0 ) faw ûs,ref := (12) 0 , else 6 Compensation PI controllers d kp d us,comp d is − d eis − d ki d us,ref Space-vector modulation Saturation φk × d is,ref = 0 0 ûmax (θ ) k us,ref s us,ref dq q kp s us,ref,sat abc ss αβ q is − q eis q q ki − × q is,ref us,ref q us,comp θ 1 s us,ref 0 (13) (14) ûs,ref Anti-windup dec. funct. (11), (12) Anti-windup Fig. 4: Standard control system (field-oriented control): PI controllers with anti-windup, cross-coupling feedforward compensation and reference voltage saturation. enables or disables integration of the integral control action (i.e. conditional integration, for more details see [23, Sect. 10.4.1]), if the applied reference voltage vector amplitude ûs,ref (in V), defined by q  uα   2 2 := T p (φk ) uks,PI − uks,comp , + uβs,ref where uss,ref := us,ref (13) ûs,ref := uα β s,ref s,ref | {z } k :=us,ref exceeds the maximally available voltage amplitude ûmax (in V), given by ûmax (udc , θ0 ) := √ 2 √3 0 · u sin(θ )+ 3 cos(θ ) 3 dc | 0 √ {z 3 2 ≤ · ≤1 }   π π ≤ 32 udc where θ0 := mod atan2(uβs,ref , uα s,ref ), 3 ∈ 0, 3 , | {z } (14) =:θ within the full (fault-free) voltage hexagon (see Fig. 2(b)). The maximally available amplitude ûmax of the converter depends on the voltage reference angle θ (in rad) and the DC-link voltage. Note that ûmax varies inside the voltage hexagon. It is larger for θ = 0◦ or θ = 60◦ (maximum voltage amplitude ûmax (udc , 0) = 32 udc ) than for θ = 30◦ (minimum voltage amplitude ûmax (udc , π/6) = √13 udc ). Invoking trigonometric identities leads to the expression of ûmax in (14) by only considering the   first sector of the voltage hexagon, i.e. θ = θ0 ∈ 0◦ , 60◦ . Note that, in the first sector, θ0 coincides with θ. Then, by using the auxiliary phase angle θ0 as defined in (14), the generalized formula for the available amplitude ûmax is obtained for all other sectors of the voltage hexagon. 2) Cross-coupling feedforward compensation: The compensation of cross-coupling terms in the current dynamics (5) is realized by the following feedforward control action   d  q   ωk (t)Ls is (t) k (t) 0 d uks,comp (t) := uus,comp := −ω (t)L J i (t) − ω (t) ψ̂ = , (15) q 1 k s s k pm −ωk (t)Ls is (t) − ωk (t)ψ̂pm (t) s,comp which (at least in steady state) cancels out the influence of the q-terms on the d-current dynamics and vice versa (cf. (5) in Sect. II-A). 3) Reference voltage saturation: To avoid undesirable and infeasible output voltages of converter by applying physically infeasible voltage reference vectors, the computed reference voltage vector uss,ref as in (13) is saturated if necessary as follows ( s us,ref (t) , if ûs,ref (t) ≤ ûmax (t) s  us,ref,sat (t) = (16) cos θ(t) ûmax (t) sin θ(t) , else. Note that the reference voltage saturation does only alter the length of the voltage vector not its direction. 7 4) Space-vector modulation: To generate the switching sequence and, in particular, the switching vector sabc based on the s saturated reference voltage uss,ref,sat , a symmetrical space vector modulation (SVM) is used in this paper (cf. [26, Chap. 14] or [24, Sect. 2.4.1]). The boundary (adjacent) space vectors of the respective sector and, usually, both zero vectors u000 and u111 are applied to approximate the reference voltage vector uss,ref,sat over one switching period Tsw = 1/fsw (in s). To do so, Tsw is divided into three time intervals: T1 for the first non-zero vector, T2 for the second non-zero vector and T0 for the zero vectors such that T1 + T2 + T0 = Tsw (see Fig. 2(b) and Fig. 6(a)). If the voltage reference vector is not saturated (cf. Sect. III-A3), this will lead—depending on the implementation of the SVM—e.g. to a negative time for T0 , which will cause strange behaviour of the SVM. 5) Control performance of standard control system under an open-switch fault in S1 (phase a): To have a measure to evaluate the control performance of the standard and the fault-tolerant control systems, the total harmonic distortion (THD) is used. The total harmonic distortion THDias (in %) of e.g. the phase current ias can be computed as follows [27] THDias := qP ∞ a 2 n=2 (In ) a I1 ≥ 0, (17) where I1a and Ina (both in A) are the rms values1 of the fundamental and the n-th harmonic current component, respectively. Figure 10(a) shows the control performance of the standard control system (as in Fig. 4) under an open-switch fault in S1 (phase a). The upper subplot illustrates reference (ids,ref & iqs,ref ) and actuals currents (ids & iqs ) in the (d, q)-reference frame, whereas the lower subplot shows the phase currents ias , ibs and ics over time. It can be clearly seen, that the current ias of phase a is sinusoidal for the negative half-wave, but non-sinusoidal (close to zero) for the positive half-wave. This deviation leads to non-constant (as usually expected) currents ids and iqs which significantly differ from their respective reference values ids,ref and iqs,ref for (almost) all time. The current iqs tends to zero during the non-existing positive half-wave of ias . Moreover, even for the negative (correct) half-wave of ias , the current iqs is not capable of tracking its reference iqs,ref . In particular, the non-constant and nonlinearly oscillating evolution of iqs leads to noticeable torque ripples. The non-zero current ids does not contribute to the torque (recall (6)) but increases copper losses in the machine. In conclusion, the standard control system performance is not acceptable and must be improved to allow for a safe and uninterrupted operation of the wind turbine system. B. Proposed fault-tolerant control system (modified field-oriented control) As illustrated in Fig. 10(a), the standard control system performance is poor and not acceptable when an open-swich fault is present. Without altering the hardware or the principle control system, three (software) modification are proposed to improve the control performance of the wind turbine system under open-switch faults in one phase. The three modifications are: 1) Extension of the anti-windup strategy, 2) Modification of the SVM and 3) Torque ripple minimization by injecting an optimal d-current. Each modification is explained in detail and its positive effect on the control performance of the fault-tolerant control system is illustrated by simulation results. Later, in Sect. IV, these modifications are implemented on a laboratory test bench and their effectiveness is validated by measurements. The block diagram of the improved and fault-tolerant control system is depicted in Fig. 5. The modifications are highlighted in blue. 1) Extension of anti-windup strategy: To improve the control performance under faults, in a first step, the anti-windup strategy (12) of the PI current controllers (11) is modified. The overshoots in the q-current during the open-switch fault in S1 (recall Fig. 10(a)) are—at least partly—due to windup of the integral control action of the PI controllers during the positive (almost zero) half-wave of ias . To avoid this windup, an additional condition considering the current direction (see Fig. 5) must be introduced which leads to the extended anti-windup decision function ( 1 , if ûs,ref ≤ ûmax (udc , θ0 ) AND ias < ı̂aw < 0 a ? faw ûs,ref , is := (18) 0 , else for open-switch faults in S1 (phase a), which replaces faw (·) in (11). The constant ı̂aw < 0 (in A) represents the maximally admissible anti-windup current and should be chosen negative to account for the chattering of the phase current ias around zero (recall Fig. 10(a)). Note that, for any other faulty phase with open-switch fault in S2 (or S3 ), the respective phase current direction of ibs (or ics ) must be considered in (18) instead of ias . In Fig. 10(b), the improved control system performance due to the extended anti-windup strategy (18) is shown. The abccurrents (lower subplot) do not alter much (almost no improvement is visible) and the THD reduces slightly to THDias = 41.4 %. But the tracking performance of the currents ids and, in particular, iqs is improved substantially. During the positive (almost zero) half-wave of ias , both currents still do not perfectly track their references; but during the negative half-wave of ias , both currents are capable of (almost) asymptotic reference tracking. Especially, the current ripple in the q-current is drastically reduced during the negative half-wave of ias . 1 The root mean square (rms) value is defined by I := q 1 T Rt t−T 2 i(τ ) dτ with fundamental period T = 1/f of the current i(·). 8 Compensation PI controllers d kp d us,comp d is d-current injection − d eis − d ki d us,ref d is,ref Flat-top modulation Saturation φk × (21) 0 ûmax (θ ) k us,ref s dq q kp us,ref,sat abc ss αβ q is − q eis q q ki × q is,ref us,ref − s us,ref q us,comp Anti-windup θ 1 0 (14) (13) ûs,ref 0 ûs,ref ≤ ûmax (θ ) AND Extended anti-windup decision function < a is ı̂aw a is < ı̂aw Fig. 5: Fault-tolerant control system (modified field-oriented control; changes in blue) for an open-switch fault in S1 (phase a): PI controllers with improved anti-windup, cross-coupling feedforward compensation and reference voltage saturation. sas sas 1 1 0 sbs Tsw 2 Tsw t 0 sbs 1 Tsw 2 Tsw t Tsw t Tsw t 1 0 scs Tsw t 0 scs 1 1 0 T0 4 T1 2 T2 2 T0 4 Tsw t 0 T0 2 (a) Standard SVM. T1 2 T2 2 (b) Flat-top modulation. s us,ref s s Fig. 6: Switching patterns to generate a voltage reference vector in sector III by a linear combination of the space vectors u010 , u011 s s s and (a) both zero vectors u000 and u111 , (b) only the zero vector u000 . 2) Modification of SVM (flat-top modulation): The second step to improve the control performance during open-switch faults is the modification of the space-vector modulation. Note that any open-switch fault in one of the upper switches (i.e. S1 , S2 or S3 ) leads to a shifted zero vector us111 (for ias ≥ 0, see Fig. 2(b)); whereas any open-switch fault in one of the lower switches (i.e. S 1 , S 2 or S 3 ) shifts the other zero vector us000 . Hence, one of the zero vectors is not zero any more. Then, using flat-top modulation allows to use only the non-shifted zero vector (cf. [26, Chap. 14.6], [28]). For example, for an open-switch fault in S1 , S2 or S3 , only the zero vector us000 is applied (see Fig. 6(b)). For faults in S 1 , S 3 or S 2 only the zero vector us111 is used. In Fig. 10(c) the positive effect of the flat-top modulation on the control performance and the THD of ias is illustrated. 9 β β b b iss (t1 ) IIb IIa iss (t1 ) uss,ref (t0 ) III uss,ref (t0 ) I ϕ0 IIb IIa I III a a α ϕ0 IV α ϕ0 VI VI IV uss,ref (t1 ) uss,ref (t1 ) Va c Vb Va iss (t0 ) c ◦ iss (t0 ) ◦ (a) ϕ0 = 150 . s Vb (b) ϕ0 = 210 . s ◦ ◦ Fig. 7: Stator current vector is and voltage reference vector us,ref at time t0 and t1 for (a) ϕ0 = 150 and (b) ϕ0 = 210 . The upper subplots show the d and q currents and their references, whereas the lower subplot depicts the abc-currents for the modified control system with extended anti-windup and modified SVM. Clearly, the intervals where ias ≈ 0 A are significantly shorter. Moreover, positive and almost sinusoidal ias currents are feasible again due to the modified SVM. So, the THD value is drastically reduced to THDias = 19.5 % and the tracking control performances of the currents ids and iqs are improved as well. 3) Injection of optimal d-current: The last improvement is to inject an optimal (additional) d-current to minimize the THD of the faulty phase even further. In the following, an open-switch fault in S1 is considered. For other open-switch faults, the modifications are straight forward. As discussed in Sect. II-B2, for a fault in S1 and ias ≥ 0, the output voltages that can be provided by the faulty converter are limited. For e.g. ias > 0, only voltage vectors from the sectors III and IV are feasible (see Fig. 3). The principle idea of the optimal d-current injection is to generate auxiliary reference voltage vectors within those two feasible sectors as long as possible. The goal is to determine an optimal phase shift ϕ0 (in rad or ◦ ) between stator current iss and reference voltage uss,ref . To illustrate the idea, in Fig. 7, the phase shifts ϕ0 = 150◦ and ϕ0 = 210◦ are shown for two time instants t0 and t1 where s is (t0 ) and iss (t1 ) are located on the negative and positive β-axis, respectively. Note that, if the phase current ias is non-negative, the stator current space vector iss is located in the right half-plane (see Fig. 7). More precisely, at t0 with ias (t0 ) = 0 (ias becomes positive thereafter), iss lies on the negative β-axis; whereas, at t1 with ias (t1 ) = 0 (ias becomes negative afterwards), iss is aligned with the positive β-axis. Clearly, within the interval [t0 , t1 ], the current moves by 180◦ and, optimally, the corresponding stator voltage reference space vector uss,ref should be within the sectors III and IV as long as possible in order to apply feasible and correct voltages to the generator. However, as these two sectors represent only span over 120◦ , it is not possible to apply the correct voltages during the whole non-negative half-wave of ias during an open-switch fault in S1 . During the remaining 60◦ , incorrect voltages will be applied by the faulty converter which affect the shape of the currents and cause deviations from the desired sinusoidal waveform. Depending on the phase shift ϕ0 between stator current and reference voltage, different parts of the non-negative half-wave of ias are affected by the fault. For ϕ0 = 150◦ (see Fig. 7(a)), uss,ref starts in sector II at time t0 . So, for the first 60◦ of the current half-wave, incorrect voltages are applied to the generator. As soon as uss,ref enters sector III, the correct voltages can be provided (even) by the faulty converter. When uss,ref is in the sectors III and IV, the correct voltages give rise to a sinusoidal current. For ϕ0 = 210◦ (see Fig. 7(b)), the behaviour is flipped: At time t0 , uss,ref starts already in the feasible sector III and, hence, during the first 120◦ of the non-negative current half-wave, the correct voltages are applied. But, as soon as uss,ref enters sector V, incorrect voltages are generated by the converter for the rest of the half-wave until time t1 . Concluding, in order to fully benefit from the two feasible voltage sectors IIIand IV, where the correct voltages can be generated for ias > 0, the phase shift must be within the interval ϕ0 ∈ 150◦ , 210◦ . The observations above are also validated by the simulation results presented in Fig. 8: For ϕ0 = 150◦ (see Fig. 8(a)), during the first 60◦ , the phase current ias jitters around zero. In contrast to the last 120◦ , where the desired sinusoidal characteristic is achieved. For ϕ0 = 210◦ (see Fig. 8(b)), the phase current ias exhibits a sinusoidal characteristic during the first 120◦ , whereas, for the last 60◦ , it is deteriorated. 10 i qs i ds 20 i qs , r e f i ds , r e f Cu r r en t / A Cu r r en t / A 30 10 0 −1 0 −2 0 i as 40 i cs i bs Cur r en t / A Cur r en t / A −3 0 60 20 0 −2 0 −4 0 0 0. 05 0. 1 0 −5 −1 0 −1 5 −2 0 −2 5 −3 0 −3 5 60 i cs i bs 20 0 −2 0 0 0. 05 Ti m e t / s ◦ i qs , r e f i ds , r e f i as 40 −4 0 0. 15 i qs i ds 0. 1 0. 15 Ti m e t / s ◦ (a) ϕ0 = 150 : THDia = 31.4 %. (b) ϕ0 = 210 : THDia = 12.2 %. s k abc Fig. 8: Currents is (with references) and is s ◦ ◦ for different phase shifts: (a) ϕ0 = 150 and (b) ϕ0 = 210 . Remark III.1. For a converter outputting power—e.g. for PMSMs in motor mode or for grid-side inverters in wind turbine  systems, solely phase shifts of ϕ0 ∈ −90◦ , 90◦ are feasible. Hence, it is not possible to benefit from the sectors III and IV. The phase shift ϕ0 can be altered by the injection of a d-current which also changes the ratio between active power p (in W) and reactive power q (in var), since q = p · tan(ϕ0 ) where p = 32 (uks )> iks and q = 32 (uks )> J iks (see e.g. [25]). (19) ids Moreover, note that, due to (6), can be chosen independently of the desired torque. In order to derive an analytical expression for the reference current ids,ref of the to-be-injected current ids , the following assumption is imposed: Assumption (A.1) The copper losses in the PMSM are negligible and its current dynamics are in steady state, i.e. d k Rs ≈ 0 Ω and dt is = 02 . (20) Solving (5) (in steady state) for uks and inserting the result into (19) gives i i h h np ωm Ls (ids )2 + Ls (iqs )2 + ψ̂pm ids = Rs (ids )2 + Rs (iqs )2 + np ωm ψ̂pm iqs tan(ϕ0 ), | {z } ωk which is a second-order polynomial in ids . Its root with the smaller amplitude is used as d-current reference2 , i.e. s q 2 np ωm ψ̂pm (np ωm ψ̂pm ) d q  2 − (iqs )2 + np ωm ψ̂pm is tan(ϕ0 )  is,ref (is ) = − + 2 np ωm Ls −Rs tan(ϕ0 ) = [Rs ≈0] = − np ωm ψ̂pm 2 np ωm Ls −Rs tan(ϕ0 ) ψ̂ − 2 pm Ls + r ψ̂ + s 2 q 2 ( 2 pm L ) − (is ) + s 4 np ωm Ls −Rs tan(ϕ0 ) 2 (np ωm ψ̂pm ) 2 − (iqs )2 + 4 np ωm Ls −Rs tan(ϕ0 ) ψ̂pm q Ls is tan(ϕ0 ). 2 np ωm Ls −Rs tan(ϕ0 ) q np ωm ψ̂pm is tan(ϕ0 )  1 np ωm Ls −Rs tan(ϕ0 ) (21) Hence, for large machines with Rs ≈ 0, the reference current ids,ref depends on the machine parameters Ls & ψ̂pm , the current iqs (or its reference iqs,ref ) and the desired phase angle ϕ0 . There exists an optimal value for ϕ0 to minimize the THD of the phase current ias . For the considered machine, the optimal value ϕ0,opt = ϕ0 = 197◦ was found by iterative simulations: These results are depicted in Fig. 9(a). Clearly, for other machines, the optimal value might be different. Finally, in Fig. 10(d), the simulation results for the overall fault-tolerant control system with extended anti-windup, modified SVM (flat-top modulation) and optimally injected d-current are shown. The upper subplot depicts the currents ids and iqs and their reference values, whereas the lower subplot illustrates the shape of the abc-currents. The THD value for this scenario is THDias = 9.4 %, which is clearly the lowest compared to the other simulation results in Figures 10(a), 10(b) and 10(c). 2 The solution with − in front of the root would lead to a higher current magnitude. 11 40 TH D i as 360 ◦ P ha s e a n g l e / TH D / % 30 20 10 0 150 160 170 180 ϕ0 / 190 200 ◦ s ϕ 0, op t 250 197 150 100 50 210 ◦ 0 ϕ0,opt = 197 (a) THDia for different phase angles ϕ0 . ϕ0 300 0 0. 025 0. 05 0. 075 Ti m e t / s 0. 1 0. 125 0. 15 ◦ (b) Tracking of optimal phase angle ϕ0,opt = 197 by actual phase angle ϕ0 .  a ◦ ◦ ◦ Fig. 9: THDias of phase current is for different phase angles ϕ0 ∈ 150 , 210 and tracking of optimal phase angle ϕ0,opt = 197 under open-switch fault in S1 (phase a). Moreover, the reference tracking capability, in particular, of iqs is the best which implies that the torque ripples3 are also minimized (recall (6)) leading to less stress on the mechanical drive train. In Fig. 9(b), the tracking of the optimal phase angle ϕ0,opt = 197◦ by the actual phase angle ϕ0 is shown. Due to the remaining time periods, where the correct voltage vector cannot be applied and the phase current is close to zero, the optimal phase angle cannot be achieved for all time. Remark III.2 (Possible limitation of the d-current injection in wind turbine systems). Due to the current rating/limitation of the machine-side converter, the additional injection of a d-current might not be feasible up to the rated torque of the isotropic generator in wind turbine systems. Therefore, the uninterrupted operation of the wind turbine system under open-switch faults might not be possible for all wind speeds unless the pitch control system is incorporated into the fault-tolerant control system. The turbine torque (proportional to the wind speed and the pitch angle) must be decreased by changing the pitch angle such that the current rating of the machine-side converter is not exceeded (for details see [25], [30, Chap. 8]). IV. I MPLEMENTATION AND EXPERIMENTAL VERIFICATION In this section, implementation, experimental validation and comparison of simulation and measurement results are discussed. Three experiments in the laboratory are conducted to (E1 ) validate the accuracy of the proposed mathematical model (8) of the converter with open-switch fault (in S1 ) against a real electrical drive system with open-switch fault; (E2 ) verify the effectiveness of the proposed modifications (such as extension of the anti-windup strategy, flat-top modulation and injection of an optimal d-current) on the generator control performance and to compare simulation and experimental results; and (E3 ) illustrate the impact of an occurring open-switch fault (after a fault-free interval) and then, step-by-step, the positive effect of each proposed modification on the control performance of the laboratory electrical drive system. A. Experimental setup and implementation The measurements where conducted on a 10 kW laboratory test bench as depicted in Fig. 11. The anisotropic reluctance synchronous machine (RSM) is speed-controlled (with underlying nonlinear current controllers [31]). The isotropic permanentmagnet synchronous machine is used as generator and current-controlled as described in the previous sections. Both drives are controlled by a dSPACE real-time system which applies the switching signals (switching vectors) to the respective inverter/converter. Both converters are connected back-to-back. The PMSM converter is modified such that each upper and lower switch can be addressed individually and allows to emulate open-switch faults. For all experiments, without loss of generality, open-switch faults in S1 (phase a) were considered, simulated and emulated. The implementation for simulations and measurements was performed using Matlab/Simulink. In Fig. 12, the block diagram of the implementation is shown. The parameters of the laboratory setup are listed in Tab. II (where Θ = ΘRSM + ΘPMSM ) and coincide with those used for the simulations. Note that the measured currents were filtered (by an analogue filter in the converter) and, then, sampled with the switching frequency; whereas the simulated currents were not filtered. B. Discussion of experiments 1) Experiment (E1 ): The simulation and measurement scenario of this experiment is as follows: The PMSM-side converter emulates an open-switch fault in S1 and the standard control system (as described in Sect. III-A) was implemented. Simulation 3 Note that if the produced generator torque in wind turbine systems does not equal its reference value, wind turbine efficiency and power production are reduced [29]. 12 i qs i ds 40 i qs , r e f i ds , r e f Cu r r en t / A Cu r r en t / A 40 20 0 − 15 . 6 −2 5 i as 40 i cs i bs 20 0 −2 0 −4 0 i qs , r e f i ds , r e f 0 − 15 . 6 −2 5 −4 0 60 Cur r en t / A Cur r en t / A −4 0 60 i qs i ds 20 0 0. 05 0. 1 0. 15 i cs i bs 20 0 −2 0 −4 0 0. 2 Ti m e t / s i as 40 0 0. 05 0. 1 0. 15 Ti m e t / s (a) Standard control performance: THDia = 41.8 %. 0. 2 (b) Improved control performance (in particular for extended anti-windup (18): THDia = 41.4 %. s q is ) due to s i qs i ds 40 i qs , r e f i ds , r e f Cu r r en t / A Cu r r en t / A 40 20 0 − 15 . 6 −2 5 i as 40 i cs i bs 20 0 −2 0 −4 0 i qs , r e f i ds , r e f 0 − 15 . 6 −2 5 −4 0 60 Cur r en t / A Cur r en t / A −4 0 60 i qs i ds 20 0 0. 05 0. 1 0. 15 i bs i cs 20 0 −2 0 −4 0 0. 2 Ti m e t / s i as 40 0 0. 05 0. 1 0. 15 0. 2 Ti m e t / s (c) Improved control performance due to extended anti-windup (18) and modified SVM (flat-top modulation): THDia = 19.5 %. (d) Improved control performance due to extended antiwindup (18), modified SVM (flat-top modulation) and d-current injection: THDia = 9.4 %. s s Fig. 10: Comparative control system performance under open-switch fault in S1 (phase a). A C B1 B2 E D1 D2 Fig. 11: Laboratory test bench with dSPACE real-time system (A), voltage-source inverters (B1) and (B2) connected back-to-back, Host-PC (C), reluctance synchronous machine (RSM; D1) and permanent-magnet synchronous machine (PMSM; D2), and torque sensor (E). 13 TABLE II: Simulation and measurement data. Description Symbol Value and unit h Runge-Kutta (ode4) 1 µs udc fsw 565 V 8 kHz Simulation parameters ODE-Solver (fixed-step) sampling time Converter DC-link voltage switching frequency Permanent-magnet synchronous machine (generator, isotropic) stator resistance Rs 0.11 Ω stator inductance Ls 3.35 mH PM-flux linkage ψ̂pm 0.377 V s number of pole pairs np 3 −4 2 machine inertia ΘPMSM 163 · 10 kg m Reluctance synchronous machine (anisotropic) stator resistance Rs 0.4 Ω d q stator inductances Ls 6= Ls nonlinear (see [32, Fig. 2]) number of pole pairs np 2 −4 2 machine inertia ΘRSM 189 · 10 kg m Current control system of PMSM PI controller gains d q 8.93 V A 293.3 AVs −1 A kp = kp d q ki = ki ı̂aw maximum anti-windup current Implementation of control system in Matlab/Simulink and dSpace real-time system current PI controllers with anti-windup (see Fig. 4 & Fig. 5) 0 ûmax (udc , θ ) − k is,ref k us,comp k us,ref s dq s us,ref us,ref,sat αβ αβ − k is abc dq abc us,ref,sat abc φk = np φm abc is PMSM (3) abc us converter (8) abc ss space-vector modulation udc mt System model in Matlab/Simulink or laboratory hardware Fig. 12: Block diagram of the implementation of SVM, converter with open-switch fault in S1 , PMSM and current control system in Matlab/Simulink and on the dSPACE real-time system. and measurement results of Experiment (E1 ) are shown in Fig. 13(a). The measured quantities are labeled with the additional subscript “meas”. Obviously, simulation and measurement results match very closely. Hence, the proposed mathematical model (8) is valid and allows to simulate the behavior of the real system precisely. Note that, due to the smaller power rating of the RSM, the speed controller for the RSM is not capable to compensate for the large torque/current ripples induced by the faulty PMSM-converter. 2) Experiment (E2 ): For this experiment, again an open-switch fault in S1 (phase a of the PMSM) is emulated; but this time, the fault-tolerant control system (extended field-oriented control, as proposed in Sect. III-B) with extended anti-windup, flat-top modulation and optimal ids -injection (with ϕ0 = 197◦ ) is implemented for simulation and measurement. Figure 13(b) shows the comparative simulation and measurement results. Again, simulation and measurement results match very closely. Moreover, also the THD-values THDias = 9.4 % and THDias ,meas = 10.6 % are almost identical. In conclusion, the proposed modifications are also effective in real world and the outcomes of the theoretical and simulative analysis in Sect. III-B are confirmed. 14 40 i ds i qs i ds , m e a s i qs , m e a s i ds , r e f 5 i qs , r e f 0 Cur r en t / A Cur r en t / A 25 10 0 −1 0 −2 5 i cs i bs i as , m e a s i bs , m e a s i as i bs i cs i qs , m e a s i ds , r e f i qs , r e f − 10 −1 5 . 6 − 20 i cs , m e a s 40 Cu r r en t / A Cu r r en t / A i ds , m e a s − 30 60 i as 20 0 −2 0 i as , m e a s i bs , m e a s i cs , m e a s 40 20 0 − 20 ωm − 40 50. 5 ωm , r e f A n g . vel o ci ty / 54 ωm , m e as ωm r ad s −4 0 56 r ad s i qs − 25 −4 0 60 A n g . vel o ci ty / i ds −5 52 50 48 46 ωm , m e as ωm , r e f 50. 25 50 49. 75 44 42 0 0. 025 0. 05 0. 075 0. 1 0. 125 Ti m e t / s 0. 15 0. 175 49. 5 0. 2 (a) Experiment (E1 ): Comparison of simulation and measurement results for standard control system: THDia = 41.8 % s (simulation) vs. THDia ,meas = 45.4 % (measurement). 0 0. 025 0. 05 0. 075 0. 1 0. 125 Ti m e t / s 0. 15 0. 175 0. 2 (b) Experiment (E2 ): Comparison of simulation and measurement results for fault-tolerant control system: THDia = 9.4 % s (simulation) vs. THDia ,meas = 10.6 % (measurement). s s Fig. 13: Comparison of simulation and measurement results for standard control system and fault-tolerant control system with extended anti-windup, modified SVM (flat-top modulation) and optimally injected d-current. 3) Experiment (E3 ): During the last experiment, the measurement scenario comprises a sequence of events (see Fig. 14) which are: • 1. time interval: Standard control system (without open-switch fault/fault-free case); • 2. time interval: Standard control system under open-switch fault in S1 ; • 3. time interval: Standard control system with extended anti-windup under open-switch fault in S1 ; • 4. time interval: Standard control system with extended anti-windup and modified SVM (flat-top modulation) under open-switch fault in S1 • 5. time interval: Fault-tolerant control system with extended anti-windup, modified SVM (flat-top modulation) and optimal d-current injection under open-switch fault in S1 . The measurement results are shown in Fig. 14. First and second subplots show the measured d-currents ids & iqs with their references ids,ref & iqs,ref , and the phase current ias with its reference ias,ref , respectively. The third subplot shows the rotational speed and its reference. As soon as the open-switch fault in S1 occurs, the currents ids and iqs start to oscillate within a band of 35 A. The phase current ias cannot track its reference, since positive half-waves cannot be reproduced. The resulting torque ripples in the PMSM deteriorate the speed control of the RSM and the rotational speed begins to oscillate with an amplitude of roughly 10 rad s . After the extended anti-windup strategy is enabled, the band of the current speed oscillations decreases slightly and the phase current ias can roughly track the negative reference half-waves again. The additional use of the modified SVM (flat-top modulation) reduces the oscillation band further and more significantly and improves the current tracking capability further. Note that iqs does not approach zero anymore. Finally, enabling the optimal ids -injection achieves that ids can again track the current reference iqs,ref with only very small ripples. Due to the optimal d-current injection, ids is still oscillating around its reference value within a band of 13 A and the resulting magnitude of the phase current ias is increased by approximately 17, 9% to 29.5 A. But the torque ripples are drastically reduced and the speed control performance is almost as good as it was in the fault-free case. V. C ONCLUSION In this paper, a generic mathematical model of a two-level converter with open-switch faults has been derived. The output voltages of the faulty converter can be computed based on switching vector, dc-link voltage and sign of the current in the phase with the open-switch fault. The model holds for faults in each of the six switches. In a next step, the impact of an open-switch fault on the current control system of isotropic permanent-magnet synchronous generators has been investigated. If the faulty switch is known and the corresponding diode is still working properly, three easy-to-implement extension to the control system have been proposed to improve fault-tolerance and control performance under faults. The three modifications reduce the THD 15 40 i ds , m e a s Cur r en t / A 30 i qs , m e a s i ds , r e f i qs , r e f 20 10 0 − 10 −1 5 . 6 − 25 − 40 40 i as , r e f Cu r r en t / A 30 i as , m e a s 20 10 0 − 10 − 20 − 30 A n g . vel o ci ty / r ad s − 40 60 ωm , m e as 57. 5 ωm , r e f 55 52. 5 50 47. 5 45 4 2 . 5 fault-free 40 case 0 2 open-switch + extended + flat-top fault in S1 anti-windup modulation 4 6 Ti m e t / s 8 + optimal d-current 10 12 Fig. 14: Experiment (E3 ): Measurement results for current control system during four different scenarios: (i) fault-free case, (ii) open-switch fault in S1 , (iii) with extended anti-windup, (iv) additionally with flat-top modulation and (v) additionally with optimal d-current injection. of the faulty phase current, the torque ripples and, therefore, the stress on the mechanical drive train. Moreover, a safe and uninterrupted operation of the generator can be guaranteed. The proposed modifications are (i) extension of the anti wind-up strategy in the current PI controllers, (ii) modification of the SVM (flat-top modulation) and (iii) injection of optimal d-currents. All modifications have been explicitly illustrated and implemented for an open-switch fault in phase a; however, the generic model and the provided descriptions allow to implement the modifications for any other open-switch fault in the converter. Finally, comparative simulation and measurement results illustrate and validate (i) the accuracy of the proposed model of the faulty converter and (ii) the effectiveness and functionality of the proposed modifications on a laboratory test bench. ACKNOWLEDGEMENT The authors are deeply indebted to Max Lindner for adapting the laboratory test bench to make measurements of a converter with open-switch faults possible. This project has received funding from the Bavarian Ministry for Education, Culture, Science, and Art. R EFERENCES [1] B. Lu and S. K. Sharma, “A literature review of IGBT fault diagnostic and protection methods for power inverters,” IEEE Transactions on Industry Applications, vol. 45, pp. 1770–1777, Sept 2009. [2] K. Rothenhagen and F. W. Fuchs, “Performance of diagnosis methods for IGBT open circuit faults in three phase voltage source inverters for AC variable speed drives,” in 2005 European Conference on Power Electronics and Applications, pp. 10 pp.–P.7, Sept 2005. [3] U. M. Choi, J. S. Lee, F. Blaabjerg, and K. B. Lee, “Open-circuit fault diagnosis and fault-tolerant control for a grid-connected NPC inverter,” IEEE Transactions on Power Electronics, vol. 31, pp. 7234–7247, Oct 2016. [4] J. S. Lee, K. B. Lee, and F. Blaabjerg, “Open-switch fault detection method of a back-to-back converter using NPC topology for wind turbine systems,” IEEE Transactions on Industry Applications, vol. 51, pp. 325–335, Jan 2015. [5] U. M. Choi, K. B. Lee, and F. Blaabjerg, “Diagnosis and tolerant strategy of an open-switch fault for T-type three-level inverter systems,” IEEE Transactions on Industry Applications, vol. 50, pp. 495–508, Jan 2014. [6] U. M. Choi, H. G. Jeong, K. B. Lee, and F. Blaabjerg, “Method for detecting an open-switch fault in a grid-connected NPC inverter system,” IEEE Transactions on Power Electronics, vol. 27, pp. 2726–2739, June 2012. [7] W.-S. Im, J.-S. Kim, J.-M. Kim, D.-C. Lee, and K.-B. Lee, “Diagnosis methods for IGBT open switch fault applied to 3-phase AC/DC PWM converter,” Journal of Power Electronics, vol. 12, no. 1, 2012. [8] N. M. A. Freire, J. O. Estima, and A. J. M. Cardoso, “Open-circuit fault diagnosis in PMSG drives for wind turbine applications,” IEEE Transactions on Industrial Electronics, vol. 60, pp. 3957–3967, Sept 2013. [9] H. T. Eickhoff, R. Seebacher, A. Muetze, and E. Strangas, “Enhanced and fast detection of open switch faults in inverters for electric drives,” IEEE Transactions on Industry Applications, vol. PP, no. 99, pp. 1–1, 2017. 16 [10] R. L. de Araujo Ribeiro, C. B. Jacobina, E. R. C. da Silva, and A. M. N. Lima, “Fault detection of open-switch damage in voltage-fed PWM motor drive systems,” IEEE Transactions on Power Electronics, vol. 18, pp. 587–593, Mar 2003. [11] K. H. Kim, D. U. Choi, B. G. Gu, and I. S. Jung, “Fault model and performance evaluation of an inverter-fed permanent magnet synchronous motor under winding shorted turn and inverter switch open,” IET Electric Power Applications, vol. 4, pp. 214–225, April 2010. [12] S. M. Jung, J. S. Park, H. W. Kim, K. Y. Cho, and M. J. Youn, “An MRAS-based diagnosis of open-circuit fault in PWM voltage-source inverters for PM synchronous motor drive systems,” IEEE Transactions on Power Electronics, vol. 28, pp. 2514–2526, May 2013. [13] W. S. Im, J. M. Kim, D. C. Lee, and K. B. Lee, “Diagnosis and fault-tolerant control of three-phase AC-DC PWM converter systems,” IEEE Transactions on Industry Applications, vol. 49, pp. 1539–1547, July 2013. [14] P. Sobanski and T. Orlowska-Kowalska, “Analysis of space vector modulation technique in inverter-fed fault-tolerant induction motor drive,” in 2014 16th International Power Electronics and Motion Control Conference and Exposition, pp. 1024–1029, Sept 2014. [15] W. S. Im, J. J. Moon, J. M. Kim, D. C. Lee, and K. B. Lee, “Fault tolerant control strategy of 3-phase AC-DC PWM converter under multiple open-switch faults conditions,” in 2012 Twenty-Seventh Annual IEEE Applied Power Electronics Conference and Exposition (APEC), pp. 789–795, Feb 2012. [16] S. M. Jung, K. Lee, and H. W. Kim, “Post-fault operation of open-circuit fault in three-phase PWM converter,” in 2014 16th International Power Electronics and Motion Control Conference and Exposition, pp. 311–316, Sept 2014. [17] J. S. Lee and K. B. Lee, “An open-switch fault detection method and tolerance controls based on SVM in a grid-connected T-type rectifier with unity power factor,” IEEE Transactions on Industrial Electronics, vol. 61, pp. 7092–7104, Dec 2014. [18] J. S. Lee and K. B. Lee, “Open-switch fault tolerance control for a three-level NPC/T-type rectifier in wind turbine systems,” IEEE Transactions on Industrial Electronics, vol. 62, pp. 1012–1021, Feb 2015. [19] N. M. A. Freire, Fault-tolerant permanent magnet synchronous generator drives for wind turbine applications. PhD thesis, University of Coimbra, 2013. [20] A. Gaeta, G. Scelba, and A. Consoli, “Modeling and control of three-phase PMSMs under open-phase fault,” IEEE Transactions on Industry Applications, vol. 49, pp. 74–83, Jan 2013. [21] O. Wallmark, L. Harnefors, and O. Carlson, “Post-fault operation of fault-tolerant inverters for PMSM drives,” in 2005 European Conference on Power Electronics and Applications, pp. 10 pp.–P.11, Sept 2005. [22] S. Bolognani, M. Zordan, and M. Zigliotto, “Experimental fault-tolerant control of a pmsm drive,” IEEE Transactions on Industrial Electronics, vol. 47, pp. 1134–1141, Oct 2000. [23] C. M. Hackl, Non-identifier based adaptive control in mechatronics: Theory and Application. No. 466 in Lecture Notes in Control and Information Sciences, Berlin: Springer International Publishing, 2017. [24] R. De Doncker, D. W. Pulle, and A. Veltman, Advanced Electrical Drives. Power Systems, Berlin: Springer-Verlag, 2011. [25] C. Dirscherl, C. Hackl, and K. Schechner, “Modellierung und Regelung von modernen Windkraftanlagen: Eine Einführung (see https://arxiv.org/abs/1703.08661 for the english translation),” in Elektrische Antriebe – Regelung von Antriebssystemen (D. Schröder, ed.), ch. 24, pp. 1540–1614, Springer-Verlag, 2015. [26] D. Schröder, Elektrische Antriebe - Regelung von Antriebssystemen. Berlin Heidelberg: Springer-Verlag, 4 ed., 2015. [27] D. Shmilovitz, “On the definition of total harmonic distortion and its effect on measurement interpretation,” IEEE Transactions on Power Delivery, vol. 20, pp. 526–528, Jan 2005. [28] R. Valentine, Motor Control Electronics Handbook. McGraw-Hill Handbooks, McGraw-Hill Companies, 1998. [29] C. Hackl and K. Schechner, “Non-ideal feedforward torque control of wind turbines: Impacts on annual energy production & gross earnings,” Journal of Physics: Conference Series, vol. 753, no. 11, p. 112010, 2016. [30] T. Burton, D. Sharpe, N. Jenkins, and E. Bossanyi, Wind energy handbook. John Wiley & Sons, 2 ed., 2011. [31] C. M. Hackl, M. J. Kamper, J. Kullick, and J. Mitchell, “Current control of reluctance synchronous machines with online adjustment of the controller parameters,” in Proceedings of the 2016 IEEE International Symposium on Industrial Electronics (ISIE 2016), (Santa Clara, CA, USA), pp. 153–160, Institute of Electrical and Electronics Engineers (IEEE), jun 2016. [32] H. Eldeeb, C. M. Hackl, L. Horlbeck, and J. Kullick, “Analytical solutions for the optimal reference currents for MTPC/MTPA, MTPV and MTPF control of anisotropic synchronous machines,” in Proceedings of the IEEE International Electric Machines & Drives Conference (IEMDC 2017), (Miami, FL, USA), 2017. 17
3cs.SY
UNIVERSALITY LAWS FOR RANDOMIZED DIMENSION REDUCTION, WITH APPLICATIONS arXiv:1511.09433v3 [math.PR] 17 Sep 2017 SAMET OYMAK AND JOEL A. TROPP A BSTRACT. Dimension reduction is the process of embedding high-dimensional data into a lower dimensional space to facilitate its analysis. In the Euclidean setting, one fundamental technique for dimension reduction is to apply a random linear map to the data. This dimension reduction procedure succeeds when it preserves certain geometric features of the set. The question is how large the embedding dimension must be to ensure that randomized dimension reduction succeeds with high probability. This paper studies a natural family of randomized dimension reduction maps and a large class of data sets. It proves that there is a phase transition in the success probability of the dimension reduction map as the embedding dimension increases. For a given data set, the location of the phase transition is the same for all maps in this family. Furthermore, each map has the same stability properties, as quantified through the restricted minimum singular value. These results can be viewed as new universality laws in high-dimensional stochastic geometry. Universality laws for randomized dimension reduction have many applications in applied mathematics, signal processing, and statistics. They yield design principles for numerical linear algebra algorithms, for compressed sensing measurement ensembles, and for random linear codes. Furthermore, these results have implications for the performance of statistical estimation methods under a large class of random experimental designs. Date: 30 November 2015. Revised 7 August 2017 and 5 September 2017 and 14 September 2017. 2010 Mathematics Subject Classification. Primary: 60D05, 60F17. Secondary: 60B20. Key words and phrases. Conic geometry, convex geometry, dimension reduction, invariance principle, limit theorem, random code, random matrix, randomized numerical linear algebra, signal reconstruction, statistical estimation, stochastic geometry, universality. ii S. OYMAK AND J. A. TROPP C ONTENTS 1. Overview of the Universality Phenomenon 1.1. Randomized Dimension Reduction 1.2. Technical Setting 1.3. A Phase Transition for Uniformly Random Partial Isometries 1.4. Other Types of Random Linear Maps? 1.5. A Universality Law for the Embedding Dimension 1.6. A Universality Law for the Restricted Minimum Singular Value 1.7. Applications of Universality 1.8. The Scope of the Universality Phenomenon 1.9. Reproducible Research 1.10. Roadmap 1.11. Notation 1 1 1 1 2 4 4 5 6 7 7 8 Part I. Main Results 2. Random Matrix Models 2.1. Bounded Random Matrix Model 2.2. Heavy-Tailed Random Matrix Model 3. A Universality Law for the Embedding Dimension 3.1. Embedding Dimension: Problem Formulation 3.2. Some Concepts from Spherical Geometry 3.3. The Statistical Dimension Functional 3.4. Theorem I: Universality of the Embedding Dimension 3.5. Theorem I: Proof Strategy 3.6. Theorem I: Extensions 4. A Universality Law for the Restricted Minimum Singular Value 4.1. Restricted Minimum Singular Value: Problem Formulation 4.2. The Excess Width Functional 4.3. Theorem II: Universality for the Restricted Minimum Singular Value 4.4. Theorem II: Proof Strategy 4.5. Theorem II: Extensions 9 9 9 9 10 11 11 11 13 14 15 15 15 15 16 17 18 Part II. Applications 5. Recovery of Structured Signals from Random Measurements 5.1. The Phase Transition for Sparse Signal Recovery 5.2. Other Signal Recovery Problems 5.3. Complements 6. Decoding with Structured Errors 6.1. Decoding with Sparse Errors 6.2. Other Demixing Problems 7. Randomized Numerical Linear Algebra 7.1. Subspace Embeddings 7.2. Sketching and Least Squares 8. The Prediction Error for LASSO 8.1. The Sparse Linear Model and the LASSO 8.2. Proof of Proposition 8.1 19 19 19 22 22 23 23 26 26 26 28 31 31 33 Part III. Universality of the Restricted Minimum Singular Value: Proofs of Theorem II and Theorem I(a) 36 UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 9. The Restricted Singular Values of a Bounded Random Matrix 9.1. Theorem 9.1: Main Result for the Bounded Random Matrix Model 9.2. Proof of Theorem 9.1(1): Concentration 9.3. Setup for Proof of Theorem 9.1(2) and (3): Dissection of the Index Set 9.4. Proof of Theorem 9.1(2): Lower Bound for the RSV 9.5. Proof of Theorem 9.1(3): Upper Bound for the RSV of a Convex Set 10. The Restricted Singular Values of a Heavy-Tailed Random Matrix 10.1. Corollary 10.1: Main Result for the p-Moment Random Matrix Model 10.2. Proof of Theorem II from Corollary 10.1 10.3. Proof of Theorem I(a) from Corollary 10.1 11. Theorem 9.1: Concentration for Restricted Singular Values 11.1. Proposition 11.1: The Lower Tail of the RSV 11.2. Proposition 11.1: The Upper Tail of the RSV 12. Theorem 9.1: Probability Bounds for Dissections 12.1. Dissection of the Excess Width 12.2. Dissection of the Restricted Singular Value 13. Theorem 9.1: Replacing Most Entries of the Random Matrix 13.1. Proof of Proposition 13.1 13.2. Proposition 13.1: Discretizing the Index Set 13.3. Proposition 13.1: Smoothing the Minimum 13.4. Proposition 13.1: Exchanging the Entries of the Random Matrix 14. Theorem 9.1: Bounding the Restricted Singular Value by the Excess Width 14.1. Proof of Proposition 14.1 14.2. Proposition 14.1: Moment Comparison Inequality for the Hybrid RSV 14.3. Proposition 14.1: The Role of the Gaussian Minimax Theorem 14.4. Proposition 14.1: Reducing the Gaussian Matrix to Some Gaussian Vectors 14.5. Proposition 14.1: Removing the Remaining Part of the Original Random Matrix 14.6. Proposition 14.1: Replacing the Coordinates Missing from the Excess Width 15. Proof of Corollary 10.1 from Theorem 9.1 by Truncation 15.1. Proof of Corollary 10.1 15.2. Corollary 10.1: Truncation of Individual Random Variables Part IV. Universality of the Embedding Dimension: Proof of Theorem I(b) 16. When Embedding Fails for a Bounded Random Matrix 16.1. The RAP Functional: Dual Condition for Failure 16.2. Theorem 16.2: Main Result for the Bounded Random Matrix Model 16.3. Proof of Theorem 16.2: Lower Tail Bound 16.4. Proof of Theorem 16.2: Truncation and Dissection 16.5. Proof of Theorem 16.2: Lower Bound for RAP Functional 17. When Embedding Fails for a Heavy-Tailed Random Matrix 17.1. Corollary 17.1: Main Result for the p-Moment Random Matrix Model 17.2. Proof of Theorem I(b) from Corollary 17.1 17.3. Proof of Proposition 6.1: Application of RAP functional to decoding with structured errors 18. Theorem 16.2: Truncation of the Cone 19. Theorem 16.2: Replacing Most Entries of the Random Matrix 19.1. Proof of Proposition 19.1 19.2. Proposition 19.1: Discretizing the Index Sets 19.3. Proposition 19.1: Smoothing the Minimum 19.4. Proposition 19.1: Exchanging the Entries of the Random Matrix 20. Theorem 16.2: Bounding the RAP Functional by the Excess Width iii 36 36 36 37 37 38 39 39 39 40 41 41 42 43 43 44 45 45 46 47 47 52 53 53 54 57 58 59 59 59 60 63 63 63 63 64 64 64 65 65 66 66 67 68 68 69 69 69 70 iv S. OYMAK AND J. A. TROPP 20.1. 20.2. 20.3. 20.4. Proof of Proposition 20.1 Proposition 20.1: Duality for the RAP Functional Proposition 20.1: Reducing the Gaussian Matrix to Some Gaussian Vectors Proposition 20.1: Finding the Gaussian Width Part V. Back Matter Appendix A. Tools from Gaussian Analysis A.1. Concentration for Gaussian Lipschitz Functions A.2. The Gaussian Minimax Theorem Appendix B. Spectral Bounds for Random Matrices Acknowledgments References 71 71 72 72 79 79 79 79 80 81 81 L IST OF F IGURES 1.1 Geometry of a Random Linear Map 2 1.2 Universality of the Embedding Dimension 3 1.3 Geometry of the Restricted Minimum Singular Value 4 1.4 Universality of the Restricted Minimum Singular Value 5 1.5 Non-Universality of the `1 Restricted Minimum Singular Value 7 1.6 Non-Universality of the Restricted Maximum Singular Value 8 5.1 Universality of the `1 Recovery Phase Transition 20 6.1 Universality of the `1 Decoding Phase Transition 24 8.1 Universality of the LASSO Prediction Error 32 UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 1 1. O VERVIEW OF THE U NIVERSALITY P HENOMENON This paper concerns a fundamental question in high-dimensional stochastic geometry: (Q1) Is it likely that a random subspace of fixed dimension does not intersect a given set? This problem has its roots in the earliest research on spherical integral geometry [San52, San76], and it also arises in asymptotic convex geometry [Gor88]. In recent years, this question has attracted fresh attention [Don06c, RV08, Sto09, DT09b, CRPW12, ALMT14, Sto13, MT13, OH13, OTH13, TOH15, TAH15] because it is central to the analysis of randomized dimension reduction. This paper establishes that a striking universality phenomenon takes place in the stochastic geometry problem (Q1). For a given set, the answer to this question is essentially the same for every distribution on random subspaces that is induced by a natural model for random linear maps. Universality also manifests itself in metric variants of (Q1), where we ask how far the random subspace lies from the set. We discuss the implications of these results in high-dimensional geometry, random matrix theory, numerical analysis, optimization, statistics, signal processing, and beyond. 1.1. Randomized Dimension Reduction. Dimension reduction is the operation of mapping a set from a large space into a smaller space. Ideally, this action distills the “information” in the set, and it allows us to develop more efficient algorithms for processing that information. In the setting of Euclidean spaces, a fundamental method for dimension reduction is to apply a random linear map to each point in the set. It is important that the random linear map preserve geometric features of the set. In particular, we do not want the linear map to map a point in the set to the origin. Equivalently, the null space of the random linear map should not intersect the set. We see that (Q1) emerges naturally in the context of randomized dimension reduction. 1.2. Technical Setting. Let us introduce a framework in which to study this problem. It is natural to treat (Q1) as a question in spherical geometry because it is scale invariant. Fix the ambient dimension D, and consider a closed subset Ω of the Euclidean unit sphere in RD . For the moment, we also assume that Ω is spherically convex; that is, Ω is the intersection of a convex cone1 with the unit sphere. Construct a random linear map Π : RD → Rd , where the embedding dimension d does not exceed the ambient dimension D. As we vary the distribution of the random linear map Π, the map Π 7→ null(Π) induces different distributions on the subspaces in RD with codimension at most d . We may now reformulate (Q1) in this language: (Q2) For a given embedding dimension d , what is the probability that Ω ∩ null(Π) = ;? Equivalently, what is the probability that 0 ∉ Π(Ω)? We say that the random projection succeeds when 0 ∉ Π(Ω). Conversely, when 0 ∈ Π(Ω), we say that the random projection fails. See Figure 1.1 for an illustration. We have the intuition that, for a fixed choice of Ω, the projection is more likely to succeed as the embedding dimension d increases. Furthermore, a random linear map Π with fixed embedding dimension d is less likely to succeed as the size of the set increases. We will justify these heuristics in complete detail. 1.3. A Phase Transition for Uniformly Random Partial Isometries. We begin with a case where the literature already contains a comprehensive answer to the question (Q2). The most natural type of random embedding is a uniformly random partial isometry. That is, Π : RD → Rd is a partial isometry2 whose null space, null(Π), is drawn uniformly at random from the Haar measure on the Grassmann manifold of subspaces in RD with codimension d . The invariance properties of the distribution of Π allow for a complete analysis of its action on Ω, the spherically convex set [SW08, Chap. 6.5]. Recent research [ALMT14, MT14a, GNP14] has shown how to convert the complicated exact formulas into interpretable results. 1A convex cone is a convex set K that satisfies αK = K for all α > 0. 2A partial isometry Π satisfies the condition ΠΠ∗ = I, where ∗ is the transpose operation and I is the identity map. 2 S. OYMAK AND J. A. TROPP range(P ) Ω Ω range(P ) P (Ω) P (Ω) null(P ) null(P ) F IGURE 1.1: Geometry of a Random Linear Map. We can identify a linear map Π : RD → Rd with an orthogonal projector P : RD → RD whose range is the orthogonal complement of null(Π). In this diagram, P : R2 → R2 is a random orthogonal projector applied to a closed, spherically convex set Ω. The likelihood of a given configuration depends on the statistical dimension δ(Ω) of the set. L EFT: Success Regime. The null space, null(P ), does not intersect Ω, and the image P (Ω) does not contain the origin. R IGHT: Failure Regime. The null space, null(P ), intersects the set Ω, and the image P (Ω) contains the origin. The modern theory is expressed in terms of a geometric functional δ(Ω), called the statistical dimension: ·µ ¶2 ¸ δ(Ω) := E max g · t , where g is NORMAL(0, I). t ∈Ω + The statistical dimension is increasing with respect to set inclusion, and its values range from zero (for the empty set) up to D (for the whole sphere). Furthermore, the functional can be computed accurately in many cases of interest. See Section 3.3 for more details. The statistical dimension demarcates a phase transition in the behavior of a uniformly random partial isometry Π as the embedding dimension d varies. For a closed, spherically convex set Ω, the results [ALMT14, Thm. I and Prop. 10.2] demonstrate that p d ≤ δ(Ω) − C δ(Ω) implies 0 ∈ Π(Ω) with high probability; (1.1) p d ≥ δ(Ω) + C δ(Ω) implies 0 ∉ Π(Ω) with high probability. The number C is a positive universal constant. In other terms, a uniformly random projection Π(Ω) of a spherically convex set Ω is likely to succeed precisely when the embedding dimension d is larger than the statistical dimension δ(Ω). See Figure 1.2 for a plot of the exact probability that a uniformly random partial isometry annihilates a point in a specific set Ω. Remark 1.1 (Related Work). The results [ALMT14, Thm. 7.1] and [MT13, Thm. A] contain good bounds for the probabilities in (1.1). The probabilities can be approximated more precisely by introducing a second geometric functional [GNP14]. These estimates depend on the spherical Crofton formula [SW08, Eqns. (6.62), (6.63)], which gives the exact probabilities in a less interpretable form. Related phase transition results can also be obtained via the Gaussian Minimax Theorem; see [Gor88, Cor. 3.4], [ALMT14, Rem. 2.9], [Sto13], or [TOH15, Thm. II.1]. See [TH15] for other results on uniformly random partial isometries. 1.4. Other Types of Random Linear Maps? The research outlined in Section 1.3 delivers a complete account of how a uniformly random partial isometry behaves in the presence of some convexity. In UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 3 Probability of Success, Random Embedding of Nonnegative Unit Vectors in R 64 1 0.9 Probability of Success 0.8 Uniformly Random (theory) Rademacher (empirical) 20% Nonzero Rademacher (empirical) Student t with 5 dof (empirical) 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 20 25 30 35 Embedding Dimension (d) 40 45 F IGURE 1.2: Universality of the Embedding Dimension. This plot describes the behavior of four types of random linear maps applied to the set Ω of unit vectors with nonnegative coordinates: Ω := {t ∈ R64 : kt k = 1, t i ≥ 0}. The dashed line marks the statistical dimension of the set: δ(Ω) = 32. The gray curve interpolates the exact probability that a uniformly random partial isometry Π : R64 → Rd succeeds (i.e., 0 ∉ Π(Ω)) as a function of the embedding dimension d . The markers indicate the empirical probability (over 100 trials) that dimension reduction succeeds for a random linear map with the specified distribution. See Sections 1.4 and 1.9 for further details. contrast, the literature contains almost no precise information about the behavior of other random linear maps. Nevertheless, in applications, we may prefer—or be forced—to work with other types of random linear maps. Here is a motivating example. Many algorithms for numerical linear algebra now depend on randomized dimension reduction. In this context, uniformly random partial isometries are expensive to construct, to store, and to perform arithmetic with. It is more appealing to implement a random linear map that is discrete, or sparse, or structured. The lack of detailed theoretical information about how these linear maps behave makes it difficult to design numerical methods with guaranteed performance. We can, however, use computation to investigate the behavior of other types of random linear maps. Figure 1.2 presents the results of the following experiment. Consider the set Ω of unit vectors in R64 with nonnegative coordinates: © ª Ω := t ∈ R64 : kt k = 1 and t i ≥ 0 for i = 1, . . . , 64 . According to (3.6), below, the statistical dimension δ(Ω) = 32, so the formula (1.1) tells us to expect a phase transition in the behavior of a uniformly random partial isometry when the embedding dimension d = 32. Using [ALMT14, Ex. 5.3 and Eqn. (5.10)], we can compute the exact probability that a uniformly random partial isometry Π : R64 → Rd succeeds as a function of d . Against this baseline, we compare the empirical probability (over 100 trials) that a random linear map with independent Rademacher3 entries succeeds. We also display experiments for a 20% nonzero Rademacher linear map and for a linear map with Student t 5 entries. See Section 1.9 for more details. From this experiment, we discover that all three linear maps act almost exactly the same way as a uniformly random partial isometry! This universality phenomenon is remarkable because the four 3A Rademacher random variable takes the two values ±1 with equal probability. 4 S. OYMAK AND J. A. TROPP null(P ) E range(P ) σmin (P ; E ) P (E ) F IGURE 1.3: Geometry of the Restricted Minimum Singular Value. We can identify a partial unitary linear map Π : RD → Rd with an orthogonal projector P : RD → RD whose range is the orthogonal complement of null(Π). In this diagram, P : R2 → R2 is an orthogonal projector applied to a compact convex set E . The restricted minimum singular value σmin (P ; E ) is the distance from the origin to the image P (E ). linear maps have rather different distributions. At present, the literature contains no information about when—or why—this phenomenon occurs. 1.5. A Universality Law for the Embedding Dimension. The central goal of this paper is to show that there is a substantial class of random linear maps for which the phase transition in the embedding dimension is universal. Here is a rough statement of the main result. Let Ω be a closed, spherically convex set in RD . Suppose that the entries of the matrix of the random linear map Π : RD → Rd are independent, standardized,4 and symmetric,5 with a modest amount of regularity.6 In particular, we may consider random linear maps that have an arbitrarily small, but constant, proportion of nonzero entries. For this class of random linear maps, we will demonstrate that d ≤ δ(Ω) − o(D) implies 0 ∈ Π(Ω) with high probability; d ≥ δ(Ω) + o(D) implies 0 ∉ Π(Ω) with high probability. (1.2) The little-o notation suppresses constants that depend only on the regularity of the random variables that populate Π. See Theorem I in Section 3.4 for a more complete statement. The result (1.2) states that a random linear map Π is likely to succeed for a spherically convex set Ω precisely when the embedding dimension d exceeds the statistical dimension δ(Ω) of the set. We learn that the phase transition in the embedding dimension is universal over our class of random linear maps, provided that Ω is not too small as compared with the ambient dimension D. Note that a random linear map Γ : RD → Rd with standard normal entries has the same behavior as a d × D uniformly random partial isometry because, almost surely, the null space of Γ is a uniformly random subspace of RD with codimension d . This analysis explains the dominant features of the experiment in Figure 1.2! 1.6. A Universality Law for the Restricted Minimum Singular Value. It is also a matter of significant interest to understand the stability of randomized dimension reduction. We quantify the stability of the random linear map Π : RD → Rd on a compact, convex set E in RD using the restricted minimum singular value: σmin (Π; E ) := min kΠt k . t ∈E 4A standardized random variable has mean zero and variance one. 5A symmetric random variable X has the same distribution as its negation −X . 6 For concreteness, we may assume that the entries of Π have five uniformly bounded moments. UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 5 Restricted Minimum Singular Value Restricted Minimum Singular Value, Random Embedding of Probability Simplex in R 0.5 64 d-Excess Width (asymptotic theory) Rademacher (empirical) 20% Nonzero Rademacher (empirical) Student t with 5 dof (empirical) 0.4 0.3 0.2 0.1 0 20 25 30 35 40 45 Embedding Dimension (d) 50 55 60 F IGURE 1.4: Universality of the Restricted Minimum Singular Value. This plot describes the behavior of P three types of random linear maps applied to the probability simplex ∆64 := {t ∈ R64 : i t i = 1, t i ≥ 0}. The dashed line marks the minimum dimension d = 32 where uniformly random¡embedding of the set ∆64 ¢ is likely to succeed. The gray curve interpolates the value of the positive part Ed (∆64 ) + of the d -excess width of ∆64 , obtained from the asymptotic calculation (4.4). The markers give an empirical estimate (over 100 trials) for the restricted minimum singular value σmin (Π; ∆64 ) of a random linear map Π : R64 → Rd drawn from the specified distribution. See Section 1.9 for more information. When the restricted minimum singular value σmin (Π; E ) is large, the random image Π(E ) is far from the origin, so the embedding is very stable. That is, we can deform either the linear map Π or the set E and still be sure that the embedding succeeds. When the restricted minimum singular value is small, the random dimension reduction map is unstable. When it is zero, the random dimension reduction map fails. See Figure 1.3 for a diagram. Our second major theorem is a universality law for the restricted minimum singular values of a random linear map. This result is expressed using a geometric functional Ed (E ), called the d -excess width of E : ¢ ¡p Ed (E ) := E min d kt k + g · t , where g is NORMAL(0, I). t ∈E The d -excess width increases p with the parameter d , and it decreases with respect to set inclusion. The typical scale of Ed (E ) is O( d ). In addition, the excess width can be evaluated precisely in many situations of interest. See Section 4.2 for more details. Now, suppose that the entries of the matrix of Π : RD → Rd are independent, standardized, and symmetric, with a modest amount of regularity. For a compact, convex subset E of the unit ball in RD , we will establish that p ¡ ¢ σmin (Π; E ) = Ed (E ) + + o( d ) with high probability. (1.3) The little-o notation suppresses constants that depend only on the regularity of the random variables. Theorem II in Section 4.3 contains a more detailed statement of (1.3). In summary, provided that the set E is not too small, the restricted minimum singular value σmin (Π; E ) depends primarily on the geometry of the set E and the embedding dimension d , rather than on the distribution of the random linear map Π. See Figure 1.4 for a numerical illustration of this fact. 1.7. Applications of Universality. Randomized dimension reduction and, more generally, random matrices have become ubiquitous in the information sciences. As a consequence, the universality laws that we outlined in Section 1.5 and 1.6 have a wide range of implications. 6 S. OYMAK AND J. A. TROPP Signal Processing: The main idea in the field of compressed sensing is that we can acquire information about a structured signal by taking random linear measurements. The literature contains extensive empirical evidence that many types of random measurements behave in an indistinguishable fashion. Our work gives the first explanation of this phenomenon. (Section 5) Stochastic Geometry: Our results also indicate that the facial structure of the convex hull of independent random vectors, drawn from an appropriate class, does not depend heavily on the distribution. (Section 5.3.1) Coding Theory: Random linear codes provide an efficient way to protect transmissions against error. We demonstrate that a class of random codes is resilient against sparse corruptions. The number of errors that can be corrected does not depend on the specific choice of codebook. (Section 6) Numerical Analysis: Our research provides an engineering design principle for numerical algorithms based on randomized dimension reduction. We can select the random linear map that is most favorable for implementation and still be confident about the detailed behavior of the algorithm. This approach allows us to develop efficient numerical methods that also have rigorous performance guarantees. (Section 7) Random Matrix Theory: Our work leads to a new proof of the Bai–Yin law for the minimum singular value of a random matrix with independent entries. (Section 7.1) High-Dimensional Statistics: The LASSO is a widely used method for performing regression and variable selection. We demonstrate that the prediction error associated with a LASSO estimator is universal across a large class of random designs and statistical error models. We also show that leastabsolute-deviation (LAD) regression can correct a small number of arbitrary statistical errors for a wide class of random designs. (Section 8 and Remark 6.2) Neuroscience: Our universality laws may even have broader scientific significance. It has been conjectured, with some experimental evidence, that the brain may use dimension reduction to compress information [GG15]. Our universality laws suggest that many types of uncoordinated (i.e., random) activity lead to dimension reduction methods with the same behavior. This result indicates that the hypothesis of neural dimensionality reduction may be biologically plausible. 1.8. The Scope of the Universality Phenomenon. The universality phenomenon developed in this paper extends beyond the results that we establish, but there are some (apparently) related problems where universality does not hold. Let us say a few words about these examples and non-examples. First, it does not appear important that the random linear map Π has independent entries. There is extensive evidence that structured random linear maps also have some universality properties; for example, see [DT09a]. Second, the restricted minimum singular value is not the only type of functional where universality is visible. For instance, suppose that f is a convex, Lipschitz function. Consider the quantity ¡ ¢ min kΠt k2 + f (t ) . t ∈E Optimization problems of this form play a central role in contemporary statistics and machine learning. It is likely that the value of this optimization problem is universal over a wide class of random linear maps. Furthermore, we believe that our techniques can be adapted to address this question. On the other hand, geometric functionals involving non-Euclidean norms need not exhibit universality. Consider the `1 restricted minimum singular value (1.4) min kΠt k`1 . t ∈E There are nontrivial sets E where the value of the optimization problem (1.4) varies a lot with the choice of the random linear map Π. For instance, let e1 ∈ RD be the first standard basis vector, and define the shifted Euclidean ball © ª E α := t ∈ RD : kt − e1 k ≤ α for 0 ≤ α ≤ 1. UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 7 l1 Restricted Minimum Singular Value, Random Embedding of Shifted Euclidean Ball in R Rademacher (empirical) Gaussian (empirical) Student t with 5 dof (empirical) 20% Nonzero Rademacher (empirical) 20 l1 Restricted Minimum Singular Value 64 15 10 5 0 0 10 20 30 40 Embedding Dimension (d) 50 60 F IGURE 1.5: Non-Universality of the `1 Restricted Minimum Singular Value. This plot describes the behavior of four types of random linear maps applied to the set E 1/2 := {t ∈ R64 : kt − e1 k ≤ 1/2}, where e1 is the first standard basis vector. The dashed line stands at the phase transition d ≈ 16 for the embedding dimension of the set E 1/2 . The markers give an empirical estimate (over 100 trials) for the `1 restricted minimum singular value mint ∈E 1/2 kΠt k`1 of a random linear map Π : R64 → Rd with the specified distribution as a function of the embedding dimension d . See Section 1.9 for more details. Using Theorem I and the calculation [ALMT14, Sec. 3.4] of the statistical dimension of a circular cone, we can verify that there is a universal phase transition for successful embedding of the set E α when the embedding dimension d = α2 D + O(1). The result (1.3) implies that the minimum restricted singular value of E α also takes a universal value. At the same time, Figure 1.5 illustrates that the functional (1.4) is not universal for the set E α . Finally, functionals involving maximization do not necessarily exhibit universality. The restricted maximum singular value is defined as σmax (Π; E ) := max kΠt k . t ∈E It is not hard to produce examples where the restricted maximum singular value depends on the choice of the random matrix Π. For instance, Figure 1.6 demonstrates that the random linear map Π has a substantial impact on the maximum singular value σmax (Π; ∆D ) restricted to the probability simplex ∆D in RD . This observation may surprise researchers in random matrix theory because the ordinary maximum singular value is universal over the class of random matrices with independent entries [BS10, Thm. 3.10]. 1.9. Reproducible Research. This paper is accompanied by MATLAB code [Tro15a] that reproduces each figure from stored data. This software can also repeat the numerical experiments to obtain new instances of each figure. By modifying the parameters in the code, the reader may explore how changes affect the universality phenomenon. We omit meticulous descriptions of the numerical experiments from the text because these recitations are tiresome for the reader and the code offers superior documentation. 1.10. Roadmap. This paper is divided into five parts. Part I offers a complete presentation of our universality laws, some comments about the proofs, and some prospects for further research. Part II outlines the applications of universality in several disciplines, and it contains more empirical confirmation of our analysis. Part III presents the proof that the restricted minimum singular value exhibits universal 8 S. OYMAK AND J. A. TROPP Restricted Maximum Singular Value Restricted Maximum Singular Value, Random Embedding of Probability Simplex in R64 10 8 6 4 Student t with 5 dof (empirical) 20% Nonzero Rademacher (empirical) Gaussian (empirical) Rademacher (empirical) 2 0 0 10 20 30 40 Embedding Dimension (d) 50 60 F IGURE 1.6: Non-Universality of the Restricted Maximum Singular Value. This plot describes the behavior P of four types of random linear maps applied to the probability simplex ∆64 := {t ∈ R64 : i t i = 1, t i ≥ 0}. The markers give an empirical estimate (over 100 trials) for the restricted maximum singular value σmax (Π; ∆64 ) of a random linear map Π : R64 → Rd with the specified distribution. See Section 1.9 for more details. behavior; this argument also yields the condition in which randomized embedding is likely to succeed. Part IV contains the proof of the condition in which randomized embedding is likely to fail. Finally, Part V includes background results, the acknowledgments, and the list of works cited. 1.11. Notation. Let us summarize our notation. We use italic lowercase letters (for example, a) for scalars, boldface lowercase letters (a) for vectors, and boldface uppercase letters (A) for matrices. Uppercase italic letters (A) may denote scalars, sets, or random variables, depending on the context. Roman letters (c, C) denote universal constants that may change from appearance to appearance. We sometimes delineate specific constant values with subscripts (Crad ). Given a vector a and a set J of indices, we write a J for the vector restricted to those indices. In particular, a j is the j th coordinate of the vector. Given a matrix A and sets I and J of row and column indices, we write A I J for the submatrix indexed by I and J . In particular, a i j is the component in the (i , j ) position of A. If there is a single index A J , it always refers to the column submatrix indexed by J . We always work in a real Euclidean space. The symbol Bn is the unit ball in Rn , and Sn−1 is the unit sphere in Rn . The unadorned norm k·k refers to the `2 norm of a vector or the `2 operator norm of a matrix. We use the notation s · t for the standard inner product of vectors s and t with the same length. We write ∗ for the transpose of a vector or a matrix. For a real number a, we define the positive-part and negative-part functions: (a)+ := max{a, 0} and (a)− := max{−a, 0}. These functions bind before powers, so (a)2+ is the square of the positive part of a. The symbols E and Var refer to the expectation and variance of a random variable, and P {·} returns the probability of an event. We use the convention that powers bind before the expectation, so E X 2 returns the expectation of the square. We write 1 A for the 0–1 indicator random variable of the event A. A standardized random variable has mean zero and variance one. A symmetric random variable X has the same distribution as its negation −X . We reserve the letter γ for a standard normal random variable; the boldface letters γ, g , h are always standard normal vectors; and Γ is a standard normal matrix. The dimensions are determined by context. UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 9 Part I. Main Results This part of the paper introduces two new universality laws, one for the phase transition in the embedding dimension and a second one for the restricted minimum singular values of a random linear map. We also include some high-level remarks about the proofs, but we postpone the details to Parts III and IV. In Section 2, we introduce two models for random linear maps that we use throughout the paper. Section 3 presents the universality result for the embedding dimension, and Section 4 presents the result for restricted singular values. 2. R ANDOM M ATRIX M ODELS To begin, we present two models for random linear maps that arise in our study of universality. One model includes bounded random matrices with independent entries, while the second allows random matrices with heavy-tailed entries. 2.1. Bounded Random Matrix Model. Our first model contains matrices whose entries are uniformly bounded. This model is useful for some applications, and it plays a central role in the proofs of our universality results. Model 2.1 (Bounded Matrix Model). Fix a parameter B ≥ 1. A random matrix in this model has the following properties: • • • • Independence. The entries are stochastically independent random variables. Standardization. Each entry has mean zero and variance one. Symmetry. Each entry has a symmetric distribution. Boundedness. Each entry X of the matrix is uniformly bounded: |X | ≤ B . Identical distribution of entries is not required. In some cases, which we will note, the symmetry requirement can be dropped. This model includes several types of random matrices that appear frequently in practice. Example 2.2 (Rademacher Matrices). Consider a random matrix whose entries are independent, Rademacher random variables. This type of random matrix meets the requirements of Model 2.1 with B = 1. Rademacher matrices provide the simplest example of a random linear map. They are appealing for many applications because they are discrete. Example 2.3 (Sparse Rademacher Matrices). Let α ∈ (0, 1] be a thinning parameter. Consider a random variable X with distribution  −1/2 , with probability α/2;  +α X= −α−1/2 , with probability α/2;   0, otherwise. A random matrix whose entries are independent copies of X satisfies Model 2.1 with B = α−1/2 . These random matrices are useful because we can control the sparsity. 2.2. Heavy-Tailed Random Matrix Model. Next, we introduce a more general class of random matrices that includes heavy-tailed examples. Our main results concern random linear maps from this model. Model 2.4 (p-Moment Model). Fix parameters p > 4 and ν ≥ 1. A random matrix in this model has the following properties: • • • • Independence. The entries are stochastically independent random variables. Standardization. Each entry has mean zero and variance one. Symmetry. Each entry has a symmetric distribution. Bounded Moments. Each entry X has a uniformly bounded pth moment: E |X |p ≤ νp . Identical distribution of entries is not required. 10 S. OYMAK AND J. A. TROPP Model 2.4 subsumes Model 2.1, but it also encompasses many other types of random matrices. Example 2.5 (Gaussian Matrices). Consider an m × n random matrix Γ whose entries are independent, standard normal random variables. The matrix Γ satisfies the requirements of Model 2.4 for each p > 4 p with ν ≤ p. In some contexts, we can use a Gaussian random matrix to study the behavior of a uniformly random partial isometry. Indeed, the null space, null(Γ), of the standard normal matrix is a uniformly random subspace of Rn with codimension min{m, n}, almost surely. Model 2.4 contains several well-studied classes of random matrices. Example 2.6 (Subgaussian Matrices). Suppose that the entries of the random matrix are independent, and each entry X is symmetric, standardized, and uniformly subgaussian. That is, there is a parameter α > 0 where ¡ ¢1/p p E |X |p ≤ α p for all p ≥ 1. p These matrices are included in Model 2.4 for each p > 4 with ν ≤ α p. Rademacher, sparse Rademacher, and Gaussian matrices fall in this category. Example 2.7 (Log-Concave Entries). Suppose that the entries of the random matrix are independent, and each entry X is a symmetric, standardized, log-concave random variable. Recall that a real log-concave random variable X has a density f of the form f (x) := 1 −h(x) e Z where h : R → R is convex and Z is a normalizing constant. It can be shown [BGVV14, Thm. 2.4.6] that these matrices are included in Model 2.4 for any p > 4. In contrast with most research on randomized dimension reduction, we allow the random linear map to have entries with heavy tails. Here is one such example. Example 2.8 (Student t Matrices). Suppose that each entry of the random matrix is an independent Student t random variable with α degrees of freedom, for α > 4. This matrix also follows Model 2.4 for each p < α. Finally, we present a general construction that takes a matrix from Model 2.4 and produces a sparse matrix that also satisfies the model, albeit with a larger value of the parameter ν. Example 2.9 (Sparsified Random Matrix). Let Φ be a random matrix that satisfies Model 2.4 for some value p > 4 and ν ≥ 1. Let α ∈ (0, 1] be a thinning parameter, and construct a new random matrix Φ(α) whose entries ϕ(α) are independent random variables with the distribution ij ϕ(α) ij = ( α−1/2 ϕi j , with probability α 0, with probability 1 − α. Then the sparsified random matrix Φ(α) still follows Model 2.4 with the same value of p and with a modified value ν0 of the other parameter: ν0 = α−1/p ν. 3. A U NIVERSALITY L AW FOR THE E MBEDDING D IMENSION In this section, we present detailed results which show that, for a large class of sets, the embedding dimension is universal over a large class of linear maps. UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 11 3.1. Embedding Dimension: Problem Formulation. Let us begin with a more rigorous statement of the problem. • Fix the ambient dimension D. • Let E be a nonempty, compact subset of RD that does not contain the origin. • Let Π : RD → Rd be a random linear map with embedding dimension d . We are interested in understanding the probability that the random projection Π(E ) does not contain the origin. That is, we want to study the following predicate: 0 ∉ Π(E ) or, equivalently, E ∩ null(Π) = ;. (3.1) We say that the random projection succeeds when the property (3.1) holds; otherwise, the random projection fails. Our goal is to argue that there is a large class of sets and a large class of random linear maps where the probability that (3.1) holds depends primarily on the choice of the embedding dimension d and an appropriate measure of the size of the set E . In particular, the probability does not depend significantly on the distribution of the random linear map Π. 3.2. Some Concepts from Spherical Geometry. The property (3.1) does not reflect the scale of the points in the set E . As a consequence, it is appropriate to translate the problem into a question about spherical geometry. We begin with a definition. Definition 3.1 (Spherical Retraction). The spherical retraction map θ : RD → RD is defined as ( t / kt k , t 6= 0 θ(t ) := 0, t = 0. For every set E in RD , we have the equivalence 0 ∉ Π(E ) if and only if 0 ∉ Π(θ(E )). (3.2) Therefore, we may pass to the spherical retraction θ(E ) of the set E without loss of generality. To obtain a complete analysis of when random projection succeeds or fails, we must restrict our attention to sets that have a convexity property. Definition 3.2 (Spherical Convexity). A nonempty subset Ω of the unit sphere in RD is spherically convex when the pre-image θ −1 (Ω) ∪ {0} is a convex cone. By convention, the empty set is also spherically convex. In particular, suppose that T is a compact, convex set that does not contain the origin. Then the retraction θ(T ) is compact and spherically convex. Next, we introduce a polarity operation for spherical sets that supports some crucial duality arguments. Definition 3.3 (Spherical Polarity). Let Ω be a subset of the unit sphere SD−1 in RD . The polar of Ω is the set © ª Ω◦ := x ∈ SD−1 : x · t ≤ 0 for all t ∈ Ω . By convention, the polar of the empty set is the whole sphere: ;◦ := SD−1 . This definition is simply the spherical analog of polarity for cones. It can be verified that Ω◦ is always closed and spherically convex. Furthermore, the polarity operation is an involution on the class of closed, spherically convex sets in SD−1 . 3.3. The Statistical Dimension Functional. We have the intuition that, for a given compact subset E of RD , the probability that a random linear map Π : RD → Rd succeeds decreases with the “content” of the set E . In the present context, the correct notion of content involves a geometric functional called the statistical dimension. 12 S. OYMAK AND J. A. TROPP Definition 3.4 (Statistical Dimension). Let Ω be a nonempty subset of the unit sphere in RD . The statistical dimension δ(Ω) is defined as h³ ´2 i δ(Ω) := E sup g · t (3.3) t ∈Ω + In addition, define δ(;) := 0. We extend the statistical dimension to a general subset T in RD using the spherical retraction: δ(T ) := δ(θ(T )). (3.4) D Recall that the random vector g ∈ R has the standard normal distribution. The statistical dimension has a number of striking properties. We include a short summary; see [ALMT14, Prop. 3.1] and the citations there for further information. • For a set T in RD , the statistical dimension δ(T ) takes values in the range [0, D]. • The statistical dimension is increasing with respect to set inclusion: S ⊂ T implies that δ(S) ≤ δ(T ). • The statistical dimension agrees with the linear dimension on subspaces: δ(L) = dim(L) for each subspace L in RD . • The statistical dimension interacts nicely with polarity: δ(Ω◦ ) = D − δ(Ω) for each spherically convex set Ω ∈ RD . (3.5) The same relation holds if we replace Ω by a convex cone K in RD and use conic polarity. As a specific example of (3.5), we can evaluate the statistical dimension of the nonnegative orthant RD +. Indeed, the orthant is a self-dual cone, so δ(RD + ) = D/2. (3.6) There is also powerful machinery, developed in [Sto09, OH10, CRPW12, ALMT14, FM14], for computing the statistical dimension of a descent cone of a convex function. Finally, we mention that the statistical dimension can often be evaluated by sampling Gaussian vectors and approximating the expectation in (3.3) with an empirical average. Remark 3.5 (Gaussian Width). The statistical dimension is related to the Gaussian width functional. For a bounded set T in RD , the Gaussian width W (T ) is defined as W (T ) := E sup g · t . (3.7) t ∈T For a subset Ω of the unit sphere in RD , we have the inequalities W 2 (Ω) ≤ δ(Ω) ≤ W 2 (Ω) + 1. (3.8) See [ALMT14, Prop. 10.3] for a proof. The relation (3.8) allows us to pass between the squared width and the statistical dimension. The Gaussian width of a set is closely related to its mean width [Ver15, Sec. 1.3.5]. The mean width is a canonical functional in the Euclidean setting [Gru07, Sec. 7.3], but it is not quite the right choice for spherical geometry. We have chosen to work with the statistical dimension because it has many geometric properties that the width lacks in the spherical setting. Remark 3.6 (Convex Cones). The papers [ALMT14, MT14a] define the statistical dimension of a convex cone using intrinsic volumes. It can be shown that the statistical dimension is the canonical (additive, continuous) extension of the linear dimension to the class of closed convex cones [ALMT14, Sec. 5.6]. Our general definition (3.4) agrees with the original definition on this class. UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 13 3.4. Theorem I: Universality of the Embedding Dimension. We are now prepared to state our main result on the probability that a random linear map succeeds or fails for a given set. Theorem I (Universality of the Embedding Dimension). Fix the parameters p > 4 and ν ≥ 1 for Model 2.4. Choose parameters % ∈ (0, 1) and ε ∈ (0, 1). There is a number N := N (p, ν, %, ε) for which the following statement holds. Suppose that • • • • The ambient dimension D ≥ N . E is a nonempty, compact subset of RD that does not contain the origin. The statistical dimension of E is proportional to the ambient dimension: δ(E ) ≥ %D. The d × D random linear map Π obeys Model 2.4 with parameters p and ν. Then d ≥ (1 + ε) δ(E ) implies P {0 ∉ Π(E )} ≥ 1 − Cp D 1−p/4 . (a) Furthermore, if θ(E ) is spherically convex, then d ≤ (1 − ε) δ(E ) implies P {0 ∈ Π(E )} ≥ 1 − Cp D 1−p/4 . (b) The constant Cp depends only on the parameter p in the random matrix model. Section 3.5 summarizes our strategy for establishing Theorem I. The detailed proof of Theorem I(a) appears in Section 10.3; the detailed proof of Theorem I(b) appears in Section 17.2. Let us mention that stronger probability bounds hold when the random linear map is drawn from Model 2.1. For any random linear map Π drawn from Model 2.4, Theorem I(a) ensures that the random dimension reduction Π(E ) is likely to succeed when the embedding dimension d exceeds the statistical dimension δ(E ). Similarly, Theorem I(b) shows that Π(E ) is likely to fail when the embedding dimension d is smaller than the statistical dimension δ(E ), provided that θ(E ) is spherically convex. Note that both of these interpretations require that the statistical dimension δ(E ) is not too small as compared with the ambient dimension D. We have already seen a concrete example of Theorem I at work. In view of the calculation (3.6) of the statistical dimension of the orthant, the theorem provides a satisfying explanation of Figure 1.2! Remark 3.7 (Prior Work). When the random linear map Π is Gaussian, the result Theorem I(a) follows from Gordon [Gor88, Cor. 3.4], while the conclusion (b) seems to be more recent [ALMT14, Thm. I]. To our knowledge, the literature contains no precedent for Theorem I for general sets and for non-Gaussian linear maps. We can identify only a few sporadic special cases. Donoho & Tanner [DT10] studied the problem of recovering a “saturated vector” from random measurements via `∞ minimization. Their work can be interpreted as a statement about random embeddings of the set of unit vectors with nonnegative coordinates. They demonstrate that the phase transition in the embedding dimension is universal when the rows of the linear map matrix are independent, symmetric random vectors with a density; this result actually follows from classical work of Schäfli [Sch50] and Wendel [Wen62]. Let us emphasize that this result does not apply to discrete random linear maps. Bayati et al. [BLM15] have studied the problem of recovering a sparse vector from random measurements via `1 minimization. Their work can be interpreted as a result on the embedding dimension of the set of descent directions of the `1 norm at a sparse vector. They showed that, asymptotically, the phase transition in the embedding dimension is universal. Their result requires the linear map matrix to contain independent, subgaussian entries that are absolutely continuous with respect to the Gaussian density. See Section 5.1 for more discussion of this result. There are also many papers in asymptotic convex geometry and mathematical signal processing that contain theory about the order of the embedding dimension for linear maps from Model 2.4; see [MPTJ07, Men10, Men14, Tro15b, Ver15]. These results do not allow us to reach any conclusions about the existence of a phase transition or its location. There is also an extensive amount of empirical work, such as [DT09a, 14 S. OYMAK AND J. A. TROPP Sto09, OH10, CSPW11, DGM13, MT14b], that suggests that phase transitions are ubiquitous in highdimensional signal processing problems, but there has been no theoretical explanation of the universality phenomenon until now. 3.5. Theorem I: Proof Strategy. The proof of Theorem I depends on converting the geometric question to an analytic problem. First, recall the equivalence (3.2), which allows us to pass from the compact set E to its spherical retraction Ω := θ(E ). Next, we identify two analytic quantities that determine whether a linear map annihilates a point in the set Ω. Proposition 3.8 (Analytic Conditions for Embedding). Let Ω be a nonempty, closed subset of the unit sphere SD−1 in RD , and let A : RD → Rd be a linear map. Then min kAt k > 0 implies 0 ∉ A(Ω). t ∈Ω (3.9) Furthermore, if Ω is spherically convex and cone(Ω) is not a subspace, min min kt k=1 s∈cone(Ω◦ ) ks − A ∗ t k > 0 implies 0 ∈ A(Ω). (3.10) Finally, if cone(Ω) is a subspace, select an arbitrary subset Ω0 ⊂ Ω with the property that cone(Ω0 ) is a (dim(Ω) − 1)-dimensional subspace. Then min min kt k=1 s∈cone(Ω◦0 ) ks − A ∗ t k > 0 implies 0 ∈ A(Ω). (3.11) Recall that cone(S) is the smallest convex cone containing the set S. Proof. The implication (3.9) is quite easy to check. At each point t ∈ Ω, we have kAt k > 0, which implies that At 6= 0. In other words, 0 ∉ A(Ω). The second implication (3.10) follows from a spherical duality principle. Suppose that Ω and Υ are closed and spherically convex, and assume cone(Ω) is not a subspace. If Ω◦ and −Υ◦ do not intersect, then Ω and Υ must intersect; see [Kle55, Thm (2.7)]. The analytic condition min min kt k=1 s∈cone(Ω◦ ) ks − A ∗ t k > 0 ensures that cone(Ω◦ ) lies at a positive distance from θ(range(A ∗ )). It follows that Ω◦ does not intersect θ(range(A ∗ )). By duality, we conclude that Ω ∩ θ(null(A)) 6= ;, which yields (3.10). Finally, if cone(Ω) is a subspace, we use a dimension counting argument. As before, the analytic condition (3.11) implies that Ω◦0 ∩ θ(range(A ∗ )) = ;. Since these sets do not intersect, the sum of their dimensions cannot exceed the ambient dimension: D ≥ dim(Ω◦0 ) + dim(range(A ∗ )) = (D − dim(Ω0 )) + (D − dim(null(A))) = 2D + 1 − dim(Ω) − dim(null(A)). We see that dim(Ω) + dim(null(A)) ≥ D + 1. As a consequence, the subspace cone(Ω) and (A) must have a nontrivial intersection.  In view of Proposition 3.8, we can establish Theorem I(a) by showing that d ≥ (1 − ε) δ(Ω) implies min kΠt k > 0 with high probability. t ∈Ω This condition follows from a universality result, Corollary 10.1, for the restricted minimum singular value. The proof appears in Section 10.3. Similarly, we can establish Theorem I(b) by showing that d ≤ (1 + ε) δ(Ω) implies min min kt k=1 s∈cone(Ω◦ ) ks − Π∗ t k > 0 with high probability. This condition follows from a specialized argument that culminates in Corollary 17.1. The proof appears in Section 17.2. We need not lavish extra attention on the case where cone(Ω) is a subspace. Indeed, the dimension of Ω and Ω0 only differ by one, which is invisible in the final results. UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 15 3.6. Theorem I: Extensions. It is an interesting challenge to delineate the scope of the universality phenomenon described in Theorem I. We believe that there remain many opportunities for improving on this result. • Theorem I only shows that the width of the phase transition ©p is o(D). ª [ALMT14, Thm. 7.1] p It is known that the width of the phase transition has order min δ(E ), D − δ(E ) for a linear map with standard normal entries. How wide is the phase transition for more general random linear maps? • A related question is whether Theorem I holds for those sets E whose statistical dimension δ(E ) is much smaller than the ambient dimension. • There is empirical evidence that the location of the phase transition is universal over a class wider than Model 2.4. In particular, results like Theorem I may be valid for structured random linear maps. • Figure 1.2 suggests that the probability of successful embedding is universal. Under what conditions can this observation be formalized? In summary, Theorem I is just the first step toward a broader theory of universality in high-dimensional stochastic geometry. 4. A U NIVERSALITY L AW FOR THE R ESTRICTED M INIMUM S INGULAR VALUE This section describes a quantitative universality law for random linear maps. We show that the restricted minimum singular value of a random linear map takes the same value for every linear map in a substantial class. This type of result provides information about the stability of randomized dimension reduction. 4.1. Restricted Minimum Singular Value: Problem Formulation. Let us frame our assumptions: • Fix the ambient dimension D. • Let E be a nonempty, compact subset of the unit ball BD . • Let Π : RD → Rd be a random linear map with embedding dimension d . In this section, our goal is to understand the distance from the random projection Π(E ) to the origin. The following definition captures this property. Definition 4.1 (Restricted Minimum Singular Value). Let A : RD → Rd be a linear map, and let T be a nonempty subset of RD . The restricted minimum singular value of A with respect to the set T is the quantity σmin (A; T ) := inf kAt k . t ∈T More briefly, we write restricted singular value or RSV. Proposition 3.8 shows that the restricted minimum singular value is a quantity of interest when studying the embedding dimension of a linear map. It is also productive to think about σmin (A; T ) as a measure of the stability of inverting the map A on the image A(T ). In particular, note that the restricted singular value σmin (A; T ) is a generalization of the ordinary minimum singular value σmin (A), which we obtain from the selection T = SD−1 . 4.2. The Excess Width Functional. It is clear that the restricted singular value σmin (A; ·) decreases with respect to set inclusion. In other words, the restricted singular value depends on the “content” of the set T . In the case of a random linear map, the following geometric functional provides the correct notion of content. Definition 4.2 (Excess Width). Let m be a positive number, and let T be a nonempty, bounded subset of RD . The m-excess width of T is the quantity ¡p ¢ Em (T ) := E inf m kt k + g · t . (4.1) t ∈T 16 S. OYMAK AND J. A. TROPP Versions of the excess width appear as early as the work of Gordon [Gor88, Cor. 1.1]. It has also come up in recent papers [Sto13, OTH13, TOH15, TAH15] on the analysis of Gaussian random linear maps. The excess width has a number of useful properties. These results are immediate consequences of the definition. • For a subset T of the unit ball in RD , the m-excess width satisfies the bounds p p p m − D ≤ Em (T ) ≤ m. • • • • In particular, the excess width can be positive or negative. The m-excess width is weakly increasing in m. That is, m ≤ n implies Em (T ) ≤ En (T ). The m-excess width is decreasing with respect to set inclusion: S ⊂ T implies Em (S) ≥ Em (T ). The m-excess width is absolutely homogeneous: Em (αT ) = |α| Em (T ) for α ∈ R. The excess width (4.1) is related to the Gaussian width (3.7): p (4.2) Em (Ω) = m − W (Ω) for Ω ⊂ SD−1 . Using (3.8), we can also relate the excess width to the statistical dimension: p p p p m − 1 + δ(Ω) ≤ Em (Ω) ≤ m − δ(Ω) for Ω ⊂ SD−1 . (4.3) The term “excess width” is not standard, but the formula (4.2) suggests that this moniker is appropriate. According to Theorem I, the sign (±) of the excess width Ed (Ω) indicates that random dimension reduction Π(Ω) with embedding dimension d succeeds (+) or fails (−) with high probability. The papers [Sto13, OTH13, TOH15] develop methods for computing the excess width in a variety of situations. For instance, if L is a k-dimensional subspace of RD , then p p Em (L ∩ SD−1 ) ≈ m − k. For a more sophisticated example, consider the probability simplex n o XD ∆D := t ∈ RD : i =1 t i = 1, t i ≥ 0 for i = 1, . . . , D . We can develop an asymptotic expression for its excess width: ³ p £ ¡ ¢´ ¤ lim Ed (∆D ) = inf α − inf s + α %q(s) where q(s) := E (γ − s)2+ . D,d →∞ D/d =% α≥0 s∈R (4.4) The proof of the formula (4.4) is involved, so we must omit the details; see [TAH15] for a framework for making such computations. See Part II for some other examples. It is also possible to estimate the excess width numerically by approximating the expectation in (4.1) with an empirical average. 4.3. Theorem II: Universality for the Restricted Minimum Singular Value. With this preparation, we can present our main result about the universality properties of the restricted minimum singular value of a random linear map. Theorem II (Universality for the Restricted Minimum Singular Value). Fix the parameters p and ν for Model 2.4. Choose parameters λ ∈ (0, 1) and % ∈ (0, 1) and ε ∈ (0, 1). There is a number N := N (p, ν, λ, %, ε) for which the following statement holds. Suppose that • • • • • The ambient dimension D ≥ N . E is a nonempty, compact subset of the unit ball BD in RD . The embedding dimension d is in the range λD ≤ dp≤ D 6/5 . The d -excess width of E is not too small: Ed (E ) ≥ % d . The random linear map Π : RD → Rd obeys Model 2.4 with parameters p and ν. Then © ¡ ¢ ª P σmin (Π; E ) ≥ (1 − ε) Ed (E ) + ≥ 1 − Cp D 1−p/4 . (a) UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION Furthermore, if E is convex, then © ¡ ¢ ª P σmin (Π; E ) ≤ (1 + ε) Ed (E ) + ≥ 1 − Cp D 1−p/4 . 17 (b) The constant Cp depends only on the parameter p in the random matrix model. Section 4.4 contains an overview of the argument. The detailed proof of Theorem II appears in Section 10.2. Stronger probability bounds hold when the random linear map is drawn from Model 2.1. For any random linear map Π drawn from Model 2.4, Theorem II asserts that the distance of the random projection Π(E ) from the origin is typically not much smaller than the d -excess width Ed (E ). Similarly, when E is convex, the distance of the random image from the origin is typically not much larger than the d -excesspwidth. These conclusions require that the excess width Ed (E ) is not too small as compared with the root d of the embedding dimension. Theorem IIpis vacuous when Ed (E ) ≤ 0. Nevertheless, in case θ(E ) is spherically convex, the condition Ed (θ(E )) + o( D) ≤ 0 implies that σmin (Π; E ) = 0 with high probability because of (4.3) and Theorem I. We have already seen an illustration of Theorem II in action. In view of the expression (4.4) for the excess width of the probability simplex, the theorem explains the experiment documented in Figure 1.4! Remark 4.3 (Prior Work). When the random linear map Π is Gaussian, Gordon’s work [Gor88, Cor. 1.1] yields the conclusion Theorem II(a), while the second conclusion (b) appears to be more recent; see [Sto13, OTH13, TOH15, TAH15]. Korada & Montanari [KM11] have established universality laws for some optimization problems that arise in communications. The mathematical challenge in their work is similar to showing that the RSV of a cube is universal for Model 2.4 with p ≥ 6. We have adopted some of their arguments in our work. On the other hand, the cube does not present any of the technical difficulties that arise for general sets. For other types of random linear maps and other types of sets, we are not aware of any research that yields the precise value of the restricted singular value, which is required to assert universality. The literature on asymptotic convex geometry and mathematical signal processing, e.g., [MPTJ07, Men10, Men14, Tro15b, Ver15], contains many results on the restricted singular value that provide bounds of the correct order with unspecified multiplicative constants. 4.4. Theorem II: Proof Strategy. One standard template for proving a universality law factors the problem into two parts. First, we compare a general random structure with a canonical structure that has additional properties. Then we use these extra properties to obtain a complete analysis of the canonical structure. Because of the comparison, we learn that the general structure inherits some of the behavior of the canonical structure. This recipe describes Lindeberg’s approach [Lin22] to the central limit theorem; see [Tao12, Sec. 2.2.4]. More recently, similar methods have been directed at harder problems, such as the universality of local spectral statistics of a non-symmetric random matrix [TV15]. Our research is closest in spirit to the papers [MOO10, Cha06, KM11]. Let us imagine how we could apply this technique to prove Theorem II. Suppose that E is a compact, convex set. After performing standard discretization and smoothing steps, we might invoke the Lindeberg exchange principle to compare the restricted singular value of the d × D random linear map Π with that of a d × D standard normal matrix Γ: E σmin (Π; E ) ≈ E σmin (Γ; E ). To evaluate the restricted minimum singular value of a standard normal matrix, we can use the Gaussian Minimax Theorem, as in [Gor88, Cor. 1.1]: ¡ ¢ E σmin (Γ; E ) ' Ed (E ) + . Last, we can incorporate a convex duality argument, as in [Sto13, OTH13, TOH15, TAH15], to obtain the reverse inequality: ¡ ¢ E σmin (Γ; E ) / Ed (E ) + . 18 S. OYMAK AND J. A. TROPP Unfortunately, this simple approach is not adequate. Our argument ultimately follows a related pattern, but we have to overcome a number of technical obstacles. Let us explain the most serious issue and our mechanism for handling it. We would like to apply the Lindeberg exchange principle to σmin (Π; E ) to replace each entry of Π with a standard normal variable. The problem is that E may contain a vector t 0 with large entries. If we try to replace the columns of Π associated with the large components of t 0 , we incur an intolerably large error. Moreover, for any given coordinate j , the set E may contain a vector t j that takes a large value in the distinguished coordinate j . This fact seems to foreclose the possibility of replacing any part of the matrix Π. We address this challenge by dissecting the index set E . For each (small) subset J of {1, . . . , D}, we define the set E J of vectors in E whose components in J c are small. First, we argue that the restricted singular value of a subset does not differ much from the restricted singular value of the entire set: E σmin (Π; E ) ≈ min J E σmin (Π; E J ). We may now use the Lindeberg method to make the comparison E σmin (Π; E J ) ≈ E σmin (Ψ; E J ), where the matrix Ψ is a hybrid of the form Ψ J = Π J and Ψ J c = Γ J c . That is, we only replace the columns of Π listed in the set J c with independent standard normal variables. At this point, we need to compare the minimum singular value of Ψ restricted to the subset E J against the excess width of the full set: ¡ ¢ E σmin (Ψ; E J ) ≈ Ed (E ) + . In other words, the remaining part Ψ J of the original matrix plays a negligible role in determining the restricted singular value. We perform this estimate using the Gaussian Minimax Theorem [Gor85], some convex duality arguments [TOH15], and some coarse results from nonasymptotic random matrix theory [Ver12, Tro15c]. See Part III for detailed statements of the main technical results that support Theorem II and the proofs of these results. Most of the ingredients are standard tools from modern applied probability, but we have combined them in a subtle way. To make the long argument clearer, we have attempted to present the proof in a multi-resolution fashion where pieces from each level are combined explicitly at the level above. 4.5. Theorem II: Extensions. We expect that there are a number of avenues for extending Theorem II. • Our p analysis shows that the error in estimating σmin (Π; E ) by the excess width Ed (E ) is at most o( D). In case Π is a standard normal matrix, the error actually has constant order [TOH15, Thm. II.1]. Can we improve the error bound for more general random linear maps? • A related question is whether thep universality of σmin (Π; E ) persists when the excess width Ed (E ) is very small in comparison with d . • There is some empirical evidence that the restricted minimum singular value may have universality properties for a class of random linear maps wider than Model 2.4. • Our proof can probably be adapted to show that other types of functionals exhibit universal behavior. For example, we can study ¡ ¢ min kΠt k2 + f (t ) t ∈E where f is a convex, Lipschitz function. This type of optimization problem plays an important role in statistics and machine learning. At the same time, we know that many natural functionals do not exhibit universal behavior. In particular, consider the restricted maximum singular value: σmax (A; T ) := sup kAt k . t ∈T There are many sets T where the maximum singular value σmax (·; T ) does not take a universal value for linear maps in Model 2.4; for example, see Figure 1.6. It is an interesting challenge to determine the full scope of the universality principle uncovered in Theorem II. UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 19 Part II. Applications In this part of the paper, we outline some of the implications of Theorems I and II in the information sciences. We focus on problems involving least squares and `1 minimization to reduce the number of distinct calculations that we need to perform; nevertheless the techniques apply broadly. In an effort to make the presentation shorter and more intuitive, we have also chosen to sacrifice some precision. Section 5 discusses structured signal recovery and, in particular, the compressed sensing problem. Section 6 presents an application in coding theory. Section 7 describes how the results allow us to analyze randomized algorithms for numerical linear algebra. Finally, Section 8 gives a universal formula for the prediction error in a sparse regression problem. 5. R ECOVERY OF S TRUCTURED S IGNALS FROM R ANDOM M EASUREMENTS In signal processing, dimension reduction arises as a mechanism for signal acquisition. The idea is that the number of measurements we need to recover a structured signal is comparable with the number of degrees of freedom in the signal, rather than the ambient dimension. Given the measurements, we can reconstruct the signal using nonlinear algorithms that take into account our prior knowledge about the structure. The field of compressed sensing is based on the idea that random linear measurements offer an efficient way to acquire structured signals. The practical challenge in implementing this proposal is to find technologies that can perform random sampling. Our universality laws have a significant implication for compressed sensing. We prove that the number of random measurements required to recover a structured signal does not have a strong dependence on the distribution of the random measurements. This result is important because most applications offer limited flexibility in the type of measurement that we can take. Our theory justifies the use of a broad class of measurement ensembles. 5.1. The Phase Transition for Sparse Signal Recovery. In this section, we study the phase transition that appears when we reconstruct a sparse signal from random measurements via `1 minimization. For a large class of random measurements, we prove that the distribution does not affect the location of the phase transition. This result resolves a major open question [DT09a] in the theory of compressed sensing. Let us give a more precise description of the problem. Suppose that x ? ∈ Rn is a fixed vector with precisely s nonzero entries. Let Φ : Rn → Rm be a random linear map, and suppose that we have access to the image y = Φx ? . We interpret this data as a list of m samples of the unknown signal. A standard approach [CDS98, DH01, Tro06, CRT06, Don06a] for reconstructing the sparse signal x ? from the data is to solve a convex optimization problem: minimize n x∈R kxk`1 subject to Φx = y. (5.1) Minimizing the `1 norm promotes sparsity in the optimization variable x, and the constraint ensures that the virtual measurements Φx are consistent with the observed data y. We say that the optimization problem (5.1) succeeds if it has a unique solution xb that coincides with x ? . Otherwise, it fails. In this setting, the following challenge arises. The Compressed Sensing Problem: Is the optimization problem (5.1) likely to succeed or to fail to recover x ? as a function of the sparsity s, the number m of measurements, the ambient dimension n, and the distribution of the random measurement matrix Φ? This question has been a subject of inquiry in thousands of papers over the last 10 years; see the books [EK12, FR13] for more background and references. In a series of recent papers [DT09b, Sto09, CRPW12, BLM15, ALMT14, Sto13, OTH13, FM14, GNP14], the compressed sensing problem has been solved completely in the case where the random measurement matrix Φ follows the standard normal distribution. See Remark 5.2 for a narrative of who did what when. 20 S. OYMAK AND J. A. TROPP Probability of Exact Recovery (20% Nonzero Rademacher) Probability of Exact Recovery (Student t with 5 dof) Number of Measurements (m) 0.8 50 0.7 0.6 40 0.5 30 0.4 20 0.3 0.2 10 Theory 0 0 10 20 30 40 Sparsity (s) 50 60 0.1 0 0.9 60 0.8 50 0.7 0.6 40 0.5 30 0.4 20 0.3 0.2 10 Theory 0 Empirical Probability 0.9 60 0 10 20 30 40 Sparsity (s) 50 60 0.1 0 F IGURE 5.1: Universality of the `1 Recovery Phase Transition. These plots depict the empirical probability that the `1 minimization problem (5.1) recovers a vector x ? ∈ R64 with s nonzero entries from a vector of random measurements y = Φx ? ∈ Rm . The heatmap indicates the empirical probability, computed over 100 trials. The white curve is the phase transition nψ`1 (s/n) promised by Proposition 5.1. L EFT: The random measurement matrix Φ is a sparse Rademacher matrix with an average of 20% nonzero entries. R IGHT: The random measurement matrix Φ has independent Student t 5 entries. See Section 1.9 for more details. In brief, there exists a phase transition function ψ`1 : [0, 1] → [0, 1] defined by ! à r Z 2 ∞ 2 2 −ζ2 /2 ψ`1 (%) := inf %(1 + τ ) + (1 − %) (ζ − τ) e dζ . τ≥0 π τ (5.2) The phase transition function is increasing and convex, and it satisfies ψ`1 (0) = 0 and ψ`1 (1) = 1. When the measurement matrix Φ is standard normal, m/n < ψ`1 (s/n) − o(1) implies (5.1) fails with probability 1 − o(1); m/n > ψ`1 (s/n) + o(1) implies (5.1) succeeds with probability 1 − o(1). (5.3) In other words, as the number m of measurements increases, the probability of success jumps from zero to one at the point nψ`1 (s/n) over a range of o(n) measurements. The error terms in (5.3) can be improved substantially, but this presentation suffices for our purposes. Donoho & Tanner [DT09a] have performed an extensive empirical investigation of the phase transition in the `1 minimization problem (5.1). Their work suggests that the Gaussian phase transition (5.3) persists for many other types of random measurements. See Figure 5.1 for a small illustration. Our universality results provide the first rigorous explanation of this phenomenon for measurement matrices drawn from Model 2.4. Proposition 5.1 (Universality of `1 Phase Transition). Assume that • • • • The ambient dimension n and the number m of measurements satisfy m ≤ n. The vector x ? ∈ Rn has exactly s nonzero entries. The random measurement matrix Φ : Rn → Rm follows Model 2.4 with parameters p and ν. We observe the vector y = Φx ? . UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 21 Then, as the ambient dimension n → ∞, m/n < ψ`1 (s/n) − o(1) implies (5.1) fails with probability 1 − o(1); m/n > ψ`1 (s/n) + o(1) implies (5.1) succeeds with probability 1 − o(1). The little-o suppresses constants that depend only on p and ν. Proposition 5.1 follows directly from our universality result, Theorem I, and the established calculation (5.3) of the phase transition in the standard normal setting. Proof. The approach is quite standard. Let Ω be the set of unit-norm descent directions of the `1 norm at the point x ? . That is, © ª Ω := u ∈ Sn−1 : kx ? + λuk1 ≤ kx ? k1 for some λ > 0 . The primal optimality condition for (5.1) demonstrates that the reconstruction succeeds if and only if Ω∩null(Φ) = ;. Since the `1 norm is a closed convex function, the set θ −1 (Ω)∪{0} of all descent directions forms a closed, convex cone. Therefore, the set Ω is closed and spherically convex. It follows from Theorem I that the behavior of (5.1) undergoes a phase transition at the statistical dimension δ(Ω) for any random linear map drawn from Model 2.4. The result [ALMT14, Prop. 4.5] contains the first complete and accurate computation of the statistical dimension of a descent cone of the `1 norm: p nψ`1 (s/n) − O( n) ≤ δ(Ω) ≤ nψ`1 (s/n). (5.4) See also [FM14, Prop. 1]. This fact completes the proof.  Note that Proposition 5.1 requires the sparsity level s to be proportional to the ambient dimension n before it provides any information. By refining our argument, we can address the case when s is proportional to n 1−ε for a small number ε that depends on the regularity of the random linear map. The empirical work [DT09a] of Donoho & Tanner is unable to provide statistical evidence for the universality hypothesis in the regime where s is very small. It remains an open problem to understand how rapidly s/n can vanish before the universality phenomenon fails. The paper [DT09a] also contains numerical evidence that the `1 phase transition persists for random measurement systems that have more structure than Model 2.4. It remains an intriguing open question to understand these experiments. Remark 5.2 (Prior Work). In early 2005, Donoho [Don06c] and Donoho & Tanner [DT06] observed that there is a phase transition in the number of standard normal measurements needed to reconstruct a sparse signal via `1 minimization. Using methods from integral geometry, they were able to perform a heuristic computation of the location of the phase transition function (5.2). In subsequent work [DT09b], they proved that the transition (5.3) is valid in some parameter regimes. They later reported extensive empirical evidence [DT09a] that the distribution of the random measurement map has little effect on the location of the phase transition. In early 2005, Rudelson & Vershynin [RV08] proposed a different approach to studying `1 minimization by adapting results of Gordon [Gor88] that depend on Gaussian process theory. Stojnic [Sto09] refined this argument to obtain an empirically sharp success condition for standard normal linear maps, but his work did not establish a matching failure condition. Stojnic’s calculations were clarified and extended to other signal recovery problems in the papers [OH10, CRPW12, ALMT14, FM14]. Bayati et al. [BLM15] is the first paper to rigorously demonstrate that the phase transition (5.3) is valid for standard normal measurements. The argument is based on a state evolution framework for an iterative algorithm inspired by statistical physics. This work also gives the striking conclusion that the `1 phase transition is universal over a class of random measurement maps. This result requires the measurement matrix to have independent, standardized, subgaussian entries that are absolutely continuous with respect to the Gaussian distribution. As a consequence, the paper [BLM15] excludes discrete and heavy-tailed 22 S. OYMAK AND J. A. TROPP models. Furthermore, it only applies to `1 minimization. In contrast, Proposition 5.1 and its proof have a much wider compass. The paper [ALMT14] of Amelunxen et al. contains the first complete integral-geometric proof of (5.3) for standard normal measurements. This work is significant because it established for the first time that phase transitions are ubiquitous in signal reconstruction problems. It also forged the first links between the approach to phase transitions based on integral geometry and those based on Gaussian process theory. The papers [MT14a, GNP14] build on these ideas to obtain precise estimates of the success probability in (5.3). Subsequently, Stojnic [Sto13] refined the Gaussian process methods to obtain more detailed information about the behavior of the errors in noisy variants of the `1 minimization problem. His work has been extended in a series [OTH13, TOH15, TAH15] of papers by Abbasi, Oymak, Thrampoulidis, Hassibi, and their collaborators. Because of this research, we now have a very detailed understanding of the behavior of convex signal recovery methods with Gaussian measurements. To our knowledge, the current paper is the first work that extends the type of general analysis in [ALMT14, OTH13, TAH15] beyond the confines of the standard normal model. 5.2. Other Signal Recovery Problems. The compressed sensing problem is the most prominent example from a large class of related questions. Our universality results have implications for this entire class of problems. We include a brief explanation. Let f : Rn → R be a proper7 convex function whose value increases with the “complexity” of its argument. The `1 norm is an example of a complexity measure that is appropriate for sparse signals [CDS98]. Similarly, the Schatten 1-norm is a good complexity measure for low-rank matrices [Faz02]. Let x ? ∈ Rn be a vector with “low complexity.” Draw a random linear map Φ : Rn → Rm , and suppose we have access to x ? only through the measurements y = Φx ? . We can attempt to reconstruct x ? by solving the convex optimization problem minimize n x∈R f (x) subject to Φx = y. In other words, we find the vector with minimum complexity that is consistent with the observed data. We say that (5.2) succeeds when it has a unique optimal point that coincides with x ? ; otherwise, it fails. The paper [ALMT14] proves that there is a phase transition in the behavior of (5.2) when Φ is standard normal. Our universality law, Theorem I, allows us to extend this result to include every random linear map from Model 2.4. Define the set Ω of unit-norm descent directions of f at the point x ? : © ª Ω := u ∈ Sn−1 : f (x ? + λu) ≤ f (x ? ) for some λ > 0 . Then, as the ambient dimension n → ∞, m < δ(Ω) − o(n) implies (5.2) fails with probability 1 − o(1); m > δ(Ω) + o(n) implies (5.2) succeeds with probability 1 − o(1). In other words, there is a phase transition in the behavior of (5.2) when the number m of measurements equals the statistical dimension δ(Ω) of the set of descent directions of f at the point x ? . See the papers [CRPW12, ALMT14, FM14] for some general methods for computing the statistical dimension of a descent cone. 5.3. Complements. We conclude this section with a few additional remarks about the scope of our results on signal recovery. First, we discuss some geometric applications. Second, we mention some other signal processing problems that can be studied using the same methods. 7A proper convex function takes at least one finite value and never takes the value −∞. UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 23 5.3.1. Geometric Implications. Proposition 5.1 can be understood as a statement about the facial structure of a random projection of the `1 ball. Equivalently, it provides information about the facial structure of the convex hull of random points. Suppose that Bn1 is the n-dimensional `1 ball, and fix an (s−1)-dimensional face F of Bn1 . Let Φ : Rn → Rm be a random linear map from Model 2.4. We say that Φ preserves the face F when Φ(F ) is an (s − 1)dimensional face of the projection Φ(Bn1 ). We can reinterpret Proposition 5.1 as saying that m/n < ψ`1 (s/n) − o(1) implies Φ is unlikely to preserve F ; m/n > ψ`1 (s/n) + o(1) implies Φ is likely to preserve F . The connection between `1 minimization and the facial structure of the `1 ball was identified in [Don06b]; see also [ALMT14, Sec. 10.1.1]. Here is another way of framing the same result. Fix an index set J ⊂ {1, . . . , n} with cardinality #J = s and a vector η ∈ Rn with ±1 entries. Let ϕ1 , . . . , ϕn ∈ Rm be independent random vectors, drawn from Model 2.4, and consider the absolute convex hull E := conv{±ϕ1 , . . . , ±ϕn }. The question is whether the set F := conv{η j ϕ j : j ∈ J } is an (s − 1)-dimensional face of E . We have the statements s/n < ψ−1 `1 (m/n) − o(1) implies F is likely to be an (s − 1)-dimensional face of E ; s/n > ψ−1 `1 (m/n) + o(1) implies F is unlikely to be an (s − 1)-dimensional face of E . See the paper [DT09b] for more discussion of the connection between the facial structure of polytopes and signal recovery. Some universality results of this type also appear in Bayati et al. [BLM15]. 5.3.2. Other Signal Processing Applications. We often want to perform signal processing tasks on data after reducing its dimension. In this section, we have focused on the problem of reconstructing a sparse signal from random measurements. Here are some related problems: • Detection. Does an observed signal consist of a template corrupted with noise? Or is it just noise? • Classification. Does an observed signal belong to class A or to class B? The literature contains many papers that propose methods for solving these problems after dimension reduction; for example, see [DDW+ 07]. The existing analysis is either qualitative or it assumes that the dimension reduction map is Gaussian. Our universality laws can be used to study the precise behavior of compressed detection and classification with more general types of random linear maps. For brevity, we omit the details. 6. D ECODING WITH S TRUCTURED E RRORS One of the goals of coding theory is to design codes and decoding algorithms that can correct gross errors in transmission. In particular, it is common that some proportion of the received symbols are corrupted. In this section, we show that a large family of random codes can be decoded in the presence of structured errors. The number of errors that we can correct is universal over this family. This result is valuable because it applies to random codebooks that are closer to realistic coding schemes. The result on random decoding can also be interpreted as a statement about the behavior of the least-absolute-deviation (LAD) method for regression. We also discuss how our universality results apply to a class of demixing problems. 6.1. Decoding with Sparse Errors. We work with a random linear code over the real field. Consider a fixed message x ? ∈ Rm . Let Φ ∈ Rn×m be a random matrix, which is called a codebook in this context. Instead of transmitting the original message x ? , we transmit the coded message Φx ? . Suppose that we receive a version y of the message where some number s of the entries are corrupted. That is, y = Φx ? +z ? where the error vector z ? has at most s nonzero entries. For simplicity, we assume that z ? does not depend on the codebook Φ. 24 S. OYMAK AND J. A. TROPP Empirical Probability of Decoding a Message of Length m = 64 (20% Nonzero Rademacher Codebook) 30 0 Theory 0.1 Number of Errors (s) 0.3 20 0.4 0.5 15 0.6 10 0.7 0.8 5 0 Empirical Probability 0.2 25 0.9 70 80 90 100 Length of Code (n) 110 120 F IGURE 6.1: Universality of the `1 Decoding Phase Transition. This plot shows the empirical probability that the `1 method (6.1) decodes the message x ? ∈ R64 from the received message y = Φx ? + z ? ∈ Rn where the corruption z ? ∈ Rn has exactly s nonzero entries. The codebook Φ ∈ Rn×64 is a sparse Rademacher matrix with an average of 20% nonzero entries. The heatmap gives the empirical probability of correct decoding, computed over 100 trials. The white curve is the exact phase transition nψ−1 (1−64/n) promised `1 by Proposition 6.1. See Section 1.9 for more details. In this setting, one can attempt to decode the message using an `1 minimization method [DH01, CRTV05, DT06, MT14b]. We solve the optimization problem minimize m n x∈R ,z∈R kzk`1 subject to y = Φx + z. (6.1) In other words, we search for a message x and a sparse corruption z that match the received data. We say that the optimization (6.1) succeeds if it has a unique optimal point (xb, zb) that coincides with (x ? , z ? ); otherwise it fails. The question is when the optimization problem (6.1) is effective at decoding the received transmission. That is, how many errors s can we correct as a function of the message length m and the code length n? The following result gives a solution to this problem for any codebook drawn from Model 2.4. Proposition 6.1 (Universality of Sparse Error Correction). Assume that • • • • • The message length m and the code length n satisfy m ≤ n. The message x ? ∈ Rm is arbitrary. The error vector z ? ∈ Rn has exactly s nonzero entries, where s ≤ (1 − ξ)n for some ξ > 0. The random codebook Φ ∈ Rn×m follows Model 2.4 with parameters p and ν. We observe the vector y = Φx ? + z ? . Then, as the message length m → ∞, s/n < ψ−1 `1 (1 − m/n − o(1)) implies s/n > ψ−1 `1 (1 − m/n + o(1)) implies (6.1) succeeds with probability 1 − o(1); (6.1) fails with probability 1 − o(1). The function ψ`1 is defined in (5.2). The little-o suppresses constants that depend only on ξ and p and ν. UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 25 This result is significant because it allows us to understand the behavior of this method for a sparse, discrete codebook. This type of code is somewhat closer to a practical coding mechanism than the ultrarandom codebooks that have been studied in the past; see Remark 6.3. Figure 6.1 contains an illustration of how the theory compares with the actual performance of this coding scheme. Proof. To analyze the decoding problem (6.1), we change variables: u := x − x ? and v := z − z ? . We obtain the equivalent optimization problem minimize m n u∈R ,v ∈R kz ? + v k`1 subject to Φu = v . (6.2) b vb) of the problem (6.2) The decoding procedure (6.1) succeeds if and only if the unique optimal point (u, is the pair (0, 0). Introduce the set Ω of unit-norm descent directions of the `1 norm at z ? : © ª Ω := v ∈ Sn−1 : kz ? + λv k`1 ≤ kz ? k`1 for some λ > 0 . The primal optimality condition for (6.2) shows that decoding succeeds if and only if Ω ∩ range(Φ) = ;. Let us compute the statistical dimension of Ω◦ : δ(Ω◦ ) = n − δ(Ω) = n − (nψ`1 (s/n) + o(n)) = n(1 − ψ`1 (s/n) + o(1)). (6.3) The first relation is the polar identity (3.5) for the statistical dimension, and the value of the statistical dimension appears in (5.4). Since s ≤ (1 − ξ)n, the properties of the function ψ`1 ensure that δ(Ω◦ ) ≥ %n for some % > 0. First, we demonstrate that decoding fails when the number s of errors is too large. To do so, we must show that Ω ∩ range(Φ) 6= ;. By polarity [Kle55, Thm. (2.7)], it suffices to check that Ω◦ ∩ null(Φ∗ ) = ;. With probability at least 1 − o(1), this relation follows from Theorem I(a), provided that m > δ(Ω◦ ) + o(n) = n(1 − ψ`1 (s/n)) + o(n). Finally, revert the inequality so that it is expressed in terms of s. Last, we must check that decoding succeeds when the number s of errors is sufficiently small. To do so, we must verify that Ω ∩ range(Φ) = ; with high probability. This relation follows from ideas closely related to the proof of Theorem I, but it is not a direct consequence. See Section 17.3 for the details.  Remark 6.2 (Least-Absolute-Deviation Regression). Proposition 6.1 can also be interpreted as a statement about the performance of the least-absolute deviation method for fitting models with outliers. Suppose that we observe the data y = X β? + z. Each of the n rows of X is interpreted as a vector of m measured variables for an independent subject in an experiment. The vector β? lists the coefficients in the true linear model, and the sparse vector z contains a small number s of arbitrary statistical errors. The least-absolute deviation method fits a model by solving minimize β∈Rm kX β − yk`1 . Proposition 6.1 shows that the procedure identifies the true model β? exactly, provided that the number s of contaminated data points satisfies s/n < ψ−1 (1 − m/n) − o(1). ` 1 Remark 6.3 (Prior Work). The idea of using `1 minimization for decoding in the presence of sparse errors dates at least as far back as the paper [DH01]. This scheme received further attention in the work [CRTV05]. Later, Donoho & Tanner [DT06] applied phase transition calculations to assess the precise performance of this coding scheme for a standard normal codebook; the least-absolute-deviation interpretation of this result appears in [DT09a, Sec. 1.3]. The paper [MT14b] revisits the coding problem and develops a sharp analysis in the case where the codebook is a random orthogonal matrix. The current paper contains the first precise result that extends to codebooks with more general distributions. 26 S. OYMAK AND J. A. TROPP 6.2. Other Demixing Problems. The decoding problem (6.1) is an example of a convex demixing problem [MT14b, ALMT14]. Our universality results can be used to study other questions of this species. Let f 0 : Rn → R and f 1 : Rn → R be proper convex functions that measure the complexity of a signal. Suppose that x ?0 ∈ Rn and x ?1 ∈ Rn are signals with “low complexity.” Draw random matrices Φ0 : Rn → Rm and Φ1 : Rn → Rm from Model 2.4. Suppose that we observe the vector y = Φ0 x ?1 + Φ1 x ?1 . We interpret the random matrices as known transformations of the unknown signals. For example, the matrices Φi might denote dictionaries in which the two components of y are sparse. We can attempt to reconstruct the original signal pair by solving © ª minimize max f 0 (z 0 ), f 1 (z 1 ) subject to Φ0 z 0 + Φ1 z 1 = y. (6.4) z 0 ∈Rn ,z 1 ∈Rn In other words, we witness a superposition of two structured signals, and we attempt to find the lowest complexity pair (z 0 , z 1 ) that reproduces the observed data. The demixing problem succeeds if it has a unique optimal point that equals (x ?0 , x ?1 ). To analyze this problem, we introduce two descent sets: © ª Ωi := u ∈ Sn−1 : f i (x ?i + λu) ≤ f i (x ?i ) for some λ > 0 for i = 1, 2. Up to scaling, the descent directions of max{ f 0 (·), f 1 (··)} at the pair (x ?0 , x ?1 ) coincide with the direct product Ω0 × Ω1 . The statistical dimension of a direct product of two spherical sets satisfies δ(Ω0 × Ω1 ) = δ(Ω0 ) + δ(Ω1 ). Therefore, Theorem I demonstrates that m < δ(Ω0 ) + δ(Ω1 ) − o(n) implies (6.4) fails with probability 1 − o(1); m > δ(Ω0 ) + δ(Ω1 ) + o(n) implies (6.4) succeeds with probability 1 − o(1). In other words, the amount of information needed to extract a pair of signals from the superposition equals the total complexity of the two signals. This result holds true for a wide class of distributions on Φ0 and Φ1 . 7. R ANDOMIZED N UMERICAL L INEAR A LGEBRA Numerical linear algebra (NLA) is the study of computational methods for problems in linear algebra, including the solution of linear systems, spectral calculations, and matrix approximations. Over the last 15 years, researchers have developed many new algorithms for NLA that exploit randomness to perform these computations more efficiently. See the surveys [Mah11, HMT11, Woo14] for an overview of this field. In this section, we apply our universality techniques to obtain new results on dimension reduction in randomized NLA. This discussion shows that a broad class of dimension reduction methods share the same quantitative behavior. Therefore, within some limits, we can choose the random linear map that is most computationally appealing when we design numerical algorithms based on dimension reduction. As an added bonus, the arguments here lead to a new proof of the Bai–Yin limit for the minimum singular value of a random matrix drawn from Model 2.4. 7.1. Subspace Embeddings. In randomized NLA, one of the key primitives is a subspace embedding. A subspace embedding is nothing more than a randomized linear map that does not annihilate any point in a fixed subspace. Definition 7.1 (Subspace Embedding). Fix a natural number k, and let L be an arbitrary k-dimensional subspace. We say that a randomized linear map Π : RD → Rd is an oblivious subspace embedding of order k if ¡ ¢ 0 ∉ Π L ∩ SD−1 with high probability. The term “oblivious” indicates that the linear map Π is chosen without knowledge of the subspace L. UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 27 In the definition of a subspace embedding, some authors include quantitative bounds on the stability of the embedding. These estimates are useful for analyzing certain algorithms, but we have left them out because they are not essential. A standard normal matrix provides an important theoretical and practical example of a subspace embedding. Example 7.2 (Gaussian Subspace Embedding). For any natural number k, a standard normal matrix Γ ∈ Rd ×D is a subspace embedding with probability one when the embedding dimension d ≥ k. In practice, it is preferable to select the embedding dimension d ≥ k +10 to ensure that the restricted singular value σmin (Γ; L ∩ SD−1 ) is sufficiently positive, which makes the embedding more stable. See [HMT11] for more details. A Gaussian subspace embedding has superb dimension reduction properties. On the other hand, standard normal matrices are expensive to generate, to store, and to perform arithmetic with. Therefore, in most randomized NLA algorithms, it is better to use subspace embeddings that are discrete or sparse. Our universality results demonstrate that, in a certain range of parameters, every matrix that follows Model 2.4 enjoys the same subspace embedding properties as a Gaussian matrix. Proposition 7.3 (Universality for Subspace Embedding). Suppose that • The ambient dimension D is sufficiently large. • The embedding dimension satisfies d ≤ D 6/5 . • The random linear map Π : RD → Rd follows Model 2.4 with parameters p and ν. Then, for each k-dimensional subspace L of RD , p p p σmin (Π; L ∩ SD−1 ) ≥ d − k − o( D) with probability 1 − o(1). In particular, Π is a subspace embedding of order k whenever d ≥ k + o(D). In these expressions, the little-o suppresses constants that depend only on p and ν. Proof. Proposition 7.3 is a consequence of Theorem II(a) and (4.3) because p p p p p p Ed (L ∩ SD−1 ) ≥ d − δ(L ∩ SD−1 ) = d − δ(L) = d − k. The last identity¡holds p ¢ because the k-dimensional subspace L has statistical dimension k. We introduce the error term o D to make sure that the stated result is only valid when the hypotheses of Theorem II are in force.  Note that Proposition 7.3 applies to a sparse Rademacher linear map with a fixed, but arbitrarily small, proportion of nonzero entries. This particular example has received extensive attention in recent years [CW13, NN13, KN14, BDN15], although these works typically focus on the regime where the subspace dimension k is small and the sparsity level of the random linear map is a vanishing proportion of the embedding dimension d . Remark 7.4 (Prior Work). For the simple problem considered in Proposition 7.3, much sharper results are available in the random matrix literature. See the paper [KY14] for a recent analysis, as well as additional references. Remark 7.5 (The Bai–Yin Limit for the Minimum Singular Value). One of the most important problems in random matrix theory is to obtain bounds for the extreme singular values of a random matrix. The Bai–Yin law [BY93] gives a near-optimal result in case the entries of the random matrix are independent and standardized. We can reproduce a slightly weaker version of the Bai–Yin law for the minimum singular value by modifying the proof of Proposition 7.3. Fix an aspect ratio % ∈ (0, 1). For each natural number d , define k := k(d ) := b%d c. Draw a d × k random matrix Φ(d ) from Model 2.4 with fixed parameters p and ν. For each ε > 0, we can apply Theorem II(a) with E = Sk−1 to see that n o ¡ ¢ p P d −1/2 σmin Φ(d ) ≥ 1 − % − ε → 1 as d → ∞. 28 S. OYMAK AND J. A. TROPP Here, σmin denotes the kth largest singular value of Φ(d ) . Under these assumptions, it is known [Yin86] that the empirical distribution of the singular values of p (d ) Φ converges in probability to the Marčenko–Pastur density, whose support is the interval 1 ± %. It follows that n o ¡ ¢ p P d −1/2 σmin Φ(d ) ≤ 1 − % + ε → 1 as d → ∞. Therefore, we may conclude that ¡ ¢ p d −1/2 σmin Φ(d ) → 1 − % in probability. In comparison, the Bai–Yin law [BY93, Thm. 2] gives the same conclusion almost surely when the entries of Φ(d ) have four finite moments. See the recent paper [Tik15] for an optimal result. 7.2. Sketching and Least Squares. In randomized NLA, one of the core applications of dimension reduction is to solve over-determined least-squares problems, perhaps with additional constraints. This idea is attributed to Sarlós [Sar06], and it has been studied intensively over the last decade; see the surveys [Mah11, Woo14] for more information. In this section, we develop sharp bounds for the simplest version of this approach. Suppose that A is a fixed D × n matrix with full column rank. Let y ∈ RD be a vector, and consider the over-determined least-squares problem kAx − yk2 . minimize n x∈R (7.1) This problem can be expensive to solve when D À n. One remedy is to apply dimension reduction. Draw a random linear map Π : RD → Rd from Model 2.4, and consider the compressed problem kΠ(Ax − y)k2 . minimize n x∈R (7.2) The question is how the quality of the solution of (7.2) depends on the embedding dimension d . The following result provides an optimal estimate. Proposition 7.6 (Randomized Least Squares: Error Bound). Instate the prevailing notation. Fix parameters λ ∈ (0, 1) and % ∈ (0, 1) and ι ∈ (0, 1). Assume that • The number D of constraints is sufficiently large as a function of the parameters. • The embedding dimension d is comparable with the number D of constraints: λD ≤ d ≤ D. • The embedding dimension d is somewhat larger than the number n of variables: d ≥ (1 + %)n. With high probability, the solution xb to the reduced least-squares problem (7.2) satisfies kA(xb − x ? )k2 2 kAx ? − yk ≤ n + ιd , d −n (7.3) where x ? is the solution to the original least-squares problem (7.1). In particular, kA xb − yk2 2 kAx ? − yk ≤ (1 + ι) d d −n In other words, the excess error kA(xb − x ? )k incurred in solving the compressed least-squares problem (7.2) is negligible as compared with the optimal value of the least-squares problem (7.1) if we choose the embedding dimension d sufficiently large. Proposition 7.6 improves substantially on the most recent work [PW15, Cor. 2(a)], both in terms of the error bound and in terms of the assumptions on the randomized linear map. Let us remark that there is nothing special about ordinary least squares. We can also solve least-squares problems with a convex constraint set by dimension reduction. For this class of problems, we can also obtain optimal bounds by adapting the argument below. For example, see the results in Section 8. UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 29 Proof. Let x ? ∈ Rn be the solution to the original least-squares problem (7.1). Define the optimal residual z ? := y − Ax ? ∈ RD , and recall that z ? is orthogonal to range(A). Moreover, minn kAx − yk2 = kAx ? − yk2 = kz ? k2 . x∈R Without loss of generality, we may scale the problem so that kz ? k2 = 1. Next, change variables. Define w := A(x − x ? ), and note that w is orthogonal to z ? . We can write the reduced least-squares problem (7.2) as minimize w ∈range(A) kΠ(w − z ? )k . (7.4) b to (7.4) to be close to zero. When dimension reduction is effective, we expect the solution w Since d ≥ (1 + %)n, we can use the fact (Proposition 7.3) that Π is a subspace embedding to obtain an a b k ≤ R ∞ that holds with high probability. The number R ∞ is a constant that depends on priori bound kw nothing but ε. We only need this observation to ensure that we are optimizing over a compact set with constant radius, so we omit the details. Next, we invoke Theorem II(b) to bound the optimal value of the reduced least-squares problem (7.4). Define the compact, convex set E := {w ∈ range(A) : kw k ≤ R ∞ }. Let ε > 0 be a parameter that will depend on the parameter ι. With high probability, min w ∈range(A) kΠ(w − z ? )k = min kΠ(w − z ? )k ≤ (1 + ε) Ed (E − z ? ). w ∈E By direct calculation, we can bound the excess width above. Let P be the orthogonal projector onto the range of A, and observe that ¢ ¡p Ed (E − z ? ) = E inf d kw − z ? k + g · (w − z ? ) w ∈E ¢ ¡p = E inf d (kw k2 + 1)1/2 + g · w w ∈E ¡p ¢ = E inf d (kw k2 + 1)1/2 − kP g k kw k w ∈E ¡p p ¢ d (α2 + 1)1/2 − nα ≤ inf 0≤α≤R ∞ p = d − n. The first line is Definition 4.2, of the excess width. Next, simplify via the orthogonality of w and z ? and the scaling kz ? k2 = 1. Use translation invariance of the infimum to remove z ? from the Gaussian term. p Apply Jensen’s inequality to draw the expectation inside the infimum, and note that E kP g k ≤ n because rank(P ) = n. Then make the change of variables α = kw k, and solve the scalar convex optimization problem. The infimum occurs at the value n α2opt := . d −n Since d ≥ (1 + %)n, we may be confident that αopt < R ∞ . We have shown that, with high probability, p min kΠ(w − z ? )k ≤ (1 + ε) d − n. (7.5) w ∈range(A) b k ≈ αopt . To prove the main result, we Furthermore, we have evidence that the norm of the minimizer kw p compute the value of the optimization problem (7.4) restricted to points with kw k ≥ αopt 1 + ι0 , where ι0 is a small positive number to be chosen later. Then we verify that the optimal value of the restricted problem is usually larger than the bound (7.5) for the optimal value of (7.2). This argument implies that p kw b k < αopt 1 + ι0 with high probability. p To that end, define R + := αopt 1 + ι0 , and introduce the compact set E + := {w ∈ range(A) : R + ≤ kw k ≤ R ∞ }. 30 S. OYMAK AND J. A. TROPP Theorem II(a) shows that, with high probability, min kΠ(w − z ? )k ≥ (1 − ε) Ed (E + − z ? ). w ∈E + (7.6) Calculating the excess width as before, ¢ ¡p d (α2 + 1)1/2 − kP g k α R + ≤α≤R ∞ ¡ ¡p p ¢ p ¢ ≥ inf d (α2 + 1)1/2 − nα − R ∞ E kP g k − n + R + ≤α≤R ∞ ¡p ¢ p 2 ≥ d (R + + 1)1/2 − nR + − R ∞ . Ed (E + − z ? ) = E inf (7.7) p p Add and subtract nα to reach the second line, and use the fact that E kP g k ≤ n. Then apply the Gaussian variance inequality, Fact A.1, to bound the expectation by one. The infimum occurs at R + because the objective is convex and R + exceeds the unconstrained minimizer αopt . Next, we simplify the expression involving R + . Setting ι0 := ιd /n, we find that p p 1 + ι0 n/d − n 1 + ι0 p d −n   s r ι(d /n − 1)  1+ι  d −n 1+ = d −n 1+ι r µ ¶ ι(d − n) 1 + ι/2 p 1+ι ≥ d −n − =p d − n. d −n 2(1 + ι) 1+ι p p d 2 + 1)1/2 − nR + = d (R + (7.8) The inequality follows from the linear upper bound for the square root at one. Combine (7.6), (7.7), and (7.8) to arrive at min kΠ(w − z ? )k ≥ w ∈E + (1 − ε)(1 + ι/2) p d − n. p 1+ι Comparing (7.5) with the last display, we discover that the choice ε := cι2 is sufficient to ensure that, with high probability, min kΠ(w − z ? )k > min kΠ(w − z ? )k . w ∈E + w ∈E It follows that the minimum of (7.4) usually occurs on the set E \ E + . We determine that kw b k2 ≤ (1 + ιd /n) α2opt . Reinterpret this inequality to obtain the stated result (7.3). b k by considering the set of vectors E − := {w ∈ range(A) : We can obtain a matching lower bound for kw p kw k ≤ R − } where R − := αopt 1 − ι0 . We omit the details.  Remark 7.7 (Prior Work). The idea of using random linear maps to accelerate the solution of least-squares problems appears in the work of Sarlós [Sar06]. This approach has been extended and refined in the literature on randomized NLA; see the surveys [Mah11, Woo14] for an overview. Most of this research is concerned with randomized linear maps that have favorable computational properties, but the results are much less precise than Proposition 7.6. Recently, Pilanci & Wainright [PW15] have offered a more refined analysis of randomized dimension reduction for constrained least-squares problems, but it still falls short of describing the actual behavior of these methods. Parts of the argument here is adapted from the work of Oymak, Thrampoulidis, and Hassibi [OTH13, TOH15]. UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 31 8. T HE P REDICTION E RROR FOR LASSO Universality results have always played an important role in statistics. The most fundamental example is the law of large numbers, which justifies the use of the sample average to estimate the mean of a general distribution. Similarly, the central limit theorem permits us to build a confidence interval for the mean of a distribution. High-dimensional statistics relies on more sophisticated methods, often based on optimization, to estimate population parameters. In particular, applied statisticians frequently employ the LASSO estimator [Tib96] to perform regression and variable selection in linear models. It is only recently that researchers have developed theory [KM11, BM12, OTH13, DJM13, JM14, TAH15] that can predict the precise behavior of the LASSO when the data are assumed to be Gaussian. It is a critical methodological challenge to develop universality results that expand the range of models in which we can make confident assertions about the performance of the LASSO. In this section, we prove the first general universality result for the prediction error using a LASSO model estimate. This theory offers a justification for using a LASSO model to make predictions when the data derives from a sparse model. We expect that further developments in this direction will play an important role in applied statistics. 8.1. The Sparse Linear Model and the LASSO. The LASSO is designed to perform simultaneous regression and variable selection in a linear model. Let us present a simple statistical model in which to study the behavior of the LASSO estimator. Suppose that the random variable Y takes the form Y = x · β? + σZ (8.1) where • • • • The deterministic vector β? ∈ Rp of model parameters has at most s nonzero entries. The random vector x ∈ Rp of predictor variables is drawn from Model 2.4. The noise variance σ2 > 0 is known. The statistical error Z is drawn from Model 2.4, independent of x. We interpret x = (X 1 , . . . , X p ) as a family of predictor variables that we want to use to predict the value of the response variable Y . Only the variables X j where (β? ) j 6= 0 are relevant to the prediction, while the others are confounding. The observed value Y of the response is contaminated with a statistical error σZ . These assumptions are idealized, but let us emphasize that our analysis holds even when the predictors and the noise are heavy-tailed. Suppose that we observe independent pairs (x 1 , Y1 ), . . . , (x n , Yn ) drawn from the model above, and let z ∈ Rn be the unknown vector of statistical errors. One of the goals of sparse regression is to use this b ∈ Rp of the model coefficients so that we can predict future responses. data to construct an estimate β That is, given a fresh random vector x 0 of predictor variables, we can predict the (unknown) response Y0 = x 0 · β? + σZ0 using the linear estimate b Yb0 := x 0 · β. We want to control the mean squared error in prediction, which is defined as £ ¤ MSEP := E |Yb0 − Y0 |2 | X , z . (8.2) Using the statistical model (8.1), it is easy to verify that £ ¤ b − β? ) + σZ0 |2 | X , z = kβ b − β? k2 + σ2 . MSEP = E |x 0 · (β (8.3) In other words, the prediction error is controlled by the squared error in estimating the model coefficients. b of the model coefficients. The estimator The LASSO uses convex optimization to produce an estimate β is chosen arbitrarily from the set of solutions to the problem minimize p β∈R kX β − yk2 subject to kβk`1 ≤ kβ? k`1 . (8.4) 32 S. OYMAK AND J. A. TROPP Mean Squared Error in Prediction (MSEP), LASSO Estimate, 16-Sparse Model in R 64 10 Asymptotic Theory Rademacher (empirical) 20% Nonzero Rademacher (empirical) Student t with 5 dof (empirical) Empirical MSEP / Variance 9 8 7 6 5 4 3 2 1 0 40 50 60 70 80 90 100 Number of Subjects (n) F IGURE 8.1: Universality of the LASSO Prediction Error. This plot shows the MSEP (8.2) obtained with the LASSO estimator (8.4), averaged over design matrices X and statistical errors z. In the linear model (8.1), the number of predictors p = 64; the number of active predictors s = 16; each nonzero coefficient (β? ) j in the model has unit magnitude; the statistical error Z is Gaussian; the variance σ2 = 1; and the number n of subjects varies. The dashed line marks the location of the phase transition for the number of subjects required to identify the model exactly when the noise variance is zero. The gray curve delineates the asymptotic upper bound n/(n − pψ`1 (s/p)) for the normalized MSEP from Proposition 8.1. The markers give an empirical estimate (over 100 trials) for the MSEP when the design matrix X has the specified distribution. In this formula, the rows of the n × p matrix X are the observed predictor vectors x i . The entries of the vector y ∈ Rn are the measured responses. For simplicity, we also assume that we have the exact side information kβ? k`1 . We can prove the following result on the squared error in the LASSO estimate of the sparse coefficient model. This is the first universal statement that offers a precise analysis for this class of statistical models. Proposition 8.1 (Universality of LASSO Prediction Error). Instate the prevailing notation. Choose parameters λ ∈ (0, 1) and % ∈ (0, 1) and ι ∈ (0, 1). Assume that • The number n of subjects is sufficiently large as a function of the parameters. • The number p of predictors satisfies λp ≤ n ≤ p 6/5 . • The number n of subjects satisfies n ≥ (1 + %) pψ`1 (s/p). With high probability over the observed data, the mean squared error in prediction (8.2) satisfies MSEP ≤ (1 + ι) σ2 n . n − pψ`1 (s/p) (8.5) The function ψ`1 is defined in (5.2). Furthermore, the bound (8.5) is sharp when n À pψ`1 (s/p) or when σ2 → 0. Proposition 8.1 gives an upper bound for the MSEP, which matches the low-noise limit (σ → 0) obtained in the Gaussian case [OTH13]. See Figure 8.1 for a numerical experiment that confirms our theoretical predictions. The proof of the result appears below in Section 8.2. The assumptions in Proposition 8.1 are somewhat restrictive, in that the number n of subjects must be roughly comparable with the number p of predictors. This condition can probably be relaxed, but the error bound in Theorem II does not allow for a stronger conclusion. The argument can also be extended to give even more precise formulas for the MSEP under the same assumptions. We also note that there is nothing special about the `1 constraint in (8.4); similar results are valid for many other convex constraints. UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 33 8.2. Proof of Proposition 8.1. Without loss of generality, we may assume that the statistical model is scaled so the noise level σ = 1. Define the sublevel set E of the `1 norm at the true parameter vector β? : © ª E := u ∈ Rp : kβ? + uk`1 ≤ kβ? k`1 . Note£that E¤ is a compact, convex set that contains the origin. Define the n × (p + 1) random matrix Φ := X z , and note that Φ also follows Model 2.4. Making the change of variables u := β − β? , we can rewrite the LASSO problem (8.4) in the form ° · ¸° ° u ° °. minimize ° Φ (8.6) ° ° −1 u∈E This expression depends on the assumption that σ = 1. Let ub be an optimal point of the problem (8.6). b 2 leads to a formula for the MSEP. Referring to (8.3), we see that a formula for kuk It will be helpful to introduce some additional sets. For a parameter α > 0, define the compact (but typically nonconvex) set © ª E α := u ∈ E : kuk = α . We also define the compact and convex set © ª E ≤α := u ∈ E : kuk ≤ α . Observe that E α ⊂ E ≤α . Furthermore, α ≤ α+ implies (1/α+ )E α+ ⊂ (1/α)E α . (8.7) The inclusion (8.7) holds because E is convex and contains the origin. Let R ∞ be a constant that depends only on the parameters % and ι. Suppose that 0 ≤ R ≤ R + ≤ R ∞ . To b < R + , it suffices to establish the inequality prove that kuk ° · ¸° ° · ¸° ° ° ° u ° ° < min °Φ u ° . min ° Φ (8.8) ° ° ° −1 −1 ° u∈E ≤R u∈E R+ Indeed, recall that ub is the minimizer of the objective over E , and let u 0 be the point in E ≤R where the left-hand minimum in (8.8) is attained. The objective is a convex function of u, so it does not decrease as b ≥ R + , this line segment muss pass through E R+ , which is u traverses the line segment from ub to u 0 . If kuk impossible because the ordering (8.8) forces the objective to decrease on the way from E R+ to u 0 . Fix the parameter R in the range 0 ≤ R ≤ R ∞ ; we will select a suitable value later. Theorem II(b) demonstrates that, with high probability, ° · ¸° ° ¡ ¢ ¡ ¢ p p u ° ° ≤ En E ≤R × {−1} + o( n) ≤ En E R × {−1} + o( n). min ° Φ ° ° −1 u∈E ≤R The second relation holds because the excess width decreases with respect to set inclusion. Observe that ¡ ¢ ¡p ¢ En E R × {−1} = E inf n(kt k2 + 1)1/2 + g · t t ∈E R p = n(R 2 + 1)1/2 − E sup g · t t ∈E R ¡ ¢ p = n(R 2 + 1)1/2 − R W (1/R)E R . The last identity holds when we factor out kt k and identify the Gaussian width (3.7). Fix the second parameter R + , such that R ≤ R + ≤ R ∞ . Theorem II(a) demonstrates that, with high probability, ° · ¸° ° ¡ ¢ p u ° ° ≥ En E R × {−1} − o( n). min ° Φ + ° ° −1 u∈E R+ Much as before, we calculate the excess width: ¡ ¢ p ¡ ¢ En E R+ × {−1} = n(R +2 + 1)1/2 − R + W (1/R + )E R+ ¡ ¢ p 2 ≥ n(R + + 1)1/2 − R + W (1/R)E R . 34 S. OYMAK AND J. A. TROPP The last inequality holds because of (8.7) and the fact that the Gaussian width is increasing with respect to set inclusion. Combine the last four displays to reach ° · ¸° ° ¡ ¢ p p u ° ° ≤ n(R 2 + 1)1/2 − R W (1/R)E R + o( n) min ° Φ ° ° −1 u∈E ≤R ° · ¸° ° ¡ ¢ p p u ° 2 °. ≤ n(R + + 1)1/2 − R + W (1/R)E R − o( n) ≤ min ° Φ ° −1 ° u∈E R+ It follows that we can establish (8.8) by finding parameters for which 0 ≤ R ≤ R + ≤ R ∞ and ¡ ¢¤ ¡ ¢¤ £p £p p 2 n(R + + 1)1/2 − R + W (1/R)E R − n(R 2 + 1)1/2 − R W (1/R)E R ≥ o( n). To that end, we replace the Gaussian width by a number that does not depend on the parameter R: ¡ ¢ ¡ ¢ ¡ ¢ W 2 (1/R)E R ≤ δ (1/R)E R ≤ δ cone(E ) ≤ pψ`1 (s/p) =: d . The first relation is (3.8); the second follows from Definition 3.4; the last is the estimate (5.4). Moreover, these bounds are sharp when R is sufficiently close to zero. Therefore, we just need to verify that hp p i hp p i p 2 n(R + + 1)1/2 − R + d − n(R 2 + 1)1/2 − R d ≥ o( n). (8.9) Once we choose R and R + appropriately, we can adapt the analysis in the proof of Proposition 7.6. For α ≥ 0, introduce the function p p f (α) := n(α2 + 1)1/2 − α d . As in the proof of Proposition 7.6, by direct calculation, f is minimized at the value R := d . n −d ¡ ¢ Note that R is very close to zero when n À d , in which case d is an accurate bound for W 2 (1/R)E R . Furthermore, p f (R) = n − d . (8.10) Now, make the selection d + ιn . (8.11) n −d Since n ≥ (1 + %) d , we see that R + is bounded by a constant R ∞ that depends only on ι and %. Repeating the calculation in (7.8), mutatis mutandis, we have 1 + ι/2 p f (R + ) ≥ p n − d. (8.12) 1+ι 2 R+ := (1 + ιn/d )R 2 = Combining (8.10) and (8.12), we determine that p p 1 + ι/2 − 1 + ι p n − d ≥ o( n). f (R + ) − f (R) ≥ p 1+ι The last inequality holds because ι is a fixed positive constant and we have assumed that n ≥ (1 + %)d . In conclusion, we have confirmed the claim (8.9) for R and the value R + designated in (8.11). It follows b ≤ R + with high probability. that (8.8) holds with high probability, and so the optimizer of (8.6) satisfies kuk Therefore, the formula (8.2) for the mean squared error yields the bound n 2 b 2 + 1 ≤ R+ MSEP = kuk + 1 = (1 + ι) . n −d Once again, we have used the assumption that σ = 1. By homogeneity, the MSEP must be proportional to σ2 , which leads to the stated result (8.5). Finally, if we allow σ → 0 with the other parameters fixed, the analysis here can be adapted to show that the error bound (8.5) is sharp. UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 35 Remark 8.2 (Prior Work). In the special case of a standard normal design X and a standard normal error z, the result of Proposition 8.1 appeared in the paper [OTH13]. Our extension to more general random models is new. Nevertheless, our proof has a lot in common with the analysis in [OTH13, TAH15]. 36 S. OYMAK AND J. A. TROPP Part III. Universality of the Restricted Minimum Singular Value: Proofs of Theorem II and Theorem I(a) In this part of the paper, we present a detailed proof of the universality law for the restricted singular value of a random matrix, Theorem II, and the first part of the universality law for the embedding dimension, Theorem I(a). Section 9 contains our main technical result, which establishes universality for the bounded random matrix model, Model 2.1. Section 10 extends the result for bounded random matrices to the heavy-tailed random matrix model, Model 2.4. In Section 10.2, we obtain Theorem II as an immediate consequence of the result for heavy-tailed matrices. Section 10.3 shows how to derive Theorem I(a) as an additional consequence. The remaining sections in this part lay out the calculations that undergird the result for bounded random matrices. 9. T HE R ESTRICTED S INGULAR VALUES OF A B OUNDED R ANDOM M ATRIX The key challenges in establishing universality for the restricted minimum singular value are already present in the case where the random matrix is drawn from the bounded model, Model 2.1. This section presents a universality law for bounded random matrices, and it gives an overview of the calculations that are required to establish this result. 9.1. Theorem 9.1: Main Result for the Bounded Random Matrix Model. The main technical result in this paper is a theorem on the behavior of the restricted minimum singular value of a bounded random matrix. Theorem 9.1 (RSV: Bounded Random Matrix Model). Place the following assumptions: • Let m and n be natural numbers with m ≤ n 6/5 . • Let T be a closed subset of the unit ball Bn in Rn . • Draw an m × n random matrix Φ from Model 2.1 with bound B . Then the squared restricted singular value σ2min (Φ; T ) has the following properties: p (1) The squared restricted singular value concentrates about its mean on a scale of B 2 m + n. For each ζ ≥ 0, © ª 2 P σ2min (Φ; T ) ≤ E σ2min (Φ; T ) − CB 2 ζ ≤ e−ζ /m , and p ª © 2 P σ2min (Φ; T ) ≥ E σ2min (Φ; T ) + CB 2 ζ ≤ Ce−ζ /(m+ζ n) . (2) The expectation of the squared restricted singular value is bounded below in terms of the excess width: ¡ ¢2 E σ2min (Φ; T ) ≥ Em (T ) + − CB 2 (m + n)0.92 . (3) If T is a convex set, the squared restricted singular value is bounded above in terms of the excess width: ¡ ¢2 E σ2min (Φ; T ) ≤ Em (T ) + + CB 4 (m + n)0.94 . Furthermore, the entries of Φ need not be symmetric for this result to hold. The proof of this result will occupy us for the rest of this part of the paper. This section summarizes the required calculations, with cross-references to the detailed arguments. 9.2. Proof of Theorem 9.1(1): Concentration. Theorem 9.1(1) states that the squared restricted singular value σ2min (Φ; T ) concentrates around its mean. We prove this claim in Proposition 11.1, which appears below. The argument depends on some concentration inequalities that are derived using the entropy method. This approach is more or less standard, so we move on to the more interesting part of the proof. UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 37 9.3. Setup for Proof of Theorem 9.1(2) and (3): Dissection of the Index Set. Let us continue with the proof of Theorem 9.1, conclusions (2) and (3). The overall approach is the same in both cases, but some of the details differ. The first step is to dissect the index set T into appropriate subsets. For each set J ⊂ {1, . . . , n}, we introduce a closed subset T J of T via the rule © ª T J := t ∈ T : |t j | ≤ (#J )−1/2 for all j ∈ J c , (9.1) where J c := {1, . . . , n} \ J . In other words, T J contains all the vectors in T where the coordinates listed in J c are sufficiently small. Note that convexity of the set T implies convexity of each subset T J . Fix a number k ∈ {1, . . . , n}. Since T is a subset of the unit ball Bn , every vector t ∈ T satisfies © ª # j : |t j | > k −1/2 ≤ k. Therefore, t belongs to some subset T J where the cardinality #J = k, and we have the decomposition [ T = #J =k T J . (9.2) It is clear that the number of subsets T J in this decomposition satisfies à ! ³ en ´k n #{T J : #J = k} = ≤ . k k (9.3) We must limit the cardinality k of the subsets, so we can control the number of subsets we need to examine. 9.4. Proof of Theorem 9.1(2): Lower Bound for the RSV. Let us proceed with the proof of Theorem 9.1(2), the lower bound for the RSV. For the time being, we fix the parameter k that designates the cardinality of the sets J . We require that k ≥ m 2/3 . First, we pass from the restricted singular value σmin (Φ; T ) over the whole set T to a bound that depends on σmin (Φ; T J ) for the subsets T J . Proposition 12.2 gives the comparison q E σ2min (Φ; T ) ≥ min E σ2min (Φ; T J ) − CB 2 km log(n/k). (9.4) #J =k We have used the decomposition (9.2) and the bound (9.3) on the number of subsets in the decomposition to invoke the proposition. The main ingredient in the proof of this estimate is the concentration inequality for restricted singular values, Proposition 11.1. Let us focus on a specific subset T J . To study the restricted singular value σmin (Φ; T J ), we want to replace the entries of the random matrix Φ with standard normal random variables. Proposition 13.1 allows us to make partial progress toward this goal. Let Γ be an m×n standard normal matrix, independent from Φ. Define an m × n random matrix Ψ := Ψ(J ) where Ψ J = Φ J and Ψ J c = Γ J c . Then E σ2min (Φ; T J ) ≥ E σ2min (Ψ; T J ) − CB 2 m 1/3 n log(mn) k 1/2 . (9.5) This bound requires the assumption that k ≥ m 2/3 . The argument is based on the Lindeberg exchange principle, but we have used this method in an unusual way. For a vector t ∈ T J , the definition (9.1) gives us control on the magnitude of the entries listed in J c , which we can exploit to replace the column submatrix Φ J c with Γ J c . The coordinates of t listed in J may be large, so we cannot replace the column submatrix Φ J without incurring a significant penalty. Instead, we just leave it in place. Next, we want to compare the expected RSV on the right-hand side of (9.5) with the excess width of the set T J . Proposition 14.1 provides the bound ³ p ´2 ³ p ´2 E σ2min (Ψ; T J ) ≥ Em (T J ) − CB 2 k ≥ Em (T ) − CB 2 k . (9.6) + + The second inequality is a consequence of the facts that T J ⊂ T and that the excess width is decreasing with respect to set inclusion. The calculation in Proposition 14.1 uses the Gaussian Minimax Theorem (see 38 S. OYMAK AND J. A. TROPP Fact A.3) to simplify the average with respect to the standard normal matrix Γ. We also invoke standard results from nonasymptotic random matrix theory to control the expectation over Φ J . We can obtain a simple lower bound on the last term in (9.6) by linearizing the convex function (·)2+ at the point Em (T ): ³ p p ¡ p ´2 ¡ ¡ ¢2 ¢2 ¢ (9.7) Em (T ) − CB 2 k ≥ Em (T ) + − CB 2 k Em (T ) + ≥ Em (T ) + − CB 2 km. + The last estimate follows from the observation that ¢ p ¡p ¢ ¡p Em (T ) = E inf m kt k + g · t ≤ E m kt0 k + g · t0 ≤ m. t ∈T (9.8) In this calculation, t 0 is an arbitrary point in T . Finally, we sequence the four displays (9.4), (9.5), (9.6), and (9.7) and combine error terms to obtain q ¡ ¢2 CB 2 m 1/3 n log(mn) 2 E σ2min (Φ; T ) ≥ Em (T ) + − − CB km log(n/k). k 1/2 Up to logarithms, an optimal choice of the cardinality parameter is k = dm −1/6 ne. Since m ≤ n 6/5 , this choice ensures that k ≥ m 2/3 . We conclude that ¡ ¢2 E σ2min (Φ; T ) ≥ Em (T ) + − CB 2 m 5/12 n 1/2 log(mn) ¡ ¢2 ≥ Em (T ) + − CB 2 (m + n)11/12 log(m + n). Combine the logarithm with the power, and adjust the constants to complete the proof of Theorem 9.1(2). 9.5. Proof of Theorem 9.1(3): Upper Bound for the RSV of a Convex Set. At a high level, the steps in the proof of Theorem 9.1(3) are similar with the argument in the last section. Many of the technical details, however, depend on convex duality arguments. As before, we fix the cardinality parameter k, with the requirement k ≥ m 2/3 . The first step is to pass from σmin (Φ; T ) to σmin (Φ; T J ). We have E σ2min (Φ; T ) ≤ min E σ2min (Φ; T J ). #J =k (9.9) This bound is a trivial consequence of the facts that T J ⊂ T for each subset J of {1, . . . , n} and that σmin (Φ; ·) is decreasing with respect to set inclusion. Select any subset T J . We invoke Proposition 13.1 to exchange most of the entries of the random matrix Φ for standard normal variables. Using the same random matrix Ψ from the last section, we have E σ2min (Φ; T J ) ≤ E σ2min (Ψ; T J ) + CB 2 m 1/3 n log(mn) . (9.10) k 1/2 The bound (9.10) requires the assumption k ≥ m 2/3 , and the proof is identical with the proof of the lower bound (9.5). Next, we compare the expected RSV on the right-hand side of (9.10) with the excess width. Proposition 14.1 delivers ³ p ´2 E σ2min (Ψ; T J ) ≤ Em (T J ) + CB 2 k . (9.11) + This argument is more complicated than the analogous lower bound (9.6), and it depends on the convexity of T J . We also apply the assumption that k ≥ m 2/3 here. Proposition 12.1 allows us to replace the excess width of T J in (9.11) with the excess width of T : q (9.12) Em (T J ) ≤ Em (T ) + C k log(n/k). We use the decomposition (9.2) and the bound (9.3) on the number of sets T J to invoke the proposition. This proof depends on the Gaussian concentration inequality. Sequence the bounds (9.9), (9.10), (9.11), and (9.12), and combine the error terms to arrive at q ³ ´2 CB 2 m 1/3 n log(mn) E σ2min (Φ; T ) ≤ Em (T ) + CB 2 k log(n/k) + . + k 1/2 UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 39 Expand the square using (9.8) to reach E σ2min (Φ; T ) ≤ Em (T ) ¡ ¢2 + + CB 2 µ m 1/3 n log(mn) k 1/2 ¶ q 2 + km log(n/k) + B k log(n/k) . Select k = dn 4/5 e to arrive at ¡ ¢2 E σ2min (Φ; T ) ≤ Em (T ) + + CB 2 (m 1/3 n 3/5 + n 2/5 m 1/2 ) log(n) + CB 4 n 4/5 log(mn) ¡ ¢2 ≤ Em (T ) + + CB 4 (m + n)14/15 log(m + n). Combine the power with the logarithm, and adjust constants to finish the proof of Theorem 9.1(3). 10. T HE R ESTRICTED S INGULAR VALUES OF A H EAVY-TAILED R ANDOM M ATRIX In this section, we present an extension of Theorem 9.1 to the heavy-tailed matrix model, Model 2.4. In Section 10.2, we explain how the universality result for the restricted singular value, Theorem II, is an immediate consequence. In Section 10.3, we show how to derive the first half of the universality result for the embedding dimension, Theorem I(a). 10.1. Corollary 10.1: Main Result for the p-Moment Random Matrix Model. We can extend Theorem 9.1 to the heavy-tailed random matrix model, Model 2.4 using a truncation argument. The following corollary contains a detailed statement of the result. Corollary 10.1 (RSV: p-Moment Random Matrix Model). Fix parameters p > 4 and ν ≥ 1. Place the following assumptions: • Let m and n be natural numbers with m ≤ n 6/5 . • Let T be a closed subset of the unit ball Bn in Rn . • Draw an m × n random matrix Φ that satisfies Model 2.4 with given p and ν. Then the restricted singular value σmin (Φ; T ) has the following properties: (1) With high probability, the restricted singular value is bounded below by the excess width: © ¡ ¢ ª P σmin (Φ; T ) ≤ Em (T ) + − Cp ν(m + n)1/2−κ(p) ≤ Cp (m + n)1−p/4 . (10.1) (2) If T is a convex set, with high probability, the restricted singular value is bounded above by the excess width: © ¡ ¢ ª P σmin (Φ; T ) ≥ Em (T ) + + Cp ν2 (m + n)1/2−κ(p) ≤ Cp (m + n)1−p/4 . (10.2) The function κ(p) is strictly positive for p > 4, and the constant Cp depends only on p. The proof of Corollary 10.1 appears below in Section 15. The main idea is to truncate each entry of the heavy-tailed random matrix Φ individually. We can treat the bounded part of the random matrix using Theorem 9.1. We show that the tails are negligible by means of a relatively simple norm bound for random matrices, Fact B.2. 10.2. Proof of Theorem II from Corollary 10.1. Theorem II is an easy consequence of Corollary 10.1. Recall the assumptions of the theorem: • • • • The embedding dimension satisfies λD ≤ d ≤ D 6/5 . E is a closed subset of the unit ball in RD . p The d -excess width of E satisfies Ed (E ) ≥ % d . The d × D random linear map Π follows Model 2.4 with parameters p > 4 and ν ≥ 1. Therefore, we may apply Corollary 10.1 with Φ = Π and T = E to see that © ¡ ¢ ª P σmin (Π; E ) ≤ Ed (E ) + − Cp ν(d + D)1/2−κ(p) ≤ Cp D 1−p/4 , and © ¡ ¢ ª P σmin (Π; E ) ≥ Ed (E ) + + Cp ν2 (d + D)1/2−κ(p) ≤ Cp D 1−p/4 if E is convex. 40 S. OYMAK AND J. A. TROPP For simplicity, we have dropped the embedding dimension d from the right-hand side of the bounds in the last display. To prove Theorem II, it suffices to check that we can make the error term Cp ν2 (d + D)1/2−κ(p) smaller than εEd (E ) if we select the ambient dimension D large enough. Indeed, the conditions D ≤ λ−1 d and d 1/2 ≤ %−1 Ed (E ) ensure that (d + D)1/2−κ(p) ≤ (1 + λ−1 )1/2 d 1/2−κ(p) ≤ (1 + λ−1 )1/2 %−1 Ed (E )d −κ(p) (1 + λ−1 )1/2 %−1 λ−κ(p) Ed (E ) D κ(p) Since κ(p) is positive, there is a number N := N (p, ν, λ, %, ε) for which D ≥ N implies ≤ Cp ν2 (d + D)1/2−κ(p) ≤ εEd (E ). This is what we needed to show. 10.3. Proof of Theorem I(a) from Corollary 10.1. Theorem I(a) is also an easy consequence of Corollary 10.1. Recall the assumptions of the theorem: • E is a compact subset of RD that does not contain the origin. • The statistical dimension of E satisfies δ(E ) ≥ %D. • The d × D random linear map Π follows Model 2.4 with parameters p > 4 and ν ≥ 1. In this section, we consider the regime where the embedding dimension d ≥ (1 + ε) δ(E ). We need to demonstrate that P {0 ∉ Π(E )} = P {E ∩ null(Π) = ;} ≥ 1 − Cp D 1−p/4 . (10.3) We begin with a reduction to a specific choice of the embedding dimension d . Let Πm be the m × D matrix formed from the first m rows of the random linear map Π. The function m 7→ P {E ∩ null(Πm ) = ;} is weakly increasing because m 7→ null(Πm ) is a decreasing sequence of sets. Therefore, it suffices to verify (10.3) in the case where d = d(1 + ε) δ(E )e. Note that d ≤ 2D + 1 because the statistical dimension δ(E ) ≤ D and ε < 1. Introduce the spherical retraction Ω := θ(E ). Proposition 3.8 and (3.2) demonstrate that σmin (Π; Ω) > 0 implies 0 ∉ Π(Ω) implies 0 ∉ Π(E ). Therefore, to check (10.3), it suffices to produce a high-probability lower bound on the restricted singular value σmin (Π; Ω). With the choices Φ = Π and T = Ω, Corollary 10.1 yields © ¡ ¢ ª P σmin (Π; Ω) ≥ Ed (Ω) + − Cp ν(d + D)1/2−κ(p) ≥ 1 − Cp D 1−p/4 . To complete the proof, we need to verify that our hypotheses imply Ed (Ω) > Cp ν(d + D)1/2−κ(p) . This point follows from two relatively short calculations. Since Ω is a subset of the unit sphere, we quickly compute ite excess width: p ¡p ¢ p Ed (Ω) = E inf d kxk + g · x ≥ d − δ(Ω) x∈Ω p p ¡p ¢p = d − δ(E ) ≥ 1 + ε − 1 δ(E ). (10.4) (10.5) The second identity holds because Ω is a subset of the unit sphere, and we have used the relation (4.3). Recall that the statistical dimension of a general set E is defined as δ(E ) = δ(θ(E )), and then introduce the value d = d(1 + ε) δ(E )e of the embedding dimension. Meanwhile, we can bound the dimensional term in (10.4) above: p (d + D)1/2−κ(p) ≤ CD 1/2−κ(p) ≤ C%−1/2 D −κ(p) δ(E ). UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 41 The first inequality holds because d ≤ 2D + 1, and the second inequality uses the assumption D ≤ %−1 δ(E ). Since κ(p) is positive, we can find a number N := N (p, ν, %, ε) for which D ≥ N implies that ¢p ¡p Cp ν(d + D)1/2−κ(p) < 1 + ε − 1 δ(E ). Combine the last display with (10.5) to determine that the claim (10.4) is valid. 11. T HEOREM 9.1: C ONCENTRATION FOR R ESTRICTED S INGULAR VALUES In this section, we demonstrate that the restricted minimum singular value of a bounded random matrix concentrates about its mean value. This result yields Theorem 9.1(1). Proposition 11.1 (Theorem 9.1: Concentration). Let S be a closed subset of Bn . Let Φ be an m × n random matrix drawn from Model 2.1 with uniform bound B . For all ζ ≥ 0, © ª 2 P σ2min (Φ; S) ≤ E σ2min (Φ; S) − CB 2 ζ ≤ e−ζ /m (11.1) p © 2 ª 2 P σmin (Φ; S) ≥ E σ2min (Φ; S) + CB 2 ζ ≤ e−ζ /(m+ζ n) . (11.2) The proof relies on some modern concentration inequalities that are derived using the entropy method. We establish the bound (11.1) on the lower tail in Section 11.1; the bound (11.2) on the upper tail appears in Section 11.2. In several other parts of the paper, we rely on variants of Proposition 11.1 that follow from essentially the same arguments. We omit the details of these proofs to avoid repetition. 11.1. Proposition 11.1: The Lower Tail of the RSV. First, we establish that the restricted singular value is unlikely to be much smaller than its mean. The proof depends on an exponential moment inequality derived using Massart’s modified logarithmic Sobolev inequality [Mas00]. For instance, see [BLM13, Thm. 6.27] or [Mau12, Thm. 19]. Fact 11.2 (Self-Bounded Random Variable: Lower Tail). Let (X 1 , . . . , X p ) be an independent sequence of real random variables. For a nonnegative function f : Rp → R+ , define Y := supi Y := f (X 1 , . . . , X i −1 , X i , X i +1 , . . . , X p ), sup α∈supp(X i ) and f (X 1 , . . . , X i −1 , α, X i +1 , . . . , X p ) for i = 1, . . . , p. Suppose that ∆− := Then, for ζ ≥ 0, Xp ¡ i =1 supi Y − Y ¢2 ≤ aY + b where a, b ≥ 0. ¶ −ζ2 /2 . a EY +b The function supp(·) returns the support of a random variable. P {Y ≤ E Y − ζ} ≤ exp µ With this fact at hand, we may derive the lower tail bound. Proof of Proposition 11.1, Eqn. (11.1). Introduce the random variable ´2 Xm ³Xn Y := σ2min (Φ; S) = min kΦsk2 = min i =1 ϕ s . j =1 i j j s∈S s∈S (i j ) For each index pair (i , j ) and real number α, define a random matrix Φα by replacing the (i , j ) entry ϕi j of Φ with the number α. Now, the random variable ¡ (i j ) ¢ (i j ) supi j Y = max σ2min Φα ; S = max min kΦα sk2 . |α|≤B |α|≤B s∈S We must evaluate the lower variance proxy Xm Xn ¡ ¢2 ∆− := i =1 j =1 supi j Y − Y . 42 S. OYMAK AND J. A. TROPP To that end, select a point t ∈ arg mins∈S kΦsk2 . For each index pair (i , j ), (i j ) (i j ) supi j Y − Y = max min kΦα sk2 − min kΦsk2 ≤ max kΦα t k2 − kΦt k2 . |α|≤B s∈S s∈S |α|≤B (i j ) The matrix Φα differs from Φ only in the i th row. Therefore, when we expand the squared norms into components, all of the components cancel except for the i th one. We discover that ³¡ Xn ¢2 ¡ Xn ¢2 ´ supi j Y − Y ≤ max (α − ϕi j )t j + `=1 ϕi ` t ` − ϕi ` t ` `=1 |α|≤B ³ ´ Xn = max (α − ϕi j )2 t 2j + 2(α − ϕi j )t j `=1 ϕi ` t ` |α|≤B (11.3) ³ ¯Xn ¯´ ≤ max (α − ϕi j )2 t 2j + 2 |α − ϕi j | |t j | ¯ `=1 ϕi ` t ` ¯ |α|≤B ¯Xn ¯ ≤ 4B 2 t 2j + 4B |t j | ¯ `=1 ϕi ` t ` ¯ . The last inequality holds because |α| ≤ B and |ϕi j | ≤ B . As a consequence, ¯Xn ¯ ´2 ¢2 ³ ¢2 ¡ ¡Xn supi j Y − Y ≤ 4B 2 t 2j + 4B |t j | ¯ `=1 ϕi ` t ` ¯ ≤ 32B 4 t 4j + 32B 2 t 2j ϕ t . `=1 i ` ` Sum over pairs (i , j ) to arrive at Xm Xn ¡ ¢2 Xm Xn ³ ¡Xn ¢2 ´ 4 4 2 2 sup Y − Y ≤ 32B t + 32B t ϕ t ij j j i =1 j =1 i =1 j =1 `=1 i ` ` X X ¡ ¢2 m n ≤ 32B 4 m + 32B 2 i =1 ϕ t `=1 i ` ` = 32B 4 m + 32B 2 kΦt k2 = 32B 4 m + 32B 2 min kΦsk2 . s∈S To reach the second line, we used the fact that kt k`4 ≤ kt k ≤ 1. The last line depends on the definition of t . In summary, we have demonstrated that ∆− ≤ 32B 2 Y + 32B 4 m. To apply Fact 11.2, we need a bound for the expectation of Y . Designate a point s 0 ∈ S, and calculate that E Y ≤ E kΦs 0 k2 = m ks 0 k2 ≤ m. The identity holds because Φ has independent, standardized entries. Fact 11.2 ensures that ¶ µ ¶ µ −ζ2 /2 −ζ2 P {Y ≤ E Y − ζ} ≤ exp ≤ exp . 32B 2 E Y + 32B 4 m 128B 4 m  Rewrite this formula to complete the proof of (11.1). 11.2. Proposition 11.1: The Upper Tail of the RSV. Next, we establish that the restricted singular value of a bounded random matrix is unlikely to be much larger than its mean. The proof depends on another tail inequality for self-bounded random variables. This result also follows from Massart’s modified log-Sobolev inequality [Mas00]; the argument is similar to the proofs of [Mau12, Thms. 18, 19] Fact 11.3 (Self-Bounded Random Variable: Upper Tail). Let (X 1 , . . . , X p ) be an independent sequence of real random variables. For a function f : Rp → R, define Y := supi Y := f (X 1 , . . . , X i −1 , X i , X i +1 , . . . , X p ), sup α∈supp(X i ) and f (X 1 , . . . , X i −1 , α, X i +1 , . . . , X p ) for i = 1, . . . , p. Suppose that supi Y − Y ≤ L uniformly for a fixed value L and that Xp ¡ ¢2 ∆− := i =1 supi Y − Y ≤ aY + b where a, b ≥ 0. UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 43 Then, for ζ ≥ 0, ¶ −ζ2 /2 . (a E Y + b) + (a + L)ζ The function supp(·) returns the support of a random variable. P {Y ≥ E Y + ζ} ≤ exp µ Proof of Proposition 11.1, Eqn. (11.2). We proceed as in the proof of (11.1). It just remains to verify the uniform bound on supi j Y − Y . Starting from (11.3), we calculate that ¯Xn ¯ supi j Y − Y ≤ 4B 2 t 2j + 4B |t j | ¯ `=1 ϕi l t ` ¯ ¡Xn ¢1/2 ≤ 4B 2 + 4B ϕ2 `=1 i ` p ≤ 4B 2 + 4B 2 n p ≤ 8B 2 n. This calculation relies on the fact that kt k ≤ 1 and the entries of Φ have magnitude bounded by B . Apply Fact 11.3 to complete the argument.  12. T HEOREM 9.1: P ROBABILITY B OUNDS FOR D ISSECTIONS In this section, we establish some results that compare the expectation of a minimum of random variables indexed by a set with the expectations of the minima indexed by subsets. These facts are easy consequences of concentration phenomena. 12.1. Dissection of the Excess Width. First, we show that the excess width of a set can be related to the excess width of a collection of subsets. Proposition 12.1 (Theorem 9.1: Dissection of Excess Width). Consider a closed subset T of the unit ball Bn that has been decomposed into a finite number of closed subsets T J : [ T = J ∈J T J . For each m ≥ 0, it holds that q ³ ¢´ ¡p ¢ ¡p ≥ min E min m kt k + g · t − C log(#J ). E min m kt k + g · t t ∈T + J ∈J t ∈T J In other words, q ¡ ¢ ¡ ¢ min Em (T J ) + ≤ Em (T ) + + C log(#J ). J ∈J Proof. Since T = S J ∈J T J , we can stratify the minimum over T : ¡p ¢ ¡p ¢ min m kt k + g · t = min min m kt k + g · t . J ∈J t ∈T J t ∈T We will obtain a lower tail bound for the minimum over T by combining lower tail bounds for each minimum over T J . Then we integrate the tail probability to obtain the required expectation bound. Each subset T J is contained in Bn , so the map ¡p ¢ g 7→ min m kt k + g · t t ∈T J is 1-Lipschitz. The Gaussian concentration inequality, Fact A.2, provides a tail bound. For each J ∈ J and for each λ ≥ 0, ½ ¾ ¡p ¢ ¡p ¢ 2 P min m kt k + g · t ≤ E min m kt k + g · t − λ ≤ e−λ /2 . t ∈T J t ∈T J Apply the union bound over J ∈ J to see that, for all ζ ≥ 0, ½ ¾ ¢ ¡p ¢ q ¡p P min m kt k + g · t ≤ min E min m kt k + g · t − 2 log(#J ) − ζ t ∈T J ∈J t ∈T J 44 S. OYMAK AND J. A. TROPP ≤ (#J )e−( p 2 log(#J )+ζ)2 /2 ≤ e−ζ 2 /2 . Using the latter estimate, we quickly compute the excess width of T . Abbreviate ¡p ¢ ¢ q ¡p Y := min m kt k + g · t and α := min E min m kt k + g · t − 2 log(#J ). J ∈J t ∈T t ∈T J If α ≤ 0, the stated result is trivial, so we may assume that α > 0. The integration by parts representation of the expectation yields Z α Z α Z α Z α p 2 (E Y )+ ≥ P {Y > ζ} dζ = P {Y > α − ζ} dζ = α − P {Y ≤ α − ζ} dζ ≥ α − e−ζ /2 dζ > α − π/2. 0 0 0 0 Reintroduce the values of Y and α, and combine constants to complete the argument.  12.2. Dissection of the Restricted Singular Value. Next, we show that the minimum singular value of a random matrix, restricted to a set, is controlled by the minimum singular value, restricted to subsets. Proposition 12.2 (Theorem 9.1: Dissection of RSV). Consider a closed subset T of the unit ball Bn , and assume that it has been decomposed into a finite number of closed subsets T J : [ T = J ∈J T J . Let Φ be an m × n random matrix that satisfies Model 2.1 with uniform bound B . Then q min E σ2min (Φ; T J ) ≤ E σ2min (Φ; T ) + CB 2 m log(#J ). J ∈J Proof. The argument is similar with the proof of Proposition 12.1. Since T = S J ∈J TJ , σ2min (Φ; T ) = min kΦt k2 = min min kΦt k2 = min σ2min (Φ; T J ). J ∈J t ∈T J t ∈T J ∈J The lower tail bound (11.1) for restricted singular values implies that, for all λ ≥ 0, © ª 2 4 P σ2min (Φ; T J ) ≤ E σ2min (Φ; T J ) − λ ≤ e−λ /(CB m) . Next, we take a union bound. For all ζ ≥ 0, ½ ¾ q 2 2 4 P σmin (Φ; T ) ≤ min E σmin (Φ; T J ) − CB m log(#J ) − ζ J ∈J p 4 2 4 2 4 ≤ (#J )e−( CB m log(#J )+ζ) /(CB m) ≤ e−ζ /(CB m) . Define a random variable Y and a constant α: Y := σ2min (Φ; T ) and α := min E σ2min (Φ; T J ) − J ∈J q CB 4 m log(#J ). If α ≤ 0, the stated result is trivial, so we may assume that α > 0. Calculating as in Proposition 12.1, EY ≥ α Z 0 P {Y > ζ} dζ = α Z 0 P {Y > α − ζ} dζ Z = α− Simplify this bound to complete the proof. α 0 P {Y ≤ α − ζ} dζ ≥ α − Z 0 α e−ζ 2 /(CB 4 m) p dζ ≥ α − CB 2 m.  UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 45 13. T HEOREM 9.1: R EPLACING M OST E NTRIES OF THE R ANDOM M ATRIX In this section, we show that it is possible to replace most of the entries of a random matrix Φ with standard normal random variables without changing the restricted singular value σmin (Φ; T J ) very much. Proposition 13.1 (Theorem 9.1: Partial Replacement). Let Φ be an m × n random matrix that satisfies Model 2.1 with magnitude bound B . Let J be a subset of {1, . . . , n} with cardinality k, and let T J be a closed subset of Bn for which t ∈ T J implies |t j | ≤ k −1/2 for each index j ∈ J c . (13.1) Define an m × n random matrix Ψ where ΨJ = ΦJ Assuming that k ≥ m 2/3 and Ψ J c = Γ J c . , we have ¯ ¯ ¯ ¯ ¯E min kΦt k2 − E min kΨt k2 ¯ ¯ ¯ t ∈T J t ∈T J ≤ (13.2) CB 2 m 1/3 n log(mn) k 1/2 . (13.3) Equivalently, ¯ 2 ¯ ¯E σ (Φ; T J ) − E σ2 (Ψ; T J )¯ min min ≤ CB 2 m 1/3 n log(mn) k 1/2 . As usual, Γ is an m × n standard normal matrix. The hypothesis (13.1) is an essential ingredient in the proof of Proposition 13.1. Indeed, we can only exchange the elements of the random matrix Φ in the columns indexed by J c because we depend on the uniform bound k −1/2 to control the replacement errors. 13.1. Proof of Proposition 13.1. The proof of Proposition 13.1 involves several steps, so it is helpful to give an overview before we begin in earnest. Throughout this discussion, the index set J is fixed. Let ε ∈ (0, 1) be a discretization parameter. The first step in the argument is to replace the index set T J by a finite subset T Jε with cardinality log(#T Jε ) ≤ n log(3/ε). We obtain the bounds ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ 2 2¯ 2 2¯ (13.4) ¯E min kΦt k − E minε kΦt k ¯ ≤ 2mnε and ¯E min kΨt k − E minε kΨt k ¯ ≤ 2mnε. ¯ t ∈T J ¯ ¯ t ∈T J ¯ t ∈T J t ∈T J See Lemma 13.2 for details, which are quite standard. Next, we introduce a smoothing parameter β > 0, and we define the soft-min function: X 2 1 F : Rm×n → R where F (A) := − log t ∈T ε e−βkAt k . J β (13.5) It is advantageous to work with the soft-min because it is differentiable. Lemma 13.3 demonstrates that we pay only a small cost for passing to the soft-min: ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ 2 −1 ε 2 (13.6) ¯E minε kΦt k − E F (Φ)¯ ≤ β log(#T J ) and ¯E minε kΨt k − E F (Ψ)¯ ≤ β−1 log(#T Jε ). ¯ t ∈T J ¯ ¯ t ∈T J ¯ This argument is also standard. Finally, we compare the expectation of the soft-min, evaluated at each of the random matrices: |E F (Φ) − E F (Ψ)| ≤ C(βB 4 + β2 B 6 )mn . (13.7) k 3/2 Lemma 13.4 encapsulates the this argument, which is based on the Lindeberg principle (Fact 13.6, below). The idea is to replace one entry of Φ J c at a time with the corresponding entry of Ψ J c , which is a Gaussian random variable. We lose very little with each exchange because the function F is smooth and the vectors in T Jε are bounded on the coordinates in J c . 46 S. OYMAK AND J. A. TROPP Combine the relations (13.4), (13.6), and (13.7) to obtain an estimate for the total error: ¯ ¯ 4 2 6 ¯ ¯ ¯E min kΦt k2 − E min kΨt k2 ¯ ≤ Cmnε + Cβ−1 n log(1/ε) + C(βB + β B )mn . ¯ t ∈T ¯ t ∈T k 3/2 J J We used the fact that log #(T Jε ) ≤ n log(3/ε) in the smoothing term. It remains to identify appropriate values for the parameters. Select ε = (mn)−1 so the discretization error is negligible. We choose the smoothing parameter so that β3 = k 3/2 /(B 6 m). In summary, ¯ ¯ 2 2/3 2 1/3 ¯ ¯ ¯E min kΦt k2 − E min kΨt k2 ¯ ≤ C + CB m n + CB m n log(mn) . ¯ t ∈T ¯ t ∈T J k k 1/2 J Since B ≥ 1 and m 2/3 ≤ k ≤ n, the third term dominates. This is the bound stated in (13.3). 13.2. Proposition 13.1: Discretizing the Index Set. The first step in the proof of Proposition 13.1 is to replace the set T J with a finite subset T Jε without changing the restricted singular values of Φ and Ψ substantially. Lemma 13.2 (Proposition 13.1: Discretization). Adopt the notation and hypotheses of Proposition 13.1. Fix a parameter ε ∈ (0, 1]. We can construct a subset T Jε of T J with cardinality log(#T Jε ) ≤ n log(3/ε) that has the property ¯ ¯ ¯ ¯ ¯ 2 2¯ (13.8) ¯E min kΦt k − E minε kΦt k ¯ ≤ 2mnε. ¯ ¯ t ∈T J t ∈T J Furthermore, the bound (13.8) holds if we replace Φ by Ψ. Proof. We choose the discretization T Jε to be an ε-covering of T J with minimal cardinality. That is, T Jε ⊂ T J and max minε kt ε − t k ≤ ε. t ∈T J t ε ∈T J Since Vol(T J ) ≤ Vol(Bn ), we can use a classic volumetric argument to ensure that the covering satisfies #T Jε ≤ (3/ε)n . For example, see [Ver12, Lem. 5.2]. When we replace the set T J with the covering T Jε , we incur a discretization error. We establish the error bound for Φ; the argument for Ψ is identical. Since T Jε ⊂ T J , it is immediate that E min kΦt k2 ≤ E minε kΦt k2 . t ∈T J t ∈T J We claim that ¡ ¢ E minε kΦt k2 ≤ E min kΦt k2 + 2ε E kΦk2 . t ∈T J Since Φ has standardized entries, t ∈T J (13.9) E kΦk2 ≤ E kΦk2F = mn, where k·kF denotes the Frobenius norm. Combine the last three displays to verify (13.8). It is quite easy to establish the claim (13.9). For all s, t ∈ T J , we have ¡ ¢ ¡ ¢ kΦsk2 − kΦt k2 = kΦsk + kΦt k · kΦsk − kΦt k ¡ ¢ ≤ kΦk ksk + kt k · kΦ(s − t )k ≤ 2 kΦk2 ks − t k . We have used standard norm inequalities and the fact that T J is a subset of the unit ball. Now, let t ? ∈ arg mint ∈T J kΦt k2 , and let t ε be a point in T Jε for which kt ε − t ? k ≤ ε. Then ¡ ¢ min kΦt k2 = kΦt ? k2 = kΦt ε k2 − kΦt ε k2 − kΦt ? k2 t ∈T ≥ minε kΦt k2 − 2 kΦk2 kt ε − t ? k t ∈T J ≥ minε kΦt k2 − 2ε kΦk2 . t ∈T J UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 47  Taking expectations, we arrive at (13.9). 13.3. Proposition 13.1: Smoothing the Minimum. The second step in the proof of Proposition 13.1 is to pass from the restricted minimum singular value over the discrete set T Jε to a smooth function. We rely on an exponential smoothing technique that is common in the mathematical literature on statistical physics. Lemma 13.3 (Proposition 13.1: Smoothing the Minimum). Adopt the notation and hypotheses of Proposition 13.1, and let T Jε be the set introduced in Lemma 13.2. Fix a parameter β > 0, and define the soft-min function F via (13.5) Then ¯ ¯ ¯ ¯ 1 ¯ ¯ (13.10) ¯E minε kΦt k2 − E F (Φ)¯ ≤ log(#T Jε ). ¯ t ∈T J ¯ β The bound (13.10) also holds if we replace Φ by Ψ. Proof. This result follows from trivial bounds on the sum in the definition (13.5) of the soft-min function F . The summands are nonnegative, so the sum exceeds its maximum term. Thus, X 2 2 log t ∈T ε e−βkAt k ≥ log maxε e−βkAt k = −β minε kAt k2 . J t ∈T J t ∈T J Similarly, the sum does not exceed the number of summands times the maximum term, so ³ ´ X 2 2 log t ∈T ε e−βkAt k ≤ log (#T Jε ) maxε e−βkAt k = log(#T Jε ) − β minε kAt k2 . J t ∈T J t ∈T J Combine the last two displays and multiply through by the negative number −1/β to reach X 2 1 1 minε kAt k2 − log(#T Jε ) ≤ − log t ∈T ε e−βkAt k ≤ minε kAt k2 . J t ∈T J t ∈T J β β Replace A by the random matrix Φ and take the expectation to reach (13.10). Similarly, we can take A = Ψ to obtain the result for Ψ.  13.4. Proposition 13.1: Exchanging the Entries of the Random Matrix. The last step in the proof of Proposition 13.1 is the hardest. We must demonstrate that the expectation E F (Φ) of the soft-min function does not change very much when we replace the submatrix Φ J c with the submatrix Ψ J c . Lemma 13.4 (Proposition 13.1: Exchanging Entries). Adopt the notation and hypotheses of Proposition 13.1; let T Jε be the set described in Lemma 13.2; and let F be the soft-min function (13.5) with parameter β > 0. Then C(βB 4 + β2 B 6 )mn |E F (Φ) − E F (Ψ)| ≤ . (13.11) k 3/2 The random matrix Ψ is defined in (13.2). Proof. We establish the lemma by replacing the rows of the random matrix Φ by the rows of the random matrix Ψ one at a time. For each i = 1, 2, . . . , m + 1, let Ξ(i ) be the random matrix whose first i − 1 rows are drawn from Ψ and whose remaining rows are drawn from Φ. By construction, Ξ(1) = Φ and Ξ(m + 1) = Ψ. It follows that Xm ¯ ¡ ¢ ¡ ¢¯ |E F (Φ) − E F (Ψ)| ≤ i =1 ¯E F Ξ(i ) − E F Ξ(i + 1) ¯ . We will demonstrate that 4 2 6 ¯ ¡ ¢ ¡ ¢¯ ¯E F Ξ(i ) − E F Ξ(i + 1) ¯ ≤ C(βB + β B )n for i = 1, . . . , m. (13.12) k 3/2 Combining the last two displays, we arrive at the bound (13.11). Fix an index i . By construction, the random matrices Ξ(i ) and Ξ(i + 1) are identical, except in the i th row. To perform the estimate (13.12), it will be convenient to suppress the dependence of the function F on the remaining rows. To that end, define the functions X 2 1 f i : Rn → R via f i (a) := − log t ∈T ε e−β(a·t ) +qi (t ) J β 48 S. OYMAK AND J. A. TROPP where q i : Rn → R via q i (t ) := −β hX j <i (ψ j · t )2 + X j >i i (ϕ j · t )2 . We have written ϕ j and ψ j for the j th rows of Φ and Ψ. With these definitions, ¡ ¢ ¡ ¢ ¡ ¢ ¡ ¢ F Ξ(i ) = f i ϕi and F Ξ(i + 1) = f i ψi . Therefore, the inequality (13.12) is equivalent with ¯ ¡ ¢ ¡ ¢¯¯ C(βB 4 + β2 B 6 )n ¯ ¯E f i ϕi − E f i ψi ¯ ≤ k 3/2 for i = 1, . . . , m. (13.13) Since the matrix Φ is drawn from Model 2.1, the random vector ϕi contains independent, standardized entries whose magnitudes are bounded by B . Meanwhile, the form (13.2) of the matrix Ψ shows that the random vector ψi coincides with ϕi on the components indexed by J , while the entries of ψi indexed by J c are independent standard normal variables. Sublemma 13.5, below, contains the proof of the inequality (13.13).  13.4.1. Lemma 13.4: Comparison Principle for One Row. To complete the argument in Lemma 13.4, we need to control how much a certain function changes when we replace some of the entries of its argument with standard normal variables. The following result contains the required calculation. Sublemma 13.5 (Lemma 13.4: Comparison for One Row). Adopt the notation and hypotheses of Proposition 13.1, and let T Jε be the set defined in Lemma 13.3. Introduce the function f : Rn → R given by f (a) := − X 2 1 log t ∈T ε e−β(a·t ) +q(t ) , J β where q : T Jε → R is an arbitrary function. Suppose that ϕ ∈ Rn is a random vector with independent, standardized entries that are bounded in magnitude by B . Suppose that ψ ∈ Rn is a random vector with ψJ = ϕJ and ψ J c = γ J c , n where γ ∈ R is a standard normal vector. Then 4 2 6 ¯ ¯ ¯E f (ϕ) − E f (ψ)¯ ≤ C(βB + β B )n . k 3/2 (13.14) The proof of Sublemma 13.5 is based on a modern interpretation [MOO10, Cha06, KM11] of the Lindeberg exchange principle [Lin22, Tro59, Rot73]. It is similar in spirit with examples from the paper [KM11]. We apply the following version of the Lindeberg principle, which is adapted from these works. Fact 13.6 (Lindeberg Exchange Principle). Let r : R → R be a function with three continuous derivatives. Let ϕ and ψ be standardized random variables, not necessarily independent, with three finite moments. Then · ¸ ¯ ¯ ¯ ¯ ¯ ¯ ¯E r (ϕ) − E r (ψ)¯ ≤ 1 E |ϕ|3 max ¯r 000 (α)¯ + |ψ|3 max ¯r 000 (α)¯ . |α|≤|ϕ| |α|≤|ψ| 6 The proof of Fact 13.6 involves nothing more than a third-order Taylor expansion of r around the origin. The first- and second-order terms cancel because the random variables ϕ and ψ have mean zero and variance one. With this inequality at hand, we may proceed with the proof of the sublemma. Proof of Sublemma 13.5. Without loss of generality, assume that the index set J = {1, . . . , k}. Indeed, the entries of the random matrix Φ are independent, standardized, and uniformly bounded so it does not matter which set J of columns we distinguish. This choice allows more intuitive indexing. For each fixed index j ∈ {k + 1, . . . , n}, define the interpolating vector ξ j : R → Rn where ξ j (α) := (ϕ1 , . . . , ϕ j −1 , α, ψ j +1 , . . . , ψn ). Introduce the function ¡ ¢ r j : R → R where r j (α) := f ξ j (α) . UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 49 Observe that ¯ ¯ ¯X ¯ ¯ ¡ ¢ ¡ ¢¯¯ Xn ¯E f (ϕ) − E f (ψ)¯ = ¯¯ n E f ξ (ϕ ) − E f ξ (ψ ) ¯ ≤ j =k+1 ¯E r j (ϕ j ) − E r j (ψ j )¯ . j j j j j =k+1 The first identity holds because the sum telescopes. Fact 13.6 shows that · ¯ ¯ ¯ ¯¸ ¯ ¯ ¯E r j (ϕ j ) − E r j (ψ j )¯ ≤ 1 E |ϕ j |3 max ¯¯r 000 (α)¯¯ + |ψ j |3 max ¯¯r 000 (α)¯¯ . |α|≤|ϕ j | j |α|≤|ψ j | j 6 We claim that, for each index j ∈ {k + 1, . . . , n}, · ¯ ¯¸ ¯ 000 ¯ 3 E |ϕ j | max ¯r j (α)¯ ≤ C(βB 4 + β2 B 6 )k −3/2 , |α|≤|ϕ j | · ¯ ¯¸ ¯ 000 ¯ 3 E |ψ j | max ¯r j (α)¯ ≤ C(βB 4 + β2 B 6 )k −3/2 . and (13.15) |α|≤|ψ j | Once we establish the bound (13.15), we can combine the last three displays to reach ¯ ¯ ¯E f (ϕ) − E f (ψ)¯ ≤ C(βB 4 + β2 B 6 )k −3/2 (n − k). The main result (13.14) follows. To establish (13.15), fix an index j ∈ {k + 1, . . . , n}. The forthcoming Sublemma 13.7 will demonstrate that à ! ¯ ¯ ¯ 0 ¯3 ³ ¯ ¯ ¯ ¯3 ´ ¯ 000 ¯ ¯ ¯ β Ev ¯ξ j (α) · v ¯ + β2 Ev ¯ξ j (α) · v ¯ (13.16) ¯r j (α)¯ ≤ C maxε ξ (α) · t t ∈T J ∈ T Jε In this expression, v immaterial. Note that is a random vector that is independent from ξ j ; the precise distribution of v is ¯ ¯3 maxε ¯ξ0 (α) · t ¯ = maxε |t j |3 ≤ k −3/2 . t ∈T J (13.17) t ∈T J Indeed, the derivative ξ0j (α) = e j , where e j is the j th standard basis vector. The last inequality holds because the conditions T Jε ⊂ T J and j ∈ J c allow us to invoke the assumption (13.1). We arrive at the following bound on the quantity of interest from (13.15): · µ · ¸ · ¸¶ ¯ ¯¸ ¯ ¯ ¯ ¯3 ¯ 000 ¯ 3 −3/2 3 2 3 ¯ ¯ ¯ ¯ E |ϕ j | max ¯r j (α)¯ ≤ Ck β E |ϕ j | max ξ j (α) · v + β E |ϕ j | max ξ j (α) · v . (13.18) |α|≤|ϕ j | |α|≤|ϕ j | |α|≤|ϕ j | ¯ ¯ We have merged the bounds (13.16) and (13.17) to control ¯r j (α)¯. Next, we invoked Jensen’s inequality to draw the expectation over v out of the maximum over α. Last, we combined the expectations to reach (13.18). It remains to bound the expectations on the right-hand side. Let us begin with the term in (13.18) that is linear in β. In view of the identity ξ j (α) = αe j + ξ j (0), · ¸ · ¸ ¯ ¯ ¯ ¯¢ ¡ E |ϕ j |3 max ¯ξ j (α) · v ¯ ≤ E |ϕ j |3 max |αv j | + ¯ξ j (0) · v ¯ |α|≤|ϕ j | |α|≤|ϕ j | ¯¢ £ ¤ ¡ ¢¡ ¯ = E |ϕ j |4 |v j | + E |ϕ j |3 E ¯ξ j (0) · v ¯ (13.19) ≤ B 4 k −1/2 + B 3 . We used the assumption that ϕ j is independent from ξ j (0) to factor the expectation in the second term in the second line. The bounds in the third line exploit the fact that |ϕ j | ≤ B and, via the hypothesis (13.1), the fact that v ∈ T J . We also relied on the estimate ¯X ¯ X ¯ ¯ ¯ ¯ E ¯ξ j (0) · v ¯ = E ¯ i < j ϕi v i + i > j ψi v i ¯ ≤ kv k ≤ 1 Indeed, Jensen’s inequality allows us to replace the expectation with the second moment, which simplifies to kv k because {ϕ1 , . . . , ϕ j −1 , ψ j +1 , . . . , ψn } is an independent family of standardized random variables. Since v ∈ T J , the norm kv k does not exceed one. 50 S. OYMAK AND J. A. TROPP Continuing to the term in (13.18) that is quadratic in β2 , we pursue the same approach to see that · ¸ · ¸ ³ ¯ ¯ ¯3 ¯3 ´ 3 3 ¯ 3 ¯ ¯ ¯ E |ϕ j | max ξ j (α) · v ≤ C E |ϕ j | max |αv j | + ξ j (0) · v |α|≤|ϕ j | |α|≤|ϕ j | (13.20) ¡ 6 −3/2 ¢ 6 ≤C B k +B . This bound relies on the Khintchine-type inequality ³ ¯ ¯3 ´1/3 E ¯ξ j (0) · v ¯ ≤ CB kv k ≤ CB. For example, see [Ver12, Cor. 5.12]. We remark that this estimate could be improved if we had additional information about the distribution of the entries of Φ. Substituting the bounds (13.19) and (13.20) into (13.18), we obtain · ¯ ¯¸ £ ¡ ¢ ¡ ¢¤ ¯ 000 ¯ 3 E |ϕ j | max ¯r j (α)¯ ≤ Ck −3/2 β B 4 k −1/2 + B 3 + β2 B 6 k −3/2 + B 6 |α|≤|ϕ j | ≤ C(βB 4 + β2 B 6 )k −3/2 . This establishes the first branch of the claim (13.15). The second branch follows from a similar argument, where we use explicit values for the moments of a standard normal variable instead of the uniform upper bound B .  13.4.2. Sublemma 13.5: Derivative Calculations. The final obstacle in the proof of Proposition 13.1 is to bound the derivatives that are required in Sublemma 13.5. This argument uses some standard methods from statistical physics, and it is similar with the approach in the paper [KM11]. Sublemma 13.7 (Sublemma 13.5: Derivatives). Adopt the notation and hypotheses of Proposition 13.1 and Sublemma 13.5. Let ξ : R → Rn be a linear function, so its derivative ξ0 ∈ Rn is a constant vector. Define the function X ¡ ¢ 2 1 r (α) := f ξ(α) = − log t ∈T ε e−β(ξ(α)·t ) +q(t ) J β where q : T Jε → R is arbitrary. The third derivative of this function satisfies à ! ¯ 000 ¯ ¯ ¯ ¡ ¢ ¯r (α)¯ ≤ 48 max ¯ξ0 · t ¯3 β Ev |ξ(α) · v | + β2 Ev |ξ(α) · v |3 . t ∈T Jε In this expression, v ∈ T Jε is a random vector that is independent from ξ(α). Proof. Introduce a (parameterized) probability measure µα on the set T Jε : µα (t ) := 1 −β(ξ(α)·t )2 +q(t ) e Zα where Zα := X t ∈T Jε e−β(ξ(α)·t ) 2 +q(t ) . We treat the normalizing factor Zα as a function of α, and we write its derivatives as Zα0 , Zα00 , Zα000 . It is convenient to use the statistical mechanics notation for expectation with respect to this measure. For any function h : T Jε → R, X 〈h(t )〉 := t ∈T ε h(t )µα (t ). J For brevity, we always suppress the dependence of 〈·〉 on the parameter α. We often suppress the dependence of ξ on α as well. The function r is proportional to the logarithm of the normalizing factor Zα : 1 r (α) = − log Zα . β Thus, it is straightforward to express the third derivative of r in terms of the derivatives of Zα : à µ ¶00 µ ¶0 µ 0 ¶3 ! Zα0 Zα00 Z 1 Zα0 1 Zα00 (Zα0 )2 1 Zα000 000 r (α) = − =− − =− −3 +2 α . 2 β Zα β Zα β Z Z Z Zα Zα α α α UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 51 By direct calculation, the derivative Zα0 satisfies Zα0 1 X 0 −β(ξ(α)·t )2 +q(t ) ε (−2β)(ξ · t )(ξ(α) · t )e Zα Zα t ∈T J ­ ® = −2β (ξ0 · t )(ξ · t ) . = The second derivative is Zα00 £ ¤ 1 X 0 2 2 0 2 2 −β(ξ(α)·t )2 +q(t ) e ε (−2β)(ξ · t ) + (2β) (ξ · t ) (ξ(α) · t ) t ∈T J Zα Zα ­ ® ­ ® = −2β (ξ0 · t )2 + 4β2 (ξ0 · t )2 (ξ · t )2 . = The third derivative is Zα000 Zα £ ¤ 1 X 2 0 3 3 0 3 3 −β(ξ(α)·t )2 +q(t ) e ε 12β (ξ · t ) (ξ(α) · t ) − 8β (ξ · t ) (ξ(α) · t ) t ∈T J Zα ­ ® ­ ® = 12β2 (ξ0 · t )3 (ξ · t ) − 8β3 (ξ0 · t )3 (ξ · t )3 = We ascertain that £ ­ ® ­ ®­ ®¤ r 000 (α) = β − 12 (ξ0 · t )3 (ξ · t ) + 12 (ξ0 · t )2 (ξ0 · t )(ξ · t ) ®­ ®3 ¤ £ ­ ® ­ ® ­ + β2 8 (ξ0 · t )3 (ξ · t )3 − 24 (ξ0 · t )(ξ · t ) (ξ0 · t )2 (ξ · t )2 + 16 (ξ0 · t )(ξ · t ) . (13.21) This completes the calculation of the exact form of the third derivative of r . Next, we simplify the formula (13.21) using basic probability inequalities for the expectation 〈·〉. First, consider the terms that are linear in β. Observe that E ³ ¯­ 0 3 ¯ ¯ ¯ ´ ®¯ D¯ ¯ (ξ · t ) (ξ · t ) ¯ ≤ ¯ξ0 · t ¯3 |ξ · t | ≤ max ¯ξ0 · t ¯3 〈|ξ · t |〉 . ε t ∈T J Indeed, Jensen’s inequality allows us to draw the absolute value inside the average, and we can invoke Hölder’s inequality to pull out the maximum of the first term. Similarly, since 〈1〉 = 1, ¯­ 0 2 ® ­ 0 ¯ ¯3 ´ ®¯ ³ ¯ (ξ · t ) (ξ · t )(ξ · t ) ¯ ≤ maxε ¯ξ0 · t ¯ 〈|ξ · t |〉 t ∈T J Next, consider the terms that are quadratic in β. The simplest is ¯­ 0 3 ¯ ¯ ´­ ®¯ ³ ® ¯ (ξ · t ) (ξ · t )3 ¯ ≤ max ¯ξ0 · t ¯3 |ξ · t |3 . ε t ∈T J Using Jensen’s inequality, we find that ¯­ ³ ¯ ¯3 ´ ¯ ¯3 ´ ­ ®3 ¯¯ ³ ® ¯ 0 |ξ · t |3 . ¯ (ξ · t )(ξ · t ) ¯ ≤ maxε ¯ξ0 · t ¯ 〈|ξ · t |〉3 ≤ maxε ¯ξ0 · t ¯ t ∈T J t ∈T J Last, using Lyapunov’s inequality twice, ¯­ 0 ¯ ¯ ´ ¯ ¯ ´­ ®­ ®¯ ³ ­ ® ³ ® ¯ (ξ · t )(ξ · t ) (ξ0 · t )2 (ξ · t )2 ¯ ≤ max ¯ξ0 · t ¯3 〈|ξ · t |〉 |ξ · t |2 ≤ max ¯ξ0 · t ¯3 |ξ · t |3 . ε ε t ∈T J t ∈T J Introduce the last five displays into (13.21) to arrive at the bound ¯ ¯ ´¡ ¯ 000 ¯ ³ ­ ®¢ ¯r (α)¯ ≤ max ¯ξ0 · t ¯3 24β 〈|ξ · t |〉 + 48β2 |ξ · t |3 . ε t ∈T J (13.22) Last, we want to replace the averages with respect to µα by averages with respect to a simpler probability measure that does not depend on ξ(α). This argument relies on a correlation inequality. Define another probability measure µ∗ on the set T Jε : µ∗ (t ) := 1 q(t ) e Z∗ where Z∗ := X t ∈T Jε eq(t ) . 52 S. OYMAK AND J. A. TROPP Write 〈·〉∗ for averages with respect to this new measure. First, consider the average 1 X −β(ξ·t )2 +q(t ) ε |ξ · t | e Zα t ∈T J Z∗ 1 X −β(ξ·t )2 q(t ) = e ε |ξ · t | e Zα Z∗ t ∈T J E 2 Z∗ D |ξ · t | e−β(ξ·t ) . = ∗ Zα 〈|ξ · t |〉 = Let X := |ξ · t | be the random variable obtained by pushing forward the measure µ∗ from T Jε to the nonnegative real line. Since x 7→ x is increasing and x 7→ exp(−βx 2 ) is decreasing, Chebyshev’s association inequality [BLM13, Thm. 2.14] provides that D E D E 2 2 Zα 1 X −β(ξ·t )2 +q(t ) |ξ · t | e−β(ξ·t ) = 〈|ξ · t |〉∗ . ≤ 〈|ξ · t |〉∗ e−β(ξ·t ) = 〈|ξ · t |〉∗ εe ∗ ∗ Z∗ t ∈T J Z∗ In summary, 〈|ξ · t |〉 ≤ 〈|ξ · t |〉∗ . (13.23) ­ ® ­ ® |ξ · t |3 ≤ |ξ · t |3 ∗ . (13.24) The same argument shows that Introduce (13.23) and (13.24) into the bound (13.22) to reach the inequality ³ ¯ ¯3 ´ ¡ ­ ® ¢ r 000 (α) ≤ 48 maxε ¯ξ0 · t ¯ β 〈|ξ · t |〉∗ + β2 |ξ · t |3 ∗ . t ∈T J The statement of the result follows when we reinterpret the averages with respect to µ∗ as expectations with respect to a random vector v ∈ T Jε with distribution Z∗−1 e−q(t ) .  14. T HEOREM 9.1: B OUNDING THE R ESTRICTED S INGULAR VALUE BY THE E XCESS W IDTH In Section 13, we showed that the restricted singular value σmin (Φ; T J ) of the random matrix Φ does not change very much if we replace Φ with a hybrid matrix Ψ, defined in (13.2), that contains many standard normal random variables. Our next goal is to relate the restricted singular value σmin (Ψ; T J ) of the hybrid matrix to the excess width of the set T J . Proposition 14.1 (Theorem 9.1: Excess Width Bound). Let Φ be an m × n random matrix from Model 2.1 with magnitude bound B , and let Γ be an m ×n random matrix with independent, standard normal entries. Let J be a subset of {1, . . . , n} with cardinality k, and let T J be a closed subset of Bn . Introduce the m × n random matrix Ψ := Ψ(J ) from (13.2). Then p ´2 ° °2 ³ E σ2min (Ψ; T J ) = E min °Φ J t J + Γ J c t J c ° ≥ Em (T J ) − CB 2 k . (14.1) t ∈T J + Furthermore, if T J is convex and k ≥ m 1/2 , p ´2 ° °2 ³ E σ2min (Ψ; T J ) = E min °Φ J t J + Γ J c t J c ° ≤ Em (T J ) + CB 2 k . t ∈T J + (14.2) To obtain this result, we will invoke the Gaussian Minimax Theorem [Gor85, Gor88] to reduce the random matrix bounds to simpler bounds involving random vectors. This approach has been used to study the ordinary singular values of a Gaussian matrix [DS01, Sec. 2.3]. It also plays a role in the analysis of restricted singular values of Gaussian matrices [Sto13, OTH13, TOH15]. The application here is complicated significantly by the presence of the non-Gaussian matrix Φ J . UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 53 14.1. Proof of Proposition 14.1. The proof of Proposition 14.1 involves several steps, so it is helpful once again to summarize the calculations that are required. First, let us explain the process by which we obtain the lower bound for a general closed subset T J of the Euclidean unit ball Bm . We will argue that µ ¶ ° °2 ° ° 2 ° ° ° ° E min Φ J t J + Γ J c t J c ≥ E min Φ J t J + Γ J c t J c (Jensen) t ∈T J t ∈T J + µ ¶2 ° ¡° ¢ ° ° ≥ E min Φ J t J + h kt J c k + g J c · t J c − 2 t ∈T J (Lemma 14.5) + µ ¶ p 2 ¢ ¡p 2 c c ≥ E min m kt k + g J · t J − CB k t ∈T J (Lemma 14.7) + µ ¶ p 2 ¡p ¢ ≥ E min m kt k + g · t − CB 2 k t ∈T J ³ p ´2 = Em (T J ) − CB 2 k . (Lemma 14.8) + (Definition 4.2) + In the first line, we pass from the expected square to the square of the expectation, which reduces the technical complexity of the rest of the argument. Next, we replace the m × n Gaussian matrix Γ with an expectation over two independent standard normal vectors h ∈ Rm and g ∈ Rn . Third, we remove the remaining piece Φ J of the original random matrix to arrive at a formula involving only the random vector g . Finally, we replace the missing coordinates in the random vector g to obtain a bound in terms of the excess width Em (T J ). We arrive at the inequality (14.1). The upper bound follows from a similar calculation. Assuming that T J is convex, we may calculate that µ ¶2 ° °2 ° ° 1/4 ° ° ° ° E min Φ J t J + Γ J c t J c ≤ E min Φ J t J + Γ J c t J c + CB m (Lemma 14.2) t ∈T J t ∈T J + µ ¶2 ° ¡° ¢ 1/4 ° ° ≤ E min Φ J t J + h kt J c k + g J c · t J c + CB m t ∈T J (Lemma 14.6) + ¶ µ p 2 ¡p ¢ 2 ≤ E min m kt k + g J c · t J c + CB k t ∈T J (Lemma 14.7) + µ ¶ p 2 ¡p ¢ 2 ≤ E min m kt k + g · t + CB k t ∈T J ³ p ´2 = Em (T J ) + CB 2 k . (Lemma 14.9) + + (Definition 4.2) The first step is a type of Poincaré inequality, which requires some specialized concentration results for the restricted singular value of the hybrid matrix. The second step of this chain involves a convex duality argument that is not present in the proof of the lower bound (14.1). We have used the assumption that k ≥ m 1/2 to simplify the error term when we pass from the second line to the third. Altogether, this yields the bound (14.2). 14.2. Proposition 14.1: Moment Comparison Inequality for the Hybrid RSV. We require a moment comparison inequality to pass from the expected square of the restricted singular value of the hybrid matrix to the expectation of the restricted singular value itself. Lemma 14.2 (Proposition 14.1: Moment Comparison). Adopt the notation and hypotheses of Proposition 14.1. Then µ ¶2 ° °2 ° ° 1/4 ° ° ° ° E min Φ J t J + Γ J c t J c ≤ E min Φ J t J + Γ J c t J c + CB m . t ∈T J t ∈T J Proof. Define the random variable ° ° X := min °Φ J t J + Γ J c t J c ° . t ∈T J 54 S. OYMAK AND J. A. TROPP We need a bound for E X 2 . We obtain this result by applying a moment comparison inequality for Φ, conditional on Γ, and then we apply a moment comparison inequality for Γ. Sublemma 14.3, applied conditionally, with the choice A = Γ, gives h¡ £ £ ¤¤ ¢2 i E X 2 = E E X 2 | Γ ≤ E E[X | Γ] + CB m 1/4 . The function Γ 7→ E[X | Γ] + CB m 1/4 is 1-Lipschitz, so the Gaussian variance inequality, Fact A.1, implies that h¡ ¢2 i ¡ ¢2 E E[X | Γ] + CB m 1/4 ≤ E X + CB m 1/4 + 1.  Combine the last two displays, and adjust the constant to complete the proof. The proof of Lemma 14.2 requires a separate moment comparison result for a random variable that depends only on the original matrix Φ J . Sublemma 14.3 (Lemma 14.2: Moment Comparison for Original Matrix). Adopt the notation and hypotheses of Lemma 14.2. For a fixed m × n matrix A, µ ¶2 ° °2 ° ° 1/4 ° ° ° ° c c c c E min Φ J t J + A J t J ≤ E min Φ J t J + A J t J + CB m . (14.3) t ∈T J t ∈T J Proof. Define the random variable ° ° X := min °Φ J t J + A J c t J c ° . t ∈T J First, observe that ¡ ¢ ¡ ¢ ¡ ¢ (E X 2 )1/2 − E X = (E X 2 )1/2 − E X + = E X − (E X 2 )1/2 − ≤ E X − (E X 2 )1/2 − . (14.4) The last inequality is Jensen’s. We can use concentration to bound this quantity. Mutatis mutandis, repeat the proof of equation (11.1) from Proposition 11.1 to see that, for all ζ ≥ 0, © ª 2 P X 2 ≤ E X 2 − CB 2 ζ ≤ e−ζ /m . Invoke the subadditivity of the square root and change variables: © ª 4 P X ≤ (E X 2 )1/2 − CB ζ ≤ e−ζ /m . Jensen’s inequality and integration by parts deliver Z ∞ Z © ª ¡ ¢ 2 1/2 2 1/2 E X − (E X ) P X − (E X ) ≤ −ζ dζ ≤ −= 0 ∞ 0 e−ζ (14.5) 4 /(CB 4 m) dζ ≤ CB m 1/4 . The third inequality follows from (14.5). Introduce the last display into (14.4) to reach (E X 2 )1/2 − E X ≤ CB m 1/4 . Rearrange this relation to complete to proof of (14.3).  14.3. Proposition 14.1: The Role of the Gaussian Minimax Theorem. To prove Proposition 14.1, we must replace the Gaussian matrix in the quantity of interest with a pair of Gaussian vectors. The key to this argument is the following technical result. Lemma 14.4 (Proposition 14.1: Application of Gaussian Minimax Theorem). Adopt the notation and hypotheses of Proposition 14.1. Let A be a fixed m × n matrix, and let g ∈ Rn and h ∈ Rm be independent standard normal random vectors. Then, for all ζ ∈ R, ½ ¾ ½ ¾ ° ° ° ¡° ¢ P min ° A J t J + Γ J c t J c ° ≤ ζ ≤ 2 P min ° A J t J + h kt J c k° + g J c · t J c ≤ ζ . (14.6) t ∈T J t ∈T J Furthermore, if T J is convex and ζ ≥ 0, ½ ¾ ½ ¾ ° ° ° ¡° ¢ ° ° ° ° P min A J t J + Γ J c t J c ≥ ζ ≤ 2 P min A J t J + h kt J c k + g J c · t J c ≥ ζ . t ∈T J If ζ ≤ 0, the left-hand side is trivially equal to one. t ∈T J (14.7) UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 55 This result depends on the Gaussian Minimax Theorem [Gor85]; see Fact A.3 for a statement. Lemma 14.4 is similar with early results of Gordon [Gor88, Cor. 1.2]. The detailed argument here is adapted from [TOH15, Thm. 2.1]; see also Stojnic [Sto13]. Proof. The basic idea is to express the quantity of interest as the value of a saddle-point problem: ° ° ¡ ¢ c tJc . min ° A J t J + Γ J c t J c ° = min max u · A t + Γ J J J m t ∈T J t ∈T J u∈B Then we apply the Gaussian Minimax Theorem to obtain probabilistic lower bounds. When T J is convex, we can also invoke convex duality to interchange the minimum and maximum, which leads to complementary bounds. To proceed with this approach, however, it is convenient to work with a slightly different minimax problem. Define the deterministic function λ(t , u) = u · (A J t J ) for t ∈ T J and u ∈ Bm . Let γ be a standard normal random variable, independent from everything else. Introduce two centered Gaussian processes: X (t , u) := u · (Γ J c t J c ) + kuk kt J c k γ and Y (t , u) := (u · h) kt J c k + kuk (g · t J c ) indexed by t ∈ T J and u ∈ Bm . Let us verify that these processes satisfy the conditions required by the Gaussian Minimax Theorem, Fact A.3. First, for all parameters t ∈ T J and u ∈ Bm , E X (t , u)2 = 2 kuk2 kt J c k2 = E Y (t , u)2 . (14.8) Second, for all parameters t , t 0 ∈ T J and u, u 0 ∈ Bm , ¢ £ ¤ £ ¤ ¡ ¢¡ E X (t , u)X (t 0 , u 0 ) − E Y (t , u)Y (t 0 , u 0 ) = kuk ku 0 k − u · u 0 kt J c k kt J0 c k − t J c · t J0 c . By the Cauchy–Schwarz inequality, £ ¤ £ ¤ E X (t , u)X (t , u 0 ) = E Y (t , u)Y (t , u 0 ) ; £ ¤ £ ¤ E X (t , u)X (t 0 , u) = E Y (t , u)Y (t 0 , u) ; £ ¤ £ ¤ E X (t , u)X (t 0 , u 0 ) ≥ E Y (t , u)Y (t 0 , u 0 ) . (14.9) (14.10) (14.11) The formulas (14.8), (14.9), and (14.11) verify the conditions of the Gaussian Minimax Theorem. Fact A.3 delivers the bound ¾ ½ ¾ ½ ¡ ¢ ¡ ¢ P min max λ(t , u) + X (t , u) > ζ ≥ P min max λ(t , u) + Y (t , u) > ζ . (14.12) m m t ∈T J u∈B t ∈T J u∈B This estimate does involve a small technicality. We can only apply the Gaussian Minimax Theorem to a finite subset of T J × Bm , so we must make an approximation argument to pass to the entire set. We omit the details. Now, let us determine the values of the saddle-point problems in (14.12). First, ¡ ¢ ¡ ¢ min max λ(t , u) + X (t , u) = min max u · (A J t J + Γ J c t J c ) + kuk kt J c k γ m m t ∈T J u∈B t ∈T J u∈B ° ¡° ¢ (14.13) = min ° A J t J + Γ J c t J c ° + kt J c k γ + . t ∈T J Similarly, ° ¡ ¢ ¡° ¢ min max λ(t , u) + Y (t , u) ≥ min ° A J t J + h kt J c k° + g J c · t J c . m t ∈T J u∈B t ∈T J 56 S. OYMAK AND J. A. TROPP Next, we remove the term involving γ from the right-hand side of (14.13). To do so, we condition on γ > 0 and γ ≤ 0 and calculate that ½ ¾ ½ ¾ ° ¡ ¢ ¡° ¢ ° A J t J + Γ J c t J c ° + kt J c k γ > ζ P min max λ(t , u) + X (t , u) > ζ = P min max + t ∈T J u∈Bm t ∈T J u∈Bm ½ ¾ ¯ ° ¡° ¢ 1 1 ¯ ° ° c c c kt k ≤ + P min A J t J + Γ J t J + J γ + > ζ ¯ γ ≤ 0 t ∈T J 2 2 ½ ¾ °¢ ¡° 1 1 ° ° ≤ + P min A J t J + Γ J c t J c + > ζ t ∈T J 2 2 ½ ¾ ° ° 1 1 ° ° = + P min A J t J + Γ J c t J c > ζ . t ∈T J 2 2 On the other hand, ½ ¾ ½ ¾ ° ¡ ¢ ¡° ¢ ° ° P min max λ(t , u) + Y (t , u) > ζ ≥ P min A J t J + h kt J c k + g J c · t J c > ζ . m t ∈T J u∈B t ∈T J Introduce the last two displays into (14.12) to reach ½ ¾ ½ ¾ ° ° ° ¡° ¢ 1 1 ° ° ° ° + P min A J t J + Γ J c t J c > ζ ≥ P min A J t J + h kt J c k + g J c · t J c > ζ . t ∈T J t ∈T J 2 2 Take the complements of both probabilities and rearrange to conclude that (14.6) is correct. The second result (14.7) requires an additional duality argument. If we replace the function λ and the random processes X and Y with their negations, all of the variance calculations above remain valid. In particular, the relations (14.8), (14.10), and (14.11) permit us to apply Fact A.3 with the roles of T J and Bm reversed. This step yields ½ ¾ ½ ¾ ¡ ¢ ¡ ¢ P minm max − λ(t , u) − X (t , u) > −ζ ≥ P minm max − λ(t , u) − Y (t , u) > −ζ . u∈B t ∈T J u∈B t ∈T J Let us examine the saddle-point problems. Since −λ − X is bilinear and the sets Bm and T J are compact and convex, the Sion Minimax Theorem [Sio58] allows us to interchange the minimum and maximum. Thus ¡ ¢ ¡ ¢ minm max − λ(t , u) − X (t , u) = max minm − λ(t , u) − X (t , u) t ∈T J u∈B u∈B t ∈T J ¡ ¢ = − min max λ(t , u) + X (t , u) m t ∈T J u∈B ° ¡° ¢ = − min ° A J t J + Γ J c t J c ° + kt J c k γ + . t ∈T J Similarly, ° ¡ ¢ ¡° ¢ minm max − λ(t , u) − Y (t , u) = − min ° A J t J + h kt J c k° + g J c · t J c + . u∈B t ∈T J t ∈T J Combining the last three displays, we reach ½ ¾ ½ ¾ ° ° ¡° ¢ ¡° ¢ ° ° ° ° P min A J t J + Γ J c t J c + kt J c k γ + < ζ ≥ P min A J t J + h kt J c k + g J c · t J c + < ζ . t ∈T J t ∈T J Proceeding as before, conditioning on the sign of γ, we may remove the dependence on γ from the left-hand side to obtain ½ ¾ ½ ¾ ° ° ° ¡° ¢ ° ° ° ° c c c c c P min A J t J + Γ J t J ≥ ζ ≥ 2P min A J t J + h kt J k + g J · t J + ≥ ζ . t ∈T J t ∈T J Clearly, this inequality is useful only for ζ ≥ 0 in which case the right hand side is equal to ½ ¾ ° ° ° ° c c c 2P min A J t J + h kt J k + g J · t J ≥ ζ . t ∈T J We confirm that (14.7) is true.  UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 57 14.4. Proposition 14.1: Reducing the Gaussian Matrix to Some Gaussian Vectors. Our next goal is to convert the probability bounds from Lemma 14.4 into expectation bounds. Lemma 14.5 gives a lower bound that is valid for every subset T J of the unit ball, and Lemma 14.6 gives an upper bound that is valid when T J is also convex. Lemma 14.5 (Proposition 14.1: Reducing the Gaussian Matrix—Lower Bound). Adopt the notation and hypotheses of Proposition 14.1. Let A be a fixed m × n matrix, and let g ∈ Rn and h ∈ Rm be independent standard normal vectors. Then ° ° ° ¡° ¢ E min ° A J t J + Γ J c t J c ° ≥ E min ° A J t J + h kt J c k° + g J c · t J c − 2. (14.14) t ∈T J t ∈T J In particular, ° ° ° ¡° ¢ E min °Φ J t J + Γ J c t J c ° ≥ E min °Φ J t J + h kt J c k° + g J c · t J c − 2. t ∈T J t ∈T J Proof. We make the abbreviations ° ° X := min ° A J t J + Γ J c t J c ° t ∈T J ° ¡° ¢ and Y := min ° A J t J + h kt J c k° + g J c · t J c . t ∈T J First, note that E Y − E X ≤ (E Y − E X )+ = (E X − E Y )− ≤ E(X − E Y )− . The last inequality is Jensen’s. To bound the right-hand side, we use integration by parts and formula (14.6) from Lemma 14.4: Z ∞ Z ∞ E(X − E Y )− = P {X − E Y ≤ −ζ} dζ ≤ 2 P {Y − E Y ≤ −ζ} dζ = 2 E(Y − E Y )− . 0 0 Finally, we make the estimates E[(Y − E Y )− ] ≤ Var[Y ]1/2 ≤ 1. The last inequality follows from the Gaussian variance inequality, Fact A.1. Indeed, the function (g , h) 7→ Y (g , h) is 1-Lipschitz because the set T J is contained in the unit ball. In summary, E Y − E X ≤ E(X − E Y )− ≤ 2 E(Y − E Y )− ≤ 2.  We arrive the advertised bound (14.14). Lemma 14.6 (Proposition 14.1: Reducing the Gaussian Matrix—Upper Bound). Adopt the notation and hypotheses of Proposition 14.1. Let A be a fixed m × n matrix, and let g ∈ Rn and h ∈ Rm be independent standard normal vectors. Then ° ° ° ¡° ¢ E min ° A J t J + Γ J c t J c ° ≤ E min ° A J t J + h kt J c k° + g J c · t J c + 2. t ∈T J t ∈T J In particular, ° ° ° ¡° ¢ E min °Φ J t J + Γ J c t J c ° ≤ E min °Φ J t J + h kt J c k° + g J c · t J c + 2. t ∈T J t ∈T J Proof. We follow the same pattern as in Lemma 14.5. Using the same notation, we calculate that E X − E Y ≤ (E X − E Y )+ ≤ E(X − E Y )+ ≤ 2 E(Y − E Y )+ ≤ 2. In this case, we invoke (14.7) from Lemma 14.4 to obtain the penultimate inequality.  58 S. OYMAK AND J. A. TROPP 14.5. Proposition 14.1: Removing the Remaining Part of the Original Random Matrix. The next step in the proof of Proposition 14.1 is to remove the remaining section of the random matrix Φ from the bounds in Lemmas 14.5 and 14.6. Lemma 14.7 (Proposition 14.1: Removing the Original Matrix). Adopt the notation and hypotheses of Proposition 14.1. Let X be an m × n random matrix with independent, standardized entries that satisfy Assumption B.1. Then ¯ ¯ p ¯ ° ¢¯ ¡° ¢ ¡p ¯E min ° X J t J + h kt J c k° + g J c · t J c − E min m kt k + g J c · t J c ¯ ≤ CB 2 k. ¯ ¯ t ∈T J t ∈T J In particular, this conclusion is valid when X = Φ. £ ¤ Proof. Abbreviate Ψ := X J h . Observe that ¸ · tJ X J t J + h kt J c k = Ψ kt J c k and °· ¸° ° tJ ° ° ° ° kt J c k ° = kt k . Therefore, we have the deterministic bounds ° ° σmin (Ψ) kt k ≤ ° X J t J + h kt J c k° ≤ σmax (Ψ) kt k . (14.15) The m × (k + 1) random matrix Ψ has independent, standardized entries that satisfy (B.1). For all ζ ≥ 0, Fact B.1 shows that its extreme singular values satisfy the probability bounds n o p p 2 4 P σmax (Ψ) ≥ m + C0 B 2 k + ζ ≤ e−c0 ζ /B , and o n (14.16) p p 2 4 P σmin (Ψ) ≤ m − C0 B 2 k − ζ ≤ e−c0 ζ /B . p These inequalities allow us to treat the singular values of Ψ as if they were equal to m. We may now perform the following estimates: ° ¡° ¢ ¡ ¢ E min ° X J t J + h kt J c k° + g J c · t J c ≤ E min σmax (Ψ) kt k + g J c · t J c t ∈T J t ∈T J ¸ · ¢ ¡ ¡p p ¢ ≤ E min m kt k + g J c · t J c + σmax (Ψ) − m + max kt k t ∈T J t ∈T J ¡p ¢ ¡ p ¢ ≤ E min m kt k + g J c · t J c + E σmax (Ψ) − m + . t ∈T J p The first inequality is (14.15). Then we add and subtract m from the maximum singular value. Last, we p 2 recall that T J is a subset of the unit ball. Set α := C0 B k, and calculate that Z ∞ ¡ © ª p ¢ p E σmax (Ψ) − m + = P σmax (Ψ) − m ≥ ζ dζ Z0 α Z ∞ © ª p (14.17) ≤ dζ + P σmax (Ψ) − m ≥ α + ζ dζ 0 Z ∞ 0 2 4 ≤ α+ e−c0 ζ /B dζ = α + CB 2 . 0 We split the integral at α, and we change variables in the second integral. For the first integral, we use the trivial bound of one on the probability. Then we invoke the probability inequality (14.16). Combining the last two displays and collecting constants, we arrive at p ° ¡° ¢ ¡p ¢ E min ° X J t J + h kt J c k° + g J c · t J c ≤ E min m kt k + g J c · t J c + CB 2 k. t ∈T J t ∈T J An entirely similar argument delivers a matching lower bound. Together, these estimates complete the proof.  UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 59 14.6. Proposition 14.1: Replacing the Coordinates Missing from the Excess Width. The last step in the proof of Proposition 14.1 is to examine the excess-width-like functional from Lemma 14.7 that involves the term g J c · t J c . We must show that this term does not change very much if we reintroduce the coordinates listed in J . Lemma 14.8 gives the easy proof of the lower bound. Lemma 14.9 contains the upper bound. Lemma 14.8 (Proposition 14.1: Missing Coordinates—Lower Bound). Adopt the notation and hypotheses of Proposition 14.1. Then ¢ ¢ ¡p ¡p E min m kt k + g J c · t J c ≥ E min m kt k + g · t . t ∈T J t ∈T J Proof. This result is an immediate consequence of Jensen’s inequality: ¡p ¢ ¢ ¡p E min m kt k + g J c · t J c = E min m kt k + g J c · t J c + Eg J (g J · t J ) t ∈T J t ∈T J ¡p ¢ ≥ E min m kt k + g J c · t J c + g J · t J t ∈T J ¢ ¡p = E min m kt k + g · t t ∈T J We rely on the fact that g J and g J c are independent standard normal vectors.  Lemma 14.9 (Proposition 14.1: Missing Coordinates—Upper Bound). Adopt the notation and hypotheses of Proposition 14.1. Then ¡p ¢ p ¢ ¡p E min m kt k + g J c · t J c ≤ E min m kt k + g · t + k. t ∈T J t ∈T J Proof. This calculation is also easy: ¡p ¢ ¢ ¡p E min m kt k + g J c · t J c = E min m kt k + g · t − g J · t J t ∈T J t ∈T J ≤ E min ¡p ¢ m kt k + g · t + E kg J k ≤ E min ¡p ¢ p m kt k + g · t + k. t ∈T J t ∈T J In the last step, we have used the fact that #J = k.  15. P ROOF OF C OROLLARY 10.1 FROM T HEOREM 9.1 BY T RUNCATION In this section, we show how to establish Corollary 10.1 as a consequence of Theorem 9.1. The proof depends on a truncation argument. 15.1. Proof of Corollary 10.1. Fix parameters p > 4 and ν ≥ 1. Assume that Φ is an m × n matrix that follows Model 2.4 with parameters p and ν. Let T be a compact subset of the unit ball Bn . We will prove the lower bound for the minimum singular value of Φ restricted to T . When T is convex, an entirely similar approach yields the corresponding upper bound. Fix a truncation parameter R that satisfies R p/2−1 ≥ 2νp/2 . Decompose the random matrix Φ as Φ = Φtrunc + Φtail by applying the truncation described below in Lemma 15.1 separately to each entry of Φ. This procedure ensures that Φtrunc contains independent, symmetric, standardized entries, each bounded by 2R. In other words, Φtrunc follows Model 2.1 with B = 2R. The tail Φtail contains independent, centered entries, each with variance bounded by Cνp R 2−p and whose pth moment is bounded by (2ν)p . We can control the restricted singular values of Φ using the triangle inequality: σmin (Φ; T ) = min kΦt k ≥ min kΦtrunc t k − kΦtail k = σmin (Φtrunc ; T ) − kΦtail k . t ∈T t ∈T (15.1) We bound the restricted singular value of the bounded matrix Φtrunc using Theorem 9.1. To bound kΦtail k, we apply a simple norm estimate, Fact B.2, based on the matrix Rosenthal inequality [Tro15c, Thm. I]. 60 S. OYMAK AND J. A. TROPP Since Φtrunc follows Model 2.1 with B = 2R, Theorem 9.1(1) and (2) give the probability bound o n ¡ ¢2 2 P σ2min (Φtrunc ; T ) ≤ Em (T ) + − CR 2 (m + n)0.92 − CR 2 ζ ≤ e−ζ /(m+n) . Select ζ = (m + n)0.92 to make the tail probability negligible: n o ¡ ¢2 0.84 P σ2min (Φtrunc ; T ) ≤ Em (T ) + − CR 2 (m + n)0.92 ≤ e−(m+n) . Taking square roots inside the event, we reach © ¡ ¢ ª 0.84 P σmin (Φtrunc ; T ) ≤ Em (T ) + − CR(m + n)0.46 ≤ e−(m+n) . (15.2) This step depends on the subadditivity of the square root. Meanwhile, the entries of Φtail are centered, have variances at most Cνp R 2−p , and have pth moments bounded by (2ν)p . Therefore, we can apply the norm bound for heavy-tailed random matrices, Fact B.2, to see that ½ ¾ q ¡ ¢ 2/p p 2−p P kΦtail k ≥ C ν R (m + n) log(m + n) + Cν(m + n) log(m + n) ζ ≤ ζ−p . Define the positive quantity ε via the relation 4(1 + ε) := p. Select ζ = (m + n)ε/p to obtain q n o P kΦtail k ≥ Cνp/2 R 1−p/2 (m + n) log(m + n) + Cν(m + n)(2+ε)/p log(m + n) ≤ (m + n)−ε . (15.3) p The key point here is that we can arrange for kΦtail k to have order o( m + n) with high probability. Combine (15.1), (15.2), and (15.3) to reach n ¡ ¢ P σmin (Φ; T ) ≤ Em (T ) + − CR(m + n)0.46 q o − Cνp/2 R 1−p/2 (m + n) log(m + n) − Cν(m + n)(2+ε)/p log(m + n) 0.84 ≤ e−(m+n) + (m + n)−ε . Set the truncation parameter R = ν(m + n)0.02/(1+ε) to equate the exponents on m + n in the two terms that depend on R. Then simplify using p = 4(1 + ε) to obtain © ¡ ¢ ¡ ¢ ª P σmin (Ψ; T ) ≤ Em (T ) + − Cν (m + n)0.5−0.02(1+2ε)/(1+ε) + (m + n)0.5−(ε/4)/(1+ε) log(m + n) ≤ e−(m+n) 0.84 + (m + n)−ε . Note that both powers in the event are bounded away from 1/2, so we can absorb the logarithm by increasing the power slightly. Furthermore, we can introduce a function κ(p) that is strictly positive for p > 4 to reach the inequality © ¡ ¢ ª 0.84 P σmin (Ψ; T ) ≤ Em (T ) + − Cp ν(m + n)0.5−κ(p) ≤ e−(m+n) + (m + n)1−p/4 . The constant Cp depends only on the parameter p. The exponential vanishes faster than any polynomial, so we can combine the terms on the right-hand side to complete the proof of (10.1). For the upper bound, we use Theorem 9.1(3) to control the expectation of the restricted singular value. In this case, the error term in the expectation bound becomes R 4 (m + n)0.94 . This change presents no new difficulties, and we arrive at the result (10.2) by a slight modification of the argument. 15.2. Corollary 10.1: Truncation of Individual Random Variables. In this section, we describe a truncation procedure for scalar random variables. The arguments here are entirely standard, but we include details for completeness. UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 61 Lemma 15.1 (Corollary 10.1: Truncation). Let ϕ be a random variable that satisfies the properties listed in Model 2.4. Let R be a parameter that satisfies R p/2−1 ≥ 2νp/2 . Then we have the decomposition ϕ = ϕtrunc + ϕtail (15.4) where E ϕtrunc = 0, E ϕ2trunc = 1, and E ϕtail = 0, E ϕ2tail ≤ 6νp , R p−2 and and |ϕtrunc | ≤ 2R E |ϕtail |p ≤ (2ν)p . Proof. Define the random variable £ ¤ ϕ1{|ϕ| ≤ R} where α2 := E ϕ2 1{|ϕ| ≤ R} . α Since ϕ is standardized and symmetric, ϕtrunc is also standardized and symmetric. To ensure that the decomposition (15.4) holds, we must set ϕtrunc := 1−α ϕ1{|ϕ| ≤ R}. (15.5) α The random variable ϕtail is also centered because of the symmetry of ϕ. To establish the other properties of ϕtrunc and ϕtail , we need to calculate some expectations. First, using integration by parts and Markov’s inequality, Z R Z ∞ £ 2 ¤ E ϕ 1{|ϕ| > R} = 2ζP {|ϕ| > R} dζ + 2ζP {|ϕ| > ζ} dζ 0 R (15.6) Z R Z ∞ E |ϕ|p E |ϕ|p 2νp 2ζ p dζ ≤ p−2 . ≤ 2ζ p dζ + R ζ R 0 R ϕtail := ϕ1{|ϕ| > R} − In the last step, we used the assumption that p ≥ 4. A similar calculation shows that Z R £ ¤ α2 = E ϕ2 1{|ϕ| ≤ R} = 2ζP {|ϕ| > ζ} dζ 0 Z ∞ Z ∞ 2ζP {|ϕ| > ζ} dζ 2ζP {|ϕ| > ζ} dζ − = R 0 £ ¤ ≥ E ϕ2 − 2νp νp ≥ 1 − . (p − 2)R p−2 R p−2 The last relation holds because ϕ is standardized. It follows that α ≥ 1− νp/2 R p/2−1 1 ≥ . 2 (15.7) The last estimate holds because p ≥ 4 and of the assumption R p/2−1 ≥ 2νp/2 . We are now prepared to verify the uniform bound on ϕtrunc : ¯ ¯ ¯ ϕ1{|ϕ| ≤ R} ¯ R ¯ ¯ ≤ ≤ 2R. |ϕtrunc | = ¯ ¯ α α The last inequality follows from (15.7). Next, we need to bound the variance of ϕtail . We have µ ¶ µ p/2 p/2−1 ¶2 £ ¤ £ ¤ ¤ 2νp £ ¤ 6νp 1−α 2 £ 2 ν /R E ϕ2tail = E ϕ2 1{|ϕ| > R} + E ψ2 ≤ p−2 . E ϕ 1{|ϕ| ≤ R} ≤ p−2 + α R 1/2 R The first identity holds because the two indicators are orthogonal random variables. The second relation uses the expectation calculation (15.6) and the estimate (15.7); we have dropped the indicator in the second expectation. The last estimate holds because ϕ is standardized. 62 S. OYMAK AND J. A. TROPP Last, we need to check the moment inequality for ϕtail . This estimate follows by applying the triangle inequality to the definition (15.5): ¡ ¢1/p ¡ ¢1/p 1 − α ¡ ¢1/p 1 ¡ ¢1/p E |ϕtail |p ≤ E |ϕ|p + E |ϕ|p = E |ϕ|p ≤ 2ν. α α We have dropped the indicators after invoking the triangle inequality. Finally, we introduced the estimate (15.7).  UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 63 Part IV. Universality of the Embedding Dimension: Proof of Theorem I(b) This part of the paper develops a condition under which the random projection of a set fails with high probability. This argument establishes the second part of the universality law for the embedding dimension, Theorem I(b). Section 16 contains the main technical result, a condition under which a bounded random matrix maps a point in a set to the origin. Section 17 extends this argument to the heavy-tailed random matrix model, Model 2.4. In Section 17.2, we use the latter result to derive Theorem I(b). The remaining parts of the section lay out the supporting argument. 16. W HEN E MBEDDING FAILS FOR A B OUNDED R ANDOM M ATRIX In this section, we introduce a functional whose value determines whether a linear transformation maps a point in a set to the origin. Then we present the main technical result, which gives an estimate for this functional evaluated on a random linear map from Model 2.1. The rest of the section outlines the main steps in the proof of the result. 16.1. The RAP Functional: Dual Condition for Failure. To study when a linear map maps a point a set to the origin, we use an approach based on polarity. Let us make the following definition. Definition 16.1 (Range Avoids Polar (RAP)). Let K ⊂ Rm be a closed, convex cone. Let A be an m × n matrix. Define the quantity τmin (A; K ) := min min◦ ks − At k . kt k=1 s∈K Note that the range of the inner minimum involves the polar K ◦ of the cone. We refer to τmin as the RAP functional. To see why the RAP functional is important, consider a closed, spherically convex subset Ω of Sm−1 for which cone(Ω) is not a subspace. The second conclusion of Proposition 3.8 states that τmin (A; cone(Ω)) > 0 implies 0 ∈ A(Ω). The third conclusion of Proposition 3.8 gives a similar result in the case of a subspace. Therefore, we can obtain a sufficient condition that A maps a point in Ω to zero by providing a lower bound for the RAP functional. 16.2. Theorem 16.2: Main Result for the Bounded Random Matrix Model. The main technical result in this part of the paper is a theorem on the behavior of the RAP functional of a bounded random matrix. Theorem 16.2 (RAP: Bounded Random Matrix Model). Place the following assumptions: • Let m and n be natural numbers with m + n ≤ min{m, n}9/8 . • Let K be a closed, convex cone in Rm , and define Ω := K ∩ Sm−1 . • Draw an m × n random matrix Φ from Model 2.1 with bound B . Then the squared RAP functional τ2min (Φ; K ) has the following properties. p (1) The squared RAP functional deviates below its mean on a scale of B 2 m + n: © ª 2 P τ2min (Φ; K ) ≤ E τ2min (Φ; K ) − CB 2 ζ ≤ e−ζ /m (2) The expected square of the RAP functional is bounded below: ¡ ¢2 En (Ω) − 2 E τmin (Φ; K ) ≥ − CB 3 (m + n)0.95 . CB 2 log(m + n) This result does use the symmetry assumption in Model 2.1. The proof of Theorem 16.2 is long, even though we can borrow a lot from the proof of Theorem 9.1. This section contains an overview of the calculations that are required with forward references to the detailed arguments. 64 S. OYMAK AND J. A. TROPP 16.3. Proof of Theorem 16.2: Lower Tail Bound. Theorem 16.2(1) states that the quantity τ2min (Φ; K ) does not deviate substantially below its mean. The proof is similar to the proof of the bound (11.1) in Proposition 11.1, which shows that the squared restricted singular value σ2min (Φ; K ) does not deviate substantially below its mean. We omit the repetitive details. 16.4. Proof of Theorem 16.2: Truncation and Dissection. Let us proceed with the proof of Theorem 16.2(2). Define the sets S := K ◦ ∩ R Bm and T := Sn−1 p where the radius R := Crad B 2 m + n for some universal constant Crad . Next, we construct a family of closed, convex subsets of S and T . For each I ⊂ {1, . . . , m} and each J ⊂ {1, . . . , n}, define © ª S I := s ∈ S : |s i | ≤ R(#I )−1/2 for all i ∈ I c ; © ª T J := t ∈ T : |t j | ≤ (#J )−1/2 for all j ∈ J c . Fix the cardinality parameter k ∈ {1, . . . , min{m, n}}. As in the proof of Theorem 9.1, we have the decompositions [ [ S = #I =k S I and T = #J =k T J . Furthermore, ¶ e(m + n) k #{S I : #I = k} × #{T J : #J = k} ≤ . (16.1) k We maintain the heuristic that the cardinality k is much smaller than either ambient dimension m or n. µ 16.5. Proof of Theorem 16.2: Lower Bound for RAP Functional. To bound the quantity τmin (Φ; K ), we must combine estimates from several technical results. We give an outline of the calculation here, with the details postponed to a series of propositions. First, we must account for the error we incur when we truncate the cone K ◦ to the wedge S. Proposition 18.1 demonstrates that E τ2min (Φ; K ) = E min min◦ ks − Φt k2 ≥ E min min ks − Φt k2 − CB 4 . kt k=1 s∈K t ∈T s∈S (16.2) This inequality is based on an estimate for the norm of the point s ∈ K ◦ where the inner minimum is achieved, as well as a probability bound for the norm of the random matrix Φ. Next, we pass from the minimum over the full sets S and T to minima over their subsets S I and T J : q E min min ks − Φt k2 ≥ min E min min ks − Φt k2 − CB 2 km log((m + n)/k). (16.3) t ∈T s∈S #I =#J =k t ∈T J s∈S I The proof of this inequality hews to the argument in Proposition 12.2. We just need to invoke the concentration inequality from Theorem 16.2(1) in lieu of the concentration inequality from Proposition 11.1, and we take into account the bound (16.1) on the number of subsets in the decomposition. Further details are omitted. We are now prepared to perform the exchange argument to pass from the matrix Φ to a matrix Ψ that contains many standard normal entries. Fix subsets I ⊂ {1, . . . , m} and J ⊂ {1, . . . , n}, each with cardinality k. Introduce the random matrix · ¸ ΦI J ΦI J c Ψ := Ψ(I , J ) := ΦI c J ΓI c J c where Γ is an m × n standard normal matrix. Proposition 19.1 gives the bound E min min ks − Φt k2 ≥ E min min ks − Ψ(I , J )t k2 − s∈S I t ∈T J t ∈T J s∈S I CB 3 (m + n)11/6 log(mn) k (16.4) CB 3 (m + n)11/6 log(mn) ≥ E min min◦ ks − Ψ(I , J )t k − kt k=1 s∈K k The proof is similar with the proof of Proposition 13.1. We discretize both sets; we smooth the minima using the soft-min function; and then we apply the Lindeberg principle. The main distinction is that we 2 UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 65 can replace even less of the matrix Φ than before. The second line in (16.4) is an immediate consequence of the facts S I ⊂ S ⊂ K ◦ and T J ⊂ T = Sn−1 . To continue, we must identify a geometric functional that is hiding within the expression (16.4). Write Ω := K ∩ Sm−1 . Proposition 20.1 demonstrates that à ¡ !2 ¢ q E (Ω) n − (16.5) E min min◦ ks − Ψ(I , J )t k2 ≥ − CB 2 k log m . p kt k=1 s∈K CB log m + As in Proposition 14.1, the main tool is the Gaussian Minimax Theorem, Fact A.3, which allows us to break down the standard normal matrix Γ into simpler quantities. The proof requires some convex duality arguments, as well as some delicate considerations that did not arise before. Last, we linearize the function (·)2+ in (16.5): à ¡ !2 ¡ ¢2 ¢ q p En (Ω) − En (Ω) − 2 − CB k log m ≥ − CB km. (16.6) p 2 CB log m CB log m + We have employed the observation that ¡ ¢ p En (Ω) − ≤ E max g · s ≤ E kg k ≤ m. s∈Ω m Here, g ∈ R is a standard normal vector. Now, sequence the estimates (16.2), (16.3), (16.4), (16.5), and (16.6) to arrive at ¡ ¢2 µ ¶ 11/6 En (Ω) − log(mn) q 2 3 (m + n) E τmin (Φ; K ) ≥ − CB + km log((m + n)/k) . CB 2 log m k We select k = b(m + n)8/9 c, which results in the bound ¡ ¢2 En (Ω) − 2 − CB 3 (m + n)17/18 log(m + n). E τmin (Φ; K ) ≥ CB 2 log(m + n) Note that k ≤ min{m, n}, as required, because we have assumed that m + n ≤ min{m, n}9/8 . We obtain the result quoted in Theorem 16.2(2). 17. W HEN E MBEDDING FAILS FOR A H EAVY-TAILED R ANDOM M ATRIX In this section, we extend Theorem 16.2 to the heavy-tailed matrix model, Model 2.4. In Section 10.3, we show how to derive the second half of the universality result for the embedding dimension, Theorem I(a), as a consequence. 17.1. Corollary 17.1: Main Result for the p-Moment Random Matrix Model. The following corollary extends Theorem 16.2 to include random matrices drawn from Model 2.4. Corollary 17.1 (RAP: p-Moment Random Matrix Model). Fix parameters p > 4 and ν ≥ 1. Place the following assumptions: • Let m and n be natural numbers with m + n ≤ min{m, n}9/8 . • Let K be a closed, convex cone in Rm , and define Ω := K ∩ Sm−1 . • Draw an m × n random matrix Φ that satisfies Model 2.4 with given p and ν. Then the RAP functional satisfies the probability bound ( ) ¡ ¢ En (Ω) − P τmin (Φ; K ) ≤ − Cp ν3/2 (m + n)1/2−κ(p) ≤ Cp (m + n)1−p/4 . Cp ν(m + n)(1−cp )κ(p) The function κ(p) is strictly positive for p > 4. The strictly positive constants cp and Cp depend only on p. The proof of Corollary 17.1 follows from Theorem 16.2 and the same kind of truncation argument that appears in Section 15. We omit further details. 66 S. OYMAK AND J. A. TROPP 17.2. Proof of Theorem I(b) from Corollary 17.1. Theorem I(b) is an easy consequence of Corollary 17.1. Let us restate the assumptions of the theorem: • E is a compact subset of RD that does not contain the origin. • The statistical dimension of E satisfies δ(E ) ≥ %D. • The d × D random linear map Π follows Model 2.4 with parameters p > 4 and ν ≥ 1. We must now consider the regime where the embedding dimension d ≤ (1 − ε) δ(E ). We need to demonstrate that P {0 ∈ Π(E )} = P {E ∩ null(Π) 6= ;} ≥ 1 − Cp D 1−p/4 . (17.1) As in Section 10.3, the probability is a decreasing function of the embedding dimension, so we may as well consider the case where d = b(1 − ε) δ(E )c. It is easy to see that d ≤ D ≤ %−1 d because δ(E ) ≤ d . In particular, d + D ≤ min{d , D}9/8 . Introduce the spherical retraction Ω := θ(E ). If cone(Ω) is a subspace, we replace Ω by a subset Ω0 with the property that cone(Ω0 ) is a subspace of one dimension fewer than cone(Ω). Then we proceed with the argument. Proposition 3.8 and relation (3.2) show that τmin (Π∗ ; cone(Ω)) > 0 implies 0 ∈ Π(Ω) implies 0 ∈ Π(E ). Therefore, to verify (17.1), it is enough to produce a high-probability lower bound on the RAP functional τmin (Π∗ ; cone(Ω)). With the choices Φ = Π∗ and K = cone(Ω), Corollary 17.1 yields ( ) ¡ ¢ Ed (Ω) − ∗ 3/2 1/2−κ(p) P τmin (Π ; cone(Ω)) ≥ − Cp ν (d + D) ≥ 1 − Cp D 1−p/4 . Cp ν(d + D)(1−cp )κ(p) We need to check that the lower bound on the RAP functional is positive. That is, ¡ ¢ Ed (Ω) − > Cp ν5/2 (d + D)1/2−cp κ(p) . (17.2) Once again, this point follows from two relatively short calculations. Since Ω is a subset of the unit sphere, we quickly compute the excess width using (4.3): p p p p p ¡ ¢ ¡ ¢p Ed (Ω) − ≥ δ(Ω) − 1 − d = δ(E ) − 1 − d ≥ 1 − 1 − ε δ(E ) − 1. (17.3) The justifications are the same as in Section 10.3. We can easily bound the dimensional term in (17.2): (d + D)1/2−cp κ(p) ≤ CD 1/2−cp κ(p) ≤ C%−1/2 D −cp κ(p) p p δ(E ) ≤ C%−1/2 D −cp κ(p) δ(E ) − 1 The first inequality holds because d ≤ D, and the last two relations both rely on the assumption 1 ¿ D ≤ %−1 δ(E ). Since cp κ(p) is positive, we can find a number N := N (p, ν, %, ε) for which D ≥ N implies that ¡p ¢p Cp ν5/2 (d + D)1/2−cp κ(p) < 1 + ε − 1 δ(E ) − 1. Combine the last result with (17.3) to see that the claim (17.2) holds true. 17.3. Proof of Proposition 6.1: Application of RAP functional to decoding with structured errors. This section establishes the success condition in Proposition 6.1. More precisely, we show that s/n < ψ−1 `1 (1 − m/n) − o(1) implies Ω ∩ range(Φ) = ; with probability 1 − o(1). The set Ω is derived from the descent cone of the `1 norm, and the calculation (6.3) shows that δ(Ω◦ ) = n(1 − ψ`1 (s/n) − o(1)). To begin, we assume that there are parameters %, ε > 0 for which • The statistical dimension δ(Ω◦ ) ≥ %n. • The message length m ≤ (1 − ε) δ(Ω◦ ). (17.4) UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 67 As in Section 17.2, these conditions imply that Ω◦ ∩ null(Φ∗ ) 6= ; with probability at least 1 − o(1). Indeed, this statement corresponds to (17.1) under the change of variables d = m and D = n and E = Ω◦ and Π = Φ∗ . By polarity, the conclusion of (17.4) holds. It remains to show that the parameter choice in (17.4) implies the two assumptions we have made. As in the proof of Proposition 6.1, the condition s ≤ (1 − ξ)n ensures that δ(Ω◦ ) ≥ %n for some % > 0. Similarly, the condition m ≤ (1 − ε)δ(Ω◦ ) holds when m ≤ (1 − ε) · n(1 − ψ`1 (s/n) − o(1)). Equivalently, s/n ≤ ψ−1 `1 (1 − m/((1 − ε)n) − o(1)). Since we can choose ε to be an arbitrarily small constant as m → ∞, it suffices that s/n ≤ ψ−1 `1 (1 − m/n − o(1)). This observation completes the argument. 18. T HEOREM 16.2: T RUNCATION OF THE C ONE In this section, we argue that functional τmin (Φ; K ) does not change very much if we truncate the cone K . Replacing the unbounded set with a compact set allows us to develop discretization arguments. Proposition 18.1 (RAP: Truncation p of Cone). Adopt the notation and hypotheses of Theorem 16.2. Let S := K ◦ ∩ R Bm , where R := Crad B 2 m + n. Then E min min◦ ks − Φt k2 ≥ E min min ks − Φt k2 − CB 4 . kt k=1 s∈K kt k=1 s∈S Proof. Since 0 ∈ K ◦ , it is easy to see that min◦ ks − Φt k ≤ kΦt k ≤ kΦk s∈K when kt k = 1. Meanwhile, the triangle inequality gives the bound ks − Φt k ≥ ksk − kΦt k ≥ ksk − kΦk when kt k = 1. It follows that s ? ∈ arg min ks − Φt k s∈K ◦ implies ks ? k ≤ 2 kΦk when kt k = 1. (18.1) Since the norm of the random matrix Φ concentrates, the bound (18.1) shows that the norm of the minimizer s ? is unlikely to be large. For any positive parameter R, the observation (18.1) allows us to calculate that E τ2min (Φ; K ) = E min min◦ ks − Φt k2 kt k=1 s∈K · ¸ 2 ≥ E min min◦ ks − Φt k 1{kΦk ≤ R/2} kt k=1 s∈K ¸ · 2 ks k = E min min − Φt 1 {kΦk ≤ R/2} kt k=1 s∈K ◦ ∩RBm · 2 ks k = E min min − Φt − E max max ◦ m ◦ kt k=1 s∈K ∩RB kt k=1 s∈K ∩RB (18.2) ¸ 2 ks k − Φt 1 {kΦk > R/2} . m To reach the last line, we write the indicator function in terms of its the complement. 68 S. OYMAK AND J. A. TROPP To bound the second term on the right-hand side of (18.2), crude estimates suffice. ¸ · £ ¤ 2 ks − Φt k 1{kΦk > R/2} ≤ E (R + kΦk)2 1{kΦk > R/2} E max max ◦ m kt k=1 s∈K ∩RB ¤ £ ≤ 9 E kΦk2 1{kΦk > R/2} ¢1/2 ¡ ¢1/2 ¡ . ≤ 9 E kΦk4 P {kΦk > R/2} The last inequality is Cauchy–Schwarz. Since Φ satisfies the condition (B.1), Fact B.1 implies that p © ª 2 P kΦk > C0 B 2 m + n + C0 B 2 ζ ≤ e−ζ . In particular, using integration by parts, p ¡ ¢1/4 E kΦk4 ≤ CB 2 m + n. Furthermore, there is a constant Crad for which p ª © P kΦk > 12 Crad B 2 m + n ≤ (m + n)−2 . p If we set R := Crad B 2 m + n, then · ¸ 2 ks − Φt k 1{kΦk > R/2} ≤ CB 4 . E max max ◦ m (18.3) kt k=1 s∈K ∩RB  Introduce the estimate (18.3) into (18.2) to complete the argument. 19. T HEOREM 16.2: R EPLACING M OST E NTRIES OF THE R ANDOM M ATRIX In this section, we show that we can replace most of the entries of a random matrix Φ with standard normal variables without changing the value of the functional E τ2min (Φ; K ) substantially Proposition 19.1 (RAP: Partial Replacement). Let Φ be an m p× n random matrix that satisfies Model 2.1 with magnitude bound B . Fix the parameter R := Crad B 2 m + n. Let I be a subset of {1, . . . , m} with cardinality k, and let S I be a closed subset of R Bm for which s ∈ SI implies for each index i ∈ I c . |s i | ≤ Rk −1/2 Let J be a subset of {1, . . . , n} with cardinality k, and let T J be a closed subset of Bn for which t ∈ TJ implies |t j | ≤ k −1/2 for each index j ∈ J c . Suppose that Ψ is an m × n matrix with block form Ψ := Ψ(I , J ) := Then ΦI J ΦI c J · ¸ ΦI J c . ΓI c J c (19.1) ¯ ¯ 3 11/6 ¯ ¯ log(mn) ¯E min min ks − Φt k2 − E min min ks − Ψt k2 ¯ ≤ CB (m + n) . ¯ ¯ t ∈T s∈S t ∈T J s∈S I k J I As usual, Γ is an m × n standard normal matrix. 19.1. Proof of Proposition 19.1. Fix the sets I and J . As in the proof of Proposition 13.1, the error has three components: ¯ ¯ ¯ ¯ ¯E min min ks − Φt k2 − E min min ks − Ψt k2 ¯ ≤ Cmnε (Lemma 19.2) ¯ ¯ t ∈T J s∈S I t ∈T J s∈S I + + Cβ−1 (m + n) log(1/ε) µ ¶ βR β2 R 3 CB 3 mn 2 + 3 . k k (Lemma 19.3) (Lemma 19.4) UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 69 The first error comes from discretizing the sets S and T at a level ε ∈ (0, 1]. The second error appears when we replace the minima with a soft-min function with parameter β > 0. The last error emerges from the Lindeberg exchange argument. To complete the proof, we set ε = (mn)−1 to make the discretization error negligible. Select the smoothing parameter so that β3 = k 3 (m + n)/(B 3 R 3 mn). We arrive at ¯ ¯ ¯ ¯ ¯E min min ks − Φt k2 − E min min ks − Ψt k2 ¯ ¯ ¯ t ∈T J s∈S I t ∈T J s∈S I ≤ CB 2 (m + n)1/3 (mn)2/3 CB R(m + n)2/3 (mn)1/3 log(mn) + . k2 k p p Since 2 mn ≤ m + n and R = Crad B 2 m + n, the second term dominates. We reach the stated result. 19.2. Proposition 19.1: Discretizing the Index Sets. The first step in the proof of Proposition 19.1 is to replace the index sets by finite subsets. Lemma 19.2 (Proposition 19.1: Discretization). Adopt the notation and hypotheses of Proposition 19.1. Fix a parameter ε ∈ (0, 1]. Then S I contains a finite subset S εI and T J contains a finite subset T Jε whose cardinalities satisfy log(#S εI ) + log(#T Jε ) ≤ (m + n) log(3/ε). Furthermore, these subsets have the property that ¯ ¯ ¯ ¯ ¯ ¯ ¯E min min ks − Φt k2 − E minε minε ks − Φt k2 ¯ ≤ Cmnε. ¯ t ∈T J s∈S I ¯ t ∈T J s∈S I (19.2) The bound (19.2) also holds if we replace Φ by Ψ. Proof. We choose S εI to be an (Rε)-covering of S I , and T Jε to be an ε-covering of T J . Since S I is a subset of R Bm and T J is a subset of Bn , we can be sure that the coverings have cardinality #S εI ≤ (3/ε)m and #T Jε ≤ (3/ε)n . See [Ver12, Lem. 5.2]. The rest of the proof is essentially the same as that of Lemma 13.2, so we omit the details.  19.3. Proposition 19.1: Smoothing the Minimum. The next step in the proof of Proposition 19.1 is to pass from the minimum to the soft-min function. Lemma 19.3 (Proposition 19.1: Smoothing). Adopt the notation and hypotheses of Proposition 19.1, and let S εI and T Jε be the sets introduced in Lemma 19.2. Fix a parameter β > 0, and introduce the function F : Rm×n → R where F (A) := − Then X X 2 1 log s∈S ε t ∈T ε e−βks−At k . I J β ¯ ¯ ¯ ¯ 1¡ ¢ ¯ ¯ log(#S εI ) + log(#T Jε ) . ¯E minε minε ks − Φt k2 − E F (Φ)¯ ≤ ¯ t ∈T J s∈S I ¯ β (19.3) The estimate (19.3) also holds if we replace Φ by Ψ. Proof. The proof is almost identical with that of Lemma 13.3.  19.4. Proposition 19.1: Exchanging the Entries of the Random Matrix. The main challenge in the proof of Proposition 19.1 is to exchange most of the entries of the random matrix Φ for the entries of Ψ. Lemma 19.4 (Proposition 19.1: Exchange). Adopt the notation and hypotheses of Proposition 19.1, and let F be the function defined in Lemma 19.3. Then µ ¶ βR β2 R 3 |E F (Φ) − E F (Ψ)| ≤ CB 3 mn 2 + 3 . k k 70 S. OYMAK AND J. A. TROPP The proof is similar with Lemma 13.4. This time, we replace only the rows of Φ listed in I c . We incur the same error for each of these m − k rows, so it suffices to control the error in exchanging a single row. The following sublemma achieves this goal. Sublemma 19.5 (Lemma 19.4: Comparison for One Row). Adopt the notation and hypotheses of Proposition 19.1, and let S εI and T Jε be the sets defined in Lemma 19.3. For i ∈ I c , introduce the function f : Rn → R given by f (a) := − X X 2 1 log s∈S ε t ∈T ε e−β(si −a·t ) +q(s,t ) , I J β where q : S εI × T Jε → R is an arbitrary function. Suppose that ϕ ∈ Rn is a random vector with independent, standardized entries that are bounded in magnitude by B . Suppose that ψ ∈ Rn is a random vector with ψJ = ϕJ and ψ J c = γ J c , where γ ∈ Rn is a standard normal vector. Then µ 2 3¶ ¯ ¯ ¯E f (ϕ) − E f (ψ)¯ ≤ CB 3 n βR + β R . k2 k3 The proof of this result is much the same as the proof of Sublemma 13.5. There are only two points that require care. First, we use a slightly different result to compute the derivatives. Sublemma 19.6 (Lemma 19.4: Derivatives). Adopt the notation and hypotheses of Proposition 19.1 and Sublemma 19.5. Let ξ : R → Rn be a linear function, so its derivative ξ0 ∈ Rn is a constant vector. For i ∈ I c , define the function X X ¡ ¢ 2 1 r (α) := f ξ(α) = − log s∈S ε t ∈T ε e−β(si −ξ(α)·t ) +q(s,t ) J I β where q : S εI × T Jε → R is arbitrary. The third derivative of this function satisfies à ! ¯ 000 ¯ ¯ 0 ¯3 ¡ ¢ ¯r (α)¯ ≤ 48 max ¯ξ · t ¯ β Ev |s i − ξ(α) · v | + β2 Ev |s i − ξ(α) · v |3 , t ∈T Jε where v ∈ T Jε is a random vector that does not depend on ξ(α). ¯ ¯ Second, when making further bounds on ¯r 000 (α)¯, we need to exploit our control on the magnitude of s on the coordinates in I c . Note that |s i − ξ(α) · v | ≤ |s i | + |ξ(α) · v | ≤ Rk −1/2 + |ξ(α) · v | The second inequality holds because |s i | ≤ Rk −1/2 for each i ∈ I c . Similarly, |s i − ξ(α) · v |3 ≤ C |s i |3 + C |ξ(α) · v |3 ≤ CRk −3/2 + C |ξ(α) · v |3 . Repeating the arguments from Sublemma 13.5, we obtain bounds of the form · ¯ ¯¸ βB 3 R Cβ2 B 3 R 3 CβB 4 + Cβ2 B 6 ¯ 000 ¯ 3 + + . E |ϕ j | max ¯r j (α)¯ ≤ |α|≤|ϕ j | k2 k3 k 3/2 p The first two terms dominate the third because our choice R = Crad B 2 m + n implies that R ≥ Bk 1/2 . We arrive at the statement of Sublemma 19.5. 20. T HEOREM 16.2: B OUNDING THE RAP F UNCTIONAL BY THE E XCESS W IDTH The most difficult part of proving Theorem 16.2 is to identify the excess width En (Ω) after we replace the original matrix Φ by the hybrid matrix Ψ defined in (19.1). The following result does the job. UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 71 Proposition 20.1 (Theorem 16.2: Excess Width Bound). Adopt the notation and hypotheses of Proposition 19.1. Let Ω := K ∩ Sm−1 . Then à ¡ !2 ¢ q En (Ω) − 2 2 E min min◦ ks − Ψ(I , J )t k ≥ − CB k log m . p kt k=1 s∈K CB log m + The random matrix Ψ is defined in (19.1). The proof of Proposition 20.1 occupies the rest of this section. At the highest level, the proof is similar with the argument underlying Proposition 14.1. We write the quantity of interest as a minimax, and then we apply the Gaussian Minimax Theorem to replace the Gaussian matrix with a pair of Gaussian vectors. Afterward, we analyze the resulting expression to identify the Gaussian width; the new challenges appear in this step. 20.1. Proof of Proposition 20.1. Here is an overview of the calculations that we will perform; the detailed justifications appear in the upcoming subsections. Let us abbreviate U := K ∩ Bm . We have the chain of inequalities E min min◦ ks − Ψt k kt k=1 s∈K ≥ E min max u · Ψt kt k=1 u∈U · ¸ · ¸· ¸ uI ΦI J ΦI J c tJ = E min max · ΦI c J ΓI c J c t J c kt k=1 u∈U u I c µ · ¸ ¶ ΦI J ΦI J c ≥ E min max u · t + (u I c · g I c ) kt J c k + ku I c k (h J c · t J c ) − 2 ΦI c J 0 kt k=1 u∈U ¡ p ¢ q W (U ) − n + ≥ − CB 2 k log m p CB log m (Lemma 20.2) (Lemma 20.3) (Lemma 20.4). Lemma 20.2 is a standard convex duality argument, and the next line follows when we write out the quantity of interest more explicitly. To reach the fourth line, we apply the Gaussian Minimax Theorem in the usual way to replace the random matrix Γ with two standard normal vectors g ∈ Rm and h ∈ Rn . In a rough sense, the remaining part of the random matrix Φ is negligible. The term (u I c · g I c ) generates the p Gaussian width W (U ), defined in (3.7), while the term (h J c · t J c ) contributes a dimensional factor − n. Apply the increasing convex function (·)2+ to the inequality in the last display, and invoke Jensen’s inequality to draw out the expectation. Notice that W (U ) = E max m u · g ≥ E maxm−1 u · g = W (Ω). u∈K ∩B u∈K ∩S p ¢ Finally, En (Ω) − = W (Ω) − n + because of (4.2). This point completes the proof. ¡ ¢ ¡ 20.2. Proposition 20.1: Duality for the RAP Functional. The first step in the argument is to apply the minimax inequality to pass to a saddle-point formulation that is amenable to analysis with the Gaussian Minimax Theorem. Lemma 20.2 (Proposition 20.1: Duality). Adopt the notation and hypotheses of Proposition 20.1. For any point t ∈ Rn , min◦ ks − Ψt k ≥ max u · Ψt s∈K u∈U where U := K ∩ Bm . Proof. Write the norm as maximum: min◦ ks − Ψt k = min◦ max u · (Ψt − s). m s∈K s∈K u∈B 72 S. OYMAK AND J. A. TROPP The minimax inequality allows us to interchange the maximum and minimum: ³ ´ min◦ ks − Ψt k ≥ max min u · (Ψt − s) = max u · Ψt − max u · s ◦ ◦ m m s∈K u∈B s∈K u∈B s∈K ◦ ◦ The value of maxs∈K ◦ u · s equals zero when u ∈ (K ) = K ; otherwise, it takes the value +∞. This step uses the assumption that K is closed and convex. We conclude that min◦ ks − Ψt k ≥ max m u · Ψt . s∈K u∈K ∩B This is the stated result.  20.3. Proposition 20.1: Reducing the Gaussian Matrix to Some Gaussian Vectors. By an argument similar with the proof of Lemma 14.5, we can replace the Gaussian block of Ψ with two Gaussian vectors. Lemma 20.3 (Proposition 20.1: Reducing the Gaussian Matrix). Adopt the notation and hypotheses of Proposition 20.1. Then · ¸ µ · ¸ ¶ ΦI J ΦI J c ΦI J ΦI J c E min max u · t ≥ E min max u · t + (u I c · g I c ) kt J c k + ku I c k (h J c · t J c ) − 2, ΦI c J ΓI c J c ΦI c J 0 kt k=1 u∈U kt k=1 u∈U where g ∈ Rm and h ∈ Rn be independent standard normal vectors. Proof. There are no new ideas in this bound, so we refer the reader to Lemmas 14.4 and 14.5 for the pattern of argument.  20.4. Proposition 20.1: Finding the Gaussian Width. To prove Proposition 20.1, most of the difficulty arises when we seek a good lower bound for the minimax problem that appears in Lemma 20.3. We have the following result. Lemma 20.4 (Proposition 20.1: Finding the Gaussian Width). Adopt the notation and hypotheses of Proposition 20.1. Define the set U := K ∩ Bm . Then p µ · ¸ ¶ q W (U ) − n ΦI J ΦI J c E min max u · t + (u I c · g I c ) kt J c k + ku I c k (h J c · t J c ) ≥ − CB 2 k log m. p ΦI c J 0 kt k=1 u∈U CB log m Proof. The proof of this bound is lengthy, so we break the argument into several steps. The overall result follows when we sequence the inequalities in Sublemmas 20.5, 20.6, 20.7, and 20.8 and consolidate the error terms.  20.4.1. Lemma 20.4: Simplifying the Minimax I. The first step in the proof of Lemma 20.4 is to simplify the minimax so we can identify the key terms. Sublemma 20.5 (Lemma 20.4: Simplifying the Minimax I). Adopt the notation and hypotheses of Lemma 20.4. Then µ · ¸ ¶ ΦI J ΦI J c E min max u · t + (u I c · g I c ) kt J c k + ku I c k (h J c · t J c ) ΦI c J 0 kt k=1 u∈U µ · ¸ ¶ p £ ¤ tj p ≥ E min max u · Φ J g − n kt J c k − CB 2 k. kt J c k kt k=1 u∈U + Proof. Let us introduce notation for the quantity of interest: µ · ¸ ¶ ΦI J ΦI J c Q 1 := E min max u · t + (u I c · g I c ) kt J c k + ku I c k (h J c · t J c ) . ΦI c J 0 kt k=1 u∈U + (20.1) We can introduce the positive-part operator because the fact that 0 ∈ U ensures that the minimax is nonnegative. UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 73 The first step in the argument is to reintroduce the missing piece of the random vector g . Adding and subtracting the quantity (u I · g I ) kt J c k inside the positive-part operator in (20.1), we obtain the bound ¸ ¶ µ · ΦI J ΦI J c t + (u · g ) kt J c k + ku I c k (h J c · t J c ) − E max u I · g I Q 1 ≥ E min max u · ΦI c J 0 kt k=1 u∈U u∈U + (20.2) µ · ¸ ¶ p ΦI J ΦI J c ≥ E min max u · t + (u · g ) kt J c k + ku I c k (h J c · t J c ) − k. ΦI c J 0 kt k=1 u∈U + The second inequality holds because #I = k and U is a subset of the unit ball. This step is similar with the proof of Lemma 14.8. Next, we combine the terms in (20.2) involving ΦI J c and the row vector h J c . Since kuk ≤ 1, · ¸ · ¸ uI ΦI J c u I · ΦI J c t J c + ku I c k (h J c · t J c ) = · tJc ku I c k hJc °· ¸° ° ΦI J c ° ° ≥ −° (20.3) ° h J c ° kt J c k µ°· ¶ ¸° ° ΦI J c ° p p ° ° − n . ≥ − n kt J c k − ° hJc ° + The (k + 1) × (n − k) random matrix on the right-hand side has independent, standardized entries that satisfy the subgaussian estimate (B.1) with bound B . Repeating the calculations in (14.17), we see that ¶ µ°· ¸° p ° ΦI J c ° p ° ° E ° − n ≤ CB 2 k. (20.4) hJc ° + Apply the estimate (20.3) inside the minimax in (20.2) and then use (20.4) to arrive at the lower bound µ · ¸ ¶ µ°· ¶ ¸° ° ΦI J c ° p p ΦI J ° ° t + (u · g ) kt J c k − n kt J c k − E ° Q 1 ≥ E min max u · − n ΦI c J J hJc ° kt k=1 u∈U + + µ · ¸ ¶ p £ ¤ tJ p − n kt J c k − CB 2 k. ≥ E min max u · Φ J g kt J c k kt k=1 u∈U +  In the second line, we have simply consolidated terms. 20.4.2. Lemma 20.4: Simplifying the Minimax II. The next step in the proof of Lemma 20.4 is to reduce the minimax problem in Sublemma 20.5 to a scalar optimization problem. Sublemma 20.6 (Lemma 20.4: Simplifying the Minimax II). Adopt the notation and hypotheses of Lemma 20.4. Then µ · ¸ ¶ £ ¤ tj p c E min max u · Φ J g − n kt J k kt J c k kt k=1 u∈U n+ ¡ £ ¤ p ¢ p o p ≥ E min max 0, max u · g − n α, min max u · Φ J g s − nα − k. α∈[0,1] u∈U ksk=1 u∈U Proof. Introduce the notation µ £ Q 2 := max u · Φ J u∈U g ¤ ¶ ¸ p tJ − n kt J c k . kt J c k + · (20.5) We will develop two lower bounds on the maximum by coupling u to the random matrix in different ways. Afterward, we combine these results into a single bound. In the first place, we can choose the row vector u so that it depends only on the remaining Gaussian vector: u(g ) ∈ arg max u · g . u∈U 74 S. OYMAK AND J. A. TROPP Since kt k = 1, we obtain the bound ¸ µ · ¶ £ ¤ tJ ¡ p p ¢ − n kt J c k ≥ u(g ) · g − n kt J c k + u(g ) · Φ J t J max u · Φ J g c kt J k u∈U ° ° ¡ p ¢ ≥ max u · g − n kt J c k − °u(g )Φ J ° . (20.6) u∈U The second term on the right-hand side of (20.6) satisfies ° ° ³ ° °2 ´1/2 p E °u(g )Φ J ° ≤ E °u(g )Φ J ° ≤ k. (20.7) Indeed, u(g ) is a random vector with ku(g )k ≤ 1 that is stochastically independent from Φ J , and the m × k random matrix Φ J has independent, standardized entries. The second bound is even simpler. Since kt k = 1, µ · ¸ ¶ £ ¤ £ ¤ tJ p p (20.8) max u · Φ J g − n kt J c k ≥ min max u · Φ J g s − n kt J c k . c kt k ksk=1 u∈U u∈U J In this expression, the variable s ∈ Rk+1 . Introducing (20.6) and (20.8) into (20.5), we arrive at n ¡ o ° ° £ ¤ p ¢ p Q 2 ≥ E min max 0, max u · g − n kt J c k − °u(g )Φ J ° , min max u · Φ J g s − n kt J c k kt k=1 ksk=1 u∈U u∈U n ¡ £ ¤ p ¢ p o p ≥ E min max 0, max u · g − n α, min max u · Φ J g s − nα − k. α∈[0,1] u∈U (20.9) ksk=1 u∈U The zero branch in the maximum accounts for the positive-part operator in (20.5). The second line follows from (20.7). We have also introduced a new parameter α to stand in for kt J c k.  20.4.3. Lemma 20.4: Probabilistic Bounds. The last major step in Lemma 20.4 is to develop probabilistic bounds for the terms that arise in Sublemma 20.6. Sublemma 20.7 (Lemma 20.4: Probabilistic Bounds). Adopt the notation and hypotheses of Lemma 20.4. Then n ¡ £ ¤ p ¢ p o E min max 0, max u · g − n α, min max u · Φ J g s − nα ksk=1 u∈U u∈U α∈[0,1] ( ) q p W (U ) − 2 p 1 ≥ min max (W (U ) − n − 2)α, p − nα − CB 2 k log m. 2 α∈[0,1] 2B log m Proof. Introduce the notation n ¡ £ p ¢ Q 3 := E min max 0, max u · g − n α, min max u · Φ J α∈[0,1] u∈U ksk=1 u∈U ¤ p o g s − nα . p We assume that W (U ) ≥ 2 + n, which is permitted because the final result would otherwise become vacuous. The next stage in the argument is to introduce probabilistic bounds for the branches of the maximum and use these to control the expectation. It is convenient to abbreviate £ ¤ p X := max u · g − n and Y := min max u · Φ J g s. u∈U ksk=1 u∈U p Note that E X = W (U )− n. Since g → 7 X (g ) is 1-Lipschitz, the Gaussian concentration inequality, Fact A.2, implies that © ª p P X ≥ W (U ) − n − 2 ≥ 3/4. On the other hand, Sublemma 20.10 will demonstrate that ( ) q W (U ) P Y ≥ − CB k log m ≥ 3/4. p CB log m UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION Therefore, taking complements and a union bound, ( p P X > W (U ) − n − 2 and Y > W (U ) CB p log m 75 ) q − CB k log m ≥ 1/2. (20.10) For each nonnegative random variable Z and each number L > 0, it holds that E Z ≥ L P {Z > L}. Using the estimate (20.9) and the probability bound (20.10), we find that ( à ! ) q p p p 1 W (U ) − CB k log m − nα − k Q 3 ≥ min max 0, (W (U ) − n − 2)α, p 2 α∈[0,1] CB log m ) ( q p W (U ) − 2 p 1 ≥ min max (W (U ) − n − 2)α, − nα − CB 2 k log m. p 2 α∈[0,1] CB log m Once again, we have used shift-invariance of the maximum to combine the error terms. For convenience, we have also dropped the zero branch of the maximum and introduced the number two into the numerator in the second branch.  20.4.4. Lemma 20.4: Solving the Scalar Minimax Problem. The final step in the proof of Lemma 20.4 is to solve the scalar minimax problem that emerges in Sublemma 20.7. Sublemma 20.8 (Lemma 20.4: Solving the Minimax Problem). Adopt the notation and hypotheses of Lemma 20.4. Then ( ) p p W (U ) − 2 p W (U ) − n − 2 − nα ≥ . min max (W (U ) − n − 2)α, p p α∈[0,1] CB log m CB log m Proof. The first branch of the maximum is increasing in α while the second branch is decreasing in α, so the minimum occurs when the two branches are equal, provided that this situation occurs when α ∈ [0, 1]. Setting the branches equal, we identify the point α? where the saddle value is achieved. α? := b a +c p W (U ) − 2 where a := W (U ) − n − 2 and b := p CB log m and c := p n. We quickly verify that α? ∈ [0, 1], so the minimax takes the value p p W (U ) − n − 2 W (U ) − 2 W (U ) − n − 2 ab = × = . p p a +c W (U ) − 2 2B log m CB log m  This is the required estimate. 20.4.5. Sublemma 20.7: Probabilistic Lower Bound for Bilinear Minimax. In this section, we explain how to obtain a lower bound for the minimax problem in (20.8) in terms of the Gaussian width of the set U . Sublemma 20.9 (Sublemma 20.7: Probability Bound for Bilinear Minimax). Assume that k < m, and let X be an m × k random matrix that satisfies Model 2.1 with bound B . Let g ∈ Rm be standard normal. Let U be a subset of the unit ball in Rm . Then ( ) q £ ¤ W (U ) P min max u · X g s > − CB k log m ≥ 3/4. p ksk=1 u∈U CB log m Proof. Fix ε = m −1 . Let N be an ε-net for the unit sphere in Rk+1 . The cardinality of the net satisfies log(N ) ≤ (k + 1) log(3m) by the standard volumetric argument [Ver12, Lem. 5.2] We can estimate the quantity of interest below by discretizing the parameter s. Since N and U are subsets of the unit ball, we have the bound °£ £ ¤ £ ¤ ¤° min max u · X g s ≥ min max u · X g s − ° X g ° ε (20.11) ksk=1 u∈U s∈N u∈U We will establish a probabilistic lower bound for the right-hand side of (20.11). 76 S. OYMAK AND J. A. TROPP First, we develop a probability bound for the second term on the right-hand side of (20.11). A simple spectral norm estimate suffices. The m × k random matrix X has standardized entries and g ∈ Rm is standard normal, so p °£ °£ ¤° ¤° E ° X g ° ≤ E ° X g °F ≤ (k + 1)m. As usual, k·kF denotes the Frobenius norm. Markov’s inequality now implies that o n°£ p ¤° P ° X g ° ≥ 6 (k + 1)m ≥ 5/6. It follows that ©°£ P ° X ¤° ª g ° ε ≥ 6 ≥ 5/6. (20.12) We have used the facts that ε = m −1 and k < m. Let us turn to the second quantity on the right-hand side of (20.11). We develop a strong probability bound for each fixed point s ∈ N , and we extend it to the entire net using the union bound. For technical reasons, it is easier to treat the random matrix£ X and the g separately. ¤ random vector k Fix a point s ∈ N , and decompose it as s = s 1 s k+1 where s 1 ∈ R . Construct a random vector u ∈ U that satisfies u(X ) ∈ arg max u · X s 1 . u∈U We may calculate that £ max u · X u∈U ¤ £ g s ≥ u(X ) · X g ¤ · s1 ¸ s k+1 = u(X ) · X s 1 + (u(X ) · g )s k+1 ¯ ¯ ≥ max u · X s 1 − ¯u(X ) · g ¯ . (20.13) u∈S The last estimate relies on the fact that |s k+1 | ≤ 1 because ksk = 1. The second term on the right-hand side of (20.13) is easy to handle using the Gaussian concentration inequality, Fact A.2: ¯ ©¯ ª 2 P ¯u(X ) · g ¯ ≥ ζ ≤ 2e−ζ /2 (20.14) Indeed, g 7→ u(X ) · g is a 1-Lipschitz function with mean zero because the random vector u(X ) is stochastically independent from g and has norm bounded by one. We can interpret the first term on the right-hand side of (20.13) as an “empirical width.” It takes some work to compare this quantity with the Gaussian width. Sublemma 20.10 contains a bound for the expectation, and Sublemma 20.11 contains a tail bound. Together, they deliver the probability inequality ( ) 2 2 W (U ) P max u · X s 1 ≤ − ζ ≤ e−ζ /(8B ) for each s ∈ N . (20.15) p u∈U CB log m In other words, the empirical width of U is comparable with the Gaussian width, modulo a logarithmic factor. Introduce the two probability bounds (20.14) and (20.15) into the deterministic estimate (20.13). We arrive at ( ) £ ¤ 2 2 W (U ) P max u · X g s ≤ − 2ζ ≤ 3e−ζ /(8B ) for each s ∈ N . p u∈U CB log m Finally, we take a union bound over s ∈ N to pobtain an estimate that is uniform over the net. Recall that log(#N ) ≤ (k + 1) log(3m) and select ζ = 4B (k + 1) log(3m) to reach ( ) q W (U ) P min max u · X s 1 ≤ − CB (k + 1) log(3m) p s∈N u∈U CB log m ≤ 3(#N )e−ζ The numerical estimate holds because 1 ≤ k < m. 2 /(8B 2 ) ≤ 3e−(k+1) log(3m) = 3(3m)−(k+1) ≤ 1/18. (20.16) UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 77 The two probability bounds (20.12) and (20.16) hold simultaneously with probability at least 3/4. Therefore, we can substitute these results into (20.11) and adjust constants to obtain the stated bound.  20.4.6. Sublemma 20.7: Lower Estimate for the Empirical Width. The next sublemma demonstrates that the Gaussian width of a set is not more than a logarithmic factor larger than the empirical width of the set as computed with bounded random variables. This is the only step in the argument for bounded random matrices that requires the symmetry assumption. Sublemma 20.10 (Sublemma 20.7: Empirical Width Bound). Adopt the notation and hypotheses of Sublemma 20.9, and let s be a fixed unit-norm vector. Then E max u · X s ≥ u∈U W (U ) CB . p log m Proof of Sublemma 20.10. Define the random vector v := (V1 , . . . ,Vn ) := X s. Our goal is to compare the empirical width of the set U computed using the vector v with the Gaussian width of the set. First, we develop a lower bound on the first moment of the entries of v . Fix an index i . Since the entries of X are independent and symmetric ¯X ¯ ¯X ¯ ¯ k ¯ ¯ k ¯ E |Vi | = E ¯ j =1 X i j s j ¯ = E ¯ j =1 η j X i j s j ¯ where {η j } is an independent family of Rademacher random variables, independent from X . The Khintchine inequality [LO94] allows us to compare the first moment with the second moment: µ ¯ ¯2 ¶1/2 ´1/2 1 1 ³Xk ¯ ¯Xk 2 2 | | |s |X . E |Vi | ≥ p E X Eη ¯ j =1 η j X i j s j ¯ =p E j i j j =1 2 2 Since s has unit norm, we can regard the sum as a weighted average, and we can invoke Jensen’s inequality to draw the average out of the square root: ¢ 1 Xk ¡ E |Vi | ≥ p E |X i j | |s j |2 . j =1 2 Last, note that 1 = E |X i j |2 ≤ B E |X i j | because the entries of X are standardized and bounded by B . Thus, 1 Xk 1 1 |s |2 = p . E |Vi | ≥ p j =1 B j 2 B 2 Let us bound the width-like functional below. Since v has independent, symmetric coordinates, Xn Xn E max u · X s = E max u · v = E max i =1 Vi u i = E max i =1 η i |Vi | u i u∈U u∈U u∈U u∈U where, again, {η i } is an independent family of Rademacher random variables, independent from u. Using a corollary of the contraction principle [LT11, Lem. 4.5], E max u · X s ≥ mini (E |Vi |) Eη max u∈U u∈U Xn i =1 ηi ui ≥ Xn 1 p E max i =1 η i u i . B 2 u∈U Applying the contraction principle again [LT11, Eqn. (4.9)], we can randomize the sum with independent Gaussian variables: Xn 1 E max u · X s ≥ E max i =1 g i u i p u∈U 2B log n u∈U Here, g := (g 1 , . . . , g n ) is a standard normal vector. Identify the Gaussian width to complete the proof.  78 S. OYMAK AND J. A. TROPP 20.4.7. Sublemma 20.7: Lower Tail of the Empirical Width. Last, we present a concentration inequality for the empirical width. Sublemma 20.11 (Sublemma 20.7: Lower Tail of Empirical Width). Adopt the notation and hypotheses of Sublemma 20.9. Let s be a fixed unit-norm vector. Then ½ ¾ 2 2 P max u · X s ≤ E max u · X s − ζ ≤ e−ζ /8B . u∈U u∈U The most direct proof of this result relies on a version of Talagrand’s inequality [BLM13, Thm. 8.6] obtained from the transportation cost method. Fact 20.12 (Talagrand’s Inequality). Let X be a metric space. Suppose that f : X p → R fulfills the one-sided Lipschitz bound Xp f (a) − f (z) ≤ i =1 c i (a)1ai 6=zi for all a, z ∈ X p , where c i : Rp → R are auxiliary functions that satisfy Xp 2 c (a) ≤ v for all a ∈ X p . i =1 i Let (X 1 , . . . , X p ) be an independent sequence of random variables taking values in X , and define Y := f (X 1 , . . . , X p ). Then, for all ζ ≥ 0, P {Y − E Y ≥ ζ} ≤ e−ζ P {Y − E Y ≤ −ζ} ≤ e 2 /(2v) −ζ2 /(2v) , and . Proof of Sublemma 20.11. Let X be the interval [−B, B ] equipped with the Euclidean distance. For a matrix A ∈ X m×k , introduce the function f (A) := max u · As. u∈U Select a point t ∈ arg maxu∈U u · As. Then f (A) − f (Z ) ≤ t · As − t · Z s Xm Xk = i =1 j =1 t i s j (a i j − z i j ) Xm Xk ¯ ¯ ≤ i =1 j =1 2B ¯t i s j ¯ 1ai j 6=zi j . We¯used¯ the fact that the entries of A and Z are bounded in magnitude by B . With the choice c i j (A) = 2B ¯t i s j ¯, we see that Xm Xk X ¯ ¯2 c 2 (A) ≤ 4B 2 i , j ¯t i s j ¯ ≤ 4B 2 i =1 j =1 i j because t , s both belong to the Euclidean unit ball. Invoke Fact 20.12 to complete the argument.  UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 79 Part V. Back Matter Two appendices contain statements of some results that we use throughout the paper. Appendix A presents some facts about Gaussian analysis, while Appendix B describes some spectral bounds for random matrices with independent entries. We conclude with acknowledgments and a list of works cited. A PPENDIX A. T OOLS FROM G AUSSIAN A NALYSIS We make extensive use of methods from Gaussian analysis to provide precise information about the behavior of functions of Gaussian random variables. These results come up in many places in the paper, so we have collected them here. A.1. Concentration for Gaussian Lipschitz Functions. We begin with two concentration results that apply to a Lipschitz function of independent Gaussian variables. Recall that a function f : Rn → R has Lipschitz constant L when ¯ ¯ ¯ f (a) − f (b)¯ ≤ L ka − bk for all a, b ∈ Rn . We also say, more briefly, that f is L-Lipschitz. The first result [Bog98, Thm. 1.6.4] gives a bound on the variance of a Lipschitz function. The second result [Bog98, Thm. 1.7.6] provides a normal concentration inequality for Lipschitz functions. Fact A.1 (Gaussian Variance Inequality). Suppose that f : Rn → R has Lipschitz constant L. Let γ ∈ Rn be a standard normal random vector. Then Var[ f (γ)] ≤ L. Equivalently, ¡ ¢2 E f (γ)2 ≤ E f (γ) + L. Fact A.2 (Gaussian Concentration Inequality). Suppose that f : Rn → R has Lipschitz constant L. Let γ ∈ Rn be a standard normal random vector. Then, for all ζ ≥ 0, © ª 2 P f (γ) ≥ E f (γ) + ζ ≤ e−ζ /2 , and © ª 2 P f (γ) ≤ E f (γ) − ζ ≤ e−ζ /2 . A.2. The Gaussian Minimax Theorem. To compute the expectations of certain functions of Gaussian random variables, we depend on a comparison principle due to Gordon [Gor85, Thm. 1.1]. Let S be an abstract set. A family {Z s : s ∈ S} of real random variables is called a centered Gaussian process when each element Z s has mean zero and each finite subcollection {Z s1 , . . . , Z sn } has a jointly Gaussian distribution. Fact A.3 (Gaussian Minimax Theorem). Let T and U be finite sets. Consider two centered Gaussian processes {X t u } and {Y t u }, indexed over T ×U . For all choices of indices, suppose that  2 2  E X t u = E Y t u E X t u X t u0 ≤ E Yt u Yt u0   E X t u X t 0 u 0 ≥ E Y t u Y t 0 u 0 when t 6= t 0 . Then, for all real numbers λt u and ζ, ¾ ½ ¾ ½ ¡ ¢ ¡ ¢ P min max λt u + X t u ≥ ζ ≥ P min max λt u + Y t u ≥ ζ . t ∈T u∈U t ∈T u∈U Fact A.3 extends to infinite index sets T,U by approximation. 80 S. OYMAK AND J. A. TROPP A PPENDIX B. S PECTRAL B OUNDS FOR R ANDOM M ATRICES Our argument also depends heavily on some non-asymptotic bounds for the spectrum of a random matrix with independent entries. These results only give rough estimates, but they are adequate for our purposes. The first result gives tail bounds for the extreme singular values of a rectangular matrix with independent, subgaussian entries. Fact B.1 (Subgaussian Matrix: Tail Bounds). Let X be an d 1 × d 2 random matrix with independent, standardized entries that are uniformly subgaussian: ¢1/p 1 ¡ ≤ B. sup p E |X i j |p p p≥1 (B.1) Then the largest singular value σmax (X ) and the d 2 -th largest singular value σmin (X ) satisfy the bounds n o p p 2 P σmax (X ) > d 1 + CB 2 d 2 + CB 2 ζ ≤ e−ζ n o p p 2 P σmin (X ) < d 1 − CB 2 d 2 − CB 2 ζ ≤ e−ζ . This result follows from [Ver12, Thm. 5.39] when we track the role of the subgaussian constant through the proof. The second result gives a tail bound for the norm of a matrix with independent entries that may only have two moments; it is based on the matrix Rosenthal inequality [Tro15c, Thm. 1.1] and a standard concentration inequality [BLM13, Thm. 15.5]. Fact B.2 (Heavy-Tailed Matrix: Norm Bound). Fix a parameter p ∈ [2, log(d 1 + d 2 )]. Let X be a d 1 × d 2 random matrix with independent entries that have the following properties. • The entries are centered: E X i j = 0. • The variances of the entries are uniformly bounded: Var(X i j ) ≤ α. • The entries have uniformly bounded pth moments: E |X i j |p ≤ νp . Then q n ¢ o ¡ P kX k ≥ C α(d 1 + d 2 ) log(d 1 + d 2 ) + Cν(d 1 + d 2 )2/p log(d 1 + d 2 ) ζ ≤ ζ−p . Proof Sketch. Write the random matrix as a sum of independent random matrices: Xd1 Xd2 X = i =1 X E , j =1 i j i j where Ei j is the d 1 × d 2 matrix with a one in the (i , j ) position and zeros elsewhere. A straightforward application of the matrix Rosenthal inequality [Tro15c, Thm. I] yields q ¡ ¢1/p E kX k ≤ C α(d 1 + d 2 ) log(d 1 + d 2 ) + C E maxi j |X i j |p log(d 1 + d 2 ) q ≤ C α(d 1 + d 2 ) log(d 1 + d 2 ) + Cν(d 1 d 2 )1/p log(d 1 + d 2 ) q ≤ C α(d 1 + d 2 ) log(d 1 + d 2 ) + Cν(d 1 + d 2 )2/p log(d 1 + d 2 ). The second line follows when we replace the maximum by a sum and exploit the uniform moment estimate. The third line is just the inequality between the geometric and arithmetic means. A standard concentration inequality for moments [BLM13, Thm. 15.5] gives £ p ¡ p ¤1/p p/2 ¢1/p E(kX k − E kX k)+ ≤ C p E V+ In this expression, the variance parameter X £¡ ¢2 ¤ V+ := i j E kX k − kX (i j ) k + | X . UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION 81 The (i , j ) entry of X (i j ) is an independent copy of the corresponding entry of X ; the remaining entries of the two matrices are the same. Applying the usual method [BLM13, Ex. 3.14], we see that £¡ ¢2 ¤ V+ ≤ C maxi j E X i j − X i0 j | X . Applying the same considerations as in the last paragraph, we obtain ¡ p/2 ¢1/p ≤ Cν(d 1 + d 2 )2/p . E V+ Combine these results and apply Markov’s inequality to obtain the tail bound © ª p P kX k ≥ E kX k + Cν p(d 1 + d 2 )2/p ζ ≤ ζ−p . Introduce the estimate for the expected norm to complete the argument.  A CKNOWLEDGMENTS The authors would like to thank David Donoho, Surya Ganguli, Babak Hassibi, Michael McCoy, Andreas Maurer, Andrea Montanari, Ivan Nourdin, Giovanni Peccati, Adrian Röllin, Jared Tanner, Christos Thrampoulidis, and Madeleine Udell for helpful conversations. We also thank the anonymous reviewers and the editors for their careful reading and suggestions. SO was generously supported by the Simons Institute for the Theory of Computing and NSF award CCF-1217058. JAT gratefully acknowledges support from ONR award N00014-11-1002 and the Gordon & Betty Moore Foundation. R EFERENCES [ALMT14] D. Amelunxen, M. Lotz, M. B. McCoy, and J. A. Tropp. Living on the edge: phase transitions in convex programs with random data. Inf. Inference, 3(3):224–294, 2014. [BDN15] J. Bourgain, S. Dirksen, and J. Nelson. Toward a unified theory of sparse dimensionality reduction in Euclidean space. Geom. Funct. Anal., 25(4):1009–1088, 2015. [BGVV14] S. Brazitikos, A. Giannopoulos, P. Valettas, and B.-H. Vritsiou. Geometry of isotropic convex bodies, volume 196 of Mathematical Surveys and Monographs. American Mathematical Society, Providence, RI, 2014. [BLM13] S. Boucheron, G. Lugosi, and P. Massart. Concentration inequalities. Oxford University Press, Oxford, 2013. A nonasymptotic theory of independence, With a foreword by Michel Ledoux. [BLM15] M. Bayati, M. Lelarge, and A. Montanari. Universality in polytope phase transitions and message passing algorithms. Ann. Appl. Probab., 25(2):753–822, 2015. [BM12] M. Bayati and A. Montanari. The LASSO risk for Gaussian matrices. IEEE Trans. Inform. Theory, 58(4):1997–2017, 2012. [Bog98] V. I. Bogachev. Gaussian measures, volume 62 of Mathematical Surveys and Monographs. American Mathematical Society, Providence, RI, 1998. [BS10] Z. Bai and J. W. Silverstein. Spectral analysis of large dimensional random matrices. Springer Series in Statistics. Springer, New York, second edition, 2010. [BY93] Z. D. Bai and Y. Q. Yin. Limit of the smallest eigenvalue of a large-dimensional sample covariance matrix. Ann. Probab., 21(3):1275–1294, 1993. [CDS98] S. S. Chen, D. L. Donoho, and M. A. Saunders. Atomic decomposition by basis pursuit. SIAM J. Sci. Comput., 20(1):33– 61, 1998. [Cha06] S. Chatterjee. A generalization of the Lindeberg principle. Ann. Probab., 34(6):2061–2076, 2006. [CRPW12] V. Chandrasekaran, B. Recht, P. A. Parrilo, and A. S. Willsky. The convex geometry of linear inverse problems. Found. Comput. Math., 12(6):805–849, 2012. [CRT06] E. J. Candès, J. Romberg, and T. Tao. Robust uncertainty principles: exact signal reconstruction from highly incomplete frequency information. IEEE Trans. Inform. Theory, 52(2):489–509, 2006. [CRTV05] E. Candès, M. Rudelson, T. Tao, and R. Vershynin. Error correction via linear programming. In Foundations of Computer Science, 2005. FOCS 2005. 46th Annual IEEE Symposium on, pages 668–681, Oct 2005. [CSPW11] V. Chandrasekaran, S. Sanghavi, P. A. Parrilo, and A. S. Willsky. Rank-sparsity incoherence for matrix decomposition. SIAM J. Optim., 21(2):572–596, 2011. [CW13] K. L. Clarkson and D. P. Woodruff. Low rank approximation and regression in input sparsity time. In STOC’13— Proceedings of the 2013 ACM Symposium on Theory of Computing, pages 81–90. ACM, New York, 2013. [DDW+ 07] M. A. Davenport, M. F. Duarte, M. B. Wakin, J. N. Laska, D. Takhar, K. F. Kelly, and R. G. Baraniuk. The smashed filter for compressive classification and target recognition. In Proc. SPIE, volume 6498, pages 64980H–64980H–12, 2007. 82 [DGM13] [DH01] [DJM13] [Don06a] [Don06b] [Don06c] [DS01] [DT06] [DT09a] [DT09b] [DT10] [EK12] [Faz02] [FM14] [FR13] [GG15] [GNP14] [Gor85] [Gor88] [Gru07] [HMT11] [JM14] [Kle55] [KM11] [KN14] [KY14] [Lin22] [LO94] [LT11] [Mah11] [Mas00] [Mau12] S. OYMAK AND J. A. TROPP D. L. Donoho, M. Gavish, and A. Montanari. The phase transition of matrix recovery from Gaussian measurements matches the minimax MSE of matrix denoising. Proc. Natl. Acad. Sci. USA, 110(21):8405–8410, 2013. D. L. Donoho and X. Huo. Uncertainty principles and ideal atomic decomposition. IEEE Trans. Inform. Theory, 47(7):2845–2862, 2001. D. L. Donoho, I. Johnstone, and A. Montanari. Accurate prediction of phase transitions in compressed sensing via a connection to minimax denoising. IEEE Trans. Inform. Theory, 59(6):3396–3433, 2013. D. L. Donoho. Compressed sensing. IEEE Trans. Inform. Theory, 52(4):1289–1306, 2006. D. L. Donoho. For most large underdetermined systems of linear equations the minimal l 1 -norm solution is also the sparsest solution. Comm. Pure Appl. Math., 59(6):797–829, 2006. D. L. Donoho. High-dimensional centrally symmetric polytopes with neighborliness proportional to dimension. Discrete Comput. Geom., 35(4):617–652, 2006. K. R. Davidson and S. J. Szarek. Local operator theory, random matrices and Banach spaces. In Handbook of the geometry of Banach spaces, Vol. I, pages 317–366. North-Holland, Amsterdam, 2001. D. Donoho and J. Tanner. Thresholds for the recovery of sparse solutions via l1 minimization. In Information Sciences and Systems, 2006 40th Annual Conference on, pages 202–206, March 2006. D. Donoho and J. Tanner. Observed universality of phase transitions in high-dimensional geometry, with implications for modern data analysis and signal processing. Philos. Trans. R. Soc. Lond. Ser. A Math. Phys. Eng. Sci., 367(1906):4273– 4293, 2009. With electronic supplementary materials available online. D. L. Donoho and J. Tanner. Counting faces of randomly projected polytopes when the projection radically lowers dimension. J. Amer. Math. Soc., 22(1):1–53, 2009. D. L. Donoho and J. Tanner. Counting the faces of randomly-projected hypercubes and orthants, with applications. Discrete Comput. Geom., 43(3):522–541, 2010. Y. C. Eldar and G. Kutyniok, editors. Compressed sensing. Cambridge University Press, Cambridge, 2012. Theory and applications. M. Fazel. Matrix rank minimization with applications. PhD thesis, Stanford, 2002. R. Foygel and L. Mackey. Corrupted sensing: novel guarantees for separating structured signals. IEEE Trans. Inform. Theory, 60(2):1223–1247, 2014. S. Foucart and H. Rauhut. A mathematical introduction to compressive sensing. Applied and Numerical Harmonic Analysis. Birkhäuser/Springer, New York, 2013. P. Gao and S. Ganguli. On simplicity and complexity in the brave new world of large-scale neuroscience. Curr. Opinion Neurobiology, 32:148–155, 2015. L. Goldstein, I. Nourdin, and G. Peccati. Gaussian phase transitions and conic intrinsic volumes: Steining the Steiner formula. Available at http://arXiv.org/abs/1411.6265, Nov. 2014. Y. Gordon. Some inequalities for Gaussian processes and applications. Israel J. Math., 50(4):265–289, 1985. Y. Gordon. On Milman’s inequality and random subspaces which escape through a mesh in Rn . In Geometric aspects of functional analysis (1986/87), volume 1317 of Lecture Notes in Math., pages 84–106. Springer, Berlin, 1988. P. M. Gruber. Convex and discrete geometry, volume 336 of Grundlehren der Mathematischen Wissenschaften [Fundamental Principles of Mathematical Sciences]. Springer, Berlin, 2007. N. Halko, P. G. Martinsson, and J. A. Tropp. Finding structure with randomness: probabilistic algorithms for constructing approximate matrix decompositions. SIAM Rev., 53(2):217–288, 2011. A. Javanmard and A. Montanari. Hypothesis testing in high-dimensional regression under the Gaussian random design model: asymptotic theory. IEEE Trans. Inform. Theory, 60(10):6522–6554, 2014. V. L. Klee, Jr. Separation properties of convex cones. Proc. Amer. Math. Soc., 6:313–318, 1955. S. B. Korada and A. Montanari. Applications of the Lindeberg principle in communications and statistical learning. IEEE Trans. Inform. Theory, 57(4):2440–2450, 2011. D. M. Kane and J. Nelson. Sparser Johnson-Lindenstrauss transforms. J. ACM, 61(1):Art. 4, 23, 2014. A. Knowles and J. Yin. Anisotropic local laws for random matrices. Available at http://arXiv.org/abs/1410.3516, Nov. 2014. J. W. Lindeberg. Eine neue Herleitung des Exponentialgesetzes in der Wahrscheinlichkeitsrechnung. Math. Z., 15(1):211–225, 1922. R. Latała and K. Oleszkiewicz. On the best constant in the Khinchin-Kahane inequality. Studia Math., 109(1):101–104, 1994. M. Ledoux and M. Talagrand. Probability in Banach spaces. Classics in Mathematics. Springer-Verlag, Berlin, 2011. Isoperimetry and processes, Reprint of the 1991 edition. M. W. Mahoney. Randomized algorithms for matrices and data. Foundations and Trends® in Machine Learning, 3(2):123–224, 2011. P. Massart. About the constants in Talagrand’s concentration inequalities for empirical processes. Ann. Probab., 28(2):863–884, 2000. A. Maurer. Thermodynamics and concentration. Bernoulli, 18(2):434–454, 2012. UNIVERSALITY OF RANDOMIZED DIMENSION REDUCTION [Men10] [Men14] [MOO10] [MPTJ07] [MT13] [MT14a] [MT14b] [NN13] [OH10] [OH13] [OTH13] [PW15] [Rot73] [RV08] [San52] [San76] [Sar06] [Sch50] [Sio58] [Sto09] [Sto13] [SW08] [TAH15] [Tao12] [TH15] [Tib96] [Tik15] [TOH15] [Tro59] [Tro06] 83 S. Mendelson. Empirical processes with a bounded ψ1 diameter. Geom. Funct. Anal., 20(4):988–1027, 2010. S. Mendelson. A remark on the diameter of random sections of convex bodies. In B. Klartag and E. Milman, editors, Geometric Aspects of Functional Analysis, volume 2116 of LNM, pages 395–404. Springer, 2014. E. Mossel, R. O’Donnell, and K. Oleszkiewicz. Noise stability of functions with low influences: invariance and optimality. Ann. of Math. (2), 171(1):295–341, 2010. S. Mendelson, A. Pajor, and N. Tomczak-Jaegermann. Reconstruction and subgaussian operators in asymptotic geometric analysis. Geom. Funct. Anal., 17(4):1248–1282, 2007. M. B. McCoy and J. A. Tropp. The achievable performance of convex demixing. Available at http://arXiv.org/ abs/arXiv:1309.7478, Sep. 2013. M. B. McCoy and J. A. Tropp. From Steiner formulas for cones to concentration of intrinsic volumes. Discrete Comput. Geom., 51(4):926–963, 2014. M. B. McCoy and J. A. Tropp. Sharp recovery bounds for convex demixing, with applications. Found. Comput. Math., 14(3):503–567, 2014. J. Nelson and H. L. Nguyen. OSNAP: faster numerical linear algebra algorithms via sparser subspace embeddings. In 2013 IEEE 54th Annual Symposium on Foundations of Computer Science—FOCS 2013, pages 117–126. IEEE Computer Soc., Los Alamitos, CA, 2013. S. Oymak and B. Hassibi. New null space results and recovery thresholds for matrix rank minimization. Available at http://arXiv.org/abs/1011.6326, Nov. 2010. S. Oymak and B. Hassibi. Asymptotically exact denoising in relation to compressed sensing. Available at http: //arXiv.org/abs/1305.2714, May 2013. S. Oymak, C. Thrampoulidis, and B. Hassibi. The squared-error of generalized lasso: A precise analysis. In Communication, Control, and Computing (Allerton), 2013 51st Annual Allerton Conference on, pages 1002–1009, Oct 2013. Available at http://arXiv.org/abs/1311.0830. M. Pilanci and M. Wainwright. Randomized sketches of convex programs with sharp guarantees. Information Theory, IEEE Transactions on, 61(9):5096–5115, Sept 2015. V. I. Rotar’. Certain limit theorems for polynomials of degree two. Teor. Verojatnost. i Primenen., 18:527–534, 1973. M. Rudelson and R. Vershynin. On sparse reconstruction from Fourier and Gaussian measurements. Comm. Pure Appl. Math., 61(8):1025–1045, 2008. L. A. Santaló. Integral geometry in spaces of constant curvature. Repub. Argentina. Publ. Comision Nac. Energia Atomica. Ser. Mat., 1(1):68, 1952. L. A. Santaló. Integral geometry and geometric probability. Addison-Wesley Publishing Co., Reading, Mass.-LondonAmsterdam, 1976. With a foreword by Mark Kac, Encyclopedia of Mathematics and its Applications, Vol. 1. T. Sarlos. Improved approximation algorithms for large matrices via random projections. In Foundations of Computer Science, 2006. FOCS ’06. 47th Annual IEEE Symposium on, pages 143–152, Oct 2006. L. Schläfli. Gesammelte mathematische Abhandlungen. Band I. Verlag Birkhäuser, Basel, 1950. M. Sion. On general minimax theorems. Pacific J. Math., 8:171–176, 1958. M. Stojnic. Various thresholds for `1 -optimization in compressed sensing. Available at http://arXiv.org/abs/ 0907.3666, July 2009. M. Stojnic. Regularly random duality. Available at http://arXiv.org/abs/1303.7295, Mar. 2013. R. Schneider and W. Weil. Stochastic and integral geometry. Probability and its Applications (New York). SpringerVerlag, Berlin, 2008. C. Thrampoulidis, E. Abbasi, and B. Hassibi. High-dimensional error anlaysis of regularized m-estimators. Forthcoming, Nov. 2015. T. Tao. Topics in random matrix theory, volume 132 of Graduate Studies in Mathematics. American Mathematical Society, Providence, RI, 2012. C. Thrampoulidis and B. Hassibi. Isotropically random orthogonal matrices: Performance of lasso and minimum conic singular values. In Information Theory (ISIT), 2015 IEEE International Symposium on, pages 556–560, June 2015. Available at http://arXiv.org/abs/1503.07236. R. Tibshirani. Regression shrinkage and selection via the lasso. J. Roy. Statist. Soc. Ser. B, 58(1):267–288, 1996. K. Tikhomirov. The limit of the smallest singular value of random matrices with i.i.d. entries. Adv. Math., 284:1–20, 2015. C. Thrampoulidis, S. Oymak, and B. Hassibi. The Gaussian min–max theorem in the presence of convexity. In Proceedings of The 28th Conference on Learning Theory (COLT), Jul. 2015. Available at http://arXiv.org/abs/ 1408.4837. H. F. Trotter. An elementary proof of the central limit theorem. Arch. Math., 10:226–234, 1959. J. A. Tropp. Just relax: convex programming methods for identifying sparse signals in noise. IEEE Trans. Inform. Theory, 52(3):1030–1051, 2006. 84 [Tro15a] [Tro15b] [Tro15c] [TV15] [Ver12] [Ver15] [Wen62] [Woo14] [Yin86] S. OYMAK AND J. A. TROPP J. A. Tropp. Code for reproducing figures from Oymak & Tropp, Universality Laws for Randomized Dimension Reduction, with Applications, 2015.ropp, Universality Laws for Randomized Dimension Reduction, with Applications, 2015. Available at http://users.cms.caltech.edu/~jtropp, Nov. 2015. J. A. Tropp. Convex recovery of a structured signal from independent random measurements. In G. Pfander, editor, Sampling Theory: A Rennaissance. Birkhäuser Verlag, 2015. Available at http://arXiv.org/abs/1405.1102. J. A. Tropp. The expected norm of a sum of independent random matrices: An elementary approach. In HighDimensional Probability VII, Cargèse, June 2015. To appear. Available at http://arXiv.org/abs/1506.04711. T. Tao and V. Vu. Random matrices: universality of local spectral statistics of non-Hermitian matrices. Ann. Probab., 43(2):782–874, 2015. R. Vershynin. Introduction to the non-asymptotic analysis of random matrices. In Compressed sensing, pages 210–268. Cambridge Univ. Press, Cambridge, 2012. R. Vershynin. Estimation in high dimensions: A geometric perspective. In G. Pfander, editor, Sampling Theory: A Rennaissance. Birkhäuser Verlag, 2015. J. G. Wendel. A problem in geometric probability. Math. Scand., 11:109–111, 1962. D. P. Woodruff. Sketching as a tool for numerical linear algebra. Foundations and Trends® in Theoretical Computer Science, 10(1–2):1–157, 2014. Y. Q. Yin. Limiting spectral distribution for a class of random matrices. J. Multivariate Anal., 20(1):50–68, 1986.
7cs.IT
Almost-global tracking for a rigid body with internal rotors arXiv:1703.07839v2 [cs.SY] 24 Mar 2017 A. Nayak1, R. N. Banavar2 and D. H. S. Maithripala Abstract— Almost-global orientation trajectory tracking for a rigid body with external actuation has been well studied in the literature, and in the geometric setting as well. The tracking control law relies on the fact that a rigid body is a simple mechanical system (SMS) on the 3−dimensional group of special orthogonal matrices. However, the problem of designing feedback control laws for tracking using internal actuation mechanisms, like rotors or control moment gyros, has received lesser attention from a geometric point of view. An internally actuated rigid body is not a simple mechanical system, and the phase-space here evolves on the level set of a momentum map. In this note, we propose a novel proportional integral derivative (PID) control law for a rigid body with 3 internal rotors, that achieves tracking of feasible trajectories from almost all initial conditions. I. I NTRODUCTION Spacecrafts are actuated either through internal or external mechanisms. External mechanisms include gas jet thrusters while internal mechanisms include spinning rotors and control moment gyros. In the recent past, there has been an increased interest in the design of coordinate-free control laws for simple mechanical systems ( [4], defined in section II) which evolve on Lie groups. Results on stabilization of a rigid body, which is an SMS on SO(3), about a desired configuration in SO(3) using proportional plus derivative (PD) control are found in [2], [7], [5]. Geometric tracking of specific mechanical systems such as a quadrotor, which is an SMS on SE(3), and a rigid body, can be found in [13], [12]. Almost-global tracking of a reference trajectory for an SMS on a Lie group implies tracking of the reference from almost all initial conditions in the tangent bundle of the Lie group. A general result on almost-global asymptotic tracking (AGAT) for an SMS on a class of compact Lie groups is found in [16]. In all these results, the rigid body is assumed to be externally actuated and the control torque is supplied through actuators such as gas jets. Almost-global stabilization and tracking of the externally actuated rigid body is, therefore, a sufficiently well studied problem. However, the problem of geometric tracking for an internally actuated rigid body has received much less attention. Interconnected mechanical systems have been studied in the context of spherical mobile robots in [8], [6], [10] et al.The stabilization of the internally actuated rigid body is studied in [3]. It is shown that any feedback torque on the 1 A. Nayak is with Systems and Control Engineering, Indian Institute of Technology Bombay, India. [email protected] 2 R. N. Banavar is currently visiting professor at Department of Electrical Engineering, Indian Institute of Technology Gandhinagar, [email protected] 3 D. H. S. Maithripala is with the University of Peradeniya, Sri Lanka. [email protected] 3 externally actuated rigid body can be realised with 3 internal rotors attached to the rigid body. This paper illustrates the fact that despite the feedback forces acting on an externally actuated rigid body, it is still Hamiltonian and behaves like a heavy rigid body. In other words, if a certain class of feedback torque is applied to the rotors, the rigid body with the rotors is a fully actuated SMS on SO(3). This motivates us to study the AGAT problem for a rigid body with rotors as AGAT for an SMS has been studied extensively ( [16], [19], [15]). In [2] and [22] the almost-global asymptotic stabilization (AGAS) problem of a rigid body with 3 internally mounted rotors is solved using proportional plus derivative (PD) control. In [9], rigid body tracking is achieved using both external and internal actuation using local representation for rotation matrices. In [14], the trajectory tracking problem is considered for a hoop robot with internal actuation such as a pendulum. It is shown that a class of internal actuation configurations exist for which the underactuated mechanical system can be converted to a fully actuated SMS by feedback torques. AGAT of an SMS on a Lie group is often achieved by a proportional plus derivative type control( [19], [16]). A configuration error is chosen on the Lie group with the help of the group operation along with a compatible navigation function. A navigation function is a Morse function with a unique minimum. The closed loop error dynamics, for a control force proportional to the negative gradient covector field generated by the navigation function plus a dissipative covector field, is then an SMS,. This control drives the error dynamics to the lifted minimum of the navigation function on the tangent bundle of the Lie group from all but the lifted saddle points and maxima of the navigation function. As the critical points of a Morse function are isolated, this convergence is almost global. The compatibility conditions in [19] ensure that the error function is symmetric and achieves its minimum when two configurations coincide. In [15], the authors propose an ’integral’ action to the existing PD control law in [16]. The addition of an integral term makes the control law robust to bounded parametric uncertainty. A rigid body with internal rotors is an underactuated, interconnected simple mechanical system. The control torque provided to the rotors gets reflected through the interconnection mechanism to the rigid body. Due to absence of external forces, the total angular momentum is conserved. This restriction implies that only a certain class of angular velocities can be attained at any configuration in SO(3). Also, due to the presence of quadratic rotor velocity terms, the rigid body alone is not an SMS. We isolate the rigid body dynamics by introduction of feedback control terms in the system dynamics so that the closed loop rigid body dynamics is a fully actuated SMS. Thereafter we apply the existing AGAT control to the rigid body and obtain the corresponding rotor trajectories from the rotor dynamics. As the control objective is to track a suitable reference trajectory on SO(3), the rotor speeds are allowed to be arbitrary. The paper is organised as follows- in section II, after presenting a few mathematical preliminaries, we derive equations for the rigid body with external actuation and with 3 internal rotors. In section III we append an integral term to the control law for AGAT of an SMS on a Lie group in [19] and propose the AGAT control for the rigid body with 3 rotors for an admissible class of reference trajectories. In section IV we present simulation results for the proposed control law. II. P RELIMINARIES This section introduces conventional mathematical notions to describe simple mechanical systems which can be found in [4], [17], [1]. A Riemannian manifold is denoted by the 2tuple (Q, G), where Q is a smooth connected manifold and G is the metric on Q. ∇ denotes the Riemannian connection on (Q, G) ( [21], [23]).The flat map G♭ ∶ Tq Q → Tq∗ Q is given by G(v1 , v2 ) = ⟨G♭ (v1 ); v2 ⟩ for v1 ,v2 ∈ Tq Q and the sharp map is its dual G♯ ∶ Tq∗ Q → Tq Q, and given by G−1 (w1 , w2 ) = ⟨G♯ (w1 ); w2 ⟩ where w1 , w2 ∈ Tq∗ Q. Therefore if {ei } is a basis for Tq∗ Q, G♭ (v1 ) = Gij v1 j ei and G♯ (w1 ) = Gij w1j ei . Definition 1: (SMS) A simple mechanical system (or SMS) on a smooth manifold Q with a metric G is denoted by the 7-tuple (Q, G, V, F, F , U ), where V is a potential function on Q, F is an external uncontrolled force, F = {F 1 . . . F m } is a collection of covector fields on Q, and U ⊂ Rm is the control set. The system is fully actuated if Tq∗ Q = span{Fq }, ∀q ∈ Q. The governing equations for the above SMS without any control input is given by G ∇γ̇(t) γ̇(t) = −gradV (γ(t)) + G♯ (F (γ̇(t))) (1) where gradV (γ(t)) = G♯ dV (γ(t)) and γ(t) is the system trajectory. Let G be a Lie group and let g denote its Lie algebra. Let φ ∶ G × G → G be the left group action in the first argument defined as φ(g, h) ∶= Lg (h) = gh for all g, h ∈ G. The infinitesimal generator corresponding to ξ ∈ g is ξQ ∈ d ∣t=0 φ(exp(tξ), q), Γ∞ (T Q) which is defined as ξQ (q) = dt where exp denotes the exponential map. The Lie bracket on g is [, ]. The adjoint map, adξ ∶ g → g for ξ ∈ g is defined as adξ η ∶= [ξ, η] for η ∈ g. Let I ∶ g → g∗ be an isomorphism from the Lie algebra to its dual. The inverse is denoted by I♯ ∶ g∗ → g. I induces a left invariant metric on G ( [4]), which we denote by GI and define by the following GI (g).(Xg , Yg ) = ⟨I(Tg Lg−1 (Xg )), Tg Lg−1 (Yg )⟩ for all g ∈ G and Xg , Yg ∈ Tg G. The equations of motion for the SMS (G, I, F ) where F ∈ g∗ are derived from (1) given by ξ = Tg Lg−1 ġ, ♯ ξ̇ − I ad∗ξ Iξ (2) ♯ =I F where g(t) describes the system trajectory. ξ(t) is called the body velocity of g(t). A. Dynamics of a rigid body with external actuation Consider a rigid body with external actuation provided through gas jets mounted on the principal axes. Let I ∈ R3×3 denote the moment of inertia of the rigid body in the body frame, u ∈ so(3) ∼ R3 be the control vector field applied to the gas jets, R(t) ∈ SO(3) be the system trajectory and Ω(t) be the body velocity of R(t). As this is a SMS given by (SO(3), I, Iu), the equations of motion are given by (2) with F = Iu as follows Ω̇ − I ̂ Ṙ = RΩ ♯ ad∗Ω IΩ (3a) = uext (3b) B. Dynamics of a rigid body with internal actuation Rigid body 3 rotors mounted on principal axes of the rigid body Fig. 1: Rigid body with 3 rotors In the internal actuation case, for a rigid body with 3 rotors, the configuration space is Q = SO(3) × S 1 × S 1 × S 1 and the configuration variable is denoted as q = (R, Θ) where T R ∈ SO(3) and Θ = (θ1 θ2 θ3 ) , θi ∈ S 1 for i = 1, 2, 3. The rotors are assumed to be mounted on the principal axes of the rigid body as shown in Figure 1. The moment of inertia of the rigid body is I ∈ R3×3 in the rigid body frame. K = diag(k1 , k2 , k3 ) is the inertia matrix of the 3 rotors in the rigid body frame, where ki is moment of inertia of ith rotor, i = 1, 2, 3. In the absence of potential energy, the Lagrangian is chosen to be the kinetic energy and given as 1 1 L(q, q̇) = ⟨Ω, IΩ⟩ + ⟨Ω + Ωr , K(Ω + Ωr )⟩ 2 2 (4) where Ω̂ = R−1 Ṙ and Ωr = (θ̇1 θ̇2 θ̇3 ) . The manifold Q is a trivial principal G− bundle as Q = G × S where the Lie group is G = SO(3) and the shape space is S = S 1 ×S 1 ×S 1 . Using the trivialization in Q it can be shown that (T Q) is locally diffeomorphic to T S × g × G. Therefore, (T Q)/G is diffeomorphic to T S × g. Further, as the lagrangian in (4) is invariant under the action of the G, it reduces from a function T on T Q to a function on (T Q)/G. By the local trivialization coordinates on (T Q)/G are (Θ, Ωr , Ω) where, (Θ, Ωr ) are coordinates for T S and Ω is the coordinate for g. Therefore, the reduced Lagrangian l ∶ (T Q)/G → R is 1 1 l(Θ, Θ̇, Ω) = ⟨Ω, IΩ⟩ + ⟨Ω + Ωr , K(Ω + Ωr )⟩ (5) 2 2 The variational principle with the reduced Lagrangian is applied by dividing variations δq of q into those only in Θ and those only in R. In Θ, we get the usual Euler Lagrange equations, while in R, we obtain Euler Poincare equations. The equations of motion are together called Hamel equations ( [18]) d ∂l ∂l ( ) = ad∗Ω ( ), (6a) dt ∂Ω ∂Ω d ∂l ∂l ( )+ = uint dt ∂Ωr ∂Θ (6b) where uint ∈ TΘ (S 1 × S 1 × S 1 ) is the control input applied to the rotors and the reconstruction equation is given as Ω̂ = R−1 Ṙ. Substituting for l from (5) in (6), (I + K)Ω̇ + K Ω̇r = Π × Ω, (7a) K(Ω̇ + Ω̇r ) = uint (7b) where Π = (I + K)Ω + KΩr is the body angular momentum. The reconstruction equation for attitude of spacecraft and angular displacement of rotors is given by Ṙ = RΩ̂, K Ω̇ Π×Ω 0 )( ) = ( )+( ) K Ω˙r 0 uint (8) Therefore, (8) is an underactuated SMS. III. G EOMETRIC OBJECTS AND ADMISSIBLE TRAJECTORIES J TQ ⟨J(q, v), ξ⟩ =≪ v, ξQ (q) ≫ (9) A(Θ, R, Ωr , Ω) = A(Θ)Ωr + Ω (10) for (q, v) ∈ T Q and ξ ∈ g. The mechanical connection A ∶ T Q → g is expressed in terms of connection coefficient A(Θ) in the body frame as A(Θ) ∶ TΘ (S × S × S ) → so(3) is the obtained from (4) as A(Θ) = (I + K)−1 K (details in [20]) and therefore, 1 1 1 A(Θ, R, Ωr , Ω) = (I + K)−1 KΩr + Ω (11) ∗ The locked inertia tensor is I(Θ, R) ∶ so(3) → so(3) in body frame is the obtained from (4) as I = (I + K) and in the inertial frame as I(Θ, R) = R(I + K)R−1 . It is observed that A(Θ, R, Ωr , Ω) = I−1 (Θ, R)J(Θ, R, Ωr , Ω) (12) Π = I((I + K)−1 KΩr + Ω) = (I + K)Ω + KΩr (13) J(Θ, R, Ωr , Ω) = I(Θ, R)A(Θ, R, Ωr , Ω) = RΠ (14) where J ∶ T Q → g is defined in (9). Details of this result can be found in [18] and [17]. Therefore, from (12), the momentum map in rigid body frame is and the momentum map in the inertial frame gives the conserved angular momentum which is Here we assume the reference trajectory is generated by another rigid body with 3 rotors. If the spatial angular momentum of the system is µ, any reference trajectory must lie in the µ level set of J. In other words, the set of reference trajectories is given as Θ̇ = Ωr respectively. Remark: (7) can be written as I +K ( K as the Lagrangian (in (4)) is invariant with respect to action of SO(3). J ∶ T Q → g∗ is defined as g∗ A I g Fig. 2: Relationship between the mechanical connection, locked inertia tensor and momentum map in a principle fibre bundle The momentum map J ∶ T (SO(3) × S 1 × S 1 × S 1 ) → ∗ so(3) gives the conserved quantity along trajectories to (6) S = {(Rd , Θd , Ωd , Ωrd ) ∈ T Q ∶ J(Ωd , Ωrd ) = µ} (15) where µ of the system is given by (13) and Ωd = Ṙd . TRd LR−1 d IV. AGAT CONTROL In this section we first state the result from [19] for AGAT of a fully actuated rigid body with external actuators and subsequently extend it to AGAT for the rigid body with 3 internal rotors. Definition 2: A function ψ ∶ G → R on a Lie group G is a navigation function ( [11]) if 1) ψ has a unique minimum. 2) All critical points of ψ are non-degenerate; Det(Hessψ(q)) ≠ 0 whenever dψ(q) = 0 for q ∈ G. Definition 3: The configuration error on a Lie group G is the map E ∶ G × G → G defined as (16) E(g, gr ) = Lgr g −1 . Definition 4: Consider a Lie group G and a navigation function ψ ∶ G → R. The configuration error map E is compatible with a navigation function ψ for the tracking problem if ψ ○ E ∶ G × G → R is symmetric; or, ψ(E(g, h)) = ψ(E(h, g)) for all g, h ∈ G. ● E(e) = q0 , where q0 is the minimum of the navigation function and e is the identity of G. The AGAT problem for a rigid body with rotors is solved in two parts. In the first part a PID control law is proposed for AGAT of a rigid body with external actuation and in the second part a feedback control law is chosen so that the equations for a rigid body with rotors reduce to an externally actuated rigid body. The first problem is well addressed in literature ( [15], [16], [19]). In [19], a proportional derivative (PD) and feed-forward (FF) control law achieves AGAT of a reference trajectory on SO(3). We introduce an additional integral control term to the PD+FF tracking control along the lines of [15] in the following theorem. Theorem 1: (AGAT for an SMS on a Lie group) Let G be a compact Lie group and I ∶ g → g∗ be an isomorphism on the Lie algebra. Consider the SMS on the Riemannian manifold (G, I) given by (2) and a smooth reference trajectory with bounded velocity gr ∶ R → G on the Lie group. Let ψ ∶ G → R be a navigation function compatible with the error map in (16). Then there exists an open dense set S in G × g such that AGAT of gr is achieved for all (g(0), ξ(0)) ∈ S with u = I♯ (F ) in (2) given by the following equation ● u = −gr−1 G♯I (−kp dψ(E) − kd Ė − kI ξI )g + g −1 (∇η η (17) d + E −1 d2 E(ġr ))g − I ♯ ad∗ξ Iξ dt g where η ∶= TE LE −1 Ė, kp , Kd and kI are constants to be chosen as shown in Appendix A and ξI is defined as GI ∇Ė ξI = G♯I dψ(E). (18) Proof: Appendix I. Theorem 2: (AGAT for a rigid body with 3 rotors) Consider the rigid body with 3 rotors in (7) and a smooth, bounded reference trajectory Rd ∶ R → SO(3) so that (Rd , Ωd ) ∈ S given by (15) for some Ωrd ∈ R3 . Let ψ ∶ G → R be a navigation function compatible with the error map in (16). Then there exists an open dense set P in G × g such that AGAT of gr is achieved for all (g(0), ξ(0)) ∈ P with uint in (7) given by the following equation where uint = −uext ˘ + K(Ω + Ωr ) × Ω (19) uext = −R−1 (I −1 (−kp skew(P E) − kd E −1 Ė − kI E −1 ξI ) (20) ̂ ̂ ̂ − I −1 ad∗ Iη)R + Ω˙d + [Ω, Ωd ] − I ♯ ad∗ I Ω, ̂ Ω η P is a positive definite symmetric matrix, E = Rd R−1 and ξI is defined in (18). Proof: Substituting for K Ω̇r from the second equation in (6) to the first Therefore, (I + K)Ω̇ + uint − K Ω̇ = Π × Ω (21) I Ω̇ − Π × Ω = −uint (22) From (13), I Ω̇ − IΩ × Ω = −uint + K(Ω + Ωr ) × Ω (23) Ω̇r = (I + K)−1 uint − I −1 Π × Ω (24) From (2), the left hand side is a SMS on SO(3) similar to (3) where Ω is the body velocity of the rigid body and the right hand side is the control field which is to be designed for AGAT of the rigid body. Therefore, theorem 1 is applicable. As the objective is AGAT of the rigid body and not the rotors, we set uext ˘ = −uint + K(Ω + Ωr ) × Ω where uext ∈ so(3) is obtained from (17) by choosing ψ(R) = trace(P (I − R)) for a positive definite symmetric matrix P and E ∶= Rd R−1 is the configuration error defined in (16). It can be shown that ψ is a navigation function compatible with E. Details of this result can be found in [19]. The rotor dynamics is given by substituting for Ω̇ from (22) in (7) as Remark: In [15], the externally actuated rigid body is allowed to have bounded parametric uncertainty in inertia and actuation models and AGAT is achieved for the proposed PID control law. For the rigid body with rotors, however, the presence of bounded parametric uncertainty and bounded constant disturbances leads to semi-global convergence as shown in [14] for interconnected mechanical systems. V. S IMULATION RESULTS Consider a rigid body with rotors having the following 1⎞ ⎛4 1 parameters I = ⎜1 5.2 2 ⎟,K = diag(5, 6, 7) and the ⎝1 2 6.3⎠ ⎛ 0.36 0.48 −0.8⎞ 0 ⎟, following initial conditions R(0) = ⎜−0.8 0.6 ⎝ 0.48 0.64 0.60 ⎠ Ω(0) = I −1 (1 2.2 5.1) and Ωr (0) = (.5 1.9 1.5). The reference trajectory is generated by a dummy rigid body with ⎛1 0 0⎞ rotors having the following parameters Id = ⎜0 1.2 0⎟, ⎝0 0 2⎠ Kd = diag(4, 3, 2) and the following initial conditions T Rd (0) = id(3), Ωd (0) = Id−1 (−0.8 −0.3 −0.5) , Ωrd (0) given by the momentum conservation equation (15) and, a T constant input vector field uint = (0; 0; 0) is applied. The dynamics of the dummy rigid body is given by (7). In order to find Kp , Kd and KI we use the bounds in Appendix I. µ = 2 ∗ (λmin (I) + λmax (I))/λmin (I) = 2.0048, max (I) λ = 2 λλmin = 1.42. We choose KI = 1, Kd = 3 (I)2 and Kp = 1 to find u1 in (17) and subsequently u in (19). The simulation results are shown in figure 3. (https://www.dropbox.com/s/7ji88vri7mp2pxd/circle.avi?dl=0 ) is a video link showing 3-D tracking of the axis representation in the quaternion representation. In both the cases, the reference trajectory is in red and the controlled trajectory is in blue and the plots show both the trajectories in matrix representation of SO(3). Now the reference trajectory is generated by the same dummy rigid body with uint = (sin(t) cos(t) sin(t)) 1 1 0.8 0.8 0.6 0.6 0.4 0.2 0 -0.2 -0.4 1 R(1, 2)(t), Rd (1, 2)(t) → R(1, 1)(t), Rd (1, 1)(t) → 1 0.5 0 -0.5 -1 0 10 20 15 20 25 (b) (1, 2)(t) R(2, 2)(t), Rd (2, 2)(t) → R(2, 1)(t), Rd (2, 1)(t) → 0.5 0 -0.5 -1 30 1 0 10 20 0.5 0 -0.5 -1 30 0 10 20 t→ 30 t→ (c) (2, 1)(t) (d) (2, 2)(t) Fig. 5: Representative plots for uint = (sin t; cos t; sin t) as input torque to reference rigid body T 0.2 0 1.2 30 1 Our Reference Existing -0.4 0.6 our Refrence Existing 0.8 our reference existing 0.4 0.6 0.8 0.2 0 5 10 t→ 15 20 25 30 t→ R(1, 2)(t), Rd (1, 2)(t) → 10 20 t→ (a) (1, 1)(t) R(1, 1)(t), Rd (1, 1)(t) → 5 10 -0.2 -1 0 0 0.4 -0.8 -1 -1 30 1 -0.6 -0.8 0 -0.5 t→ 1 -0.6 0.5 0.6 0.4 0.2 0 -0.2 R(1, 3)(t), Rd (1, 3)(t) → R(1, 2)(t), Rd (1, 2)(t) → R(1, 1)(t), Rd (1, 1)(t) → and uint = (0.2 0.1 0.2). The simulations are shown in figures 4 and 5 respectively. We compare the control effort by considering the 2− norm of uext ˘ in (20) with the AGAT control for a rigid body in [15]. The trace function is considered as a navigation function on SO(3) with the same P , kd , kp and kI values for both the simulations. The trajectories for tracking the same reference are plotted in figure 6. The control law for internal actuation is obtained from (19) for the AGAT tracking law in [15] and compared with the proposed control in figure 7. 0.4 0.2 0 -0.2 -0.4 0 -0.2 -0.4 -0.6 -0.4 -0.6 -0.6 -0.8 -0.8 0 5 10 15 t→ 20 25 -1 30 0.8 0.6 R(2, 2)(t), Rd (2, 2)(t) → R(2, 1)(t), Rd (2, 1)(t) → 0.2 0 -0.2 -0.4 -0.6 0.4 0 -0.4 0.2 0 -0.8 -1 -0.2 20 25 -1 30 0 5 10 15 t→ 20 25 30 1 our reference existing our reference existing 0.8 0.6 0.5 0 0.4 0.2 0 -0.2 -0.4 -0.5 -0.6 0 5 10 15 t→ 20 25 30 -1 0 5 10 15 t→ 20 25 30 -0.8 0 5 10 15 t→ 20 25 30 -0.4 -0.6 -0.8 Fig. 6: Comparison of tracking results for uint T (0.2; 0.1; 0.2) as input torque to reference rigid body -0.8 -1 -1 0 5 10 15 20 25 30 0 5 10 t→ 15 20 25 30 t→ (c) (2, 1)(t) of both trajecto- (d) (2, 2)(t) of both trajectories ries Fig. 3: Representative plots for uint = (0; 0; 0) torque to reference rigid body T 1 1 0.8 0.8 R(1, 2)(t), Rd (1, 2)(t) → 0.4 0.2 0 -0.2 -0.4 where ξI is defined in (18). Therefore, ui ∈ TE G. Consider Ecl ∶ T G × T G → R given as Ecl (E, Ė, G♯ dψ(E)) = 1 ≪ Ė, Ė ≫ +kp ψ(E) (26) 2 τ + ≪ ξI , ξI ≫ 2 + α ≪ G♯ dψ(E), Ė ≫ +β ≪ ξI , Ė ≫ 0.4 0.2 0 -0.2 -0.4 -0.6 -0.6 -0.8 -0.8 -1 0 5 10 15 20 25 30 = as input 0.6 0.6 R(1, 1)(t), Rd (1, 1)(t) → 0.2 -0.2 -0.6 15 t→ 1 R(2, 2)(t), Rd (2, 2)(t) → 0.8 0.4 10 existing reference our 0.6 R(1, 4)(t), Rd (1, 4)(t) → 1 0.6 5 1.5 0.4 0.8 -0.8 0 R(2, 3)(t), Rd (2, 3)(t) → (a) (1, 1)(t) of both trajecto- (b) (1, 2)(t) of both trajectories ries 0 5 10 t→ 15 20 25 30 t→ (a) (1, 1)(t) + δ ≪ G♯ dψ(E), ξI ≫ (b) (1, 2)(t) 0.8 0.5 0.6 R(2, 1)(t), Rd (2, 1)(t) → R(1, 3)(t), Rd (1, 3)(t) → 0.4 0 -0.5 0.2 0 -0.2 -0.4 -0.6 -0.8 -1 -1 0 5 10 15 20 25 30 0 5 t→ 10 15 20 25 30 t→ (c) (1, 3)(t) (d) (2, 1)(t) Fig. 4: Representative plots for uint = (0.2; 0.1; 0.2) input torque to reference rigid body T as A PPENDIX I We define ve ∶= Ė where E(g(t), gr (t)) is the error trajectory on G defined in (16). The error dynamics for the SMS in (2) is for some constants kp , kI , kd , α, β, τ , δ that will be determined shortly. The following shows Ecl is negative semi-definite. We essentially follow the proof outlined in [15]. Remark: The objective is to show that Ecl is non-increasing along trajectories to (7). The derivative of the first term is given by (25). Therefore, appropriately weighted cross terms in (26) must be introduced so that Ecl is negative semidefinite. d Ecl =≪ ∇Ė Ė, Ė ≫ +kp ≪ G♯ dψ(E), Ė ≫ dt + τ ≪ ∇Ė ξI , ξI ≫ +α ≪ ∇Ė G♯ dψ(E), Ė ≫ + α ≪ G♯ dψ(E), ∇Ė Ė ≫ +β ≪ ∇Ė ξI , Ė ≫ + β ≪ ξI , ∇Ė Ė ≫ +δ ≪ ∇Ė G♯ dψ(E), ξI ≫ + δ ≪ G♯ dψ(E), ∇Ė ξI ≫ GI ∇Ė(g(t),gr (t)) ve = −kp G♯ dψ(E) − kd Ė − kI ξI (25) 25 Our Existing 8 Norm of u(t)int → Norm of uext (t) → 10 6 4 2 0 0 5 10 15 20 25 30 Existing our 20 15 Q22 = 10 5 0 Q11 = kd − µα = kd − µ kkI2 , 0 5 10 15 20 (Control effort) t → (Control effort) t → (a) uext (b) uint 25 30 Fig. 7: Comparison of 2− norm of control effort for uint = T (0.2; 0.1; 0.2) as input torque to reference rigid body Grouping together terms and using the fact that ∇Ė ξI = G♯ dψ(E), we have, d Ecl =≪ ∇Ė Ė, Ė + αG♯ dψ(E) + βξI ≫ dt + kp ≪ G♯ dψ(E), Ė ≫ + ≪ ∇Ė G♯ dψ(E), αĖ + δξI ≫ + ≪ G♯ dψ(E), τ ξI + β Ė + δG♯ dψ(E) ≫ From (25), d Ecl = −kd ≪ Ė, Ė ≫ +(β − kd α) ≪ Ė, G♯ dψ(E) ≫ dt − (kd β + kI ) ≪ Ė, ξI ≫ + (δ − αkp ) ≪ G♯ dψ(E), G♯ dψ(E) ≫ + (τ − kp β + αkI ) ≪ G♯ dψ(E), ξI ≫ − βkI ≪ ξI , ξI ≫ + ≪ ∇Ė G♯ dψ(E), αĖ + δξI ≫ The Hess(ψ(q)) is a (0, 2) tensor on Tq G defined as Hess(ψ(q))(X, Y ) =≪ ∇X G♯ dψ(q), Y ≫ for X,Y ∈ Tq G, q ∈ G. As ψ is a navigation function with a unique minimum at q0 ∈ G, there exists an compact neighborhood Sq0 of (q0 , 0, 0) in T G × T G in which the Hess(ψ) is postivedefinite and ∣∣Hess(ψ)∣∣2 is bounded. This implies there is a µ > 0 such that ≪ ∇X G♯ dψ(q), Y ≫< µ ≪ X, Y ≫ for all (q, X, Y ) ∈ Sq0 . Therefore, kI 2 (kp kd − 2κkd2 ) and Q33 = d k ⎛kd − µ kdI2 ⎜ 0 Q=⎜ ⎜ ⎝ −σkI kI 2 (kp kd kI2 . kd Then, 0 − 2κkd2 ) 0 −σkI ⎞ 0 ⎟ ⎟. ⎟ kI2 ⎠ k d It is observed that the leading principal minors of Q are k3 positive if kp > 2κkd2 and 0 < kI < µd (1 − σ 2 ). Let λ ∶= ♯ ♯ dψ(E)≫ . It can be shown ( [15]) that Ecl supSq0 ≪G dψ(E),G 2ψ(E) is positive definite for all (E, Ė, G♯ dψ(E)) ∈ Sq0 with kp > 6 2 4κ2 kI kd +kI3 +kI2 kd kp α2 ) λ (σ(τ +τ =λ . Therefore, we choose kp > 5 −β 2 ) kp kd √ ⎧ ⎫ ⎪ ⎪ ⎪ 4k3 (k2 +4κ2 k6 ) ⎪ λk2 max⎨2κkd2 , 2k4I (1 + 1 + d Iλk3 d ) ⎬ so that both Q I ⎪ ⎪ d ⎪ ⎪ ⎩ ⎭ and Ecl are positive definite. The error dynamics (25) is a dissipative SMS with a control vector field proportional to gradient of a navigation function. From the result in [11], therefore, ui achieves AGAS of the error dynamics. From [19], AGAT control for (3) is given by uext = −gr−1 G♯I (ui )g + g −1 (∇η η + g − I ♯ ad∗ξ Iξ d −1 E d2 E(ġr ))g dt ACKNOWLEDGMENT A part of this work was carried out when the second author was visiting IIT-Gandhinagar. Ravi N Banavar acknowledges with pleasure the support provided by IIT-Gandhinagar. R EFERENCES [1] Vladimir I Arnol’d. Mathematical methods of classical mechanics, volume 60. Springer Science & Business Media, 2013. [2] Ramaprakash Bayadi and Ravi N Banavar. Almost global attitude stabilization of a rigid body for both internal and external actuation schemes. European Journal of Control, 20(1):45–54, 2014. [3] Anthony M Bloch, Perinkulam S Krishnaprasad, Jerrold E Marsden, and G Sánchez De Alvarez. Stabilization of rigid body dynamics by internal and external torques. Automatica, 28(4):745–756, 1992. [4] Francesco Bullo and Andrew D Lewis. Geometric control of mechan≪ ∇Ė G♯ dψ(E), αĖ + δξI ≫ < µα ≪ Ė, Ė ≫ ical systems: modeling, analysis, and design for simple mechanical control systems, volume 49. Springer Science & Business Media, + µδ ≪ Ė, ξI ≫ 2004. [5] Francesco Bullo and Richard M Murray. Tracking for fully actuated So, mechanical systems: a geometric framework. Automatica, 35(1):17– d 34, 1999. Ecl ≤ −vQv T [6] Yao Cai, Qiang Zhan, and Xi Xi. Path tracking control of a spherical dt mobile robot. Mechanism and Machine Theory, 51:58–73, 2012. where v = (∣∣Ė∣∣ ∣∣G♯ dψ(E)∣∣ ∣∣ξI ∣∣) and [7] Peter Crouch. Spacecraft attitude control and stabilization: Applications of geometric control theory to rigid body models. IEEE Q= Transactions on Automatic Control, 29(4):321–331, 1984. [8] Sneha Gajbhiye and Ravi N Banavar. Geometric approach to tracking 1 1 kd − µα (kd α − β) (kd β + kI − µδ) ⎞ ⎛ and stabilization for a spherical robot actuated by internal rotors. 2 2 1 CoRR, abs/1511.00428, 2015. αkp − δ (k ⎜ 21 (kd α − β) p β + αkI − τ )⎟ 2 [9] Christopher Hall, Panagiotis Tsiotras, and Haijun Shen. Tracking rigid ⎝ 1 (kd β + kI − µδ) 1 (kp β + αkI − τ ) ⎠ βk I 2 2 body motion using thrusters and momentum wheels. In AIAA/AAS Astrodynamics Specialist Conference and Exhibit, page 4471, 1998. We shall now express α, β, δ and τ in terms of kp , kd and [10] Yury L Karavaev and Alexander A Kilin. The dynamics and control β kI . We set α = kd so that Q12 = Q21 = 0. Next, we choose of a spherical robot with an internal omniwheel platform. Regular and Chaotic Dynamics, 20(2):134–152, 2015. τ = kp β+αkI makes Q23 = Q32 = 0. Let β = kkdI and δ = 2κkI [11] D. Koditschek. The application of total energy as a lyapunov function such that µ1 < κ < µ2 . This makes Q13 = Q31 = µδ − 2kI = for mechanical control systems. Contemporary Mathematics, 97:131, −σkI where σ > 0. 1989. [12] Taeyoung Lee. Geometric tracking control of attitude dynamics of a rigid body on SO(3). American Control Conference, pages 1200–1205, 2011. [13] Taeyoung Lee, Melvin Leoky, and N Harris McClamroch. Geometric tracking control of a quadrotor uav on se (3). In Decision and Control (CDC), 2010 49th IEEE Conference on, pages 5420–5425. IEEE, 2010. [14] TWU Madhushani, DHS Maithripala, and JM Berg. Feedback regularization and geometric pid control for trajectory tracking of coupled mechanical systems: Hoop robots on an inclined plane. arXiv preprint arXiv:1609.09557, 2016. [15] DH Sanjeeva Maithripala and Jordan M Berg. An intrinsic robust pid controller on lie groups. In 53rd IEEE Conference on Decision and Control, pages 5606–5611. IEEE, 2014. [16] DH Sanjeeva Maithripala, Jordan M Berg, and Wijesuriya P Dayawansa. Almost-global tracking of simple mechanical systems on a general class of lie groups. IEEE Transactions on Automatic Control, 51(2):216–225, 2006. [17] Jerrold E Marsden and Tudor Ratiu. Introduction to mechanics and symmetry: a basic exposition of classical mechanical systems, volume 17. Springer Science & Business Media, 2013. [18] Jerrold E Marsden and Jürgen Scheurle. The reduced euler-lagrange equations. Fields Institute Comm, 1:139–164, 1993. [19] Aradhana Nayak and Ravi N Banavar. On almost-global tracking for a certain class of simple mechanical systems. arXiv preprint arXiv:1511.00796, 2015. [20] James P Ostrowski. Computing reduced equations for robotic systems with constraints and symmetries. IEEE Transactions on Robotics and Automation, 15(1):111–123, 1999. [21] P. Petersen. Graduate Texts in Mathematics- Riemannian Geometry. Springer, October 1998. [22] Avishai Weiss, Xuebo Yang, Ilya Kolmanovsky, and Dennis Bernstein. Inertia-free spacecraft attitude control with reaction-wheel actuation. In AIAA Guidance, Navigation, and Control Conference, page 8297, 2010. [23] Kentarō Yano. Integral formulas in Riemannian geometry, volume 1. M. Dekker, 1970.
3cs.SY
Characterisation of speech diversity using self-organising maps Tom A. F. Anderson, David M. W. Powers Flinders University [email protected], [email protected] Index Terms: Kohonen speech typewriter, Australian speech, semi-supervised SOM training and boosting arXiv:1702.02092v1 [cs.CL] 23 Jan 2017 1. Introduction We report investigations into speaker classification of larger quantities of unlabelled speech data using small sets of manually phonemically annotated speech. The Kohonen speech typewriter [1] is a semi-supervised method comprised of selforganising maps (SOMs) that achieves low phoneme error rates. A SOM is a 2D array of cells that learn vector representations of the data based on neighbourhoods. In this paper, we report a method to evaluate pronunciation using multilevel SOMs with /hVd/ single syllable utterances for the study of vowels, following [2] (for Australian pronunciation). The vowel error rate, shown in Table 1, was calculated by comparing the most frequent vowel label outputted for an audio file with the vowel noted by manual annotators. Our method of using initial, vowel, or final for submaps was observed to be slightly better than Kohonen’s method of using submaps to disambiguate confused phonemes, and particularly for Chinese, marginally significant. Table 1: Vowel Error Rate for single (25x25 classifier), or multiSOMs trained on confused vowels (Vowels) or initial, vowel, or final (h V d) (standard error in parentheses) based on 10 CV over word tokens. Type Single Vowels hVd 2. Methodology We used 18 /hVd/ words from AusTalk, an Australian speech research corpus collected from speakers of Australian English [3]. Audio was converted to conventional 39-feature mel-frequency cepstral coefficients (MFCCs, log energy, and differential and acceleration calculated on 25 ms windows with 10 ms offsets).1 To investigate the sensitivity of our phonemic model to dialect, the system was trained using unlabelled speech from one of three different groups, General Australian (21 speakers), educated Melbournian (21 aged 25-34y), or speakers of Chinese (14), and labelled using a subset of manually annotated data (phonemes and start/end points) from three further speakers, as follows: a base 25x25 unit SOM was trained using all audio windows from the unlabelled data; three-quarters of the annotated data was assigned to the units in the base map; the resulting labelled map was used for separating the unlabelled input data for submap boosting. Two approaches to submapping, each with three 20x20 submap SOMs, were trained on data segmented by the base map by: (1) three maps for subsets of vowels with shared confusion in the base map (Kohonen’s method); or (2) three maps of either /h/, vowels, or /d/ (linguistic). 1 MATLAB scripts are available from the authors on request. Scripts for MFCCs were modified from mathworks.com/matlabcentral/fileexchange/32849-htk-mfcc-matlab. Melb. 0.600(0.025) 0.047(0.019) 0.042(0.022) Chinese 0.506(0.041) 0.090(0.016) 0.027(0.015) 4. Discussion The goal of the experiments conducted in this work was to explore the general capacity of labelled data for revealing characteristics of dialect in the unlabelled speech of Chinesebackground Australians and educated Melbournians vs Australians generally. The results are competitive with the original phonetic typewriter results, demonstrating effectiveness with 39-feature MFCC vectors. There is the possibility for improving on these using context, but for the future directions of this research, we are more interested in characterising differences between the three groups. 5. Acknowledgements The AusTalk corpus was collected as part of the Big ASC project funded by the Australian Research Council (LE100100211).2 6. References 3. Results Frequently confused phonemes (on the first map) were identified using a greedy method based on high off-diagonal values in the confusion matrix from the base map: • Vowel Group 1: /oI/ (hoyd) and /o:/ (horde) • Vowel Group 2: /e/ (head), /e:/ (haired), /3:/ (herd), /I/ (hid), and /I@/ (heared) • Vowel Group 3: /5/ (hud), /æO/ (howd), /æI/ (hade), /5:/ (hard), /Ae/ (hide), /O/ (hod), and /@0/ (hode) General 0.487(0.062) 0.059(0.021) 0.057(0.014) [1] T. Kohonen, ”The neural phonetic typewriter,” Computer, vol. 21, pp. 1122, Mar. 1988. [2] F. Cox, ”The acoustic characteristics of /hvd/ vowels in the speech of some Australian teenagers,” Australian J. Linguistics, vol 26, pp. 147179, Feb. 2006. [3] D. Estival et al., ”AusTalk: An audio-visual corpus of Australian English,” in Proceedings of the 9th International Conference on Language Resources and Evaluation, Reykjavik, Iceland, 2014, pp. 3105-3109. 2 See https://austalk.edu.au/bibliography.html for details.
9cs.NE
arXiv:1508.05563v2 [math.AC] 30 Aug 2015 CLUSTER ALGEBRAS AND SEMI-INVARIANT RINGS II. PROJECTIONS JIARUI FEI Abstract. Let SIβ (Q) be the semi-invariant ring of β-dimensional representations of a quiver Q. Suppose that (Q, β) projects to another quiver with dimension vector (Q′ , β ′ ) through an exceptional representation E. We show that if SIβ (Q) is the upper cluster algebra associated to an ice quiver ∆, then SIβ ′ (Q′ ) is the upper cluster algebra associated to ∆′ , where ∆′ is obtained from ∆ through simple operations depending on E. We also study the relation of their bases using the quiver with potential model. Introduction The cluster algebra of Fomin-Zelevinsky was turned out be ubiquitous in algebraic Lie theory and classical invariant theory. It had been realized under different motivation (eg., [11, 10]) that the upper cluster algebra [2] is a more useful notion than the cluster algebra. The purpose of this series of papers is to understand when a semi-invariant of quiver representations is an upper cluster algebra, and use the cluster structure solve problems in invariant theory. One family of such upper cluster algebras found in [9] is the semi-invariant ring of complete triple flags introduced in [4]. They are multigraded upper cluster algebras of the hive quivers. The grading is also very useful because the dimension of each graded piece counts certain Littlewood-Richardson coefficient. On the other hand, many quivers can be projected from the triple flag quivers through exceptional sequences. In fact, the author does not know any quiver without oriented cycles that cannot be projected from a triple flag quiver. As we shall see in this paper that finding the cluster structure of semi-invariant ring of their representations will be ultimately reduced to the case of complete triple flags. More naturally and generally, one can ask how a graded upper cluster algebra (or GUCA in short) might change into another one under degree (or weight) restriction. We are unable to answer this question in general. However, if the grading is restricted to the hyperplane θ⊥ cut out by some weight θ, then we can provide a complete solution under some additional conditions. There is one special case which is particularly interesting to us. That is when θ = ǫ is a projector in the graded upper cluster algebra A. Here, being a projector simply means that ǫ is real and (Ae )ǫ⊥ = Aǫ⊥ for some e ∈ Aǫ . In this case, the restriction leads to deleting some vertex. For the general cases, we need more restriction on the weights σ of an extended cluster. In general, we need to delete 2010 Mathematics Subject Classification. Primary 13F60, 16G20; Secondary 13A50, 52B20. Key words and phrases. Cluster Algebra, Semi-invariant Ring, Quiver Representation, Graded Upper Cluster Algebra, Quiver with Potential, Weight Restriction, Orthogonal Projection, Vertex Removal, Exceptional Sequence, Cluster Character, Polytope, Lattice Point. 1 2 JIARUI FEI a set of frozen vertices, then freeze another set of vertices. Let ∆ be an ice quiver, and C(∆) be its associated upper cluster algebra. Let v be a set of vertices of ∆. We use the notation ∆v and ∆v for the quiver obtained from ∆ by deleting and freezing v respectively. Let Q = (Q0 , Q1 ) be a finite quiver without oriented cycles, and β be a fixed dimension vector of Q. The space Repβ (Q) of all β-dimensional representations is Q acted by the product of special linear groups SLβ := v∈Q0 SLβ(v) by the natural base change. The rings of semi-invariants SIβ (Q) is by definition the invariant ring k[Repβ (Q)]SLβ . This algebra is graded by a sublattice of ZQ0 equipped with a bilinear form h−, −i. We denote by SIβ (Q)σ the weight-σ component of SIβ (Q). The weight restriction to ǫ⊥ := {σ | hǫ, σi = 0} applied to SIβ (Q) leads to a change of the quiver Q and the dimension vector β. This was studied L by A. Schofield [23] and Derksen-Weyman [5]. To be more precise, we have that σ∈ǫ⊥ SIβ (Q)σ ∼ = SIβǫ (Qǫ ), where Qǫ is another quiver with one vertex less than Q, and βǫ is a dimension vector of Qǫ . The general weight restriction does not necessarily lead to such a change. However, it does in another special case called vertex removal with an additional condition (3.3) on β. We denote the new quiver with dimension vector in this situation by (Q, β). Put all these together, and we obtain our first two main results. Theorem 0.1 (Theorem 3.7). Suppose that SIβ (Q) is a naturally graded UCA C(∆, x; σ), and B(∆) has full rank. If σ(e) = ǫ is real and extremal in the grading cone of SIβ (Q), then we have that SIβǫ (Qǫ ) ∼ = C(∆e , xe ; σ e ). Theorem 0.2 (Theorem 3.17). Suppose that SIβ (Q) is a naturally graded UCA C(∆; σ), and B(∆) has full rank. Let r be a vertex of Q satisfying (3.3) and that σ(v)(r) = 0 for all v ∈ ∆0 except for a set of frozen vertices v, where all σ(v)(r) < 0 v)), where u is attached to v. (or all > 0). Then we have that SIβ (Q) ∼ = C(∆u v ; σ(b In [6] and [7], the mutation of quivers with potentials is invented to model the cluster algebras. For an ice quiver with potential (∆, W ), we can associated to it the Jacobian algebra J(∆, W ). Let G(∆, W ) be the set of all µ-supported vectors in K0 (proj -J(∆, W )) introduced in [9]. We say an IQP (∆, W ) models an algebra A if the generic cluster character of [21] maps G(∆, W ) onto a basis of A. Our other two main results say that the model is in some sense hereditary under the two operations considered before. Theorem 0.3 (Theorem 5.6). Suppose that e is a projector in C(∆; σ). If (∆, W ) models C(∆; σ), then (∆e , We ) models C(∆e ; σ e ). Theorem 0.4 (Theorem 5.17). Under the same assumption as Proposition 2.13, u v)). we suppose that (∆, W ) models C(∆; σ). Then (∆u v , Wv ) models C(∆v ; σ(b If in addition G(∆, W ) is given by lattice points in some polyhedron, then so are G(∆e , We ) and G(∆u v , Wv ). A comprehensive application of this theory has been illustrated in [10]. To invite readers, we still provide many other examples. The first class of examples explains how we get some known cluster structure from [9]. They include the total coordinate rings of partial flag varieties and unipotent subgroups of GLn [15]. The second class of examples is mildly new. They are the semi-invariant rings of complete m-tuple flags for m ≤ 6, whose cluster structure can also be obtained from [9]. CLUSTER ALGEBRAS AND SEMI-INVARIANT RINGS II. PROJECTIONS 3 Outline of the paper. In Section 1 we recall the graded upper cluster algebra following [2, 14, 12]. The new emphasis is on the grading given by a weight configuration of a unimodular lattice. In Section 2, we introduce the crucial map ℓe and the definition of a projector. We prove the precursors of the first two main results – Proposition 2.8 and 2.13. In Section 3, we recall the theory of semi-invariant ring of quiver representations with an emphasis on the two operations – orthogonal projection and vertex removal. We give a characterization of a projector in a semiinvariant ring in Proposition 3.6. We prove our first two main results – Theorem 3.7 and 3.17, and provide many examples. In Section 4, we recall the ice quivers with potentials and their representations following [6]. We recall the generic cluster character in the current setting following [21, 9]. In Section 5, we use the restriction and induction functor to study the relation of the cluster models under the two operations. We prove the other two main results – Theorem 5.6 and 5.17, and provide examples. Notations and Conventions. Our vectors are exclusively row vectors. All modules are right modules. For a quiver Q, we denote by Q0 the set of vertices and by Q1 the set of arrows. For an arrow a, we denote by t(a) and h(a) its tail and head. a b Arrows are composed from left to right, i.e., ab is the path · − →·− → ·. Unadorned Hom, ⊗ and dim are all over the base field k. We write hom for dim Hom. For any representation M , dimM is the dimension vector of M . For direct sum of n copies of M , we write nM instead of the traditional M ⊕n . 1. Graded Upper Cluster Algebras 1.1. Cluster Algebras. A quiver is just a directed graph with possibly multiple arrows between two vertices. Throughout we assume that quivers have no loops or oriented 2-cycles. An ice quiver ∆ is a quiver, where some vertices are designated as mutable while the rest are designated frozen. We usually label the quiver such that the first p vertices are mutable. If we require no arrows between frozen vertices, then such a quiver is uniquely determined by its B-matrix B(∆). It is a p×q matrix given by bu,v = |arrows u → v| − |arrows v → u|. The combinatorial data defining a cluster algebra is completely encoded in an ice quiver. Definition 1.1. Let u be a mutable vertex of ∆. The quiver mutation µu transforms ∆ into the new quiver ∆′ = µu (∆) via a sequence of three steps. (1) For each pair of arrows v → u → w, introduce a new arrow v → w (unless both v and w are frozen, in which case do nothing); (2) Reverse the direction of all arrows incident to u; (3) Remove all oriented 2-cycles. The above recipe can be reformulated in terms of B-matrix as follows. Let φ be the q × q matrix obtained from the identity matrix by replacing the u-th row by a vector φu where φu (u) = −1, and φu (v) = |arrows v → u|. 4 JIARUI FEI We write φp for the restriction of φ to its p × p upper left corner. Then the mutated B-matrix B ′ for ∆′ is related to the original one by (1.1) B ′ = φT p Bφ. We note that φ = φ−1 and φp = φ−1 p so the quiver mutation is an involution and preserves the rank of the B-matrix. Definition 1.2. Let F be a field containing k. A seed in F is a pair (∆, x) consisting of an ice quiver ∆ together with a collection x = {x1 , x2 , . . . , xq }, called an extended cluster, consisting of algebraically independent (over k) elements of F , one for each vertex of ∆. The elements of x associated with the mutable vertices are called cluster variables; they form a cluster. The elements associated with the frozen vertices are called frozen variables, or coefficient variables. A seed mutation µu at a (mutable) vertex u transforms (∆, x) into the seed (∆′ , x′ ) = µu (∆, x) defined as follows. The new quiver is ∆′ = µu (∆). The new extended cluster is x′ = x ∪ {x′u } \ {xu } where the new cluster variable x′u replacing xu is determined by the exchange relation Y Y xu x′u = xv + xw . v→u u→w We note that the mutated seed (∆′ , x′ ) contains the same coefficient variables as the original seed (∆, x). It is easy to check that one can recover (∆, x) from (∆′ , x′ ) by performing a seed mutation again at u. Two seeds (∆, x) and (∆† , x† ) that can be obtained from each other by a sequence of mutations are called mutation-equivalent, denoted by (∆, x) ∼ (∆† , x† ). If ∆ and ∆† are clear from the context, we may just write x ∼ x† . Definition 1.3 (Cluster algebra). The cluster algebra C(∆, x) associated to a seed (∆, x) is defined as the subring of F generated by all elements of all extended clusters of the seeds mutation-equivalent to (∆, x). Note that the above construction of C(∆, x) depends only, up to a natural isomorphism, on the mutation equivalence class of the initial quiver ∆. So we may drop x and simply write C(∆). 1.2. Upper Cluster Algebras. An amazing property of cluster algebras is Theorem 1.4 (Laurent Phenomenon, [13, 2]). Any element of a cluster algebra C(∆, x) can be expressed in terms of the extended cluster x as a Laurent polynomial, which is polynomial in coefficient variables. Since C(∆, x) is generated by cluster variables from the seeds mutation equivalent to (∆, x), Theorem 1.4 can be rephrased as \ C(∆, x) ⊆ Lx† , (∆† ,x† )∼(∆,x) ±1 where Lx := k[x±1 1 , . . . , xp , xp+1 , . . . xq ]. Note that our definition of Lx is slightly different from the original one in [2], where the coefficient variables are inverted in ±1 ±1 ±1 Lx := k[x±1 1 , . . . , xp , xp+1 , . . . xq ]. CLUSTER ALGEBRAS AND SEMI-INVARIANT RINGS II. PROJECTIONS 5 Definition 1.5 (Upper Cluster Algebra). The upper cluster algebra (or UCA in short) with seed (∆, x) is \ C(∆, x) := Lx† . (∆† ,x† )∼(∆,x) In general, there may be infinitely many seeds mutation equivalent to (∆, x). So the above definition is not very useful to test the membership in an upper cluster algebra. However, the following theorem allows us to do only finitely many checking. Definition 1.6. [2] We define the upper bounds \ U(∆, x) := Lµu (x) . 1≤u≤p Theorem 1.7. [2, Corollary 1.9] Suppose that B(∆) has full rank, and (∆, x) ∼ (∆† , x† ), then U(∆, x) = U(∆† , x† ). In particular, U(∆, x) = C(∆, x). Remark 1.8. This theorem is originally proved for U(∆, x) and C(∆, x) with Lx defined there. However, if we carefully examine the argument, we find that the result is also valid for our Lx . Any upper cluster algebra, being a subring of a field, is an integral domain (and under our conventions, a k-algebra). However, it may fail to be Noetherian [25]. Since normality is preserved under localization and intersection, any UCA is normal. The next lemma is useful to identify an UCA as a subalgebra of some given Noetherian normal domain. Let x be an extended cluster in some UCA. If x is contained in another commutative ring R, we write ZR (x) for the union of the zero locus in Spec(R) defined by all cluster variables in x. Definition 1.9. We say that a seed (∆, x) is cluster-regular in codimension 1 (or T  ′ ′ µ CR1 in short) in R if each adjacent cluster x ⊂ R, and ZR (x) ∩ u ZR (x ) ′ x ∼x has codimension ≥ 2 in Spec R. We call two elements of R coprime in codimension 1 if the locusof their common  T ′ µu ZR (x ) , zeros has codimension ≥ 2 in Spec(R). By expanding ZR (x) ∩ ′ x ∼x we can easily see that the codimension condition in Definition 1.9 is equivalent to that Each pair of cluster variables in x and each pair (xu , x′u ) (1.2) are coprime in codimension 1 in R. Lemma 1.10 ([12, Proposition 3.6]). Let R be a k-algebra and a Noetherian normal domain. If (∆, x) is a CR1 seed in R, then R ⊇ C(∆, x). T  ′ µu ZR (x ) Proof. For any r in the complement of ZR (x) ∩ in Spec R, we ′ x ∼x can find a seed (∆◦ , x◦ ) (either the original one or an adjacent one) such that any cluster variable in x◦ does not vanish at r. We can express any z ∈ C(∆, x) as a Laurent polynomial in x◦ , which is polynomial in coefficient variables. Since x◦ ⊂ R, we conclude that z is regular T at r. We know from [1, Corollary 5.22] that if R is a Noetherian domain, then ht P =1 RP is the integral closure of R. By the CR1 assumption, we conclude that z is in the integral closure of R which is R itself by the normality.  6 JIARUI FEI 1.3. g-vectors and Gradings. Let x = {x1 , x2 , . . . , xq } be an (extended) cluster. g(1) g(2) g(q) For a vector g ∈ Zq , we write xg for the monomial x1 x2 · · · xq . For u = 1, 2, . . . , p, we set yu = x−bu where bu is the u-th row of the matrix B(∆), and let y = {y1 , y2 , . . . , yp }. Suppose that an element z ∈ C(∆) can be written as (1.3) z = xg(z) F (y1 , y2 , . . . , yp ), where F is a rational polynomial not divisible by any yi , and g(z) ∈ Zq . If we assume that the matrix B(∆) has full rank, then the elements y1 , y2 , . . . , yp are algebraically independent so that the vector g(z) is uniquely determined [14]. We call the vector g(z) the (extended) g-vector of z. Definition implies at once that for two such elements z1 , z2 we have that g(z1 z2 ) = g(z1 ) + g(z2 ). So the set G(∆) of all g-vectors in C(∆) forms a sub-semigroup of Zq . Lemma 1.11 ([9, Lemma 5.5], cf. [21]). Assume that the matrix B(∆) has full rank. Let Z = {z1 , z2 , . . . , zk } be a subset of C(∆) with distinct well-defined gvectors. Then Z is linearly independent over k. Let L ∼ = Zn be a unimodular lattice equipped with a bilinear form L × L → Z, α, β 7→ hα, βi. The bilinear form may be neither symmetric nor skew-symmetric but must be unimodular, i.e., the mapping α7→hα,−i L −−−−−−→ HomZ (L, Z) is a Z-module isomorphism. This kind of lattice is the one discussed throughout this paper. For any θ ∈ L, we write ⊥ θ := {α ∈ L | hα, θi = 0}, and θ⊥ := {β ∈ L | hθ, βi = 0} for its left and right orthogonal sublattices. The Coxeter transformation τ is the unique linear transformation determined by hα, βi = −hβ, τ αi. Note that ⊥ θ ∼ = θ⊥ via the Coxeter transformation, allowing us to restrict our discussion to right orthogonal sublattices. For a real vector ǫ ∈ L, i.e., hǫ, ǫi = 1, we define two maps rǫ : L → ⊥ ǫ, α 7→ α − hα, ǫiǫ, and lǫ : L → ǫ⊥ , β 7→ β − hǫ, βiǫ. called the right and left projection through ǫ. Definition 1.12. A weight configuration σ of L on an ice quiver ∆ is an assignment for each vertex v of ∆ a (weight) vector σ(v) ∈ L such that for each mutable vertex u, we have that X X (1.4) σ(v) = σ(w). v→u u→w The mutation µu also transforms σ into a weight configuration σ ′ on the mutated quiver µu (∆) defined as X  σ(w) − σ(u) if v = u, σ ′ (v) = u→w  σ(v) if v 6= u. CLUSTER ALGEBRAS AND SEMI-INVARIANT RINGS II. PROJECTIONS 7 We usually write such a weight configuration as a pair (∆, σ) and its mutation by µu (∆, σ). By slight abuse of notation, we can view σ as a matrix whose v-th row is the weight vector σ(v). In this matrix notation, the condition (1.4) is equivalent to Bσ is a zero matrix. For any weight configuration of ∆, the mutation can be iterated because of (1.1). Let (∆, σ) be a weight configuration of a unimodular lattice. Let e be a vertex of ∆ such that σ(e) corresponds to a real vector ǫ. We define the (left) projection of the weight configuration (∆, σ) through e as the pair (∆e , σ e ), where ∆e is the full subquiver obtained from ∆ by deleting the vertex e, and σ e (v) = lǫ (σ(v)) = σ(v) − hǫ, σ(v)i ǫ. It is easy to see that the projection commutes with mutations away from e. Given a weight configuration (∆, σ), we can assign a multidegree (or weight) to the upper cluster algebra C(∆, x) by setting deg(xv ) = σ(v) for v = 1, 2, . . . , q. Then mutation preserves multihomogeneousity. We say that this upper cluster algebra is σ-graded, and denoted by C(∆, x; σ). We refer to (∆, x; σ) as a graded seed. Note that the variables in y have zero degrees. So if z has a well-defined g-vector as in (1.3), then z is homogeneous of degree gσ. 2. Projections from Graded Cluster Algebras 2.1. The map ℓe . Let M be a monoid. For simplicity, we assume that M is a submonoid inside a unimdoular lattice L := Zn . Let A be a M-graded k-algebra, which is also an integral domain. We do not assume that A is Noetherian, or have finite-dimensional graded pieces. We will speak of a M-graded k-algebra just as L a graded algebra. For any ǫ ∈ L, we define Aǫ⊥ to be the graded subalgebra α∈M|ǫ⊥α Aα of A. We denote by Ae the localization of A at e ∈ A. For any e ∈ A of real weight ǫ, we define the algebra homomorphism ℓe : A → (Ae )ǫ⊥ by the following k-linear extension on the homogeneous components: ∀a ∈ Aα , a 7→ ae−hǫ,αi . Clearly ℓe fixes Aǫ⊥ . For any ae−n ∈ (Ae )ǫ⊥ , we have that ℓe (a) = ae−n so ℓe is surjective. The homomorphism ℓe can be uniquely extended to the quotient fields QF(A) → QF(A)ǫ⊥ , which fixes QF(A)ǫ⊥ . We denote the extension still by ℓe . Let ie be the embedding QF(A)ǫ⊥ ֒→ QF(A). Definition 2.1. An element e ∈ Aǫ is called a projector in A if ǫ is real and (Ae )ǫ⊥ = Aǫ⊥ . Such an ǫ ∈ M is also called a projector for A. If e is a projector, then ℓe maps A onto Aǫ⊥ . We call ℓe the projection through e. Lemma 2.2. e ∈ Aǫ is a projector if and only if for any f ∈ Aα with hǫ, αi = d > 0, f factors as f = ed f ′ for some f ′ ∈ Aǫ⊥ . Proof. Clearly (Ae )ǫ⊥ ⊇ Aǫ⊥ . For ∀f ∈ Aα such that f e−d ∈ (Ae )ǫ⊥ , we have that hǫ, αi = dhǫ, ǫi. Then (Ae )ǫ⊥ = Aǫ⊥ if and only if hǫ, ǫi = 1 and f ′ := f e−d ∈ Aǫ⊥ .  Proposition 2.3. Suppose that ǫ is a projector for A, then we have the following. (1) If A0 = k, then dim Anǫ = 1 for any n ∈ N. (2) If any u ∈ A0 is a unit in A, then any f ∈ Aǫ is irreducible in A. 8 JIARUI FEI (3) If A is a UFD and A0 = k contains all units in A, then ǫ is extremal in the cone R+ M. Proof. (1). If e ∈ Aǫ is a projector, then for all f ∈ Anǫ we have that f = en f ′ for some f ′ ∈ A0 . But A0 = k, so dim Anǫ = 1. (2). Let e be a projector in Aǫ . Suppose that f = gh ∈ Aǫ with g ∈ Aα and h ∈ Aβ . One of α and β, say α, must have that hǫ, αi = d > 0. Then g = g ′ ed for some g ′ ∈ Aǫ⊥ . On the other hand, f = eu for some u ∈ A0 . Then eu = g ′ ed h ⇒ g ′ ed−1 h = u because A is a domain. By assumption u is a unit, then so is h. (3). Suppose that ǫ is not extremal, then there is some α, β ∈ M \ Rǫ such that nǫ = α + β. By (1), we have that en = gh for e ∈ Aǫ , and some g ∈ Aα , h ∈ Aβ . By (2) e is irreducible, so en = gh contradicts the UFD property of A.  2.2. The Cases when ǫ ∈ M. Throughout this paper, we will use e for both the vertex e and the cluster variable x(e). We find no potential confusion from this abuse of notation. From now on, the map ℓe is always defined on the quotient field k(x) of C(∆, x; σ). If x is an extended cluster, when we say “Laurent polynomial in x”, it always implies that it is polynomial in coefficient variables in x. We omit this part if it is not important in the context.  The goal of this subsection is to relate C(∆; σ)e ǫ⊥ to another upper cluster algebra, where ǫ = σ(e) is real. Our first lemma reduces the general case to the case when e is frozen. By freezing a set of vertex u, we mean that we make u frozen. Let ∆u be the quiver obtained from ∆ by freezing u. Lemma 2.4. Suppose that B(∆) is of full rank. Let A := C(∆, x; σ) and S := C(∆e , x; σ), then we have that Ae = Se . Proof. We first show that S is a subalgebra of A. By Theorem 1.7, it suffices to show that any s ∈ S can be written as a Laurent polynomial in x′ := µe (x). Note that s can be written as a Laurent polynomial p in x, which is polynomial in e. But ee′ = h, where h is the exchange polynomial. Substituting e by h(e′ )−1 , we get the required Laurent polynomial in x′ . Since any cluster x of S is also a cluster of A, any element in A can be written as a Laurent polynomial in x but not necessary polynomial in e. So after inverting e in S, we obtain that Se ⊇ A. We conclude that Se = Ae .  Remark 2.5. The lemma still holds if the full rank condition is replaced by the condition that A is Noetherian and (∆, x) is a CR1 seed in A. Indeed, if (∆, x) is a CR1 seed in A, then (∆e , x) is also a CR1 seed in A by (1.2). By Lemma 1.10, we still have that S ⊂ A. The same remark applies to several results depending on Lemma 2.4, eg., Proposition 2.8, Corollary 2.11, Theorem 3.7, and Corollary 5.8. For a graded seed (∆, x; σ), we define xe by xe (v) = ℓe (x(v)) = x(e)−hǫ,σ(v)i x(v) for v 6= e. Since x is algebraically independent, so is xe . We have seen that (∆e ; σe ) is a weight configuration, so (∆e , xe ; σ e ) is a graded seed. Lemma 2.6. For any sequence of mutations µ := µuk · · · µu2 µu1 with ui 6= e, we have that µ(∆)e = µ(∆e ) and ℓe (µ(x)(v)) = µ(xe )(v) for v 6= e. Proof. It suffices to show for µ = µu with u 6= e. It is rather clear from the definition that µu commutes with the deletion at e. The map ℓe commutes with mutations because ℓe is a homomorphism.  CLUSTER ALGEBRAS AND SEMI-INVARIANT RINGS II. PROJECTIONS 9 Corollary 2.7. For any extended cluster x†e of (∆e , xe ), there is an extended cluster x† of (∆, x) such that x† (e) = e and ℓe (x† (v)) = x†e (v) for v 6= e. In particular, C(∆e , xe ; σ e ) ⊆ (C(∆, x; σ)e )ǫ⊥ . Proof. Suppose that x†e is obtained from xe by a sequence of mutations µ := µuk · · · µu2 µu1 . We claim that x† = µ(x). Since the mutation is away from e, we have that x† (e) = e. By Lemma 2.6 we have that ℓe (x† (v)) = ℓe (µ(x)(v)) = µ(xe )(v).  Proposition 2.8. Suppose that e is frozen or B(∆) has full rank. Let A := C(∆, x; σ) and S := C(∆e , xe ; σ e ), then we have that (Ae )ǫ⊥ ∼ = S. Proof. By Lemma 2.4, we only need to consider the case when e is frozen. We first show that S ⊆ (Ae )ǫ⊥ . Let x† ∼ x be any extended cluster of (∆, x). Since e is frozen, ℓe (x† ) \ {1} is an extended cluster of (∆e , xe ) by Lemma 2.6. For any homogeneous s ∈ S, we write s as a Laurent polynomial p(ℓe (x† )), which is equal to ℓe (p(x† )). Let x‡ be another extended cluster, and we write s as a Laurent polynomial p′ (ℓe (x‡ )) = ℓe (p′ (x‡ )). By the definition of ℓe , we see that p(x† ) and p′ (x‡ ) differ by a factor of some power of e. So s lies in the image ℓe (Ae ), which is (Ae )ǫ⊥ . Now let a ∈ (Ae )ǫ⊥ be homogeneous. Let x†e ∼ xe be any extended cluster of (∆e , xe ). Choose an extended cluster x† as in Corollary 2.7, and then we can write a as a Laurent polynomial p(x† ). We apply the map ℓe to a = p(x† ), and then a = ℓe (a) = p(ℓe (x† )) is a Laurent polynomial in x†e . We thus obtain the other containment (Ae )ǫ⊥ ⊆ S.  Remark 2.9. We saw from Corollary 2.7 that C(∆e , xe ; σ) ⊆ (C(∆, x; σ)e )ǫ⊥ . However, we have examples to show that under the assumption of Proposition 2.8 the inclusion can be strict. We define a linear function ǫl : R∆0 → R by ǫl : g 7→ hǫ, gσi. We define a linear isomorphism ıe : R(∆e )0 → Ker ǫl by ev 7→ ev − hǫ, σ(v)iee . By construction the map ıe is weight-preserving, that is, gσ e = ıe (g)σ, and satisfies that ie (xge ) = xıe (g) (ie as defined before Definition 2.1). Let Ie be the matrix of the linear transform ıe . Lemma 2.10. If e is frozen, then B(∆e )Ie = B(∆). So we have that ie (yu′ ) = yu and ℓe (yu ) = yu′ , where yu and yu′ are the y-variables associated to (∆, x) and (∆e , xe ). Proof. It suffices to show that the e-th columns are equal, or equivalently X bu,e = bu,v Iv,e . v6=e P Since v6=e bu,v σ(v) = bu,e σ(e). The required v bu,v σ(v) = 0, we have that identity is obtained by taking hσ(e), −i on the both sides. ′ −b′ By definition, ie (yu′ ) = ie (xe u ) = x−ıe (bu ) = x−bu = yu , where b′u is the u-th row of B(∆e ). Applying ℓe to the above equation, we get that ℓe (yu ) = yu′ .  P 10 JIARUI FEI Let le : R∆0 → R(∆e )0 be the linear map defined by forgetting the e-th coordinate. l (g) Then it is a left inverse of ıe and satisfies that ℓe (xg ) = xee . We say that an upper cluster algebra C(∆) is g-indexed if it has a basis whose elements have well-defined distinct g-vectors in G(∆) (see Section 1.3). Corollary 2.11. Suppose that e is frozen or B(∆) has full rank. If C(∆, x; σ) is g-indexed, then C(∆e , xe ; σ e ) has a basis with well-defined g-vectors in le (G(∆)). Moreover, if e is a projector, then C(∆e , xe ; σ e ) is g-indexed as well. Proof. Suppose that a basis element z in C(∆; σ) can be written as (1.3). Then by l (g(z)) Lemma 2.10, ℓe (z) = xee F (y1′ , y2′ , . . . , yp′ ). By Proposition 2.8, C(∆e ; σ e ) has a basis with well-defined g-vectors in le (G(∆)). Now suppose that e is a projector, then C(∆; σ)ǫ⊥ = (C(∆; σ)e )ǫ⊥ = C(∆e ; σ e ). We remain to show that g-vectors can be chosen to be distinct for a basis of C(∆e ; σ e ). Since elements with well-defined g-vectors are homogeneous, C(∆; σ)ǫ⊥ has a basis with g-vectors in G(∆) ∩ Ker ǫl . It suffices to show that le is injective restricted to G(∆) ∩ Ker ǫl . If g ∈ Ker le , then g(u) = 0 for all u 6= e. But ee ∈ / Ker ǫl . The last statement follows.  2.3. The Cases when ǫ is not necessary in M. In general, the cases when ǫ is not necessary in M is much more complicated. We can only obtain similar result after imposing more restriction. However, in what follows we need not assume ǫ to be real, so we use θ instead of ǫ. Definition 2.12. A set of vertices u is called attached to another set of vertices v if t(a) ∈ v (resp. h(a) ∈ v) whenever h(a) ∈ u (resp. t(a) ∈ u). For such a pair (u, v), we form a quiver ∆u v by deleting v and freezing u. Let v be a set of vertices. We write x(b v) for the set of cluster variables {x(v) | v∈ / v} in the cluster x. We also write σ(b v ) for the restriction of σ to ∆0 \ v. Proposition 2.13. Let A := C(∆, x; σ) with B(∆) of full rank. Suppose that θ is a weight such that hθ, σ(v)i = 0 for all v ∈ ∆0 except for a set of frozen vertices v, where all hθ, σ(v)i < 0 (or all > 0). Then the graded subalgebra Aθ⊥ is equal to S := C(∆u v); σ(b v)), where u is attached to v. v , x(b Proof. The same argument as Lemma 2.4 shows that S is contained in A, and thus in Aθ⊥ . Indeed, by Theorem 1.7 it suffices to show that any s ∈ S can be written as a Laurent polynomial in x′ := µu (x) for each u ∈ u. Note that s can be written as a LaurentQpolynomial inQx, which is polynomial in x(u)’s. Let h be the exchange polynomial u→v x(v) + w→u x(w) so that x(u) = hx′ (u)−1 . We thus get the required Laurent polynomial in x′ . Conversely, for any homogeneous a ∈ Aθ⊥ , we can write a as a Laurent polynomial p in any given extended cluster x† ∼ x with polynomial coefficient variables. We assume that (∆† , x† ; σ † ) is obtained from (∆, x; σ) by mutations away from u. v)) is contained in some It is clear that any cluster mutated from the seed (∆u v , x(b x† . Since u is attached to v, we still have that hθ, σ † (v)i = 0 for all v ∈ ∆0 \ v and hθ, σ(v)i < 0 (or > 0) for v ∈ v. Then we see that any coefficient variables in x(v) cannot appear in p because otherwise a ∈ / Aθ⊥ . We remain to show that p is polynomial in x(u) for u ∈ u. We write a as a Laurent polynomial p′ in the mutated cluster x′ := µu (x). Since u is attached to v, the exchange polynomial h contains variables in x(v). In particular, hθ, σ ′ (u)i has the same sign as hθ, σ(v)i where v ∈ v. We decompose p′ as a sum of (homogeneous) CLUSTER ALGEBRAS AND SEMI-INVARIANT RINGS II. PROJECTIONS 11 Laurent monomials with no cancelations. We see that x′ (u) must have non-positive degree in each such monomial because otherwise a ∈ / Aθ⊥ . But x′ (u)−1 = x(u)h−1 so p must be polynomial in x(u).  Remark 2.14. Similar to Remark 2.5, we can replace the full rank condition by the condition that A is Noetherian and (∆, x) is a CR1 seed in A. Then by (1.2) (∆u v)) is also a CR1 seed in A, so by Lemma 1.10 we still have that S ⊂ A. v , x(b The same remark applies to several results depending on Proposition 2.13, such as Corollary 2.16, Theorem 3.17, Theorem 5.17, and Corollary 5.18. Remark 2.15. Analogous to Remark 2.9, under the assumption of Proposition 2.13, we only have C(∆u v ); σ(b v)) ⊆ C(∆, x; σ)θ⊥ in general. v , x(b In the situation of Proposition 2.13, if we define pv : A → Aθ⊥ = S by evaluation of x(v) at 0, then pv is a left inverse of the embedding iv : S ֒→ A. Similar to Lemma 2.10, we have that iv (yu′ ) = yu and pv (yu ) = yu′ , where yu′ is the y-variable for (∆u v)). Let pv : R∆0 → R(∆v )0 and ıv : R(∆v )0 → R∆0 be the linear maps v , x(b such that pv (xg ) = x(b v )pv (g) and iv (x(b v)g ) = xıv (g) . The proof of the following corollary is similar to (but easier than) that of Corollary 2.11. Corollary 2.16. Suppose that we are in the situation of Proposition 2.13. If C(∆; σ) is g-indexed, then C(∆u v)) is g-indexed as well, and moreover we have v ; σ(b that G(∆u ) = p (G(∆)). v v 3. Projections from Semi-invariant Rings 3.1. Semi-invariant Rings of Quiver Representations. Let us briefly recall the semi-invariant rings of quiver representations [23]. Let Q be a finite quiver without oriented cycles. We fix an algebraically closed field k of characteristic zero. For Q a dimension vector β of Q, let V be a β-dimensional vector space i∈Q0 k β(i) . We write Vi for the i-th component of V . The space of all β-dimensional representations is M Repβ (Q) := Hom(Vt(a) , Vh(a) ). a∈Q1 The product of general linear group GLβ := Y GL(Vi ) i∈Q0 acts on Repβ (Q) by the natural base change. Define SLβ ⊂ GLβ by Y SLβ = SL(Vi ). i∈Q0 We are interested in the rings of semi-invariants SIβ (Q) := k[Repβ (Q)]SLβ . The ring SIβ (Q) has a weight space decomposition M SIβ (Q) = SIβ (Q)σ , σ 12 JIARUI FEI where σ runs through the multiplicative characters of GLβ . We refer to such a decomposition the σ-grading of SIβ (Q). Recall that any character σ : GLβ → k ∗ can be identified with a weight vector σ ∈ ZQ0 Y  σ(i) g(i) i∈Q0 7→ det g(i) . i∈Q0 Let us understand these multihomogeneous components SIβ (Q)σ := {f ∈ k[Repβ (Q)] | g(f ) = σ(g)f, ∀g ∈ GLβ }. Since Q has no oriented cycles, the degree zero component is the field k [19]. For any projective presentation f : P1 → P0 , we view it as an element in the homotopy category K b (proj -Q) of bounded complexes of projective representations of Q. We view each weight σ ∈ ZQ0 as an element in the Grothendieck group K0 (K b (proj -Q)). 0 Concretely, suppose that P1 = P (σ1 ) and P0 = P (σ0 ) for σ1 , σ0 ∈ ZQ ≥0 , then L σ = σ1 − σ0 . Here, we use the notation P (σ) for i∈Q0 σ(i)Pi , where Pi is the indecomposable projective representation corresponding to the vertex i. Let σ be a weight such that σ · β = 0, and f be a projective presentation of weight σ. In [23] Schofield constructed for each such f a (not necessary non-zero) element in SIβ (Q)σ . For the construction of s(f ), we refer the readers to the original text or [9, Section 1]. In fact, Theorem 3.1 ([4, 26, 8]). s(f )’s span SIβ (Q)σ over the base field k. Let Σβ (Q) be the set of all weights σ such that SIβ (Q)σ is non-empty. It is known that such a weight σ corresponds to some dimension vector α σ, i.e., σ · (−) = −hα σ, −iQ , where h−, −iQ is the Euler form of Q. The Euler form induces a form h−, −i on the space of weights satisfying hσ, θi = hα σ, α θiQ . The unimodular lattice ZQ0 with this form will be used in our weight configuration later. The next theorem is an easy consequence of King’s stability criterion [19, Proposition 3.1] and Theorem 3.1. By a general β-dimensional representation, we mean in a sufficiently small Zariski open subset (“sufficient” here depends on the context). Following [24], we use the notation γ ֒→ β to mean that a general β-dimensional representation has a γ-dimensional subrepresentation. Theorem 3.2. [4, Theorem 3] We have Σβ (Q) = {σ ∈ ZQ0 | σ · β = 0 and σ · γ ≥ 0 for all γ ֒→ β}. In particular, Σβ (Q) is a pointed saturated monoid. Recall that a dimension vector α is called a real root if hα, αiQ = 1. It is called Schur if HomQ (M, M ) = k for M general in Repα (Q). For a real Schur root α, Repnα (Q) has a dense orbit for any n ∈ N. Lemma 3.3 ([9, Lemma 1.7]). If α is a real Schur root, then SIβ (Q)−hnα,−iQ ∼ =k for any n ∈ N. Lemma 3.4. [4, Lemma 1] Suppose that we have an exact sequence of representations of Q 0 → L → M → N → 0. If hdimL, βi = hdimN, βi = 0, then as a function on Repβ (Q), s(fM ) is, up to a scalar, equal to s(fL )s(fN ), where fM is the minimal presentation of M . If hdimL, βi > 0 or hdimN, βi < 0, then s(fM ) = 0. CLUSTER ALGEBRAS AND SEMI-INVARIANT RINGS II. PROJECTIONS 13 3.2. Orthogonal Projections. For two dimension vector α, β, we write α ⊥ β if HomQ (M, N ) = ExtQ (M, N ) = 0 for M, N general in Repα (Q) and Repβ (Q). We recall that an exceptional sequence of dimension vector E := {ǫ1 , ǫ2 , . . . , ǫn } is a sequence of real Schur roots of Q such that ǫi ⊥ ǫj for any i < j. It is called quiver if hǫj , ǫi iQ ≤ 0 for any i < j. It is called complete if n = |Q0 |. The quiver Q(E) of a quiver exceptional sequence E is by definition the quiver with vertices labeled by ǫi and extQ (ǫj , ǫi ) arrows from ǫj to ǫi . According to [24, Theorem 4.1], extQ (ǫj , ǫi ) = −hǫj , ǫi iQ . Given an exceptional sequence of dimension vector F = {ε1 , ε2 , . . . , εr } with Fi general in Repεi (Q), we consider the (right) orthogonal subcategory F⊥ defined by F⊥ := {M ∈ Rep(Q) | Fi ⊥ M for i = 1, 2, . . . , r}. According to [23], this abelian subcategory is equivalent to the module category of another quiver denoted by QF . We say that Q projects to QF through F. In this case there is a unique quiver exceptional sequence E = {ǫ1 , ǫ2 , . . . , ǫ|Q0 |−r } of Q such that the concatenation of two sequences (F, E) is a (complete) exceptional sequence and Q(E) ∼ = QF . We refer to [23] for the construction of E. We define a linear isometry (with respect to the Euler forms) ιF : K0 (QF ) → K0 (Q) by X β ′ (i)ǫi . (3.1) β ′ 7→ Conversely we define a linear map πF left inverse to ιF as the composition K0 (Q) → K0 (F⊥ ) ∼ = K0 (QF ), where the first map β0 := β 7→ βr is given by the recursion βi+1 = βi − hεi+1 , βi iQ εi+1 . Both maps induce a linear map on the weights, still denoted by ιF and πF . We write βF and σF for πF (β) and πF (σ). To effectively compute σF later, we can use the formulae (3.2) σF (i) = σ · ǫi . Theorem 3.5 ([5, Theorem 2.39]). Let ǫ be a real Schur root such that ǫ ⊥ β. Then we have that SIβǫ (Qǫ ) ∼ = SIβ (Q)ǫ⊥ . Proposition 3.6. Let ǫ is a real root of Q. Then σ ǫ is extremal in R+ Σβ (Q) if and only if σ ǫ is a projector for SIβ (Q). Proof. By [22, Theorem 3.17], any SIβ (Q) is a UFD. Since SIβ (Q)0 = k and Σβ (Q) is pointed, the direction “ ⇐ ” follows from Proposition 2.3.(3). Conversely, let us first show that ǫ is in fact Schur. If not, then a general representation E in Repǫ (Q) decomposes as E = L ⊕ N . By Lemma 3.4, we must have that s(fE ) = s(fL )s(fN ) 6= 0. Since σ ǫ is extremal, the weights of fL and fN must lie on R+σ ǫ. But ǫ is real, so it is clearly impossible. For any dimension vector α such that α ⊥ β and hǫ, αiQ > 0, we must have that hǫ ֒→ α where h = homQ (ǫ, α). Indeed, let γ be the rank of a general morphism f from a general representation U ∈ Rephǫ (Q) to a general representation V ∈ Repα (Q). Note that h ≥ hǫ, αiQ > 0. We claim that γ = hǫ. We first observe that γ must be a multiple of ǫ, say γ = h′ ǫ. Otherwise by Lemma 3.4 the weights of Ker(f ) and Im(f ) lie in R+ Σβ (Q) contradicting σ ǫ being extremal. f| ′ E V → W → 0 where E is the Now we have an exact sequence 0 → h′ E −−h−→ exceptional representation of dimension ǫ. By applying HomQ (E, −), we find that 14 JIARUI FEI homQ (E, W ) = h − h′ . Since ǫ is real Schur, a general representation of dimension hǫ is isomorphic to hE = h′ E ⊕ (h − h′ )E. If h > h′ , then there is a nontrivial homomorphism from (h − h′ )E to W . We can thus construct a homomorphism from hE to V with image strictly containing f (h′ E). So we must have that h = h′ . Now by Theorem 3.1, any semi-invariant function of weight σ α is a linear combination of s(f )’s, where f is the minimal presentation of a general representation in Repα (Q). By Lemma 3.4, any such s(f ) has a factor s(fE )h in SIβ (Q). We conclude that σ ǫ is a projector from Lemma 3.3 and 2.2.  We say that a semi-invariant ring SIβ (Q) is a naturally graded upper cluster algebra C(∆, x; σ) if SIβ (Q) ∼ = C(∆, x; σ) and σ(v) is the σ-weight of x(v) under the isomorphism. Theorem 3.7. Suppose that SIβ (Q) is a naturally graded UCA C(∆, x; σ), and B(∆) has full rank. If σ(e) = σ ǫ is real and extremal in R+ Σβ (Q), then ǫ is Schur and SIβǫ (Qǫ ) is the naturally graded UCA C(∆e , xe ; πǫ (σ)). Proof. From the proof of Proposition 3.6, we have seen that ǫ must be Schur. The rest follows from Proposition 2.8, 3.6, and Theorem 3.5.  Remark 3.8. In what follows, we will always identify σ e with πǫ (σ) through the linear isometry ιǫ if available. So we may keep C(∆e , xe ; σ e ) instead of writing C(∆e , xe ; πǫ (σ)). Remark 3.9. We note that if ε1 , ε2 , . . . , εr is an exceptional sequence with each σ εi extremal in R+ Σβ (Q), then each σ (ε2 )ε1 , . . . , σ (εn )ε1 is extremal in R+ Σβε1 (Qε1 ). So Theorem 3.7 can be inductively applied to such an exceptional sequence. 3.3. Complete Flag Varieties, Unipotent Subgroups, and Sextuple Flags. We first recall the main result in [9]. Consider the triple flag quiver Tn 1 /2 / ··· 1 /2 / ··· 1 /2 / ··· / n−1 ◆◆◆ ◆◆◆ '/ / n−1 ♣♣7 n ♣ ♣ ♣♣ / n−1 with the standard dimension vector βn as indicated above. Let eai be the unit vector supported on the i-th vertex of the a-th arm of Tn . Let fi,j be the weight given by en − e1i − e2j − e3k for k = n − i − j, and εi,j = α fi,j . We use the convention that ea0 is the zero vector and ean = en for a = 1, 2, 3. It is clear that each fi,j is extremal in R+ Σβn (Tn ). It is proved in [9] that the semi-invariant ring SIβn (Tn ) is the GUCA C(∆n ; σ n ), where ∆n is the ice hive quiver and σ n (i,  j) = fi,j . The ice hive quiver ∆n of size n − 3 vertices arranged in a triangular grid. is an ice quiver in the plane with n+2 2 We label the vertices as shown in Figure 1. Note that three vertices (0, 0), (n, 0) and (0, n) are missing, and all boundary vertices are frozen. There are three types of arrows: (i, j) → (i + 1, j), (i, j) → (i, j − 1), and (i, j) → (i − 1, j + 1). It is easy to see that B(∆n ) has full rank. Example 3.10 (Complete flag varieties). Consider the exceptional sequence F := {εi,n−i }1≤i≤n−1 of Tn . Note that εi,n−i ⊥ εj,n−j for i 6= j so the order of F does CLUSTER ALGEBRAS AND SEMI-INVARIANT RINGS II. PROJECTIONS 0,1 0,5 1,0 ✺✺ ✠D ✺ ✠✠ o o 0,2 2,0 1,1 ✺✺ ✠✠D ✺✺✺ ✠D ✺ ✠✠ ✺ ✠✠ o o o 0,3 2,1 3,0 1,2 ✺✺ ✠✠D ✺✺✺ ✠✠D ✺✺✺ ✠D ✺ ✠✠ ✺ ✠✠ ✺ ✠✠ o o o o 0,4 4,0 1,3 2,2 3,1 ✺✺ ✠✠D ✺✺✺ ✠✠D ✺✺✺ ✠✠D ✺✺✺ ✠D ✺ ✠✠ ✺ ✠✠ ✺ ✠✠ ✺ ✠✠ o o o o o 1,4 2,3 3,2 4,1 D ✺✺ D ✺✺ D ✺✺ D ✺✺ ✠ ✠ ✠ ✠ ✺ ✠✠ ✺ ✠✠ ✺ ✠✠ ✺ ✠✠ 1,5 2,4 15 3,3 4,2 5,0 5,1 Figure 1. The ice hive quiver ∆6 . not matter. We find that the unique quiver exceptional sequence E completing F is given by {ǫn , . . . , ǫ2 , ǫ1 , e3n−1 , . . . , e32 , e31 }, where ǫi = α (en − e1i − e2n−i+1 ). The quiver of E is displayed below, where e31 , . . . , e3n−1 and ǫ1 , . . . , ǫn corresponds to the vertices 1, . . . , n − 1, and 1′ , . . . , n′ respectively. ′ r9 1 rr r rr n arrows /2 / ··· / n−1 1 ▲▲ n vertices ▲▲ ▲▲ % ′ n We denote the quiver of E by SFn . Let βn′ be the dimension vector given by βn′ (i) = i and βn′ (i′ ) = 1. We can verify by (3.1) that under the embedding the dimension vector βn′ goes to βn . It is not hard to see that SIβn′ (SFn ) is the total coordinate ring R(Fln ) of the complete flag variety Fln of the n-dimensional vector space. Let Cl(X) be the divisor class group of a variety X. By definition, M Γ(X, OX (D)), R(X) := [D]∈Cl(X) where the multiplication is given by multiplying homogeneous sections in the field of rational functions k(X). However, to rigorously prove this fact, we need variation of GIT. We will write this up in some lecture notes. We observe that the exceptional sequence F corresponds to the last row of frozen vertices of ∆n . Let ∆♭n be the ice quiver obtained from ∆n by deleting the last row of frozen vertices (see Figure 2). It follows from Theorem 3.7 that Proposition 3.11. The total coordinate ring of Fln is the GUCA C(∆♭n ; σ ♭n ). Here, the new weight configuration σ ♭n can be computed from (3.2). For example, P n σ ♭n (i, 0) = k=i+1 e′k − en−i , which is clearly extremal in R+ Σβn′ (SFn ). Example 3.12 (The unipotent subgroups). We sketch how to get the cluster structure of the maximal unipotent subgroup Nn of GLn from the previous example, and 16 JIARUI FEI 0,1 0,5 1,0 0,1 ✷✷ ✌F ✷ ✌✌ o o 1,1 0,2 2,0 ✸✸ ✌✌F ✷✷✷ ☛E ✸ ✌✌ ✷ ☛☛ o o o 0,3 3,0 1,2 2,1 ✸✸ ☛☛E ✷✷✷ ✌✌F ✸✸✸ ☛E ✷ ✌✌ ✸ ☛☛ ✸ ☛☛ o o o o 1,3 0,4 2,2 3,1 4,0 ✸✸ ☛☛E ✸✸✸ ✌✌F ✷✷✷ ☛☛E ✸✸✸ ☛E ✸ ☛☛ ✸ ✌✌ ✷ ☛☛ ✸ ☛☛ o o o o o 1,4 2,3 3,2 4,1 5,0 0,5 ✷✷ ✷ o 1,1 0,2 ✸✸ ✌✌F ✵✵✵ ✵ ✸ ✌✌ o o 0,3 1,2 2,1 ✸✸ ☛☛E ✷✷✷ ✍✍F ✵✵✵ ✵ ✷ ✍✍ ✸ ☛☛ o o o 1,3 0,4 2,2 3,1 ✸✸ ☛☛E ✸✸✸ ✌✌F ✵✵✵ ✍✍F ✵✵✵ ✵ ✍✍ ✵ ✸ ☛☛ ✸ ✌✌ o o o o 1,4 2,3 3,2 4,1 Figure 2. The ice quiver ∆♭6 (left) and ∆♭♭ 6 (right) leave the details to the readers. Although as an ungraded algebra it is just a polynomial ring, it is certainly non-trivial if the multigrading is taken into account. We verify that each σ ♭n (i, 0) corresponds to a real Schur root, denoted by εi . In fact, F := {εn−1 , . . . , ε2 , ε1 } is an exceptional sequence of SFn . We find that the unique quiver exceptional sequence E completing F is given by {ǫ′n , . . . , ǫ′2 , ǫ′1 }, Pn−1 where ǫ′i = e′n−1+i + i ei . Then we can verify that the arrow matrix of Q(E) is a strict upper-triangular matrix with all entries equal to one. Let 1 be the dimension vector (1, 1, . . . , 1). We can verify by (3.1) that under the embedding the dimension vector 1 goes to βn′ . Clearly SI1 (Q(E)) is the coordinate ♭ ring of Nn . Let ∆♭♭ n be the ice quiver obtained from ∆n by deleting the right (or left) row of frozen vertices. It follows that ♭♭ Proposition 3.13. The coordinate ring of Nn is the GUCA C(∆♭♭ n ; σ n ). We want to tell curious readers that we cannot project from any vertex of ∆♭♭ n except for (n, 1) because none of the weights in σ ♭♭ n corresponds to a real Schur root. Example 3.14 (Complete sextuple flags). Consider the exceptional sequence F := {ε0,n , εn,0 , εn,n } of T2n . We find that the unique quiver exceptional sequence E completing F is given by {ǫ, F′a , Fa }a=1,2,3 (the order of a does not matter), where Fa := ean−1 , . . . , ea2 , ea1 , F′a := ea2n−1 , . . . , ean+2 , ean+1 and ǫ = α (e2n − e1n − e2n − e3n ). The quiver of E is the sextuple flag quiver, where eai (1 ≤ i ≤ n − 1) and ean+i (1 ≤ i ≤ n − 1) correspond to the vertices on the left and right three flags respectively, and ǫ corresponds to the central vertex n. / ··· /n−1 /2 2o 1 n−1 o ··· o 1 ❊❊ ② ❊❊ ② ❊❊ ②② ❊" |②②② / / / / o 1 2 ··· n−1 n n−1 o ··· o 2o 1 ②< b❊❊❊ ② ❊ ② ❊❊ ② ②② / / / ··· o n−1 o 1 2 ··· n−1 2o 1 We call such a quiver sextuple flag quiver, denoted by Sn6 . Let βn6 be the dimension vector indicated as above. We can verify by (3.1) that under the embedding the dimension vector βn6 goes to β2n of T2n . Let ∆▽ n be the ice quiver obtained from ∆2n by deleting the vertices corresponding to F. It follows from Theorem 3.7 that CLUSTER ALGEBRAS AND SEMI-INVARIANT RINGS II. PROJECTIONS 0,1 0,5 1,0 ✹✹ ✡D ✹ ✡✡ o o 0,2 2,0 1,1 ✽✽✽ ✞✞C ✼✼✼✼ ✝B ✞ ✝  ✞o  ✝ B✝ 1,2 ✼✼ ✞C 2,1 ✽✽ ✼✼ ✞✞ ✽✽ ✝  ✞o  o ✝✝o o 0,4 2,2 3,1 4,0 1,3 ✹✹ ✡✡D ✺✺✺ ✡✡D ✹✹✹ ✠✠D ✹✹✹ ✡D ✹ ✠✠ ✹ ✡✡ ✹ ✡✡ ✺ ✡✡ o o o o o 1,4 2,3 3,2 4,1 ✺✺ D ✹✹ D D ✹✹ ✠ ✡ ✡ ✹ ✠✠ ✺ ✡✡ ✹ ✡✡ 1,5 17 2,4 4,2 5,0 5,1 Figure 3. The ice quiver ∆▽ 3. ▽ Proposition 3.15. The semi-invariant ring SIβn6 (Sn6 ) is the GUCA C(∆▽ n ; σ n ). Here, σ ▽ n can also be easily obtained from (3.2). Since it will appear in Proposition 5.15, we list it for readers’ convenience. Let i = iq n + ir such that 0 ≤ ir < n, and similar for j and k = n − i − j, then 1+3iq σ▽ n (i, j) = (2 − iq − jq − kq )en − eir 2+3jq − ejr 3+3kq − ekr . 3.4. Vertex Removal. Let Q be a quiver, and β a dimension vector of Q. For a fixed vertex r ∈ Q, let Q be the quiver such that Q0 = Q0 \ {r}, and Q1 = Q1 \ {a | h(a) = r or t(a) = r} ∪ {[ab] | h(a) = t(b) = r}, where t([ab]) = t(a) and h([ab]) = h(b). The vertex removal at r on Repβ (Q) is the algebraic morphism Repβ (Q) → Repβ (Q) sending M to M defined by if t(a), h(a) 6= r, M (a) = M (a) a b if t(a) − →r− → h(b). M ([ab]) = M (ab) Lemma 3.16. Assume the following condition on β X X  β(h(b)) ≤ β(r). β(t(a)), (3.3) min h(a)=r t(b)=r The vertex removal Repβ (Q) → Repβ (Q) induces an embedding ι : SIβ (Q) ֒→ L SIβ (Q) mapping SIβ (Q) onto σ0 SIβ (Q)σ0 , where σ0 runs through all weights not supported on r. L L Proof. It suffices to show that SIβ (Q) ∼ = σ0 SIβ (Q)σ0 . Let Min := h(a)=r M (t(a)) L and Mout := t(b)=r M (h(b)). By the first and second fundamental theorem of invariant theory of GL(V ), we can identify Hom(Min , M (r)) × Hom(M (r), Mout )// GL(M (r)) with the rank at most β(r) maps in Hom(Min , Mout ). But due to L our assumption, all maps in Hom(Min , Mout ) have rank at most β(r). By definition, σ0 SIβ (Q)σ0 = k[Repβ (Q)]SLβ × GL(M(r)) , which is equal to k[Repβ (Q)]SLβ .  18 JIARUI FEI In other words, the σ0 in the above lemma is in θ⊥ , where θ is the weight corresponding to the unit vector er . It follows from Proposition 2.13 and Lemma 3.16 that Theorem 3.17. Suppose that SIβ (Q) is a naturally graded UCA C(∆; σ), and B(∆) has full rank. Let r be a vertex of Q satisfying (3.3) and that σ(v)(r) = 0 for all v ∈ ∆0 except for a set of frozen vertices v, where all σ(v)(r) < 0 (or all v)), where > 0). Then we have that SIβ (Q) is the naturally graded UCA C(∆u v ; σ(b u is attached to v. Finally, we remark that Proposition 2.13 can also be used to remove Q arrows. The outer automorphism group Aut1 (Q) of the quiver Q is by definition i,j∈Q0 GL(Ai,j ), where Ai,j is the linear space spanned by arrows from i to j. In particular, for each arrow a of Q, there is an associated torus ka∗ in Aut1 (Q).QSince the action of Aut1 (Q) commutes with the action of GLβ , the torus T1 := a∈Q1 ka∗ induces another grading of the semi-invariant ring. If the cluster in a seed is homogeneous with respect to the grading induced by ka∗ , then we can use Proposition 2.13 to remove the arrow a. 3.5. Partial Flag Varieties, Quintuple and Quadruple Flags, and a Triple Flag. Exercise 3.18 (Partial flag varieties). We are able to find the cluster structure of total coordinate ring of any partial flag varieties in type A. Since the divisor class group of a Grassmannian is Z, its total coordinate ring is just the usual coordinate ring. Hence we should be able to recover the result in [27] as well. We can start from the result in Example 3.10, then remove some vertices on the long arm of SFn depending on the particular flag variety. The following hint may be useful. Let rl,m = {n − i | i = l, l + 1, . . . , m} for n > m ≥ l. We define a sequence of vertices ul := {(l − 1, 1), (l − 2, 2), . . . , (1, l − 1)}. This contains all mutable vertices of l-th row of ∆♭n . If we want to remove all vertices in rl,m , we first apply a sequence mutation in the following order (3.4) ul ; ul+1 , ul ; ul+2 , ul+1 , ul ; . . . . . . ; um , um−1 , . . . , ul . Then we are able to apply Theorem 3.17. Exercise 3.19 (Complete quintuple and quadruple flags). To get the cluster structure of complete quintuple flags, we start with Example 3.14, then we remove all vertices in a flag in the order n − 1, n − 2, . . . , 1. Remove vertices in another flag, and we get a complete quadruple flag. We shall find that Proposition 3.20. The semi-invariant ring SIβn5 (Sn5 ) is the GUCA C(!n ; σ ′n ); The semi-invariant ring SIβn4 (Sn4 ) is the GUCA C(n ; σ ′′n ). We are not going to give the precise construction of the quivers !n and n because it is rather clear. When n = 3, the quiver !3 and 3 is displayed below. Conjecture 3.21. The quiver Snm can be projected from a triple flag quiver for any m ≥ 3, n ≥ 2. The semi-invariant ring SIβnm (Snm ) of any complete m-tuple flag is an upper cluster algebra. What we will do in the rest of this subsection is to illustrate in a single example on how to inductively apply the vertex removal technique (Theorem 3.17) to find CLUSTER ALGEBRAS AND SEMI-INVARIANT RINGS II. PROJECTIONS 1,2 0,5 2,1 1,2 E ✷✷ ✌F ✸✸ ✷ ✌✌ ✸ ☛☛ ☛ o o o o 1,3 0,4 2,2 3,1 4,0 ✷✷ ✌✌F ✸✸✸ ✌✌F ✷✷✷ ☛☛E ✷✷✷ ✌F ✷ ✌✌ ✸ ✌✌ ✷ ☛☛ ✷ ✌✌ o o o o o 1,4 2,3 3,2 4,1 ✸✸ ✌F ✷✷ ✌✌F ✷✷✷ ☛☛E ✸ ✌✌ ✷  ☛ ✌ 1,5 2,4 4,2 1,3 5,0 19 2,1 ✷✷ ✌F ✸✸ ✷ ✌✌ ✸ o o o 2,2 3,1 4,0 ✌✌F ✷✷✷ ☛☛E ✷✷✷ ✌F ✷ ☛☛ ✷ ✌✌ ✌ o o o 2,3 3,2 4,1 ✸✸ ✌F ✷✷ ✸ ✌✌ ✷ 5,1 4,2 5,0 5,1 Figure 4. The quiver !3 (left) and 3 (right) possible cluster structure. If the method described below fails, we believe that the cluster structure may not exist. However, the method is not deterministic. The Method: Suppose that SIβ (Q) is a GUCA C(∆; σ), and we want to remove a vertex r of Q satisfying (3.3) Let us assume that β is a Schur root, so the stabilizer in general position of the action is zero-dimensional. Then the Krull dimension of SIβ (Q) is given by dim Repβ (Q) − dim SLβ = |Q0 | − hβ, βi. We first compute the difference d of |Q0 |−hβ, βi before and after the vertex removal. If Theorem 3.17 works, then σ(v)(r) should vanish for all but exactly d frozen vertices, where σ(v)(r) < 0 (or > 0). These d vertices are our choice of v. Otherwise the method fails, or the cluster structure may not exist for SIβ (Q). Next we need to seek a suitable sequence of mutations such that after application σ(u)(r) = 0 for all mutable u. If no such sequence exists, then the method fails, or the cluster structure may not exist. If succeeds, we take ∆u v , where u is attached to v. Example 3.22. In this example, we explain how to find a cluster algebra structure of the semi-invariant ring SIβ (T3,3,5 ), where (T3,3,5 , β) is obtained from (T6 , β6 ) by removing the 5’s of all three arms, and the 1’s and 3’s of the first two arms. We also explain why the cluster algebra structure may not exist if we further forget either 1 or 3 of the third arm. We suggest that readers play this example with B. Keller’s applet [18]. We can directly apply Theorem 3.17 to remove all 5’s and one 3, say of the first arm. The results correspond to the Figure (5a), (5b), (5c), and (5d). We apply another mutation at (3, 2) to make the quiver easier to draw. This step is optional. Next, to remove 1 of the first arm, we first mutate at (1, 3) and (1, 2), then we find that v = {(1, 1), (1, 4)} and u = {(1, 2)} as required. So we delete v and freeze u, and perform an optional mutation at (1, 3). Similarly, to remove 3 of the second arm, we mutate at (1, 3) and (2, 3), then we find that v = {(0, 3), (3, 1)} and u = {(2, 3)}. So we delete v and freeze u, and perform an optional mutation at (1, 3). Finally to remove 1 of the first arm, we mutate at (1, 3) and (2, 1), then we find that v = {(1, 2), (4, 1)} and u = {(2, 1)}. So we delete v and freeze u, and perform an optional mutation at (2, 2). The results correspond to the Figure (5e), (5f), and (5g). The interested readers can verify using [18] that the types of the cluster algebras are affine E9 , E8 , E7 , D6 , D5 , D4 , A3 . 20 JIARUI FEI For the last one, the cluster variable associated to a vertex v is semi-invariant of weight fv , where fij as before and ′ f21 = 3e6 − 2e31 − e12 − e22 − e14 − e24 − e34 , ′ f23 = 3e6 − e12 − e22 − 2e33 − e14 − e24 , ′′′ f13 = 2e6 − e31 − e12 − e22 − e33 − e24 , ′ f32 = 2e6 − e31 − e12 − e22 − e33 − e14 , ′ f22 = 2e6 − e31 − e33 − e14 − e24 . One can verify that they all correspond to all real Schur roots. The semi-invariant ring SIβ (T3,3,5 ) is this graded upper cluster algebra. However, if we want to further remove 3 or 1 of the third arm, then we are unable to choose the set v because the expected cardinality of v is 2. Even worse, no matter how we mutate from (5g), there are at least 3 vertices v such that σ(v)(r) 6= 0. So we suspect that it may not be an upper cluster algebra. 4. Cluster Characters from Quivers with Potentials 4.1. Quivers with Potentials. In [6] and [7], the mutation of quivers with potentials is invented to model the cluster algebras. We emphasis here that ice quivers considered here can have arrows between frozen vertices. Following [6], we define a potential W on an ice quiver ∆ as a (possibly infinite) linear combination of oriented cycles in ∆. More precisely, a potential is an element of the trace space c := k∆/[ c k∆, c k∆], c where k∆ c is the completion of the path algebra k∆ and Tr(k∆) c k∆] c is the closure of the commutator subspace of k∆. c The pair (∆, W ) is [k∆, an ice quiver with potential, or IQP for short. For each arrow a ∈ ∆1 , the cyclic c is defined to be the linear extension of derivative ∂a on k∆ ∂a (a1 · · · ad ) = d X a∗ (ak )ak+1 · · · ad a1 · · · ak−1 . k=1 For each potential W , its Jacobian ideal ∂W is the (closed two-sided) ideal in c generated by all ∂a W . The Jacobian algebra J(∆, W ) is the quotient algebra k∆ c k∆/∂W . If W is polynomial and J(∆, W ) is finite-dimensional, then the completion is unnecessary to define J(∆, W ). This is the case throughout this paper. The key notion introduced in [6, 7] is the mutation of quivers with potentials and their decorated representations. For an ice quiver with nondegenerate potential (see [6]), the mutation in certain sense “lifts” the mutation in Definition 1.1. Since we do not need mutation in an explicit way, we refer readers to the original text. Definition 4.1. A decorated representation of a Jacobian algebra J := J(∆, W ) is a pair M = (M, M + ), where M ∈ Rep(J), and M + is a finite-dimensional k ∆0 -module. Let Rep(J) be the set of decorated representations of J(∆, W ) up to isomorphism. There is a bijection between two additive categories Rep(J) and K 2 (proj -J) mapping any representation M to its minimal presentation in Rep(J), and the simple representation Su+ of k ∆0 to Pu → 0. Suppose that M corresponds to a 0 projective presentation P (β1 ) → P (β0 ) for β1 , β0 ∈ ZQ >0 . CLUSTER ALGEBRAS AND SEMI-INVARIANT RINGS II. PROJECTIONS 21 Definition 4.2. The g-vector g(M) of a decorated representation M is the weight vector of its image in K b (proj -J), that is, g = β1 − β0 . The representation M is called g-coherent if min(β1 (u), β0 (u)) = 0 for all vertices u. Definition 4.3. For an IQP (∆, W ), freezing a set of vertices u is the operation that we set all vertices in u to be frozen, but we do not delete arrows between frozen vertices. We also keep the same potential W . Remark 4.4. This definition is slightly different from [9] where we delete arrows between frozen vertices, and thus change potential as well. This difference can be ignored if we only look at the category of µ-supported representations (see Definition 4.5). The reason is that for the two different definitions, the two categories are equivalent and their objects take the same value under the cluster character (Definition 4.6). However, if we insist on deleting arrows between frozen vertices, that will cause additional trouble in constructing the two functors in Section 5.1. Definition 4.5. A decorated representation M is called µ-supported if the supporting vertices of M are all mutable. We denote by Repg,µ (J) the set of all g-coherent µ-supported decorated representations of J. 4.2. The Cluster Character. Definition 4.6 ([7]). We define the cluster character C : Repg,µ (J) → Z(x) by X  e b , (4.1) C(M) = xg(M) χ Gre (M ) y e e where Gr (M ) is the variety parameterizing e-dimensional quotient representations of M , and χ(−) denotes the topological Euler-characteristic. It turns out [9, Lemma 5.3] that if M ∈ Repg,µ (J), then C(M) is an element in C(∆, x). We note that C(M) has a well-defined g-vector, which is g(M). Theorem 4.7 ([9, Theorem 5.6]). Suppose that IQP (∆, W ) is non-degenerate and B(∆) has full rank. Let R be a set of g-coherent µ-supported decorated representations with all distinct g-vectors, then C maps R (bijectively) to a set of linearly independent elements in the upper cluster algebra C(∆). However, it is not clear to us whether any UCA has a basis with distinct g-vectors. Definition 4.8 ([3]). To any g ∈ Z∆0 we associate the reduced presentation space PHomJ (g) := HomJ (P ([g]+ ), P ([−g]+ )), where [g]+ is the vector satisfying [g]+ (u) = max(g(u), 0). We denote by Coker(g) the cokernel of a general presentation in PHomJ (g). Reader should be aware that Coker(g) is just a notation rather than a specific representation. If we write M = Coker(g), this simply means that we take a general presentation in PHomJ (g), then let M to be its cokernel. Definition 4.9 ([9]). A weight vector g ∈ K0 (proj -J) is called µ-supported if Coker(g) is µ-supported. Let G(∆, W ) be the set of all µ-supported vectors in K0 (proj -J). Definition 4.10 ([21]). We define the generic character CW : G(∆, W ) → Z(x) by X  (4.2) CW (g) = xg χ Gre (Coker(g)) ye . e 22 JIARUI FEI It is known [9, Lemma 5.11] that a general presentation in PHomJ (g) corresponds to a g-coherent decorated representation. So the image of CW is also contained in C(∆, x). In particular, we have that G(∆, W ) ⊆ G(∆). Remark 4.11. Assume that we are in the situation of Theorem 4.7. Moreover, we assume that C(∆) is σ-graded with finite-dimensional graded components. Let G(R) be the set of all g-vectors in R. If C(R) forms a basis of C(∆), then so does CW (G(R)) by Lemma 1.11. Definition 4.12. We say that an IQP (∆, W ) models an algebra A if the generic cluster character maps G(∆, W ) onto a basis of A. If A is the upper cluster algebra C(∆), then we simply say that (∆, W ) is a cluster model. If in addition G(∆, W ) is given by lattice points in some polyhedron, then we say that the model is polyhedral. In this definition we do not require the IQP to be non-degenerate. If C(∆) is σgraded with finite-dimensional graded components, then by Remark 4.11 (∆, W ) being a cluster model is equivalent to that C(∆) is g-indexed and G(∆, W ) = G(∆). 5. The IQP Models 5.1. Restriction and Induction. Definition 5.1. For an IQP (∆, W ), deleting a set of vertices v ⊂ ∆0 is the operation that we delete all vertices in v for ∆, and set all incoming and outgoing arrows of v ∈ v to be zero in W . We denote the new IQP by (∆v , Wv ). The operation of deleting v is the same as restricting (∆, W ) to the vertex set ∆0 \ v as in [6, Definition 8.8]. In what follows, we shall mainly consider the case when v is a single vertex e. The general case can be easily treated by induction. According to [6, Proposition 8.9], the restriction induces an algebra epimorphism p : J(∆, W ) ։ J(∆e , We ). We denote Je := J(∆e , We ). Let rese : Rep(Je ) → Rep(J) be the restriction of scalar functor induced by p. Concretely, if N ∈ Rep(Je ), then the extension of N by zeros to the quiver ∆ is clearly a representation of J. Such a representation is rese (N ). Conversely, we denote the functor ⊗J Je : Rep(J) → Rep(Je ) by inde . It is well-known [28] that the functor inde is left adjoint to the exact functor rese . We extend the functor rese to decorated representations by copying the decorated spaces. We denote such a map still by rese : Rep(Je ) → Rep(J). The functor inde f → P0 ∈ proj -J, we define inde (f ) ∈ proj -Je can be naturally extended. For P1 − f ⊗J J e as P1 ⊗J Je −−−−→ P0 ⊗J Je . We note that Pe ⊗J Je = 0 but Pu ⊗J Je is the indecomposable projective Pu in Rep(Je ). So g(inde (M)) = le (g(M)), where le is the linear map forgetting the e-th coordinate. Lemma 5.2. The g-vector of M and rese (M) only differ on the e-th coordinate. Moreover, g(rese (M))(e) is always non-negative. Proof. Recall from [6, (1.13)] that (5.1) g(u) = dim(Coker γu ) − dim M (u) + dim M + (u). We refer readers to [6, Section 10] for the definition of the map γu . Comparing M and rese (M), we find that there is no changes on the three terms on the right for u 6= e. The last statement is also clear from the equation.  CLUSTER ALGEBRAS AND SEMI-INVARIANT RINGS II. PROJECTIONS 23 Lemma 5.3. The composition inde · rese is the identity functor. In particular, if e is frozen and Coker(f ) is µ-supported, then so is Coker(inde (f )). Proof. Since the composition is right exact, it suffices to show that it is an identity on the indecomposable projective representations. By Lemma 5.2, for any Pu ∈ Rep(Je ) we have the following presentation mPe → Pu → rese (Pu ) → 0 for some m ∈ Z>0 . We apply the right exact functor inde to the exact sequence, and get 0 = m inde (Pe ) → Pu = inde (Pu ) → inde rese (Pu ) → 0. If e is frozen, then f = rese (f ′ ) for some µ-supported f ′ . The last statement follows.  Ln L Suppose that P0 = m j=1 Pvj . Then we can view P0 , P1 as i=1 Pui and P1 = row vectors with entries in Pui , Pvj , and f : P1 → P0 can be represented by an n × m matrix (aji ) with aji a linear combination of paths from ui to vj . From this description, we see that the functor ⊗J Je induces a surjective algebraic map HomJ (P1 , P0 ) → HomJe (P1 ⊗J Je , P0 ⊗J Je ). In particular, if f is general enough in HomJ (P1 , P0 ), then both C(M) and C(inde (M)) take the value of the generic character, where M is the decorated representation corresponding to f . 5.2. Orthogonal Projection. We first focus on the case when e is frozen. We keep our assumption that ǫ = σ(e) is real. Lemma 5.4. We have the following commutative diagram for e frozen.  C / C(∆, x; σ) Repg,µ (J)  ℓe inde Rep  g,µ (Je )  C  / C(∆e , xe ; σ e ) Proof. The surjectivity of ℓe follows from Proposition 2.8. For M ∈ Repg,µ (J), we have that M = rese (N ) for some N ∈ Repg,µ (Je ) because e is frozen. Recall from Lemma 5.3 that inde · rese (N ) = N . By the definition of rese , N is isomorphic P to rese (N ) restricting to the subquiver ∆e . By definition C(M) = xg(M) χ(Gre (M))ye . By Lemma 2.10 we have that X ℓe (C(M)) = ℓe (xg(M) ) χ(Gre (M))(y′ )e . On the other hand, ) C(inde (M)) = C(N ) = xg(N e l (g(M)) Since ℓe (xg(M) ) = xee g(N ) = xe X χ(Gre (M))(y′ )e . , we conclude that ℓe C = C inde .  Remark 5.5. If e is a projector, then we have the embedding ie : C(∆e ; σ e ) ֒→ C(∆; σ). However, we want to warn readers that another functor rese and the embedding do not fit into the above commutative diagram in general, i.e., C rese 6= ie C. Theorem 5.6. Suppose that e is a projector in C(∆; σ). If (∆, W ) models C(∆; σ), then (∆e , We ) models C(∆e ; σe ). 24 JIARUI FEI Proof. We first assume that e is frozen. We first show that CWe (G(∆e , We )) forms a basis of C(∆e ). By assumption, there is a subset R of Repg,µ (J(∆, W )) with distinct g-vectors in Ker ǫl (defined after Remark 2.9) such that C(R) forms a basis of C(∆; σ)ǫ⊥ . Moreover, by the remark in the end of Section 5.1, each element in R can be chosen to take the value of the generic character. Since e is a projector, C(∆e ; σ e ) = C(∆; σ)ǫ⊥ by Proposition 2.8. So ℓe (C(R)) = C(inde (R)) forms a basis of C(∆e ; σ e ). Since g(inde (M)) = le (g(M)), by a similar argument as in Corollary 2.11 we see that elements in inde (R) have distinct g-vectors. Now we come back to the general situation, that is, e is not necessary frozen. We first claim that ℓe (CW (G(∆e , W ))) spans C(∆e ; σ e ) if CW (G(∆, W )) spans C(∆; σ). For any such g ∈ G(∆, W ), we can always find some m sufficiently large such that Coker(g + mee ) is not supported on e, i.e., g + mee ∈ G(∆e , W ). By the definition of ℓe , the g-vector of ℓe (CW (g)) is equal to g − hǫ, gσiee . Note that this is also the g-vector of ℓe (CW (g + mee )). Since ℓe (CW (G(∆, W ))) spans C(∆e , xe ; σ e ), so is ℓe (CW (G(∆e , W ))) by Lemma 1.11. Finally, we can apply the previous conclusion to (∆e , W ).  Remark 5.7. If the model of C(∆) is polyhedral, then so is the model of C(∆e ) because le is totally unimodular. The similar remark also applies to Theorem 5.17. Corollary 5.8. Suppose that (∆, W ) models SIβ (Q) and B(∆) has full rank. If σ(e) = σ ǫ is a real weight extremal in R+ Σβ (Q), then (∆e , We ) models SIβǫ (Qǫ ). Proof. This follows from Theorem 3.7, Proposition 3.6, and Theorem 5.6.  5.3. Example continued. The quiver ∆n can be equipped with a rigid potential Wn (see [9] for detail). It is proved in [9] that (∆n , Wn ) models the semi-invariant ring SIβn (Tn ). Moreover, G(∆n , Wn ) is given by the lattice points in the hive cone Gn defined as follows. A maximal straight path in ∆n must start from a frozen vertex and end in another frozen vertex, eg., from (i, 0) to (0, i). We define Gn by X (5.2) g(u) ≥ 0 for all strict subpaths p of a maximal straight path. u∈p P Here, subpaths include all trivial paths ev for v frozen, and the notation u∈p g(u) stand for g(u0 ) + g(u1 ) + · · · + g(ut ) if p is the path u0 − → u1 − → ··· − → ut . Definition 5.9. Given a weight configuration σ of a quiver ∆ and a convex polyhedral cone G ⊂ R∆0 , we define the (not necessarily bounded) convex polytope G(σ) as G cut out by the hyperplane sections gσ = σ. It follows from Knutson-Tao [20] and Derksen-Weyman [4] (see [9]) that the lattice λ(σ) points in Gn (σ) counts the Littlewood-Richardson coefficient cµ(σ),ν(σ) . We refer readers to [5, 7.1] for the definition of the partitions λ(σ), µ(σ), and ν(σ). Example 5.10 (Example 3.10 continued). By Corollary 5.8, G(∆♭n ; σ ♭n ) is given by lattice points in some polyhedral cone denoted by G♭n . Similar to the calculation in [9, Section 6], we find that the cone G♭n can also be described by (5.2). By a calculation similar to [4, Proposition 1], we find that the dimension of each graded piece SIβn′ (SFn )σ counts the Kostka number Kλµ , which is by definition the multiplicity of the irreducible complex representation Sλ of GLn in the tensor CLUSTER ALGEBRAS AND SEMI-INVARIANT RINGS II. PROJECTIONS 25 product Sµ(1) ⊗Sµ(2) ⊗· · ·⊗Sµ(n) . The partitions λ and the weight µ are determined by σ as follows λ(σ) = ((n − 1)−σ(n−1) , . . . , 2−σ(2) , 1−σ(1) )∗ , µ(σ) = (σ(1′ ), σ(2′ ), . . . , σ(n′ )). Alternatively, one can see this from the identification in Theorem 3.5. Under the identification SIβn′ (SFn )σ ∼ = SIβn (Tn )ιF (σ) , the Kostka coefficient can be interpreted as certain Littlewood-Richardson coefficient. This interpretation is well-known. µ(σ) Proposition 5.11. The Kostka number Kλ(σ) is counted by the lattice points in G♭n (σ). ♭♭ Example 5.12 (Example 3.12 continued). By Corollary 5.8, G(∆♭♭ n ; σ n ) is given ♭♭ by lattice points in some polyhedral cone  denoted by Gn . Since the semi-invariant ring is just a polynomial ring in N = n2 variables, we see that the cone is generated by N extremal rays. Moreover, the cone G♭♭ n can also be described by (5.2), and we denote this hyperplane representation by gHn ≥ 0. The cone is related to Kostant’s vector partition function kA [17, 24.1] in type A as follows. Recall that kA (λ) counts the lattice points in the polytope KA (λ) := {h ∈ ZN >0 | hΦn = λ}, where Φn is the matrix form by rows of positive roots in type An−1 . It is easy ♭♭ to verify by linear algebra that Hn Φn = σ ♭♭ n , so we have that Gn (σ) = KA (λ(σ)), ♭♭ −1 ♭♭ where λ(σ) = gHn σ n if σ = gσ n . Since Hn is totally unimodular, the two polytope have the same number of lattice points. Question 5.13. Recall that Kostant’s formulae [17, 24.2] X Kλµ = (−1)ε(ω) kA (ω · λ − µ) ω∈Sn relates any Kostka number to an alternating sum of values in the partition function, and Steinberg’s formulae [17, 24.4] X (−1)ε(ω) Kνω·λ−µ cλµ,ν = ω∈Sn relates any Littlewood-Richardson coefficient to an alternating sum of Kostka numbers. Here ω · λ is the dot action of Sn defined by ω · λ = ω(λ + ρ) − ρ for ρ the half sum of positive roots in type A. Can we see these two formula from the relations ♭ among polytopes G♭♭ n , Gn , and Gn ? ▽ Example 5.14 (Example 3.14 continued). By Corollary 5.8, G(∆▽ n ; σ n ) is given ▽ by lattice points in some polyhedral cone denoted by Gn . By a similar calculation in [9, Section 6], we find that the cone G▽ n can also be described by (5.2). Similar to [4, Proposition 1], the dimension of each graded piece SIβn6 (Sn6 ) counts certain multiple Littlewood-Richardson coefficients cλη ([10, Section 1]), where η = (η1 , η2 , . . . , η5 ) and λ are determined by the weight σ similar to [5, 7.1]. λ(σ) Proposition 5.15. The multiple Littlewood-Richardson coefficients cη(σ) is an or′ dinary Littlewood-Richardson coefficient cλµ′ ,ν ′ , which is counted by the lattice points in G▽ n (σ). 26 JIARUI FEI 5.4. Vertex Removal. Suppose that u is attached to v, and (∆, x; σ) is a graded u seed. If we restrict the seed to ∆u v); σ(b v)) as in v , we get a new graded seed (∆v , x(b Section 2.3. Denote Jv := J(∆v , Wv ). Recall that in the situation of Proposition 2.13, we have an epimorphism pv : C(∆; σ) ։ C(∆u v)). The proof of the v ; σ(b following lemma, theorem, and corollary is completely analogous to (but easier than) that of Lemma 5.4, Theorem 5.6, and Corollary 5.8, so we leave the details to the readers. Lemma 5.16. We have the following commutative diagram under the assumption of Proposition 2.13.  C / C(∆, x; σ) Repg,µ (J)  pv resv Rep  g,µ  (Jv )  C  / C(∆u v); σ(b v)) v , x(b Theorem 5.17. Under the same assumption as Proposition 2.13, we suppose that v)). (∆, W ) models C(∆; σ). Then (∆v , Wv ) models C(∆u v ; σ(b Corollary 5.18. Under the same assumption as Theorem 3.17, we suppose that the semi-invariant ring SIβ (Q) is modeled by (∆, W ). Then SIβ (Q) is modeled by (∆u v , Wv ). We are not going provide more examples for this part. Good examples for illustration are contained in [10, Section 10]. References 1. M. F. Atiyah, I. G. Macdonald, Introduction to commutative algebra, Addison-Wesley Publishing Co., Reading, Mass.-London-Don Mills, Ont. 1969 ix+128 pp. 2. A. Berenstein, S. Fomin, A. Zelevinsky, Cluster algebras. III. Upper bounds and double Bruhat cells, Duke Math. J. 126 (2005), no. 1, 1–52. 3. H. Derksen, J. Fei, General presentations of algebras, Adv. Math. 278 (2015), 210–237. 4. H. Derksen, J. Weyman, Semi-invariants of quivers and saturation for Littlewood-Richardson coefficients, J. Amer. Math. Soc. 13 (2000), no. 3, 467–479. 5. H. Derksen, J. Weyman, The combinatorics of quiver representation, Ann. Inst. Fourier (Grenoble) 61 (2011), no. 3, 1061–1131. 6. H. Derksen, J. Weyman, A. Zelevinsky, Quivers with potentials and their representations I, Selecta Math. (N.S.) 14 (2008), no. 1, 59–119. 7. H. Derksen, J. Weyman, A. Zelevinsky, Quivers with potentials and their representations II, J. Amer. Math. Soc. 23 (2010), no. 3, 749–790. 8. M. Domokos, A. Zubkov, Semi-invariants of quivers as determinants, Transform. Groups 6 (2001), no. 1, 9–24. 9. J. Fei, Cluster algebras and semi-invariant rings I. Triple Flags, arXiv:1411.4693. 10. J. Fei, Cluster algebras, invarant theory, and Kronecker coefficients I, arXiv:1504.02970. 11. V. Fock and A. Goncharov, Moduli spaces of local systems and higher Teichmüller theory, Publ. Math. Inst. Hautes Études Sci., 103 (2006) 1–211. 12. S. Fomin, P. Pylyavskyy, Tensor diagrams and cluster algebras, arXiv:1210.1888. 13. S. Fomin, A. Zelevinsky, Cluster algebras. I. Foundations, J. Amer. Math. Soc. 15 (2002), no. 2, 497–529. 14. S. Fomin, A. Zelevinsky, Cluster algebras. IV. Coefficients, Compos. Math. 143 (2007), no. 1, 112–164. 15. C. Geiss, B. Leclerc, J. Schröer, Auslander algebras and initial seeds for cluster, Journal of the London Mathematical Society (2) 75 (2007), 718–740. 16. C. Geiss, B. Leclerc, J. Schröer, Partial flag varieties and preprojective algebras, Ann. Inst. Fourier (Grenoble) 58 (2008), no. 3, 825–876. CLUSTER ALGEBRAS AND SEMI-INVARIANT RINGS II. PROJECTIONS 27 17. J. E. Humphreys, Introduction to Lie algebras and representation theory, Graduate Texts in Mathematics, Vol. 9. Springer-Verlag, New York-Berlin, 1972. 18. B. Keller, Quiver mutation in Java, http://www.math.jussieu.fr/∼keller/quivermutation/. 19. A.D. King, Moduli of representations of finite-dimensional algebras, Quart. J. Math. Oxford Ser. (2) 45 (1994), no. 180, 515–530. 20. A. Knutson, T. Tao, The honeycomb model of GLn (C) tensor products. I. Proof of the saturation conjecture, J.Amer. Math. Soc. 12 (1999), no. 4, 1055–1090. 21. P. Plamondon, Generic bases for cluster algebras from the cluster category, Int Math Res Notices (2013) 2013 (10): 2368–2420. 22. V. L. Popov, E. B. Vinberg, Invariant theory, in: Algebraic geometry. IV, Encyclopaedia of Mathematical Sciences, vol. 55, Springer-Verlag, Berlin, 1994, 123–284. 23. A. Schofield, Semi-invariants of quivers, J. London Math. Soc. (2) 43 (1991), no. 3, 385–395. 24. A. Schofield, General representations of quivers, Proc. London Math. Soc. (3) 65 (1992), no. 1, 46–64. 25. D. Speyer, An infinitely generated upper cluster algebra, arXiv:1305.6867. 26. A. Schofield, M. Van den Bergh, Semi-invariants of quivers for arbitrary dimension vectors, Indag. Math. (N.S.) 12 (2001), no. 1, 125–138. 27. J. Scott, Grassmannians and cluster algebras, Proc. London Math. Soc. (3) 92 (2006), no. 2, 345–380. 28. Z. Škoda, Noncommutative localization in noncommutative geometry, Non-commutative localization in algebra and topology, 220–313, London Math. Soc. Lecture Note Ser., 330, Cambridge Univ. Press, Cambridge, 2006. National Center for Theoretical Sciences, Taipei 30043, Taiwan E-mail address: [email protected] 28 JIARUI FEI 0,1 0,5 1,0 0,1 ✸✸ ☛E ✸ ☛☛ o o 1,1 0,2 2,0 ✸✸ ☛☛E ✸✸✸ ☛E ✸ ☛☛ ✸ ☛☛ o o o 0,3 3,0 1,2 2,1 ✸✸ ☛☛E ✸✸✸ ☛☛E ✸✸✸ ☛E ✸ ☛☛ ✸ ☛☛ ✸ ☛☛ o o o o 1,3 0,4 2,2 3,1 ✸✸ ☛☛E ✸✸✸ ☛☛E ✸✸✸ ☛☛E ✸✸✸ ✸ ☛☛ ✸ ☛☛ ✸ ☛☛  o o o o 4,1 1,4 2,3 3,2 ✸ ✸ ✸ ☛E ✸✸ ☛☛E ✸✸ ☛☛E ✸✸  ☛  ☛  ☛☛ 1,5 2,4 3,3 4,0 0,4 4,2 2,4 (a) remove 1 5 0,2 0,4 1,1 3,3 0,2 2,0 0,4 4,0 0,4 2,0 3,1′ 4,0 4,2 (d) remove 1 3 2,0 3,1′ 1,1 2,4 0,2 O ✸✸ E ✸✸ ☛☛ ☛ o ✸✸ 0,3 ✸✸ ♣♣♣✠7 2,1O ✸✸ ✺✺ ♣ ✸✸ ✺ ♣♣♣♣♣✸✸ ✠✠✠ ✸✸ o o o 1,3′ 2,2 ✸✸ ♣8 E☛ ✺✺ D✠ ✷✷ ♣✸ ♣♣ ✷ ✺ ✠ ☛ ✷ ☛☛ ✺ ♣♣♣♣ ✸ ✠ o o o 2,3 1,2′ 3,2′ 4,1 F ✸✸ D ✸✸ ✠ ☞ ✸ ✸ ✠ ☞  ✠ ☞  2,4 4,2 ✺✺ ☛E ✷✷ ☛E ✷ ☛☛ ✺ ☛☛ o o o 1,2 0,3 2,1 3,0 O ✸✸ ✸✸ ✌✌F ✸✸✸ ✸ ✸ ✌✌ ✸ ✸✸ o o o ✸✸ 1,3 2,2 E ✷✷ ✸✸ ♣♣♣8 E ✺✺ ☛ ☛ ✺ ✷ ☛ ☛ ♣ ✺ ♣♣♣ ♣✸ ✷ ☛☛ ☛ o o o 1,4 3,2′ 4,1 2,3 ✌✌F ✸✸✸ ✠✠D ✸✸✸  ✠  ✌ 4,2 (c) remove 3 5 0,2 3,3 4,0 (b) remove 2 5 ✷✷ ✌F ✷✷ ✌F ✷ ✌✌ ✷ ✌✌ o o o 0,3 3,0 1,2 2,1 ✸✸ ✌✌F ✷✷✷ ✌✌F ✷✷✷ ☛E ✷ ☛☛ ✷ ✌✌ ✸ ✌✌ o o o o 1,3 2,2 3,1 E ✷✷ ✌F ✷✷ ✌F ✸✸ ☛ ✷✷ ✌✌ ✷✷ ✌✌ ✸ ☛☛  ✌o  ✌o o 1,4 4,1 2,3 3,2 ✌F ✷✷✷ ✌✌F ✷✷✷ ✌  ✌  ✌ 2,4 1,0 ✸✸ ☛E ✸ ☛☛ o o 1,1 0,2 2,0 ✸✸ ☛☛E ✸✸✸ ☛E ✸ ☛☛ ✸ ☛☛ o o o 0,3 3,0 1,2 2,1 ✸✸ ☛☛E ✸✸✸ ☛☛E ✸✸✸ ☛E ✸ ☛☛ ✸ ☛☛ ✸ ☛☛ o o o o 2,2 3,1 E☛13 ✸✸ E ✸ E ✸ ☛☛ ✸✸ ☛☛☛ ✸✸✸ ☛☛☛ ✸✸  ☛  ☛o  ☛o o 1,4 4,1 3,2 2,3 ✸ ☛E ✸✸✸ ☛☛E ✸✸  ☛☛  ☛ 4,0 0,4 4,2 2,4 (e) remove 1 1 (f) remove 2 3 4,0 4,2 0,4 [✻✻ ☛ ✻ ☛☛ 0,2 2,4 2,2′ ✽✽ ✟✟ Y✸✸✸ ✠D ✸ ✠✠ ✽ ✟✟ o / 1,3 ′′′ / ❖♥❖♥❖♥7 3,2′Z✺ ❖ ✺ ✞ ♥ ❖ ♥ ❖❖❖ ✺ ✞✞♥♥♥♥ ' 2,1′ 2,0 D O ✳✳ ✠✠ ✳✳ ✠ o ✳✳ 2,3′ 9 2,1 ✳ ss O ✺ ✾✾ ✾✾ sss✳✳s ✡✡✡ ✺✺✺  so  ✡ o ✺✺ o 1,3′′ ❑ 2,2 ✺✺ ♥♥7 B✆ ❑❑✏H ❑ ✆ ♥✺♥✺ ♥ ❑ ✆✆ ✏✏✏ ❑❑% ♥♥♥♥  o o ✏ 1,2′ 4,1 3,2′ ✻✻ ✏✏✏ ✻ ✏  0,2 2,3′ (g) remove 2 1 Figure 5. Operations towards SIβ (T3,3,5 ) in steps 4,2 4,0
0math.AC
Partial Reinitialisation for Optimisers arXiv:1512.03025v1 [stat.ML] 9 Dec 2015 Ilia Zintchenko Theoretical Physics and Station Q Zurich, ETH Zurich, 8093 Zurich, Switzerland ZINTCHENKO @ ITP. PHYS . ETHZ . CH Matthew Hastings Station Q, Microsoft Research, Santa Barbara, CA 93106-6105, USA MAHASTIN @ MICROSOFT. COM Quantum Architectures and Computation Group, Microsoft Research, Redmond, WA 98052, USA Nathan Wiebe Quantum Architectures and Computation Group, Microsoft Research, Redmond, WA 98052, USA NAWIEBE @ MICROSOFT. COM Ethan Brown Theoretical Physics and Station Q Zurich, ETH Zurich, 8093 Zurich, Switzerland EBROWN @ ITP. PHYS . ETHZ . CH Matthias Troyer Theoretical Physics and Station Q Zurich, ETH Zurich, 8093 Zurich, Switzerland TROYER @ PHYS . ETHZ . CH Abstract Heuristic optimisers which search for an optimal configuration of variables relative to an objective function often get stuck in local optima where the algorithm is unable to find further improvement. The standard approach to circumvent this problem involves periodically restarting the algorithm from random initial configurations when no further improvement can be found. We propose a method of partial reinitialization, whereby, in an attempt to find a better solution, only sub-sets of variables are re-initialised rather than the whole configuration. Much of the information gained from previous runs is hence retained. This leads to significant improvements in the quality of the solution found in a given time for a variety of optimisation problems in machine learning. 1. Introduction Multivariate optimisation is of central importance in industry and is used for a range of problems from finding solutions which satisfy a set of constraints to training classifiers in machine learning. Despite the wide range of ap- plications, nearly all of them involve finding an optimal assignment of a set of variables with respect to a cost function. An exact global optimum is, however, rarely required and is in general significantly more costly to find than a very good local optimum. Heuristic optimisers are therefore ubiquitous for many industrial application problems (Zhang et al., 2001; Likas et al., 2003; Burges et al., 2011). A heuristic optimiser generally starts from a random configuration of variables and optimises this configuration until a local optimum is found. For a convex optimisation problem this optimum is also the global optimum and no further effort is required. However, problems which are considered NP-hard have in general exponentially many such local optima and hence the probability that a particular local optimum is also the global one is exponentially suppressed. Nevertheless, such problems often contain some amount of structure which makes their solution useful. This structure can be used to obtain configurations of a given cost much faster than random guessing. As such, each subsequent query to the cost function makes use of preceding queries to make a more informed guess of an optimal configuration. Partial Reinitialisation for Optimisers km = N km 1 k2 k1 k0 Figure 1. An illustration of the partial reinitialisation algorithm. On each level l, sub-sets of kl variables are reinitialised (black circles) such that (km = N ) > km−1 > . . . > k0 . On the bottom level the k0 -optimal optimiser is called (yellow circles). Each level starts with the most optimal configuration of its parent and reinitialises a sub-set of kl variables before calling the optimiser on the next level (green arrows). Checkpoints of the most optimal configuration found are kept on each level with a flow from left to right (blue arrows). A strategy that is frequently used to escape a local optimum is to restart the optimisation process from a new random initial configuration. Repeating this process multiple times, the local optimum with the lowest cost is then returned, which is with high probability better and with certainty no worse than the initial configuration. Although such restarts allow the optimiser to get out of local optima, different restarts are also completely decoupled from each other. That is, information which was learned about the structure of the problem in one restart is not passed on to the next and has to be relearned from scratch. Hence, this way of running an optimiser is effectively coarse grained random guessing, but where each guess is further improved towards a local optimum. Here we introduce a general approach to address this problem which allows an optimiser to find the global optimum with high probability in a single run. 2. Algorithm Lets assume we have a heuristic which picks sub-sets of variables. Also, let us define k0 -optimality of an optimiser such that for any configuration it returns, reinitialising the variables in a typical sub-set smaller than k0 found by this heuristic does not get the configuration out of the local optimum. That is, the optimiser would just return the same configuration again. However, reinitialising sub-sets of k1 > k0 variables may allow the optimiser to find a set of new local optima, some of which may be worse or better than the current one. Starting from k1 = k0 , lets increase k1 until a better local optimum is reachable for a typical sub-set picked by our heuristic. If the current local optimum is good, that is, the number of better local optima is negligible, increasing k1 further would only reduce the chance of finding a better local optimum. Hence, except in the very beginning of the optimisation process, the optimiser has a higher chance of finding a better local optimum after re-initialising sub-sets of only k1 rather than N variables, where k0 < k1  N . As sub-sets of k1 variables are reinitialised and the optimiser called after each re-initialisation, the configuration becomes k1 -optimal with high probability and the chance of finding a better local optimum decreases. To prevent the optimiser from getting stuck in the k1 -optimum, sub-sets of k2 > k1 variables can be re-initialised. In turn, to get out of k2 -local optima, sub-set of k3 > k2 variables can be re-initialised and so on. Repeating this process iteratively, each time increasing the size of the sub-set until (km = N ), the configuration becomes N -optimal, which is the global optimum with high probability. This process can hence refine a local optimizer into a global optimizer. We call this approach partial re-initialisation with the following algorithm (see also Fig. 1). Algorithm 1 Partial reinitialisation Input: current level l, number of reinitialisations Ml and number of variables for each reinitialisation kl if l = 0 then call heuristic optimiser on x else x0 ← x reinitialise sub-set of kl variables in x for i ∈ {1 . . . Ml } do call partial reinitialisation on level l − 1 end for if cost(x) > cost(x0 ) then x ← x0 end if end if With m levels in the hierarchy, the algorithm is started from the mth level. The configuration is denoted by x and the checkpoints by x0 ; the checkpoints are optimal configurations found thus far, to which the algorithm reverts if no improved configuration is found by partial reinitialization. At each level l, Ml reinitialisations of kl variables are performed and (km = N ) > km−1 > . . . > k0 . The Q complexity of a single run of the algorithm is hence O( l Ml ). Not only the number of variables, but also the heuristic which picks the variables in a sub-set is important. The simplest approach is to pick variables at random. However, Partial Reinitialisation for Optimisers if variables are chosen according to a problem-specific heuristic, the probability that re-initialising a sub-set of a given size leads to a more optimal configuration can be maximised. One approach is to pick sub-sets such that the optimality of variables within the set depends on the values of the other variables in the set as much as possible. This could increase the chance of getting out of a local optimum by reducing the number of constraints on the sub-set from the rest of the system. If the outcome of the heuristic optimiser does not directly depend on the initial configuration, but also on a random seed, it could be used to optimise only the variables within a sub-set, while the other variables in the problem are kept fixed. Such an approach was employed in (Zintchenko et al., 2015) for finding ground states of Ising spin glasses with simulated annealing and showed significant speedup relative to conventional global restarts. of samples are needed to conclude with high probability that the value is k` -optimal. If  is small on the other hand, such as in unstructured search, then the number of requisite reinitialisations can be exponential in the number of variables. Thus the value of  taken makes an implicit assumption about the structure and complexity of the problem. 3. Benchmarks On a set of machine learning problems we study the advantage of partial reinitialisation compared to the standard full reinitialisation for finding optimum model parameters. These problems are picked from the ones with which we have most experience. The size of each problem was chosen to be large enough such that finding the optimal configuration is non-trivial using the respective standard algorithms. (1) It is worth noting that in machine learning, the local optimum is sometimes sufficient or even more desired than a global optimum due to overtraining (LeCun et al., 2015). However, as we show below, partial reinitialisation improves not only the quality of the final solution, but also the speed at which a local optium of a given quality is obtained. Also, although in general more expensive, overtraining can be reduced by using the classicifation accuracy on random sub-sets of the training data as a cost function. where µ is the mean and σ is the standard deviation of the distribition N . Hence, we can either fully reinitialise subsets of variables, add small perturbations to all variables, or combine the two and partially perturb sub-sets of variables, which could further improve performance. For simplicity we use α = 0 in the benchmarks below. For simplicity we use only one level in the hierarchy between a full reinitialisation and calling the heuristic optimiser. That is, for each full reinitialisation, multiple reinitialisations of sub-sets of variables are perfomed. To maintain generality, we choose sub-sets at random for all benchmark problems. If the optimisation problem is over the space of continuous variables, the concept of partial reinitialisation can be extended to partially reinitialising each variable in addition to sub-sets of variables. That is, rather than setting a variable to a random value within a pre-defined domain, it can be perturbed by, for example, adding noise with some standard deviation σ, that is x = αx + (1 − α)N (µ, σ) 2.1. Choosing M` Although M` can be chosen empirically to optimise the performance of an optimiser over a set of randomly chosen optimization problems, there is also a theoretical basis behind the choice. M` should be chosen to ensure that the probability of being in a local optima (with respect to reinitiasation of k` variables from the input) is maximised. We call such a configuration probabilistically k` –optimal. If we require that the probability that a reinitialization of k` variables does not improve the optimum is less than 1 − δ and assert that the probability that a given reinitialisation improves the objective function is P ≥  then it suffices to take (Donmez et al., 2009) M` ≥ dln(δ)/ ln(1 − )e. (2) Thus the values of δ and  specify the value of M` needed to conclude that the local optimum is probabilistically k` optimal within a margin of error. Furthermore, if we consider 1 −  to be a constant then only a logarithmic number The parameters in the benchmarks, such as the size of each subset (denoted by k1 ) and the number of partial reinitialisations (denoted by M1 ) which are done within each full reinitialisation, were manually optimised and are not the true optima for the respective performance metrics. As a performance measure for each benchmark we use the most optimal cost obtained after a given elapsed time or number of iterations averaged over multiple runs with different random initial states. Elapsed time was measured on Intel Xeon E5-2660 v2 processors. 3.1. Training hidden Markov models Learning temporal patterns in a signal is of central importance in a wide range of fields including speech recognition, finance and bioinformatics. A classic method to model such systems is hidden Markov models (HMM), which are based on the assumption that the signal follows a Markov process. That is, the future state of the system depends solely on the present state without any memory of the past. Partial Reinitialisation for Optimisers 5.0 1e10 0 5 M1 =8192 k1 =8 M1 =1 k1 =128 M1 =128 k1 =1 M1 =1 k1 =50 4.5 10 20 WCSS log P 15 25 4.0 3.5 30 35 3.0 40 45 0 10 101 102 time[s] 103 104 10-1 100 101 102 time[s] 103 104 Figure 2. Learning random 128-bit sequences using the BaumWelch algorithm. Median log-likelihood to observe the sequence within the model vs. elapsed training time over 1000 runs with different random seeds is shown. Full reinitialisations are blue and partial reinitialisations red. Figure 3. The benchmark is the A3 set from (clu, 2015). Median within-cluster sum of squares (WCSS) and elapsed time over 1000 runs of the k-means algorithm is shown. The blue curve is full reinitialisations and the red curve is partial reinitialisations. This assumption turns out to be surprisingly accurate for many applications. non-trivial starting from random transition and emission matrices. If the number of hidden states is at least as large as the length of the bit-string, the model can be trained until that bit-string is observed with certainty within the model. Here we will use two visible states and the same number of hidden states as bits in the input. For generality we do not impose any restrictions on the transition matrix. In discrete HMMs, which we will consider here, the system can be in one of N possible states hidden from the observer. Starting from a discrete probability distribution over these states, as time evolves the system can transition between states according to an N × N probability matrix A. Each hidden state can emmit one of M possible visible states. The model is hence composed of three parts: the initial probability distribution of length N over the hidden states; the N × N transition matrix between hidden states; the N × M emission matrix from each hidden state into M possible visible states. During training on a given input sequence, these matrices are optimised such as to maximise the likelihood for this sequence to be observed. The standard algorithm for training HMMs is the BaumWelch algorithm (Rabiner, 1989). It is based on the the forward-backward procedure, which computes the posterior marginal distributions using a dynamic programming approach. The model is commonly initialised with random values and optimised to maximise the expectation of the input sequence until convergece to a local optimum. To improve accuracy, multiple restarts are usually performed. Over the sequence of restarts, we will investigate if partial reinitialisation can improve the convergence rate towards a global optimum. As a benchmark we choose learning a random 128-bit string. Although artificial, this problem is very simple and has few free parameters. At the same time, finding a model which accurately represents the sequence is Each full reinitialisation starts with random emission and transition matrices. In a partial reinitialisation only the elements in the matrices corresponding to a sub-set of hidden states are reinitialised. We found about 8000 reinitialisations of 8 variables within each global restart to be optimal and leads to a much more rapid increase in accuracy with training time than with full reinitialisations (see Fig. 2). 3.2. Clustering with k-means Dividing objects into clusters according to a similarity metric is of central importance in data analysis and is employed ubiquitously in machine learning. Given a set of points in a finite-dimensional space, the idea is to assign points to clusters in such a way as to maximise the similarities within a cluster and minimise the similarities between clusters. Similarity can be defined in many ways, depending on the particular needs of the application. Here we use the Euclidean distance. One of the most widely used algorithm for finding such clusters is the k-means algorithm (MacQueen, 1967). Kmeans searches for an assignment of points to clusters such as to minimise the within-cluster sum of square distances to the center. That is, it seeks to minimise the following Partial Reinitialisation for Optimisers cost function k X X 8600 2 kxj − µi k M1 =524288 k1 =1 M1 =1 k1 =121 8400 affinity propagation i=1 j∈Ci Our benchmark problem is set A3 in a standard clustering data set (clu, 2015). The clusters have points sampled from Gaussian distributions. There are 7500 points around 50 uniformly placed centres. Each full reinitialisation starts with an intial assignment of all centers to random points using Forgy’s method (Forgy, 1965). In a partial reinitialisation only a single cluster center is reinitialised. We found about 100 partial reinitialisations for each global restart to be optimal. Except in the very beginning, a given quality of clusters is obtained significantly quicker with partial rather than full reinitialisation (see Fig. 3). The reason full reinitialisation is here more efficient at finding low quality clusters is because in the regime where the cost is high, larger strides in reducing the cost can be made by just random guessing than optimising a bad global restart further with partial reinitialsiations. However, as the cost threshold becomes harder to reach, partial reinitialisation quickly becomes more efficient. 3.3. Clustering with k-medoids An often more robust approach, called k-medoids, for clustering data is to pick the best cluster center to be one of the points in the cluster rather than the Euclidean center. The standard algorithm for finding such clusters is partitioning around medoids (PAM) (Theodoridis & Koutroumbas, 2006). Similar to the k-means algorithm, PAM iterates between assigning points to their closest center and finding the best center of each cluster until convergence. As the centers are constrainted to the positions of the points and no cluster assignment can occur twice during a run, the trivial upper bound on the number of iterations until  convergence is N for N points and k clusters. Similar to k k-means, however, it typically converges very quickly. WCSS 8200 Starting from a random initialisation of centers, each iteration proceeds in two stages. First all points are assigned to the nearest cluster center. In the second part each center is picked to be the Euclidean center of its cluster. This is repeated until convergence to a local optimum. As the cost is never increased, convergence is guaranteed. It has been shown that there exists problems on which k-means converges in exponentially many iterations in the number of points (Vattani, 2011). The smoothed running time is, however, polynomial (Arthur et al., 2009) and it typically converges very quickly. Similar to the Baum-Welch algorithm, multiple global reinitialisations of centers are often performed to improve the quality of the clusters. 8000 7800 7600 7400 7200 10-2 10-1 100 101 time[s] 102 103 104 Figure 4. The benchmark problem is clustering 900 images of faces from the Olivetti face database (fac, 2015a) into 121 clusters. Affinity propagation (green curve) compared to kmedoids with full (blue curve) and partial (red curve) reinitialisation. The affinity propagation benchmark with coresponding timings was done using the web interface (aff, 2015). The benchmark problem we use here is clustering 900 images of faces from the Olivetti database (fac, 2015a). This dataset has been used previously to benchmark a novel method, called affinity propagation (Frey & Dueck, 2007), for finding k-medoids clusters against PAM. Here we repeat this benchmark, but also compare to PAM with partial reinitialisations. We chose to find 121 clusters as this was roughly the regime where affinity propagation had the largest advantage over k-medoids (Frey & Dueck, 2007). Within each gloal restart, we found that about 0.5 · 106 reinitialisations of only a single randomly chosen cluster center is optimal. We use a pre-computed similarity matrix, available from (fac, 2015b), the entries of which are the pixel-wise squared distances between the images after some pre-processing. Affinity propagation indeed quickly finds much better clusters than PAM with full reinitialisations. However, after some time PAM with partial reinitialisations finds even better clusters which keep improving even further with time (see Fig. 4). Full reinitialisation finds better cluters in the beginning for similar reasons as in k-means. 3.4. Training Bolzmann machines Boltzmann machines are a class of highly generalizable models, related to feed-forward neural networks, that are have proven to be very useful for modeling data sets in many areas including speech and vision (Bengio, 2009; Hinton, 2002; Salakhutdinov & Hinton, 2009). The goal in Boltzmann machine training is not to replicate the prob- -5.15 0.07 -5.2 0.06 -5.25 0.05 -5.3 Relative Error Mean Training Objective Function Partial Reinitialisation for Optimisers -5.35 -5.4 0.04 0.03 -5.45 -5.5 100% 10% 0% -5.55 -5.6 0 200 400 600 800 100% 10% 0.02 1000 10 0 10 1 10 2 10 3 Trial Number Trial Number Figure 5. Training of Restricted Bolzmann Machine (RBM) with λ = 0 (left) absolute values of objective functions and (right) relative difference between mean OML and the “approximate global optima” found by maximizing OML over all experimental runs. ability distribution of some set of training data, but rather to identify patterns in the data set and generalize them to cases that have not yet been observed. The Boltzmann machine takes the following form: Let us define two layers of units, which we call the visible layer and the hidden layer. The visible units comprise the input and output of the Boltzmann machine and the hidden units are latent variables that are marginalized over in order to generate the correlations present in the data. We call the vector of visible units v and the vector of hidden units h. These units are typically taken to be binary and the joint probability of a configuration of visible and hidden units is P (v, h) = exp (−E(v, h)) , Z (3) where Z is a normalization factor known as the partition function and E(v, h) = −v · a − h · b − vT W h, (4) is the energy. Here W is a matrix of weights that models the interaction between pairs of hidden and visible units. a and b are vectors of biases for each of the units. This model can be viewed as an Ising model on a complete bipartite graph that is in thermal equilibrium. This model is commonly known as a Restricted Boltzmann Machine (RBM). Such RBMs can be stacked to form layered Boltzmann machines which are sometimes called deep Boltzmann machines. For simplicity we will focus on training RBMs since training deep Boltzmann machines using popular methods, such as contrastive divergence training, involves optimising the weights and biases for each layered RBM independently. The training process involves optimising the maximum likelihood training objective, OML , which is   λP W2 ij ij , (5) OML = Ev∈xtrain ln[Eh P (v, h)] − 2 where λ is a regularization term introduced to prevent overfitting. The exact computation of the training objective function is #P hard, which means that its computation is expected to be intractable for large RBMs under reasonable complexity theoretic assumptions. Although OML cannot be efficiently computed, its derivatives can be efficiently estimated using a method known as contrastive divergence. The algorithm, described in detail in (Hinton, 2002), uses a Markov chain algorithm that estimates the expectation values of the hidden and visible units which are needed to compute the derivatives of OML . Specifically, ∂OML = hvi hj idata − hvi hj imodel − λWij . ∂Wij (6) Here h·idata denotes an expectation value over the Gibbs distribution of (3) with the visible units clamped to the training data and the h·imodel denotes the unconstrained expectation value. The derivative with respect to the biases is similar. Locally optimal configurations of the weights and biases can then be calculated by stochastic gradient ascent using these approximate gradients. As a benchmark we will examine small synthetic examples of Boltzmann machines where the training objective function can be calculated exactly. Although this differs from the task based estimates of the performance of a Bolzmann machine, we focus on it because the contrastive divergence Partial Reinitialisation for Optimisers training algorithm formally seeks to approximate the gradients of this objective function. As such the value of the training objective function is a more natural metric of comparison for our purposes than classification accuracy for an appropriate data set. The training set consists of four distinct functions: ( 1 j = 1, . . . , bnv /2c [x1 ]j = 0 otherwise [x2 ]j = j mod 2, (7) and their bitwise negations. In order to make the data set more challenging to learn, we add 10% Bernoulli noise to each of the training examples. One hundred training examples were used in each instance with a learning rate of 0.01 and 105 epochs per reinitialization. We take the model to be an RBM consisting of 8 visible units and 10 hidden units. Finally, rather than reinitialising a fixed number of weights at each iteration we update each weight with a fixed probability. This formally differs from previous approaches, but performs similarly to reinitialising a constant fraction. Upon initialisation, each variable is drawn from a zero-mean Gaussian distribution. We see in Figure 5 that partial reinitialization accelerates the process of estimating the global optima for contrastive divergence training. We find that the optimal probability of reinitializing a weight or bias in the BM is roughly 10%. This tends to lead to substantial reductions in the number of reinitializations needed to attain a particular objective function. In particular, for λ = 0 if 10% of the variables are reset at each stage then it only takes 58 resets on average to obtain the same training objective function as the strategy that resets every variable attains with 1000 resets. Furthermore, we see evidence that suggests a possible polynomial advantage of the 10% strategy over the traditional random resetting strategy. Strong regularization is expected to lead to a much simpler landscape for the optimisation since as λ → ∞ the optimisation problem becomes convex. We find that for λ = 0.01 that the difference between the partial and total reinitisation strategies becomes on the order of 0.01%. Although partial reinitialising 10% of the variables continues to be the superior method, these small differences could also arise solely from the stochastic nature of contrastive divergence training and the fact that it takes fewer epoches for the partial reinitialization to approach the local optima. It is evident from these benchmarks that partial reinitialization can substantially reduce the complexity of finding an approximate global optimum for Boltzmann machines. Consequently, we expect that this approach will also work for optimising Boltzmann training for large task– based problems such as MNIST digit classification. Sim- ilarly, these improvements should be able to be leveraged in other forms of neural net training, such as feedforward convolutional neural nets. 4. Conclusion We introduced a general purpose approach, which we termed partial re-initialisation, to significantly improve the performance of an optimiser. We numerically explored comparisons to state of the art algorithms on a range of optimisation problems in machine learning and although we only used the most basic version of our algorithm, with a single additional level in the hierarchy and picking sub-sets of variables at random, the advantage over the standard full reinitialisation is substantial. We expect a hierarchy with multiple levels and with sub-sets picked according to more advanced problem-specific heuristics to lead to even further improvements. Acknowledgments We would like to thank A. Supernova for inspiration and J. Imriska, H. Katzgraber, A. Kosenkov, A. Soluyanov, K. Svore, D. Wecker for fruitful discussions. This paper is based upon work supported in part by ODNI, IARPA via MIT Lincoln Laboratory Air Force Contract No. FA872105-C- 0002. The views and conclusions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies or endorsements, either expressed or implied, of ODNI, IARPA, or the U.S. Government. The U.S. Government is authorized to reproduce and distribute reprints for Governmental purpose notwithstanding any copyright annotation thereon. References Affinity propagation web app. http://www.psi. toronto.edu/affinitypropagation/ webapp/, 2015. Accessed: 2015-08-18. Clustering datasets. http://cs.joensuu.fi/ sipu/datasets/, 2015. Accessed: 2015-05-25. Olivetti face database. http://www.psi.toronto. edu/affinitypropagation/Faces.JPG, 2015a. Accessed: 2015-08-18. Olivetti face database. http://www.psi. toronto.edu/index.php?q=affinity% 20propagation, 2015b. Accessed: 2015-09-11. Arthur, David, Manthey, Bodo, and Röglin, Heiko. kmeans has polynomial smoothed complexity. In Proceedings of the 2009 50th Annual IEEE Symposium on Foundations of Computer Science, FOCS ’09, pp. 405– 414, Washington, DC, USA, 2009. IEEE Computer So- Partial Reinitialisation for Optimisers ciety. ISBN 978-0-7695-3850-1. doi: 10.1109/FOCS. 2009.14. URL http://dx.doi.org/10.1109/ FOCS.2009.14. Bengio, Yoshua. Learning deep architectures for ai. Foundations and trends® in Machine Learning, 2(1):1–127, 2009. Burges, Christopher JC, Svore, Krysta Marie, Bennett, Paul N, Pastusiak, Andrzej, and Wu, Qiang. Learning to rank using an ensemble of lambda-gradient models. In Yahoo! Learning to Rank Challenge, pp. 25–35, 2011. Donmez, Pinar, Svore, Krysta M, and Burges, Christopher JC. On the local optimality of lambdarank. In Proceedings of the 32nd international ACM SIGIR conference on Research and development in information retrieval, pp. 460–467. ACM, 2009. Forgy, E. Cluster analysis of multivariate data: Efficiency versus interpretability of classification. Biometrics, 21 (3):768–769, 1965. Frey, Brendan J. and Dueck, Delbert. Clustering by passing messages between data points. Science, 315: 972–976, 2007. URL www.psi.toronto.edu/ affinitypropagation. Hinton, Geoffrey E. Training products of experts by minimizing contrastive divergence. Neural computation, 14 (8):1771–1800, 2002. LeCun, Yann, Bengio, Yoshua, and Hinton, Geoffrey. Deep learning. Nature, 521(7553):436–444, May 2015. ISSN 0028-0836. URL http://dx.doi.org/10. 1038/nature14539. Insight. Likas, Aristidis, Vlassis, Nikos, and Verbeek, Jakob J. The global k-means clustering algorithm. Pattern recognition, 36(2):451–461, 2003. MacQueen, J. Some methods for classification and analysis of multivariate observations, 1967. URL http://projecteuclid.org/euclid. bsmsp/1200512992. Rabiner, Lawrence R. A tutorial on hidden markov models and selected applications in speech recognition. In PROCEEDINGS OF THE IEEE, pp. 257–286, 1989. Salakhutdinov, Ruslan and Hinton, Geoffrey E. Deep boltzmann machines. In International Conference on Artificial Intelligence and Statistics, pp. 448–455, 2009. Theodoridis, Sergios and Koutroumbas, Konstantinos. Chapter 14 - clustering algorithms iii: Schemes based on function optimization. In Koutroumbas, Sergios TheodoridisKonstantinos (ed.), Pattern Recognition (Third Edition), pp. 589 – 651. Academic Press, San Diego, third edition edition, 2006. ISBN 978-0-12-369531-4. doi: http://dx. doi.org/10.1016/B978-012369531-4/50014-7. URL http://www.sciencedirect.com/science/ article/pii/B9780123695314500147. Vattani, Andrea. k-means requires exponentially many iterations even in the plane. Discrete and Computational Geometry, 45(4):596–616, 2011. ISSN 0179-5376. doi: 10.1007/s00454-011-9340-1. URL http://dx. doi.org/10.1007/s00454-011-9340-1. Zhang, Lintao, Madigan, Conor F, Moskewicz, Matthew H, and Malik, Sharad. Efficient conflict driven learning in a boolean satisfiability solver. In Proceedings of the 2001 IEEE/ACM international conference on Computer-aided design, pp. 279–285. IEEE Press, 2001. Zintchenko, Ilia, Hastings, Matthew B., and Troyer, Matthias. From local to global ground states in ising spin glasses. Phys. Rev. B, 91:024201, Jan 2015. doi: 10.1103/PhysRevB.91.024201. URL http://link.aps.org/doi/10.1103/ PhysRevB.91.024201.
9cs.NE
arXiv:1508.07518v2 [math.AC] 29 Sep 2016 GRADED-IRREDUCIBLE MODULES ARE IRREDUCIBLE JUSTIN CHEN AND YOUNGSU KIM Abstract. We show that if a graded submodule of a Noetherian module cannot be written as a proper intersection of graded submodules, then it cannot be written as a proper intersection of submodules at all. More generally, we show that a natural extension of the index of reducibility to the graded setting coincides with the ordinary index of reducibility. We also investigate the question of uniqueness of the components in a graded-irreducible decomposition, as well as the relation between the index of reducibility of a non-graded ideal and that of its largest graded subideal. Let R be a ring (commutative with 1 6= 0), M an R-module, and N ⊆ M a submodule. Recall that N is said to be irreducible in M if whenever N = N1 ∩ N2 for some R-submodules N1 , N2 of M , then N = N1 or N = N2 . Definition. Let R be a Z-graded ring, M a graded R-module, and N ⊆ M a graded submodule. N is said to be graded-irreducible in M if whenever N = N1 ∩ N2 for some graded R-submodules N1 , N2 of M , then N = N1 or N = N2 . Equivalently, N is graded-irreducible iff whenever N = N1 ∩ . . . ∩ Nr for a finite collection of graded submodules Ni , then N = Ni for some i. It follows directly from the definitions that if N is a graded submodule of M and N is irreducible, then N is graded-irreducible. A natural question to ask is whether or not the converse holds. This is answered by our first result: Theorem 1. Let R be a Z-graded ring, M a Noetherian graded R-module, and N ⊆ M a graded submodule. Then N is irreducible iff N is graded-irreducible. As an analogy, we recall the case of monomial (i.e. Nn -graded) ideals in a polynomial ring. It is a textbook exercise that monomial ideals are irreducible iff they are monomial-irreducible (i.e. cannot be written as a proper intersection of monomial ideals) iff they are generated by pure powers of the variables, cf. [7, Section 1.3.1]. Moreover, decompositions into monomial-irreducible ideals are unique. We note that it is possible for even a monomial ideal to be an intersection of non-graded ideals, e.g. (x2 , xy, y 3 ) = (x2 , xy, x−y 2 )∩(x2 , xy, x+y 2 ) in k[x, y], for k a field, char k 6= 2. However, the monomial case is quickly resolved by the following lemma (cf. [8], Lemma 5.18): If I is a monomial ideal with a minimal generator mm′ where m, m′ are relatively prime monomials, then I = (I + (m)) ∩ (I + (m′ )). In contrast, there is no such formula in the Z-graded case; not to mention that a general graded ring can be far worse behaved than a polynomial ring. 2010 Mathematics Subject Classification. 13A02, 13C05. 1 2 JUSTIN CHEN AND YOUNGSU KIM Before giving the proof of Theorem 1, we introduce a numerical invariant of a graded submodule. If M is Noetherian, every graded submodule of M is a finite intersection of graded-irreducible submodules: If there were a maximal counterexample N , then N would not be graded-irreducible. By definition N would be an intersection of two strictly larger graded submodules, which (by maximality of N ) are finite intersections of graded-irreducibles, and thus N is as well, a contradiction. This motivates the following definition: Definition. Let M be a Noetherian R-module and N ⊆ M a submodule. The index of reducibility of N in M is ) ( r \ Ni . rM (N ) := min r : ∃N1 , . . . , Nr irreducible R-submodules, N = i=1 If R, M, N are graded, the graded index of reducibility of N in M is ( g rM (N ) := min r : ∃N1 , . . . , Nr graded-irreducible R-submodules, N = r \ i=1 Ni ) . If the module M is understood, e.g. if N = I is an R-ideal (so that M = R), then we may simply write r(N ) or r(I). The Noetherian hypothesis on M guarantees that g rM (N ), rM (N ) are both always finite. Moreover, rM (N ) = 1 iff N is irreducible, g and if N is graded, rM (N ) = 1 iff N is graded-irreducible. When M = R is local and N is primary to the maximal ideal, the definition of the index of reducibility above has appeared in the literature (although to the best of our knowledge, the graded index of reducibility has not appeared before), and is well-known to be the vector space dimension of the socle over the residue field of R, see e.g. [6, 10, 4]. If in addition N is graded and R is a local N-graded ring, then it is not hard to show that both indices coincide, cf. Lemma 4. However, in the non-local case, e.g. if R is a polynomial ring, the graded index of reducibility is in general not a vector space dimension over the base field; one must compute ranks over a Laurent polynomial ring instead. From the definitions alone, it is not clear if there is any relation between rM (N ) g and rM (N ) that holds in general. Somewhat surprisingly, they are always equal; a fact which follows from Theorem 1. Indeed, the following three statements are equivalent for a Noetherian graded module M , cf. Theorem 7: (1) Any graded-irreducible submodule is irreducible. g (2) For any graded submodule N , rM (N ) = rM (N ). (3) Any graded submodule is a finite intersection of irreducible graded submodules. The key feature of Statement (3) is the simultaneous requirements of finiteness, irreducibility, and gradedness (notice: finiteness along with either irreducibility or gradedness is easy to satisfy). Although an independent proof of Statement (3), which at first sight may seem to follow directly from the Noetherian hypothesis, would give another proof of Theorem 1, so far we have been unable to find one. Proof of Theorem 1 We begin the proof of Theorem 1 with some reductions, which we use hereafter without further mention. From the definitions, rM (N ) = rM/N (0), and if N is GRADED-IRREDUCIBLE MODULES ARE IRREDUCIBLE 3 g g graded, rM (N ) = rM/N (0). Also, R-submodules of M are the same as R/annR M submodules of M (and if R, M are graded, then R/ annR M is also graded), so henceforth we will pass to the factor ring R/annR M and assume that the ring R is Noetherian. If p is a graded prime ideal of a graded ring R, for any graded Rmodule M we set M(p) := W −1 M , where W is the set of all homogeneous elements of R not in p, so M(p) is a graded R(p) -module. Finally, we refer to Sections 1.5 and 3.6 in [2] for notation and basic results for the graded case. Lemma 2. Let R be a Noetherian ring, p a prime ideal of R, M a finitely generated R-module, and N ⊆ M a submodule. If N is p-primary, then N is irreducible in M iff Np is irreducible in Mp . If in addition R, M, N , and p are graded, then N is graded-irreducible in M iff N(p) is graded-irreducible in M(p) . Proof. We may assume N = 0. Then Ass(M ) = {p}, so R \ p consists of nonzerodivisors on M , and thus the localization map i : M → Mp is injective. If 0 = N1 ∩ N2 for 0 6= N1 , N2 ⊆ M , then (N1 )p ∩ (N2 )p = (N1 ∩ N2 )p = 0 with (N1 )p , (N2 )p 6= 0. Conversely, submodules of Mp are extended from submodules of M , so if 0 = (N1 )p ∩ (N2 )p for 0 6= N1 , N2 ⊆ M , then 0 = i−1 (0) = i−1 ((N1 )p ) ∩ i−1 ((N2 )p ) ⊇ N1 ∩ N2 . In the graded case, the same proof above applies to the homogeneous localization M ֒→ M(p) .  Remark 3. Despite the elementary nature of the proof of Lemma 2, the conditions are quite delicate: In general, irreducibility is not preserved under faithfully flat ring extensions or localizations. For an example where irreducibility in the source does not extend to the target, take k ֒→ k × k for a field k or the completion k[x, y](x,y) /(y 2 − x3 − x2 ) ֒→ k[[x, y]]/(y 2 − x3 − x2 ). On the other hand, if R is a domain and p, q ∈ Spec(R) with I := p ∩ q 6= p, q, then rR (I) = 2 and R ֒→ Rp is flat and injective, but rRp (Ip ) = 1 = rRq (Iq ). g (N )) in the Artinian case in terms We next give a formula for rM (N ) (resp. rM of socle rank (resp. graded socle rank). We provide a proof for the graded case; the proof holds verbatim in the local case, after removing all appearances of the word “graded”. Lemma 4. Let R be a Noetherian ring, M a finitely generated R-module, and N ⊆ M a submodule. (1) If (R, m, k) is local and M/N is Artinian, then rM (N ) = dimk (0 :M/N m).1 g (2) If (R, m, k) is ∗local and M/N is ∗Artinian, then rM (N ) = rankk (0 :M/N m). Proof. (2): Notice that k = R/m is a graded field, so graded k-modules are free, i.e. are direct sums of twists of k. Replacing M with M/N , we may assume N = 0. Set g rM (0) = r, so 0 = N1 ∩ . . . ∩ Nr with Ni graded-irreducible, and this decomposition is irredundant, i.e. ∩j6=i Nj 6⊆ Ni for each i. Now for any graded module M , 0 is graded-irreducible in M iff ∗E R (M ) is indecomposable iff ∗E R (M ) = ∗E R (L) for every graded submodule 0 6= L ⊆ M . Thus the decomposition 0 = N1 ∩ . . . ∩ Nr implies ∗E(M ) ∼ = ∗E(M/N1 ) ⊕ . . . ⊕ ∗ ∗ E(M/Nr ). Also, HomR (k, M ) = HomR (k, E(M )) for any graded module M . ∗ 1For the case where N is a parameter ideal in a local ring, see [6, Satz 3]. 4 JUSTIN CHEN AND YOUNGSU KIM Since M is ∗Artinian, AssR (M ) = {m}. The structure theorem of ∗ injectives implies ∗E(M/Ni ) ∼ = ∗E(R/m) for each i (as ∗E(M/Ni ) is ∗ indecomposable), so ∗ ∗ r ∼ E(M ) = ( E(k)) . Then one has rankk (0 :M m) = rankk HomR (k, M ) = rankk HomR (k, ∗E(M )) = rankk HomR (k, (∗E(k))r ) = r · rankk HomR (k, ∗E(k)) = r · rankk HomR (k, k) = r, as HomR (k, k) ∼ = 0 :k m = k.  Remark 5. Let (R, m, k) be a Noetherian local ring. The type of a finitely generated R-module M is defined as M type(M ) := dimk Extdepth (k, M ). R Since HomR (k, M ) ∼ = 0 :M m, Lemma 4(1) implies that if M is Artinian, then rM (0) = type(M ). Recall that a local ring R is Gorenstein iff R is Cohen-Macaulay of type 1. Remark 6. Together, lemmas 2 and 4 yield the following irreducibility criterion: if I is an ideal in a Noetherian ring R, then I is irreducible iff I is primary and generically Gorenstein (recall that an ideal I is generically Gorenstein if (R/I)p is Gorenstein for all p ∈ Ass(R/I)). Lemmas 2 and 4, along with one last trick, yield the theorems mentioned above: Theorem 1. Let R be a Z-graded ring, M a Noetherian graded R-module, and N ⊆ M a graded submodule. Then N is irreducible iff N is graded-irreducible. Proof. The only if direction is clear. Suppose that N is graded-irreducible. Replacing M with M/N , we may assume that N = 0. Take a graded primary decomposition 0 = Q1 ∩ . . . ∩ Qt with Qi graded and primary, cf. [3, Prop. 3.12]. By hypothesis 0 = Qi for some i, i.e. 0 is primary, so AssR (M ) = {p} for some graded prime ideal p. g By Lemma 2, 0 is graded-irreducible in M(p) , i.e. rM (0) = 1. As M(p) (p) ∗ ∗ is Artinian over the local ring R(p) , Lemma 4(2) implies that 0 :M(p) pR(p) ∼ = (R(p) /pR(p) )(n), for some twist n ∈ Z. Localizing at p yields 0 :Mp pRp ∼ = Rp /pRp ,  so by Lemma 4(1), rMp (0) = 1. By Lemma 2, 0 is irreducible in M . We next show the equivalence mentioned in the introduction: Theorem 7. Let R be a Z-graded ring and M a Noetherian graded R-module. The following statements are equivalent: (1) Every graded-irreducible submodule N ⊆ M is irreducible. g (2) For every graded submodule N ⊆ M , rM (N ) = rM (N ). (3) Every graded submodule N ⊆ M is a finite intersection of irreducible graded submodules. Proof. (1) =⇒ (2): Take a decomposition of N into graded-irreducible modules, of g length rM (N ). By (1), this is an irredundant irreducible decomposition of N and by [1, Exercise II.§2.17], every such decomposition has length rM (N ). GRADED-IRREDUCIBLE MODULES ARE IRREDUCIBLE 5 g (2) =⇒ (1): If N is graded, then N is irreducible iff rM (N ) = 1 iff rM (N ) = 1 iff N is graded-irreducible. (1) =⇒ (3): Let N ⊆ M be a graded submodule. Write N = N1 ∩ . . . ∩ Nr , where Ni are graded-irreducible. By assumption, each Ni is irreducible. (3) =⇒ (1): Let N be graded-irreducible, and take a decomposition N = N1 ∩ . . . ∩ Nr where each Ni is irreducible and graded. Since N is graded-irreducible, N = Ni for some i, so N is irreducible.  Examples Example 8. Let R be a Noetherian ring and I a radical ideal. Then rR (I) = | Min(I)| = | Ass(I)|, the number of minimal (equivalently associated) primes of I. This can fail if I only satisfies Serre’s condition S1 but not R0 , as the following example shows. Example 9. Let k be a field, char k 6= 2, R := k[x, y], and set I := (x2 + xy, x2 − y 2 , y 3 ), J1 := I + (x2 − x − y) = (x2 − x − y, xy + x + y), and J2 := I + (x2 + x + y) = (x2 + x + y, xy − x − y). The ideals J1 and J2 are (x, y)-primary and generated by regular sequences; hence they are irreducible by Remark 6 since R/J1 , R/J2 are Gorenstein. Thus I = J1 ∩ J2 is an irredundant irreducible decomposition of I (note that I is graded, g but J1 and J2 are not graded), so rR (I) = 2. By Theorem 7(2), rR (I) = 2 as well: 3 2 indeed, I = (x + y, y ) ∩ (x , y) is an irredundant graded-irreducible decomposition of I. In analogy with the monomial case, it is interesting to ask to what extent these graded-irreducible ideals are unique; this is addressed in Remark 10. To see that J1 ∩ J2 = I, observe that R/I is an Artinian local ring with socle soc(R/I) = (x + y, x2 ). Finally, if (R, m) is any local ring and a ∈ 0 :R m, b ∈ R with (a) 6⊆ (b), then (a) ∩ (b) = 0: if 0 6= ar ∈ (b) for some r ∈ R, then r 6∈ m implies a ∈ (b). In particular, if 0 6= a, b ∈ 0 :R m, then (a) ∩ (b) 6= 0 iff (a) = (b). The ideal I in Example 9 has some interesting properties, which we summarize in the following remark: Remark 10. (1) R and I are minimal in the following ways: (a) R/I has minimal length among all graded k-algebras of finite length that are not monomial. (b) dim R and µ(I) are minimal among all polynomial rings S and graded primary S-ideals J such that J is reducible and is not contained in a principal ideal. (2) The component (x+y, y 3 ) in an irredundant decomposition of I into gradedirreducibles is unique. Furthermore, the other component must be of the form (x − by, y 2 ) or (y, x2 ), where b ∈ k \ {-1}, and any one of these along with (x + y, y 3 ) forms an irredundant decomposition of I. 6 JUSTIN CHEN AND YOUNGSU KIM Proof. (1): For (a): Let A be a graded k-algebra of finite length. If the length of A is 1 or 2, then A is isomorphic to k or k[x]/(x2 ), respectively. If the length of A is 3, then A is isomorphic to either k[x, y]/(x2 , xy, y 2 ) or k[x]/(x3 ), both of which are monomial k-algebras. For (b): If dim S = 1, then every graded S-ideal is irreducible. On the other hand, if µ(J) ≤ 2, then J is either a complete intersection (hence irreducible by Remark 6) or contained in a principal ideal. (2): Let K1 , K2 be graded-irreducible ideals such that I = K1 ∩ K2 (recall that rg (I) = 2). We first show that for i = 1, 2, each Ki contains a form of degree 1. Suppose not. Then since x2 + xy, x2 − y 2 have the least degrees among a minimal generating set for I, Ki must contain both of them. Observe that Ki is a complete intersection ideal. Therefore, Ki = (x2 + xy, x2 − y 2 ) 6⊃ I, a contradiction. Next, we show that without loss of generality K1 = (x + y, y 3 ) and K2 can be generated by forms of degree 1 and 2. Write m = (x, y)R. Certainly, Ki cannot be generated by forms of degree 1 only: if so, then since Ki is graded, Ki would equal m. Suppose both Ki were generated by forms of degree 1 and 2. Then dimk [Ki ]2 = 3 (where [−]j denotes the j th graded piece) would imply m2 ⊆ Ki , but m2 6⊆ I, a contradiction. Thus without loss of generality K1 is generated in degree 1 and 3, say K1 = (l, g), where l is a linear form and g is a form of degree 3. Since y 3 ∈ K1 , there exist forms a, b such that y 3 = al + bg. Then b ∈ k, and in fact b 6= 0 (else l = y ∈ K1 and then K1 = (y, x2 ), a contradiction), hence l, y 3 also generate K1 . In order for K1 to contain I, l must divide both x2 + xy and x2 − y 2 ; hence l = x + y is the greatest common divisor of x2 +xy, x2 −y 2 . Therefore, one has K1 = (x+y, y 3 ). Now, we show that K2 can be generated by forms of degree 1 and 2. Since x + y is in K1 , x + y ∈ / K2 . Suppose y ∈ K2 . Then x2 − y 2 ∈ I ⊆ K2 implies x2 ∈ K2 , so we conclude that K2 = (y, x2 ) if y ∈ K2 . Let x − by, where b ∈ k \ {-1} be a linear form in K2 . Then I ⊆ K2 is equivalent to (b2 + b)y 2 , (b2 − 1)y 2 , y 3 ∈ K2 . Since b 6= −1, we conclude that K2 = (x − by, y 2 ), where b 6= −1. This proves the first part of the second statement in (2). It remains to show that L1 ∩ L2 = I, where L1 = (x + y, y 3 ) and L2 is either (y, x2 ) or (x − by, y 2 ), b ∈ k \ {−1}. The reasoning above shows that I ⊆ L1 ∩ L2 , so it suffices to show that the Hilbert functions agree. This follows since m3 ⊆ I, m2 6⊆ L1 ∩ L2 , [I]2 is a maximal (proper) subspace of m2 , and L1 ∩ L2 contains no forms of degree ≤ 1.  Relationship between r(I) and r(I ∗ ) Thus far, we have started with a graded object, and seen that graded and ungraded notions of irreducibility agree on graded objects. We end by briefly discussing a different setting, namely starting with a non-graded object, and passing to its closest graded approximation. For any submodule N of a graded module M , let N ∗ denote the submodule of N generated by all graded elements in N . Now let p be a non-graded prime ideal in a Noetherian graded ring R. Then the ideals p and p∗ , although distinct, often differ only slightly (if at all) under various properties and invariants. For example, GRADED-IRREDUCIBLE MODULES ARE IRREDUCIBLE 7 height p = height p∗ + 1, Rp is Cohen-Macaulay (resp. Gorenstein) iff Rp∗ is, and for a finitely generated graded R-module M , type(Mp ) = type(Mp∗ ). In this vein, it is natural to ask how r(I) compares to r(I ∗ ), for a non-graded ideal I. We answer this in the following special case: Proposition 11. Let R be a Noetherian graded ring, p a non-graded prime ideal of R, and I a non-graded p-primary R-ideal. If I/I ∗ is principal, then r(I) = r(I ∗ ). In particular, I is irreducible iff I ∗ is irreducible. Lemma 12. Let R be an ∗Artinian ∗local ring. Then for any maximal ideal m of R, rR (0) = type(Rm ). Proof. Let q be the unique homogeneous prime ideal of R, and let m be a maximal ideal of R. If q = m, then R is Artinian local, and the result follows from Remark 5. Otherwise, q = m∗ 6= m is the largest graded subideal of m, so type(Rm ) = type(Rq ) = rRq (0) = rR (0), where the equalities follow from [2, Theorem 1.5.9], Remark 5, and the proof of Lemma 2, respectively (notice that Rq is an Artinian local ring).  Proof of 11. First, notice that since I is p-primary, I ∗ is p∗ -primary. The hypothesis and the numbers r(I), r(I ∗ ) do not change upon going modulo I ∗ and homogeneously localizing at p∗ . Hence we may assume that R is ∗Artinian ∗ local with unique maximal homogeneous ideal p∗ , p 6= p∗ is a maximal ideal, and I ∗ = 0. Since Ass(R) = {p∗ } and I 6⊆ p∗ , I is a principal ideal generated by a nonzerodivisor, say f . Then rR (I) = rR (f ) = rR/(f ) (0) = type(R/(f )) is the type of the Artinian local ring R/(f ), and by Lemma 12, rR (I ∗ ) = rR (0) = type(Rp ). If k(p) := Rp /pRp , then from the isomorphism (cf. [2, Lemma 1.2.4]) Ext1 (k(p), Rp ) ∼ = HomR (k(p), Rp /(f )) Rp p we conclude that r(I ∗ ) = type(Rp ) = dimk(p) Ext1Rp (k(p), Rp ) = dimk(p) HomRp (k(p), Rp /(f )) = type(R/I) = r(I).  The hypothesis that p is non-graded in 11 is necessary (notice that p not graded implies I is not graded, but not conversely). The following examples were computed with the help of Macaulay2 [5]. Example 13. Let R = k[x, y, z], where k is a field and deg x = deg y = deg z = 1. (1) For ideals I ∗ = (x3 − y 3 , y√3 − z 3√ , xy, xz, yz) and I = I ∗ + (x2 − y 3 ), we have ∗ r(I) = 3, r(I ) = 1, and I = I ∗ = (x, y, z). 5 (2) For ideals I ∗ = (z 3 , y 3 , x√3 y 2 , x√ y, x7 ), and I = I ∗ + (x3 + xy), we have r(I) = 1, r(I ∗ ) = 3, and I = I ∗ = (x, y, z). The next example demonstrates that I/I ∗ being principal is stronger than the condition that I can be generated by µ(I ∗ ) + 1 elements. Example 14. Let R = k[x, y, t, t−1 ], where k is a field, deg x = 0, and deg y = deg t = 1. Let I = (x − y, t − 1, x2 ). Then I ∗ = (x2 , y 2 ) and r(I) = r(I ∗ ) = 1. However, the ideal I/I ∗ in R/I ∗ requires at least two generators, for instance, x − y, t − 1. Observe that the homogeneous minimal generating set x2 , y 2 of I ∗ does not lift to part of a minimal generating set of I, as x − y is in every minimal generating set of I. 8 JUSTIN CHEN AND YOUNGSU KIM However, even the more general condition that I can be generated by µ(I ∗ ) + 1 elements is not necessary for the conclusion of 11 to hold, even in the simplest case when I is prime (so that r(I) = r(I ∗ ) = 1): Example 15 (Moh’s primes [9]). Let k be a field, char k = 0. Fix n ∈ N odd, m := (n + 1)/2, l > n(n + 1)m with (l, m) = 1, and consider the ring map ϕn : k[x, y, z] → k[t] x 7→ tnm + tnm+l , y 7→ t(n+1)m , z 7→ t(n+2)m Then Pn := ker ϕn is a height 2 non-graded prime ideal in R := k[x, y, z], so Pn∗ is a height 1 graded prime ideal in the UFD R, hence is principal. However, Moh has shown that Pn requires at least n generators. Thus, conditions on numbers of generators of I or I ∗ are unlikely to be necessary for r(I) = r(I ∗ ). In view of these examples, we pose the following question: Question. Let R be a Noetherian graded ring, p a non-graded prime ideal of R, and I a non-graded p-primary R-ideal. What are necessary conditions for r(I) = r(I ∗ )? Acknowledgements: This project started when the authors met at the AMS sectional meeting in San Francisco State University in October 2014 after independently reading a question on math.stackexchange.com, which is answered positively in Theorem 1. We thank Professor David Eisenbud and Professor Bernd Ulrich for their advice and encouragement and Professor William Heinzer for reading an early draft. We also thank the referee for helpful comments. References [1] N. Bourbaki. Éléments de mathématique. Algèbre. Chapitres 1 à 3. Hermann, Paris, 1970. [2] Winfried Bruns and Jürgen Herzog. Cohen-Macaulay rings, volume 39 of Cambridge Studies in Advanced Mathematics. Cambridge University Press, Cambridge, 1993. [3] David Eisenbud. Commutative algebra, volume 150 of Graduate Texts in Mathematics. Springer-Verlag, New York, 1995. With a view toward algebraic geometry. [4] Shiro Goto and Naoyoshi Suzuki. Index of reducibility of parameter ideals in a local ring. J. Algebra, 87(1):53–88, 1984. [5] Daniel R. Grayson and Michael E. Stillman. Macaulay2, a software system for research in algebraic geometry. Available at http://www.math.uiuc.edu/Macaulay2/. [6] Wolfgang Gröbner. Über irreduzible Ideale in kommutativen Ringen. Math. Ann., 110(1):197– 222, 1935. [7] Jürgen Herzog and Takayuki Hibi. Monomial ideals, volume 260 of Graduate Texts in Mathematics. Springer-Verlag London, Ltd., London, 2011. [8] Ezra Miller and Bernd Sturmfels. Combinatorial commutative algebra, volume 227 of Graduate Texts in Mathematics. Springer-Verlag, New York, 2005. [9] T. T. Moh. On the unboundedness of generators of prime ideals in power series rings of three variables. J. Math. Soc. Japan, 26:722–734, 1974. [10] D. G. Northcott. On irreducible ideals in local rings. J. London Math. Soc., 32:82–88, 1957. Department of Mathematics, University of California, Berkeley, California, 94720 U.S.A E-mail address: [email protected] Department of Mathematics, University of California, Riverside, California, 92521 U.S.A E-mail address: [email protected]
0math.AC
ON COMMENSURABILITY OF RIGHT-ANGLED ARTIN GROUPS I: RAAGS DEFINED BY TREES OF DIAMETER 4 arXiv:1611.01741v2 [math.GR] 28 Mar 2018 MONTSERRAT CASALS-RUIZ, ILYA KAZACHKOV, AND ALEXANDER ZAKHAROV Abstract. In this paper we study the classification of right-angled Artin groups up to commensurability. We characterise the commensurability classes of RAAGs defined by trees of diameter 4. In particular, we prove a conjecture of Behrstock and Neumann that there are infinitely many commensurability classes. Hence, we give first examples of RAAGs that are quasi-isometric but not commensurable. 1. Introduction 1.1. Context. One of the basic problems on locally compact topological groups is to classify their lattices up to commensurability. Recall that two lattices Γ1 , Γ2 < G are commensurable if and only if there exists g ∈ G such that Γ1 ∩ Γg2 has finite index in both Γ1 and Γg2 . In particular, commensurable lattices have covolumes that are commensurable real numbers, that is, they have a rational ratio. The notion of commensurability was generalized to better suit topological and large-scale geometric properties and to compare groups without requiring them to be subgroups of a common group. More precisely, we say that two groups H and K are (abstractly) commensurable if they have isomorphic finite index subgroups. In this article, we will only be concerned with the notion of abstract commensurability and we simply refer to it as commensurability. As we mentioned, commensurability is closely related to the large-scale geometry of the group. Indeed, any finitely generated group can be endowed with a natural word-metric which is welldefined up to quasi-isometry and since any finitely generated group is quasi-isometric to any of its finite index subgroups, it follows that commensurable groups are quasi-isometric. Gromov suggested to study groups from this geometric point of view and understand the relation between these two concepts. More precisely, a basic problem in geometric group theory is to classify commensurability and quasi-isometry classes (perhaps within a certain class) of finitely generated groups and to understand whether or not these classes coincide. Key words and phrases. right-angled Artin groups, commensurability, quasi-isometries. This work was supported by the ERC Grant 336983, by the Basque Government grant IT974-16 and by the grant MTM2014-53810-C2-2-P of the Ministerio de Economia y Competitividad of Spain. The first author was supported by Juan de la Cierva programme of the Spanish Government. The third author was supported by the Russian Foundation for Basic Research (project no. 15-01-05823), and by CMUP (UID/MAT/00144/2013), which is funded by FCT (Portugal) with national (MEC) and European structural funds (FEDER), under the partnership agreement PT2020. 1 2 M. CASALS-RUIZ, I. KAZACHKOV, AND A. ZAKHAROV The classification of groups up to commensurability (both in the abstract and classical case) has a long history and a number of famous solutions for very diverse classes of groups such as Lie groups, hyperbolic 3-manifold groups, pro-finite groups, Grigorchuk-Gupta-Sidki groups, etc, see for instance [BJN09, DW93, Mar73, Sch95, Si43, GrW03, Ga16]. In this paper, we focus on the question of classification of right-angled Artin groups, RAAGs for short, up to commensurability. Recall that a RAAG is a finitely presented group G(Γ) which can be described by a finite simplicial graph Γ, the commutation graph, in the following way: the vertices of Γ are in bijective correspondence with the generators of G(Γ) and the set of defining relations of G(Γ) consists of commutation relations, one for each pair of generators connected by an edge in Γ. RAAGs have become central in group theory, their study interweaves geometric group theory with other areas of mathematics. This class interpolates between two of the most classical families of groups, free and free abelian groups, and its study provides uniform approaches and proofs, as well as rich generalisations of the results for free and free abelian groups. The study of this class from different perspectives has contributed to the development of new, rich theories such as the theory of CAT(0) cube complexes and has been an essential ingredient in Agol’s solution to the Virtually Fibered Conjecture. The commensurability classification of RAAGs has been previously solved for the following classes of RAAGs: • Free groups [St68, Sch95, KPS73], [Gr93, 1.C]; • Free Abelian groups, [Gr81, B72]; • Fm × Zn , [Wh10]; • Free products of free groups and free Abelian groups, [BJN09]; • Fm × Fn with m, n ≥ 2, [Wi96, BM00]; • G(Γ), where Γ is a tree of diameter ≤ 3, [BN08]; • G(Γ), where Γ is connected, triangle- and square-free graph without any degree one vertices, [KK14] • G(Γ), when the outer automorphism of G is finite, Γ is star-rigid and does not have induced 4-cycles, [H16]. It turns out that, inside the class of RAAGs, the classification up to commensurability coincides with the quasi-isometric classification for all known cases. These rigidity results are mainly a consequence of the rigid structure of the intersection pattern of flats in the universal cover of the Salvetti complex. In this paper we describe the commensurability classes of RAAGs defined by trees of diameter at most 4 and describe the “minimal” group in each commensurability class (minimal in terms of number of generators or the rank of its abelianization). In particular, we show that there exist infinitely many different commensurability classes confirming a conjecture of Behrstock and Neumann. In their paper [BN08], the authors show that RAAGs defined by trees of diameter at least 3 are quasi-isometric, so we provide first examples of RAAGs that are quasi-isometric but not commensurable. As in the classical case of lattices in locally compact topological groups, we define an ordered set that plays the role of the covolume and prove that the groups are commensurable if COMMENSURABILITY OF RAAGS 3 and only if the sets are commensurable, that is they have the same cardinality and constant rational ordered ratios. 1.2. Main results. Let ∆ = (V (∆), E(∆)) be a simplicial graph, then we denote by G(∆) the RAAG defined by the commutation graph ∆. We call the vertices of the graph ∆ the canonical generators of G(∆). For our purposes, it will be convenient to encode finite trees of diameter four as follows. Let T be any finite tree of diameter four. Let f be a path (without backtracking) of length four from one leaf of T to another. By definition f contains 5 vertices and let cf ∈ V (T ) be the middle vertex in f . It is immediate to see that the choice of the vertex c = cf does not depend on the choice of the path f of length four. We call c the center of T . Any leaf of T connected to c by an edge is called a hair vertex. Vertices connected to c by an edge which are not hair are called pivots. Any finite tree T of diameter 4 is uniquely defined by the number q of hair vertices and by the number ki of pivots of a given degree di + 1. Hence we encode any finite tree of diameter 4 as T ((d1 , k1 ), . . . , (dl , kl ); q). Here all di and ki and l are positive integers, d1 < d2 < . . . < dl , and q is a non-negative integer; moreover, either l ≥ 2 or l = 1 and k1 ≥ 2, so that T indeed has diameter 4. See Figure 1. ... ... ... ... ... ... ... ... ... ... ... Figure 1. Tree of diameter 4 Given a tree of diameter four T = T ((d1 , k1 ), . . . , (dl , kl ); q), we denote by M (T ) = M (T ((d1 , k1 ), . . . , (dl , kl ); q)) the set of numbers di , that is, we have that M (T ((d1 , k1 ), . . . , (dl , kl ); q)) = {d1 < d2 < · · · < dl }. In the original usage two real numbers a, b ∈ R are commensurable if and only if the ratio ab is rational. In this fashion, we will say that two ordered sets P = {p1 < · · · < pk } and Q = {q1 < · · · < ql } are commensurable if • they have the same cardinality, i.e. k = l, • there exists c ∈ Q such that each quotient pi qi = c. 4 M. CASALS-RUIZ, I. KAZACHKOV, AND A. ZAKHAROV In this case we write P = cQ. We say that a set M = {m1 , . . . , mk }, mi ∈ N, is minimal if the greatest common divisor d = gcd(m1 , . . . , mk ) is 1. It is clear that for each commensurability class of a set M ⊂ Nk , there exists a minimal set that belongs to the class, namely { md1 , . . . , mdk }. We show that the commensurability class of the set M (T ((d1 , k1 ), . . . , (dl , kl ); q)) determines the commensurability class of the RAAG defined by the tree of diameter 4. Theorem 4.5 (Characterisation of commensurability classes). Let T and T 0 be two finite trees of diameter 4, T = T ((d1 , k1 ), . . . , (dl , kl ); q) and T 0 = T ((d01 , k10 ), . . . , (d0l0 , kl00 ); q 0 ). Let G = G(T ) and G0 = G(T 0 ). Consider the sets M = M (T ), M 0 = M (T 0 ). Then G and G0 are commensurable if and only if M and M 0 are commensurable. For n > 1 denote by Pn the path with n vertices and n − 1 edges. By a minimal RAAG in some class C we mean a RAAG in C with the minimal number of generators, i.e., defined by a graph with the minimal number of vertices among all commutation graphs of RAAGs in C. Theorem 4.7. Let T = T ((d1 , k1 ), . . . , (dl , kl ); q) be a finite tree of diameter 4. Let C(T ) be the commensurability class of G(T ) and let M = M (T ) be as above, so |M | = l. Then the minimal RAAG that belongs to C(T ) is either the RAAG defined by the tree T 0 = T ((d01 , 1), . . . , (d0l , 1); 0), where M (T 0 ) is minimal in the commensurability class of M , if |M | > 1, or the RAAG defined by the path of diameter 3, that is G(P4 ), if |M | = 1. Our results extend naturally to the commensurability classification of some right-angled Coxeter groups. Recall that every RAAG G embeds naturally as a finite index subgroup into a right-angled Coxeter group, say C(G), see [DJ00]. Hence, we have the following result Corollary. There are infinitely many pair-wise quasi-isometric, but pair-wise not commensurable right-angled Coxeter groups defined by graphs of diameter 4 with cliques of dimension 2. 1.3. Strategy of the proof. As we discussed, in previous results on commensurability of RAAGs the structure of the intersection pattern of flats inside the universal cover of the Salvetti complex is so rigid that the large-scale geometry that it determines forces commensurability, see [KK14, H16]. In our case, all trees of diameter 4 are quasi-isometric and so geometry is not sufficient to determine the commensurability classes. However, we will use the structure of the intersection pattern of flats together with algebra to derive the result. In broad strokes, the strategy is as follows. To two given RAAGs G(T ) and G(T 0 ) defined by trees of diameter 4, we associate a linear system of equations S(T, T 0 ) and show that, if G(T ) and G(T 0 ) are commensurable, then the system S(T, T 0 ) has positive integer solutions, see Section 3.3. We then study the system S(T, T 0 ) and determine conditions on the trees T and T 0 for which the system does not have positive integer solutions. This allows us to conclude, that the corresponding RAAGs are not commensurable, see Sections 3.4 and 3.5. In order to obtain a characterisation, we prove that if the conditions are not satisfied (and so the system S(T, T 0 ) has positive integer solutions), then we can exhibit isomorphic finite index subgroups H < G(T ) and H 0 < G(T 0 ) and conclude that G(T ) and G(T 0 ) are commensurable, see Section 4. We believe that the general strategy of our proof, i.e. to reduce the existence of subgroups to a linear system of equations with positive integer solutions, can be used to study commensurability COMMENSURABILITY OF RAAGS 5 classes of RAAGs defined by trees and more general RAAGs. The real obstacle is to elucidate the necessary conditions for the system of equations to have positive integer solutions – “just” a linear algebra problem. 2. Basics on RAAGs In this section we recall some preliminary results on RAAGs and introduce the notation we use throughout the text. Let Γ = (V (Γ), E(Γ)) be a finite simplicial graph (i.e., a graph without loops and multiple edges) with vertex set V (Γ) and edge set E(Γ). Then, the right-angled Artin group (or RAAG for short) G = G(Γ) defined by the (commutation) graph Γ is the group given by the following presentation: G = hV (Γ) | [v1 , v2 ] = 1, whenever (v1 , v2 ) ∈ E(Γ)i. The elements of V (Γ) are called the canonical generators of G. Let Γ0 = (V (Γ0 ), E(Γ0 )) be a full subgraph of Γ. It is not hard to show, see for instance [EKR05], that the RAAG G0 = G(Γ0 ) is the subgroup of G generated by V (Γ0 ), i.e. G(Γ0 ) = hV (Γ0 )i. Let X = V (Γ), and u be a word in the alphabet X ∪ X −1 . Denote by [u] the element of G corresponding to u, we also say that the word u represents [u] ∈ G. We denote the length of a word u by |u|. A word u is called geodesic if it has minimal length among all the words representing the same element [u] of G. In RAAGs, any word can be transformed to a geodesic (representing the same element of G) by applying only free cancellations and permutations of letters allowed by the commutativity relations of G. Moreover, any two geodesic words representing the same element of G can be transformed to each other by applying only the commutativity relations of G. See [EKR05] for details. Let w ∈ G, and u be any geodesic word representing w. Then the length of w is defined to be the length of u, |w| = |u|. An element w ∈ G is called cyclically reduced if |w2 | = 2|w|, or, equivalently, the length of w is minimal in the conjugacy class of w. Every element is conjugate to a cyclically reduced one. We say that a letter x of X occurs in a word u if at least one of the letters in u is either x or x−1 . For a given element w ∈ G, denote by alph(w) the set of letters of X occurring in u, where u is any geodesic word representing w (this does not depend on the choice of u, due to the above remarks). Also define A(w) to be the subgroup of G generated by all the letters in X that do not occur in a geodesic word u (which represents w) and commute with w. Again, the subgroup A(w) is well-defined (independent of the choice of u), due to the above remarks. Note also that a letter x commutes with w if and only if x commutes with every letter in alph(w), see [EKR05]. In this paper we always conjugate as follows: g h = hgh−1 . For a RAAG G(Γ) we define its non-commutation graph ∆ = (V (∆), E(∆)) as follows: V (∆) = V (Γ) and E(∆) = (V (Γ) × V (Γ)) \ E(Γ), i.e., ∆ is the complement graph of Γ. The graph ∆ is a union of its connected components I1 , . . . , Ik , which induce a decomposition of G as the direct product G = G(I1 ) × · · · × G(Ik ). 6 M. CASALS-RUIZ, I. KAZACHKOV, AND A. ZAKHAROV Given a cyclically reduced w ∈ G and the set alph(w), consider the graph ∆(alph(w)), which is the full subgraph of ∆ with the vertex set consisting of letters in alph(w). If the graph is connected, we call w a block. If ∆(alph(w)) is not connected, then we can decompose w into the product (1) w = wj1 · wj2 · · · wjt ; j1 , . . . , jt ∈ J, where |J| is the number of connected components of ∆(alph(w)) and the word wji is a word in the letters from the ji -th connected component. Clearly, the words {wj1 , . . . , wjt } pairwise commute. Each word wji , i ∈ 1, . . . , t, is a block and so we refer to expression (1) as the block decomposition of w. An element w ∈ G is called a least root (or simply, root) of v ∈ G if there exists a positive integer m0 m 1 ≤ m ∈ N such that v = w√ and there does not exist w0 ∈ G and 1 < m0 ∈ N such that w = w0 . In this case, we write w = v. By a result from [DK93], RAAGs have least roots, that is the root element of v is defined uniquely for every v ∈ G. The next result describes centralisers of elements in RAAGs. Since centralizers of conjugate elements are conjugate subgroups, it suffices to describe centralizers of cyclically reduced elements. Theorem 2.1 (Centraliser Theorem, Theorem 3.10, [Ser89] and [DK93]). Let w ∈ G be cyclically reduced and w = v1 . . . vk be its block decomposition. Then, the centraliser of w is the following subgroup of G: √ √ C(w) = h v1 i × · · · × h vk i × A(w). The following two corollaries follow immediately from Theorem 2.1 and the definitions. √ Corollary 2.2. For any w ∈ G we have C(w) = C( w). Corollary 2.3. For any vertex v of Γ the centralizer of v in G(Γ) is generated by all the vertices in the star of v in Γ, i.e., by all the vertices adjacent to v and v itself. In particular, if Γ is a tree, then the centralizer of any vertex in Γ is isomorphic to Z × Fn , where n is the degree of v, so it is isomorphic to Z2 if v is a leaf, and contains a non-abelian free group otherwise. The following corollary will play a key role in this paper. Corollary 2.4. Let Γ be a tree and let w ∈ G(Γ). Then C(w) is non-abelian if and only if w is conjugate to a power of a non-leaf vertex generator of G(Γ), and in this case C(w) ' Z × F = √ h wi × F , where F is a non-abelian free group. Proof. One implication follows immediately from Corollaries 2.2 and 2.3. For the other implication, suppose that w has non-abelian centralizer, and let w = w0g , where w0 is cyclically reduced. Since C(w0 ) is non-abelian, it follows from Theorem 2.1 that A(w0 ) is not cyclic, and since Γ is a tree this implies that w0 is a power of some non-leaf generator, by definition of A(w0 ).  Corollary 2.5. Centralizers of elements in RAAGs are RAAGs themselves. Proof. Follows immediately from Theorem 2.1 and the fact that A(w) is a RAAG by definition.  Note that in general RAAGs contain lots of subgroups which are not RAAGs themselves, even of finite index. COMMENSURABILITY OF RAAGS 7 3. Necessary conditions for commensurability 3.1. (Reduced) Extension graph and centraliser splitting. In this section we recall the notions of the (reduced) extension graph and the (reduced) centraliser splitting. In the particular case when the underlying graph ∆ is a tree, so is the (reduced) extension graph, see [KK13]. The goal of this section is to show that there exists an equivariant isomorphism between the (reduced) extension graph and the Bass-Serre tree of the (reduced) centraliser splitting of G(∆). Definition 3.1 (Extension graph, see [KK13]). Let G(∆) be a RAAG with underlying commutation graph ∆, then the extension graph ∆e is defined as follows. The vertex set of ∆e is the set of all elements of G(∆) which are conjugate to the canonical generators (vertices of ∆). Two vertices are joined by an edge if and only if the corresponding group elements commute. The group G(∆) acts on ∆e by conjugation. In some sense, the extension graph encodes the structure of the intersection pattern of flats inside the universal cover of the Salvetti complex. It plays an essential role in establishing the quasi-isometric rigidity of the class of RAAGs with finite outer automorphism groups, see [H16]. Observe that RAAGs split as fundamental groups of graph of groups, whose vertex groups are centralisers of vertex generators. In this paper we will work with the centraliser splitting defined as follows. Definition 3.2 ((Reduced) Centraliser splitting). Let ∆ be a tree and let G(∆) be the RAAG with underlying graph ∆. The centraliser splitting of G(∆) is a graph of groups defined as follows. The graph of the splitting is isomorphic to ∆ and the vertex group at every vertex is defined to be the centralizer of the corresponding vertex generator. Note that if v is some vertex of ∆, and u1 , . . . , us are all vertices of ∆ adjacent to v, then C(v) = hv, u1 , . . . , us i ∼ = Z × Fs , where Fs is the free group of rank s, see Corollary 2.3. In particular, C(v) is abelian if and only if v has degree 1, and in this case C(v) ∼ = Z2 is contained in the centralizer of the vertex adjacent to v. For an edge e connecting vertices u and v the edge group at e is C(u) ∩ C(v) = hu, vi ∼ = Z2 . Note that the centralizer splitting is not reduced, since for every vertex of degree 1 in ∆ the vertex group is equal to the incident edge group. Thus it makes sense to consider the reduced centraliser splitting of G(∆) (for a tree ∆), which is obtained from the centralizer splitting by removing all vertices of degree 1. In this splitting all the vertex groups are non-abelian, and all the edge groups are isomorphic to Z2 , in particular, this splitting is already reduced. As we show in Lemma 3.4 below, just as the centraliser splitting corresponds to the extension graph, the reduced centraliser splitting corresponds to the reduced extension graph, which we now define. Definition 3.3 (Reduced extension graph). For a tree ∆, we define the reduced extension graph e e , to be the full subgraph of the extension graph ∆e , whose vertex set is of ∆, and denote it by ∆ the set of all elements of G(∆) which are conjugate to the canonical generators corresponding to vertices of ∆ of degree more than 1 (which are exactly those which have non-abelian centralizers). The reduced extension graph will play an essential role in the classification of RAAGs up to commensurability. If H < G(∆) is a subgroup of finite index, then H intersects each cyclic subgroup associated to the vertex groups of the reduced extension graph in a non-trivial cyclic subgroup, 8 M. CASALS-RUIZ, I. KAZACHKOV, AND A. ZAKHAROV g that is H ∩ hagi i = h(aki i ) i for some ki ∈ N, g ∈ G. On the other hand, in the case of trees, by the description of centralisers in RAAGs, every element in H whose centraliser is non-abelian belongs g to some cyclic subgroup h(aki i ) i = H ∩ hagi i, see Corollary 2.4. Since the set of elements with non-abelian centralisers is an invariant set up to isomorphism, it follows that the reduced extension graph is an algebraic invariant in the class of finite index subgroups of G(∆), that is if K ' H and H <f i G(∆), then the graph T (K) whose vertex set is in one-to-one correspondence with maximal cyclic subgroups generated by elements of K with non-abelian centraliser and there is an edge (u, v) whenever the corresponding elements commute, is isomorphic to the reduced extension graph of G(∆) (see Lemma 3.6). From this observation, one can deduce that many classes of RAAGs are not commensurable (without using the stronger fact that they are not quasi-isometric). For instance, RAAGs whose defining graphs are trees are not commensurable to RAAGs whose defining graph have cycles; or RAAGs defined by cycles of different lengths are not commensurable, etc. At this point, a couple of remarks are in order. Firstly, the above observation does not extend to the extension graph, that is, commensurable RAAGs may not have isomorphic extension graphs. For instance, we will show that the RAAGs defined by paths of length 3 and 4 are commensurable but their extension graphs are not isomorphic (leaves in the tree are also leaves in the extension graphs and the minimal distances in the extension graphs between leaves is 3 and 4 respectively). The reason here is that there are elements with abelian centralisers that are not powers of conjugates of the canonical generators so they are not accounted for in the extension graph. Secondly, the isomorphism of the reduced extension graphs is a necessary condition but it is by far not sufficient. All RAAGs defined by trees of diameter 4 have isomorphic reduced extension graphs but there are infinitely many different commensurability classes among them. In the next lemmas we notice that the two trees, the (reduced) extension graph and the Bass-Serre tree associated to the (reduced) centraliser splitting are equivalent and that the reduced extension graph and its quotient by the action of H is invariant up to isomorphism. Lemma 3.4. If ∆ is a tree, then the extension graph ∆e is also a tree, which is isomorphic to the Bass-Serre tree T corresponding to the centralizer splitting of G(∆). Moreover, the reduced e e is a subtree of ∆e , which is isomorphic to the Bass-Serre tree Te corresponding extension graph ∆ to the reduced centralizer splitting of G(∆). The graph isomorphisms above are equivariant, in the e e ) corresponds to the natural action of sense that the action of G(∆) by conjugation on ∆e (or ∆ G(∆) on the Bass-Serre tree of the centralizer splitting (reduced centralizer splitting, respectively). From now on we denote G = G(∆). Proof. Every vertex of ∆e has the form v g , where v is some canonical generator of G, and g ∈ G. By Bass-Serre theory, vertices of T correspond to left cosets of centralizers of canonical generators of G. Define a morphism β from ∆e to T by sending v g to the vertex of the form gC(v). This gives a bijection of the vertex sets. By definition, two vertices v1g1 and v2g2 of ∆e are connected by an edge iff [v1g1 , v2g2 ] = 1 iff [v1 , v2 ] = 1 and v1g1 = v1g , v2g2 = v2g for some g ∈ G, iff [v1 , v2 ] = 1 and g1−1 g ∈ C(v1 ), g2−1 g ∈ C(v2 ) for some g ∈ G, COMMENSURABILITY OF RAAGS 9 iff [v1 , v2 ] = 1 and g1 C(v1 ) ∩ g2 C(v2 ) 6= ∅. By Bass-Serre theory, since ∆ is a tree and therefore there are no HNN-extensions appearing, two vertices g1 C(v1 ) and g2 C(v2 ) of T are connected by an edge iff [v1 , v2 ] = 1 and gC(v1 ) = g1 C(v1 ), gC(v2 ) = g2 C(v2 ) for some g ∈ G, iff [v1 , v2 ] = 1 and g1 C(v1 ) ∩ g2 C(v2 ) 6= ∅. This shows that β is indeed a graph isomorphism. Now β(v g ) = gC(v) = gβ(v), so β is equivariant, and the e e gives an equivariant isomorphism between ∆ e e and Te. restriction of β to ∆  3.2. Commensurability invariants: the reduced extension graph and the quotient graph. The goal of this section is to show that the reduced extension graph and the quotient graph (defined below) are commensurability invariants. Suppose ∆ is a finite tree, and K is a finite index subgroup e e , and K acts on ∆ e e by restriction. Let of G(∆). Then G(∆) acts on the reduced extension graph ∆ e e Ψ(K) be the quotient graph: Ψ(K) = K\∆ . The goal of this section is to show that if G(∆) and G(∆0 ) are commensurable, and G(∆) >f i K ' K 0 <f i G(∆0 ), then the reduced extension graphs e e and ∆ e 0e are isomorphic and so are the quotient graphs Ψ(K) = K\∆ e e and Ψ(K 0 ) = K 0 \∆ e 0e . ∆ Note that there are natural projection graph morphisms e e → Ψ(K) γK : ∆ and e = G(∆)\∆ e e. δK : Ψ(K) → ∆ Note also that the graph Ψ(K) is finite, since K has finite index in G(∆). Below CK (w) = K ∩ CG (w) is defined even if w ∈ G is not in K. In fact, since K has finite index in G, there exists a natural m such that wm ∈ K, and then CK (w) = CK (wm ). e e such that γK (w) = v. Then Lemma 3.5. Let v be a vertex of Ψ(K), and w be any vertex of ∆ (1) There is a bijection between the vertices of Ψ(K) adjacent to v and the equivalence classes e e adjacent to w, modulo conjugation by K. of vertices of ∆ (2) There is a bijection between the edges of Ψ(K) incident to v and the equivalence classes of e e adjacent to w, modulo conjugation by CK (w). vertices of ∆ Proof. The first claim follows immediately from the definition of Ψ(K) as a quotient graph. Now e e incident to w. Let w1 , w2 be the other ends of e1 , e2 let e1 and e2 be two different edges of ∆ respectively. Then e1 and e2 project into the same edge of Ψ(K) if and only if there exists g ∈ K which takes e1 to e2 . Since w and w1 for sure belong to different orbits under the action of K (even of G), this happens if and only if g takes w1 to w2 and leaves w fixed. This means that w1g = w2 and wg = w, so g ∈ CK (w), thus the second claim also holds.  In particular, graph Ψ(K) can have multiple edges and cycles (but not loops). Suppose now ∆ and ∆0 are finite trees, and denote G = G(∆) and G0 = G(∆0 ). Suppose G and G0 are commensurable. Thus there exist finite index subgroups H ≤ G and H 0 ≤ G0 and an isomorphism ϕ : H → H 0 . e e and ∆ e 0e defined above, with the actions by conjugation Consider the reduced extension graphs ∆ 0 of G and G respectively. The finite graphs Ψ(H) and Ψ(H 0 ) are defined as above. 10 M. CASALS-RUIZ, I. KAZACHKOV, AND A. ZAKHAROV ee → ∆ e 0e and Lemma 3.6. The group isomorphism ϕ : H → H 0 induces graph isomorphisms ϕ : ∆ 0 ϕ∗ : Ψ(H) → Ψ(H ). Proof. Let u1 , . . . , uk be all vertices of ∆ which have degree more than 1, and u01 , . . . , u0k0 be all vertices of ∆0 which have degree more than 1. Then u1 , . . . , uk are all canonical generators of G with non-abelian centralizers, and u01 , . . . , u0k0 are all canonical generators of G0 with non-abelian centralizers. Notice that the only elements of G which have non-abelian centralizers in G are conjugates of powers of u1 , . . . , uk by some element of G. Since H has finite index in G and so CH (x) = H ∩ CG (x) has finite index in CG (x) for any x ∈ G. The only elements of H which have non-abelian centralizers in H are conjugates of powers of u1 , . . . , uk by some element of G which belong to H, that is elements from the set MH = {(uki i )gi ∈ H}, where g ∈ G, ki ∈ Z. Analogously, the only elements of H 0 which have non-abelian centralizers in H 0 are conjugates of powers of u01 , . . . , u0k0 by some element k0 0 of G0 which belong to H 0 , that is elements from the set MH 0 = {(u0i i )gi ∈ H 0 }, where g ∈ G0 , ki0 ∈ Z. Thus, the isomorphism ϕ should take the set MH to the set MH 0 . ee → ∆ e 0e as follows. First define ϕ on the vertex set of ∆ e e . Let Now define a morphism of trees ϕ : ∆ e g e w be a vertex of ∆ . Then w = u for some g ∈ G, where u is one of u1 , . . . , uk . Since H has finite index in G, there exists a minimal positive integer k such that wk ∈ H. Then wk has non-abelian centralizer in H, so ϕ(wk ) also has non-abelian centralizer in H 0 , thus ϕ(wk ) = (ul0 )g0 ∈ H 0 for some positive integer l, g0 ∈ G0 , and u0 equal to one of u01 , . . . , u0k0 . Denote w0 = ug00 . Then let ϕ(w) = w0 . Note that here l is also equal to the minimal positive integer i such that w0i ∈ H 0 , since if i < l, then also i|l, so w0l is a proper power in H 0 , but this is impossible, since wk is not a proper power in H, and w0l = ϕ(wk ). We can extend ϕ to the edges in a natural way. Indeed, by description of centralisers in RAAGs, e e are adjacent iff see Theorem 2.1, two vertices w1 , w2 of ∆ [w1 , w2 ] = 1 ⇔ [w1k1 , w2k2 ] = 1 (take positive integers k1 , k2 such that w1k1 , w2k2 ∈ H), iff [ϕ(w1k1 ), ϕ(w2k2 )] = 1 ⇔ [ϕ(w1 ), ϕ(w2 )] = 1, iff ϕ(w1 ) and ϕ(w2 ) are adjacent. This shows that ϕ is a well-defined morphism of trees. Moreover, ϕ is in fact an isomorphism of trees, since the inverse morphism can be constructed in the same way. e e , and h ∈ H, then we have that ϕ(wh ) = ϕ(w)ϕ(h) . It follows that we can If w is a vertex of ∆ restrict ϕ to the graph isomorphism e e → Ψ(H 0 ) = H 0 \∆ e e , ϕ∗ (γH (z)) = γH 0 (ϕ(z)), ϕ∗ : Ψ(H) = H\∆ e e , and γH , γH 0 are the orbit projections as above. This proves where z is a vertex or an edge of ∆ the lemma.  3.3. Commensurability invariant: linear relations between minimal exponents. So far we have observed that isomorphisms leave the set of powers of conjugates of canonical generators g 0 g0 with non-abelian centralisers invariant. However, if an isomorphism ϕ sends (ak ) to (a0k ) , then a priori there is no relation between the integer numbers k and k 0 corresponding to the powers. COMMENSURABILITY OF RAAGS 11 0 Example 3.7. Let H, K <f i Z × F2 ' hci × ha, bi, H = hck , a, bi and K = hck , a, bi. Clearly, 0 ϕ : H → K that maps ck → ck , a → a and b → b is an isomorphism and k and k 0 can be taken arbitrarily. 0 On the other hand, if we consider H = hck , a2 , b, ab i, K = hck i × Fm <f i hci × ha, bi and we assume 0 that the isomorphism ϕ : H → K sends ck to ck and each power of a conjugate of either a or b to a power of a conjugate of a and b, then we do get a constraint on the possible powers of the image of a. Indeed, the isomorphism ϕ induces an isomorphism ϕ0 from the subgroup ha2 , b, ab i to Fm , hence m = 3 and the index of F3 < F2 is 2. Since among the conjugates of powers of generators in H there are 3 of minimal exponent, by our assumption, there are also 3 in K. Furthermore, since the sum of the minimal exponents of conjugates of a fixed generator is equal to the index, which in our case is 2, and since, upto relabeling, there are only two covers of F2 of degree 2 and only one of them has 3 conjugates of powers of generators of minimal exponent, it follows that either a is sent to a conjugate of a generator (and there are exactly two conjugates of this generator) or it is sent to a square of a generator (and it is the only conjugate of minimal exponent of this generator in the subgroup). Our next goal is to formalise and generalise these ideas in order to find linear relations between the minimal exponents of the different (conjugacy) classes of powers of generators that belong to the subgroups H and H 0 correspondingly. The strategy is as follows. We already established that the isomorphism between finite index subgroups H ≤ G and H 0 ≤ G0 induces an isomorphism between non-abelian centralisers in H and H 0 : CH (w) ' CH 0 (w0 ), where w and w0 are conjugates of generators of G and G0 correspondingly. Since H and H 0 are of finite index in G and G0 , so are CH (w) and CH 0 (w0 ) in the centralisers C1 = CG (w) and C2 = CG0 (w0 ) respectively. Note that C1 and C2 are of the form centre×free group. Hence, the isomorphism between CH (w) and CH 0 (w0 ) induces an isomorphism between the images PH,w and PH 0 ,w0 of CH (w) and CH 0 (w0 ) in the free groups obtained from C1 and C2 by killing their centres, see Lemma 3.10. In general, for a conjugate v = xg of a canonical generator x in G, such that v ∈ CG (w), the minimal exponent k such that v k belongs to CH (w) does not coincide with the minimal exponent l such that π(v)l belongs to PH,w , where π is the quotient by the center of CG (w) (i.e., by hwi) homomorphism, see Example 3.9. We refer to such l as the minimal quotient exponent; it is equal to the minimal positive number m such that v m ws ∈ CH (w) for some s, see Definition 3.8. Since the ranks of the isomorphic subgroups PH,w and PH 0 ,w0 of free groups are the same, the Schreier formula relates the corresponding indexes of PH,w and PH 0 ,w0 . We show in Lemma 3.11, that the index of PH,w coincides with the sum of the minimal quotient exponents of conjugates of a given generator that belong to PH,w . The goal of Section 3.3.1 is to describe a linear relation between the minimal quotient exponents of conjugates of generators that belong to PH,w and PH 0 ,w0 correspondingly, see Corollary 3.15. In Section 3.3.2 we establish a relation between minimal exponents and minimal quotient exponents, see Lemma 3.16, and deduce a linear relation between the minimal exponents of the conjugates of generators that belong to H and H 0 correspondingly, see Lemma 3.18. 12 M. CASALS-RUIZ, I. KAZACHKOV, AND A. ZAKHAROV 3.3.1. Linear relations between minimal quotient exponents. Fix a finite index subgroup K ≤ G. e e, We now encode the minimal exponent as a label of a vertex in the reduced extension graph ∆ and then of Ψ(K). Definition 3.8 (Label of a vertex/edge (minimal exponent/quotient exponent)). Let w be a vertex e e , thus w is also an element of G. Define the label of the vertex w, denoted by L(w), to be the of ∆ minimal positive integer k such that wk ∈ K. Such number exists, since K has finite index in G. Similarly, we encode the minimal quotient exponent as a label of an edge of reduced extension graph e e (and so of Ψ(K)) as follows. For an edge f of ∆ e e connecting vertices w1 and w2 define the label ∆ of the edge f at the vertex w1 , denoted by lw1 (f ), to be the minimal positive integer k such that there exists an integer l such that w1k w2l ∈ K. Note that we can always suppose l is non-negative. Analogously the label of f at w2 is defined. Note that by definition L(w1 ) ≥ lw1 (f ), for all edges f . e e (by conjugation). Note that the labels of vertices and edges are invariant under the action of K on ∆ k h k k l h k h l Indeed, for h ∈ K w ∈ K iff (w ) ∈ K, and w1 w2 ∈ K iff (w1 ) (w2 ) ∈ K. This means that we can define labels for the quotient graph Ψ(K) as well. If v is a vertex of Ψ(K), then define the label of the vertex v, denoted by L(v), to be the label L(w), where w is some vertex e e such that γK (w) = v. Analogously, if p is an edge of Ψ(K) connecting vertices v1 and v2 , of ∆ then define the label of the edge p at the vertex v1 , denoted by lv1 (p), to be the label lw1 (f ), where e e such that γK (f ) = p, and w1 is the end of p such that γK (w1 ) = v1 . These f is some edge of ∆ labels are well-defined. Note that the labels of vertices and edges of Ψ(K) are positive integers. Example 3.9 (Minimal exponent vs minimal quotient exponent). Consider the free group F (a, b) 2 3 of rank 2 and consider an index 4 subgroup F5 = hb, ba , ba , ba , a4 i < F (a, b). Let G = F (a, b) × hci and let K = hF5 , a2 c, c2 i be a finite index subgroup of G. An easy computation shows that the minimal exponent of a equals 4, min{n ∈ N | an ∈ CK (c2 ) = K} = 4. a Let π : G → G/hci be a natural projection. Then π(K) = hb, b , a2 i, hence the minimal quotient exponent of a equals 2, min{n ∈ N | an ∈ π(CK (c2 )) = π(K)} = 2. e e , and let γK (w) = v and u = δK (v). Thus u is a canonical generator of Let w be a vertex of ∆ G with non-abelian centralizer, and w = ug for some g ∈ G. Suppose u1 , . . . , uk are all vertices of ∆ adjacent to u, then k ≥ 2 is the degree of u in ∆, and u1 , . . . , us are those of them which have degree more than 1 (and so have non-abelian centralizer), here s ≤ k. Note that g g CK (w) ≤ CG (w) ∼ = Z(CG (w)) × F (u , . . . , u ), 1 k F (ug1 , . . . , ugk ) where Z(CG (w)) = hwi is cyclic and is the free group of rank k with the basis ug1 , . . . , ugk . Let FK,w be the free group of rank k with the basis q1 , . . . , qk . Denote by π : CG (w) → FK,w the factorization by the center homomorphism induced by the map π(w) = 1, π(ugi ) = qi , i = 1, . . . , k. Then π induces an isomorphism between F (ug1 , . . . , ugk ) and FK,w . Below, when we speak about cycles in the Schreier graph, we mean simple cycles with all edges labelled by the same generator, and we mean the Schreier graph with respect to the generators q1 , . . . , qk of FK,w . COMMENSURABILITY OF RAAGS 13 Lemma 3.10. In the above notation, the epimorphism π induces a group embedding πC : CK (w)/Z(CK (w)) ,→ FK,w , and PK,w = πC (CK (w)/Z(CK (w))) = π(CK (w)) is a finite index subgroup of FK,w . Proof. Let j be the minimal (positive) power of w which belongs to K. Note that Z(CK (w)) ≤ Z(CG (w)), since if some z ∈ CG (w), then for some positive integer l z l ∈ CK (w), so every element in the center of CK (w) should also commute with z. Also Ker(π) = Z(CG (w)) = hwi, so Ker(π|CK (w) ) = K ∩ Z(CG (w)) = hwj i = Z(CK (w)). This means that π induces an embedding πC : CK (w)/Z(CK (w)) ,→ FK,w . Since CK (w) = K ∩ CG (w) has finite index in CG (w), it follows that PK,w has finite index in FK,w .  Lemma 3.11. In the above notation the following statements hold: (1) π induces a bijection π∗ between the edges of Ψ(K) incident to v = γK (w) and those cycles in the Schreier graph of PK,w in FK,w which correspond to the generators q1 , . . . , qs . (2) For every edge p of Ψ(K) connecting v = γK (w) with some other vertex v1 , the label lv1 (p) of p with respect to v1 is equal to the length of the cycle π∗ (p) in the Schreier graph of PK,w in FK,w . Proof. Consider the Cayley graph of FK,w (with respect to the basis q1 , . . . , qk ). A line in the Cayley graph of FK,w is a bi-infinite path, where every edge is labelled by the same generator. e e incident to w and lines in the Cayley graph of We define a bijection π between the edges of ∆ FK,w labelled one of the generators q1 , . . . , qs (which have non-abelian centralizers). Let x be one of the generators u1 , . . . , us , and f be an edge connecting w = ug with w1 = xg1 , for some g1 ∈ G. As in the proof of Lemma 3.4, this means that gC(u) ∩ g1 C(x) 6= ∅, so w1 = xg1 = xgg2 , where g2 ∈ C(u) = hu, u1 , . . . , uk i. Note that g2 is defined up to multiplication on the right by an element of the centraliser of x. We can suppose that g2 ∈ hu1 , . . . , uk i, since u commutes with u1 , . . . , uk , in particular with x as well. Then w1 = gg2 xg2−1 g −1 = yxg y −1 , where y = g2g is the word obtained from g2 by replacing each ui by ugi , for i = 1, . . . , k, so y can be thought of as an element of F (ug1 , . . . , ugk ). Now let π(f ) be the line in the Cayley graph of FK,w passing through the vertex corresponding to π(y), and with edges labeled by the element π(xg ) = q, which is equal to one of the elements q1 , . . . , qs . Note that π is well-defined. Indeed, suppose we can write w1 in two ways: w1 = xg1 = xgg2 and 0 0 w1 = xg1 = xgg2 , where g2 , g20 ∈ hu1 , . . . , uk i, and x is one of u1 , . . . , us . Thus in G we have 0 0 xgg2 = xgg2 , so xg2 = xg2 . This can be considered as an equality in the free group on u1 , . . . , uk . −1 0 Then [x, g2 g2 ] = 1, so g2−1 g20 = xk for some k ∈ Z, which means that g20 = g2 xk , and then y 0 = y(xg )k , where y = g2g , y 0 = g20g , which means that π(y 0 ) = π(y)q k , so the line in the Cayley graph is defined correctly. It follows from the definition of π that it is surjective. Now we show that π is injective. Suppose f 0 connects w with w1 = xg1 , anf f 0 connects w with w10 = xg1 , g1 = gg2 , y = g2g and g10 = gg20 , y 0 = g20g , where g2 , g20 ∈ hu1 , . . . , uk i. If π(f ) = π(f 0 ), then π(y) = π(y 0 )q k , so y = y 0 (xg )k for some k ∈ Z. Then g2 = g20 xk , and thus g1 = g10 xk , so w1 = w10 . This shows that π is bijective. e e , and thus CK (w) also Note that CG (w) acts on the set of edges incident to the vertex w of ∆ acts on this set. The action of w is trivial, so this induces the action of CK (w)/Z(CK (w)) on the set of edges incident to w. On the other hand, PK,w = πC (CK (w)/Z(CK (w))) ≤ FK,w acts on 14 M. CASALS-RUIZ, I. KAZACHKOV, AND A. ZAKHAROV the Cayley graph of FK,w in the natural way (by left multiplication), and so PK,w also acts on the set of lines in the Cayley graph of FK,w defined above. Recall that πC induces an isomorphism CK (w)/Z(CK (w)) ∼ = πC (CK (w)/Z(CK (w))). It follows from the definition of π that for every e e incident to w and every h ∈ CK (w)/Z(CK (w)) we have π(h · f ) = πC (h) · π(f ), edge f of ∆ where we denote both actions defined above by dots. This means that the bijection π induces a bijection between the orbits of the edges incident to w under the action of CK (w) on one side, and the orbits of the lines (as above) in the Cayley graph of FK,w under the action of PK,w on the other side. By Lemma 3.5, the orbits of the edges incident to w under the action of CK (w) are in one-to-one correspondence with the edges of Ψ(K) incident to v = γK (w). And the orbits of the lines (as above) in the Cayley graph of FK,w under the action of PK,w are in a natural one-to-one correspondence with the cycles in the Schreier graph of PK,w in FK,w , which are labelled by the generators q1 , . . . , qs . This defines the desired bijection π∗ and proves the first claim of the Lemma. e e incident to w such that γK (f ) = p, and Now we turn to the second claim. Let f be an edge of ∆ let f connect w with w1 , so γK (w1 ) = v1 . Recall that the label of p at v1 is equal to the label of f at w1 , lw1 (f ), which is the minimal positive integer k such that there exists an integer l such that w1k wl ∈ K. Note that this means that π(w1k ) = π(w1k wl ) ∈ PK,w . Since Ker(π) = hwi, it follows 0 that lw1 (f ) is equal to the minimal positive integer k 0 such that (π(w1 ))k ∈ PK,w . Let w = ug and w1 = xgg2 as above, where g2 ∈ hu1 , . . . , uk i. Denote, as above, π(xg ) = q, g2g = y. We have π(w1 ) = π(xgg2 ) = π(y)qπ(y)−1 , and π(f ) is the line passing through π(y) and with edges labelled by q. Thus lw1 (f ) is equal to the minimal positive integer k 0 such that 0 0 0 (π(w1 ))k = (π(y)qπ(y)−1 )k = π(y)q k π(y)−1 ∈ PK,w , 0 which is equivalent to rπ(y) = π(y)q k for some r ∈ PK,w . Thus, lw1 (f ) is equal to the minimal 0 positive exponent k 0 of q for which points π(y) and π(y)q k on the line π(f ) in the Cayley graph of FK,w are equivalent under the action of PK,w , and this is exactly the length of the corresponding cycle π∗ (f ) in the Schreier graph of PK,w in FK,w . This proves the second claim.  e e in the same orbit under the Lemma 3.12. In the above notation, let w, w0 be two vertices of ∆ action of K. Then there is a natural isomorphism α between FK,w and FK,w0 , which restricts to an isomorphism αP between PK,w and PK,w0 and respects the bijections from Lemma 3.11. Proof. Let w0 = wh , where h ∈ K, and let u, u1 , . . . , uk be as above. Then g g w = ug , CG (w) ∼ = hug i × F (u1 , . . . , uk ), hg hg w0 = uhg , CG (w0 ) = (CG (w))h ∼ = huhg i × F (u , . . . , u ). 1 Also k FK,w = F (q1 , . . . , qk ), FK,w0 = F (q10 , . . . , qk0 ), π : CG (w) → FK,w , π(w) = 1, π(ugi ) = qi , i = 1, . . . , k, 0 π 0 : CG (w0 ) → FK,w0 , π(wh ) = 1, π(uhg i ) = qi , i = 1, . . . , k. Let α be the isomorphism α : CG (w) → CG (w0 ), α(t) = th for t ∈ CG (w). Define the isomorphism α : FK,w → FK,w0 , α(qi ) = qi0 , i = 1, . . . , k. Then απ = π 0 α by definitions. We have CK (w0 ) = K ∩ CG (w0 ) = K ∩ (CG (w))h = (K ∩ CG (w))h = CK (w)h , COMMENSURABILITY OF RAAGS 15 so α(CK (w)) = CK (w0 ). Note that PK,w = π(CK (w)), PK,w0 = π 0 (CK (w0 )), so α(PK,w ) = απ(CK (w)) = π 0 α(CK (w)) = π 0 (CK (w0 )) = PK,w0 , so α induces an isomorphism αP between PK,w and PK,w0 . Thus α also induces an isomorphism between the Schreier graphs of PK,w in FK,w and of PK,w0 in FK,w0 in a natural way. Recall that π∗ is a bijection between the edges of Ψ(K) incident to v = γK (w) and those cycles in the Schreier graph of PK,w in FK,w which correspond to the generators q1 , . . . , qs . Analogously π∗0 is a bijection between the edges of Ψ(K) incident to v = γK (w0 ) = γK (w) and those cycles in the Schreier graph of PK,w0 in FK,w0 which correspond to the generators q10 , . . . , qs0 . It follows from the definition of π∗ , π∗0 that for every edge p of Ψ(K) incident to v the cycle π∗ (p) goes into the cycle  π∗0 (p) under the isomorphism induced by α, i.e., α respects the bijections. e e such that γK (w) = v If v is some vertex of Ψ(H), then by Lemma 3.12 different choices of w in ∆ give the same groups FK,w , subgroups PK,w , as well as bijections π∗ , as in Lemma 3.11, up to isomorphism. This means that the exact choice of such w is unimportant, and, abusing the notation, e e such that we will denote FK,v = FK,w , PK,v = PK,w , where the vertex w is any vertex of ∆ γK (w) = v. Lemma 3.13. In the above notation, with v being a vertex of Ψ(K) and u = δK (v), let u0 be some vertex of ∆ of degree more than 1, connected to u by an edge e0 . If f1 , . . . , fk are all edges of Ψ(K) incident to the vertex v such that δK (fi ) = e0 for all i = 1, . . . , k, and each fi connects v with the vertex vi (i = 1, . . . , k), then (2) k X lvi (fi ) = |FK,v : PK,v |. i=1 If z1 , . . . , zp are all edges of Ψ(K) incident to v, and each zi connects v with the vertex wi , then (3) p X lwi (zi ) = r |FK,v : PK,v |. i=1 where r is the number of vertices of degree greater than 1 adjacent to u in ∆. Proof. According to Lemma 3.11, there is a bijection between the set of edges f1 , . . . , fk and the set of cycles in the Schreier graph of PK,v in FK,v which correspond to conjugates of u0 , and the length of each cycle is equal to the corresponding edge label. The sum of lengths of these cycles is equal to the number of vertices in the Schreier graph, which is equal to |FK,v : PK,v |, thus (2) follows. Summing all the equalities of the form (2) for all vertices of ∆ of degree greater than 1 adjacent to u gives (3).  As above, suppose now ∆ and ∆0 are finite trees such that G = G(∆) and G0 = G(∆0 ) are commensurable, and so there exist finite index subgroups H ≤ G and H 0 ≤ G0 and an isomorphism ϕ : H → H 0 , and Ψ(H), Ψ(H 0 ) are defined as above. Recall that for a vertex v of Ψ(H) and a vertex v 0 of Ψ(H 0 ) the finite index subgroups PH,v ≤ FH,v and PH 0 ,v0 ≤ FH 0 ,v0 are defined as in Lemma 3.10. 16 M. CASALS-RUIZ, I. KAZACHKOV, AND A. ZAKHAROV Lemma 3.14. Let v be a vertex of Ψ(H), and let v 0 = ϕ∗ (v) be the corresponding vertex of Ψ(H 0 ), where ϕ∗ is the graph isomorphism between Ψ(H) and Ψ(H 0 ) from Lemma 3.6. Let δH (v) = u and δH 0 (v 0 ) = u0 , and suppose u has degree t in ∆, and u0 has degree t0 in ∆0 . Then (t − 1) |FH,v : PH,v | = (t0 − 1) |FH 0 ,v0 : PH 0 ,v0 |. (4) e e be such that γH (w) = v, and think of w as an element of G. Let l be such Proof. Let w ∈ ∆ positive integer that wl ∈ H. Then ∼ CH 0 (ϕ(wl )) = CH 0 (ϕ(w)). CH (w) = CH (wl ) = Note that γH 0 (ϕ(w)) = v 0 . Thus, ∼ CH (w)/Z(CH (w)) ∼ PH,v = = CH 0 (ϕ(w))/Z(CH 0 (ϕ(w))) ∼ = PH 0 ,v0 . In particular, rk(PH,v ) = rk(PH 0 ,v0 ). Then, by Schreier index formula, |FH,v : PH,v |(rk(FH,v ) − 1) = rk(PH,v ) − 1 = rk(PH 0 ,v0 ) − 1 = |FH 0 ,v0 : PH 0 ,v0 |(rk(FH 0 ,v0 ) − 1). This implies (4).  Combining the two previous lemmas, we establish a linear relation between the minimal quotient exponents that we record in the following corollary. Corollary 3.15. Let v be a vertex of Ψ(H), and let v 0 = ϕ∗ (v). Let δH (v) = u and δH 0 (v 0 ) = u0 , and suppose u has degree t in ∆, and u0 has degree t0 in ∆0 . Let e1 , . . . , ek be all edges of Ψ(H) incident to v, where each ei connects v with the vertex wi , and let e0i = ϕ∗ (ei ), wi0 = ϕ∗ (wi ), i = 1, . . . , k. Let also r be the number of non-leaf vertices adjacent to u in ∆, and r0 be the number of non-leaf vertices adjacent to u0 in ∆0 . Then k k t0 − 1 X t−1 X lwi (ei ) = lw0 (e0 ). r i=1 r0 i=1 i i Proof. Since ϕ∗ is a graph isomorphism, see Lemma 3.6, e01 , . . . , e0k are all edges of Ψ(H 0 ) incident to v 0 . By Lemma 3.13 we have k X lwi (ei ) = r|FH,v : PH,v |, i=1 The statement now follows from Lemma 3.14. k X lwi0 (e0i ) = r0 |FH 0 ,v0 : PH 0 ,v0 |. i=1  3.3.2. Linear relations between minimal exponents. We recall the definitions of labels of vertices and edges, see Definition 3.8. e e incident to a vertex w, and f 0 = ϕ(f ), w0 = ϕ(w), where ϕ is as in Lemma Let f be an edge of ∆ 0 e e , w0 in ∆ e 0e respectively. By lw (f ) 3.6. By L(w), L (w) we denote the labels of the vertices w in ∆ e 0 e we denote the label of the edge f with respect to w in ∆ , and by l w (f ) we denote the label of the e 0e . edge f 0 with respect to w0 in ∆ Analogously, let p be an edge of Ψ(H) incident to a vertex v, and p0 = ϕ∗ (p), v 0 = ϕ∗ (v). By L(v), L0 (v) we denote the labels of the vertices v in Ψ(H), v 0 in Ψ(H 0 ) respectively. By lv (p) we denote the label of the edge p with respect to v in Ψ(H), and by lv0 (p) we denote the label of the edge p0 with respect to v 0 in Ψ(H 0 ). COMMENSURABILITY OF RAAGS 17 Lemma 3.16. Let p be an edge of Ψ(H) connecting vertices v1 and v2 . Then L(v2 ) L(v1 ) = = r, lv1 (p) lv2 (p) (5) where r is some positive integer. e e such that γH (f ) = p, and w1 , w2 be the ends of f , so that Proof. Let f be some edge of ∆ γH (w1 ) = v1 , γH (w2 ) = v2 . Then we can rewrite (5) as L(w1 ) L(w2 ) = = r. lw1 (f ) lw2 (f ) (6) By definition lw1 (f ) is the minimal positive integer k such that there exists an integer l such that w1k w2l ∈ H. Note that if k 0 is some other positive integer such that there exists an integer l0 such 0 0 that w1k w2l ∈ H, then lw1 (f )|k 0 . Indeed, denote k0 = lw1 (f ) and let d be the greatest common divisor of k0 and k 0 . Then there exist integers α, β such that αk0 + βk 0 = d. We have w1k0 w2l ∈ H 0 0 and w1k w2l ∈ H, so, since w1 and w2 commute, 0 0 0 0 0 (w1k0 w2l )α (w1k w2l )β = w1αk0 +βk w2αl+βl = w1d w2αl+βl ∈ H, so d ≥ k0 , but since d = gcd(k0 , k 0 ), this means that d = k0 and thus k0 = lw1 (f )|k 0 . L(w1 ) Recall that L(w1 ) is the minimal positive integer k such that w1k ∈ H, so w1 from above that lw1 (f )|L(w1 ). Thus, positive integer. L(w1 ) lw1 (f ) = r1 is a positive integer. Analogously l It remains to show that r1 = r2 . Indeed, suppose that l is such that w1w1 above, this means that lw2 (f )|l, so let l = lw2 (f )q. We have l (w1w1 L(w ) (f ) l w2l )r2 = w1w1 (f )r2 l w2lr2 = w1w1 l L(w )q ∈ H and it follows (f )r2 l w2w2 (f )qr2 l = w1w1 (f )r2 (f ) = r2 is a w2l ∈ H. As shown L(w2 )q w2 L(w2 ) lw2 (f ) ∈ H. (f )r 2 But w2 2 ∈ H, so w2 2 ∈ H. Thus w1w1 ∈ H. This means that lw1 (f )r2 ≥ L(w1 ) = lw1 (f )r1 , so r2 ≥ r1 . Analogous argument shows that r1 ≥ r2 . Thus r1 = r2 .  Lemma 3.17. Let p be an edge of Ψ(H) connecting vertices v1 and v2 . Then (7) L(v1 ) L0 (v1 ) L(v2 ) L0 (v2 ) = 0 = = 0 = q, lv1 (p) lv1 (p) lv2 (p) lv2 (p) where q is some positive integer. Proof. We already know from Lemma 3.16 that L(v2 ) L(v1 ) = = q1 , lv1 (p) lv2 (p) L0 (v1 ) L0 (v2 ) = 0 = q2 , 0 lv1 (p) lv2 (p) where q1 and q2 are some positive integers. Thus it suffices to show that q1 = q2 , or (8) L0 (v1 ) L(v1 ) . = 0 lv1 (p) lv1 (p) 18 M. CASALS-RUIZ, I. KAZACHKOV, AND A. ZAKHAROV e e such that γH (f ) = p, and w1 , w2 be the ends of f , so that γH (w1 ) = Let f be some edge in ∆ v1 , γH (w2 ) = v2 . Let also w10 = ϕ(w1 ), w20 = ϕ(w2 ). Then we can rewrite (8) as L(w1 ) L0 (w1 ) . = 0 lw1 (f ) l w1 (f ) (9) Recall that lw1 (f ) is the minimal positive integer k such that there exists an integer l such that w1k w2l ∈ H. Fix such number l. Denote L(w1 ) = m1 , L(w2 ) = m2 , L0 (w1 ) = m01 , L0 (w2 ) = m02 . l Then w1w1 (f ) l w2l ∈ H, and the element y = (w1w1 (f ) w2l )m1 m2 is a m1 m2 power in H. Note that y = (w1m1 )lw1 (f )m2 (w2m2 )lm1 . 0 0 Note also that w1m1 , w2m2 ∈ H by definition of labels, and ϕ(w1m1 ) = (w10 )m1 , ϕ(w2m2 ) = (w20 )m2 , as shown in the proof of Lemma 3.6. Thus 0 0 ϕ(y) = ((w10 )m1 )lw1 (f )m2 ((w20 )m2 )lm1 is a m1 m2 power in H 0 : ϕ(y) = z m1 m2 for some z ∈ H 0 . But roots in RAAGs are unique, see Section 2, so 0 0 z = (w10 )m1 lw1 (f )/m1 (w20 )m2 l/m2 ∈ H 0 . By definition of l0 w1 (f ), this means that m01 lw1 (f )/m1 ≥ l0 w1 (f ), so L0 (w1 ) L(w1 ) ≥ . 0 l w1 (f ) lw1 (f ) The same argument with the roles of G and G0 interchanged shows that L(w1 ) L0 (w1 ) ≥ 0 . lw1 (f ) l w1 (f ) Thus L(w1 ) L0 (w1 ) = 0 . lw1 (f ) l w1 (f ) This proves the Lemma.  The above lemmas imply that the labels of edges satisfy the following equations. Lemma 3.18. Suppose v is some vertex of Ψ(H), and v 0 = ϕ∗ (v), where ϕ∗ is the graph isomorphism between Ψ(H) and Ψ(H 0 ) from Lemma 3.6. Suppose δH (v) has degree t in ∆ and is adjacent to r vertices of degree more than 1 in ∆, and δH 0 (v 0 ) has degree t0 in ∆0 , and is adjacent to r0 vertices of degree more than 1 in ∆0 . Let f1 , . . . , fk be all edges of Ψ(H) adjacent to v, and suppose αi = lv (fi ), αi0 = lv0 (fi ), i = 1, . . . , k, are their labels. Then we have k k k k (10) t−1X t0 − 1 X αi L(vi ) = αi L0 (vi ), r i=1 r0 i=1 (11) t−1X 0 t0 − 1 X 0 0 αi L(vi ) = α L (vi ). r i=1 r0 i=1 i COMMENSURABILITY OF RAAGS 19 Proof. Let the edge fi connect v to vi , i = 1, . . . , k. By Corollary 3.15, we have that k k t0 − 1 X 0 t−1 X lvi (fi ) = l (fi ). r i=1 r0 i=1 vi Multiplying both sides by L(v), we obtain (12) k k t0 − 1 X 0 t−1 X lvi (fi )L(v) = l (fi )L(v). r i=1 r0 i=1 vi Multiplying both sides by L0 (v), we obtain (13) k k t0 − 1 X 0 t−1 X lvi (fi )L0 (v) = l (fi )L0 (v). r i=1 r0 i=1 vi According to Lemma 3.17, we have L0 (v) L(vi ) L0 (vi ) L(v) = 0 = = 0 lv (fi ) lv (fi ) lvi (fi ) lvi (fi ) for all i = 1, . . . , k, so lvi (fi )L(v) = L(vi )lv (fi ), lv0 i (fi )L(v) = L0 (vi )lv (fi ), lvi (fi )L0 (v) = L(vi )lv0 (fi ), Thus (12), (13) imply (10), (11). lv0 i (fi )L0 (v) = L0 (vi )lv0 (fi ).  Definition 3.19 (Type of a vertex). If v is a vertex of Ψ(H) such that δH (v) = u1 , and δH 0 (ϕ∗ (v)) = u2 , then we say that v is a vertex of type u1 /u2 , or v is a u1 /u2 -type vertex. Note that a vertex of Ψ(H) of type u1 /u2 can only be adjacent to a vertex of Ψ(H) of type v1 /v2 if u1 and v1 are adjacent in ∆ and u2 and v2 are adjacent in ∆0 . 3.4. Infinitely many commensurability classes of RAAGs defined by trees of diameter 4. We now turn our attention to the proofs of the main results. We first show that there are infinitely many different commensurability classes inside the class of RAAGs defined by trees of diameter 4. This is a particular case of Theorem 3.21 , but we give a separate proof for two reasons: the first one, it is technically easier and it helps as a warm up for the general case; secondly, for the reader interested only in the qualitative aspect of the result, it suffices to read our Theorem 3.20. For 0 < d1 ≤ d2 we denote by Pd1 ,d2 the tree of diameter 4 with 2 pivots, one of degree d1 and the other of degree d2 , and no hair vertices, see Figure 2. Thus Pd1 ,d2 = T ((d1 , 1), (d2 , 1); 0) if d1 < d2 and Pd1 ,d1 = T ((d1 , 2); 0). Theorem 3.20 (Infinitely many commensurability classes). Let 0 < m1 ≤ m2 and 0 < n1 ≤ n2 . m2 1 Suppose the groups G = G(Pm1 ,m2 ) and G0 = G(Pn1 ,n2 ) are commensurable. Then m n1 = n2 . In particular, there are infinitely many commensurability classes among RAAGs defined by trees of diameter 4. In fact, we will see in the next section that G = G(Pm1 ,m2 ) and G0 = G(Pn1 ,n2 ) are commensurable m2 1 if and only if m n1 = n2 . M. CASALS-RUIZ, I. KAZACHKOV, AND A. ZAKHAROV ... ... 20 Figure 2. Tree of diameter 4 with 2 pivots Proof of Theorem 3.20. Let c be the center vertex of Pm1 ,m2 and c0 be the center vertex of Pn1 ,n2 . Let p1 , p2 be the pivots of Pm1 ,m2 of degrees m1 + 1, m2 + 1 correspondingly, and p01 , p02 be the pivots of Pn1 ,n2 of degrees n1 + 1, n2 + 1 correspondingly. Let H ≤ G and H 0 ≤ G0 be finite index subgroups such that H ∼ = H 0 . From Lemma 3.18 and 0 Lemma 3.13 applied to both ∆ = Pm1 ,m2 and ∆ = Pn1 ,n2 we have a system of equations on the labels of vertices and edges of Ψ(H). We will show that this system of equations does not have any m2 1 positive integer solutions unless m n1 = n2 . Note that there could exist vertices of the following nine types in Ψ(H): p1 /p01 , p1 /p02 , p2 /p01 , p2 /p02 , c/p01 , c/p02 , p1 /c0 , p2 /c0 , c/c0 , see Definition 3.19. It also follows from Definition 3.19 that the following statements hold: • Every vertex of type p1 /p01 , p1 /p02 , p2 /p01 , p2 /p02 can be connected only with c/c0 -type vertices; • Every c/c0 -type vertex can be connected only with vertices of type p1 /p01 , p1 /p02 , p2 /p01 , p2 /p02 ; • Every p1 /c0 -type and p2 /c0 -type vertex can be connected only with c/p01 -type and c/p02 -type vertices; • Every c/p01 -type and c/p02 -type vertex can be connected only with p1 /c0 -type and p2 /c0 -type vertices. Thus, there are two cases: either Ψ(H) has only vertices of type p1 /p01 , p1 /p02 , p2 /p01 , p2 /p02 and c/c0 , or Ψ(H) has only vertices of type p1 /c0 , p2 /c0 , c/p01 and c/p02 . Case 1. Suppose first Ψ(H) has only vertices of type p1 /p01 , p1 /p02 , p2 /p01 , p2 /p02 and c/c0 . Let v be a pi /p0j -type vertex, where i = 1, 2, j = 1, 2. Then all vertices adjacent to v are of type c/c0 . Let f1 , . . . , fS be all edges incident to v, and let fs connect v with vs for s = 1, . . . , S (possibly some of vi coincide). Then, by Lemma 3.18, in the notations of which we have t = mi + 1, r = 1, t0 = nj + 1, r0 = 1, we have (14) mi S X s=1 0 L(vs )lv (fs ) = nj S X L0 (vs )lv (fs ). s=1 Let w1 , . . . , wQ be all the c/c -type vertices of Ψ(H). For every vertex wq , q = 1, . . . , Q, consider all the edges incident to wq which finish in pi /p0j -type vertices (for fixed i = 1, 2 and j = 1, 2), and COMMENSURABILITY OF RAAGS 21 q q let Xij be the sum of the l-labels of these edges at the pi /p0j -type ends; we let Xij = 0 if there are no such edges. It follows from Lemma 3.13 that for all q = 1, . . . , Q we have q q q q X11 + X12 = |FH,wj : PH,wj | = X21 + X22 . (15) Now sum up the equalities of the form (14) for all pi /p0j -type vertices v (for fixed i = 1, 2 and j = 1, 2), and group the summands with the vertex label corresponding to the same c/c0 -type vertex together. We obtain (16) m1 Q X q = n1 L(wq )X11 (17) m1 q L(wq )X12 = n2 q=1 (18) m2 Q X m2 Q X Q X q L0 (wq )X12 , q=1 q L(wq )X21 = n1 q=1 (19) q , L0 (wq )X11 q=1 q=1 Q X Q X Q X q L0 (wq )X21 , q=1 q L(wq )X22 = n2 q=1 Q X q L0 (wq )X22 . q=1 Summing (16) and (17) and using that n1 ≤ n2 , we get (20) m1 Q X q q L(wj )(X11 +X12 ) = n1 q=1 Q X q L0 (wq )X11 +n2 q=1 Q X q L0 (wq )X12 ≥ n1 q=1 Q X q q L0 (wq )(X11 +X12 ). q=1 Analogously, summing (19) and (18) and using that n1 ≤ n2 , we get (21) m2 Q X q q L(wq )(X21 +X22 ) q=1 = n1 Q X 0 L q (wq )X21 +n2 q=1 Q X 0 L q (wq )X22 ≤ n2 q=1 Q X q q L0 (wq )(X21 +X22 ). q=1 Multiplying (20) by m2 and (21) by m1 and using (15), we obtain m 2 n1 Q X q q L0 (wq )(X11 + X12 ) ≤ m2 m1 q=1 Q X q q L(wq )(X11 + X12 ) q=1 = m1 m2 Q X q q L(wq )(X21 + X22 ) ≤ m 1 n2 q=1 = m 1 n2 Q X Q X q q L0 (wq )(X21 + X22 ) q=1 q q L0 (wq )(X11 + X12 ). q=1 q q Since L0 (wq ) > 0 by definition and X11 + X12 > 0 by (15) for every q = 1, . . . , Q, it follows that n2 m2 m2 n1 ≤ m1 n2 , or m1 ≤ n1 . Note that we can apply the same argument with the roles of G and G0 interchanged, and thus get n2 m2 m2 n2 m1 m2 n1 ≤ m1 . This means that m1 = n1 , so n1 = n2 , as desired. 22 M. CASALS-RUIZ, I. KAZACHKOV, AND A. ZAKHAROV Case 2. Now suppose that Ψ(H) has only vertices of type p1 /c0 , p2 /c0 , c/p01 and c/p02 . Let v be a c/p0j -type vertex of Ψ(H), where j = 1 or j = 2. Then all vertices adjacent to v are of type p1 /c0 or p2 /c0 . Let f1 , . . . , fS be all edges incident to v, and let fs connect v with vs for s = 1, . . . , S (possibly some of the vertices vs coincide). Then, by Lemma 3.18, in the notations of which we have t = 2, t0 = nj + 1, r = 2, r0 = 1, we obtain (22) S X L(vs )lv0 (fs ) = 2nj s=1 S X L0 (vs )lv0 (fs ). s=1 Let w1 , . . . , wQ be all the p1 /c0 -type and p2 /c0 -type vertices of Ψ(H). For every vertex wq , q = 1, . . . , Q, consider all the edges incident to wq which finish in c/p01 -type vertices (note that such edges always exist), and let Z1q > 0 be the sum of the l0 -labels of these edges at the c/p01 -type ends. Analogously, consider all the edges incident to wq which finish in c/p02 -type vertices (note that such edges should always exist), and let Z2q > 0 be the sum of the l0 -labels of these edges at the c/p02 -type ends. Let wq0 = ϕ∗ (wq ) for q = 1, . . . , Q. Then it follows from Lemma 3.13 that for every q = 1, . . . , Q we have (23) |FH 0 ,wq0 : PH 0 ,wq0 | = Z1q = Z2q . Now sum up the equalities of the form (22) for all c/p01 -type vertices v, and group the summands with the vertex label corresponding to the same pi /c0 -type vertex together. We obtain (24) Q X L(wq )Z1q = 2n1 q=1 Q X L0 (wq )Z1q . q=1 Analogously, summing the equalities of the form (22) for all c/p02 -type vertices v we get (25) Q X q=1 L(wq )Z2q = 2n2 Q X L0 (wq )Z2q . q=1 Together with (23), equalities (24) and (25) imply that n1 = n2 . Note that we can apply the same argument with the roles of G and G0 interchanged, and thus get m2 1 m1 = m2 . It follows that, in particular, m n1 = n2 . This proves Theorem 3.20.  3.5. Criterion for non-commensurability of RAAGs defined by trees of diameter 4. We now prove the main non-commensurability result of this paper. Theorem 3.21. Let T = T ((m1 , 1), . . . , (mk , 1); 0) and T 0 = T ((n1 , 1), . . . , (nl , 1); 0) for some k, l ≥ 2. Suppose G = G(T ) and G0 = G(T 0 ) are commensurable. Then M (T ) and M (T 0 ) are commensurable, i.e., k = l, and n1 n2 nk (26) = = ... = . m1 m2 mk Moreover, if S = T ((m, 2); 0) for some m ≥ 2, then G(S) and G(T 0 ) are not commensurable. COMMENSURABILITY OF RAAGS 23 Proof of Theorem 3.21. We first prove the first claim. Let c be the central vertex of T and c0 be the central vertex of T 0 . Let p1 = p1,1 , . . . , pk = pk,1 be the pivots of T , and p01 = p01,1 , . . . , p0l = p0l,1 be the pivots of T 0 . Let H ≤ G and H 0 ≤ G0 be finite index subgroups such that H ∼ = H 0 . From Lemma 3.18 and 0 0 Lemma 3.13 applied to both ∆ = T and ∆ = T we have a system of equations on the labels of vertices and edges of Ψ(H). We will show that this system of equations does not have any solutions in the positive integers unless M (T ) and M (T 0 ) are commensurable. Below we always mean that i ranges between 1 and k, and j ranges between 1 and l, unless stated otherwise. Note that there could exist vertices of the following types in Ψ(H): c/c0 , pi /p0j , pi /c0 , c/p0j , see Definition 3.19. It also follows from Definition 3.19 that the following statements hold: • Every pi /p0j -type vertex can be connected only with c/c0 -type vertices; • Every c/c0 -type vertex can be connected only with pi /p0j -type vertices; • Every pi /c0 -type vertex can be connected only with c/p0j -type vertices; • Every c/p0j -type vertex can be connected only with pi /c0 -type vertices. Thus, there are two cases: either Ψ(H) has only pi /p0j -type and c/c0 -type vertices, or Ψ(H) has only pi /c0 -type and c/p0j -type vertices. Case 1. Suppose first Ψ(H) has only pi /p0j -type and c/c0 -type vertices. We will denote pi /p0j -type vertices as i/j-type vertices for short. Let v be an i/j-type vertex of Ψ(H). Then all vertices adjacent to v are of type c/c0 . Let f1 , . . . , fN be all edges incident to v, and let fs connect v with vs for s = 1, . . . , S (possibly some of the vertices vs coincide). Then, by Lemma 3.18, in the notations of which we have t = mi + 1, t0 = nj + 1, r = 1, r0 = 1, we obtain (27) mi S X L(vs )lv (fs ) = nj s=1 (28) mi S X s=1 S X L0 (vs )lv (fs ), s=1 L(vs )lv0 (fs ) = nj S X L0 (vs )lv0 (fs ). s=1 Now suppose that w1 , . . . , wQ are all c/c0 -type vertices of Ψ(H). For every vertex wq , q = 1, . . . , Q, q consider all the edges incident to wq which finish in i/j-type vertices (for fixed i and j), and let Xij q be the sum of the l-labels of these edges at the i/j-type ends, and let Yij be the sum of the l0 -labels q of these edges at the i/j-type ends; we let Xij = Yijq = 0 if there are no such edges. It follows from Lemma 3.13 that for all q = 1, . . . , Q we have q q |FH,wq : PH,wq | = Xi1 + Xi2 + . . . + Xilq for every i, so (29) q q q q q q q q q X11 + X12 + . . . + X1l = X21 + X22 + . . . + X2l = . . . = Xk1 + Xk2 + . . . + Xkl . 24 M. CASALS-RUIZ, I. KAZACHKOV, AND A. ZAKHAROV Analogously, for all q = 1, . . . , Q if we denote wq0 = π∗ (wq ), then q q q |FH 0 ,wq0 : PH 0 ,wq0 | = Y1j + Y2j + . . . + Ykj for every j, so (30) q q q q q q + . . . + Yk2 = . . . = Y1lq + Y2lq + . . . + Yklq . + Y22 + . . . + Yk1 = Y12 + Y21 Y11 Now sum up the equalities of the form (27) for all i/j-type vertices v (for fixed i and j) and group the summands with the vertex label corresponding to the same c/c0 -type vertex together. We obtain Q X mi q L(wq )Xij = nj q=1 Q X q L0 (wq )Xij q=1 for all possible i and j. Denote (31) xij = Q X q L(wq )Xij , x0ij = Q X q L0 (wq )Xij . q=1 q=1 Then we get mi xij = nj x0ij (32) for all possible i and j. Analogously, sum up the equalities of the form (28) for all i/j-type vertices v (for fixed i and j) and group the summands with the vertex label corresponding to the same c/c0 -type vertex together. We obtain mi Q X L(wq )Yijq = nj q=1 Q X L0 (wq )Yijq q=1 for all possible i and j. Denote (33) yij = Q X L(wq )Yijq , 0 yij = q=1 Q X L0 (wq )Yijq . q=1 Then we get 0 mi yij = nj yij (34) for all possible i and j. From (29) and (31) we get (35) x11 + x12 + . . . + x1l = x21 + x22 + . . . + x2l = . . . = xk1 + xk2 + . . . + xkl , (36) x011 + x012 + . . . + x01l = x021 + x022 + . . . + x02l = . . . = x0k1 + x0k2 + . . . + x0kl , COMMENSURABILITY OF RAAGS 25 for all possible i and j. Summing the equalities (32) with the same i we get the following system of equations  0 0 0  m1 (x11 + x12 + . . . + x1l ) = n1 x11 + n2 x12 + . . . + nl x1l    m2 (x21 + x22 + . . . + x2l ) = n1 x021 + n2 x022 + . . . + nl x02l  (37) ···    mk−1 (xk−1,1 + xk−1,2 + . . . + xk−1,l ) = n1 x0k−1,1 + n2 x0k−1,2 + . . . + nl x0k−1,l    m (x + x + . . . + x ) = n x0 + n x0 + . . . + n x0 k k1 k2 kl 1 k1 2 k2 l kl Analogously, from (30) and (33) we get (38) y11 + y21 + . . . + yk1 = y12 + y22 + . . . + yk2 = . . . = y1l + y2l + . . . + ykl , (39) 0 0 0 0 0 0 0 0 0 y11 + y21 + . . . + yk1 = y12 + y22 + . . . + yk2 = . . . = y1l + y2l + . . . + ykl , for all possible i and j. Summing the equalities (34) with the same j we get the following system of equations  0 0 0  m1 y11 + m2 y21 + . . . + mk yk1 = n1 (y11 + y21 + . . . + yk1 )    0 0 0   m y + m y + . . . + m y = n (y + y + . . . + y ) 2 22 k k2 2 12 22  1 12 k2 (40) ···   0 0 0  m1 y1,l−1 + m2 y2,l−1 + . . . + mk yk,l−1 = nl−1 (y1,l−1 + y2,l−1 + . . . + yk,l−1 )    m y + m y + . . . + m y = n (y 0 + y 0 + . . . + y 0 ) 1 1l 2 2l k kl l−1 1l 2l kl Let A = (aij ) be the matrix with k rows and l columns, such that aij = 1 if there are i/j-type vertices in Ψ(H) and aij = 0 otherwise. Note that for every q = 1, . . . , Q we have L(wq ) > 0, L0 (wq ) > 0, q and Xij = 0 if and only if Yijq = 0, if and only if there are no vertices of type i/j adjacent to wq . Obviously every vertex of type i/j of Ψ(H) should be adjacent to at least one c/c0 -type vertex, i.e. to at least one of w1 , . . . , wQ . This means that xij ≥ 0, x0ij ≥ 0, and xij = 0 if and only if x0ij = 0, q if and only if Xij = 0 for all q = 1, . . . , Q, if and only if there are no vertices of type i/j in Ψ(H), 0 0 if and only if aij = 0. Analogously yij ≥ 0, yij ≥ 0, and yij = 0 if and only if yij = 0, if and only if q Yij = 0 for all q = 1, . . . , Q, if and only if there are no vertices of type i/j in Ψ(H), if and only if aij = 0. Note also that for every i there should exist some j such that there are i/j-type vertices in Ψ(H). Analogously, for every j there should exist some i such that i/j-type vertices exist in Ψ(H). This means that the matrix A does not have zero rows or columns. Combining (35), (36), (37), (38), (39), (40), we have the following equations and conditions on 0 xij , x0ij , yij , yij , aij :  m1 (x11 + x12 + . . . + x1l ) = n1 x011 + n2 x012 + . . . + nl x01l      m2 (x21 + x22 + . . . + x2l ) = n1 x021 + n2 x022 + . . . + nl x02l      ···  (41) mk−1 (xk−1,1 + xk−1,2 + . . . + xk−1,l ) = n1 x0k−1,1 + n2 x0k−1,2 + . . . + nl x0k−1,l    mk (xk1 + xk2 + . . . + xkl ) = n1 x0k1 + n2 x0k2 + . . . + nl x0kl      x11 + x12 + . . . + x1l = x21 + x22 + . . . + x2l = . . . = xk1 + xk2 + . . . + xkl    0 x11 + x012 + . . . + x01l = x021 + x022 + . . . + x02l = . . . = x0k1 + x0k2 + . . . + x0kl 26 (42) (43) (44) M. CASALS-RUIZ, I. KAZACHKOV, AND A. ZAKHAROV  0 0 0 m1 y11 + m2 y21 + . . . + mk yk1 = n1 (y11 + y21 + . . . + yk1 )     0 0 0  m y + m y + . . . + m y = n (y + y + . . . + y 1 12 2 22 k k2 2 12  22 k2 )     ···  0 0 0 m1 y1,l−1 + m2 y2,l−1 + . . . + mk yk,l−1 = nl−1 (y1,l−1 + y2,l−1 + . . . + yk,l−1 )   0 0 0 m1 y1l + m2 y2l + . . . + mk ykl = nl (y + y + . . . + y )  1l 2l kl     y + y + . . . + y = y + y + . . . + y = . . . = y1l + y2l + . . . + ykl  11 21 k1 12 22 k2   0 0 0 0 0 0 0 0 0 y11 + y21 + . . . + yk1 = y12 + y22 + . . . + yk2 = . . . = y1l + y2l + . . . + ykl 0 xij = 0 ⇔ x0ij = 0 ⇔ yij = 0 ⇔ yij = 0 ⇔ aij = 0, 0 ∀i ∀j xij , x0ij , yij , yij ≥ 0, ∀i ∃j : xij > 0, i = 1, . . . , k, j = 1, . . . l ∀j ∃i : xij > 0, i = 1, . . . , k, j = 1, . . . l. Without loss of generality, we can assume that k ≥ l. By [α] we denote the (lower) integer part of α, so [l/2] = l/2 if l is even, and [l/2] = (l − 1)/2 if l is odd. Claim. In the above notation, aij = ak+1−i,l+1−j = 0 if i ≤ [l/2] or j ≤ [l/2], provided i 6= j. Proof. We prove this claim by induction on dij , where dij = min (i, j). Thus we are interested in the case when 1 ≤ dij ≤ [l/2]. The base of induction is the case when dij = 1, so either i = 1, or j = 1. This case is included in the inductive step below, with r = 1. Suppose the claim is proved for d(i, j) ≤ r − 1, where 1 ≤ r ≤ [l/2], and we want to prove it for d(i, j) = r. We have aij = 0 if i ≤ r − 1 or j ≤ r − 1, provided i 6= j, and aij = 0 if i ≥ k − r + 2 or j ≥ l − r + 2, provided k − i 6= l − j (in the case r = 1 there are no conditions). By (43), this means that the r-th equation of (41) has the following form (45) mr (xrr + xr,r+1 + . . . + xr,l+1−r ) = nr x0rr + nr+1 x0r,r+1 + . . . + nl+1−r x0r,l+1−r , and the (k + 1 − r)-th equation of (41) has the following form (46) mk+1−r (xk+1−r,r + xk+1−r,r+1 + . . . + xk+1−r,l+1−r ) = = nr x0k+1−r,r + nr+1 x0k+1−r,r+1 + . . . + nl+1−r x0k+1−r,l+1−r . Also from the last two lines of equations of (41) we obtain (47) xrr + xr,r+1 + . . . + xr,l+1−r = xk+1−r,r + xk+1−r,r+1 + . . . + xk+1−r,l+1−r , (48) x0rr + x0r,r+1 + . . . + x0r,l+1−r = x0k+1−r,r + x0k+1−r,r+1 + . . . + x0k+1−r,l+1−r . Since nr < nr+1 < . . . < nl+1−r , (45) implies (49) mr (xrr + xr,r+1 + . . . + xr,l+1−r ) ≥ nr (x0rr + x0r,r+1 + . . . + x0r,l+1−r ) and equality in (49) is obtained if and only if x0r,r+1 = x0r,r+2 = . . . = x0r,l+1−r = 0. Also (46) implies (50) mk+1−r (xk+1−r,r + xk+1−r,r+1 + . . . + xk+1−r,l+1−r ) ≤ ≤ nl+1−r (x0k+1−r,r + x0k+1−r,r+1 + . . . + x0k+1−r,l+1−r ), COMMENSURABILITY OF RAAGS 27 and equality in (50) is obtained if and only if x0k+1−r,r = x0k+1−r,r+1 = . . . = x0k+1−r,l−r = 0. Multiplying (49) by mk+1−r , (50) by mr and using (47), (48), we obtain (51) mk+1−r nr (x0rr + x0r,r+1 + . . . + x0r,l+1−r ) ≤ mk+1−r mr (xrr + xr,r+1 + . . . + xr,l+1−r ) = = mr mk+1−r (xk+1−r,r + xk+1−r,r+1 + . . . + xk+1−r,l+1−r ) ≤ ≤ mr nl+1−r (x0k+1−r,r + x0k+1−r,r+1 + . . . + x0k+1−r,l+1−r ) = = mr nl+1−r (x0rr + x0r,r+1 + . . . + x0r,l+1−r ). Note that by (43), (44) we have x0rr + x0r,r+1 + . . . + x0r,l+1−r 6= 0 (since otherwise the r-th row of A is zero, which is impossible). So (51) implies mk+1−r nr ≤ mr nl+1−r . (52) Now apply analogous arguments to (42). By induction hypothesis the r-th equation of (42) has the following form (53) 0 0 0 mr yrr + mr+1 yr+1,r + . . . + mk+1−r yk+1−r,r = nr (yrr + yr+1,r + . . . + yk+r−1,r ), and the (l + 1 − r)-th equation of (42) has the following form (54) mr yr,l+1−r + mr+1 yr+1,l+1−r + . . . + mk+1−r yk+1−r,l+1−r = 0 0 0 = nl+1−r (yr,l+1−r + yr+1,l+1−r + . . . + yk+r−1,l+1−r ). Also from the last two lines of equations (42) we obtain (55) yrr + yr+1,r + . . . + yk+1−r,r = yr,l+1−r + yr+1,l+1−r + . . . + yk+1−r,l+1−r , (56) 0 0 0 0 0 0 yrr + yr+1,r + . . . + yk+1−r,r = yr,l+1−r + yr+1,l+1−r + . . . + yk+1−r,l+1−r . Since mr < mr+1 < . . . < mk+1−r , (53) implies (57) 0 0 0 mr (yrr + yr+1,r + . . . + yk+1−r,r ) ≤ nr (yrr + yr+1,r + . . . + yk+r−1,r ), and equality in (57) is obtained if and only if yr+1,r = yr+2,r = . . . = yk+1−r,r = 0. Also (54) implies (58) mk+1−r (yr,l+1−r + yr+1,l+1−r + . . . + yk+1−r,l+1−r ) ≥ 0 0 0 ≥ nl+1−r (yr,l+1−r + yr+1,l+1−r + . . . + yk+r−1,l+1−r ), and equality in (58) is attained if and only if yr,l+1−r = yr+1,l+1−r = . . . = yk−r,l+1−r = 0. Multiplying (57) by nl+1−r , (58) by nr and using (55), (56), we obtain 0 0 0 (59) nl+1−r mr (yrr + yr+1,r + . . . + yk+1−r,r ) ≤ nl+1−r nr (yrr + yr+1,r + . . . + yk+r−1,r )= 0 0 0 = nr nl+1−r (yr,l+1−r + yr+1,l+1−r + . . . + yk+r−1,l+1−r )≤ ≤ nr mk+1−r (yr,l+1−r + yr+1,l+1−r + . . . + yk+1−r,l+1−r ) = = nr mk+1−r (yrr + yr+1,r + . . . + yk+1−r,r ). Note that by (43), (44) we have yrr + yr+1,r + . . . + yk+1−r,r 6= 0 (since otherwise the r-th column of A is zero, which is impossible). So (59) implies nl+1−r mr ≤ nr mk+1−r . 28 M. CASALS-RUIZ, I. KAZACHKOV, AND A. ZAKHAROV Combined with (52), this gives (60) mk+1−r nr = mr nl+1−r , so all the inequalities in (51), (59), and then also in (49), (50), (57), (58), turn into equalities. As mentioned above, this means that x0r,r+1 = x0r,r+2 = . . . = x0r,l+1−r = 0, x0k+1−r,r = x0k+1−r,r+1 = . . . = x0k+1−r,l−r = 0, so by (43) we have ar,r+1 = ar,r+2 = . . . = ar,l+1−r = 0, ak+1−r,r = ak+1−r,r+1 = . . . = ak+1−r,l−r = 0, yr+1,r = yr+2,r = . . . = yk+1−r,r = 0, yr,l+1−r = yr+1,l+1−r = . . . = yk−r,l+1−r = 0, and so by (43) we have ar+1,r = ar+2,r = . . . = ak+1−r,r = 0, ar,l+1−r = ar+1,l+1−r = . . . = ak−r,l+1−r = 0. Combined with the induction hypothesis, this proves that aij = ak+1−i,l+1−j = 0 if i ≤ r or j ≤ r, provided i 6= j. This proves the claim.  Thus we have proved that (61) aij = ak+1−i,l+1−j = 0, if i ≤ [l/2] or j ≤ [l/2], provided i 6= j. Claim. In the above notation, one has k = l. Proof. Suppose, on the contrary, that k > l. Suppose first l is even. Then we have from (61) that aij = 0 if j ≤ l/2 and i 6= j, and aij = 0 if j ≥ l/2 + 1 and k − i 6= l − j. In particular, taking i = l/2 + 1, we get that al/2+1,j = 0 for j ≤ l/2 (since for these pairs i 6= j), and al/2+1,j = 0 for j ≥ l/2 + 1 (since for these pairs k − i = k − l/2 − 1 > l/2 − 1 ≥ l − j), so A has a zero row, a contradiction. So l is odd. Then it follows from (61) that aij = 0 if j ≤ (l − 1)/2 and i 6= j, and aij = 0 if j ≥ (l + 3)/2 and k − i 6= l − j. In particular, a(l+1)/2,j = a(l+3)/2,j = 0 when j 6= (l + 1)/2. Denote (l + 1)/2 = b, then (l + 3)/2 = b + 1. Due to (43), this means that among the equations (41) we have the following:  mb xbb = nb x0bb ,    m x 0 b+1 b+1,b = nb xb+1,b ,  xbb = xb+1,b ,    0 xbb = x0b+1,b . This immediately implies mb = mb+1 , a contradiction. This shows that k = l.  It follows from (61) that aij = 0 if i 6= j. Then A is the identity matrix, since it does not have zero rows or columns, so, according to (43), (44), we have xij = x0ij = 0 if i = 6 j, and xii > 0 for all COMMENSURABILITY OF RAAGS 29 i = 1, . . . , k, therefore (41) turns into  m1 x11 = n1 x011      m2 x22 = n2 x022     ··· 0  m x k kk = nk xkk     x11 = x22 = . . . = xkk    0 x11 = x022 = . . . = x0kk , which immediately implies (26). This finishes Case 1. Case 2. Now suppose that Ψ(H) has only pi /c0 -type and c/p0j -type vertices, i = 1, . . . , k, j = 1, . . . , l. The proof in this case is almost the same as the proof of Case 2 in Theorem 3.20. Let v be a c/p0j -type vertex of Ψ(H), j = 1, . . . , l. Then all vertices adjacent to v are of types pi /c0 , i = 1, . . . , k. Let f1 , . . . fS be all edges incident to v, and let fs connect v with vs for s = 1, . . . , S (possibly some of the vertices vs coincide). Then, by Lemma 3.18, in the notations of which we have t = k, t0 = nj + 1, r = k, r0 = 1, we obtain (62) S X L(vs )lv0 (fs ) = s=1 S X k nj L0 (vs )lv0 (fs ). k−1 s=1 Now suppose that w1 , . . . , wQ are all pi /c0 -type vertices of Ψ(H), for all i = 1, . . . , k. For every vertex wq , q = 1, . . . , Q and j = 1, 2, consider all the edges incident to wq which finish in c/p0j -type vertices (note that such edges should always exist), and let Zjq be the sum of the l0 -labels of these edges at the c/p0j -type ends. Then we have Zjq > 0 for every q = 1, . . . , Q and j = 1, 2. Let wq0 = ϕ∗ (wq ) for q = 1, . . . , Q. Then it follows from Lemma 3.13 that for every q = 1, . . . , Q we have |FH 0 ,wq0 : PH 0 ,wq0 | = Z1q = Z2q . (63) Now sum up the equalities of the form (62) for all c/p01 -type vertices v, and group the summands with the vertex label corresponding to the same pi /c0 -type vertex together. We obtain (64) Q X L(wq )Z1q = q=1 Q X k n1 L0 (wq )Z1q . k−1 q=1 Analogously, summing the equalities of the form (62) for all c/p02 -type vertices v we get (65) Q X q=1 L(wq )Z2q = Q X k n2 L0 (wq )Z2q . k−1 q=1 Together with (63), equalities (64) and (65) imply that n1 = n2 , a contradiction. This finishes the proof of the first claim of the theorem. The proof of the second claim is similar, but easier. Indeed, let m1 = m2 = m, k = 2, and apply the arguments as in the proof of the first claim above. In Case 1, the above argument shows that (60) still holds with r = 1, so m2 n1 = m1 nl , but m1 = m2 , so n1 = nl , a contradiction. The proof of Case 2 is the same as above. 30 M. CASALS-RUIZ, I. KAZACHKOV, AND A. ZAKHAROV This proves Theorem 3.21.  4. Characterisation of commensurability classes of RAAGs defined by trees of diameter 4 We now turn to prove commensurability of some RAAGs defined by trees of diameter 4. Proposition 4.1. Let G = G(T ), where T = T ((v1 , 1), . . . , (vl , 1); 0), l ≥ 2. For any k1 , . . . , kl there exist a non-negative integer q and a finite index subgroup H of G such that H ' G(S), where S is a tree of diameter 4 of the form S = T ((v1 , k1 ), . . . , (vl , kl ); q). In particular, G(S) and G(T ) are commensurable. If G = G(T ), where T = T ((d, 2); 0), then for any k > 2 there exists a finite index subgroup H of G such that H ' G(S), where S = T ((d, k); 0). Proof. We first consider the case when l = 1, i.e. T = T ((d, 2); 0). Let p1 , p2 be the pivots of T . Let φ be the epimorphism G → Zk , induced by the map p1 7→ 1 and x 7→ 0, where x is any canonical generator of G different from p1 . It is not hard to see that ker φ is isomorphic to G(S), see [KK13, BN08]. Suppose now l ≥ 2. Denote the only pivot of valency vi in T by pi , i = 1, . . . , l, and the central vertex of T by c. Let V (T ) = X. Let F (X) be the free group with basis X. Then there is a natural epimorphism φ : F (X) → G. Fix k1 , . . . , kl and without loss of generality assume that k1 ≤ k2 ≤ · · · ≤ kl . We can always suppose that kl > 1, since otherwise k1 = k2 = . . . = kl = 1, and the claim is obvious. Let xi,1 , . . . , xi,vi be all leaves of T adjacent to the pivot pi , i = 1, . . . , l. Consider the finite index subgroup G < F (X) defined as the subgroup corresponding to the finite cover of the bouquet of |X| circles K defined as follows. Below by (a1 , . . . , akl ) we mean a simple cycle of length kl , with vertices appearing in the order a1 , . . . , akl , a1 , and analogously with other cycles. We take two cycles: the first one of the form (a1 , . . . , akl ), of length kl , with all edges labelled by p1 ; and the second one of the form (b1 , . . . , bk1 ), of length k1 , with all edges labelled by pl ; we identify these cycles by a vertex, a1 = b1 . This vertex is the basepoint of the based cover we construct. The degree of the finite cover of the bouquet of |X| circles we construct is k1 + kl − 1, so no new vertices will be added, only edges. We first complete the constructed graph to a cover of the free group F (p1 , pl ), by adding loops labelled by p1 at vertices b2 , . . . , bk1 (no loops are added if k1 = 1), and adding loops labelled by pl at vertices a2 , . . . , akl . If l = 2, then we are done with the construction of the cover. If l > 2, we consider two cases. In the first case we suppose that k2 = 1, so for some 2 ≤ j < l we have 1 = k1 = k2 = · · · = kj < kj+1 ≤ kj+2 ≤ · · · ≤ kl . In the second case we assume that k2 > 1. In the first case, for every i = 2, . . . , j, we add a cycle (a1 , . . . , akl ) labelled by pi . For every i = j + 1, . . . , l−1, we add loops labelled by pi to vertices a1 , . . . , aki −1 , and add a cycle (aki , aki +1 , . . . , akl ), of length kl − ki + 1, with all edges labelled by pi , see Figure 3. Adding loops labelled by the generators from X \ {p1 , . . . , pl } at all vertices of the graph we obtain a finite cover of the bouquet of |X| circles and hence this defines a finite index subgroup G of F (X). COMMENSURABILITY OF RAAGS 31 ... Figure 3. Constructing the cover, case 1 ... ... Figure 4. Constructing the cover, case 2 In the second case, for every i = 2, . . . , l − 1, we do the following. First add a cycle (b1 , . . . , bk1 ) with all edges labelled by pi . Then add loops labelled by pi to vertices a2 , . . . , aki −1 . Finally, add a cycle (aki , aki +1 , . . . , akl ), of length kl − ki + 1, labelled by pi , see Figure 4. Adding loops labelled by the generators X \ {p1 , . . . , pl } at all vertices of the graph we obtain a finite cover of the bouquet of |X| circles and hence this defines a finite index subgroup G of F (X). We continue under the assumptions of the second case. Proof in the first case is analogous. Note that G has index k1 + kl − 1 in F (X) by construction. We have epimorphisms φ : F (X) → G and ψ : G → F (p1 , . . . , pl ), where F (p1 , . . . , pl ) is the free group with the basis p1 , . . . , pl . By construction, the image of ψ(φ(G)) has index k1 + kl − 1 in F (p1 , . . . , pl ). Hence, [F (X) : G] ≥ [G : φ(G)] ≥ [F (p1 , . . . , pl ) : ψ(φ(G))], and it follows that H = φ(G) has index k1 + kl − 1 in G. Choosing the maximal subtree spanned by the edges {(ai , ai+1 ), i = 1, . . . , kl − 1}, labelled by pl , and {(bj , bj+1 ) | j = 1, . . . , k1 − 1}, labelled by p1 , and using Nielsen transformations, it is not difficult to see that G has a free basis which consists of the following generators, where the elements in A form a free basis of G ∩ F (p1 , . . . , pl ): 32 M. CASALS-RUIZ, I. KAZACHKOV, AND A. ZAKHAROV A: j −1 (p1i • {pki 1 , pi ) pk1 i −1  | ji = 2, . . . , ki − 1, i = 2, . . . , l − 1}; , pki l −ki +1 j1 −1 ) • {pk1l , p1 (pl j −1 (p1l ) • {pkl 1 , pl | j1 = 2, . . . , k1 }; | jl = 2, . . . , kl }. • q other generators h1 , . . . , hq which are words in p1 , . . . , pl , each of them containing at least two of p1 , . . . , pl . pr 1 B: {xi,m | r = 0, . . . , kl − 1}, i = 1, . . . , l, mi = 1, . . . , vi ; i ps l {xi,m | s = 1, . . . , k1 − 1}, i = 1, . . . , l, mi = 1, . . . , vi . i r s C: {cp1 | r = 0, . . . , kl − 1}, {cpl | s = 1, . . . , k1 − 1}. Here q = (k1 + kl − 1)(l − 1) + 1 − (k1 + . . . + kl ). Indeed, this can be seen by direct calculations or by applying Schreier formula: G ∩ F (p1 , . . . , pl ) is a subgroup of index k1 + kl − 1 in the free group F (p1 , . . . , pl ) of rank l, so by Schreier formula rk(G ∩ F (p1 , . . . , pl )) = (k1 + kl − 1)(l − 1) + 1, and there are k1 + . . . + kl generators in A of the first three types, so the above formula for q follows. Thus H is a finite index subgroup of G, and H is generated by the set φ(A) ∪ φ(B) ∪ φ(C). Note that in G all elements of C become equal to c, so φ(C) consists just of one generator c. We now show that H ' G(S), where S = T ((v1 , k1 ), . . . , (vl , kl ); q). Note that the group G splits as a fundamental group of a star of groups: G = π1 (B), with l leaves, with vertex groups at leaves equal to Bi = hc, pi , xi,1 , . . . , xi,vi i, i = 1, . . . , l, and vertex group at the center vertex equal to Bc = hc, p1 , . . . , pl i. The edge groups are Ei = hc, pi i, i = 1, . . . , l. This is the reduced centralizer splitting of G. Let T be the Bass-Serre tree corresponding to this splitting of G. Recall that by Bass-Serre theory vertices of T correspond to left cosets by the vertex groups of B, and edges of T correspond to left cosets by the edge groups of B. Consider the finite subgraph Y0 of the tree T, which consists of the vertex Bc and the incident edges pj1i Ei going to the vertices pj1i Bi , ji = 0, . . . , ki − 1, i = 2, . . . , l, and edges pjl 1 E1 going to the vertices pjl 1 B1 , j1 = 0, . . . , k1 − 1, together with these vertices. Note that all these vertices are indeed different. Thus Y0 as a graph is a star with k1 + · · · + kl leaves. We claim that Y0 is the fundamental domain under the action of H on T, i.e., Y0 contains exactly one representative of each vertex and edge orbit under the action of H on T. First we show that Y0 cannot contain two vertices or edges in the same orbit under the action of H. It suffices to show this for vertices of Y0 . Note that Bc is not in the same H-orbit with any other vertex of Y0 , since it is not even in the same G-orbit. Suppose that u = pj1i Bi is in the same j0 H-orbit with some other vertex v of Y0 , then v can only be of the form v = p1i Bi , where ji0 6= ji ; here ji , ji0 = 0, . . . , ki − 1, i = 2, . . . , l. Then there exists some d ∈ Bi = hc, pi , xi,1 , . . . , xi,vi i such that j0 Hpj1i d = Hp1i . If ji < ki − 1, then from the definition of H, see Figure 4, we have that Hpj1i Bi = Hpj1i , j0 j 0 −ji and it follows that Hp1i = Hpj1i , so p1i ∈ H, which is a contradiction by definition of H. COMMENSURABILITY OF RAAGS 33 If ji = ki − 1, then ji0 < ki − 1, and we get a contradiction in the same way as above. In the same way we can prove that the vertex pjl 1 B1 , j1 = 0, . . . , k1 − 1, is not in the same H-orbit with some other vertex in Y0 . Thus indeed Y0 does not contain two vertices or edges in the same orbit under the action of H. Now we show that Y0 contains at least one representative of each orbit, and so Y0 is a fundamental domain. Note that it suffices to show that every edge of T which is incident to some edge in Y0 can be taken to some edge in Y0 by an element of H. Let e be some edge of T incident to the vertex Bc , then by Bass-Serre theory e = gEi , where g ∈ Bc , and we can suppose g does not contain c, so g = g(p1 , . . . , pl ). Suppose i > 1, the case i = 1 is analogous. By definition of H, see Figure 4, t Q = {ps1 , s = 0, . . . , ki − 1; pk1i −1 pm i , m = 1, . . . , kl − ki ; pl , t = 1, . . . k1 − 1} is the set of coset representatives of H in G, so g = hq for some q ∈ Q, and e = gEi is in the same H-orbit as qEi . Since pi ∈ Ei , by definition of Y0 the edge qEi is in Y0 , and so we are done. Now, if f is some edge of T incident to the vertex pj1i Bi , ji = 0, . . . , ki − 1, i = 2, . . . , l, then by Bass-Serre theory f = gEi , where g = pj1i b, b ∈ Bi , so f = pj1i bEi , and we can suppose b does not contain pi , so b = w(c, xi,1 , . . . , xi,vi ). Then, by definition of H, pj1i b(pj1i )−1 = h ∈ H, so f = pj1i bEi = hpj1i Ei is in the same H-orbit as pj1i Ei , which is in Y0 by definition. The case when f is some edge of T incident to the vertex pjl 1 B1 , j1 = 0, . . . , k1 − 1 is analogous. ∼ π1 (Y) be the This proves that Y0 is the fundamental domain under the action of H on T. Let H = induced splitting of H as a fundamental group of a graph of groups, corresponding to the induced action of H on T. Let Y be the underlying graph of Y. Let π : T → Y be the natural projection morphism. It follows that the morphism π restricted to Y0 induces an isomorphism of graphs πY0 : Y0 → Y , and the vertex group at π(v) is equal to the stabilizer of the vertex v for every vertex v of Y0 . This means that Y is a star with k1 + · · · + kl leaves, u1,1 , . . . , u1,k1 ; . . . ; ul,1 , . . . , ul,kl and the center vertex z. The vertex group at z is H ∩ hc, p1 , . . . , pl i = hgenerators of type A, ci. The vertex groups Gui,ji at leaves ui,ji are the following:  j ji (p1i )  G = H ∩ hc, pi , xi,1 , . . . , xi,vi ip1 , ui,ji = H ∩ Bi j1 j1 (pl )  G = H ∩ hc, p1 , x1,1 , . . . , x1,v1 ipl , u1,j1 = H ∩ B1 ji = 0, . . . , ki − 1, i = 2, . . . , l; j1 = 0, . . . , k1 − 1. The edge groups of Y are the corresponding intersections of vertex groups. Since c ∈ H it follows that the vertex groups are direct products of a free group and the infinite cyclic group. Moreover, since, by construction, conjugates of xi,1 , . . . , xi,vi −1 belong to H, it follows that every edge group of Y is the direct product of the cyclic group generated by c and a subgroup of hp1 , . . . , pl i. Let S = T ((v1 , k1 ), . . . , (vl , kl ); q), where q is as above. Let pi,1 , . . . , pi,ki be the pivots of T of valency vi + 1, i = 1, . . . , l. Let xi,ji ,1 , . . . , xi,ji ,vi be all leaves of S which are adjacent to the pivot pi,ji , for ji = 1, . . . , ki , i = 1, . . . , l. Denote the center of S by c0 , and the hairs of S by y1 , . . . , yq . 34 M. CASALS-RUIZ, I. KAZACHKOV, AND A. ZAKHAROV It follows that the following map induces an isomorphism from π1 (Y) to G(S): c 7→ c0 , hi 7→ yi , i = 1, . . . , q, pk1l 7→ p1,1 (p j1 −1 ) (p ji −1 ) p1 l 7→ p1,j1 , j1 = 2, . . . , k1 k1 pi 7→ pi,1 , i = 2, . . . , l, 7→ pi,ji , ji = 2, . . . , ki − 1, i = 2, . . . , l pi 1 pk1 i −1  kl −ki +1 7→ pi,ki , i = 2, . . . , l pi p ri 1 xi,m 7→ xi,ri +1,mi , ri = 0, . . . , ki − 1, i = 1, . . . , l, mi = 1, . . . , vi i psl x1,m1 7→ x1,s+1,m1 , s = 0, . . . , k1 − 1, m1 = 1, . . . , v1 . In other words, this means that π1 (Y) is the reduced centralizer splitting of G(S). We conclude that H ' G(S).  Proposition 4.2. Let T = T ((v1 , k1 ), . . . , (vl , kl ); p) and S = T ((v1 , k1 ), . . . , (vl , kl ); q) be two trees of diameter 4. Then there exists r such that G(R) is a finite index subgroup of both G(S) and G(T ), where R = T ((v1 , k1 ), . . . , (vl , kl ); r). In particular, G(S) and G(T ) are commensurable. Proof. Let K = k1 + · · · + kl . Since the group G(S) (the group G(T ) correspondingly) retracts onto the free subgroup FK+q (FK+p correspondingly) generated by pivots and hair vertices, the full preimage of a subgroup of FK+q (of FK+p correspondingly) of finite index I is an index I subgroup of G(S) (G(T ), correspondingly). We define subgroups of FK+q and FK+p via covers of bouquet of K + q and K + p circles correspondingly. The subgroup Aq of FK+q is defined as follows. Take p + K − 1 points a1 , . . . , ap+K−1 and for every pivot generator of FK+q add a cycle (a1 , . . . , ap+K−1 ) of length p + K − 1 labelled by this generator. We complete the obtained graph to a cover of FK+q by adding q loops labelled by the hair generators of FK+q at every vertex ai , i = 1, . . . , p + K − 1. The subgroup Ap of FK+p is defined in a similar fashion. We note that Aq and Ap are free subgroups of index p + K − 1 and q + K − 1 in FK+q and FK+p correspondingly, and both have rank (q + K − 1)(p + K − 1) + 1. Define the subgroups Bq < G(S) and Bp < G(T ) as the full preimages of the subgroups Aq and Ap correspondingly. Then Bq has index p + K − 1 in G(S), and Bp has index q + K − 1 in G(T ). We claim that the groups Bq and Bp are isomorphic to G(R), where R = T ((v1 , k1 ), . . . , (vl , kl ); r) for r = (q + K − 1)(p + K − 1) + 1 − K. Indeed, since Aq has rank (q + K − 1)(p + K − 1) + 1, one can see that Aq has a free basis which includes the powers of all the K pivot generators, as well as some other elements h1 , . . . , hr , for r as above, and similar for Ap . Similar to the proof of Proposition 4.1, it follows that both Bq and Bp split as fundamental groups of the star of groups with K = k1 + · · · + kl leaves, which are the induced splittings with respect to the reduced centralizer splittings of G(S) and G(T ) respectively, and that these splittings of Bq and Bp are both isomorphic to the reduced centralizer splitting of G(R). Then the claim of the lemma holds with r = (q + K − 1)(p + K − 1) + 1 − K.  COMMENSURABILITY OF RAAGS 35 Theorem 4.3. Let T = T ((m1 , k1 ), . . . , (ml , kl ); p) and S = T ((n1 , r1 ), . . . , (nl , rl ); q) be two trees mj i of diameter 4. Suppose that m ni = nj for all i, j = 1, . . . , l. Then the group G(T ) is commensurable to G(S). Proof. By Propositions 4.1 and 4.2 it suffices to prove the statement in the case when l ≥ 2, ki = rj = 1 for i, j = 1, . . . , l and p = q = 0, and in the case when l = 1, k1 = r1 = 2 and p = q = 0. m i Consider the first case, the proof in the second case is analogous. Let m ni = n . Consider the homomorphism fn : G(T ) → Zn induced by the map cT 7→ 1 and x 7→ 0, where cT is the center of the tree T and x is any other canonical generator of G(T ). Let Gn be the kernel of fn . Similarly, let fm : G(S) → Zm be the homomorphism induced by the map cS 7→ 1 and y 7→ 0, where cS is the center of the tree S and y is any other canonical generator of G(S), and let Gm be the kernel of fm . By Bass-Serre theory, it is not difficult to see that Gn ' G(T ((nm1 , 1), . . . , (nml , 1); 0)) and Gm ' G(T ((mn1 , 1), . . . , (mnl , 1); 0)). Since nmi = mni for all i = 1, . . . , l, it follows that Gn ' Gm and hence G(T ) and G(S) are commensurable.  We now turn our attention to the description of minimal elements in the commensurability classes. We first record that the RAAGs defined by paths of length 3 and 4 are commensurable. This fact is not new and was mentioned to us by T. Koberda. Proposition 4.4. G(P3 ) is commensurable with G(P4 ). Proof. Let G(P3 ) = hx, p1 , c, p2 | [x, p1 ], [p1 , c], [c, p2 ]i and let ϕ : G(P3 ) → Z/(2Z) be the homomorphism defined by the map x → 0 p1 → 0 c → 0 p2 → 1 Set H = ker ϕ. It is clear that H is an index 2 subgroup of G(P3 ). Let ϕ0 : G(P4 ) → Z/(2Z) be the homomorphism defined by the map x1 → 0 p1 → 1 c → 0 p2 → 1 x2 → 0 0 0 and let H = ker ϕ , where x1 and x2 are the leaves of P4 at the pivots p1 and p2 correspondingly. It is clear that H 0 is an index 2 subgroup of G(P4 ). Straightforward application of Reidemeister-Schreier technique shows that H = hx, p1 , c, pp12 , xp2 , p22 i and H 0 = hx1 , p21 , c, p22 , x2 , p1 p2 i are isomorphic to G(∆) = ha, b, c, d, e, f | [a, b] = 1, [b, c] = 1, [c, d] = 1, [d, e] = 1, [c, f ] = 1i.  We deduce the following results. Theorem 4.5 (Characterisation of commensurability classes). Let T and T 0 be two finite trees of diameter 4, T = T ((d1 , k1 ), . . . , (dl , kl ); q) and T 0 = T ((d01 , k10 ), . . . , (d0l0 , kl00 ); q 0 ). Let G = G(T ) and G0 = G(T 0 ). Consider the sets M = M (T ), M 0 = M (T 0 ). Then G and G0 are commensurable if and only if M and M 0 are commensurable. Proof. It is a consequence of Theorem 3.21 and Theorem 4.3.  Corollary 4.6. The groups G = G(Pm1 ,m2 ) and G0 = G(Pn1 ,n2 ) are commensurable if and only if m2 m1 n1 = n2 . 36 M. CASALS-RUIZ, I. KAZACHKOV, AND A. ZAKHAROV Theorem 4.7 (Minimal RAAG in the commensurability class). Let T = T ((d1 , k1 ), . . . , (dl , kl ); q) be a finite tree of diameter 4. Let C(T ) be the commensurability class of G(T ) and let M = M (T ) be as above, so |M | = l. Then the minimal RAAG that belongs to C(T ) is either the RAAG defined by the tree T 0 = T ((d01 , 1), . . . , (d0l , 1); 0), where M (T 0 ) is minimal in the commensurability class of M , if |M | > 1, or the RAAG defined by the path of diameter 3, that is G(P4 ), if |M | = 1. Proof. It is a consequence of Proposition 4.4 and Theorem 4.5.  References [B72] H. Bass, The degree of polynomial growth of finitely generated nilpotent groups, Proc. London Math. Soc. 3, 4 (1972), 603-614. [BJN09] J. Behrstock, T. Januszkiewicz, W. Neumann, Commensurability and QI classification of free products of finitely generated abelian groups. Proc. Am. Math. Soc. 137, 3 (2009), 811-813. [BJN10] J. Behrstock, T. Januszkiewicz, W Neumann, Quasi-isometric classification of some high dimensional right-angled Artin groups, Groups, Geom. Dynamics 4, 681-692, 2010. [BN08] J. Behrstock, W Neumann, Quasi-isometric classification of graph manifold groups. Duke Math. J. 141, 2 (2008), 217-240. [BM00] M. Burger, S. Mozes, Lattices in product of trees. Inst. Hautes tudes Sci. Publ. Math., 92 (2000), 151-194. [DJ00] M. Davis, T. Januszkiewicz, Right-angled Artin groups are commensurable with right-angled Coxeter groups, J. Pure Appl. Algebra 153, 229-235 (2000) [DW93] P. Deligne and G. D. Mostow, Commensurabilities among lattices in P U (1, n), Annals of Mathematics Studies, 132. Princeton University Press, 1993. [DK93] G. Duchamp, D. Krob, Partially Commutative Magnus Transformations, Internat. J. Algebra Comput. 3 (1993), 15-41. [EKR05] E. Esyp, I. Kazachkov and V. Remeslennikov, Divisibility Theory and Complexity of Algorithms for Free Partially Commutative Groups, 319–348, Contemp. Math., 378, Amer. Math. Soc., Providence, RI, 2005. [Ga16] A. Garrido, Abstract commensurability and the Gupta-Sidki group, Groups Geom. Dyn. 10 (2016), 523-543. [GrW03] R. Grigorchuk, J. Wilson, A structural property concerning abstract commensurability of subgroups. J. London Math. Soc. (2), 68(3):671-682, 2003. [Gr81] M. Gromov, Groups of polynomial growth and expanding maps. Inst. Hautes tudes Sci. Publ. Math., 53 (1981), 53-78. [Gr93] M. Gromov, Geometric group theory, vol. 2: Asymptotic invariants of infinite groups. Lond. Math. Soc. Lecture Notes 182, (1993), 1-295. [H16] J. Huang, Commensurability of groups quasi-isometric to RAAGs, arXiv:1603.08586v2 [KPS73] A. Karrass, A. Pietrowski, D. Solitar, Finite and infinite cyclic extensions of free groups, J. Australian Math. Soc 16, 04 (1973), 458-466. [KK13] S. Kim, T. Koberda, Embedability between right-angled Artin groups, Geom. Topol. 17 (2013), 493-530. [KK14] S. Kim, T. Koberda, The geometry of the curve graph of a right-angled Artin group, Int. J. Algebra Comput. 24 (2014), 121-169. [Mar73] G. A. Margulis, Arithmeticity of nonuniform lattices, Funkcional. Anal. i Prilozen., 7(3):88-89, 1973. [Sch95] R. E. Schwartz, The quasi-isometry classification of rank one lattices, Publ. Math. Inst. Hautes Etudes Sci., 82:133-168, 1995. [Ser89] H. Servatius, Automorphisms of Graph Groups, J. Algebra, 126 (1989), no. (1), pp. 34-60. [Si43] C. L. Siegel, Symplectic geometry, Amer. J. Math., 65:1-86, 1943. [St68] J.R. Stallings, On torsion-free groups with infinitely many ends Ann. Math. (1968), 312-334. [Wh10] K. Whyte, Coarse bundles, arXiv:1006.3347. [Wi96] D. Wise, Non-positively curved squared complexes aperiodic tilings and non-residually finite groups, Princeton University, 1996. COMMENSURABILITY OF RAAGS 37 Ikerbasque - Basque Foundation for Science and Matematika Saila, UPV/EHU, Sarriena s/n, 48940, Leioa - Bizkaia, Spain E-mail address: [email protected] Ikerbasque - Basque Foundation for Science and Matematika Saila, UPV/EHU, Sarriena s/n, 48940, Leioa - Bizkaia, Spain E-mail address: [email protected] Matematika Saila, UPV/EHU, Sarriena s/n, 48940, Leioa - Bizkaia, Spain, and Russian foreign trade academy, 4a Pudovkin Street, 119285, Moscow, Russia E-mail address: [email protected]
4math.GR
arXiv:1706.00504v1 [cs.NE] 1 Jun 2017 Dynamic Stripes: Exploiting the Dynamic Precision Requirements of Activation Values in Neural Networks Alberto Delmas, Patrick Judd, Sayeh Sharify & Andreas Moshovos Department of Electrical and Computer Engineering, University of Toronto {delmasl1, juddpatr, sayeh, moshovos}@ece.utoronto.ca Abstract—Stripes is a Deep Neural Network (DNN) accelerator that uses bit-serial computation to offer performance that is proportional to the fixed-point precision of the activation values. The fixed-point precisions are determined a priori using profiling and are selected at a per layer granularity. This paper presents Dynamic Stripes, an extension to Stripes that detects precision variance at runtime and at a finer granularity. This extra level of precision reduction increases performance by 41% over Stripes. I. I NTRODUCTION Our previously described Stripes [1] accelerator exploited the variable precision requirements of deep learning neural networks to improve performance and energy efficiency. In the previously disclosed design, the hardware expected that prior to processing each layer, the precision required by that layer would be communicated by the software. These per layer precisions were thus not adjusted at runtime to reflect any additional reduction in precision that may be possible for each layer or even at a smaller granularity. However, the underlying compute units are capable of exploiting precisions on a much finer granularity than a layer. In the described implementation, each chip comprised 16 tiles, each processing 16 filters and 16 weights (synapses) per filter. A set of 256 activations where broadcast to all tiles one bit per cycle. For each layer, the precision of the activations, that is the positions of the most significant and of the least significant bits (MSB and LSB respectively), nH and nL were adjusted per layer. However, the precision could easily be adapted at a smaller granularity. For example the precision could be adjusted per group of 256 activations that are processed concurrently, or per group of 16 activations that are broadcast to the same column of SIPs in the described implementation. Similar techniques of dynamic precision reduction for bit-serial computation have been used for signal processing [2]. To the best of our knowledge this is the first application of this technique to neural networks. II. S IMPLIFIED E XAMPLE Figure 1 shows how the detection of nH and nL can be done for an example where a group of four activations, each originally expressed in 8 bits of precision. Without the mechanism to detect the precision at runtime, it could have been that he precision used to process this group of activations would be 7 bits since the precisions have to be determined during a prior profiling run and for the whole layer. This would be the case, if for example, there were some other activation possibly at some other position, that during the profiling runs was determined that it needed to be able take the value 0100 0001. Or, as another example, this would be the case, if there were two activations that during the profiling run it was determined that they needed to be able to take the values of 0100 0000 and 0000 0001 respectively for accuracy to be maintained as desired. However, during any run, the activations will take values that depend on the given input to the network (or prior inputs in the case of, for example, recurrent neural networks). As the figure shows, the specific values for this group of four activations can all be represented using just 4 bits. This is because among all four values, the highest bit position a 1 appears is at position 5 (counting from 0), e.g, in n0 , whereas the lowest bit position where a 1 appears is at position 1 in n1 . The figure shows the network calculating a set of signals ORj, one per input bit position. The ORj signals can be calculated using a set of cascaded OR gates which in the figure are shown as diamonds. The nH detection block accepts these ORj signals as input and performs a leading bit that is 1, or simply leading 1 detection, to identify the position of nH . The result of this block is a 1-hot encoding of nH . Since this information has to be communicated to the processing tiles, an encoder block can be used as shown to convert this encoding into a number in binary. This is the function of the offset encoder. The nL detection uses an identical block as the nH block with the priority of the ORj inputs reversed. This in effect calculates a trailing bit that is 1 detector. The figure shows an example of detecting nH and nL for a set of neuron values. Since the input neurons use 8 bits, the two offsets are encoded using 3 bits each. To process this group of neurons, the dispatcher will send nH as the starting offset. The units will decrement this offset every subsequent cycle. The dispatcher will signal the last cycle of processing for this group when the current offset becomes equal to nL . This can be done with an extra wire which signals the end of processing each neuron group. Assuming that processing starts at the nH bit, position, a counter keeps track of the current bit position being broadcast and a comparator sets the end of group signal when we arrive at nL . While in our example there are only four neurons that are being processed concurrently and as a single group, in practice there may be more neurons and more than one group. In such a case, once a group of neurons is processed the corresponding neuron lanes can be made to wait for all other neuron lanes to finish before advancing to the next group of neuron values. Alternatively, the dispatcher and the synapse buffer can be modified to support per neuron group accesses at the expense of additional area and memory bandwidth. group. Assuming that processing starts at the nH bit position, a counter keeps track of the current bit position being broadcast and a comparator sets the end of group signal when the units arrive at nL . Figure 2 shows an example Dynamic Stripes organization and specifically how the dispatcher communicates the activation bits and precision info to 16 processing tiles. In this configuration the 256 activations are grouped in 16 subgroups, each of 16 activations. For each subgroup the dispatcher sends the current offset along with an End of Group (EOG) signal. Assuming a baseline precision of 16 bits, the offset will require 4 wires and the EOG one for a total of 5 extra wires per subgroup of 16 activations. Other groupings are possible. Fig. 1: An Example Illustrating the Runtime Detection of the Precision Necessary to Process a Group of Activations. Fig. 2: A Dynamic Stripes Overview of Dispatcher and Processing Titles. III. D ESIGN While in the previous section we considered a case where only four activations forming a single group are processed concurrently, other implementations may choose to process more activations an in multiple groups. In the example implementation described in Stripes, 256 activations are processed in concurrently. They are broadcast to 16 tiles, where each tile processes 16 filters, and 16 weights per filter for a total of 256 weights per tile. Each tile comprises a grid of 16x16 Serial Inner-Product units, or SIPs. The SIPs along the same row process the same set of 16 weights, while the SIPs along the same column process the same set of 16 activations. Accordingly, in this implementation the precision p, specified as (nH ,nL ) can dynamically adjusted for the whole group of 256 activations that are processed concurrently or it can be determined separately for each group of 16 activations that are processed concurrently by each column of SIPs. Determining the precision necessary for a group of activations can be performed by the dispatcher prior to communicating the activations to the units for processing. For each of the 256 neurons to be sent to the units, ni where i ∈ [0, 255], and for each bit ni, j j ∈ [0, 15] and assuming that all neurons are positive, the transposer first calculates the logical OR of all bits at the same position: OR j = ∑i=255 i=0 nib j , and then applies a leading bit that is 1 detector over OR j , j = [0, 16] to determine nH the highest bit position where a bit that is 1 appears. Similarly, the transposer uses a trailing bit that is 1 detector to determine nL the lowest bit position where a bit that is 1 appears. To process these neurons, the transposer sends along with the bits also their offset via a set of extra 4 wires. An additional wire indicates the end of processing a neuron A. Modified Serial Inner-Product Unit Figure 3 shows an implementation of the modified SerialInner Product Unit. An additional shifter appears at the output of the adder tree. This shifter, through the control signal sB, allows the output of the adder tree to be adjusted to the right bit position so that it can be accumulated with the running sum which is kept at the accumulator A. 1(n0) MSB sB neuron 1(n15) shift x16 + neg Synapse 16 1(n15) Synapse 16 16 neg 1(n0) o_nbout + max 1 0 <<1 MSB << prec i_nbout Fig. 3: Modified SIP. IV. E VALUATION : P ERFORMANCE We have evaluated the performance improvement possible with Dynamic Stripes for a set of modern Image Classification Convolutional Neural Networks. Table I shows the resulting performance improvements of an equivalently configured DaDianNao [3] accelerator. Performance measurements were obtained via our cycle-accurate simulator which was extended to support dynamic detection of activation precisions. For this set of results, we first set the precisions per layer as in the 2 Network AlexNet NiN Googlenet VGG 2 VGG S VGG 19 GeoMean vs STR 1.29x 1.30x 1.56x 1.43x 1.62x 1.27x 1.41x vs DaDN 2.81x 2.39x 2.64x 3.16x 3.28x 1.71x 2.61x example, if an activation has a value 1010 0101 and MSP2 is 3, the activation can be converted to 1010 0100, whereas if MSP2 was 2 it would be converted to 1010 0000. With either MSP2 threshold, an activation of 0000 0101 would be represented exactly. This representation is different than a fixed-point and a floating point representation. We have experimented with such an optimization and found that it greatly improves performance for AlexNet. Specifically, the method followed is: 1. Get precision profiles via gradient descent to determine the number of 1-bits required for 100% accuracy. For Alexnet this gives 5,5,5,3,3, as opposed to 9,8,5,5,7 when using a fixed number of bits. 2. Take the n most significant 1-bits of every neuron, where n is the precision profile obtained in step 1, and then run that through Pragmatic. Performance over DaDianNao becomes 3.91x with the 2b-1R Pragmatic configuration (the tiles remain the same, only the dispatcher needs to be modified to stop transmitting oneffsets after a threshold). By comparison, sending all oneffsets resulted in a performance improvement of 3.26x. With full range shifters, the performance with this technique becomes 4.83x which exceeds that of the improved encoding technique. TABLE I: Speedup original Stripes design and then precision was dynamically detected at runtime per subgroup of 16 activations being processed concurrently. All 16 subgroups belonging to each group of 256 activations that were being processed concurrently had to finish processing prior to advancing to the next set of 256 activations. The Dynamic Stripes design improves performance over the baseline Stripes design. It lags compared to the Pragmatic [4] design that skips zero-bits instead of trying to exploit precision alone. V. A N OVEL WAY TO ADJUST PRECISION WITH P RAGMATIC In the Pragmatic engine which is was motivated by Stripes, performance depends on the number of activation bits that are 1. This engine opens up the opportunity for value based optimizations for performance and energy efficiency where the activation values are adjusted on the fly to reduce the number of bits that are 1. For example, we can determine a per layer threshold for the number of most significant powers of 2 (MSP2) that ought to be kept to maintain accuracy. For R EFERENCES [1] P. Judd, J. Albericio, and A. Moshovos, “Stripes: Bit-serial deep neural network computing,” Computer Architecture Letters, 2016. [3] Y. Chen, T. Luo, S. Liu, S. Zhang, L. He, J. Wang, L. Li, T. Chen, Z. Xu, N. Sun, and O. Temam, “DaDianNao: A machine-learning supercomputer,” in Microarchitecture (MICRO), 2014 47th Annual IEEE/ACM International Symposium on, pp. 609–622, Dec 2014. [4] J. Albericio, P. Judd, A. Delmás, S. Sharify, and A. Moshovos, “Bitpragmatic deep neural network computing,” CoRR, vol. abs/1610.06920, 2016. [2] T. Xanthopoulos and A. P. Chandrakasan, “A low-power dct core using adaptive bitwidth and arithmetic activity exploiting signal correlations and quantization,” IEEE Journal of Solid-State Circuits, vol. 35, pp. 740–750, May 2000. 3
9cs.NE
arXiv:1710.02063v2 [math.CO] 28 Nov 2017 CONNECTIVITY PROPERTIES OF FACTORIZATION POSETS IN GENERATED GROUPS HENRI MÜHLE AND VIVIEN RIPOLL Abstract. We consider three notions of connectivity and their interactions in partially ordered sets coming from reduced factorizations of an element in a generated group. While one form of connectivity essentially reflects the connectivity of the poset diagram, the other two are a bit more involved: Hurwitz-connectivity has its origins in algebraic geometry, and shellability in topology. We propose a framework to study these connectivity properties in a uniform way. Our main tool is a certain total order of the generators that is compatible with the chosen element. 1. Introduction For any group G the braid group Bn on n strands naturally acts on n-tuples of elements of G. This Hurwitz action is roughly defined as follows: the ith standard generator of Bn acts on an n-tuple by swapping the ith entry and the (i + 1)st entry, and moreover conjugating one by the other, so that the product of all the elements remains unchanged (see (9) for the precise definition). This action goes back to [23], where it appeared in the study of branched coverings of Riemann surfaces and applies to the case where G is the symmetric group. It also plays a role in the computation of the braid monodromy of projective curves [16, 27, 30]. It is a natural question to ask for the number of orbits in G n under Hurwitz action. There are several results on conditions for two elements of G n to belong to the same Hurwitz orbit. To name a few, [4] deals with the symmetric group, [18] investigates generalized quaternion groups and dihedral groups and [35] treats dihedral groups, dicyclic groups and semidihedral groups. Since the Hurwitz action preserves the multiset of conjugacy classes of a tuple, it is natural to study the action on An for any subset A ⊆ G that is closed under Gconjugation. Without loss of generality we may then assume that G is generated by A as a monoid. Some authors refer to this setting as an “equipped group” [24, 26]. We will, however, call this structure a generated group following [5, 21]. A fundamental case is the study of the Hurwitz action on A-reduced factorizations of some element c ∈ G, and the question of the number of Hurwitz orbits. 2010 Mathematics Subject Classification. 06A11 (primary), and 20F99, 05E15 (secondary). Key words and phrases. generated group, braid group, Hurwitz action, factorization poset, shellability, compatible order, well covered poset, cycle graph, noncrossing partition lattice. HM is partially supported by a Public Grant overseen by the French National Research Agency (ANR) as part of the “Investissements d’Avenir” Program (Reference: ANR-10-LABX-0098) and by Digiteo project PAAGT (Nr. 2015-3161D). VR is supported by the Austrian Science Foundation FWF, Grants Z130-N13 and F50-N15, the latter in the framework of the Special Research Program “Algorithmic and Enumerative Combinatorics”. 1 2 HENRI MÜHLE AND VIVIEN RIPOLL Let us write Red A (c) for the set of all A-reduced factorizations of c. It is a classical result [17] that, when G is a finite irreducible real reflection group, A its set of reflections and c a Coxeter element, the Hurwitz action is transitive on Red A (c). This was later generalized to finite irreducible complex reflection groups [7, Proposition 7.6]. It was shown recently that for G a finite irreducible real reflection group the Hurwitz action on Red A (c) is transitive if and only if c is a (parabolic) quasi-Coxeter element [3, Theorem 1.1]. One direction of this equivalence was recently extended to affine Coxeter groups [39, Theorem 1.1]. In a similar spirit, [32, Theorem 4.1] enumerates the Hurwitz orbits for elements of the alternating group generated by all 3-cycles. In [5, 6] and also [14] generated groups were equipped with an additional structure of a partially ordered set. This construction has its origin already in [19]. More precisely, we consider the poset Pc of all prefixes (up to equivalence) of some element c ∈ G ordered by containment. From this viewpoint maximal chains correspond to A-reduced factorizations of c and the Hurwitz action can be seen as a method to pass from one chain to another. The number of Hurwitz orbits of Red A (c) can then be interpreted as a “connectivity coefficient” of this factorization poset Pc ( G, A). This article revolves around the relation of the previously described Hurwitzconnectivity to two other forms of connectivity of a poset: chain-connectivity (motivated by graph theory) and shellability (motivated by topology). The main result of this article is the following uniform approach to proving Hurwitz-connectivity, chain-connectivity and shellability of the factorization poset Pc ( G, A). The statement of this result uses two notions that will be formally defined later in the article, namely a total order of the generators that is compatible with c (Definition 5.3), and a certain “well-covered” property (Definition 5.16). The latter property asserts that for every generator that is not minimal with respect to a given total order we can find a smaller generator such that both have a common upper cover in Pc ( G, A). Let us fix the following notation for the upcoming three statements. Let G denote a group that is generated by A ⊆ G as a monoid, where A is assumed to be closed under G-conjugation. For c ∈ G let Ac ⊆ A denote the set of all generators that appear in at least one A-reduced factorization of c. Theorem 1.1. If Red A (c) is finite, and the factorization poset Pc ( G, A) admits a ccompatible order ≺ of Ac and is totally well covered with respect to ≺, then Pc ( G, A) is chain-connected, Hurwitz-connected and shellable. We want to emphasize that Theorem 1.1 uniformly and simultaneously approaches the question whether a factorization poset is chain-connected, Hurwitzconnected or shellable. Note that it is far from trivial in full generality to establish that a factorization poset is well covered and admits a compatible order. However, for some special groups the framework presented here may provide a convenient method to reach uniform insights about the connectivity of the respective factorization posets. By definition a factorization poset can only be well covered with respect to a given total order of the generators. We conjecture that we can weaken the CONNECTIVITY PROPERTIES OF FACTORIZATION POSETS IN GENERATED GROUPS 3 assumptions of Theorem 1.1 a bit; and we are able to prove this conjecture for the Hurwitz-connectivity part. Theorem 1.2. If Red A (c) is finite, and the factorization poset Pc ( G, A) is chain-connected and admits a c-compatible order of Ac , then the Hurwitz action is transitive on Red A (c). Conjecture 1.3. If Red A (c) is finite, and the factorization poset Pc ( G, A) is totally chain-connected and admits a c-compatible order of Ac , then Pc ( G, A) is shellable. The main part of this article deals with a proper study of the implications and non-implications between the three types of connectivity; see Figure 1 for an overview. We also provide three other versions of this conjecture (Conjectures 5.11, 5.23 and 6.7). The latter is formulated in terms of a particular graph that represents the local structure of the factorization poset. This tool enables us to prove a particular case of Conjecture 1.3; see Theorem 6.8. This article is organized as follows. In Section 2 we formally define chainconnectivity, Hurwitz-connectivity and shellability. In the process we recall the necessary background and define the needed concepts. In Section 3 we introduce a huge class of factorization posets arising from reflection groups. We briefly recall the definitions and state that these factorization posets possess all three connectivity properties. In Section 4 we investigate relations between our three connectivity properties without any further assumptions. The heart of this manuscript is Section 5 in which we define the notion of a compatible order of the generators and the “well-covered” property. We prove Theorem 1.2 and provide an equivalent formulation of Conjecture 1.3. This section culminates in the proof of Theorem 1.1. We conclude this manuscript with Section 6 in which we define a certain graph from which we can essentially recover the factorization poset, and we use this perspective to prove a particular case of our main conjecture. 2. Three Notions of Connectivity In this section we define the three notions of connectivity that we care about. Each of the following three sections serves at the same time as a preliminary section that introduces further necessary concepts and notions. 2.1. Poset Terminology. In this section we recall the basic concepts from the theory of partially ordered sets, and we introduce a first notion of connectivity. A partially ordered set (poset for short) is a set P equipped with a partial order ≤, and we usually write P = ( P, ≤). If P has a least element 0̂ and a greatest element  1̂, then it is bounded, and the proper part of P is the subposet P = P \ {0̂, 1̂}, ≤ . An interval of P is a set of the form [ x, y] = {z ∈ P | x ≤ z ≤ y} for x, y ∈ P with x ≤ y. Two elements x, y ∈ P form a covering if x < y and there is no z ∈ P with x < z < y. We then write x ⋖ y, and equivalently say that x is covered by y or that y covers x. Let us define the set of coverings of P by  (1) E (P ) = ( x, y) | x ⋖ y . From now on we will only consider finite posets. A chain of P is a totally ordered subset C ⊆ P meaning that for any x, y ∈ C we have x < y or y < x. If 4 HENRI MÜHLE AND VIVIEN RIPOLL Fig totally chain-connected 4.1 Ex. 4.3 \ Ex \ .4 .2 Pr op . .4 Ex \ .4 .2 .4 . op Pr 1 4. .3 .4 Ex \ . op Pr b ro /P \ f. + Ex . \ 4.3 .8 De Def. chain-connected 4. 1 Ex. 4.3 \ Ex \ .4 .2 Lem. 5.8 λc EL-labeling Def. . nj Co .5 .11 D D ef ef .+ . op Pr 5.22 chain-connected + compatible order 4.1 T hm . ef . totally chain-connected + compatible order Conj. 5.23 nj Co 6. 6 totally well-covered + compatible order .6 .7 Pr op . D Ex \ .5 .1 2 Thm. 1.2 Ex. 5.12 \ compatible order Ex . \ 4.2 . Ex. 6.13 \ 2 .1 .5 Ex \ ef locally Hurwitzconnected Ex \ .5 .1 2 shellable D \ 4.7 . Ex \ Ex. 4.2 .3 .4 Ex \ Ex . \ 5.12 Hurwitz-connected reduced cycle graph linear Figure 1. Implications, non-implications and conjectures between the several properties of Pc . We have omitted a few arrows coming from transitivity. C = { x1 , x2 , . . . , x k } with xi < x j whenever i < j, we occasionally use the notation C : x1 < x2 < · · · < xk to emphasize the order of the elements. Moreover, a chain C is maximal if it is not properly contained in some other chain. Let M (P ) denote the set of maximal chains of P . A poset is graded if all maximal chains have the same cardinality, and this common cardinality minus one is the rank of P ; denoted by rk(P ). The first notion of connectivity of a poset that springs  to mind is the connectivity of its poset diagram, namely the graph P, E (P ) . Observe that this graph is trivially connected whenever P is bounded. However, the poset diagram of the proper part of a bounded poset need not be connected, see Figure 2. We are in fact interested in the following stronger version of connectivity. CONNECTIVITY PROPERTIES OF FACTORIZATION POSETS IN GENERATED GROUPS 5 Figure 2. A bounded graded poset that is not chain-connected. Definition 2.1. Let P be a graded, bounded poset, and define  (2) Ichain = {C, C ′ } | |C ∩ C ′ | = rk(P ) .  The chain graph of P is the graph C (P ) = M (P ), Ichain . In other words two maximal chains of P are adjacent in the chain graph if they differ in exactly one element. We call P chain-connected if C (P ) is connected. Observe that the poset diagram of the proper part of a chain-connected poset is again connected as soon as the rank of P is at least three. Moreover, if every interval of P is chain-connected, then we call P totally chainconnected. It is easy to check (by induction) that a graded, bounded poset is totally chain-connected if and only if the poset diagram of the proper part of every interval of rank ≥ 3 is connected (we will not use this characterization in the following). 2.2. Factorization Posets in Generated Groups. In this section we introduce the main construction that associates a bounded graded poset with each triple ( G, A, c), where G is a group generated as a monoid by the set A ⊆ G, and where c is some element in G. Fix a group G and a subset A ⊆ G that generates G as a monoid. Let 1 denote the identity of G. We then call the pair ( G, A) a generated group, and we define the A-length of x ∈ G by  (3) ℓ A ( x ) = min k ∈ N | x = a1 a2 · · · ak , where ai ∈ A for i ∈ [k] , where [k] = {1, 2, . . . , k}. If k = ℓ A ( x ), then any factorization x = a1 a2 · · · ak is called A-reduced. Let Red A ( x ) denote the set of all A-reduced factorizations of x ∈ G. In order to avoid confusion, we usually write the elements of Red A ( x ) as tuples rather than as words on the alphabet A. It follows immediately from the definition that ℓ A satisfies the sub-additivity law ℓ A ( xy) ≤ ℓ A ( x ) + ℓ A (y). (4) If x, y ∈ G are such that equality holds in (4), then we say that x divides xy. In that case there exists an A-reduced factorization of x that is a prefix of some Areduced factorization of xy. This gives immediately rise to the definition of the following partial order on G; the A-prefix order. (5) x ≤A y if and only if ℓ A ( y ) = ℓ A ( x ) + ℓ A ( x −1 y ) . 6 HENRI MÜHLE AND VIVIEN RIPOLL Observe that x divides y if and only if x lies on a geodesic from 1 to y in the right Cayley graph of ( G, A). In other words, the A-prefix order is simply a particular acyclic orientation (“away from the identity”) of the Cayley graph of G with respect to A. The definition of the A-prefix order as given in (5) has perhaps first appeared explicitly in [14] in the case of the symmetric group, but the notion of divisibility goes back to [19]. The next lemma, which is well known to experts, describes the intrinsic recursive structure of the A-prefix order. Its proof is essentially verbatim to the proof of [10, Proposition 3.1.6], which treats a particular case. Lemma 2.2. Let x, y, z ∈ G. If x ≤ A y ≤ A z, then x −1 y ≤ A x −1 z. Moreover, the map f x : G → G, g 7→ xg is an order isomorphism from [ x −1 y, x −1 z] A to [y, z] A . In particular, any subinterval of the interval [1, c] A is isomorphic to an interval of the form [1, g] A for some g ≤ A c. Proof. Pick some g ∈ G with x −1 y ≤ A g ≤ A x −1 z. The assumption x ≤ A z and Equations (4) and (5) imply ℓ A ( z ) = ℓ A ( x ) + ℓ A ( x −1 z ) = ℓ A ( x ) + ℓ A ( g ) + ℓ A ( g −1 x −1 z )  ≥ ℓ A ( xg) + ℓ A ( xg)−1 z ≥ ℓ A (z), from which follows x ≤ A xg ≤ A z. These relations together with x ≤ A y and (4) imply ℓ A ( xg) ≤ ℓ A (y) + ℓ A (y−1 xg) = ℓ A ( x ) + ℓ A ( x −1 y) + ℓ A (y−1 xg) = ℓ A ( x ) + ℓ A ( g) = ℓ A ( xg). As a consequence we have g ∈ [ x −1 y, x −1 z] A if and only if xg ∈ [y, z] A .  Let us from now on assume that A is closed under G-conjugation. In that case, ≤ A is in fact a subword order on Red A ( x ). Proposition 2.3 ([21, Proposition 2.8]). Let A ⊆ G be a generating set closed under G-conjugation. Let g ∈ G with ℓ A ( g) = n. Fix k ≤ n and a list of integers 1 ≤ i1 < i2 < · · · < ik ≤ n. For x ∈ G with ℓ A ( x ) = k the following are equivalent. (i) x ≤ A g, i.e. ℓ A ( g) = ℓ A ( x ) + ℓ A ( x −1 g); (ii) there exists ( a1 , a2 , . . . , an ) ∈ Red A ( g) such that x = ai1 ai2 · · · aik . Now fix some c ∈ G and consider the principal order ideal generated by c in ( G, ≤ A ), i.e. Pc ( G, A) = { g ∈ G | g ≤ A c}. The poset  (6) Pc ( G, A) = Pc ( G, A), ≤ A is the factorization poset of c in ( G, A). Whenever it is clear from the context, we omit the group and the generating set. Observe that a poset is completely determined by its set of maximal chains; and in the given setting, the maximal chains of Pc correspond bijectively to the A-reduced factorizations of c. Let ℓ A (c) = n and consider the map CONNECTIVITY PROPERTIES OF FACTORIZATION POSETS IN GENERATED GROUPS (7) 7 λc : M (Pc ) → Red A (c)  x0 ⋖ A x1 ⋖ A · · · ⋖ A xn 7→ x0−1 x1 , x1−1 x2 , . . . , x n−−1 1 xn . The three following properties (whose proofs are straightforward) will be used extensively in the rest of the paper. Lemma 2.4. The map λc is a bijection. Its inverse is given by: Red A (c) → M (Pc ) ( a1 , a2 , . . . , a n ) 7 → x 0 ⋖ A x 1 ⋖ A · · · ⋖ A x n , where x0 = 1 and xi = a1 a2 · · · ai for i ∈ [n]. Lemma 2.5. The map f x from Lemma 2.2 preserves the map λc . The fact that A is closed under G-conjugation implies that the isomorphism type of Pc depends only on the conjugacy class of c. Lemma 2.6. If A is closed under G-conjugation, then ℓ A is invariant under G-conjugation. In other words ℓ A ( x ) = ℓ A ( gxg−1) for all g, x ∈ G. Moreover, for all x, y, g ∈ G, we have x ≤ A y if and only if gxg −1 ≤ A gyg−1. Note also that factorization posets are always self-dual. Proposition 2.7 ([21, Proposition 2.5]). Let A be closed under G-conjugation. For any x, z ∈ G with x ≤ A z the map K x,z : G → G, y 7→ xy −1 z restricts to an anti-automorphism of the interval [ x, z] A . Example 2.8. Let G = S4 be the symmetric group of permutations of [4]. It is well known that G is generated by its set of transpositions  T = (1 2), (1 3), (1 4), (2 3), (2 4), (3 4) . Since any transposition is an involution, T generates S4 as a monoid. It is moreover easy to check that T is closed under S4 -conjugation. Let c = (1 2 3 4) be a long cycle in S4 . The factorization poset Pc (S4 , T ) is shown in Figure 3. The reader is cordially invited to verify Lemmas 2.4 and 2.5. Lemma 2.6 translates to this case as follows: if we replace c by any other long cycle c′ , then the map that adjusts the order of the letters in the cycles of the permutations occurring in Figure 3 according to the relative order of [4] in c′ , is a poset isomorphism. Proposition 2.7 can be verified by rotating the poset diagram by 180 degrees. Perhaps the most important consequence of the assumption that A is closed under G-conjugation is the existence of a braid group action on Red A ( x ) (and thus in view of Lemma 2.4 also on M (Pc ).) Recall that the braid group on n strands can be defined via the group presentation (8) Bn = σ1 , σ2 , . . . , σn−1 | σi σi+1 σi = σi+1 σi σi+1 for i ∈ [n − 2], and σi σj = σj σi for i, j ∈ [n − 1] with |i − j| > 1 . 8 HENRI MÜHLE AND VIVIEN RIPOLL (1 2 3 4) (1 2 3) (1 2)(3 4) (1 3 4) (1 2 4) (2 3 4) (1 4)(2 3) (1 3) (1 2) (3 4) (1 4) (2 4) (2 3) 1 Figure 3. The factorization poset Pc of the long cycle c = (1 2 3 4) in the symmetric group S4 generated by its transpositions. Now fix x ∈ G with ℓ A ( x ) = n. For i ∈ [n − 1], we define an action of the braid group generator σi on Red A ( x ) by (9) = σi · ( a1 , . . . , ai−1, ( a1 , . . . , a i −1 , ai , a i +1 , a i +1 , 1 a− i +1 a i a i +1 , a i +2 , . . . , a n ) a i +2 , . . . , a n ) . In other words, the generators of Bn swap two consecutive factors of an Areduced factorization of x and conjugate one by the other, so that the product stays the same. Since A is closed under G-conjugation, σi is indeed a map on Red A ( x ), and it is straightforward to verify that this action respects the relations of (8), and therefore extends to a group action of Bn on Red A ( x ): the Hurwitz action. We can now define the second notion of connectivity used in this paper. Definition 2.9. Let c ∈ G, and define  (10) Ihurwitz = {x, x′ } | x, x′ ∈ Red A (c) and x′ = σi x for some i ∈ [ℓ A (c) − 1] .  The Hurwitz graph of c is the graph H (c) = Red A (c), Ihurwitz . In view of Lemma 2.4 we may as well define the Hurwitz graph of c as a graph on the maximal chains of Pc , and from this point of view it is clearly (isomorphic to) a subgraph of C (Pc ); see Definition 2.1. We call Pc Hurwitzconnected if H (c) is connected. This is the case if and only if the braid group Bℓ A (c) acts transitively on Red A (c). In view of Lemma 2.4 we sometimes abuse notation and write H (Pc ) instead of H (c). Figure 4 shows the Hurwitz graph of the factorization poset from Figure 3. 2.3. Shellability of Posets. The last notion of connectivity that will be important for this article has its origins in algebraic topology. Recall that the set of chains of a graded poset P forms a simplicial complex; the order complex of P , denoted by ∆(P ). It is a consequence of Hall’s Theorem [36, Proposition 3.8.5] that if CONNECTIVITY PROPERTIES OF FACTORIZATION POSETS IN GENERATED GROUPS (12)(24)(23) 9 (12)(23)(34) (12)(34)(24) (14)(12)(23) (24)(14)(23) (13)(12)(34) (14)(23)(13) (14)(13)(12) (23)(13)(34) (23)(14)(13) (13)(34)(12) (24)(23)(14) (23)(34)(14) (34)(12)(24) (34)(14)(12) (34)(24)(14) Figure 4. The Hurwitz graph of the long cycle c = (1 2 3 4) in the symmetric group S4 generated by its transpositions. P is graded and bounded, then the Möbius invariant of P , i.e. the value of the Möbius function of P between least and greatest element, equals the reduced Euler characteristic of ∆(P ). Consequently, the combinatorics of P provides some information on the topology of ∆(P ). In this section we want to outline how a simple combinatorial tool, an edgelabeling of P , may serve to learn about the homotopy type of ∆(P ). A class of pure simplicial complexes with a particularly nice homotopy type are the shellable simplicial complexes: their homotopy type is in fact that of a wedge of spheres [13, Theorem 4.1], the corresponding (co-)homology groups are torsionfree, and the Stanley-Reisner ring of such complexes is Cohen-Macaulay [9, Appendix]. We phrase the definition of shellability directly in terms of a graded bounded poset P . It can be transferred to pure simplicial complexes via the correspondence between maximal chains of P and facets of ∆(P ). Definition 2.10. Let P be a graded bounded poset. A shelling of P is a linear order ≺ on M (P ) such that whenever two maximal chains M, M ′ ∈ M (P ) satisfy M ≺ M ′ , then there exists N ∈ M (P ) with N ≺ M ′ and x ∈ M ′ with the property that (11) M ∩ M ′ ⊆ N ∩ M ′ = M ′ \ { x }. A poset that admits a shelling is shellable. We observe further that a poset which is not chain-connected cannot be shellable, because then any linear order on M (P ) has a first occurence of two successive chains that lie in different connected components of C (P ), and these two chains forbid such an order to be a shelling of P . Moreover, every bounded poset of rank ≤ 2 is shellable, and a 10 HENRI MÜHLE AND VIVIEN RIPOLL bounded graded poset of rank 3 is shellable if and only if its proper part is connected. Bearing this in mind, we can view shellability as a sophisticated notion of connectivity. There is a nice combinatorial way to establish shellability, by exhibiting a particular edge-labeling of the poset. An edge-labeling of P is a map λ : E (P ) → Λ, where Λ is an arbitrary partially ordered set. An edge-labeling of P naturally extends to a labeling of M (P ), where for C : 0̂ = x0 ⋖ x1 ⋖ · · · ⋖ xn = 1̂ we set  λ ( C ) = λ ( x 0 , x 1 ) , λ ( x 1 , x 2 ) , . . . , λ ( x n −1 , x n ) . A maximal chain C ∈ M (P ) is rising if λ(C ) is weakly increasing with respect to the partial order on Λ, and it is falling if λ(C ) is strictly decreasing. A chain C ∈ M (P ) precedes a chain C ′ ∈ M (P ) if λ(C ) is lexicographically smaller than λ(C ′ ) with respect to the order on Λ. An edge-labeling λ of P is an EL-labeling if in every interval of P there exists a unique rising maximal chain, and this chain precedes every other maximal chain in that interval. A poset that admits an ELlabeling is EL-shellable. A. Björner proved the following fundamental property. Theorem 2.11 ([9, Theorem 2.3]). Every EL-shellable poset is shellable. The converse of Theorem 2.11 is not true, see for instance [37, 38]. Observe, for instance in Lemma 2.4, that in the case of factorization posets coming from a generated group ( G, A) the A-reduced factorizations of c ∈ G induce an edgelabeling of Pc . One of the main motivations for this article was the question whether there is a local criterion to guarantee that a total order on A turns this labeling into an EL-labeling. Example 2.12. Consider G to be the free abelian group of rank 3 (isomorphic to Z3 ), generated by three pairwise commuting elements r, s, t. Fix the element c = rst. The corresponding factorization poset is the boolean poset shown in Figure 5a, and the corresponding chain graph is shown in Figure 5b. Observe that this graph is isomorphic to the Hurwitz graph of c. Fix the total order r ≺ s ≺ t. Then, the reduced factorizations of c are (in lexicographic order): (r, s, t) ≺ (r, t, s) ≺ (s, r, t) ≺ (s, t, r ) ≺ (t, r, s) ≺ (t, s, r ). Observe that (r, s, t) is the unique rising reduced factorization of c. In view of Lemma 2.4 this sequence of reduced factorizations corresponds to the following order on M (Pc ): {1, r, rs, c} ≺ {1, r, rt, c} ≺ {1, s, rs, c} ≺ {1, s, st, c} ≺ {1, t, rt, c} ≺ {1, t, st, c}. It is straightforward to check that this is a shelling of Pc . 3. The Motivating Example Let us now describe one of the main sources of factorization posets arising in the context of generated groups, which was also the motivating example for the present article. Fix a finite-dimensional complex vector space V and consider the group U (V ) of unitary transformations on V. An element t ∈ U (V ) is a reflection if it has finite order and fixes a hyperplane pointwise, called the reflecting hyperplane of t. Any CONNECTIVITY PROPERTIES OF FACTORIZATION POSETS IN GENERATED GROUPS {1, t, st, rst} rst rs rt st {1, s, st, rst} {1, t, rt, rst} r s t {1, s, rs, rst} {1, r, rt, rst} 1 11 {1, r, rs, rst} (a) The factorization poset Prst in (b) The chain graph of the factorizathe free abelian group generated by tion poset in Figure 5a. {r, s, t}. Figure 5. A factorization poset and its chain graph in the free abelian group on three generators. subgroup of U (V ) that is generated by reflections is a (complex) reflection group. If W is a reflection group and T is its set of reflections, then (W, T ) is—naturally—a generated group. It is easy to see that T is closed under W-conjugation. For more background on reflection groups, we refer the interested reader to [22, 29]. An element w ∈ W is said to be regular if it has an eigenvector in the complement of the reflecting hyperplanes of W. A Coxeter element is a regular element of some particular order. We do not go into further detail here, and refer the interested reader to [34] instead. It is a consequence of [28, Theorem C] that Coxeter elements exist in the case when W is irreducible and well-generated, i.e. W does not fix a proper subspace of V pointwise, and the minimal number of reflections needed to generate W equals dim V. The factorization poset Pc (W, T ), where W is a finite irreducible well-generated complex reflection group, T its set of reflections and c is a Coxeter element in W is usually called the lattice of c-noncrossing W-partitions. There exists a vast literature on the study of these posets, and we refer the reader for instance to [1, 5, 7, 15, 33] and all the references given therein. The name comes from the fact that when W is the symmetric group, T the set of all transpositions, and c a long cycle, then there is a poset isomorphism from Pc to the lattice of noncrossing set partitions introduced in [25]. This map was perhaps first described in [8] and essentially maps cycles of a permutation to blocks of a set partition. Note that we have encountered a lattice of noncrossing partitions already in Example 2.8. The next two results show that lattices of noncrossing partitions possess all of our three types of connectivity. Theorem 3.1 ([7, 17]). Let W be a finite irreducible well-generated complex reflection group, let T be its set of reflections and let c ∈ W be a Coxeter element. The lattice Pc (W, T ) of c-noncrossing W-partitions is Hurwitz-connected, and thus chainconnected. Theorem 3.2 ([2, 31]). Let W be a finite irreducible well-generated complex reflection group, let T be its set of reflections and let c ∈ W be a Coxeter element. The lattice 12 HENRI MÜHLE AND VIVIEN RIPOLL Pc (W, T ) of c-noncrossing W-partitions is shellable. In particular, the map λc defined in (7) induces an EL-labeling of Pc (W, T ) for a certain total order of T. To date, however, no uniform proofs of Theorems 3.1 and 3.2 are available. By a uniform proof, we mean a proof that does not rely on the classification of complex reflection groups. Uniform proofs are known when W is assumed to be a real reflection group; these are the main results of [17] and [2], respectively. For the remaining complex reflection groups both Hurwitz-connectivity and shellability have been verified case by case. One of the main goals of our work is the creation of a uniform framework with which we can essentially verify both properties by the same means: a particular total order of the chosen generating set. Such a total order—tailored to the case of reflection groups—plays a crucial role in [2] and [31], and can indeed be seen as a precursor to one of the main definitions of this article, Definition 5.3 below. 4. Interaction of Different Types of Connectivity In this section we want to investigate the implications between the three types of connectivity. We have already mentioned the following easy observation. Proposition 4.1. Every Hurwitz-connected bounded graded poset is chain-connected. Every shellable bounded graded poset is chain-connected. Proof. Let P be a bounded graded poset. Since H (P ) (if it exists) is (isomorphic to) a subgraph of C (P ) with the same set of vertices, the first claim follows. Now let P be shellable, and let M (P ) = { M1 , M2 , . . . , Ms } indicate the shelling. Assume that C (P ) is not connected. There is thus a minimal index i ∈ [s] such that Mi and Mi+1 lie in different connected components of C (P ). Hence Mi ∩ Mi+1 < rk(P ) − 1. Since P is shellable, there must be j ∈ [s] with j < i + 1 such that M j ∩ Mi+1 = rk(P ) − 1, which implies that M j and Mi+1 lie in the same connected component of C (P ), and consequently that M j and Mi lie in different connected components of C (P ). We can thus find k ∈ { j, j + 1, . . . , i − 1} such that Mk and Mk+1 lie in different connected components of C (P ) which contradicts the minimality of i. It follows that C (P ) is connected.  None of the converse statements in Proposition 4.1 is true without further assumptions as the next examples illustrate. Example 4.2. For the converse of the first statement consider for instance the finite group given by the presentation (12) G = r, s, t, u | r2 = s2 = t2 = u2 = 1, rt = tr, su = us, rs = st = tu = ur, sr = ru = ut = ts . Note that this group is isomorphic to the Coxeter group B2 (group of isometries of the square), and the presentation given here contains the so-called dual braid relation (see [5] for more background on related groups and presentations). The set A = {r, s, t, u} is clearly closed under G-conjugation. Now take the ele ment c = rt. We have Red A (c) = (r, t), (t, r ), (s, u), (u, s) , which implies that Pc ( G, A) is not Hurwitz-connected. Since Pc ( G, A) has rank two, however, it is trivially chain-connected and shellable. See Figure 6 for an illustration. CONNECTIVITY PROPERTIES OF FACTORIZATION POSETS IN GENERATED GROUPS 13 rt r s u t 1 (a) The factorization poset Prt ( G, A), where G is given by the presentation in (12). tr us rt su (b) The Hurwitz graph of the poset in Figure 6a. Figure 6. An example of a chain-connected factorization poset that is not Hurwitz-connected. rrrt strr sstr trrr ssst srur susr usrr rrs rrt rrr rss ssru rurr rrv ssus ursr srsu rsur surs urrs rr rv rt rs ru ss srrv rssu vssr rvsr r v t u s srvs rsrv vsrs rrvr svss rrsv vrss rvrs rsvs rrrt 1 tsss rrts (a) The factorization poset Prrrt ( G, A), where G is given by the presentation in (13). rtss (b) The Hurwitz graph of the poset in Figure 7a (the loops are not drawn). Figure 7. An example of a Hurwitz-connected factorization poset that is not shellable, because it contains an interval of rank 3 that is not chain-connected. Example 4.3. Next consider the infinite group given by the presentation (13) G = r, s, t, u, v | r3 = s3 , t2 = u2 = v2 , rs = sr, tu = uv = vt, ut = tv = vu, rt = ts = sv = vr, rv = vs = su = ur, ru = us = st = tr . The set A = {r, s, t, u, v} is closed under G-conjugation. The factorization poset of c = rrrt is shown in Figure 7a, and the corresponding Hurwitz graph is depicted in Figure 7b. By inspection of these figures we see that Pc ( G, A) is Hurwitzconnected, but not shellable, since the subposet Prrr ( G, A) is not chain-connected. We observe that the example given in Figure 7a contains an interval which is not chain-connected, and this is the reason why it is not shellable. But what happens if we exclude this situation, i.e. if we assume our factorization poset to be totally chain-connected? We are not aware of a factorization poset that is totally chain-connected, but not shellable. 14 HENRI MÜHLE AND VIVIEN RIPOLL Figure 8. A totally chain-connected poset that is not shellable. Problem 4.4. Prove or disprove the following statement. If Pc ( G, A) is finite and totally chain-connected, then it is also shellable. A solution to Problem 4.4 would be of great importance within the framework presented here: we could either reduce the difficulty to prove that a factorization poset is shellable, or the group structure of such an example would exhibit a new obstruction to shellability. In what follows we will address Problem 4.4 under additional assumptions. Note that, for arbitrary graded posets, there are some well-known examples of totally chain-connected posets which are not shellable. Consider for instance the poset P in Figure 8, which is reproduced from [11, Page 16]. The geometric realization of ∆(P ) is the Dunce Hat, which is known to be non-shellable [20, Theorem 3]. However, it can be verified that every interval of P is chain-connected. On the other hand, P is not self-dual and does therefore not arise as a factorization poset in some generated group. We have seen in Example 4.2 that chain-connectivity of a factorization poset does not imply Hurwitz-connectivity. However, we may add the following local criterion to make things work. Definition 4.5. Let Pc ( G, A) be factorization poset. If B2 acts transitively on Red A ( g) for every g ≤ A c with ℓ A ( g) = 2, then we call Pc ( G, A) locally Hurwitz-connected. Theorem 4.6. Let A be closed under G-conjugation, and fix c ∈ G with ℓ A (c) = n. If Pc is chain-connected and locally Hurwitz-connected, then Bn acts transitively on Red A (c), i.e., Pc is Hurwitz-connected. Proof. Let x, x′ ∈ Red A (c). Lemma 2.4 implies that these A-reduced factorizations correspond to C, C ′ ∈ M (Pc ). Since C (Pc ) is connected, we can find a sequence C = C0 , C1 , . . . , Cs = C ′ with s ≥ 1 such that Ci−1 ∩ Ci = k − 1 for i ∈ [s]. Moreover, say that Ci corresponds to the A-reduced factorizations (i) (i) (i) xi = a1 a2 · · · ak for i ∈ [s]. In view of Lemma 2.2 the assumption that Ci−1 ∩ Ci = k − 1 amounts to the fact that there is some g ≤ A c with ℓ A ( g) = 2 ( i −1 ) ( i −1 ) (i) (i) ( i −1 ) (i) such that g = ar ar +1 = ar ar +1 for r ∈ [k − 1], and a j = a j if and only if j∈ / {r, r + 1}. Since B2 acts transitively on Red A ( g) we conclude that there exists CONNECTIVITY PROPERTIES OF FACTORIZATION POSETS IN GENERATED GROUPS rrt rt rr rur rrt rs rsu ru trr usr rts r u t 15 str s urs tss 1 (a) The factorization poset Prrt ( G, A), where the prefix order on the group given by the presentation in (14). sru sus sst (b) The Hurwitz graph of the poset in Figure 9a (the loops are not drawn). Figure 9. An example of a Hurwitz-connected factorization poset which has a rank-2 interval that is not Hurwitz-connected. ωi ∈ B2 such that ωi · xi−1 = xi . Consequently, we have (ωs ωs−1 · · · ω1 ) · x = x′ as desired.  The next example illustrates that being locally Hurwitz-connected is actually not a necessary condition for Hurwitz-connectivity of Pc . Example 4.7. Consider the infinite group given by the presentation (14) G = r, s, t, u | r2 = s2 , t2 = u2 , rs = sr, tu = ut, rt = ts = su = ur, st = tr = ru = us . The set A = {r, s, t, u} is closed under G-conjugation. Figure 9a shows the factorization poset of c = rrt, and the corresponding Hurwitz graph is depicted in Figure 9b. We see that Prrt ( G, A) is Hurwitz-connected, but the interval Prr ( G, A) is not. 5. Compatible A-Orders In this section we introduce our main tool, a total order of A that is compatible with c ∈ G. This concept is an algebraic generalization of the compatible reflection order introduced in [2], and it also appeared in [31] in the context of reflection groups. In order to make this definition work, we assume from now on that Red A (c) is finite (which is equivalent to the requirement that Pc is finite). 5.1. Definition and Properties of Compatible Orders. Let Ac = { a ∈ A | a ≤ A c}. Observe that we trivially have Red A (c) = Red Ac (c). Let ≺ be any total order on Ac . We say that a factorization ( a1 , a2 , . . . , aℓ A (c) ) ∈ Red A (c) is ≺-rising if ai  ai+1 for i ∈ [ℓ A (c) − 1]. We denote by Rise(c; ≺) the number of ≺-rising A-reduced factorizations of c for a given total order ≺ on Ac . The next statement relates these rising factorizations to the Hurwitz orbits of Red A (c), in the specific case when ℓ A (c) = 2. 16 HENRI MÜHLE AND VIVIEN RIPOLL Proposition 5.1. Let c ∈ G have ℓ A (c) = 2. Let Orb(c) denote the number of Hurwitz orbits of Red A (c). Then:  Orb(c) = min Rise(c; ≺) | ≺ is a total order on Ac . In particular, there exists a total order ≺ of Ac such that the number of Hurwitz orbits of Red A (c) is equal to the number of ≺-rising A-reduced factorizations of c. Proof. Any Hurwitz orbit of Red A (c) is by assumption finite, and therefore has the form (15) c = a1 a2 = a2 a3 = · · · = a p −1 a p = a p a1 . For any total order ≺ on Ac , at least one of the factorizations in (15) is ≺-rising, because otherwise we would obtain the contradiction a1 ≻ a2 ≻ · · · ≻ a p ≻ a1 . We thus obtain the inequality Orb(c) ≤ Rise(c; ≺) for any order ≺. It remains to show that equality can be achieved for some order ≺. Since ℓ A (c) = 2, any a ∈ Ac appears in exactly one Hurwitz orbit of Red A (c). We can  (i) (i) (i) therefore write Ac as the disjoint union of sets of the form a1 , a2 , . . . , a pi , where i ranges over the number of Hurwitz orbits of Red A (c). Moreover, for any (i) (i) i and any k ∈ [ pi ] we have c = ak ak+1 (where we understand p i + 1 = 1). We can (i) (i) (i) thus define a total order ≺ on Ac by setting a1 ≻ a2 ≻ · · · ≻ a pi , and we find Rise(c; ≺) = Orb(c).  If ℓ A (c) > 2, then it is not guaranteed that we can find a total order ≺ on Ac such that Rise(c; ≺) equals the number of Hurwitz orbits of Red A (c), as shown in the following example. Example 5.2. Consider the group G from Example 4.3 again, then we can check (by computer) that for any total order ≺ on A = {r, s, t, u, v} produces at least two ≺-rising maximal chains in Prrrt. (In fact Rise(rrrt; ≺) ranges between two and six.) We have, however, already seen that the Hurwitz graph H (rrrt) is connected; see Figure 7b. We note in the same example that it is not possible to find a total order on A such that for every g ≤ A c with ℓ A ( g) = 2 there is a unique ≺-rising A-reduced factorization of g. (Observe that B2 acts transitively on Red A ( g) for any such g.) Take for instance g = rt. We find Red A ( g) = {rt, ts, sv, vr }. If we suppose that ≺ is chosen in such a way that exactly one of the elements of Red A ( g) is ≺-rising, then there are four possibilities: • r ≺ t implies r ≺ v ≺ s ≺ t, which means that the two factorizations (r, v) and (v, s) in Red A (rv) are ≺-rising; • t ≺ s implies t ≺ r ≺ v ≺ s, which means that the two factorizations (r, v) and (v, s) in Red A (rv) are ≺-rising; • s ≺ v implies s ≺ t ≺ r ≺ v, which means that the two factorizations (t, r ) and (s, t) in Red A (ru) are ≺-rising; • v ≺ r implies v ≺ s ≺ t ≺ r, which means that the two factorizations (t, r ) and (s, t) in Red A (ru) are ≺-rising. This brings us to the main definition of this section. CONNECTIVITY PROPERTIES OF FACTORIZATION POSETS IN GENERATED GROUPS 17 Definition 5.3. A total order ≺ on Ac is c-compatible if for any g ≤ A c with ℓ A ( g) = 2 there exists a unique ≺-rising A-reduced factorization of g. As a direct consequence of Proposition 5.1, we get the following connection to the Hurwitz action in the case of an element of length 2. Corollary 5.4. If ℓ A (c) = 2, then there exists a c-compatible order of Ac if and only if Pc ( G, A) is Hurwitz-connected. If ℓ A (c) > 2, this is not true anymore, but the existence of a compatible order still implies local Hurwitz-connectivity (see Lemma 5.8). We see immediately that if G is abelian, then for any c ∈ G every total order of A is c-compatible. Moreover, Example 5.2 illustrates that there are factorization posets which do not admit a compatible order. However, there are also non-trivial examples. Example 5.5. Let us continue Example 2.8. Let ≺ be the lexicographic order on the set T of transpositions of S4 , i.e. (1 2) ≺ (1 3) ≺ (1 4) ≺ (2 3) ≺ (2 4) ≺ (3 4). The following table lists the elements of length two in Pc together with their sets of T-reduced factorizations of c = (1 2 3 4). The highlighted factorizations are ≺-rising. RedT ( g) g ≤T c     (1 2 3) ( 1 2 ) , ( 2 3 ) , (   2 3), (1 3), (1 3), (1 2) (1 2 4)  (1 2), (2 4), (2 4), (1 4), (1 4), (1 2) (1 3 4)  (1 3), (3 4), (3 4), (1 4), (1 4), (1 3) (2 3), (3 4) , (3 4), (2 4) , (2 4), (2 3) (2 3 4) { (1 2), (3 4), (3 4), (1 2)} (1 2)(3 4) (1 4)(2 3) { ( 1 4 ), ( 2 3 ) , (2 3), (1 4) } We thus conclude that ≺ is c-compatible. On the other hand, if we consider the following total order (1 3) ≺′ (1 2) ≺′ (1 4) ≺′ (2 3) ≺′ (2 4) ≺′ (3 4), then we observe that (1 2 3) has two ≺′ -rising A-reduced factorizations, namely  (1 2), (2 3) and 1 3), (1 2) . There is an easy way to obtain new compatible orders from a given one. Lemma 5.6. Let Ac = { a1 , a2 , . . . , a N }, and suppose that a1 ≺ a2 ≺ · · · ≺ a N is c-compatible. For any t ∈ [ N ] the order at ≺ at+1 ≺ · · · ≺ a N ≺ a1 ≺ a2 ≺ · · · ≺ at−1 is c-compatible. Proof. It suffices to consider the case t = 2, the other cases follow then by repeated application. It is immediate that we only need to consider those g ≤ A c of length two for which a1 ∈ A g . (For all other g of length two, the restriction of ≺ to A g is not affected by the cyclic shift of the indices.) Say that g is such an element, and g = a1 ais = ai2 a1 = ai3 ai2 = · · · = ais ais−1 for some s ≥ 2 and some 1 < i2 < i3 < · · · < is ≤ N. It follows that ( a1 , ais ) is the 18 HENRI MÜHLE AND VIVIEN RIPOLL unique ≺-rising A-reduced factorization of g before the shift, and is no longer ≺-rising after the shift. Moreover, ( air , air−1 ) is not ≺-rising before and after the shift whenever r ∈ {3, 4, . . . , s}. Finally ai2 a1 is not ≺-rising before the shift, but it is ≺-rising after the shift. We conclude that the number of ≺-rising A-reduced factorizations of g does not change under cyclically shifting the order ≺.  Let us collect a few properties of c-compatible orders. Lemma 5.7. If ≺ is a c-compatible order of Ac , then for any g ≤ A c the restriction ≺ g of ≺ to A g is g-compatible. Proof. This follows from the fact that any element of length two which lies below g also lies below c.  Lemma 5.8. If there exists a c-compatible order of Ac , then Pc ( G, A) is locally Hurwitzconnected. Proof. Let g ≤ A c with ℓ A ( g) = 2. If ≺ is c-compatible, then its restriction to A g is g-compatible and Corollary 5.4 implies that Red A ( g) has a unique Hurwitz orbit.  We are now in the position to prove Theorem 1.2. Proof of Theorem 1.2. Suppose that Pc is chain-connected and admits a c-compatible order ≺ of Ac . Then Lemma 5.8 implies that Pc is locally Hurwitz-connected. Theorem 4.6 now implies that Bℓ A (c) acts transitively on Red A (c).  However, Example 5.2 shows that there are cases where Red A (c) is Hurwitzconnected, but there does not exist a c-compatible order of Ac . In the remainder of this section we provide some evidence that c-compatible orders are also closely related to the shellability of the factorization poset Pc . Lemma 5.9. Let ≺ be a c-compatible order of Ac , and let ≺ g denote the restriction of ≺ to A g for some g ≤ A c with ℓ A (c) = 2. If ( a, b) is the unique ≺ g -rising A-reduced factorization of g, then a is minimal and b is maximal with respect to ≺ g . Proof. By definition and Lemma 5.7 there exists a unique ≺ g -rising A-factorization of g, say ( a, b). Let amin = min A g , and amax = max A g . Proposition 2.3 implies that we can write g = amin x for some x ∈ A g , and by minimality we find amin ≺ x. So ( amin , x ) is a rising factorization, and by uniqueness we get amin = a. Analogously we can write g = amax y; and using Hurwitz action this can be rewritten g = y′ amax for some y′ ∈ A g . By maximality we find y′ ≺ amax , which implies amax = b.  Recall that for any total order on Ac we can consider the lexicographic order on Red A (c), which is itself a total order. Lemma 5.10. For any total order ≺ of Ac and any g, h ∈ G with g ≤ A h ≤ A c the lexicographically smallest A-reduced factorization of g−1 h is ≺-rising. CONNECTIVITY PROPERTIES OF FACTORIZATION POSETS IN GENERATED GROUPS 19 Proof. In view of Lemma 2.4 the lexicographically smallest A-reduced factorization corresponds to a maximal chain in the interval [ g, h] A . In view of Lemma 2.2 and Corollary 2.5 it also corresponds to a maximal chain in the interval [1, g−1 h] A . It therefore suffices to consider the case g −1 h = c. We proceed by induction on ℓ A (c), with the claim being trivially true for ℓ A (c) ≤ 1. Suppose now that ℓ A (c) = k for k > 1, and the claim is true for any c′ ∈ G with c′ < A c. Let a1 = min Ac . By definition a1 ≤ A c, and thus ℓ A ( a1−1 c) = k − 1. Write c′ = a−1 c. By induction assumption the lexicographically smallest A-reduced factorization of c′ is ≺-rising. Say that this factorization is ( a2 , a3 , . . . , ak ). Any b ∈ Ac′ satisfies b ≤ A c′ ≤ A c, so we obtain a1  b. We conclude that ( a1 , a2 , . . . , ak ) is the lexicographically smallest A-reduced factorization of c, and it is clearly ≺-rising.  As a consequence of Lemma 5.10 we find that every interval in Pc has at least one maximal chain C ∈ M (Pc ) such that λc (C ) is ≺-rising for some total order ≺ of Ac . Here, λc is the map defined in (7). For simplicity, we will use the same notation for the following edge-labeling (16) λc : E (Pc ) → Ac , ( g, h) 7→ g−1 h of Pc , the natural labeling. One motivation of this paper was about asking which total orders of A have the property that λc produces exactly one rising chain per interval of Pc . In other words, which total orders of Ac turn λc into an ELlabeling of Pc ? We conjecture that this is the case precisely for the c-compatible orders. Conjecture 5.11. The natural labeling λc from (16) is an EL-labeling of Pc with respect to some total order ≺ of Ac if and only if Pc is totally chain-connected and ≺ is ccompatible. Observe that a maximal chain in Pc is rising with respect to λc and some total order ≺ of A if and only if the corresponding A-reduced factorization of c is ≺rising. Observe further that one direction of Conjecture 5.11 is trivially true. If λc is an EL-labeling of Pc with respect to ≺, then every interval of Pc is shellable, and by Proposition 4.1 chain-connected. Since every rank-2 interval of Pc has a unique rising chain, it follows in view of Lemma 2.4 that there exists a unique ≺-rising A-reduced factorization for any element of Pc that has length 2. Hence ≺ is c-compatible. Conjecture 5.11 does, however, not suggest that Pc can only be EL-shellable if there exists a c-compatible order of Ac . If there is no c-compatible order of Ac , we may only conclude that λc is not an EL-labeling (there may exist others, though). Consider for instance the factorization poset from Example 4.2 again. Since it is of rank 2 and not Hurwitz-connected, Corollary 5.4 implies that it does not admit a c-compatible order. However, the labeling which assigns the label sequence (1, 2) to one chain, and the label sequence (2, 1) to the remaining chains is clearly an EL-labeling. We observe that Conjecture 5.11 requires that the factorization poset is totally chain-connected. If we drop this condition, we may no longer conclude 20 HENRI MÜHLE AND VIVIEN RIPOLL rst wvu tsr rs r rt s uv st u t uw v vw w e (a) An interval in the prefix order on the quotient of the free abelian group on six generators r, s, t, u, v, w given by the relation rst = uvw. trs str wuv vwu rts srt uwv vuw rst uvw (b) The Hurwitz graph of the poset in Figure 10a. Figure 10. An factorization poset which admits a compatible generator order, but is neither chain-connected, nor EL-shellable. EL-shellability from the existence of a c-compatible order. This is illustrated in the following example. Example 5.12. Let G be the quotient of the free abelian group on six generators r, s, t, u, v, w given by the relation rst = uvw. The factorization poset Prst is shown in Figure 10a; its chain graph, depicted in Figure 10b, has two connected components. Since the generators all commute, any total order on {r, s, t, u, v, w} is rst-compatible, but we always find exactly two rising maximal chains. We note that the factorization poset in Example 5.12 admits two rising maximal chains for every c-compatible order, and the corresponding chain graph has two connected components. Problem 5.13. Let ( G, A) be a generated group, let c ∈ G be some element. Suppose that there exists a c-compatible order ≺ of Ac . Determine the connection between the number of ≺-rising A-reduced factorizations of c and the number of connected components of  C Pc ( G, A) . Is one of these quantities always smaller or equal to the other? Are they in fact the same? An affirmative solution to the following problem would enable us to weaken the hypotheses of Conjecture 5.11. Problem 5.14. Prove or disprove the following statement. If Pc ( G, A) is finite, chainconnected and admits a c-compatible order, then it is totally chain-connected. 5.2. The Well-Covered Property and EL-Labelings. Let us first state some further properties of factorization posets admitting compatible orders. Fix a total order ≺ of Ac , and for a ∈ Ac define  F≺ ( a; c) = g ∈ G | a ⋖ A g ≤ A c and there is a′ ∈ Ac with a′ ≺ a and a′ ⋖ A g . In other words, F≺ ( a; c) consists of all upper covers of a in Pc that also cover some a′ ≺ a. Proposition 5.15. If ≺ is a c-compatible order of Ac , then the natural labeling λc satisfies CONNECTIVITY PROPERTIES OF FACTORIZATION POSETS IN GENERATED GROUPS 21 (i) if g ∈ F≺ ( a; c), then λc ( a, g) ≺ λc (1, a), and (ii) if g ∈ / F≺ ( a; c), then λc ( a, g)  λc (1, a) for any a ∈ Ac and any g ∈ G with a ⋖ A g. Proof. Let Ac = { a1 , a2 , . . . , a N } where ai ≺ a j if and only if i < j. We proceed by induction on ℓ A (c) with the claim being trivial for ℓ A (c) ≤ 1. Assume that ℓ A (c) ≥ 2. Let g ∈ G be of length 2 in Pc , and pick a j ∈ Ac such that g = a j a for some a ∈ Ac . If g ∈ F≺ ( a j ; c), then there must be some ai ∈ A g with i < j. It follows that a j is not minimal in A g , and Lemma 5.9 implies that a j ≻ a, which yields λc ( a j , g) = a ≺ a j = λc (1, a j ). If g ∈ / F≺ ( a j ; c), then a j is the minimal generator in A g , and Lemma 5.9 implies a j  a. Thus λc ( a j , g) = a  a j = λc (1, a j ).  By definition for any total order ≺ of Ac the set F≺ ( a; c) is empty for a = min Ac . Factorization posets in which this is the only case when F≺ ( a; c) is empty will be awarded a special name. The point of this definition is that it provides a different perspective on the question for which total orders λc is an EL-labeling. Definition 5.16. A factorization poset Pc is well covered with respect to a total order ≺ of Ac if F≺ ( a; c) is empty if and only if a = min Ac . Moreover, Pc is totally well covered with respect to ≺ if for all g ∈ Pc the factorization poset P g is well covered with respect to the appropriate restriction of ≺. In other words, Pc is well covered if and only if for every atom a (except the smallest one with respect to ≺), we can find a cover g ⋗ A a such that a is not the smallest atom in A g . Note also that in view of Lemma 2.2, Pc is totally well covered if and only if every interval of Pc is well covered. Example 5.17. Let us continue Example 2.8 once again, and fix the lexicographic order ≺ on T from Example 5.5 again. We now list the sets F≺ (t; c) for any transposition t. t (1 2) (1 3) (1 4) (2 3) (2 4) (3 4) F≺ (t; c) ∅ ( 1 2 3)  ( 1 2 4 ) , (1 3 4)  (1 2 3), (1 4)(2 3) (1 2 4), (2 3 4)  (1 3 4), (2 3 4), (1 2)(3 4)  Since F≺ (t; c) is empty only for t = (1 2) = min Tc we conclude that Pc is well covered with respect to ≺. Example 5.18. Let us continue Example 5.12. If we fix the total order r ≺ s ≺ t ≺ u ≺ v ≺ w, then we observe that F≺ (u; rst) is empty even though u is not minimal with respect to ≺. By definition Prst is not well covered with respect to ≺. In fact, it is not well covered with respect to any total order on {r, s, t, u, v, w}. 22 HENRI MÜHLE AND VIVIEN RIPOLL Proposition 5.19. Let ≺ be a total order of Ac . If Pc is totally well covered with respect to ≺, then Pc is totally chain-connected. Proof. It suffices to prove that Pc is chain-connected. The local variant then follows by restricting ≺ to any interval of Pc and repeating the argument. We proceed by induction on ℓ A (c). Let a = min Ac . First we want to prove that any maximal chain is in the same component as some chain running through a. Let C ∈ M (Pc ), and suppose that C ∩ Ac = {b0 }. If b0 = a, we are done. Otherwise, since Pc is well covered we can find g1 ∈ F≺ (b0 ; c) and b1 ≺ b0 with b0 ⋖ A g1 and b1 ⋖ A g1 . Let D1 be any maximal chain in [ g1 , c] A . If b1 = a, then we stop; otherwise we repeat this construction k times until we reach bk = a. The sequence of chains C, {1, b0 } ∪ D1 , {1, b1 } ∪ D1 , {1, b1 } ∪ D2, {1, b2 } ∪ D2 , . . . , {1, bk } ∪ Dk shows that C can be connected to a maximal chain of Pc running through a. It remains to check that all the maximal chains running through a are in the same connected component. Since Pc is totally well covered, the interval [ a, c] A itself is well covered, therefore is chain-connected by induction hypothesis. This means any two maximal chains D1 , D2 of [ a, c] A are connected, thus any two maximal chains of Pc of the form {1} ∪ D1 , {1} ∪ D2 are also connected, which concludes the proof.  Now assume that Ac = { a1 , a2 , . . . , a N } and fix a total order ≺ of Ac . For j ∈ [ N ] denote by ⊏ j the total order of the atoms of [ a j , c] A induced by ≺, i.e. for 1 −1 ′ g, g′ ∈ G with a j ⋖ A g, g′ we have g ⊏ j g′ if and only if a− j g ≺ aj g . Lemma 5.20. Suppose that ≺ is c-compatible. For j ∈ [ N ], there are no two upper covers g, g′ of a j such that g ⊏ j g′ , but g ∈ / F≺ ( a j ; c) and g′ ∈ F≺ ( a j ; c). Proof. Suppose that there exists j ∈ [ N ] and g, g′ ≤ A c with a j ⋖ A g, g′ such that g ⊏ j g′ , but g ∈ / F≺ ( a j ; c) and g′ ∈ F≺ ( a j ; c). By definition we find a ∈ Ac with a ≺ a j and a ⋖ A g′ . Since a j ⋖ A g we can write g = a j b for some b ∈ Ac , and since g ∈ / F≺ ( a j ; c), we conclude a j  b. Analogously we can find b′ ∈ Ac such that ′ g = a j b′ . Since a j is not minimal in A g′ Lemma 5.9 implies b′ ≺ a j . Since g ⊏ j g′ 1 −1 ′ we obtain by construction that a− j g ≺ a j g . We thus obtain 1 −1 ′ ′ a j  b = a− j g ≺ aj g = b ≺ aj, which is a contradiction.  We proceed with the announced observation that Pc is totally well covered with respect to a c-compatible order ≺ if and only if λc is an EL-labeling with respect to ≺. Proposition 5.21. Let ≺ be a c-compatible order of Ac , and suppose that Pc is totally well covered with respect to ≺. Then, for every x, y ∈ G with x ≤ A y ≤ A c there exists a unique ≺-rising A-reduced factorization of x −1 y. Proof. Fix x, y ∈ G with x ≤ A y ≤ A c. In view of Lemmas 2.2 and 5.7 it suffices to consider the case x = 1 and y = c. We proceed by induction on k = ℓ A (c). The cases k ≤ 1 are trivial, so we can assume that k > 1. CONNECTIVITY PROPERTIES OF FACTORIZATION POSETS IN GENERATED GROUPS 23 Lemma 5.10 implies that the lexicographically smallest A-reduced factorization of c is ≺-rising. Denote this factorization by F = ( a1 , a2 , . . . , ak ). Now let F = ( a1 , a2 , . . . , ak ) be any ≺-rising factorization. If a1 = a1 , then ( a2 , a3 , . . . , ak ) and ( a2 , a3 , . . . , ak ) are both ≺-rising A-reduced factorization of a1−1 c. So by induction hypothesis they are equal, and F = F. Now assume a1 6= a1 , i.e., a1 ≻ a1 . Let z ≤ A c such that a1 ⋖ A z. We can thus write z = a1 b for some b ∈ Ac . By induction we obtain that ( a2 , a3 , . . . , ak ) is the lexicographically smallest A-reduced factorization of a1−1 c. It follows that a2  b, / F≺ ( a1 , c). and therefore a1  b, which in view of Proposition 5.15 implies that z ∈ Since z was chosen arbitrarily we conclude F≺ ( a1 , c) = ∅. Since Pc is (totally) well covered we conclude that a1 = min Ac , which yields the contradiction a1  a1 .  Theorem 5.22. Let ≺ be a total order of Ac . Then λc is an EL-labeling of Pc if and only if ≺ is c-compatible and Pc is totally well covered with respect to ≺. Proof. By definition of λc and of an EL-labeling, the “if” implication is exactly Proposition 5.21. Now assume that λc is an EL-labeling of Pc . Then by observing the intervals of rank 2, we automatically get that ≺ is a c-compatible order. Moreover, since λc restricts to an EL-labeling of any interval of Pc by restricting ≺ accordingly, it suffices to prove that Pc is well covered. Now pick a1 ∈ Ac with a1 6= min Ac . Let ( a2 , a3 , . . . , ak ) be the lexicographically smallest A-reduced factorization of a1−1 c. The restriction of λc to [ a1 , c] A is an EL-labeling, so we have a2 ≺ a3 ≺ · · · ≺ ak . Since a1 6= min Ac we also know that ( a1 , a2 , . . . , ak ) is not the lexicographically smallest A-reduced factorization of c. Since λc is an EL-labeling of Pc we obtain that ( a1 , a2 , . . . , ak ) is not ≺-rising, and thus a1 ≻ a2 . Consider g = a1 a2 , so that a1 ⋖ g and a2 ⋖ g. Thus g ∈ F≺ ( a1 ; c). Since a1 was chosen arbitrarily we conclude that F≺ ( a1 ; c) 6= ∅ whenever a1 6= min Ac , which precisely says that Pc is well covered.  We thus obtain the following equivalent statement of Conjecture 5.11. Conjecture 5.23. If Pc is totally chain-connected, then it is totally well covered with respect to any c-compatible order of Ac . Proposition 5.24. Conjectures 5.11 and 5.23 are equivalent. Proof. Suppose that Pc is chain-connected and let ≺ be a c-compatible order of Ac . If Conjecture 5.11 was true, then Pc would be EL-shellable, which by Theorem 5.22 yields that Pc is well covered. Thus Conjecture 5.23 would be established. Conversely, if Conjecture 5.23 was true, then Pc would be well covered, which by Proposition 5.21 yields that λc is an EL-labeling of Pc . Hence Conjecture 5.11 would be established.  Remark 5.25. The well-covered property is modeled after Condition (ii) in [12, Definition 3.1], which introduces the concept of a recursive atom order of a bounded 24 HENRI MÜHLE AND VIVIEN RIPOLL graded poset. Lemma 5.20 implies that a c-compatible order of Ac satisfies Condition (i) of [12, Definition 3.1]. Consequently, if Conjecture 5.23 were true, any c-compatible order of Ac in a totally chain-connected factorization poset would be a recursive atom order. Moreover, the proofs of Propositions 5.15, 5.21 and Theorem 5.22 are essentially verbatim parts of the proof of [12, Theorem 3.2]. Let us conclude this section with the proof of Theorem 1.1. Proof of Theorem 1.1. Suppose that Pc admits a c-compatible order of Ac and that it is totally well-covered. Proposition 5.19 implies that Pc is (totally) chainconnected. Moreover, Theorem 1.2 implies that it is Hurwitz-connected, and Proposition 5.21 implies that it is shellable.  6. The Cycle Graph of Pc In this section we prove a particular case of Conjecture 5.23. We achieve this with the help of a graph-theoretic representation of a part of Pc . We associate to such a poset a simpler structure, that can be seen as a directed labeled graph constructed from cycles (the “cycle graph” of Pc ). This structure retains only the information about the rank 2 subintervals of Pc but allows us to tackle some cases of our conjectures systematically and in a nice graphical way. 6.1. Definition and Properties of the Cycle Graph. Assume that c ∈ G is chosen in such a way that Ac is finite. Let  (17) Bc = g ∈ Pc | ℓ A ( g) = 2 be the set of length 2 elements below c. For any g ∈ Bc , the set of A-reduced factorizations of g is partitioned into Hurwitz orbits, i.e. connected components of H ( g). Since Ac is finite, each of these orbits consists of factorizations of the form g = a1 a2 = a2 a3 = · · · = a k −1 a k = a k a1 , for some k ≥ 1 and some pairwise distinct generators a1 , a2 , . . . , ak . If k = 1, then g = a21 . We can represent this Hurwitz orbit by drawing a cycle connecting a1 , a2 , . . . , ak , a1 in that order. This gives rise to the following definition. Definition 6.1. Let Pc be a factorization poset. The cycle graph of Pc , denoted by Γ(Pc ) is a directed labeled graph such that • the set of vertices of Γ(Pc ) is Ac ; • for a, b ∈ Ac we have that a → b is an oriented edge of Γ(Pc ) if and only if ab ∈ Bc ; • for a, b ∈ Ac the label of a → b is given by the product ab. Lemma 6.2. Γ(Pc ) has the following properties. • Γ(Pc ) has no multiple directed edges. • Γ(Pc ) has a loop with vertex a and label g if and only if g = a2 ∈ Bc . • The set of edge labels of Γ(Pc ) is Bc , and every element of Bc appears as the label of at least one edge of Γ(Pc ). CONNECTIVITY PROPERTIES OF FACTORIZATION POSETS IN GENERATED GROUPS (2 3) (1 4) 25 w r t (2 4) u v r s u (1 3) v (1 2) s (3 4) (a) The cycle graph of the factorization poset from Figure 3. t (b) The cycle graph of the factorization poset from Figure 7a. (c) The cycle graph of the factorization poset from Figure 10a. Figure 11. Some cycle graphs. • For any g ∈ Bc , the set of edges of Γ(Pc ) having label g is a disjoint union of directed cycles, each corresponding to a Hurwitz orbit of Red A ( g) under B2 , i.e., a connected component of H ( g). Proof. This is immediate from the definition.  Note also that Γ(Pc ) can be seen as an edge-disjoint union of cycles, each of which has constant label on its edges. Figure 11 shows three cycle graphs of factorization posets we have encountered before. For clarity we have omitted the edge labels, and have instead used colors to indicate edges with the same label. Now assume that Pc admits a c-compatible order of Ac . It follows in this case from Lemma 5.8 that for every g ∈ Bc the graph Γ(Pc ) has a unique directed cycle which consists only of edges labeled by g. In fact, the existence of a c-compatible order puts a bound on the number of edges we need to remove from Γ(Pc ) to make it acyclic. Generally, for any directed graph Γ a feedback arc set is a set of directed edges of Γ whose removal makes Γ acyclic. Let d(Γ) denote the minimal size of a feedback arc set of Γ.  Proposition 6.3. Any factorization poset Pc satisfies d Γ(Pc ) ≥ Bc . Moreover,  d Γ(Pc ) = Bc if and only if Pc admits a c-compatible order of Ac . Proof. Let us abbreviate Γ = Γ(Pc ). It is immediate from the definition that d(Γ) needs to be at least the number of edge-disjoint cycles of Γ. Moreover, every (i) g ∈ Bc produces a collection of k g ≥ 1 cycles of Γ, say Cg for i = 1, 2, . . . , k g .  (i) (i) Since the edges in any Cg are labeled by g, we find that Cg | g ∈ Bc , i ∈ [k g ] is a family of edge-disjoint cycles of Γ, and we obtain  (i) d(Γ) ≥ Cg | g ∈ Bc , i ∈ [k g ] ≥ Bc . Now suppose that d(Γ) = Bc . This implies in particular that there is only one cycle labeled by g for each g ∈ Bc ; which we denote simply by Cg . Let Γ′ be an acyclic graph that is constructed from Γ by removing d(Γ) edges. It follows that Γ′ is obtained by removing exactly one edge for each Cg . Since Γ′ is acyclic, 26 HENRI MÜHLE AND VIVIEN RIPOLL (2 3) (1 2) (1 4) w (2 4) u v (1 3) r s (3 4) (a) A reduced cycle graph of the cycle graph from Figure 11a corresponding to the order (1 2) ≺ (1 3) ≺ (1 4) ≺ (2 3) ≺ (2 4) ≺ (3 4). t (b) The reduced cycle graph of the cycle graph from Figure 11c corresponding to the order r ≺ s ≺ t ≺ u ≺ v ≺ w. Figure 12. Some reduced cycle graphs. we can define the following partial order on Ac : a  b if and only if b → a in Γ′ . Then by construction, any linear extension of  is c-compatible. Conversely suppose that there exists a c-compatible order ≺ on Ac . Then from Lemma 5.8, the Hurwitz action of B2 on Red A ( g) is transitive for any g ∈ Bc . Let us write the unique Hurwitz orbit for g as g = a1 a2 = a2 a3 = · · · = ak−1 ak = ak a1 ; this corresponds in Γ to the unique cycle Cg labeled by g. Since ≺ is a c-compatible order, we can find some i ∈ [k] such that ai ≻ ai+1 ≻ · · · ≻ ai+k−1 (indices taken mod k). Now let us remove from Γ the edge from ai−1 to ai in Cg . After doing that for each g ∈ Bc , every edge a → b in the resulting graph Γ′ satisfies b ≻ a. This implies that there can be no cycles left in Γ′ . This yields d(Γ) = Bc .  Let us denote the acyclic graph Γ′ constructed in the last paragraph of the proof of Proposition 6.3 by Γ≺ (Pc ), and call it the reduced cycle graph. Figure 12 shows reduced versions of the cycle graphs in Figures 11a and 11c. The cycle graph in Figure 11b has seven different edge labels, but it is quickly verified that we need to remove at least ten edges to make this graph acyclic. (These are the two loops plus one edge for each of the eight back-and-forth pairs.) We have seen in Example 5.2 that the corresponding factorization does not admit a compatible order, which agrees with Proposition 6.3. From the proof of Proposition 6.3 we obtain the following corollary. Corollary 6.4. Let ≺ be a c-compatible order of Ac . Let ( Ac , ⊑) be the dual of the poset induced by Γ≺ (Pc ). Then, ≺ is a linear extension of ⊑, and moreover every linear extension of ⊑ is c-compatible. Lemma 6.5. The order induced by Γ≺ (Pc ) is linear (and therefore equal to ≺) if and only if Γ≺ (Pc ) is connected as a directed graph. Proof. This follows again from the construction. More precisely, two vertices a and b of Γ≺ (Pc ) are comparable in ( Ac , ⊑) if and only if they are connected by a directed path in Γ≺ (Pc ).  We can also characterize the well covered property inside the reduced cycle graph. CONNECTIVITY PROPERTIES OF FACTORIZATION POSETS IN GENERATED GROUPS 27 Proposition 6.6. For any c-compatible order ≺, Pc is well covered if and only if the reduced cycle graph Γ≺ (Pc ) has a unique sink. In particular, if Γ≺ (Pc ) induces a linear order, then Pc is well covered. Proof. Let s0 be the minimal element of Ac for the order ≺. Clearly s0 is a sink. A vertex b of Γ≺ (Pc ) is not a sink if and only if there exists one vertex a with a → b, which is equivalent to a ≺ b, with both a and b covered by some g ∈ Bc (corresponding to the label of that edge). So b is not a sink in Γ≺ (Pc ) if and only if there exists g ∈ Bc such that g ∈ F≺ (b, c), i.e. exactly when F≺ (b, c) 6= ∅. By definition, this means that Pc is well covered if and only if Γ≺ has only s0 as a sink. The second statement follows naturally since an acyclic graph inducing a linear order has necessarily a unique sink.  Then the following conjecture, described in terms of the cycle graph, implies Conjecture 5.23. Conjecture 6.7. If Pc is totally chain-connected and admits a c-compatible order ≺ of Ac , then for any g ∈ Pc , the reduced cycle graph Γ≺ (P g ) induces a linear order. 6.2. Proof of a Specific Case. In the remainder of this section we prove a particular case of Conjecture 6.7. Theorem 6.8. Let c ∈ G be such that ℓ A (c) ≥ 3 and Ac is finite. If there exists a ∈ Ac such that there is a unique g ∈ Bc with a ⋖ A g and g 6= a2 , then Conjecture 6.7 holds. Let us denote the unique element in Bc from Theorem 6.8 by ga , and denote by b the atom such that ga = ab. In terms of the cycle graph the condition in Theorem 6.8 translates as follows: there is a unique cycle containing the vertex a (not counting a possible loop), and this cycle is labeled by ga . In particular, thanks to Proposition 2.3, we know that in any factorization of c starting with a, any other factor is either a or b. We start by explaining the strategy of proof, which depends on the size of the cycle containing a. We assume in the following the hypotheses of Conjecture 6.7, i.e., Pc is totally chain-connected and there exists a c-compatible order of Ac . In particular, Theorem 1.2 implies that P g is Hurwitz-connected for every g ≤ A c, and the size of the cycle containing a is equal to the cardinality A ga . • Suppose A ga = 2. This means that A ga = { a, b}, and a and b commute. So the hypotheses imply that g can be written ak bl for some integers k, l, and by Hurwitz-connectivity we conclude Ac = { a, b}. The cycle graph is straightforward to obtain (one cycle of length 2 and possibly one or two loops), and the reduced cycle graph is just one oriented edge. • Suppose now A ga ≥ 3. Let us write ab = bc = · · · = za, where the number of terms is | A ga |. In particular z 6= b. Suppose that aa ≤ A c, then we have either c = an (where n = ℓ A (c)) or aab ≤ A c. In the first case, we obtain by Hurwitz-connectivity the contradiction Ac = { a}. In the second case we have aab = aza, which forces the existence of az ∈ Bc with a ⋖ A az, thus contradicting the assumption that ab and aa are the only upper covers of a. So aa 6≤ A c, which implies c = abn−1 . The proof 28 HENRI MÜHLE AND VIVIEN RIPOLL of Theorem 6.8 is now reduced to the two theorems below: Theorem 6.12, which deals with the case A ga ≥ 4, and Theorem 6.15 which tackles the remaining case A ga = 3. In both cases we apply the following reasoning. We assume knowledge of the Hurwitz orbit of Red A ( ga ) and we then let the appropriate braid group act on the factorization abn−1 in order to exhibit other elements in Ac and Bc step by step. With the help of Proposition 6.11 below we deduce the size of the corresponding Hurwitz orbits, and we continue until we find no new elements. There exists a Sage-script that may assist in this process, and that can be obtained from https://www.math.tu-dresden.de/~hmuehl/files/hurwitz.sage. In many cases (when n or A ga is large enough) we find out there does not exist any c-compatible order. In the remaining cases we check explicitly that the reduced cycle graph induces a linear order. We first need one technical result that holds in any group G. Let x, y ∈ G and define c = xy. Consider the sequence ( xi )i≥0 given by x0 = x, x1 = y, and xi = xi−−11 c for all i ≥ 1, so that we have c = x 0 x 1 = x 1 x 2 = · · · = x i x i +1 = · · · . Note that the set { x0 , x1 , x2 , . . . , } is finite if and only if the sequence ( x i )i≥0 is periodic, and in this case the size of this set equals the period. Moreover, define the alternating order of { x, y}, denoted by Alt( x, y), to be the minimal n ≥ 1 such that the alternating products of x and y having length n are equal, i.e. xyx · · · = yxy · · · . | {z } | {z } (18) n factors n factors If there is no such n, then we simply set Alt( x, y) = ∞. Observe that if Alt( x, y) = n < ∞, then we have equality in (18) for any multiple of n. The next proposition relates Alt( x, y) and the sequence ( xi )i≥0. Proposition 6.9. Let G be a group, let x, y ∈ G, and define the sequence ( x i )i≥0 and the number Alt( x, y) as above. Let n ∈ N >0 . The sequence ( xi )i≥0 has period n if and only if Alt( x, y) = n. Remark 6.10. The two components of the equivalence are reminiscent of two wellknown presentations of the Artin-Tits group associated to the dihedral group I2 (n). The relation xyx · · · = yxy · · · corresponds to the classical braid presentation, whereas the relations x0 x1 = x1 x2 = · · · = xn−1 x0 correspond to the dual braid presentation introduced in [5]. Proof. Let c = xy. For all k ≥ 0 we have ( x0 x1 )( x2 x3 ) · · · ( x2k−2 x2k−1 ) x2k = x0 ( x1 x2 )( x3 x4 ) · · · ( x2k−1 x2k ), which yields the equation ck x2k = x0 ck . Hence x2k = c−k xck . Similarly we obtain x2k+1 = c−k yck . For any r ≥ 0 denote by πr ( x, y) the alternating product xyx · · · consisting of r factors. We thus obtain for k ≥ 1 that x2k = x if and only if ( xy)k x = x ( xy)k if and only if π2k (y, x ) = π2k ( x, y). CONNECTIVITY PROPERTIES OF FACTORIZATION POSETS IN GENERATED GROUPS 29 Analogously we find x2k+1 = x if and only if ( xy)k x = y( xy)k if and only if π2k+1 ( x, y) = π2k+1 (y, x ). This establishes the equivalence.  Proposition 6.9 has the following direct consequence. Proposition 6.11. Let ( G, A) be a generated group, where A is closed under G-conjugation, and let a, b ∈ A. Suppose that Red A ( ab) is finite. Then the Hurwitz orbit of Red A ( ab) containing ( a, b) has the same size as the Hurwitz orbit of Red A (ba) containing (b, a). Proof. Let Ω be the Hurwitz orbit of Red A ( ab) containing ( a, b). Since Ω ⊆ Red A ( ab) we conclude that Ω is finite and we can write Ω = { a0 a1 , a1 a2 , . . . , a p −1 a p , a p a0 } for some p ≥ 1, and a0 = a and a1 = b. It follows that the sequence ( ai )i≥0 from Proposition 6.9 has period p, which yields Alt( a, b) = p. We thus find that the sequence ( āi )i≥0 where ā0 = b and ā1 = a has period p as well. We obtain the set Ω = { ā0 ā1 , ā1 ā2 , . . . , ā p−1 ā p , ā p ā0 }, which clearly is the Hurwitz orbit of Red A (ba) containing (b, a).  Theorem 6.12. Let c ∈ G be such that ℓ A (c) = n ≥ 3 and Ac is finite. Suppose that: • Pc is totally chain-connected; • there exists a ∈ Ac and a unique ga ∈ Bc with a ⋖ A ga and ga 6= a2 ; • c = abn−1 , where b is such that ga = ab; • A ga ≥ 4. Then there does not exist a c-compatible order of Ac . Proof. Assume that there exists a c-compatible order. Since Pc is totally chainconnected, Theorem 1.2 implies in particular that P g is Hurwitz-connected for any g ≤ A c. Let us write ab = bc = · · · = za, where the number of terms is A ga . Since c = abn−1 , we have abb ∈ Pc . Rename a = a0 and b = b0 . We can thus write a0 b0 b0 = b0 c0 b0 = b0 b0 a1 = b0 a1 b1 = a1 b1 b1 , for appropriate elements c0 , a1 , b1 . If we continue this process, the finiteness of Ac implies that we can find a minimal k ≥ 1 with ak = a0 and bk = b0 . If k = 1, then we get from b0 a1 = a1 b1 that a and b commute. We thus obtain the contradiction A ga = 2. We therefore have k ≥ 2. Moreover, we observe that for i ∈ {0, 1, . . . , k − 1} we have ai bi = bi ci and ci bi = ai+1 bi+1 . Let us denote by Ci the cycle in Γ(P abb ) labeled by ai bi . Proposition 6.11 implies Ci = Ci+1 . In particular for each i ∈ {0, 1, . . . , k − 1} the graph Γ(P abb ) contains the 2-cycle ab a i +1 bi +1 i i bi −→ ci −→ bi . We also observe that there exists a cycle a0 b0 a1 b1 a1 b1 a2 b2 a k −1 bk −1 a k −1 bk −1 a0 b0 a0 −→ b0 −→ a1 −→ b1 −→ · · · −→ ak−1 −→ bk−1 −→ a0 . 30 HENRI MÜHLE AND VIVIEN RIPOLL a0 b0 b2 c0 c2 c1 a1 a2 b1 Figure 13. The cycle graph Γ(P abb ) from Example 6.13, corresponding to the case A ga = 5 and k = 3 of Theorem 6.12. (For simplicity the loops are all drawn black even though their labels are distinct.) So we exhibited k + 1 cycles that are mutually edge-disjoint by construction, whereas there are only k elements of length 2 in P abb . We conclude that any feedback arc set of Γ(P abb ) needs to contain two edges with the same label, which in light of Proposition 6.3 implies that we cannot find an abb-compatible order of A abb . Consequently we cannot find a c-compatible order of Ac .  Example 6.13. Let us illustrate Theorem 6.12 for the case A ga = 5 and k = 3. Let c = abb, and write a0 = a and b0 = b. We obtain a0 b0 b0 = b0 c0 b0 = b0 b0 a1 = b0 a1 b1 = a1 b1 b1 = b1 c1 b1 = b1 b1 a2 = b1 a2 b2 = a2 b2 b2 = b2 c2 b2 = b2 b2 a0 = b2 a0 b0 = a0 b0 b0 . The factorization poset Pc is shown in Figure 14, and the corresponding cycle graph is shown in Figure 13. The reader is invited to verify that there does not exist a c-compatible order of Ac = { a0 , b0 , c0 , a1 , b1 , c1 , a2 , b2 , c2 }. By construction, however, B3 acts transitively on Red Ac (c), and moreover B2 acts transitively on Red Ac ( g) for any g ≤ A c with ℓ Ac ( g) = 2. Remark 6.14. If A ga = 4, then we have c0 = c1 = · · · = ck−1 . Indeed, observe that we can write c0 b0 = b0 a1 = a1 b1 = b1 c1 . Proposition 6.11 implies that this is the whole Hurwitz orbit, which forces c0 = c1 . Theorem 6.15. Let c ∈ G be such that ℓ A (c) = n ≥ 3 and Ac is finite. Suppose that: • there exists a ∈ Ac and a unique ga ∈ Bc with a ⋖ A ga and ga 6= a2 ; • c = abn−1 , where b is such that ga = ab; • A ga = 3. Then Conjecture 6.7 holds. CONNECTIVITY PROPERTIES OF FACTORIZATION POSETS IN GENERATED GROUPS 31 a 0 b0 b0 b0 b0 a 0 b0 c 1 b2 b1 c 2 c 0 b0 b2 b2 b1 b2 b1 b1 c 1 b1 b0 a0 c0 a1 b2 c2 c1 b1 a2 1 Figure 14. The factorization poset of Example 6.13, corresponding to the cycle graph from Figure 13. abb bb ab bc cc a b c d a b c d 1 (a) The factorization poset of Pc in the case n = 3 of Theorem 6.15. (b) The cycle graph of the factorization poset of Figure 15a. (For simplicity the loops are all drawn black even though their labels are distinct.) Figure 15. Illustration of the case n = 3 in Theorem 6.15. Proof. Suppose that Pc is totally chain-connected, and there exists a c-compatible order ≺ of Ac . In particular, Theorem 1.2 implies that P g is Hurwitz-connected for any g ≤ A c. Let A ga = { a, b, c}, and say that ga = ab = bc = ca. If n = 3, then c = abb and Proposition 6.11 implies that there is a unique possible cycle graph, which is shown in Figure 15b. The corresponding factorization poset is shown in Figure 15a. There are four c-compatible orders of Ac (namely a ≺ c ≺ d ≺ b and its cyclic shifts, see Lemma 5.6), and we can check that in each case the reduced cycle graph Γ≺ (Pc ) induces a linear order. If n = 4, then Proposition 6.11 implies once again that there is a unique possible cycle graph, which is shown in Figure 16b. The corresponding factorization poset is shown in Figure 16a. There are six c-compatible orders of Ac (namely a ≺ c ≺ f ≺ d ≺ e ≺ b and its cyclic shifts), and we can check that in each case the reduced cycle graph Γ≺ (Pc ) induces a linear order. 32 HENRI MÜHLE AND VIVIEN RIPOLL abbb ccc abb bbb bdd bbe ddd ab cc bb cb cd db dd a c b f d e a c f b d e 1 (a) The factorization poset of Pc in the case n = 4 of Theorem 6.15. (b) The cycle graph of the factorization poset of Figure 16a. (For simplicity the loops are all drawn black even though they represent distinct elements.) Figure 16. Illustration of the case n = 4 in Theorem 6.15. Next let n = 5, and let a0 = a, b0 = b and c0 = c. We have c = a0 b0 b0 b0 b0 = b0 c0 b0 b0 b0 , which in view of Proposition 2.3 implies that c0 b0 ∈ Bc . Proposition 6.11 implies that there is some d ∈ Ac with c0 b0 = b0 d = dc0 . We continue to find b0 c0 b0 b0 b0 = b0 b0 db0 b0 , and as before we find db0 ∈ Bc , which forces the existence of b1 ∈ Ac with db0 = b0 b1 = b1 d. Now we have b0 b0 db0 b0 = b0 b0 b0 b1 b0 so that b1 b0 ∈ Bc and we find a1 ∈ Ac with b1 b0 = b0 a1 = a1 b1 . We finish this iteration to obtain c = b0 b0 b0 b1 b0 = b0 b0 b0 b0 a1 = b0 b0 b0 a1 b1 = b0 b0 a1 b1 b1 = b0 a1 b1 b1 b1 = a1 b1 b1 b1 b1 . Since Ac is finite we can find some k > 1 with ak = a0 and bk = b0 . This also implies that c0 is in fact bk−1 , and we have bi−1 bi = dbi−1 = bi d for i ∈ [k]. If k = 2 the cycle graph consists of two cycles a → b → c → a, and a → c → b → a, which contradicts the assumption that ga is the unique element covering a. (But even without that assumption we would still obtain a contradiction to the fact that ≺ is c-compatible.) If k = 3 we can find the following sequence of equalities coming from repeated Hurwitz moves: a0 b0 b0 b0 b0 = b0 b2 b0 b0 b0 = b0 db2 b0 b0 = db2 b2 b0 b0 = db2 db2 b0 = db1 b2 b2 b0 = db1 b2 b0 d = db1 db2 d = db0 b1 b2 d = db0 b2 dd = da0 b0 dd = da0 db2 d. The highlighted words imply a0 = b1 , which contradicts the assumption that ga is the unique element covering a. bi +1 d Now if k ≥ 4 we observe that Γ(Pc ) has the following 2k + 1 cycles: bi −→ a i +1 bi +1 bd bi +1 d i bi+1 −→ bi and bi −→ d −→ bi for i ∈ {0, 1, . . . , k − 1} as well as a0 b0 a1 b1 a1 b1 a2 b2 a2 b2 a0 b0 a0 −→ b0 −→ a1 −→ b1 −→ a2 −→ · · · bk−1 −→ a0 . CONNECTIVITY PROPERTIES OF FACTORIZATION POSETS IN GENERATED GROUPS 33 a0 b3 a3 b0 a1 d b1 b2 a2 Figure 17. The cycle graph Γ(P abbbb ) corresponding to the case k = 4 of Theorem 6.15. (For simplicity the loops are all drawn black even though they represent distinct elements.) The thick blue edges represent a rank-2 element which affords a nontransitive Hurwitz action. It follows that any feedback arc set of Pc needs to contain at least two edges with the same label, which in view of Proposition 6.3 contradicts the assumption that ≺ is c-compatible. In fact, if k is even, then we can explicitly find an element in Bc on whose set of A-reduced factorizations B2 does not act transitively. See Figure 17 for an illustration of the case k = 4. If n > 5, then we observe that Pc contains an interval isomorphic to P ab4 . We have seen in the previous paragraph, that the restriction of ≺ to this interval cannot be ab4 -compatible, which implies that ≺ cannot be c-compatible. This, however, contradicts our assumption on ≺.  References [1] Drew Armstrong, Generalized Noncrossing Partitions and Combinatorics of Coxeter Groups, Memoirs of the American Mathematical Society 202 (2009). [2] Christos A. Athanasiadis, Thomas Brady, and Colum Watt, Shellability of Noncrossing Partition Lattices, Proceedings of the American Mathematical Society 135 (2007), 939–949. [3] Barbara Baumeister, Thomas Gobet, Kieran Roberts, and Patrick Wegener, On the Hurwitz Action in Finite Coxeter Groups, Journal of Group Theory 20 (2017), 103–132. [4] Tzachi Ben-Itzhak and Mina Teicher, Graph Theoretic Method For Determining Hurwitz Equivalence in the Symmetric Group, Israel Journal of Mathematics 135 (2003), 83–91. [5] David Bessis, The Dual Braid Monoid, Annales Scientifiques de l’École Normale Supérieure 36 (2003), 647–683. [6] David Bessis, A Dual Braid Monoid for the Free Group, Journal of Algebra 302 (2006), 55–69. [7] David Bessis, Finite Complex Reflection Arrangements are K ( π, 1), Annals of Mathematics 181 (2015), 809–904. [8] Philippe Biane, Some Properties of Crossings and Partitions, Discrete Mathematics 175 (1997), 41–53. [9] Anders Björner, Shellable and Cohen-Macaulay Partially Ordered Sets, Transactions of the American Mathematical Society 260 (1980), 159–183. [10] Anders Björner and Francesco Brenti, Combinatorics of Coxeter Groups, Springer, New York, 2005. 34 HENRI MÜHLE AND VIVIEN RIPOLL [11] Anders Björner, Adriano Garsia, and Richard P. Stanley, An Introduction to Cohen-Macaulay Posets, Ordered Sets, Springer, Dordrecht, 1982. [12] Anders Björner and Michelle L. Wachs, On Lexicographically Shellable Posets, Transactions of the American Mathematical Society 277 (1983), 323–341. [13] Anders Björner and Michelle L. Wachs, Shellable and Nonpure Complexes and Posets I, Transactions of the American Mathematical Society 348 (1996), 1299–1327. [14] Thomas Brady, A Partial Order on the Symmetric Group and new K ( π, 1)’s for the Braid Groups, Advances in Mathematics 161 (2001), 20–40. [15] Thomas Brady and Colum Watt, Non-Crossing Partition Lattices in Finite Real Reflection Groups, Transactions of the American Mathematical Society 360 (2008), 1983–2005. [16] Egbert Brieskorn, Automorphic Sets and Braids and Singularities, Contemporary Mathematics 78 (1988), 45–115. [17] Pierre Deligne, Letter to Eduard Looijenga, 1974. Available at http://homepage.univie.ac.at/christian.stump/Deligne_Looijenga_Letter_09-03-1974.pdf . [18] Xiang dong Hou, Hurwitz Equivalence in Tuples of Generalized Quaternion Groups and Dihedral Groups, The Electronic Journal of Combinatorics 15 (2008). [19] Frank A. Garside, The Braid Group and Other Groups, The Quarterly Journal of Mathematics 20 (1969), 235–254. [20] Masahiro Hachimori, Decompositions of Two-Dimensional Simplicial Complexes, Discrete Mathematics 308 (2008), 2307–2312. [21] Jia Huang, Joel B. Lewis, and Victor Reiner, Absolute Order in General Linear Groups, Journal of the London Mathematical Society 95 (2017), 223–247. [22] James E. Humphreys, Reflection Groups and Coxeter Groups, Cambridge University Press, Cambridge, 1990. [23] Adolf Hurwitz, Ueber Riemann’sche Flächen mit gegebenen Verzweigungspunkten, Math. Ann. 39 (1891), 1–60. [24] Viatcheslav M. Kharlamov and Viktor S. Kulikov, On Braid Monodromy Factorizations, Izvestiya Rossiiskoi Akademii Nauk Seriya Matematicheskaya 67 (2003), 79–118. [25] Germain Kreweras, Sur les partitions non croisées d’un cycle, Discrete Mathematics 1 (1972), 333– 350. [26] Viktor S. Kulikov, Factorizations in Finite Groups, Sbornik: Mathematics 204 (2013), 237–263. [27] Viktor S. Kulikov and Mina Teicher, Braid Monodromy Factorizations and Diffeomorphism Types, Izvestiya Rossiiskoi Akademii Nauk Seriya Matematicheskaya 64 (2000), 89–120. [28] Gustav I. Lehrer and Tonny A. Springer, Reflection Subquotients of Unitary Reflection Groups, Canadian Journal of Mathematics 51 (1999), 1175–1193. [29] Gustav I. Lehrer and Donald E. Taylor, Unitary Reflection Groups, Cambridge University Press, Cambridge, 2009. [30] Anatoly Libgober, Invariants of Plane Algebraic Curves via Representations of the Braid Groups, Inventiones Mathematicae 95 (1989), 25–30. [31] Henri Mühle, EL-Shellability and Noncrossing Partitions Associated with Well-Generated Complex Reflection Groups, European Journal of Combinatorics 43 (2015), 249–278. [32] Henri Mühle and Philippe Nadeau, The Alternating Group Generated by 3-Cycles, Séminaire Lotharingien de Combinatoire (2017). Proceedings of FPSAC’17. [33] Victor Reiner, Non-Crossing Partitions for Classical Reflection Groups, Discrete Mathematics 177 (1997), 195–222. [34] Victor Reiner, Vivien Ripoll, and Christian Stump, On Non-Conjugate Coxeter Elements in WellGenerated Reflection Groups, Mathematische Zeitschrift 285 (2017), 1041–1062. [35] Charmaine Sia, Hurwitz Equivalence in Tuples of Dihedral Groups, Dicyclic Groups, and Semidihedral Groups, The Electronic Journal of Combinatorics 16 (2009). [36] Richard P. Stanley, Enumerative Combinatorics, Vol. 1, 2nd ed., Cambridge University Press, Cambridge, 2011. [37] Andrew Vince and Michelle L. Wachs, A Shellable Poset that is not Lexicographically Shellable, Combinatorica 5 (1985), 257–260. [38] James W. Walker, A Poset which is Shellable but not Lexicographically Shellable, European Journal of Combinatorics 6 (1985), 287–288. CONNECTIVITY PROPERTIES OF FACTORIZATION POSETS IN GENERATED GROUPS 35 [39] Patrick Wegener, On the Hurwitz Action in Affine Coxeter Groups (2017), available at arXiv:1710.06694. Institut für Algebra, Technische Universität Dresden, Zellescher Weg 12–14, 01069 Dresden, Germany. E-mail address: [email protected] Fakultät für Mathematik, Universität Wien, Oskar-Morgenstern-Platz 1, 1090 Vienna, Austria. E-mail address: [email protected]
4math.GR
Topic modeling of public repositories at scale using names in source code Vadim Markovtsev [email protected] Eiso Kant [email protected] arXiv:1704.00135v2 [cs.PL] 20 May 2017 source{d}, Madrid, Spain February 2017 Abstract—Programming languages themselves have a limited number of reserved keywords and character based tokens that define the language specification. However, programmers have a rich use of natural language within their code through comments, text literals and naming entities. The programmer defined names that can be found in source code are a rich source of information to build a high level understanding of the project. The goal of this paper is to apply topic modeling to names used in over 13.6 million repositories and perceive the inferred topics. One of the problems in such a study is the occurrence of duplicate repositories not officially marked as forks (obscure forks). We show how to address it using the same identifiers which are extracted for topic modeling. We open with a discussion on naming in source code, we then elaborate on our approach to remove exact duplicate and fuzzy duplicate repositories using Locality Sensitive Hashing on the bag-of-words model and then discuss our work on topic modeling; and finally present the results from our data analysis together with open-access to the source code, tools and datasets. Index Terms—programming, open source, source code, software repositories, git, GitHub, topic modeling, ARTM, locality sensitive hashing, MinHash, open dataset, data.world. I. I NTRODUCTION There are more than 18 million non-empty public repositories on GitHub which are not marked as forks. This makes GitHub the largest version control repository hosting service. It has become difficult to explore such a large number of projects and nearly impossible to classify them. One of the main sources of information that exists about public repositories is their code. To gain a deeper understanding of software development it is important to understand the trends among open-source projects. Bleeding edge technologies are often used first in open source projects and later employed in proprietary solutions when they become stable enough1 . An exploratory analysis of open-source projects can help to detect such trends and provide valuable insight for industry and academia. Since GitHub appeared the open-source movement has gained significant momentum. Historically developers would manually register their open-source projects in software digests. As the number of projects dramatically grew, those lists became very hard to update; as a result they became more fragmented and started exclusively specializing in narrow 1 Notable examples include the Linux OS kernel, the PostgreSQL database engine, the Apache Spark cluster-computing framework and the Docker containers. technological ecosystems. The next attempt to classify open source projects was based on manually submitted lists of keywords. While this approach works [1], it requires careful keywords engineering to appear comprehensive, and thus not widely adopted by the end users in practice. GitHub introduced repository tags in January 2017 which is a variant of manual keywords submission. The present paper describes how to conduct fully automated topic extraction from millions of public repositories. It scales linearly with the overall source code size and has substantial performance reserve to support the future growth. We propose building a bag-of-words model on names occurring in source code and applying proven Natural Language Processing algorithms to it. Particularly, we describe how ”Weighted MinHash” algorithm [2] helps to filter fuzzy duplicates and how an Additive Regularized Topic Model (ARTM) [3] can be efficiently trained. The result of the topic modeling is a nearly-complete open source projects classification. It reflects the drastic variety in open source projects and reflect multiple features. The dataset we work with consists of approx. 18 million public repositories retrieved from GitHub in October 2016. The rest of the paper is organised as follows: Section II reviews prior work on the subject. Section III elaborates on how we turn software repositories into bags-of-words. Section IV describes the approach to efficient filtering of fuzzy repository clones. Section V covers the building of the ARTM model with 256 manually labeled topics. Section VI presents the achieved topic modeling results. Section VII lists the opened datasets we were able to prepare. Finally, section VIII presents a conclusion and suggests improvements to future work. II. R ELATED WORK A. Academia There was an open source community study which presented statistics about manually picked topics in 2005 by J. Xu et.al. [4]. Blincoe et.al. [5] studied GitHub ecosystems using reference coupling over the GHTorrent dataset [6] which contained 2.4 million projects. This research employs an alternative topic modeling method on source code of 13.6 million projects. Instead of using the GHTorrent dataset we’ve prepared open datasets from almost all public repositories on GitHub to be able to have a more comprehensive overview. M. Lungi [7] conducted an in-depth study of software ecosystems in 2009, the year when GitHub appeared. The examples in this work used samples of approx. 10 repositories. And the proposed discovery methods did not include Natural Language Processing. The problem of the correct analysis of forks on GitHub has been discussed by Kalliamvakou et.al. [8] along with other valuable concerns. Topic modeling of source code has been applied to a variety of problems reviewed in [9]: improvement of software maintenance [10], [11], defects explanation [12], concept analysis [13], [14], software evolution analysis [15], [16], finding similarities and clones [17], clustering source code and discovering the internal structure [18], [19], [20], summarizing [21], [22], [23]. In the aforementioned works, the scope of the research was focused on individual projects. The usage of topic modeling [24] focused on improving software maintenance and was evaluated on 4 software projects. Concepts were extracted using a corpus of 24 projects in [25]. Giriprasad Sridhara et.al. [26], Yang and Tan [27], Howard et.al. [28] considered comments and/or names to find semantically similar terms; Haiduc and Marcus [29] researched common domain terms appearing in source code. The presented approach in this papers reveals similar and domain terms, but leverages a much significantly larger dataset of 13.6 million repositories. Bajracharya and Lopes [30] trained a topic model on the year long usage log of Koders, one of the major commercial code search engines. The topic categories suggested by Bajracharya and Lopes share little similarity with the categories described in this paper since the input domain is much different. B. Industry To our knowledge, there are few companies which maintain a complete mirror of GitHub repositories. source{d} [31] is focused on doing machine learning on top of the collected source code. Software Heritage [32] strives to become web.archive.org for open source software. SourceGraph [33] processes source code references, internal and external, and created a complete reference graph for projects written in Golang. libraries.io [34] is not GitHub centric but rather processes the dependencies and metadata of open source packages fetched from a number of repositories. It analyses the dependency graph (at the level of projects, while SourceGraph analyses at the level of functions). III. B UILDING THE BAG - OF - WORDS MODEL This section follows the way we convert software repositories into bags-of-words, the model which stores each project as a multiset of its identifiers, ignoring the order while maintaining multiplicity. For the purpose of our analysis we choose to use the latest version of the master branch of each repository. And treat each repository as a single document. An improvement for further research would be to use the entire history of each repository including unique code found in each branch. A. Preliminary Processing Our first goal is to process each repository to identify which files contain source code, and which files are redundant for our purpose. GitHub has an open-source machine learning based library named linguist [35] that identifies the programming language used within a file based on its extension and contents. We modified it to also identify vendor code and automatically generated files. The first step in our preprocessing is to run linguist over each repository’s master branch. From 11.94 million repositories we end up with 402.6 million source files in which we have high confidence it is source code written by a developer in that project. Identifying the programming language used within each file is important for the next step, the names extraction, as it determines the programming language parser. B. Extracting Names Source code highlighting is a typical task for professional text editors and IDE’s. There have been several open source libraries created to tackle this task. Each works by having a grammar file written per programming language which contains the rules. Pygments [36] is a high quality communitydriven package for Python which supports more than 400 programming languages and markups. According to Pygments, all source code tokens are classified across the following categories: comments, escapes, indentations and generic symbols, reserved keywords, literals, operators, punctuation and names. Linguist and Pygments have different sets of supported languages. Linguist stores it’s list at master/lib/linguist/languages.yml and the similar Pygments list is stored as pygments.lexers.LEXERS. Each has nearly 400 items and the intersection is approximately 200 programming languages (”programming” Linguist’s item type). The languages common to Linguist and Pygments which were chosen are listed in appendix A. In this research we apply Pygments to the 402.6 million source files to extract all tokens which belong to the type Token.Name. C. Processing names The next step is to process the names according to naming conventions. As an example class FooBarBaz adds three words to the bag: foo, bar and baz, or int wdSize should add two: wdsize and size. Fig. 1 is the full listing of the function written in Python 3.4+ which splits identifiers. In this step each repository is saved as an sqlite database file which contains a table with: programming language, name extracted and frequency of occurance in that repository. The total number of unique names that were extracted were 17.28 million. Fig. 1. Identifier splitting algorithm, Python 3.4+ Fig. 2. Name lengths distribution NAME_BREAKUP_RE = re.compile(r"[ˆa-zA-Z]+") def extract_names(token): token = token.strip() prev_p = [""] def ret(name): r = name.lower() if len(name) >= 3: yield r if prev_p[0]: yield prev_p[0] + r prev_p[0] = "" else: prev_p[0] = r for part in NAME_BREAKUP_RE.split(token): if not part: continue prev = part[0] pos = 0 for i in range(1, len(part)): this = part[i] if prev.islower() and this.isupper(): yield from ret(part[pos:i]) pos = i elif prev.isupper() and this.islower(): if 0 < i - 1 - pos <= 3: yield from ret(part[pos:i - 1]) pos = i - 1 elif i - 1 > pos: yield from ret(part[pos:i]) pos = i prev = this last = part[pos:] if last: yield from ret(last) Fig. 3. Influence of the stemming threshold on the vocabulary size D. Stemming names It is common to stem names when creating a bag-of-words in NLP. Since we are working with natural language that is predominantly English we have applied the Snowball stemmer [37] from the Natural Language Toolkit (NLTK) [38]. The stemmer was applied to names which were >6 characters long. In further research a diligent step would be to compare results with and without stemming of the names, and also to predetermine the language of the name (when available) and apply stemmers in different languages. The length of words on which stemming was applied was chosen after the manual observation that shorter identifiers tend to collide with each other when stemmed and longer identifiers need to be normalized. Fig. 2 represents the distribution of identifier lengths in the dataset: It can be seen that the most common name length is 6. Fig. 3 is the plot of the number of unique words in the dataset depending on the stemming threshold: We observe the breaking point at length 5. The vocabulary size linearly grows starting with length 6. Having manually inspected several collisions on smaller thresholds, we came to the conclusion that 6 corresponds to the best trade-off between collisions and word normalization. The Snowball algorithm was chosen based on the comparative study by Jivani [39]. Stems not being real words are acceptable but it is critical to have minimum over-stemming since it increases the number of collisions. The total number of unique names are 16.06 million after stemming. To be able to efficiently pre-process our data we used Apache Spark [40] running on 64 4-core nodes which allowed us to process repositories in parallel in less than 1 day. However, before training a topic model one has to exclude near-duplicate repositories. In many cases GitHub users include the source code of existing projects without preserving the commit history. For example, it is common for web sites, blogs and Linux-based firmwares. Those repositories contain very little original changes and may introduce frequency noise into the overall names distribution. This paper suggests the way to filter the described fuzzy duplicates based on the bag of words model built on the names in the source code. IV. F ILTERING NEAR - DUPLICATE REPOSITORIES There were more than 70 million GitHub repositories in October 2016 by our estimation. Approx. 18 million were not marked as forks. Nearly 800,000 repositories were de facto forks but not marked correspondingly by GitHub. That is, they had the same git commit history with colliding hashes. Such repositories may appear when a user pushes a cloned or imported repository under his or her own account without using the GitHub web interface to initiate a fork. When we remove such hidden forks from the initial 18 million repositories, there still remain repositories which are highly similar. A duplicate repository is sometimes the result of a git push of an existing project with a small number of changes. For example, there are a large number of repositories with the Linux kernel which are ports to specific devices. In another case, repositories containing web sites were created using a cloned web engine and preserving the development history. Finally, a large number of github.io repositories are the same. Such repositories contain much text content and few identifiers which are typically the same (HTML tags, CSS rules, etc.). Filtering out such fuzzy forks speeds up the future training of the topic model and reduces the noise. As we obtained a bag-of-words for every repository, the naive approach would be to measure all pairwise similarities and find cliques. But first we need to define what is the similarity between bags-ofwords. A. Weighted MinHash Suppose that we have two dictionaries - key-value mappings with unique keys and values indicating non-negative ”weights” of the corresponding keys. We would like to introduce a similarity measure between them. The Jaccard Similarity between dictionaries A = {i : ai }, i ∈ I and B = {j : bj }, j ∈ J is defined as P min(ak , bk ) k∈K ,K = I ∪ J (1) J= P max(ak , bk ) k∈K where ak = 0, k ∈ / I and bk = 0, k ∈ / J. If the weights are binary, this formula is equivalent to the common Jaccard Similarity definition. The same way as MinHash is the algorithm to find similar sets in linear time, Weighted MinHash is the algorithm to find similar dictionaries in linear time. Weighted MinHash was introduced by Ioffe in [2]. We have chosen it in this paper because it is very efficient and allows execution on GPUs instead of large CPU clusters. The proposed algorithm depends on the parameter K which adjusts the resulting hash length. 1. for k in range(K): 1.1. Sample rk , ck ∼ Gamma(2, 1) - Gamma distribution (their PDF is P (r) = re−r ), and βk ∼ U nif orm(0, 1). 1.2. Compute tk = b ln Sk + βk c rk yk = erk (tk −βk ) zk = yk e ck ak = zk rk (2) (3) (4) (5) 2. Find k ∗ = arg mink ak and return the samples (k ∗ , tk∗ ). Thus given K and supposing that the integers are 32bit we obtain the hash with size 8K bytes. Samples from Gamma(2, 1) distribution can be efficiently calculated as r = − ln(u1 u2 ) where u1 , u2 ∼ U nif orm(0, 1) - uniform distribution between 0 and 1. We developed the MinHashCUDA [41] library and Python native extension which is the implementation of Weighted MinHash algorithm for NVIDIA GPUs using CUDA [42]. There were several engineering challenges with that implementation which are unfortunately out of the scope of this paper. We were able to hash all 10 million repositories with hash size equal to 128 in less than 5 minutes using MinHashCUDA and 2 NVIDIA Titan X Pascal GPU cards. B. Locality Sensitive Hashing Having calculated all the hashes in the dataset, we can perform Locality Sensitive Hashing. We define several hash tables, each for it’s own sub-hash which depends on the target level of false positives. Same elements will appear in the same bucket; union of the bucket sets across all the hash tables for a specific sample yields all the similar samples. Since our goal is to determine the sets of mutually similar samples, we should consider the set intersection instead. We used the implementation of Weighted MinHash LSH from Datasketch [43]. It is designed after the corresponding algorithm in Mining of Massive Datasets [44]. LSH takes a single parameter - the target Weighted Jaccard Similarity value (”threshold”). MinHash LSH puts every repository in a number of separate hash tables which depend on the threshold and the hash size. We used the default threshold 0.9 in our experiments which ensures a low level of dissimilarity within a hash table bin. Algorithm 5 describes the fuzzy duplicates detection pipeline. Step 6 discards less than 0.5% of all the sets and aims at reducing the number of false positives. The bins size distribution after step 5 is depicted on Fig. 4 - it is clearly seen that the majority of the bins has the size 2. Step 6 uses Weighted Jaccard similarity threshold 0.8 instead of 0.9 to be sensitive to evident outliers exclusively. Table I reveals how different hash sizes influence on the resulting number of fuzzy clones: Algorithm 5 results in approximately 467,000 sets of fuzzy duplicates with overall 1.7 million unique repositories. Each repository appears in two sets on average. The examples of fuzzy duplicates are listed in appendix B. The detection algorithm works especially well for static web sites which share the same JavaScript libraries. 1: 2: 3: 4: 5: 6: 7: Fig. 4. LSH hash table’s bin size distribution Fig. 6. Stemmed names frequency histogram Fig. 5. Fuzzy duplicates detection pipeline Fig. 7. Bag sizes after fuzzy duplicates filtering Calculate Weighted MinHash with hash size 128 for all the repositories. Feed each hash to MinHash LSH with threshold 0.9 so that every repository appears in each of the 5 hash tables. Filter out hash table bins with single entries. For every repository, intersect the bins it appears in across all the hash tables. Cache the intersections, that is, if a repository appears in the same existing set, do not create the new one. Filter out sets with a single element. The resulting number of unique repositories corresponds to ”Filtered size” in Table I. For every set with 2 items, calculate the precise Weighted Jaccard similarity value and filter out those with less than 0.8 (optional). Return the resulting list of sets. The number of unique repositories corresponds to ”Final size” in Table I. and Fig. 7 displays the heavy-tailed bag size distribution. V. T RAINING THE ARTM TOPIC MODEL After the exclusion of the fuzzy duplicates, we finish dataset processing and pass over to training of the topic model. The total number of unique names has now reduced by 2.06 million to 14 million unique names. To build a meaningful dataset, names with occurrence of less than Tf = 20 were excluded from the final vocabulary. 20 was chosen on the frequency histogram shown on Fig. 6 since it is the drop-off point. After this exclusion, there are now 2 million unique names, with an average size of a bag-of-words of 285 per repository TABLE I I NFLUENCE OF THE W EIGHTED M IN H ASH SIZE TO THE NUMBER OF This section revises ARTMs and describes how the training of the topic model was performed. We have chosen ARTM instead of other topic modeling algorithms since it has the most efficient parallel CPU implementation in bigARTM according to our benchmarks. A. Additive Regularized Topic Model Suppose that we have a topic probabilistic model of the collection of documents D which describes the occurrence of terms w in document d with topics t: X p(w|d) = p(w|t)p(t|d). (6) t∈T FUZZY CLONES Hash size 64 128 160 192 Hash tables 3 5 6 7 Average bins 272000 263000 261063 258000 Filtered size 1,745,000 1,714,000 1,687,000 1,666,000 Final size 1,730,000 1,700,000 1,675,000 1,655,000 Here p(w|t) is the probability of the term w to belong to the topic t, p(t|d) is the probability of the topic t to belong to the document d, thus the whole formula is just an expression of the total probability, accepting the hypothesis of conditional independence: p(w|d, t) = p(w|t). Terms belong to the vocabulary W , topics are taken from the set T which is simply the series of indices [1, 2, . . . nt ]. We’d like to solve the problem of recovering p(w|t) and p(t|d) from the given set of documents {d ∈ D : d = {w1 . . . wnd }}. We normally assume p̂(w|d) = nndw , n being the number of times term w dw d occurred in document d, but this implies that all the terms are equally important which is not always true. ”Importance” here means some measure which negatively correlates with the overall frequency of the term. Let us denote the recovered probabilities as p̂(w|t) = φwt and p̂(t|d) = θtd . Thus our problem is the stochastic matrix decomposition which is not correctly stated: ndw ≈ Φ · Θ = (ΦS)(S −1 Θ) = Φ0 · Θ0 . (7) nd The stated problem can be solved by applying maximum likelihood estimation: XX X ndw ln φwt θtd → max (8) upon the conditions X X φwt > 0; φwt = 1; θtd > 0; θtd = 1. w∈W t Value 256 10 8 0.5 0.5 Fig. 8. ARTM convergence (9) t∈T The idea of ARTM is to naturally introduce regularization as one or several extra additive members: XX X ndw ln φwt θtd + R(Φ, Θ) → max . (10) d∈D w∈d Parameter Topics Iterations without regularizers Iterations with regularizers Φ sparsity weight Θ sparsity weight Φ,Θ t d∈D w∈d TABLE II U SED ARTM META - PARAMETERS Φ,Θ Since this is a simple summation, one can combine a series of regularizers in the same objective function. For example, it is possible to increase Φ and Θ sparsity or to make topics less correlated. Well-known LDA model [45] can be reproduced as ARTM too. The variables Φ and Θ can be effectively calculated using the iterative expectation maximization algorithm [46]. Many ready to be used ARTM regularizers are already implemented in the BigARTM open source project [47]. B. Training Vorontsov shows in [3] that ARTM is trained best if the regularizers are activated sequentially, with a lag relative to each other. For example, first EM iterations are performed without any regularizers at all and the model reaches target perplexity, then Φ and Θ sparsity regularizers are activated and the model optimizes for those new members in the objective function while not increasing the perplexity. Finally other advanced regularizers are appended and the model minimizes the corresponding members while leaving the old ones intact. We apply only Φ and Θ sparsity regularizers in this paper. Further research is required to leverage others. We experimented with the training of ARTM on the source code identifiers from III and observed that the final perplexity and sparsity values do not change considerably on the wide range of adjustable meta-parameters. The best training metaparameters are given in Table II. We chose 256 topics merely because it is time intensive to label them and 256 was the largest amount we could label. The traditional ways of determining the optimal number of topics using e.g. Elbow curves are not applicable to our data. We cannot consider topics as clusters since a typical repository corresponds to several topics and increasing the number of topics worsens the model’s generalization and requires the dedicated topics decorrelation regularizer. The overall number of iterations equals 18. The convergence plot is shown on Fig. 8. The achieved quality metric values are as given in Table III. On the average, a single iteration took 40 minutes to complete on our hardware. We used BigARTM in a Linux environment on 16-core (32 threads) Intel(R) Xeon(R) CPU E5-2620 v4 computer with 256 GB of RAM. BigARTM supports the parallel training and we set the number of workers to 30. The peak memory usage was approximately 32 GB. It is possible to relax the hardware requirements and speed up the training if the model size is reduced. If we set the frequency threshold Tf to a greater value, we can dramatically reduce the input data size with the risk of loosing the ability of the model to generalize. TABLE III ACHIEVED ARTM METRICS Metric Perplexity Φ sparsity Θ sparsity Value 10168 0.964 0.913 We trained a reference LDA topic model to provide the baseline using the built-in LDA engine in BigARTM. 20 iterations resulted in perplexity 10336 and Φ and Θ sparsity 0 (fully dense matrices). It can be seen that the additional regularization not only made the model sparse but also yielded a better perplexity. We relate this observation with the fact that LDA assumes the topic distribution to have a sparse Dirichlet prior, which does not obligatory stand for our dataset. C. Converting the repositories to the topics space Let Rt be the matrix of repositories in the topics space of size R×T , Rn be the sparse matrix representing the dataset of size R×N and Tn be the matrix representing the trained topic model of size N × T . We perform the matrix multiplication to get the repository embeddings: Rt = Rn × Tn . (11) We further normalize each row of the matrix by L2 metric: Rtnormed = rowwise Rt . kRt k2 Human languages (10) - it appeared that one can determine programmer’s approximate native language looking at his code, thanks to the stem bias. • Programming languages (33) - not so interesting since this is the information we already have after linguist classification. Programming languages usually have a standard library of classes and functions which is imported/included into most of the programs, and the corresponding names are revealed by our topic modeling. Some topics are more narrow than a programming language. • General IT (72) - the topics which could appear in Concepts if had an expressive list of key words but do not. The repositories are associated by the unique set of names in the code without any special meaning. • Technologies (87) - devoted to some specific, potentially narrow technology or product. Often indicates an ecosystem or community around the technology. • Games (13) - related to video games. Includes specific gaming engines. The complete topics list is in appendix C. The example topic labelled ”Machine Learning, Data Science” is shown in appendix D. It can be observed that some topics are dual and need to be splitted. That duality is a sign that the number of topics should be bigger. At the same time, some topics appear twice and need to be de-correlated, e.g. using the ”decorrelation” ARTM regularizer. Simple reduction or increase of the number of topics however do not solve those problems, we found it out while experimenting with 200 and 320 topics. • Fig. 9. ARTM topic significance distribution (12) The sum along every column of this matrix indicates the significance of each topic. Fig. 9 shows the distribution of this measure. VI. T OPIC MODELING RESULTS The employed topic model is unable to summarize the topics the same way humans do. It is possible to interpret some topics based on the most significant words, some based on relevant repositories, but many require manual supervision with the careful analysis of most relevant names and repositories. This supervision is labour intensive and the single topic normally takes up to 30 minutes to summarize with proper confidence. 256 topics required several man-days to complete the analysis. After a careful analysis, we sorted the labelled topics into the following groups: • Concepts (41) - general, broad and abstract. The most interesting group. It includes scientific terms, facts about the world and the society. VII. R ELEASED DATASETS We generated several datasets which were extracted from our internal 100 TB GitHub repository storage. We incorporated them on data.world [48], the recently emerged ”GitHub for data scientists”, each has the description, the origin note and the format definition. They are accessed at data.world/vmarkovtsev. Besides, the datasets are uploaded to Zenodo and have DOI. They are listed in Table VII. TABLE IV O PEN DATASETS ON DATA . WORLD Name abd DOI source code names 10.5281/zenodo.284554 452,000,000 commits 10.5281/zenodo.285467 keyword frequencies 10.5281/zenodo.285293 readme files 10.5281/zenodo.285419 duplicate repositories 10.5281/zenodo.285377 Description names extracted from 13,000,000 repositories (fuzzy clones excluded) considered in section III metadata of all the commits in 16,000,000 repositories (fuzzy clones excluded) frequencies of programming language keywords (reserved tokens) across 16,000,000 repositories (fuzzy clones excluded) README files extracted from 16,000,000 repositories (fuzzy clones excluded) fuzzy clones which were considered in section IV VIII. C ONCLUSION AND FUTURE WORK Topic modeling of GitHub repositories is an important step to understanding software development trends and open source communities. We built a repository processing pipeline and applied it to more than 18 million public repositories on GitHub. Using developed by us open source tool MinHashCUDA we were able to remove 1.6 million fuzzy duplicate repositories from the dataset. The preprocessed dataset with source code names as well as other datasets are open and the presented results can be reproduced. We trained ARTM on the resulting dataset and manually labelled 256 topics. The data processing and model training are possible to perform using a single GPU card and a moderately sized Apache Spark cluster. The topics covered a broad range of projects but there were repeating and dual ones. The chosen number of topics was enough for general exploration but not enough for the complete description of the dataset. Future work may involve experimentation with clustering the repositories in the topic space and comparison with clusters based on dependency or social graphs [49]. A PPENDIX A PARSED LANGUAGES r racket ragel rb rebol red redcode ruby rust sage salt scala coldfusion common lisp component pascal console coq csharp csound cucumber cuda cython d dart delphi dosbatch dylan ec ecl eiffel elisp elixir elm emacs erlang factor fancy fantom fish fortran foxpro fsharp gap gas genshi gherkin glsl gnuplot go golo gosu groovy haskell haxe hy i7 idl idris igor igorpro inform 7 io ioke j isabelle jasmin java javascript jsp julia kotlin lasso lassoscript lean lhaskell lhs limbo lisp literate agda literate haskell livescript llvm logos logtalk lsl lua make mako mathematica matlab mf minid mma modelica modula-2 monkey standard ml supercollider swift tcl tcsh thrift typescript vala vb.net verilog vhdl vim winbatch x10 xbase xml+genshi xml+kid xquery xslt xtend zephir A PPENDIX B E XAMPLES OF FUZZY DUPLICATE REPOSITORIES A. Linux kernel • • • abap abl actionscript ada agda ahk alloy antlr apl applescript arduino as3 aspectj aspx-vb autohotkey autoit awk b3d bash batchfile befunge blitzbasic blitzmax bmax boo bplus brainfuck bro bsdmake c c# c++ ceylon cfc cfm chapel chpl cirru clipper clojure cmake cobol coffeescript scheme scilab shell shen smali smalltalk smarty sml sourcepawn splus squeak stan 1406/linux-0.11 yi5971/linux-0.11 love520134/linux-0.11 wfirewood/source-linux-0.11 sunrunning/linux-0.11 Aaron123/linux-0.11 junjee/linux-0.11 pengdonglin137/linux-0.11 yakantosat/linux-0.11 • moocode • moonscript mupad • myghty • nasm • nemerle • nesc newlisp B. Tutorials nimrod nit • dcarbajosa/linuxacademy-chef nix • jachinh/linuxacademy-chef nixos • flarotag/linuxacademy-chef nsis • qhawk/linuxacademy-chef numpy • paul-e-allen/linuxacademy-chef obj-c obj-c++ C. Web applications 1 obj-j objectpascal • choysama/my-django-first-blog ocaml • mihuie/django-first octave • PubMahesh/my-first-django-app ooc • nickmalhotra/first-django-blog opa openedge • Jmeggesto/MyFirstDjango pan • atlwendy/django-first pascal • susancodes/first-django-app pawn • quipper7/DjangoFirstProject perl • phidang/first-django-blog php pike D. Web applications 2 plpgsql posh • iggitye/omrails povray • ilrobinson81/omrails powershell • OCushman/omrails progress • hambini/One-Month-Rails prolog puppet • Ben2pop/omrails pyrex • chrislorusso/omrails python • arjunurs/omrails qml • crazystingray/omrails robotframework • • scorcoran33/omrails Joelf001/Omrails A PPENDIX C C OMPLETE LIST OF LABELLED TOPICS A. Concepts 1) 2) 3) 4) 5) 6) 7) 8) 9) 10) 11) 12) 13) 14) 15) 16) 17) 18) 19) 20) 21) 2D geometry 3D geometry Arithmetic Audio Bitcoin Card Games Chess; Hadoop # Classical mechanics (physics) Color Manipulation/Generation Commerce, ordering Computational Physics Date and time Design patterns; HTML parsing Email * Email * Enumerators, Mathematical Expressions Finance and trading Food (eg. pizza, cheese, beverage), Calculator Genomics Geolocalization, Maps Graphs 22) 23) 24) 25) 26) 27) 28) 29) 30) 31) 32) 33) 34) 35) 36) 37) 38) 39) 40) 41) B. Human languages 42) 43) 44) 45) 46) Chinese Dutch French * French * German 47) 48) 49) 50) 51) C. Programming languages 52) 53) 54) 55) 56) 57) 58) 59) 60) 61) 62) Assembler Autoconf Clojure ColdFusion * ColdFusion * Common LISP Emacs LISP Emulated assembly Go HTML Human education system 63) Java AST and bytecode 64) libc 65) Low-level PHP 66) 67) 68) 69) 70) 71) 72) 73) 74) 75) 76) 77) 78) 79) 80) Verilog/VHDL 81) Work, money, employment, driving, living Hexademical numbers D. General IT Human Identifiers 85) 3-char identifiers Language names; 86) Advertising (Facebook, JavaFX # Ad Engines, Ad BlockLinear Algebra; Optiers, AdMob) mization 87) Animation Machine Learning, Data 88) Antispam; PHP forums Science 89) Antivirus; database acMy cess # Parsing 90) Barcodes; browser enParticle physics gines # Person Names (Ameri- 91) Charting can) 92) Chat; messaging Personal Information 93) Chinese web Photography, Flickr 94) Code analysis and genPlaces, transportation, eration travel 95) Computer memory and Publishing; Flask # interfaces Space and solar system 96) Console, terminal, COM Sun and moon 97) CPU and kernel Trade 98) Cryptography Trees, Binary Trees 99) Date and time picker Video; movies 100) DB Sharding, MongoDB Word Term sharding 101) Design patterns; formal architecture 102) DevOps 103) Drawing * Portuguese * 104) Drawing * Portuguese * 105) Forms (UI) Spanish * 106) Glyphs; X11 and Spanish * FreeType # Vietnamese 107) Grids and tables 108) HTTP auth 109) iBeacons 110) Image Manipulation Lua * 111) Image processing Lua * 112) Intel SIMD, Linear AlMakefiles gebra # Mathematics: proofs, sets 113) IO operations Matlab 114) Javascript selectors Object Pascal 115) JPEG and PNG Objective-C 116) Media Players Perl 117) Metaprogramming Python 118) Modern JS frontend Python, ctypes (Bower, Grunt, Yeoman) Ruby 119) Names starting with “m” Ruby with language ex- 120) Networking tensions 121) OAuth; major web serSQL vices # String Manipulation in C 122) Observer design pattern 82) x86 Assembler * 83) x86 Assembler * 84) XPCOM 123) Online education; Moodle 124) OpenGL * 125) Parsers and compilers 126) Plotting 127) Pointers 128) POSIX Shell; VCS # 129) Promises and deferred execution; Angular # 130) Proof of concept 131) RDF and SGML parsing 132) Request and Response 133) Requirements and dependencies 134) Sensors; DIY devices 135) Sockets C API 136) Sockets, Networking 137) Sorting and searching 138) SQL database 139) SQL DB, XML in PHP projects 140) SSL 141) Strings 142) Testing with mocks 143) Text editor UI 144) Threads and concurrency 145) Typing suggestions and dropdowns 146) UI 147) Video player 148) VoIP 149) Web Media, Arch Packages # 150) Web posts 151) Web testing; crawling 152) Web UI 153) Wireless 154) Working with buffers 155) XML (SAX, XSL) 156) XMPP 157) .NET 158) Android Apps 159) Android UI 160) Apache Libraries for BigData 161) Apache Thrift 162) Arduino, AVR 163) ASP.NET * 164) ASP.NET * E. Technologies 165) 166) 167) 168) 169) 170) 171) 172) 173) 174) 175) 176) 177) 178) 179) 180) 181) 182) 183) 184) 185) 186) 187) 188) 189) 190) 191) 192) 193) 194) 195) 196) 197) 198) 199) 200) 201) 202) 203) 204) Backbone.js Chardet (Python) Cocos2D Comp. vision; OpenCV Cordova CPython Crumbs; cake(PHP) cURL DirectDraw DirectX Django Web Apps, CMS Drupal Eclipse SWT Emacs configs Emoji and Dojo # Facebook; Parse SDK # ffmpeg FLTK Fonts FPGA, Verilog FreeRTOS (Embedded) Glib Ionic framework, Cordova iOS Networking iOS Objective-C API iOS UI Jasmine tests, JS exercises, exercism # Java GUI Java Native Interface Java web servers Javascript AJAX, Javascript DOM manipulation Joomla JQuery jQuery Grid Lex, Yacc compiler libav / ffmpeg Linear algebra libraries Linux Kernel, Linux Wireless Lodash MFC Desktop Applications 205) 206) 207) 208) 209) 210) 211) 212) 213) 214) 215) 216) 217) 218) 219) 220) 221) 222) 223) 224) 225) 226) 227) 228) 229) 230) 231) 232) 233) 234) 235) 236) 237) 238) 239) 240) 241) 242) 243) Minecraft mods Monads OpenCL OpenGL * PHP sites written by non-native English people PIC32 Portable Document Format Puppet Pusher.com Apps Python packaging Python scientific stack Python scrapers Qt * Qt * React ROS (Robot Operating System) Ruby On Rails Apps SaltStack Shockwave Flash Spreadsheets (Excel) Spreadsheets with PHP SQLite STL, Boost STM32 Sublime Extensions Symphony, Doctrine; NLP # U-boot Vim Extensions Visual Basic, MSSQL Web scraping WinAPI Wordpress * Wordpress * Wordpress-like frontend Working with PDF in PHP wxWidgets Zend framework zlib * zlib * F. Games 244) 3D graphics and Unity 245) Fantasy Creatures * Repeating topic with different key words, see section VI. # Dual topic, see section VI. 246) 247) 248) 249) 250) 251) Games Hello World, Games Minecraft MMORPG Pokemon Puzzle games 252) 253) 254) 255) 256) RPG, fantasy Shooters (SDL) Unity Engine Unity3D Games Web Games A PPENDIX D K EY WORDS AND REPOSITORIES BELONGING TO TOPIC #27 (M ACHINE L EARNING , DATA S CIENCE ) Rank 0.313115 0.303456 0.273759 0.187565 0.181307 0.169696 0.166166 0.165236 0.159658 0.153094 0.146327 0.144736 0.132792 0.124264 0.120666 0.110212 0.110049 0.096037 0.093182 0.084059 0.082812 0.081260 0.080978 0.080325 0.077891 0.076858 0.076140 0.076043 0.075235 0.073265 0.072214 0.072196 0.069818 0.065453 0.065453 0.065322 0.064042 0.062975 0.061608 0.060443 0.059155 0.058877 0.057343 0.057328 0.056908 0.056292 0.051978 0.051359 0.050785 0.050586 Word plot numpy plt figur zeros matplotlib dtype fig ylabel xlabel subplot shape pyplot scipy axis arang mean reshap range ylim linspac savefig xlim axes legend bins panda astyp pylab ones xrang len float linewidth linalg norm hist label sum cmap scatter fontsiz self none true xtick figsiz sigma ndarray sqrt Rank 1.000000 0.999998 0.999962 0.999719 0.999658 0.999543 0.999430 0.999430 0.999361 0.999354 0.999282 0.999103 0.999034 0.998969 0.998385 0.998138 0.998123 0.997822 0.997662 0.997567 0.996786 0.996327 0.995153 0.994776 0.992801 0.992558 0.992324 0.991026 0.990514 0.989586 0.988722 0.988514 0.987874 0.987039 0.986802 0.986272 0.986039 0.985837 0.985246 0.985173 0.985043 0.984838 0.983808 0.983393 0.983170 0.983074 0.982967 0.982904 0.981725 0.981156 Repository jingxia/kaggle yelp Carreau/spicy zck17388/test jonathanekstrand/Python ... skendrew/astroScanr southstarj/YCSim parteekDhream/statthermo... axellundholm/FMN050 soviet1977/PriceList connormarrs/3D-Rocket-... Holiver/matplot wetlife/networkx JingshiPeter/CS373 marialeon/los4mas2 acnz/Project khintz/GFSprob claralusan/test aug 18 amcleod5/PythonPrograms ericqh/deeplearning laserson/stitcher hs-jiang/MCA python DianaSplit/Tracking SivaGabbi/Ipython-Noteb... prov-suite/prov-sty bmoerker/EffectSizeEstim... natalink/machine learning olehermanse/INF1411-El... fonnesbeck/scipy2014 tut... fablab-paderborn/device-... mqchau/dataAnalysis acemaster/Image-Process... henryoswald/Sin-Plot npinto/virtualenv-bootstrap ipashchenko/test datajoy Ryou-Watanabe/practice mirthbottle/datascience-... hglabska/doktorat parejkoj/yaledemo grajasumant/python aaronspring/Scientific-Py... asesana/plots Sojojo83/SJFirstRepository Metres/MetresAndThtu... e-champenois/pySurf pawel-kw/dexy-latex-ex... keiikegami/envelopetheorem msansa/test qdonnellan/spyder-examples qiuwch/PythonNotebook... rescolo/getdaa R EFERENCES [1] “Sourceforge directory.” https://sourceforge.net/directory. [2] S. Ioffe, “Improved consistent sampling, weighted minhash and l1 sketching,” in Proceedings of the 2010 IEEE International Conference on Data Mining, ICDM ’10, (Washington, DC, USA), pp. 246–255, IEEE Computer Society, 2010. [3] K. Vorontsov and A. Potapenko, “Additive regularization of topic models,” Machine Learning, vol. 101, no. 1, pp. 303–323, 2015. [4] J. Xu, S. Christley, and G. Madey, “The open source software community structure,” in Proceedings of the North American Association for Computation Social and Organization Science, NAACSOS ’05, 2005. [5] K. Blincoe, F. Harrison, and D. Damian, “Ecosystems in github and a method for ecosystem identification using reference coupling,” in Proceedings of the 12th Working Conference on Mining Software Repositories, MSR ’15, (Piscataway, NJ, USA), pp. 202–207, IEEE Press, 2015. [6] G. Gousios, “The ghtorrent dataset and tool suite,” in Proceedings of the 10th Working Conference on Mining Software Repositories, MSR ’13, (Piscataway, NJ, USA), pp. 233–236, IEEE Press, 2013. [7] M. Lungu, Reverse Engineering Software Ecosystems. PhD thesis, University of Lugano, Sept 2009. [8] E. Kalliamvakou, G. Gousios, K. Blincoe, L. Singer, D. M. German, and D. Damian, “The promises and perils of mining github,” in Proceedings of the 11th Working Conference on Mining Software Repositories, MSR 2014, (New York, NY, USA), pp. 92–101, ACM, 2014. [9] X. Sun, X. Liu, B. Li, Y. Duan, H. Yang, and J. Hu, “Exploring topic models in software engineering data analysis: A survey,” in 2016 17th IEEE/ACIS International Conference on Software Engineering, Artificial Intelligence, Networking and Parallel/Distributed Computing (SNPD), pp. 357–362, May 2016. [10] S. Grant, J. R. Cordy, and D. B. Skillicorn, “Using topic models to support software maintenance,” in 2012 16th European Conference on Software Maintenance and Reengineering, pp. 403–408, March 2012. [11] S. Grant and J. R. Cordy, “Examining the relationship between topic model similarity and software maintenance,” in 2014 Software Evolution Week - IEEE Conference on Software Maintenance, Reengineering, and Reverse Engineering (CSMR-WCRE), pp. 303–307, Feb 2014. [12] T.-H. Chen, S. W. Thomas, M. Nagappan, and A. E. Hassan, “Explaining software defects using topic models,” in Proceedings of the 9th IEEE Working Conference on Mining Software Repositories, MSR ’12, (Piscataway, NJ, USA), pp. 189–198, IEEE Press, 2012. [13] S. Grant, J. R. Cordy, and D. Skillicorn, “Automated concept location using independent component analysis,” in 2008 15th Working Conference on Reverse Engineering, pp. 138–142, Oct 2008. [14] E. Linstead, P. Rigor, S. Bajracharya, C. Lopes, and P. Baldi, “Mining concepts from code with probabilistic topic models,” in Proceedings of the Twenty-second IEEE/ACM International Conference on Automated Software Engineering, ASE ’07, (New York, NY, USA), pp. 461–464, ACM, 2007. [15] E. Linstead, C. Lopes, and P. Baldi, “An application of latent dirichlet allocation to analyzing software evolution,” in 2008 Seventh International Conference on Machine Learning and Applications, pp. 813–818, Dec 2008. [16] S. W. Thomas, B. Adams, A. E. Hassan, and D. Blostein, “Modeling the evolution of topics in source code histories,” in Proceedings of the 8th Working Conference on Mining Software Repositories, MSR ’11, (New York, NY, USA), pp. 173–182, ACM, 2011. [17] J. I. Maletic and A. Marcus, “Using latent semantic analysis to identify similarities in source code to support program understanding,” in Proceedings 12th IEEE Internationals Conference on Tools with Artificial Intelligence. ICTAI 2000, pp. 46–53, 2000. [18] J. I. Maletic and N. Valluri, “Automatic software clustering via latent semantic analysis,” in 14th IEEE International Conference on Automated Software Engineering, pp. 251–254, Oct 1999. [19] A. Kuhn, S. Ducasse, and T. Gı́rba, “Semantic clustering: Identifying topics in source code,” Inf. Softw. Technol., vol. 49, pp. 230–243, Mar. 2007. [20] S. W. Thomas, “Mining software repositories using topic models,” in Proceedings of the 33rd International Conference on Software Engineering, ICSE ’11, (New York, NY, USA), pp. 1138–1139, ACM, 2011. [21] B. P. Eddy, J. A. Robinson, N. A. Kraft, and J. C. Carver, “Evaluating source code summarization techniques: Replication and expansion,” in [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] 2013 21st International Conference on Program Comprehension (ICPC), pp. 13–22, May 2013. P. W. McBurney, C. Liu, C. McMillan, and T. Weninger, “Improving topic model source code summarization,” in Proceedings of the 22Nd International Conference on Program Comprehension, ICPC 2014, (New York, NY, USA), pp. 291–294, ACM, 2014. A. M. Saeidi, J. Hage, R. Khadka, and S. Jansen, “Itmviz: Interactive topic modeling for source code analysis,” in Proceedings of the 2015 IEEE 23rd International Conference on Program Comprehension, ICPC ’15, (Piscataway, NJ, USA), pp. 295–298, IEEE Press, 2015. X. Sun, B. Li, H. Leung, B. Li, and Y. Li, “Msr4sm: Using topic models to effectively mining software repositories for software maintenance tasks,” Inf. Softw. Technol., vol. 66, pp. 1–12, Oct. 2015. V. Prince, C. Nebut, M. Dao, M. Huchard, J.-R. Falleri, and M. Lafourcade, “Automatic extraction of a wordnet-like identifier network from software,” International Conference on Program Comprehension, vol. 00, pp. 4–13, 2010. G. Sridhara, L. Pollock, E. Hill, and K. Vijay-Shanker, “Identifying word relations in software: A comparative study of semantic similarity tools,” International Conference on Program Comprehension, vol. 00, pp. 123–132, 2008. J. Yang and L. Tan, “Inferring semantically related words from software context,” in Proceedings of the 9th IEEE Working Conference on Mining Software Repositories, MSR ’12, (Piscataway, NJ, USA), pp. 161–170, IEEE Press, 2012. M. J. Howard, S. Gupta, L. Pollock, and K. Vijay-Shanker, “Automatically mining software-based, semantically-similar words from commentcode mappings,” in Proceedings of the 10th Working Conference on Mining Software Repositories, MSR ’13, (Piscataway, NJ, USA), pp. 377– 386, IEEE Press, 2013. S. Haiduc and A. Marcus, “On the use of domain terms in source code,” International Conference on Program Comprehension, vol. 00, pp. 113– 122, 2008. S. Bajracharya and C. Lopes, “Mining search topics from a code search engine usage log,” in Proceedings of the 2009 6th IEEE International Working Conference on Mining Software Repositories, MSR ’09, (Washington, DC, USA), pp. 111–120, IEEE Computer Society, 2009. “source{d}.” https://sourced.tech. “Software heritage.” https://www.softwareheritage.org. “Sourcegraph.” https://sourcegraph.com/. A. Nesbitt, “libraries.io.” http://libraries.io. “github/linguist.” https://github.com/github/linguist. Pocoo, “Pygments - generic syntax highlighter.” http://pygments.org. M. F. Porter, “Snowball: A language for stemming algorithms,” 2001. “Natural language toolkit.” http://www.nltk.org. A. G. Jivani, “A comparative study of stemming algorithms,” vol. 2 (6) of IJCTA, pp. 1930–1938, 2011. “Apache spark.” https://spark.apache.org. source{d} and V. Markovtsev, “Minhashcuda - the implementation of weighted minhash on gpu.” https://github.com/src-d/minhashcuda. Appeared in 2016-09. J. Nickolls, I. Buck, M. Garland, and K. Skadron, “Scalable parallel programming with cuda,” Queue, vol. 6, pp. 40–53, Mar. 2008. E. Zhu, “ekzhu/datasketch.” https://github.com/ekzhu/datasketch. Appeared in 2015-03. J. Leskovec, A. Rajaraman, and J. D. Ullman, Mining of Massive Datasets. New York, NY, USA: Cambridge University Press, 2nd ed., 2014. D. M. Blei, A. Y. Ng, and M. I. Jordan, “Latent dirichlet allocation,” J. Mach. Learn. Res., vol. 3, pp. 993–1022, Mar. 2003. F. Dellaert, “The expectation maximization algorithm,” tech. rep., Georgia Institute of Technology, 2002. O. Frei, M. Apishev, N. Shapovalov, and P. Romov, “Bigartm - the state-of-the-art platform for topic modeling.” https://github.com/bigartm/ bigartm. Appeared in 2014-11. “data.world - the most meaningful, collaborative, and abundant data resource in the world.” https://data.world. S. Syed and S. Jansen, “On clusters in open source ecosystems,” 2013.
6cs.PL
Distributed Resource Allocation Using One-Way Communication with Applications to Power Networks arXiv:1601.07090v1 [cs.SY] 26 Jan 2016 Sindri Magnússon, Chinwendu Enyioha, Kathryn Heal, Na Li, Carlo Fischione, and Vahid Tarokh Abstract—Typical coordination schemes for future power grids require two-way communications. Since the number of end power-consuming devices is large, the bandwidth requirements for such two-way communication schemes may be prohibitive. Motivated by this observation, we study distributed coordination schemes that require only one-way limited communications. In particular, we investigate how dual descent distributed optimization algorithm can be employed in power networks using one-way communication. In this iterative algorithm, system coordinators broadcast coordinating (or pricing) signals to the users/devices who update power consumption based on the received signal. Then system coordinators update the coordinating signals based on the physical measurement of the aggregate power usage. We provide conditions to guarantee the feasibility of the aggregated power usage at each iteration so as to avoid blackout. Furthermore, we prove the convergence of algorithms under these conditions, and establish its rate of convergence. We illustrate the performance of our algorithms using numerical simulations. These results show that one-way limited communication may be viable for coordinating/operating the future smart grids. I. I NTRODUCTION Network infrastructures have a central role in communication, finance, technology and other areas of the economy, for instance, electricity transmission and distribution. Due to the massive scale of real-world networks, distributed optimization algorithms are expected to increasingly play a leading role in their operation. Distributed optimization problems are commonly solved by dual-based (sub)gradient methods where primal and dual decision variables are optimized at each iteration with some sort of message passing protocol between agents in the network [1]–[3]. In power networks, for example, consumers and suppliers communicate power consumption request and pricing signals back and forth. This requires ubiquitous, two-way communication among consumers and suppliers. Since the number of end powerconsuming devices is large, the bandwidth requirements for two-way schemes may be prohibitive. However, the communication infrastructure for the grid, especially the power distribution networks, is still under-developed and the nonavailability of communication bandwidth remains a challenge [4]–[9]. Given communication bandwidth constraints, it is critical that algorithms for distributed coordination in power This work was supported by the VR Chromos Project and NSF grant No. 1548204 and NSF CAREER 1553407. C. Enyioha, K. Heal, N. Li, and V. Tarokh are with the School of Engineering and Applied Sciences, Harvard University, Cambridge, MA USA. (email: [email protected]; [email protected]; [email protected]; [email protected]) S. Magnússon and C. Fischione are with Electrical Engineering School, Access Linnaeus Center, KTH Royal Institute of Technology, Stockholm, Sweden. (e-mail: [email protected]; [email protected]) networks use significantly less communication overhead – for instance, one-way message passing, as opposed to the conventional two-way message passing scheme typically used in distributed coordination algorithms. That said, a one-way message passing protocol for power distribution networks in which suppliers are only able to send out a price signal can be challenging to implement especially since a widespread system breakdown (blackouts) can occur if the aggregate power consumption exceeds the supply capacity. Given 1) limits on power capacity at the supply end, and 2) a oneway message passing protocol, with many power demanding devices on the network, the question of interest is how to ensure that the aggregate power consumption from users does not exceed the available supply capacity. In developing distributed algorithms to solve this problem, it is important that while the algorithm runs and users locally compute their optimal power allocation, the aggregate power consumption does not exceed the supply capacity to avoid a system failure and catastrophic blackout. Our work relates closely to [10] where a distributed resource allocation algorithm was presented based on a fast dual gradient method. It showed that dual gradient iteration has a convergence rate of O(1/t2 ) and yet the primal decision variables converge with a rate of O(1/t) (where t denotes a time-step of the algorithm). The framework presented there, however, gives no guarantee of primal feasibility at each iteration of the algorithm. The focus of this paper is on developing a distributed power allocation algorithm in which one-way communication, from the power suppliers to users, is used to coordinate the allocation. Due to the critical nature of power distribution systems, the power allocation algorithm presented in this paper • maintains primal feasibility at each iteration and satisfies the capacity constraint, to avoid a blackout, • assumes a one-way communication or information sharing model, in which the supplier (or network operator) sends out a price signal to users, users update the consumption based on the signal but do not report the consumption back to the supplier, and • has fast convergence rates and properties. A. Contributions of This Work We present a distributed, dual gradient power allocation algorithm for power distribution networks. The algorithm uses only one way communication, where the supplier iteratively broadcasts a price/dual variable to the users and then measures the aggregate power usage to compute the dual gradient. Since the users actually consume power during operation (en route convergence) of the algorithm, it essential that the aggregate power usage does not exceed the suppliers capacity to avoid a blackout. We show how such blackouts can be avoided by providing step-sizes that ensure that the primal iterates remain feasible at ever iteration. To ensure the primal feasibility we must sacrifice the optimal convergence rate O(1/t2 ) [10] for gradient methods for convex problems with Lipschitz continuous gradients and instead only get the convergence rate O(1/t). Nevertheless, we prove that under mild conditions on the problem structure our algorithm attains a convergence rate O(ct ), where 0 < c < 1 and t is the time-step of the algorithm in the dual variable, and still guarantee primal feasibility. Moreover, we provide conditions which ensure that the linear convergence rate, i.e., the constant c, does not depend on the number of users, which demonstrate excellent scaling properties of the algorithm. The rest of the paper is organized as follows: Following notation and definitions, we introduce the system model, underlying assumptions and distributed solution in Section II. Sections III-A and III-B respectively present a convergence analysis and convergent rate analysis of our proposed algorithm. In Section IV, illustration of our algorithm is presented and discussed. We make our conclusions in Section V. B. Notation and Definitions Definition 1. We say that a function f : Rn → R is Lsmooth on X ⊆ Rn if its gradient is L-Lipschitz continuous on X , i.e., for all x1 , x2 ∈ X we have ||∇f (x1 ) − ∇f (x2 )|| ≤ L||x1 − x2 ||. (1) n Definition 2. We say that a function f : R → R is µ-convex on X ⊆ Rn if for all x1 , x2 ∈ X , µ f (x2 ) ≥ f (x1 ) + h∇f (x1 ), x2 − x1 i + ||x2 − x1 ||2 . (2) 2 Similarly, we say a function is µ-concave if it is µ-strongly concave. II. S YSTEM M ODEL AND A LGORITHM In this paper we focus on an abstract power distribution model, and for simple exposition we ignore some specific power network constraints. We consider an electric network with N users whose set is denoted by N , and a single supplier. The power allocation of user i ∈ N is denoted by qi ∈ R+ and the total power capacity is denoted by Q ∈ R+ . The value of the power qi of each user i ∈ N is decided by a private utility function Ui (qi ), which the user would like to maximize. By private, we mean the function Ui (qi ) of each user is unknown to the power supplier. The Resource Allocation problem for the power distribution system is given by the following optimization program [3] [11]: Resource Allocation (RA): maximize q1 ,··· ,qN subject to N X Ui (qi ), (RA) qi ≤ Q, i=1 mi ≤ qi ≤ Mi . Assumption 1. (Convexity) The function Ui (qi ) is µ-concave and increasing for all i ∈ N . Assumption 2. (Well Posed) We have that N X mi ≤ Q ≤ i=1 N X Mi . (3) i=1 In other words, Problem (RA) is feasible and the constraint PN i=1 qi ≤ Q is not redundant. As motivated in the introduction, in this work we focus on one-way communication protocols for solving (RA). For each user i ∈ N the problem data Ui , qi , mi , and Mi are private to user i. In particular, the supplier can not access this information. We consider protocols based on the following two operations. Operation 1 (One-Way Communication). At each time-step (iteration), the supplier can broadcast to all users one scalar message referred to as the price (of power). Operation 2 (Feedback Information). After broadcasting the price, the supplier can measure PN the deviation between total power load and supply, i.e. i=1 qi (t)−Q, where t indicates the time-step. Algorithms for solving (RA) that only use Operations 1 and 2 can be achieved using duality theory [1][3]. In particular, we achieve the solution by solving the dual problem of (RA) that is given as follows: The Dual of (RA): minimize p D(p), (Dual-RA) subject to p ≥ 0, where D and p are the dual function and dual variables [12, Chapter 5], respectively, and D is given by ! N N X X D(p) = maximize Ui (qi )−p qi −Q q∈M = N X i=1 Ui (qi (p))−p i=1 i=1 N X ! qi (p)−Q (4) i=1 where mi and Mi are respectively the lower QN and upper bounds on the power loads of user i; M = i=1 [mi , Mi ], and q = (q1 , . . . , qN )T . The local problem for user i is to solve  M qi (p)= argmax Ui (qi ) − p qi = (Ui0 )−1 (p) m . (5) qi ∈[mi ,Mi ] i=1 N X We make the following assumptions on (RA): In words, qi (p) in (5) denotes the power demand of user i when the price of power is p. We have the following relationship between (RA) and (Dual-RA): Lemma 1. (Strong Duality) Suppose Assumptions 1 and 2 hold; if p? is an optimal solution of (Dual-RA), then q(p? ) = (qi (p? )i∈N (cf. (5)) is the optimal solution to (RA). PN Proof: The proof follows by simply noting that i=1 mi ≤ Q, and mi ≤ Mi ensures that (RA) satisfies Slater’s condition, which is sufficient for the zero duality gap for convex problems [12, Section 5.2.3]. Let us now demonstrate benefits of studying the dual problem (Dual-RA), which takes advantage of the following property: A. General Convergence Result Proposition 1. Suppose Assumption 1 holds, then D(·) is differentiable and N/µ-smooth. Proof: Follows directly from Theorem 1 in [3]. Proposition 2 ensures that the primal sequence q(t) converges to q? . However, there is no guarantee that that the iterates q(t) are feasible to (RA) at each iteration except in the limit. Such infeasibilities can cause blackouts in the power network (cf. Remark 1) and therefore it is essential to find conditions that ensure the feasibility of q(t) for all t ∈ N. Such conditions are now established. Proof: See Lemma II.2 in [10] Due to Proposition 1, we can solve (Dual-RA) using a dual descent method, given by the iterates: p(t+1) = dp(t) − γD0 (p(t))e+ , (6) where γ > 0 is step-size and D0 (·) is the gradient of D(·), which is given by X qi (p). (7) D0 (p) = Q − i=1 Notice that (7) is exactly the feedback provide in Operation (2) above. In Algorithm 1 below we demonstrate how the the dual descent algorithm can be implemented between the supplier and the users using only Operations 1 and 2. Algorithm 1: Dual descent, using only Operations 1 and 2 and local computation at the users and the supplier. Supplier: Decides the initial prize p(0) ≥ 0; for t = 0, 1 · · · do Supplier: Broadcast p(t) to all users; for i = 1, · · · , N do User i: Receives p(t);  M User i: qi (t) = (Ui0 )−1 (p(t)) m ; PN Supplier: Measures D0 (p(t))=Q− i=1 qi (t); Supplier: Updates price:p(t+1)=dp(t)+γD0(p(t))e+; Remark 1. Due to the one-way communication, the primal iterates qi (t) are not communicated to the supplier. Instead the users take the action qi (t) and the aggregate of their actions is measured by the supplier. Therefore, it is essential that the primal problem P (RA) is feasible during every N iteration of Algorithm 1, i.e. i=1 qi (t) ≤ Q for all t ∈ N. Otherwise, a heightened demand of power in the network can result in a system overload and eventual blackout. In what follows, we study the convergence of Algorithm 1 and how to ensure that the primal problem is feasible during every iteration. III. C ONVERGENCE ANALYSIS OF A LGORITHM 1 In this section, we provide rules on choosing the initial price and the step-size to ensure that the primal variables are feasible throughout the algorithm (Section III-A ). We also further prove that the algorithm has a convergence rate ct , where 0 < c < 1 and t is the time-step of the algorithm, under certain conditions (Section III-B). The following result on the convergence of Algorithm 1 is standard in the literature [3]. Proposition 2. If γ ∈]0, 2µ/N [ in Algorithm 1, then every limit point of p(t) is a solution to (Dual-RA) and limt→∞ q(t) = q? where q? is the solution to (RA). Proposition 3. Let P ? = [p? , p? ] be the set of optimal solutions to (Dual-RA): If Assumptions 1 and 2 hold and γ ∈]0, µ/N ] in Algorithm 1, then the following hold. a) If p(0) ≥ p? , then limt→∞ p(t) = p? and the primal variables q(t) are feasible to (RA) at every iteration t ∈ N. b) The convergence rate of the objective function values D(p(t)) is O(1/t). Moreover, the optimal convergence rate 2||p(0) − p? ||2 D(p(t)) − D(p? ) ≤ , (8) t+4 is achieved when γ = µ/N . Proof: a) From Proposition 2 we know that every limit point of p(t) is in P ? . Moreover, since q(p) is decreasing function (cf. Equation (5)) and q(p? ) is feasible point of (RA), then q(p) is also a feasible point of (RA) for all p ≥ p? . Therefore, if we can show that p(t) ≥ p? for all t ∈ N, then it holds that limt→∞ p(t) = p? and q(p(t)) is feasible to (RA) for all t ∈ N. Let us now show that p? < p(t) for all t ∈ N by induction. By assumption p? < p(0). Let us now suppose p? < p(t). Then D0 (p? ) = 0 implies that D0 (p(t)) > 0, and the convexity of D(·) implies that D0 (·) is increasing. Hence, we have p(t+1) = p(t)−γD0 (p(t)) < p(t). Moreover, using that D(·) is N/µ-smooth and D0 (·) is increasing we get D0 (p(t))−D0 (p(t+1))< N N (p(t)−p(t+1))= γD(p(t)), µ µ and rearranging one obtain s   N 0 < 1 − γ D0 (p(t)) ≤ D0 (p(t+1)). µ (9) Hence, the step-size γ ∈]0, µ/N [ implies that D0 (p(t+1)) > 0. Hence, since D0 (·) is increasing and D0 (p? ) = 0 we must have p? ≤ p(t+1). b) This result is proved in [13, Theorem 2.1.14]. Remark 2. For general objective functions with Lipschitz continuous gradients, the optimal convergence rate is O(1/t2 ) by using Nesterov fast gradient methods, see [13, chapter 2]. However, these optimal dual gradient methods cannot ensure the feasibility of the primal problems during the converging process, bringing blackout risk. B. Linear Convergence Rate We now identify structures on (RA) which ensure convergence rate ct , where 0 < c < 1, on Algorithm 1. We start by providing a linear rate under the following assumptions on utility function and local constraints. Assumption 3. The function Ui (qi ) is L-Lipschitz continuous. Assumption S 4. Let pi = Ui0 (Mi ) and pi = Ui0 (mi ). Then the set P = i∈N [pi , pi ] is connected, i.e., an interval on R+ . We write P in terms of its end points as P = [p, p]. The linear convergence rate can now formally be stated as follows. Proposition 4. Suppose Assumptions 1 to 4 hold; then for any p(0) ∈ [p, p] and γ ∈]0, µ/N [, Algorithm 1 converges at rate ct to the set of optimal solutions P ? ; and dist(p(t), P ? ) ≤ct dist(p(0), P ? ), (10) where c = 1 − γ/L. The optimal convergence rate c = 1 − µ/(N L) is obtained when γ = µ/N . Proof: Let us start by showing that D(·) is P 1/L-convex N on [p, p]. From Lemma 2, we can write D(p) = i=1 Di (p) where Di (·) are convex on R+ for all i ∈ N and Di (·) is 1/L-convex on [pi , pi ]. Therefore, from Assumption 4 and the fact that sums of a convex and 1/L-convex function are 1/L-convex [13, Lemma 2.1.4] we get that D(p) is 1/L convex on [p, p]. Since D(·) is strongly convex on P, P ? ∩ [p, p] can have at most one element. In fact, P ? ∩ [p, p] is non-empty, since from (7) and Assumption 2 we have D0 (p) = Q − D0 (p) = Q − N X i=1 N X Mi ≤ 0 and mi ≥ 0, (11) (12) i=1 and therefore by the continuity of D0 (·) and the intermediate value theorem there exists p? ∈ [p, p] such that D0 (p? ) = 0. We now show the ct convergence rate of Algorithm 1 to p? . Without loss of generality suppose that p(0) ≥ p? . Then from Proposition 3 and the step-size choice of γ ∈]0, µ/N ] we know p(t) ≥ p? for all t ∈ N. Hence, suppose p(0) ≥ p? then we get that p(t+1) − p? = p(t) − p? − γD0 (p(t)), γ ≤ p(t) − p? − (p(t) − p? ) L  γ = 1− (p(t) − p? ) L (13) (14) where the inequality follows from the fact that p(t+1), p(t), p? ∈ [p, p] and that D is 1/L-strongly convex on [p, p], which implies that [13, Theorem 2.1.9.] 1 (15) (p − p? ) ≤ D0 (p), for all p ∈ [p, p]. L Applying Inequality (14) t times gives (10), which concludes the proof. Note that the optimal convergence rate c = 1 − µ/(N L) in (10) depends on the number of users N . However, the following mild assumption yields a convergence rate in the dual variable that is independent of the number of users, which illustrate excellent scaling properties Algorithm 1. Assumption 5. Let p = Ui0 (Mi ) and p = Ui0 (mi ) for all i ∈ N. Assumption 5 essentially gives each user the freedom to choose their utility functions Ui as well as upper and lower bounds mi and Mi with the constraint that Ui0 (Mi ) = p and Ui0 (mi ) = p. These utility functions can be customized to reflect the preferences or priorities of the user, for example the times of day that each user will require the most power. Proposition 5. Suppose Assumptions 1–3 and 5 hold. Then for any p(0) ∈ [p, p] and γ ∈]0, µ/N ], Algorithm 1 has a ct convergence rate which does not depend on the number of users. In particular, we have dist(p(t), P ? ) ≤ct dist(p(0), P ? ), (16) where c = 1 − N γ/L. The optimal convergence rate c = 1 − µ/L is obtained when γ = µ/N . Proof: The proof follows almost the same steps as the proof of Proposition 4. The only difference is that here the dual function D is N/L-convex on [p, p] instead of 1/Lconvex as in Proposition 4. To see why D is N/L-convex on [p, p], we have from Lemma 2 (in the Appendix) that PN D(p) = i=1 Di (p) where Di (p) is 1/L-convex on [p, p] for each i ∈ N . In the next section we will consider a specific form of utility function that is commonly used in the resource allocation literature [14]. In particular, we assume a utility function of the form Ui (qi ) = ai log(bi + qi ), (17) where the parameters ai , bi may be unique to the different users i ∈ N . Applying Proposition 4 to this logarithmic utility function, S we can assert specific conditions under which the set P = i∈N [pi , pi ] is connected. Proposition 6. Let ai in Equation (17) be ordered as a1 ≤ · · · ≤ aN . Let Mi = M and mi = 0 for all i. Then if (bi +M )ai ≥ ai+1 for i = 1, · · · , N −1 and p(0) ∈ [a1 /(bi + M ), aN ] then if we choose the step-size γ = µ/N we have  µ t dist(p(t), P ? ) ≤ 1 − dist(p(0), P ? ) (18) NL Proof: The result is a corollary of Proposition 4 and can be obtained by showing that Assumption 4 holds. To see that Assumption 4 holds, note that pi = Ui0 (M ) = ai /(bi + M ) and pi = Ui0 (m) = ai . Therefore, (bi + M )ai ≥ Demand estimates over time for Two-User Case 1 User 2 0.8 0.6 0.4 0.2 0 0 0.2 0.4 0.6 0.8 1 User 1 Fig. 1: Using a sufficiently small step size, the feasibility of the primal problem is maintained. The upper boundary of this feasible set is denoted by the dotted line. ai+1 for i = 1, · · · , N − 1 implies that P = connected. S i∈N [pi , pi ] is V. S UMMARY AND C ONCLUSION We considered the problem of allocating power to users in a network by one supplier and presented a distributed algorithm that uses a one-way communication between the supplier and users to coordinate the optimal solution. We showed how to choose step sizes and derive appealing convergence properties in the dual domain. Furthermore, we identified mild modifications to the power allocation problem that 1) results in a ct convergence rate of our algorithm, and 2) yields a convergence rate independent of the number of users in the network. All these indicate excellent scaling properties of the algorithm. The results presented here propose a paradigm for solving distributed resource allocation problems that achieve fast convergence rates, even with a one-way information passing mechanism. Based on this work, of interest to us, is to derive similar convergence rates in the primal domain. In addition, within the context of limited communication, we would like to study the tradeoffs between the need for primal feasibility, convergence rates and actual bits transmitted (bandwidth) using the one-way coordination protocol. IV. N UMERICAL R ESULTS In this section we illustrate the theoretical findings using two numerical examples. In both examples, we set mi = 0 and Mi and use the same utility function of the form in Equation (17) with ai = 20, bi = 1. Figure 1 depicts the first example which is a system consisting of two users. The power suppliers capacity is Q = 1.6 and the step size is γ = µ/N . As observed, both users are assigned a socially optimal rate of qi = 0.8 power units each and primal P feasibility is satisfied at each iteration N of the algorithm, i.e., i=1 qi (t) ≤ Q for all t. Figure 2 illustrate a scenario with multiple users N = 5, 10, 20, 30, 40, 150, 1000. The step-size is γ = µ/N , the initial price is p(0) = 30 in all cases, and the suppliers capacity is Q = 4N/5. The assumptions of Proposition 5 hold PN in this case. Figure 2a depicts the aggregate rates i=1 qi allocated to all users scaled by the power capacity Q. As observed, the primal variables remain feasible at each iteration of the algorithm, as proved in Proposition 3. Figures 2b and 2c respectively illustrate the convergence of the algorithm to the optimal primal and dual variables. As observed, the dual variables converge at a linear rate, which is to be expected due to Proposition 5. Moreover, the convergence is not sensitive to the number of users N which also agrees with the results of Proposition 5. Interestingly, the primal variables also converge at a linear rate which suggest that similar convergence results can be obtained for the primal variables. As can be observed, the results in figures 2a and 2c are identical for N = 5, 10, 20, 30, 40, 150, 1000. This can be explained by that the utilities of of the users are identical and the power supply increases with number of users. However, Proposition 5 also holds under much more general assumptions. In future work we will consider more complicated and realistic problems for which Proposition 5 holds. A PPENDIX The following Lemmas are used in our derivations. Lemma 2. Suppose Assumption 1 holds and set pi = Ui0 (Mi ) and pi = Ui0 (mi ) for i ∈ N . Then PN the dual function D(·) can be decomposed as D(p) = i=1 Di (p), where Di (·) is 1/L-convex on [pi , pi ] and the derivative D0 (·) is constant on [0, pi ] and on [pi , ∞]. In particular, Di0 (p) = Q/N − Mi if p ∈ [0, pi ] and Di0 (p) = Q/N − mi if p ∈ [pi , ∞]. Proof: a) We set Di (p) = Ui (qi (p)) − pqi (p) − p Q , N (19) where qi (p) is defined as in (5). By summing (19) over i ∈ N and recalling the definition of the dual function D in (4), we get D(p) = N X Di (p). (20) i=1 Let us now show that Di (·) is L1 -convex on [pi , pi ]. From [13, Theorem 2.1.9.] it is L1 -convex on [pi , pi ] if and only if for all y1 , y2 ∈ [pi (t), pi (t)] it holds that 1 |y2 −y1 |2 ≤ hy2 − y1 , Di0 (y2 ) − Di0 (y1 )i L   = y2 −y1 , −(Ui0 )−1 (y2 ) − −(Ui0 )−1 (y1 ) , (21) where the equality comes by using that (cf. (7) and (5)) i Di0 (p) = Q/N − qi (p) = Q/N − [(Ui0 )−1 (p)]M mi . (22) Due to the strong concavity of Ui (·) on [mi , Mi ] (cf. Assumption 1), Ui0 is bijective from [mi , Mi ] to [pi , pi ] and we can choose x1 , x2 ∈ [mi , Mi ] such that Ui0 (x1 ) = y1 and (a) Primal Feasibility (b) Convergence of the Primal Variable (c) Convergence of the dual Variable Fig. 2: Convergence of the algorithm for different number of users N = 5, 10, 20, 30, 40, 150, 1000. In Figures 2a and 2c the behaviour of the algorithm is identical for all N . The blue dotted line in 2c is the theoretical bound from Proposition 5. Ui0 (x2 ) = y2 . Then since Ui is concave and L-smooth we have from (23) in Lemma 3 that 1 − hUi0 (x2 )−Ui0 (x1 ), x2 −x1 i ≥ |Ui0 (x2 )−Ui0 (x1 )|2 , L or by using U 0 (x1 ) = y1 and U 0 (x1 ) = y1 , we get   1 y2 −y1 , −(Ui0 )−1 (y2 ) − −(Ui0 )−1 (y1 ) ≥ |y2 −y1 |2 . L Hence, (21) holds and we can conclude that Di (·) is 1/Lconvex on [pi , pi ]. Let us now show that the gradient Di0 (·) is constant on [0, pi ] and on [pi , ∞]. The result follows by combining (22) with Ui0 is decreasing and that U 0 (Mi ) = pi and U 0 (mi ) = pi . Lemma 3. A function f is concave and L-smooth on X if for all x1 , x2 ∈ X ⊆ Rn , 1 hf 0 (x1 )−f 0 (x2 ), x2 −x1 i ≥ ||f 0 (x2 )−f 0 (x1 )||2 , (23) L Proof: The proof follows directly from Theorem 2.1.5. in [13] and using that −f is convex. R EFERENCES [1] F. P. Kelly, A. K. Maulloo, and D. K. Tan, “Rate control for communication networks: shadow prices, proportional fairness and stability,” Journal of the Operational Research society, pp. 237–252, 1998. [2] A. Nedić and A. Ozdaglar, “Subgradient methods in network resource allocation: Rate analysis,” in Information Sciences and Systems, 2008. CISS 2008. 42nd Annual Conference on. IEEE, 2008, pp. 1189–1194. [3] S. Low, “Optimization flow control with on-line measurement or multiple paths,” in Proceedings of the 16th International Teletraffic Congress. Citeseer, 1999, pp. 237–249. [4] S. Galli, A. Scaglione, and Z. Wang, “For the grid and through the grid: The role of power line communications in the smart grid,” Proceedings of the IEEE, vol. 99, no. 6, pp. 998–1027, 2011. [5] E. Biglieri, “Coding and modulation for a horrible channel,” Communications Magazine, IEEE, vol. 41, no. 5, pp. 92–98, 2003. [6] R. Clarke, “Internet privacy concerns confirm the case for intervention,” Communications of the ACM, vol. 42, no. 2, pp. 60–67, 1999. [7] A. P. Snow, “Network reliability: the concurrent challenges of innovation, competition, and complexity,” Reliability, IEEE Transactions on, vol. 50, no. 1, pp. 38–40, 2001. [8] G. N. Ericsson, “Cyber security and power system communicationessential parts of a smart grid infrastructure,” Power Delivery, IEEE Transactions on, vol. 25, no. 3, pp. 1501–1507, 2010. [9] V. C. Gungor, D. Sahin, T. Kocak, S. Ergut, C. Buccella, C. Cecati, and G. P. Hancke, “A survey on smart grid potential applications and communication requirements,” Industrial Informatics, IEEE Transactions on, vol. 9, no. 1, pp. 28–42, 2013. [10] A. Beck, A. Nedic, A. Ozdaglar, and M. Teboulle, “An gradient method for network resource allocation problems,” IEEE Transactions on Control of Network Systems, vol. 1, no. 1, pp. 64–73, 2014. [11] X. Liu, K. Ren, Y. Yuan, Z. Li, and Q. Wang, “Optimal budget deployment strategy against power grid interdiction,” in INFOCOM, 2013 Proceedings IEEE, April 2013, pp. 1160–1168. [12] S. Boyd and L. Vandenberghe, Convex Optimization. New York, NY, USA: Cambridge University Press, 2004. [13] Y. Nesterov, Introductory Lectures on Convex Optimization. Springer, 2004. [14] R. Yim, O.-S. Shin, and V. Tarokh, “Reverse-link rate control algorithms with fairness guarantees for cdma systems,” Wireless Communications, IEEE Transactions on, vol. 6, no. 4, pp. 1386–1397, 2007.
3cs.SY
IJCSI International Journal of Computer Science Issues, Vol. 10, Issue 5, No 2, September 2013 ISSN (Print): 1694-0814 | ISSN (Online): 1694-0784 www.IJCSI.org The Cerebellum: New Computational Model that Reveals its Primary Function to Calculate Multibody Dynamics Conform to Lagrange-Euler Formulation Lavdim Kurtaj1, Ilir Limani2, Vjosa Shatri3 and Avni Skeja4 1 Department of Automation, Faculty of Electrical and Computer Engineering, University of Prishtina Prishtina, 10000, Kosovo 2 Department of Automation, Faculty of Electrical and Computer Engineering, University of Prishtina Prishtina, 10000, Kosovo 3 Department of Fundamental Engineering Subjects, Faculty of Electrical and Computer Engineering, University of Prishtina Prishtina, 10000, Kosovo 4 Department of Automation, Faculty of Electrical and Computer Engineering, University of Prishtina Prishtina, 10000, Kosovo Abstract Cerebellum is part of the brain that occupies only 10% of the brain volume, but it contains about 80% of total number of brain neurons. New cerebellar function model is developed that sets cerebellar circuits in context of multibody dynamics model computations, as important step in controlling balance and movement coordination, functions performed by two oldest parts of the cerebellum. Model gives new functional interpretation for granule cells-Golgi cell circuit, including distinct function for upper and lower Golgi cell dendritc trees, and resolves issue of sharing Granule cells between Purkinje cells. Sets new function for basket cells, and for stellate cells according to position in molecular layer. New model enables easily and direct integration of sensory information from vestibular system and cutaneous mechanoreceptors, for balance, movement and interaction with environments. Model gives explanation of Purkinje cells convergence on deep-cerebellar nuclei. Keywords: New Cerebellar function model, CMAC, Cerebellar elementary processing unit, Golgi cell, Basket cell, Stellate cell. 1. Introduction The cerebellum is part of vertebrate brain, and it is only part that spans to both sides continually without interruption. It plays important role in lower levels functions of motor control in relation to sensory information, such as coordination of complicated multi-joint bodies, balance, motor planning. According to connections with other parts of the brain, it is suggested for cerebellum to be involved in many other functional levels, up to cognition and emotional level. What makes debatable broad and diverse functional involvement of cerebellum is its uniform structure, in neuronal elements present, in local connectivity between them, and in circuits with other parts of the brain. This has lead authors of [1] to propose the general-purpose coprocessor function for the cerebellum. Based on connections between neuronal elements cerebellum can be viewed as a hierarchically organized system. Lowest 1 IJCSI International Journal of Computer Science Issues, Vol. 10, Issue 5, No 2, September 2013 ISSN (Print): 1694-0814 | ISSN (Online): 1694-0784 www.IJCSI.org level contains array of elementary processing units, each with group of neurons and single Purkinje cell, all arranged in highly ordered fashion [2]. Starting from functions of oldest parts of the cerebellum, and importance of robot dynamics model for high performance control algorithms, new cerebellar function model is developed that relates cerebellar circuits with multibody multijoint dynamics model computations. 2. Multibody System Dynamics Meaning of term multibody system is very broad. In following, this term will imply to a set of bodies, called links, assembled together in a specific way with a set of movement constraining elements, called joints [3]. Interaction between bodies can happen only in joints. Joint can be only a concept that describes relative position between bodies, or specific construction where bodies are rigidly connected. Former case of joint infers that constraint motion is achieved with special construction of link endings that will be assembled together. In later case, all bodies that are rigidly connected together are treated as single link. Minimum number of parameters required to define relative movement of links connected with a joint denotes joint degrees of freedom. Sum of all joint degrees of freedom gives multibody system degrees of freedom. Each joint may have actuator for intentional altering of joint position (active joint), otherwise joint is passive and its state may change from external interactions acting on corresponding links. Links may be rigid or flexible. In general all links will express some degree of flexibility (elasticity), but for normal operating conditions deformation are bellow some maximal acceptable value. Theory of multibody system can be used to analyze all animals with skeletal structure (vertebrata), including humans, were links are represented by bones and joints are usually called articulations [4]. Muscles are used for joints actuation. A typical artificial multibody system, that sometimes serves as synonym for them, are robots [5], [6], sometimes with structure inspired by nature. Robotics is interdisciplinary field and many disciplines contribute to different aspects of its development, naming some: mechanics, electronics, mechatronics, control engineering, computer science, biomechanics, etc. Main topics of robotics are kinematics, dynamics, trajectory planning, sensing, motion control, and intelligence. 2.1 Robot kinematics Robot consists of links connected with joints. Robot kinematics deals with problem of finding analytical model that describes robot motion, with respect to fixed coordinate frame over time, without regard to forces and/or moments that cause the motion. Forward kinematics will give position p and orientation ψ of some frame attached to the robot, usually end-effector frame, as a function of joint variables q  p    f FK q  .   (1) Opposite problem of finding joint variables q for given end-effector position p and orientation ψ is solved with inverse kinematics. Solution of forward kinematics is unique, whereas solution of inverse 2 IJCSI International Journal of Computer Science Issues, Vol. 10, Issue 5, No 2, September 2013 ISSN (Print): 1694-0814 | ISSN (Online): 1694-0784 www.IJCSI.org kinematics is not, necessitating sometime to add additional variables [7] and sometime to use numerical methods [8]. 2.2 Robot dynamics General form of dynamics equation of motion in matrix form (inverse dynamics) for robots with rigid links, derived following Lagrange-Euler formulation (L-E) is   D (q )q  C (q, q )  G (q )  F f (q )  J T (q ) f e , (2) and gives torques/forces τ needed to drive joints for desired trajectory given by joint variables q , q , and q , for joint position, velocity, and acceleration. D (q ) denotes inertia matrix, C (q, q) is the vector of Coriolis and centripetal terms, G (q) is the vector of gravity terms. Friction is represented with F f (q) and any friction model may be used. Usually it includes dynamic friction and other unstructured friction effects. Possible interaction of end-effector with environment is expressed with last term, where f e is vector of external forces and torques, and J (q) is robot Jacobian. Eq. (2) is used for different forms of control strategies, e.g., feedforward, computed torque, feedback linearization [9], [10]. Forward dynamics equation can be derived from (2) by solving it for acceleration   q  D 1 ( q )   C ( q , q )  G ( q )  F f ( q )  J T ( q ) f e , (3) and is used for simulation of robot movement. 2.3 Processing units for robot dynamics computation Advanced control strategies rely on dynamics model of the robot to achieve and maintain desired system dynamic response in accordance with specified performance criteria. To be able to track desired trajectories as close as possible, computation of appropriate torques/forces to drive joint actuators of the robot has to be done in real time. Delay caused by computer system to calculate control algorithm has negative influence on system performance. To shorten this delay when control computer system is based on single processor, computation is based on Newton-Euler formulation (N-E) for dynamics model, as a set of forward and backward recursive equations. Computational complexity of N-E is of order O(n), where n is the number of degrees of freedom (DOF) of the robot, as compared to O(n4) for L-E. Two main additional approaches are recursive Lagrangian formulation [11] with O(n) complexity, and generalized d'Alambert equations of motion [12] with complexity of order O(n3). Classification of computational complexity is based in number of multiplications and additions for dynamics model calculation (ndm). When calculations are done in single processor computers with given execution time per instruction (Tins), total number of instructions ndm will determine time delay introduced to control system by computation of dynamics model to Tsp=ndm·Tins. For computer architectures with many processors, recursive computations will limit minimum delay proportional to the number of recursion steps (nrs), i.e. Tmpr=nrs·Tins, even under assumption that calculation of single 3 IJCSI International Journal of Computer Science Issues, Vol. 10, Issue 5, No 2, September 2013 ISSN (Print): 1694-0814 | ISSN (Online): 1694-0784 www.IJCSI.org recursion step is one "super" instruction and executes within Tins. This can not be made smaller because of data dependencies between recursion steps. For N-E case there are n forward and n backward steps and nrs=2·n, where n is number of degrees of freedom for the robot. If for some multibody system, with n=10 and with many very slow processors with Tins=100μs, control system must update control values every Tc=10ms, question is: what the control computer architecture should be and which set of "super" instructions should it posses? Simple solution that pops up, when it is required to do complex, time consuming calculations with slow processors is to store precalculated values in a table. "Super" instruction would be the one that reads input data, calculates address from input data, reads value from the table, and writes result to the output. If input data are directly used as address, processor would be nothing but a memory of sufficient capacity. Calculation time with this "computer" system would be 1·Tins. Despite its simplicity, this approach has as a drawback enormous size of memory for most applications. Input data space dimension for robot with n DOF is 3n (n joint positions, n velocities, and n accelerations). If each dimension of input data space is quantized with bk values, memory size would be b1·b2···b3n, indicating exponential growth. If all bk are equal memory size would be bk3n, and for bk=16 (that is considered to be very coarse quantization) it would be 1630, i.e. 120-bit address and 102412 byte memory space, if single byte values are stored. Decreasing memory size of this unstructured approach is sought by exploiting structure of the problem to be solved. Dynamics equation of motion for single joint is  k  d k 1 (q)q1  d k 2 (q)q2   hk 11 (q)q1  hk 21 (q)q2  h (q )q  h (q)q  1 k 22 2  k 12   hk1n (q )q1  hk 2 n (q )q2   d kn (q)qn   hkn1 (q)qn   hkn 2 (q)qn     hknn (q)q n  Gk 1 ( q ) g x 0  G k 2 ( q ) g y 0  Gk 3 ( q ) g z 0  T  q1  q   2     qn  (4) Fkd q k  Fks (qk )  J 1k (q) Fex0  J 2 k (q ) Fey 0  J 3k (q) Fez0  J 4 k (q) M ex0  J 5 k (q) M ey 0  J 6 k (q ) M ez0 where gravity term for joint k, Gk(q), has been written in form so calculations with individual components of gravitational constant vector g are visible explicitly. This form has two advantages; first, it creates gravity terms that are similar in form with most of others, and second, it opens possibility to compensate directly when multibody reference changes orientation relative to gravitational field, that is present almost all the time for example in humans and mobile robots. 4 IJCSI International Journal of Computer Science Issues, Vol. 10, Issue 5, No 2, September 2013 ISSN (Print): 1694-0814 | ISSN (Online): 1694-0784 www.IJCSI.org To calculate dynamics model for single joint, as seen from Eq. (4), we need only a small set of prototype functions. Main function prototype of form f p (q, x)  N (q) x , (5) will suffice for calculation of inertial torques, d kj (q )q j , gravitational torques, Gkj (q ) g j , and torques exerted from interaction with environment, J jk (q) Fej and J jk (q) M ej . Calculation of Coriolis and centrifugal torques hkij (q )qi q j can be done by using first prototype function  Cc  f p (q, x) y , (6) or they can be calculated by defining second prototype function f p 2 (q, x, y)  N (q) xy . (7) Calculating previous terms of dynamics equation with second prototype can be done by giving constant value equal to 1 for second variable, y=1, or by providing some controlled switching mechanism for variable y. Calculation of dynamic and static friction torques, Fkd qk and Fks (qk ) , is possible with either prototype function, but, having in mind their simplicity compared to other terms, it seams like waste of computational resources. This could be solved with some add-on to selected prototype function. Extended second prototype function would become f p 2 s  (q, x, s, y, a, b)  N (q) xy( s)   d a   s (b) , (8) were we have included logical variable s as switch for variable y, with y(s)=1 for one value of s and y(s)=y for the other. Two last terms of Eq. (8) can be used to calculate friction torques of Eq. (4). Computer architecture for calculation of dynamics model that exploits structure of the model would have first layer with one processing unit (PU) for each term in Eq. (4) for each DOF, excluding friction terms, with single "super" instruction for doing calculation according to Eq. (8) within Tins time, and second layer with one PU for each DOF for summing corresponding results together, also within Tins time. Total calculation time would be 2·Tins, independent of DOF for the system. First layer of architecture resembles Single Instruction Multiple Data (SIMD) class of parallel computer architectures according to Flynn's taxonomy [13], [14]. Number of PU in first layer for n=10 is n·(n+n·n+3+3+6)=1220, and second layer has 10 PU. With new structure, dimension of input space for nonlinear function is n (as opposed to 3n for unstructured approach), and if value is taken from table, table memory size for single PU would be 1610, i.e. 40-bit memory address and 10244 byte (at least, now we can name it: 1 Tera byte) memory space. Despite enormous reduction, this value is still high. Different approaches are followed to reduce this value, and approximation of nonlinear functions with neural networks is one of them. 5 IJCSI International Journal of Computer Science Issues, Vol. 10, Issue 5, No 2, September 2013 ISSN (Print): 1694-0814 | ISSN (Online): 1694-0784 www.IJCSI.org 3. Cerebellum and CMAC There is a small number of neuron types present in cerebellum, common to all vertebrates, arranged in highly ordered fashion. Among them are largest neuron in the brain, (giant) Purkinje cell, and most numerous type of neuron, small granule cell [2]. They are organized in three layers. Middle layer, so called Purkinje cell layer, contains only Purkinje cells packed in one-cell thick layer. Inner layer (below Purkinje layer), granule cell layer, inhabits granule cells, Golgi cells, and some other interneurons (some only at specific regions) [15]. Outer layer of cerebellar cortex is named molecular layer. It consists of granule cells axons with characteristic T-shaped form crossing at right angle with plane of flat-shaped Purkinje cells dendrite trees. Present in this layer are also basket and stellate cells. Granule cells are the only excitatory cells in the cerebellum, all the others are inhibitory. Axons of Purkinje cell are sole outputs of the cerebellar cortex, whereas inputs are through group of mossy fibers and through climbing fibers. There are lot of evidences about neuronal connections inside cerebellum, and higher functional organizations, into microzones and even higher to zones, when considering connections with other parts of the brain [16]. Simple sketch of connections between cerebellar neurons is given in Fig. 1. There are two main feedforward routes from input to output. In first main route afferent mossy fibers project to granule cells, granule cells project to Purkinje cell, Purkinje cell sends its efferent axon out of the cerebellar cortex. Second main route is from climbing fiber to Purkinje cell, and again from Purkinje cell out of the cerebellar cortex. Connection climbing fiber-Purkinje cell is rather specific in that each Purkinje cell receives strongest synaptic contact in the brain, and that exclusively from single climbing fiber. Additional routs are through basket and stellate cells inhibitory interneurons. Golgi cell forms local feedback loop with granule cells, and an additional feedforward route from mossy fibers to Purkinje cell output fiber. Connectivity like this is present in all vertebrates, almost invariant, with Fig. 1 Cerebellar neurons, connections, and signal routes. PC: Purkinje cell; GC: Granule cell; GoC: Golgi cell; StC: Stellate cell; BaC: Basket cell; Gl: glomeruli; aa: granule cell ascending axon; PF: parallel fibers; adt: Golgi cell ascending dendritic tree; ddt: Golgi cell descending dendritic tree; mf1, mf2: mossy fibers; CF: climbing fiber; PC axon: Purkinje cell axon. 6 IJCSI International Journal of Computer Science Issues, Vol. 10, Issue 5, No 2, September 2013 ISSN (Print): 1694-0814 | ISSN (Online): 1694-0784 www.IJCSI.org difference only in quantities [17]. There are also additional similar structures in vertebrates and invertebrates [18]. Other difference is anatomical and has to do with appearance of deep folds that resulted with increase of cerebellar cortex, with purpose of more compact packing. If unfolded human cerebellum would have approximate dimensions of 1 m long and 50 mm wide, with as high as 15x106 Purkinje cells [19]. Number of Purkinje cells in rat is 3.38x105 [20] and in frog around 8300 [21]. Cerebellum is collection of numerous elementary processing units (ePU), thousands to tens of millions, which may, more or less, share processed input data, and influence other ePU with limited number of collaterals from output fiber. To understand function of the cerebellum, as a first step would be to understand function of single ePU by neglecting possible mutual couplings, as they would belong to higher level organization of several ePU. This approach is followed by renowned theories of Marr [22] and Albus [23], and formalized later by Albus with Cerebellar Model Articulation Controller (CMAC) [24] as type of artificial neural network (ANN) that can be used as robotic controller. Model retains two main feedforward routs, with attribution of learning mechanism to climbing fiber-Purkinje cell route. Purkinje cell functions as a perceptron with adjustable weights that model synapses between this cell and granule cell axons (parallel fibers), as only site were learning takes place mediated by climbing fibers assumed to carry error signal. Model does not include explicitly molecular layer inhibitory neurons (basket and stellate cells), but their functionality according to theory is included in possibility of having negative weights. Fig. 2 shows basic CMAC structure. Granule cell layer processing is represented with mapping MIA from input space (mossy fibers) to association space (inputs of the perceptron). This type of ANN is characterized with fast learning, attributed to local generalization property, which in turn is dependent on mapping MIA. By selecting proper mappings CMAC can turn to simple perceptron that wont be able to solve even XOR problem, to storage table, to network with properties equivalent to radial basis functions (RBF) ANNs, it can turn to be equivalent with fuzzy ANN. or to some quite different ANN. In case of multidimensional input spaces, standard operation used to process receptive fields is multiplication operation [25] [26] (in standard CMAC with rectangular shaped receptive fields AND operation is used [27]). With this broad range of possibilities, success of the network (perceptron) is highly dependent on proper selection of mapping for selected Fig. 2 CMAC structure. 7 IJCSI International Journal of Computer Science Issues, Vol. 10, Issue 5, No 2, September 2013 ISSN (Print): 1694-0814 | ISSN (Online): 1694-0784 www.IJCSI.org problem. So, network can learn, but quality and quantity of learning relies on opportunities that are given for the network to learn from associations presented by mapping MIA. Since this mapping represents processing in the granular layer, turns attention to process of creating multidimensional receptive fields, and if multiplication really is present in biological neurons [28], [29] [30]. If it is present, is it implemented by a single neuron or by a group of neurons [31], [32]? In other side, coordination of multi-joint systems may have great benefit from it, as dimension of input space can be greatly reduced, because of multiplicative nature of speed and acceleration in dynamics model, Eq. (4). Does multiplication between two different inputs happen in cerebellum? Where possible sites are where multiplication in the cerebellum could take place, and how could they be related to dynamics model computation, as important issue in controlling balance (assisted by evolutionary oldest part of the cerebellum, archicerebellum), and movement coordination (second oldest part of the cerebellum, spinocerebellum or known also as paleocerebellum)? 4. New Computational Model of Cerebellar Function Multi-joint articulated robots dynamics is characterized with many interactions between joints. High quality control requires carefully designed controller, and robot dynamics model is usually part of this controller [33], [34]. With exception of simple cases, finding this model for more complicated structures is a challenge. Having in mind that oldest parts of the cerebellum are related to the problems that in essence contain dynamic interactions, better understanding of cerebellar function will help us to solve robotic problems of ever increasing complexity, which still in number of sensors and actuators is far behind from humans and animals that serve as inspiration [35]. This is new anatomy-based model [36] that gives new functional description for cerebellar circuits, revealing relation to dynamics calculation. Model includes: - new functional interpretation for granule cell-Golgi cell circuit, and distinction between upper and lower dendrite trees, - explanation of scenarios for sharing Golgi cells between Purkinje cells, - new function for basket cells, - new function for stellate cells, with distinct feature for upper and middle ones, - definition of coding for different signals at parallel fibers and mossy fibers for consistency with new model, - direct integration of information from vestibular system, - direct integration of multilevel interaction with environment, - explanation of convergence on deep-cerebellar nuclei. 4.1 Cerebellar elementary processing unit Cerebellum will be treated as computer architecture with several levels of organization. Lowest level contains thousands to millions of cerebellar elementary processing units (CePU), with only one output form axon of single Purkinje cell (PC). Functional diagram of CePU is shown in Fig. 3. Most numerous inputs to the PC come from T-shaped axons of granule cells (GrC), know as parallel fibers (PF), and are excitatory by nature. Other inputs to PC are from molecular layer inhibitory interneurons, stellate cells (StC) and Basket cells (BaC). StCs provide input through PC dendrite tree, whereas group of BaCs supply inhibitory synapses to the basket-like structure at initial segment of PC soma. PF provide inputs to the StC and BaC, and serve as data path that is shared between many PCs. Each PC 8 IJCSI International Journal of Computer Science Issues, Vol. 10, Issue 5, No 2, September 2013 ISSN (Print): 1694-0814 | ISSN (Online): 1694-0784 www.IJCSI.org will receive data from as many as 200000 (in humans) from about 10 million PF that will pass by. Data at PF is result of preprocessing done by GrCs and Golgi Cells (GC) over cerebellar input data from mossy fibers (MF). 4.2 Granule cells-Golgi cell circuit Granule cell receive inputs from a number (usually 4-5) of distinct MF and generates output to a single PF. A group of GrC will map information from mg-dimensional MF input space to a sparse pgdimensional PF output space. Index g is used to indicate existence of many different groups. Marr [22] referred to output of GrC as codon representation of an input, while Albus [23] named mapping process as expansion recoding and output as association of input. In concepts of ANN output would correspond to some sort of multidimensional basis function. Sparsity is considered important feature of new representation and will influence learning speed and capacity. Fig. 3 Functional diagram of Cerebellar elementary Processing Unit, CePU. In an ideal situation, when mossy fibers provide information in form of normalized basis functions, and GrC would function as multiplier of its inputs, output would be normalized higher dimensional basis function. This ideal approach is usually followed when using ANN. GoC are used to deal with real 9 IJCSI International Journal of Computer Science Issues, Vol. 10, Issue 5, No 2, September 2013 ISSN (Print): 1694-0814 | ISSN (Online): 1694-0784 www.IJCSI.org situations and keep mean output activity on controlled level. GoC influences output over two control mechanisms, feedback and feedforward, with former acting through upper part off dendritic tree residing on molecular layer, and synapsing with GrC axons (PF and ascending axon [37]). Feedforward uses lower dendritic tree and synapses with MF. According to Marr [22] output activity is controlled by influencing GrC threshold by that tree that is more powerfully stimulated [22]. Albus suggested that automatic gain control [23] is used to maintain constant output activity independent of input activity. Distinction between two trees is on speed of acting, with feedforward path being faster acting. Our opinion is that part of cerebellum for handling dynamic interactions (balance control, movement coordination, and joint decoupling) between joints of the multijoint system works in mode of rate coded version of continuous control system. Functional relation between inputs and outputs will be analyzed from functional diagram of GrC-GoC circuit, Fig. 4 (see also Fig. 7 from [23]). GrC receive inputs Ljk from structures called mossy fiber rosettes (cerebellar glomeruli); place where GoC axon terminates too and influences mossy fiber signals M. Output from single GrC will be Fig. 4 Granule cells-Golgi cell functional diagram for preprocessing input data from mossy fibers. 10 IJCSI International Journal of Computer Science Issues, Vol. 10, Issue 5, No 2, September 2013 ISSN (Print): 1694-0814 | ISSN (Online): 1694-0784 www.IJCSI.org  4  Yi     M ik   i  K th O   GGr    k 1  (9) if control is done by changing GC threshold, and it will be 4   Yi    g (O)   M ik   i   GGr   k 1   with (10) g (O)  1  K g O (11) if control is done through automatic gain control. Kth and Kg are glomeruli specific constants. Function of GrC is assumed simple summation of four incoming signals from dendrites followed by GGr part, which may include neuron dynamic and nonlinear static characteristics (except firing threshold σi already included). Plus sign over Y indicates that value can be only positive or zero, i.e. neurons by nature are excitatory or inhibitory and their functionality can not be reversed. GoC output is p q   O    H U   Yi  H L   R j     H Go .   i 1 j 1   (12) In contrast to [22] it is assumed that action potentials from both dendritic trees are simply summed. Possible behavioral differences are taken into account with functions HU and HL. p and q denote number of synapses (assumed fixed) made by upper and lower dendritic trees, respectively. Spontaneous firing is represented with θ, while dynamic and static (without spontaneous firing) characteristics of GoC are represented with GGo. Plus sign over O, again, has same meaning, whereas minus sign preceding it will indicate inhibitory nature of GoC. Static characteristics of GrC and GoC are given in [38], where it can be seen that GoC is characterized with spontaneous firing activity, while GrC will start firing after crossing some threshold, modeled with σi and θ, respectively. From Eq. (9), (11), (12) and after summing over m active outputs Yi we can find m  4  GGr     M ik   i  K th H Go    m i 1  k 1     Yi  1  GGr  K g H U H Go  m i 1 GGr H  K g H U H Go  m  L HU q (12) Rj j 1 1  GGr  K g H U H Go  m  Aim is to keep m in a small fraction of p, around 1%. Independence of output activity from input activity Mik cannot be achieved, contrary to conclusion of Albus [23], because only positive term in Eq. 11 IJCSI International Journal of Computer Science Issues, Vol. 10, Issue 5, No 2, September 2013 ISSN (Print): 1694-0814 | ISSN (Online): 1694-0784 www.IJCSI.org (12) is function of inputs, and by removing that (ex. by making closed loop gain GGr·KgHUHGo·m very large) no output will be active. But despite that, output activity can be kept constant if inputs Mik are in form of basis functions, which would result in constant first term of Eq. (12). Sparsity then is controlled with widths of basis functions. All this could have been done with GrC only, without complicating things with cerebellar glomeruli and GoC. Our conclusion is that usefulness of this structure lies on interpretation of second term of Eq. (12). Since, except input information, all parameters are related to constructive parameters, this equation can be written as Y  k1 M  k 2  k 3 R . (13) For given M it is equation of a line with negative slope. This slope will effectively turn to positive one at final action: inhibiting inhibitor neuron. Our opinion is that main functionality behind preprocessing with GoC and cerebellar glomeruli is realization of linear dependence of group of outputs Yi from an additional input R, i.e. simple multiplication operation, and preparation phase for approximating function prototypes given by Eq. (5)-(8). Consequence of this functional interpretation is that coding to be used for information on Rj inputs is rate coding with no GoC axon termination on corresponding glomeruli. Outputs Yi will provide higher dimensional basis functions in M space modulated in amplitude with additional variable R. Same outputs can be used between many PC for final function approximation, ex. when calculating dynamics model terms of form d km (q)qm , same set of Yi outputs (PF) can be used for all joints, where M would correspond to joint positions vector q, and R to acceleration q m . This removes the doubt put by Marr [22] about sharing GoC between PC. One prediction can be made from this interpretation: number of PC that will contact this set of PF should be related to dimension of joint space where dynamic interactions may occur. To calculate whole dynamics equation, for each term in Eq. (4) at least one GoC will be needed. Recoding higher dimensional spaces can be done with several GoC over corresponding subset of dimensions, and number of GrC dendrites could match the dimensionality of subspace. These subsets may have realistic meaning, like shoulder position, head position, etc. 4.3 Basket cells and Stellate cells Role of BaC and StC according to Marr [22] was in setting up the PC threshold, with distinguishing role of most superficial StC as on preventing false initial response by the PC. Albus in his theory [23] assigned them function of providing negative weights for PC that serves a function as a perceptron, a feature that would enable PC high learning capabilities. Many models and theories of cerebellar function do not include them at all [39], or make no difference between them and refer them together as basket/stellate cells [39]. [40] concluded that StC and BaC are similar types of interneurons, with functional difference to synaptic strength, with that of BaC (somatic) being 7-fold higher than that of StC (dendritic). Different spatial, temporal, and physiological effects and consequences for stellate (dendritic), and basket (somatic)-type inhibition was attributed by [39]. When cerebellum is set in context of balance and movement coordination, we hypothesize different function for each of them in duty of computing dynamic interactions. Basket cells are part of the circuit for calculating Coriolis and centrifugal terms of dynamics equation. Stellate cells will mainly handle calculations of friction terms. A set of GrC with one GoC and one PC will be able to approximate 12 IJCSI International Journal of Computer Science Issues, Vol. 10, Issue 5, No 2, September 2013 ISSN (Print): 1694-0814 | ISSN (Online): 1694-0784 www.IJCSI.org calculation of product between one multidimensional nonlinear function and one linearly dependent variable, Eq. (5). This set can be used to calculate terms of inertial torques of Eq. (4) d km (q)qm  f pk (q, qm )  N k (q)qm p km   Ysk   wPCs (14) s 1 p km   Bs (q)qm  wPCs s 1 To calculate Coriolis and centripetal terms an additional multiplication is needed, Eq. (6). One BaC with its axon synapsing on PC soma will approximate this, under assumption that this interaction performs multiplication between these two signals, and ijth term for joint k can be written as hkij (q )qi  q j  f pk (q, qi )  q j  p k  kij     Ys  wPCs   q j    s 1  (15)  sq  m  kij     Bs (q)qi  wPCs q   j s  s  q  with Bs(q) being m+1 nonzero bases functions for current joint vector q, and wkijPCs are weights of PFPC synapses. This approach would need n2 PC and BaC for single joint. Additionally, PF with joint speed data q is needed. To find more suitable solution we will start from a group of Coriolis and centrifugal terms hki  hki1 (q)qi q1  hki 2 (q)qi q2   hkin (q)qi qn . (16) By applying Eq. (15) for given position q0 and square basis functions of width 1, Eq. (16) takes this form ki1 ki 2 hki  Bs (q0 ) qi wPCs  q1  Bs (q0 ) qi wPCs  q2   B (q )q w kii 1 ki 2  Bs (q0 ) qi wPCs w ki Xs  q1  w Xs  q 2   kii Bs (q0 ) qi wPCs s 0 1 ki1 BCs  kin  Bs (q 0 ) qi wPCs  qn kin  w Xs  qn ki 2 Bs (q0 ) q 2 wBCs    kin Bs (q0 ) q n wBCs  (17) Last form of Eq. (17) can be interpreted as sum of n signals from BaC controls output from one PC. Weights wkijBCs represent synaptic connections PF-BaC. This form as input for BaC uses already present outputs from GrC. Now we need only n PC for single joint, but n2 BaC are needed. To simplify further, BaC that uses basis functions modulated with jth joint speed will be used for all PC that need it, resulting with total Coriolis and centrifugal term for joint k as 13 IJCSI International Journal of Computer Science Issues, Vol. 10, Issue 5, No 2, September 2013 ISSN (Print): 1694-0814 | ISSN (Online): 1694-0784 www.IJCSI.org k2 Bs (q0 )q 2 wPCs  B (q )q w kk Bs (q0 )q k wPCs  k1 k1 k2 hk  Bs (q0 )q1 wPCs Bs (q0 )q1 wBCs  Bs (q0 )q2 wBCs  s 0 1 k1 BCs  k2 Bs (q0 )q2 wBCs   kn Bs (q0 )qn wBCs k ( k 1) k ( k 1)  Bs (q0 )q k 1 wBCs  0  Bs (q0 )qk 1 wBCs   kn k1 k2 Bs (q0 )q n wPCs Bs (q0 )q1 wBCs  Bs ( q0 )q 2 wBCs    kn  Bs (q0 )q n wBCs   kn  Bs (q0 )qn wBCs (18)  Value zero at kkth term indicates anatomical observations that BaC do not inhibit the PC immediately adjacent [23], that is consistent also with physical interpretation that hkkk=0 [7]. Interpretation is valid too for wider basis functions, which will justify much less dense dendritic tree of BaC. Justification is based on the fact that all outputs from a group of GrC modulated with given joint speed carry joint speed information, and it will suffice to sample it sparsely, ex. 2 per basis width m, i.e. if m=20 number of inputs to BaC would be p/10, meaning ten times less than inputs to GoC, and not necessarily related to number of PC synapses. Even further simplification can be in using fixed PF-BaC synapses. Consequence of this would be that BaC make synapses with ascending axon of corresponding GrC outputs, which are essentially hard wired [41] connections, but there are disagreements about functionality between GrC synapses on ascending axon and PF fiber [42], [43]. Additional possibly adjustable places are BaC-PC synapses, which depending on the configuration may be redundant to GrC-BaC synapses, or the only one adjustable. Other extreme, in contrast to mammals and birds, is total lack of BaC, like in most fish, amphibians, and most reptiles [39]. This could be interpreted as lack of given type of dynamic interactions, insignificant contribution, or different mechanism of approximation. There are two friction terms in dynamics equation of motion, dynamic and static. Calculation of dynamic friction is readily achieved with StC that would receive inputs from sparsely sampled joint speed modulated basis functions, like in BaC, where output of the StC would correspond to recovered joint speed information. StC synapse with PC dendrite would represent dynamic friction coefficient Fd  rnd d ( p )  k   kfd  Fkd q k    Bs (q )qk  wSCs  wk  s  rnd ( p )  SP . 1   (19) Weights wkSCs are for PF-StC synapses that may be fixed one, whereas adjustable weight is the one between StC and PC wkSP. Friction effect is local and in ideal case there is one friction term per joint. Since in living organisms many joint are with many DOF driven by many paralleled actuators (muscles), each actuator that drives given joint will need one StC. Those StC at most superficial regions of molecular layer would probably be the ones related to joint with 1-DOF, and deeper one for joints with more DOF, where resultant speed would govern dynamic friction torques. Calculation of static friction term would need GrC with space encoded joint speed. This task can be accomplished with smaller GoC and small number of GrC. If outputs of these GrC space coded joint speed information, static friction can be calculated as 14 IJCSI International Journal of Computer Science Issues, Vol. 10, Issue 5, No 2, September 2013 ISSN (Print): 1694-0814 | ISSN (Online): 1694-0784 www.IJCSI.org  v  k k   kfs  Fks (qk )    Bs (q k )  wSCs w  SP .  s 1  (20) In this case weights wkSCs at PF-StC synapses are adjustable, whereas between StC and PC wkSP is redundant, or can be used as global adjustment parameter. 4.4 Functional integration of sensory information All types of information generated from different that are related to balance, movement, and interaction with environment are easily integrated with this new functional model of the cerebellum. Processed information from vestibular systems (saccule and utricle), combined with information from joints, will result with orientation of body relative to gravitational field. This information can be used in computation of gravity terms of dynamics model in a similar way as was done with inertial torques, Eq. (4) and Eq. (14), with only difference that instead of joint accelerations modulatory functions would be gravity projections. In a completely same way, and same set of computation prototypes (a set of GrC with one GoC and one PC) can be used to integrate cutaneous mechanoreceptors information for movement and interaction with environment. External forces, torques, and places of action will be found by processing sensor information. Their dynamic effects will be computed with expressions similar to Eq. (14) with modulatory function being six components of interaction force/torque for each segment of multijoint system. Last six terms of Eq. (4) represent this group of interactions, but it shows only one set from many possible, usually robot end-effector force/torque interaction with environment. 4.5 Higher levels of organization Second level of organization between CePU is done with PC collaterals [23], [44]. Third level is constituted from microzones [1], [45], each with a group of around 1000 PC arranged in a narrow longitudinal strip that crosses PF into right angle. PC axons terminate to a group less than 50 deep cerebellar nuclei (DCN) [46]. According to new model, microzone would correspond to computational unit that computes total joint torques, Eq. (4), by collecting together all results from individual CePU. This model can help to resolve dilemma about reason that hundreds of PCs converge to single DCN [47]. Climbing fibers (CF) that innervate PCs of microzone (each CF about 10 PC) come from a group of olivary neurons that tend to be coupled by gap junctions. Also axones of BaC are much longer in longitudinal direction, and stay mainly inside a microzone. It is thought that microzones represent effective cerebellar functional units, and even higher level organization represents functional modules (stripes, zones, and multizonal microcomplexes) [1]. These organizations are marked also with molecular markers, as an additional fact beside anatomical and physiological facts [16]. 5. Conclusions New computation model of cerebellar function tries to relate cerebellar neuronal circuits with problem of multijoint dynamics model computations. Multiplicative inclusion of joint speeds, accelerations, gravitational acceleration, and forces/torques of interaction with environment, will make great 15 IJCSI International Journal of Computer Science Issues, Vol. 10, Issue 5, No 2, September 2013 ISSN (Print): 1694-0814 | ISSN (Online): 1694-0784 www.IJCSI.org reduction of dimensionality of problem space to be learned and extend generalization over wide range of multiplicative variables. Model gives functional explanation of connections between main neuron types. To be consistent with model, position information should be space-coded with bases functions of selected width. Same data is additionally amplitude modulated (rate code) with an additional information source. Position information on mossy fibers should be in form of basis functions, whereas other variables that are used multiplicatively, such as joint speed, joint acceleration, etc., use simple rate code. Compared to traditional CMAC, new model may serve as guideline for preprocessing and possibilities of inclusion of pure multiplication in model, that is biologically plausible, for solving problems in robotics with higher level of generalization. Issues to be resolved in context of new model are functions of Purkinje cell collaterals, and for collaterals of climbing fibers. Additional information for seeking more probable explanation is branching of climbing fiber to 10 Purkinje cells: is it related to redundancy, or 10-fold increase in resolution, or maybe load sharing between paralleled actuators (muscle fibers), or group is related to timing issues like interpolation. References [1] Egidio D'Angel and Stefano Casali, "Seeking a unified framework for cerebellar function and dysfunction: from circuit operations to cognition", Frontiers in Neural Circuits, Januray 2013, Vol. 6, Article 116. [2] Dan H. Sanes, Thomas A. Reh, William A. Harris, Development of the Nervous System, Second Edition, Elsevier Academic Pess, 2006. [3] Abhinandan Jain, Robot and Multibody Dynamics: Analysis and Algorithms, Springer, 2012 [4] Aydın Tözeren, Human Body Dynamics: Classical Mechanics and Human Movement, Springer-Verlag, 2000. [5] Bruno Siciliano, Lorenzo Sciavicco, Luigi Villani, Giuseppe Oriolo, Robotics: Modelling, Planning and Control, Springer, 2011 [6] Siciliano, Bruno; Khatib, Oussama (Eds.), Springer Handbook of Robotics, Springer, 2008. [7] Fu, Gonzalez, Lee, Robotics: Control, Sensing, Vision, and Intelligence, McGraw-Hill, Inc., 1987. [8] Peter Corke, Robotics, Vision and Control: Fundamental Algorithms in MATLAB, Springer-Verlag, 2011. [9] Zhihua Qu, Darren M. Dawson, Robust Tracking Control of Robot Manipulators, IEEE Press, 1996. [10] Rafael Kelly, Victor Santibáñez Davila, Julio Antonio Loría Perez, Control of Robot Manipulators in Joint Space, Springer, 2005. [11] John M. Hollerbach, "A Recursive Formulation of Manipulator Dynamics", Massachusettes Institute of Technology, Artificial Intelligence Laboratory, A.I. Memo No. 533, June, 1979, Revised June, 1980. [12] C. S. G. Lee, B. H. Lee, R. Nigam, "An Efficient Formulation of Robot Arm Dynamics for Control Analysis and Manipulator Design", The University of Michigan, Center for Robotics and Integrated Manufacturing, April 1982. [13] Michael J. Flynn, Computer Architecture: Pipelined and Parallel Processor Design, Jones and Bartlett Publishers, Inc., 1995. [14] Flynn's taxonomy, (last accessed 2013.08.30), http://en.wikipedia.org/wiki/Flynn's_taxonomy. [15] Diño MR, Schuerger RJ, Liu Y, Slater NT, Mugnaini E., "Unipolar brush cell: a potential feedforward excitatory interneuron of the cerebellum", Neuroscience, 2000, 98(4): 625-36. [16] Karl Herrup and Barbara Kuemerle, "The Compartmentaliz- ation of the Cerebellum", Annu. Rev. Neurosci. 1997. 16 IJCSI International Journal of Computer Science Issues, Vol. 10, Issue 5, No 2, September 2013 ISSN (Print): 1694-0814 | ISSN (Online): 1694-0784 www.IJCSI.org [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] Ann B. Butler, William Hodos, Comparative Vertebrate Neuroanatomy: Evolution and Adaptation, Second Edition, John Wiley & Sons, Inc., 2005. Curtis C. Bell, "Evolution of Cerebellum-Like Structures, Brain, Behavior and Evolution", 2002, 59:312– 326. Gordon M. Shepherd (Ed.), The Synaptic Organization of the Brain, Fifth Edition, Oxford University Press, Inc., 2004. R. J. Harvey, Dr. R. M. A. Napper, "Quantitative study of granule and Purkinje cells in the cerebellar cortex of the rat", Journal of Comparative Neurology, 8 August 1988, Volume 274, Issue 2, pages 151– 157. A. Pellionisz, R. Llinas, "A Computer Model of the Crebellar Cortex of the Frog", Neuroscience, 1977, Vol. 2, pp. 19-35, Pergamon Press. David Marr, "A Theory of Cerebellar Cortex", J. Physiol., 1969, 202, pp. 437-470. James S. Albus, "Theory of Cerebellar Function", Mathematical Biosciences, February 1971, Volume 10, Numbers 1/2, pgs. 25-61. James S. Albus, "New Approach to Manipulator Control: The Cerebellar Model Articulation Controller (CMAC)", Transactions of the ASME Journal of Dynamic Systems, Measurement, and Control, September 1975, pgs. 220 - 227. Stephen H. Lane, David A. Handelman, and Jack J. Gelfand, "Theory and Development of Higher-Order CMAC Neural Networks", IEEE Control Systems, April 1992. Wen Yu, Floiberto Ortiz Rodriguez, and Marco A. Moreno-Armendariz, "Hierarchical Fuzzy CMAC for Nonlinear System Modeling", IEEE Transaction on Fuzzy Systems, October, 2008, Vol. 16, No. 5. W. Thomas Miller, III, Filson H. Glanz, L. Gordon Kraft, III, "CMAC: An Associative Neural Network Alternative to Backpropagation", Proceedings of the IEEE , Oct. 1990, Vol 78, No. 10, pp. 1561-1567. José Luis Peňa and Masakazu Konishi, "Robustnes of Multiplicative Processes in Auditory Spatial Tuning", The Journal of Neuroscience, October 6, 2004 - 24(40) 8907 - 8910. Fabrizio Gabbiani, Holger G. Krapp, Nicholas Hatsopoulos, Chun-Hui Mo, Christof Koch, Gilles Laurent, "Multiplication and stimulus invariance in a looming-sensitive neuron", Journal of Physiology Paris 98 (2004) 19-34. Panagiotis Nezis and Mark C W van Rossum, "Accurate multiplication with noisy spiking neurons", Journal of Neural Engineering, 2011, 034005 (5pp). Christof Koch and Idan Segev, "The role of single neurons in information processing, nature neuroscience supplement", November 2000, Vol. 3. Koch, C. and Poggio, T. "Multiplying with synapses and neurons". In: McKenna, T., Davis J.,and Zornetzer F.S. (Eds.) Single Neuron Computation, 1992, p. 315-345. Zhang Wenhui, and Zhu Yinfa, "Control of Free-floating Space Robotic Manipulators base on Neural Network", IJCSI International Journal of Computer Science Issues, November 2012, Vol. 9, Issue 6, No 2. Yongqiao Wei, Jingdong Zhang, Li Hou, Fenglan Jia, Qinglin Chang, "Backstepping Adaptive Fuzzy Control for two-link robot manipulator", IJCSI International Journal of Computer Science Issues, January 2013, Vol. 10, Issue 1, No 2. Maki K. Habib (Ed.), Bioinspiration and Robotics: Walking and Climbing Robots, I-Tech Education and Publishing, 2007. Egidio D'Angelo, "The cerebellar network: revisiting dhe critical issues", The Journal of Physiology (J Physiol), 2011, 589 14, pp 3421-3422. Cesana E, Pietrajtis K, Bidoret C, Isope P, D'Angelo E, Dieudonné S, Forti L., "Granule Cell Ascending Axon Excitatory Synapses onto Golgi Cells Implement a Potent Feedback Circuit in the Cerebellar Granular Layer", J Neurosci., 2013 Jul 24, 33(30):12430-12446. Fabio M Simões de Souza, Erik De Schutter, "Robustness effect of gap junctions between Golgi cells on cerebellar cortex oscillations", Neural Systems & Circuits 2011, 1:7. 17 IJCSI International Journal of Computer Science Issues, Vol. 10, Issue 5, No 2, September 2013 ISSN (Print): 1694-0814 | ISSN (Online): 1694-0784 www.IJCSI.org [39] James M. Bower, "Model-founded explorations of the roles of molecular layer inhibition in regulating Purkinje cell responses in cerebellar cortex: more trouble for the beam hypothesis", Frontiers in Cellular Neuroscience, August 2010, Volume 4, Article 27. [40] Jin Bao, "The role of short-term synaptic plasticity in neuronal microcircuit", PhD thesis, Biology Faculty, Georg-August-University Göttingen, Germany, 2010. [41] Robert E. Sims and Nicholas A. Hartell, "Differences in Transmission Properties and Susceptibility to Long-Term Depression Reveal Functional Specialization of Ascending Axon and Parallel Fiber Synapses to Purkinje Cells", The Journal of Neuroscience, March 23, 2005, 25(12):3246 –3257. [42] Girija Gundappa-Sulur, Erik de Schutter, and James M. Bower, "Ascending Granule Cell Axon: An Important Component of Cerebellar Cortical Circuitry", The Journal of Comparative Neurology, 2013, 408:580–596. [43] Paul Dean, John Porrill, Carl-Fredrik Ekerot & Henrik Jörntell, "The cerebellar microcircuit as an adaptive filter: experimental and computational evidence", Nature Reviews Neuroscience, 2010, 11, 3043. [44] O'Donoghue DL, Bishop GA., "A quantitative analysis of the distribution of Purkinje cell axonal collaterals in different zones of the cat's cerebellum: an intracellular HRP study", Exp Brain Res., 1990, 80(1):63-71. [45] Masao Ito, The Cerebellum: Brain for an Implicit Self, Pearson Education, Inc., 2012. [46] Richard Apps and Martin Garwicz, "Anatomical and physiological foundations of cerebellar information processing", Nat Rev Neurosci., 2005 Apr, 6(4):297-311. [47] Gilad Jacobson, "Spatio-temporal aspects of information processing in the cerebellar cortex", PhD thesis, Hebrew University of Jerusalem, January 2009. 18
5cs.CE
Computational Capabilities of Random Automata Networks for Reservoir Computing David Snyder1 , Alireza Goudarzi2 , Christof Teuscher1 1 Portland State University, 1900 SW 4th Avenue, Portland, OR 97206 USA 2 University of New Mexico, 1 University Boulevard Northeast Albuquerque, NM 87131 USA arXiv:1212.1744v2 [nlin.AO] 20 Apr 2013 (Dated: April 23, 2013) This paper underscores the conjecture that intrinsic computation is maximal in systems at the “edge of chaos.” We study the relationship between dynamics and computational capability in Random Boolean Networks (RBN) for Reservoir Computing (RC). RC is a computational paradigm in which a trained readout layer interprets the dynamics of an excitable component (called the reservoir) that is perturbed by external input. The reservoir is often implemented as a homogeneous recurrent neural network, but there has been little investigation into the properties of reservoirs that are discrete and heterogeneous. Random Boolean networks are generic and heterogeneous dynamical systems and here we use them as the reservoir. An RBN is typically a closed system; to use it as a reservoir we extend it with an input layer. As a consequence of perturbation, the RBN does not necessarily fall into an attractor. Computational capability in RC arises from a trade-off between separability and fading memory of inputs. We find the balance of these properties predictive of classification power and optimal at critical connectivity. These results are relevant to the construction of devices which exploit the intrinsic dynamics of complex heterogeneous systems, such as biomolecular substrates. I. INTRODUCTION Reservoir computing is an emerging paradigm that promotes computing using the intrinsic dynamics of an excitable system called the reservoir [1]. The reservoir acts as a temporal kernel function, projecting the input stream into a higher dimensional space, thereby creating features for the readout layer. To produce the desired output, the readout layer performs a dimensionality reduction on the traces of the input signal in the reservoir. Two advantages of RC are: computationally inexpensive training and flexibility in reservoir implementation. The latter is particularly important for systems that cannot be designed in a top-down way by traditional engineering methods. RC permits computation with physical systems that show extreme variation, interact in partially or entirely unknown ways, allow for limited functional control, and have a dynamic behavior beyond simple switching. This makes RC suitable for emerging unconventional computing paradigms, such as computing with physical phenomena [2] and self-assembled electronic architectures [3]. The technological promise of harnessing intrinsic computation with RC beyond the digital realm has enormous potential for cheaper, faster, more robust, and more energy-efficient information processing technology. Maass et al. [4] initially proposed a version of RC called Liquid State Machine (LSM) as a model of cortical microcircuits. Independently, Jaeger [5] introduced a variation of RC called Echo State Network (ESN) as an alternative recurrent neural network approach for control tasks. Variations of both LSM and ESN have been proposed for many different machine learning and system control tasks (Lukosevicius and Jaeger [1]). Insofar, most of the RC research is focused on reservoirs with homogeneous in-degrees and transfer functions. However, due to high design variation and the lack of control over these devices, most self-assembled systems are heterogeneous in their connectivity and transfer functions. Since RC can be used to harness the intrinsic computational capabilities of physical systems, our study is motivated by three fundamental questions about heterogeneous reservoirs: 1. What is the relationship between the dynamical properties of a heterogeneous system and its computational capability as a reservoir? 2. How much does a reservoir need to be perturbed to adequately distribute the input signal? It may be infeasible to perturb the entire system. Also, a single-point perturbation may not propagate throughout the system due to its internal topology. Thus, we consider the size of the perturbation necessary to adequately distribute the input signal. 3. In a physical RC device, it may be difficult to observe the entire system. How much of the system and which components ought to be observed to extract features about the input stream? We model the reservoirs with Random Boolean Networks (RBN), which are chosen due to their heterogeneity, simplicity, and generality. Kauffman [6] first introduced this model to study gene regulatory networks. He showed these Boolean networks to be in a complex dynamical phase at “the edge of chaos” when the average connectivity (in-degree) of the network is hKi = 2 (critical connectivity). Rohlf et al. [7] showed that with nearcritical connectivity information propagation in Boolean 2 networks becomes independent of system size. Packard [8] used an evolutionary algorithm to evolve Cellular Automata (CA) for solving computational tasks. He found the first evidence that connects critical dynamics and optimal computation in CA. Detailed analysis by Mitchell et al. [9] refuted this idea and accounted genetic drift, not the CA dynamics, for the evolutionary behavior of the CA. Goudarzi et al. [10] studied adaptive computation and task solving in Boolean networks and found that learning drives the network to the critical connectivity hKc i = 2. Snyder et al. [11] introduced RBNs for RC, and found optimal task solving in networks with hKi > hKc i. Here, using a less restrictive RC architecture, we find that RBNs with critical dynamics provided by hKc i tend to offer higher computational capability than those with ordered or chaotic dynamics. To be suitable for computation, a reservoir needs to eventually forget past perturbations, while possessing dynamics which respond in different ways due to different input streams. The first requirement is captured by fading memory. The separation property captures the second requirement and computes a distance measurement between the states of two identical reservoirs after being perturbed by two distinct input streams. It has been hypothesized that computational capabilities are optimal when the separation property is highest, but old input is eventually forgotten by the reservoir, which occurs when fading memory is lowest [12]. We extend the measurements described in [12, 13] to predict the computational capability of a reservoir in finite time-scales with a shortterm memory requirement. II. MODEL A Reservoir Computing device is made up of three parts: input layer, reservoir, and readout layer [cf. Fig. 1]. The input layer excites the reservoir by passing an input signal to it, and the readout layer interprets the traces of the input signal in the reservoir dynamics to compute the desired output. In our model, the reservoir is a Random Boolean Network (RBN). The fundamental subunit of an RBN is a node with K input connections. At any instant in time, the node can assume either of the two binary states, “0” or “1.” The node updates its state at time t according to a K-to-1 Boolean mapping of its K inputs. Therefore, the state of a single node at time t + 1 is completely determined by its K inputs at time K t and by one of the 22 Boolean functions used by the node. An RBN is a collection of N such binary nodes. For each node i out of N nodes, the node receives Ki inputs, each of which is connected to one of the N nodes in the network. In this model, self-connections are allowed. The network is random in two different ways: 1) the source nodes for an input are chosen from the N nodes in the network with uniform probability and 2) the Boolean function of node i is chosen from the Ki 22 possibilities with uniform probability. Each node sends the same value on all of its output connections to the destination nodes. The average connectivity will PN be hKi = N1 i=1 Ki . We study the properties of RBNs characterized by N nodes and average connectivity hKi. This refers to all the instantiations of such RBNs. Once the network is instantiated, the collective time evolution at time t can be described as using xt+1 = fi (xt1 , xt2 , . . . , xtKi ), where xti is the state of the i node i at time t and fi is the Boolean function that governs the state update of the node i. The nodes are updated synchronously, i.e., all the nodes update their state according to a single global clock signal. From a graph-theoretical perspective, an RBN is a directed graph with N vertices and E = hKiN directed edges. We construct the graph according to the random graph model [14]. We call this model a heterogeneous RBN because each node has a different in-degree. In the classical RBN model, all the nodes have identical in-degrees and therefore are homogeneous. The original model of Kauffman [6] assumes a static environment and therefore does not include exogenous inputs to the network. To use RBNs as the reservoir, we introduced I additional input nodes that each distribute the input signals to L randomly picked nodes in the network. The source nodes of Ki links for each node i are randomly picked from N nodes with uniform probability. The input nodes are not counted in calculating hKi. For online computation, the reservoir is extended by a separate readout layer with O nodes. Each node in the readout layer is connected to each node in the reservoir. The output of node o in the readout layer at time t isdenoted by yot and is PN t computed according to yot = sign j=1 αj xj + b . Parameters αj are the weights on the inputs from node j in the reservoir to node o in the readout layer, and b is the common bias for all the readout nodes. Parameters αj and b can be trained using any regression algorithm to compute a target output [5]. In this paper, we are concerned with RBN-RC devices with a single input node, and a single output node. III. A. MEASURES Perturbation Spreading RBNs are typically studied as closed systems in which the notion of damage spreading is used to classify the RBNs’ dynamics as ordered, critical, or chaotic [15]. Because our model requires external perturbations, we must extend the notion of damage spreading to account for RBNs which are continuously excited by external input. Since an RBN used as a reservoir is not a closed system, the propagation of external perturbations may behave distinctly from the propagation of damage in the initial states of the RBN. Let M be an RBN with N nodes and average connectivity hKi. Let ua be an input stream, and 3 input layer reservoir I=1 L=2 N =5 hKi = 2 A 0 0 1 1 readout layer Natschläger et al. [12] found that computational capability of recurrent neural network reservoirs are greatest when the difference between separation and fading memory are largest and that this coincides with critical dynamics. Therefore, we want fading memory to be low, while separation is high. We define the computational capability of a reservoir M over an input stream of length T , τ time steps in the past as: O=1 ∆(M, T , τ ) = Sτ (M, T ) − F(M, T ). B 0 1 0 1 F 0 1 1 0 B. FIG. 1. Schematic of a reservoir computing system. The input layer delivers the input signals to random nodes inside the reservoir. The readout layer receives output signals from random nodes inside the reservoir. The reservoir itself is made of a collection of computing nodes that are randomly interconnected. The reservoir creates a representation of the input signals that can be read and classified by the readout layer. Learning is performed by training only the readout layer nodes and connections. Entropy and Mutual Information Information theory [16] provides a generic framework for measuring information transfer, noise, and loss between a source and a destination. The fundamental quantity in information theory is Shannon information defined as the entropy HS of an information source S. For a source S that takes a state {si |1 ≤ i ≤ n} with probability p(si ), the entropy is defined as: HS = − ub be a variation of ua . Then the perturbance spreading of M with an input stream ua and its variation ub , where A and B are the states is P(M, ua , ub ) = H(A,B) N of the RBN after being driven by input streams ua and ub respectively, and H(A, B) is the Hamming distance between the states. For a dynamical system to act as a reservoir, it needs to be excited in different ways by very different input streams, while eventually forgetting past perturbations. These measurements are captured by the notions of separation and fading memory in [12]. However, to account for the importance of short-term memory in the reservoir and finite-length input streams, we are specifically interested in the separation of the system τ time steps in the past, within an input stream of length T . The ability of the RBN to separate two input streams of length T , which differ for only the first T − τ time steps, is given by Sτ (M, T ) = P(M, u, v), (1) where T = |u| = |v| and ( ūi , if i < T − τ vi = ui , otherwise. F(M, T ) = P(M, u, w), where T = |u| = |w| and ( ūi , if i = 0 wi = ui , otherwise. n X p(si ) log2 p(si ). (4) i=1 This is the amount of information that S contains. To measure how much information is transferred between a source and a destination, we calculate the mutual information I(S : D) between a source S and a destination D with states dj . Before we can calculate I(S : D) we need to calculate a joint entropy of the source and destination as follows: HSD = − n X m X p(si , dj ) log2 p(si , dj ). (5) i=1 j=1 Now the mutual information is given by: I(S : D) = HS + HD − HSD . (6) We will see later how we can use entropy and mutual information to see how much information from the input signals are transferred to the reservoir and how much information the reservoir can provide about the output while it is performing computation. C. In order for an RC device to be able to generalize, a reservoir needs to eventually forget past perturbations. Thus we define: (3) Tasks We use the temporal parity and density classification tasks to test the performance of the reservoir systems. According to the task, the RC system is trained to continuously evaluate n bits which were injected into the reservoir beginning at τ + n time steps in the past. (2) 1. Temporal Parity The task determines if n bits τ + n to τ time steps in the past have an odd number of “1” values. Given an 4 500 500 400 0.15 300 300 0.1 200 0.05 0 2 4 6 8 0 1, if 2 n−1 X τ (a) (b) i=0 0.15 300 8 0, otherwise, L 0.1 200 |ST | 50 150 300 500 500 |SG | 50 150 150 150 150 We train the output node with a form of stochastic gradient descent in which the weights of the incoming connections are adjusted after every time step in each training example. Given our system and tasks, this form of gradient descent appears to yield better training and testing accuracies than the conventional forms. We use a learning rate η = 0.01, and train the weights for up to 20,000 epochs. Since the dynamics of the underlying RBN are deterministic and reset after each training stream, we terminate training early if an accuracy of 1.0 is achieved on ST . The accuracy of an RC device on a stream v ∈ ST is determined by the number of times that the output matches the expected output as specified by the task divided by the total number of values in the output stream. The accuracy on each input set is summed together and divided by the total number of input streams in the set to calculate the current training accuracy T . After the weights of the output layer are trained on the input streams in ST , they remain fixed. 0.15 0.1 200 0.05 100 0.05 100 2 4 6 8 0 2 4 τ τ (c) (d) 6 8 500 0.1 500 0.1 400 0.08 400 0.08 300 0.06 300 0.06 L Training and Evaluation 400 300 u(t − τ − i) > n For every system, we randomly generate a training set ST and testing set SG . For each stream v ∈ ST or u ∈ SG , |v| = |u| = T . The size of the training and testing sets are dependent on n, and determined by the following table. n 1 3 5 7 9 6 500 400 0 where τ + n ≤ t ≤ T − τ − n. 3. 4 L   2 τ Temporal Density The task determines whether or not an odd number of bits τ + n to τ time steps in the past have more “1” values than “0.” Given an input stream u, where |u| = T , a delay τ , and a window n = 2k + 1, where k ≥ 1, Bn (t) = 0.05 100 500    0.1 200 100 where τ + n ≤ t ≤ T − τ − n. 2. 0.15 L An (t) = u(t − τ ), if n = 1 ⊕n−1 u(t − τ − i), otherwise, i=0 L  400 L input stream u, where |u| = T , a delay τ , and a window n ≥ 1, 200 0.04 200 0.04 100 0.02 100 0.02 0 2 4 6 8 0 0 2 4 τ τ (e) (f) 6 8 0 FIG. 2. (Color online) The computational capability ∆ of RBN reservoirs with N = 500, L ∈ [1, N ] and τ ∈ [1, 9]. Parameters hKi and T are: hKi = 1, T = 10 (a), hKi = 1, T = 100 (b), hKi = 2, T = 10 (c), hKi = 2, T = 100 (d), hKi = 3, T = 10 (e), hKi = 3, T = 100 (f). The computational capability ∆ varies according to hKi ∈ {1, 2, 3} and T = 10 in the left column and T = 100 in the right column. We then drive the reservoirs with input streams u ∈ SG and record the number of times that the output of the RC device matches the expected output. The generalization capability G is then computed by dividing the total number of times in which the output of the readout layer matches the correct output, by the total number of correct outputs. This process is averaged over all streams in SG . In general, we are interested in finding the reservoirs that maximize G. IV. A. RESULTS Computational Capability The computational capability as predicted by ∆ are dependent on the properties of the reservoir M, the length of the input stream T , and the memory τ required by the reservoir. The properties of M are determined by the dy- 5 4 4 80 40 2 3 60 hK i 60 hK i 3 80 40 2 20 1 0 2 4 6 8 0 20 1 0 2 4 τ τ (a) (b) 6 8 0 FIG. 3. (Color online) The computational capability ∆ of RBN reservoirs M with N = 500 and hKi ∈ [1, 4] summed PN over L ∈ [1, 500]. These are calculated as: L=1 ∆(M, T , τ ), PN where T = 10 (a), and L=1 ∆(M, T , τ ), where T = 100 (b). The dashed curve is a spline fit to the highest ∆, illustrating that near-critical connectivity maximizes computational capability, particularly in high T . namics which are due primarily to hKi and the number of nodes L which the input directly perturbs. For each L, hKi, T , and τ we calculate the average ∆(M, T , τ ) of 50 instantiations of M. In figure 2 we present these results for hKi ∈ {1, 2, 3}. To produce Fig. 3 we sum over ∆(M, T , τ ) for all L. The dashed curves in Figs. 3(a) and 3(b) are spline fits which highlight the greatest ∆ values. In Figs. 2 and 3 we see that RBNs with critical connectivity hKc i = 2 tend to provide the highest ∆. A high ∆ signifies that the reservoir dynamics have the ability to separate different input streams, while having dynamics which are determined more by recent input, than past input. In contrast, a low ∆ signifies either or both of the following: i) the reservoir’s dynamics are too frozen to separate different input streams effectively or ii) traces of early perturbations are never forgotten by the reservoir. The consequence of i) is the inability to compute difficult tasks, such as An or those which require long short-term memory. The consequence of ii) is great difficulty in generalizing; if past information which is irrelevant to computing the correct output in the readout layer dominates the dynamics of the reservoir, the output layer will be unable to classify the dynamics caused by the more relevant, recent input. We see that hKi = 1 has a very high ∆ only when τ is small. This is due to the brief short-memory afforded to an RBN with subcritical dynamics. Since a network with hKi = 1 has little short-term memory, its computational capabilities are unaffected by an increase in T , as demonstrated in Figs. 2(a) and 2(b): there is no memory at all of early perturbations. Chaotic reservoirs, represented here by hKi = 3, are characterized by their sensitivity to initial perturbations, and a high separation. In two identical, chaotic systems, a single bit difference in their respective input streams will eventually become magnified until the two systems differ by the states of some P nodes. If the initial perturbation is larger than P , then the differences in the systems will diminish until reaching P . Because of this, a chaotic system could maximize its ∆ in two different ways: i) compute over a sufficiently short input stream and ii) perturb enough of the system so that the recent input has a more significant effect on the dynamics than the past input. In i), the restriction of a brief input stream can be relaxed if the input stream perturbs as few nodes as possible, giving the system more time to propagate perturbations (cf. Fig. 2(e)). On the other hand ii) requires maximizing L (cf. Fig. 2(f)). However, even if distortion is staved off by slowing down the propagation of external perturbations, the system is ultimately fated to disorder. B. Information and Optimal Perturbation In the traditional implementations of reservoir computing, all the nodes in the reservoir are connected to the source of the input signal. Many task specific and generic measures of computation in reservoirs have been comprehensively studied in [13]. However, the relationship between the computational properties of the reservoir and the number of nodes which the input layer perturbs remains unexplored. Here, we use information theory to characterize the computation in the reservoir as information transfer between the input and the reservoir and between the reservoir and the output. In reservoir computing, the reservoir is a dynamical system and therefore has intrinsic entropy. The input is also time-varying and we can calculate its entropy. In order to reconstruct the desired function, the output layer has to pick up the traces of the input in the reservoir dynamics. This fact is reflected in the entropy change of the reservoir due to its input and therefore can be measured using mutual information between the input I and the reservoir R, i.e., I(I : R). In our study we distribute the input to the reservoir only sparsely, we would thus like to find how I(I : R) changes as a function of L and if there is an optimal L. Moreover we would like to know, given a task to be solved, how much information the reservoir can provide to the output. That is, given the desired output, can the reservoir state be predictive of the output? This is equivalent to determining how much information is transferred from the reservoir to the desired output. We show this measure using I(R : O) where O indicates the output as the target. In order to calculate I(I : R) and I(R : O), we consider the instantaneous states of the reservoir and its output to calculate the entropy. For the input, we need to calculate the entropy over the states that the input can take over the window size n. For example, on a input stream of length T = 50 bits, window size n, and time delay τ = 1, the input pattern unt1 is an n-bit long moving window over the stream, starting at time step t1 = 0, i.e., {unt1 |0 ≤ t1 ≤ T − τ − n}. To calculate the entropy of the reservoir we consider the collection of instantaneous reservoir states st2 at time step t2 , i.e., 6 C. Task Solving We calculate the generalization capability G of RBNRC devices with hKi ∈ {1, 2, 3}, N = 500, and L ∈ (0, 500] on the Bn and An tasks with random input streams of length T ∈ {10, 100}. For each set of parameters, we instantiate, train, and test 30 RC devices. Figs. 5 and 6 present cubic spline fits to the average of these results. We observe in Figs. 5 and 6 that critical dynamics provide the most robust generalization capa- 8 8 4 2 0 0 10 20 30 4 2 0 0 50 200 (b) 12 10 I (I : S ) I (S : O) HI HS HO 6 4 2 20 30 40 8 4 2 0 0 50 100 200 12 10 10 I (I : S ) I (S : O) HI HS HO 6 4 2 30 (e) 40 50 8 bits 8 L 300 400 500 (d) 12 20 500 L (c) 10 400 I (I : S ) I (S : O) HI HS HO 6 L 0 0 300 (a) 10 10 100 L 12 0 0 I (I : S ) I (S : O) HI HS HO L 8 bits 40 6 bits I (I : S ) I (S : O) HI HS HO bits bits 6 bits {st2 |τ + n ≤ t2 ≤ T }. The output pattern is calculated using the output of the Bn (t) task. A subtlety arises while calculating the reservoir entropy; since the reservoir follows deterministic dynamics, if L = 0, where the input signals does not perturb the reservoir, then the reservoir dynamics will be identical when one repeats the experiment. For reservoirs with chaotic dynamics, where each st2 is unique, we have a many-to-one mapping between the reservoir states and the output patterns and therefore the reservoir states appear to be capable of reconstructing the output completely. To get the correct result, one must calculate the entropy over many streams. In this case, since the corresponding output patterns change every time, the mapping between the reservoir state and the output will not appear predictive of the output. We feed the reservoir with 50 randomly chosen input sequences of length 50. The entropies HI , HR , and HO are calculated using the states the input, the reservoir, and the desired output takes during this 50 time interval. Note there is no need to have an output layer in these experiments and the calculations are independent of training mechanism. Figure 4 illustrates I(I : R), and I(R : O) as a function of L for reservoirs of hKi ∈ {1, 2, 3}. For comparison, we have also included HI , HR , and HO . In an ideal reservoir in which the reservoir contains all the information from the input I(I : R) = HI , and I(R : O) = HO , indicating that the reservoir contains the required information to reconstruct the desired output perfectly. For hKi = 1 we see that growing L increases I(I : R) and I(R : O) to a maximum level below the ideal values even for L = 500, where all the nodes in the reservoirs are receiving the input. These systems do not have enough capacity to calculate the desired output perfectly. For hKi = 2, we see that mutual information increases and reaches the ideal level at L = 20. In these systems, the sparse connectivity between input and reservoir is enough to provide all the required information about the input to the reservoir. We see that at the same level of L the reservoir dynamics are completely predictive of the output. For hKi = 3, the intrinsic dynamics of the reservoir are very rich (supercritical dynamics) and the mutual information between the reservoir and output reaches its peak at L = 5. In these systems a small perturbation quickly spreads. The reservoir at this perturbation level will have enough information to reconstruct the output. I (I : S ) I (S : O) HI HS HO 6 4 2 0 0 100 200 300 400 500 L (f) FIG. 4. Mutual information between the input and reservoir I(I : R) and reservoir and output I(R : O). The results are for: hKi = 1.0 (a) and (b), hKi = 2.0 (c) and (d), hKi = 3.0 (e) and (f). We have also included the intrinsic information in the input stream, reservoir, and output. For all of these cases τ = 1. In an ideal reservoir I(I : R) = HI and I(R : O) = HO . For hKi = 1.0, as L grows both I(I : R) and I(R : O) grow to a maximum level below the ideal level. The reservoir in these systems does not carry enough information for the output layer to solve the task. For hKi = 2.0, as L grows, the mutual information grows and reaches the sufficient level at L = 20. For hKi = 3.0, mutual information peaks near L = 5. Small perturbation from the input provide enough information to the reservoir to reconstruct the desired output. bility in task solving. Ordered and chaotic reservoirs can evidently solve tasks under certain circumstances. However, the ordered networks are limited by little short-term memory, while the chaotic networks accumulate extraneous information from past perturbations and demonstrate reduced performance as the length of the input stream increases. 1 1 0.9 0.9 0.9 0.9 0.8 0.8 0.8 0.8 hK i = 1 data hK i = 2 data hK i = 3 data 300 400 0.6 0.5 100 200 0.7 fit fit 0.6 fit 0.5 500 100 200 L 1 0.6 0.5 500 100 200 0.7 fit fit 0.6 fit 0.5 500 (a) 1 0.9 0.8 0.8 0.6 0.6 0.6 0.6 300 (c) 400 500 0.5 100 200 300 400 500 100 Average Reservoir Indegree hKi = 1 When n of An and Bn is small, there is very little memory and processing required by the reservoir, and so RC devices in which the reservoir has hKi = 1 can achieve perfect generalization G for B3 and A3 (cf. Figs. 5(a) and 6(a)). However, ordered networks are dominated by fading memory, hence the dynamics do not retain enough information about past perturbations to achieve high accuracy when n increases. Since the dynamics of ordered networks are only determined by their most recent perturbations, the length of the input stream T is irrelevant for the task solving capability, which explains why the generalization G of ordered networks computing B3 is very similar when T = 10 and T = 100, as seen in Figs. 5(a) and 5(b) respectively. Since memory fades quickly in an ordered reservoir, input cannot propagate swiftly through the network. Moreover, a hKi = 1 network will almost certainly possess islands. These islands will be unreachable by an input stream that does not strongly perturb the system. In addition, figure 4(b) demonstrates that an ordered network with hKi = 1 increases its mutual information between input and reservoir I(I : R) as L increases from 0 to N . 200 300 L (c) (d) FIG. 5. The generalization capability G of an RBN-RC device M on the task Bn is dependent on L and hKi, as well as task parameters n and T . Here the parameters are: n = 3, T = 10 (a), n = 3, T = 100 (b), n = 7, T = 10 (c), n = 9, T = 10 (d). Notably, chaotic networks achieve their maximum generalization capability with a lower L than ordered networks. Ordered networks possess little memory and so their performance drops as n increases. On the other hand, chaotic networks perform poorly with T = 100 as opposed to T = 10, due to an inadequately fading memory. 1. 0.5 L 400 500 400 500 hK i = 1 fit data hK i = 2 fit data hK i = 3 fit data 0.9 0.7 L 300 1 hK i = 1 fit data hK i = 2 fit data hK i = 3 fit data 0.7 200 200 (b) 0.7 100 100 L 0.7 0.5 hK i = 1 fit data hK i = 2 fit data hK i = 3 fit data L G(L) 0.8 hK i = 1 data hK i = 2 data hK i = 3 data 300 400 fit hK i = 1 fit data hK i = 2 fit data hK i = 3 fit data 0.9 G(L) G(L) 0.8 fit (b) hK i = 1 fit data hK i = 2 fit data hK i = 3 fit data 0.9 0.7 fit L (a) 1 hK i = 1 data hK i = 2 data hK i = 3 data 300 400 G(L) 0.7 G(L) 1 G(L) 1 G(L) G(L) 7 0.5 100 200 300 400 500 L (d) FIG. 6. The generalization capability G of an RBN-RC device M on the task An is dependent on L and hKi, and task parameters n and T . Here the parameters are: n = 3, T = 10 (a), n = 3, T = 100 (b), n = 5, T = 10 (c), n = 7, T = 10 (d). Due to high sensitivity to the initial perturbations, the generalization capability of chaotic networks drop as the length of the input stream increases from T = 10 to T = 100. Ordered networks possess little short-term memory and are least robust to an increase in n, with generalization capability on A7 no better than chance. Because of this, we see in Figs. 5 and 6 that increasing L tends to result in higher accuracy on Bn and An respectively. Therefore, an increase of L can only increase the performance of the reservoir. 2. Average Reservoir Indegree hKi = 3 Chaotic reservoirs, represented here by hKi = 3, are dominated by the separation property. As a result, the G of the chaotic networks are least affected by increasing the window n. However, high performance is only possible when the input stream is sufficiently small, such as T = 10. In Figs. 5(d) and 6(a) the stream length is T = 10 and the G of the chaotic network is high. However, when the length of the input stream is increased to T = 100, the performance drops significantly, even while the performance of networks with lower connectivities remain relatively unchanged (cf. Figs. 5(a) and 5(b)). Though no longer relevant to the RC device, early perturbations have a significant effect on the dynamics, which makes it difficult for the output layer to extract information about the more recent input. On the other hand, if the input stream is sufficiently short, chaotic reservoirs 8 have less time to be distorted by early input. In a network which is chaotic due to high connectivity, there will be fewer and larger connected components than in those which are less densely connected [14]. Therefore, the minimal L needed to adequately distribute the input signal in a hKi = 3 network is less than the other connectivities explored here (cf. Fig. 4(f)). Also, a chaotic reservoir can effectively increase its computational capability as predicted by ∆ by reducing its L, which increases the time it takes for perturbations to spread through the system (cf. Fig. 2(e)). Evidently, the chaotic system uses this strategy in computing Bn when T = 10, as seen in figure 5. However, this behavior is not observed for the highly non-linear parity task An . We speculate that, due to the complexity of the task, separation capability is more significant than it is in Bn ; this causes a strategy which maximizes the separation property by increasing L to be optimal. 3. Average Reservoir Indegree hKi = 2 As observed in figure 3, the difference between the separation property and fading memory tends to be maximized with near-critical connectivity hKi = 2. This is evident in our task solving results: when the n of Bn and An increases, these systems do not show the dramatic drop in G that the ordered systems do (cf. Figs. 5 and 6). Simultaneously, the G of these systems are unaffected by an increase in the stream length T , in contrast to chaotic networks. In figure 4(d) we observe that with L < 20 the input signal cannot adequately propagate the input signal, which is demonstrated by a lower G for very small L in Figs. 5 and 6. However, increasing L in task solving appears to afford more of a benefit than simply increasing the information about the input stream. In both Figs. 5 and 6 we see that the best G of the critical networks occurs after the system has already achieved maximal I(I : R) between input stream and reservoir dynamics. V. SUMMARY AND DISCUSSION We investigated the computational capabilities of random Boolean networks when used as the dynamical component in reservoir computing devices. We found that computation tends to be maximized at the critical connectivity hKc i = 2. However, in RC, the reservoir is continuously perturbed, and both the size of the perturbations as well as the length of time that the reservoir is perturbed for must be taken into account, along with the chaoticity of the dynamics. If the input stream is sufficiently short, then chaotic systems can still perform quite well, but as the length of the input stream increases, these networks can no longer differentiate and generalize on subsets of the input stream, as the past perturbations, which may no longer be relevant to the computation, are dominating the dynamics. On the other hand, ordered networks can perform well, independent of the length of the input stream, as long as the window of computation is sufficiently small, as an ordered system retains little information about perturbations in the past. A network view of the RC device can also give us more insight as to why connectivity influences performance. If the reservoir acts on the input stream as a set of spatiotemporal kernels, a suitable reservoir needs to include a diverse set of kernels. In [10], we saw that at the connectivity hKc i = 2 the network shows maximal topological diversity and dynamics. A reservoir with connectivity hKc i = 2 therefore can act as many networks of the same connectivity, each acting as different kernel. In [12] and [13] it was shown that optimal computation occurs in recurrent neural networks at the critical points, and our results provide an additional example of this, in a binary, heterogeneous reservoir. In RC, we continuously perturb the reservoir and so the underlying RBN of our model is not a closed system. Therefore, computation cannot be dependent on attractors and must be enabled by the dynamics of the RBN. However, in some circumstances the network dynamics can fall into an attractor temporarily or indefinitely, due to frozen dynamics, inadequate distribution of the input signal, or a non-random input stream. Therefore, RC is a novel framework in which to explore the capacity of RBN dynamics for information processing. RBNs have been studied under other task solving scenarios; in Goudarzi et al. [10] networks evolve towards criticality, although computation is still performed by attractors. Our study shows that unlike the findings in [9], for RBNs there is a strong connection between computation and dynamics, and optimality of the computation is evidently due to critical dynamics in the network. Despite the differences between externally perturbed RBNs in RC and RBNs explored as a closed system, we nevertheless observe that critical RBNs are indeed optimal for reservoir computing. Criticality also plays an important role in biological systems that often require an optimal balance between stability and adaptability. For example, it has been shown by using compelling theoretical and experimental evidence that gene regulatory networks—which are commonly modeled by RBNs—are indeed critical [17, 18]. Our conclusion provides an intriguing link between disparate usages of RBN. By providing evidence that critical dynamics are desirable for heterogeneous substrates in RC, our findings may be relevant to the development of devices which exploit the intrinsic information processing capabilities of heterogeneous, physical systems such as biomolecular or nanoscale device networks. VI. ACKNOWLEDGMENTS This work was supported by NSF grants No. 1028120 and No. 1028378 as well as Portland State University’s Maseeh College of Engineering & Computer Science Un- 9 dergraduate Research & Mentoring Program. [1] M. Lukosevicius and H. Jaeger, Comput. Sci. Rev. 3, 127–149 (2009). [2] C. Fernando and S. Sojakka, ECAL 2003, (SpringerVerlag, Berlin, 2003), LNAI 2801, p. 588–597. [3] M. Haselman and S. Hauck, Proc. IEEE, 98, 11–38, (2010). [4] W. Maass, T. Natschläger, and H. Markram, Neural Comput., 14, 2531–60, (2002). [5] H. Jaeger, St. Augustin: German National Research Center for Information Technology Technical Report GMD Rep. 148, (2001). [6] S. A. Kauffman, J. Theor. Biol. 22, 437 (1969) [7] T. Rohlf, N. Gulbahce, and C. Teuscher, Phys. Rev. Lett., 99, 248701 (2007). [8] N. H. Packard, in Dynamic Patterns in Complex Systems, ed. by J. A. S. Kelso, A. J. Mandell, and M. F. Shlesinger (World Scientific, Singapore, 1988), p. 293-301. [9] M. Mitchell, J. P. Crutchfield, and P. T. Hraber, Complex Syst., 7, 89–130 (1993). [10] A. Goudarzi, C. Teuscher, N. Gulbahce, and T. Rohlf, Phys. Rev. Lett. 108, 128702 (2012). [11] D. Snyder, A. Goudarzi, and C. Teuscher, in Proc. Thirteenth Int’l Conference on the Simulation and Synthesis of Living Systems (ALife 13), (MIT Press, Cambridge, 2012), p. 259–266. [12] T. Natschläger, N. Bertschinger, and R. Legenstein, in Advances in Neural Information Processing Systems, edited by L. K. Saul, Y. Weiss, and L. Bottou (MIT Press, Cambridge, 2004), 17, p. 147–152. [13] L. Büsing, B. Schrauwen, and R. Legenstein, Neural Comput., 22 1272–1311, (2010). [14] P. Erdös and A. Rényi Publ. Math. Debrecen, 6, 290–297, (1959). [15] B. Derrida and Y. Pomeau, Europhys. Lett. 1, 45 (1986). [16] C. E. Shannon, Bell Sys. Tech. J., 27 379–423, (1948). [17] P. Rämö, J. Kesseli, and O. Yli-Harja, J. Theor. Biol., 242, 164–170 (2006). [18] M. Nyker, N. D. Price, M Aldana, S. A. Ramsey, S. A. Kauffman, L. E. Hood, O. Yli-Harja, and I. Shmulevich, Proc. Natl. Acad. Sci. (USA), 105, 1897–1900 (2008).
9cs.NE
Lower bounds for approximation schemes for Closest String Marek Cygan∗ Daniel Lokshtanov† Marcin Pilipczuk‡ Michal Pilipczuk§ arXiv:1509.05809v1 [cs.DS] 18 Sep 2015 Saket Saurabh¶ Abstract In the Closest String problem one is given a family S of equal-length strings over some fixed alphabet, and the task is to find a string y that minimizes the maximum Hamming distance between y and a string from S. While polynomial-time approximation schemes (PTASes) for this problem are known for a long time [Li et al.; J. ACM’02], no efficient polynomial-time approximation scheme (EPTAS) has been proposed so far. In this paper, we prove that the existence of an EPTAS for Closest String is in fact unlikely, as it would imply that FPT = W[1], a highly unexpected collapse in the hierarchy of parameterized complexity classes. Our proof also shows that the existence of a PTAS for Closest String with running time f (ε) · no(1/ε) , for any computable function f , would contradict the Exponential Time Hypothesis. ∗ Institute of Informatics, University of Warsaw, Poland, [email protected]. Supported by Polish National Science Centre grant DEC-2012/05/D/ST6/03214. † Department of Informatics, University of Bergen, Norway, [email protected]. Supported by the BeHard grant under the recruitment programme of the of Bergen Research Foundation. ‡ Institute of Informatics, University of Warsaw, Poland, [email protected]. Supported by Polish National Science Centre grant DEC-2012/05/D/ST6/03214. § Institute of Informatics, University of Warsaw, Poland, [email protected]. Supported by Polish National Science Centre grant DEC-2013/11/D/ST6/03073 and by the Foundation for Polish Science via the START stipend programme. During the work on these results, Michal Pilipczuk held a post-doc position at Warsaw Center of Mathematics and Computer Science. ¶ Institute of Mathematical Sciences, India, [email protected], and Department of Informatics, University of Bergen, Norway, [email protected]. Supported by PARAPPROX, ERC starting grant no. 306992. 1 Introduction Closest String and Closest Substring are two computational problems motivated by questions in molecular biology connected to identifying functionally similar regions of DNA or RNA sequences, as well as by applications in coding theory. In Closest String we are given a family S of strings over some fixed alphabet Σ, each of length L. The task is to find one string y ∈ ΣL for which maxx∈S H(x, y) is minimum possible, where H(x, y) is the Hamming distance between x and y, that is, the number of positions on which x and y have different letters. We will consider both the optimization variant of the problem where the said distance is to be minimized, and the decision variant where an upper bound d is given on the input, and the algorithm needs to decide whether there exists a string y with maxx∈S H(x, y) ≤ d. Closest Substring is a more general problem where the strings from the input family S all have length m ≥ L, and we look for a string y ∈ ΣL that minimizes maxx∈S minx′ substring of x H(x′ , y). In other words, we look for y that can be fit as close as possible to a substring of length L of each of the input strings from S. Both Closest String and Closest Substring, as well as numerous variations on these problems, have been studied extensively from the point of view of approximation algorithms. Most importantly for us, for both of these problems there are classic results providing polynomial-time approximation schemes (PTASes): for every ε > 0, it is possible to approximate in polynomial time the optimum distance within a multiplicative factor of (1 + ε). The first PTASes for these problems 4 were given by Li et al. [9], and they had running time bounded by nO(1/ε ) . This was later improved log 1/ε by Andoni et al. [1] to nO( ε2 ) , and then by Ma and Sun [11] to nO(1/ε ) , which constitutes the current frontier of knowledge. We refer to the works [3, 8, 7, 9, 11, 12] for a broad introduction to biological applications of Closest String, Closest Substring, and related problems, as well as pointers to relevant literature. One of the immediate questions stemming from the works of Li et al. [9], Andoni et al. [1], and Ma and Sun [11], is whether either for Closest String or Closest Substring one can also give an efficient polynomial-time approximation scheme (EPTAS), i.e., an approximation scheme that for every ε > 0 gives a (1 + ε)-approximation algorithm with running time f (ε) · nO(1) , for some computable function f . In other words, the degree of the polynomial should be independent of ε, whereas the exponential blow-up (inevitable due to NP-completeness) should happen only in the multiplicative constant standing in front of the running time. EPTASes are desirable from the point of view of applications, since they provide approximation algorithms that can be useful in practice already for relatively small values of ε, whereas running times of general PTASes are usually prohibitive. For the more general Closest Substring problem, this question was answered negatively by Marx [12] using the techniques from parameterized complexity. More precisely, Marx considered various parameterizations of Closest Substring, and showed that when parameterized by d and |S|, the problem remains W[1]-hard even for the binary alphabet. This means that the existence of a fixed-parameter algorithm with running time f (d, |S|) · nO(1) , where n is the total size of the input, would imply that FPT = W[1], a highly unexpected collapse in the parameterized complexity. This result shows that, under FPT 6= W[1], also an EPTAS for Closest Substring can be excluded. Indeed, if such an EPTAS existed, then by setting any ε < d1 one could in time f (d)·nO(1) distinguish instances with optimum distance value d from the ones with optimum distance value d+1, thus solving the decision variant in fixed-parameter tractable (FPT) time. Using more precise results about the parameterized hardness of the Clique problem, Marx [12] showed that, under the assumption of Exponential Time Hypothesis (ETH), which states that 3-SAT cannot be solved in time O(2δn ) for some δ > 0, one even cannot expect PTASes for Closest Substring with running 2 1 time f (ε) · no(log(1/ε)) for any computable function f . We refer to a survey of Marx [13] for more examples of links between parameterized complexity and the design of approximation schemes. The methodology used by Marx [12], which is the classic connection between parameterized complexity and EPTASes that dates back to the work of Bazgan [2] and of Cesati and Trevisan [4], completely breaks down when applied to Closest String. This is because this problem actually does admit an FPT algorithm when parameterized by d. An algorithm with running time dd · nO(1) was proposed by Gramm et al. [7]. Later, Ma and Sun [11] gave an algorithm with running time 2O(d) ·|Σ|d ·nO(1) , which is more efficient for constant-size alphabets. Both the algorithms of Gramm et al. and of Ma and Sun are known to be essentially optimal under ETH [10], and nowadays they constitute textbook examples of advanced branching techniques in parameterized complexity [5]. Therefore, in order to settle the question about the existence of an EPTAS for Closest String, one should look for a substantial refinement of the currently known techniques. An approach for overcoming this issue was recently used by Boucher et al. [3], who attribute the original idea to Marx [13]. Boucher et al. considered a problem called Consensus Patterns, which is a variation of Closest Substring where the goal function is the total sum of Hamming distances between the center string and best-fitting substrings of the input strings, instead of the maximum among these distances. The problem admits a PTAS due to Li et al. [8], and was shown by Marx [12] to be fixed-parameter tractable when parameterized by the target distance d. Despite the latter result, Boucher et al. [3] managed to prove that the existence of an EPTAS for Consensus Patterns would imply that FPT = W[1]. The main idea is to provide a reduction from a W[1]hard problem, such as Clique, where the output target distance d is not bounded by a function of the input parameter k (indeed, the existence of such a reduction would prove that FPT = W[1]), but 1 , the multiplicative gap between the optimum distances yielded for yes- and no-instances is 1 + g(k) for some computable function g. Even though the output parameter is unbounded in terms of k, an EPTAS for the problem could be still used to distinguish between output instances obtained from yes- and no-instances of Clique in FPT time, thus proving that FPT = W[1]. Our contribution In this paper we provide a negative answer to the question about the existence of an EPTAS for Closest String by proving the following theorem. Theorem 1.1. The following assertions hold: • Unless FPT = W[1], there is no EPTAS for Closest String over binary alphabet. • Unless ETH fails, there is no PTAS for Closest String over binary alphabet with running time f (ε) · no(1/ε) , for any computable function f . Thus, one should not expect an EPTAS for Closest String, whereas for PTASes there is still 2 a room for improvement between the running time of nO(1/ε ) given by Ma and Sun [11] and the lower bound of Theorem 1.1. It is worth noting that our f (ε) · no(1/ε) time lower bound for (1 + ε)approximating Closest String also holds for the more general Closest Substring problem. This yields a significantly stronger lower bound than the previous f (ε) · no(log(1/ε)) lower bound of Marx [12]. Our proof of Theorem 1.1 follows the methodology proposed Marx [13] and used by Boucher et al. [3] for Consensus Patterns. The following theorem, which is the main technical contribution of this work, states formally the properties of our reduction. Theorem 1.2. There is an integer c and an algorithm that, given an instance (G, k) of Clique, works in time 2k · nO(1) and outputs an instance (S, L, d) of Closest String over alphabet {0, 1} with the following properties: 2 • If G contains a clique on k vertices, then there is a string w ∈ {0, 1}L such that H(w, x) ≤ d for each x ∈ S. • If G does not contain a clique on k vertices, then for each string w ∈ {0, 1}L there is x ∈ S 1 ) · d. such that H(w, x) > (1 + ck The statement of Theorem 1.2 is similar to the core of the hardness proof of Boucher et al. [3]. However, our reduction is completely different from the reduction of Boucher et al., because the causes of the computational hardness of of Closest String and Consensus Patterns are quite orthogonal to each other. In Consensus Patterns the difficulty lies in picking the right substrings of the input strings. Once these substrings are known the center string is easily computed in polynomial time, since we are minimizing the sum of the Hamming distances. In Closest String there are no substrings to pick, we just have to find a center string for the given input strings. This is a computationally hard task because we are minimizing the maximum of the Hamming distances to the center, rather than the sum. Theorem 1.1 follows immediately by combining Theorem 1.2 with the known parameterized 1 . hardness results for Clique, gathered in the following theorem, and setting ε = ck Theorem 1.3 (cf. Theorem 13.25 and Corollary 14.23 of [5]). The following assertions hold: • Unless FPT = W[1], Clique cannot be solved in time f (k) · nO(1) for any computable function f . • Unless ETH fails, Clique cannot be solved in time f (k) · no(k) for any computable function f . The main idea of the proof of Theorem 1.2 is to encode the n vertices of the given graph G as an “almost orthogonal” family T of strings from {0, 1}ℓ , for some ℓ = O(log n). Strings from T are used as identifiers of vertices of G, and the fact that they are almost orthogonal means that the identifiers of two distinct vertices of G differ on approximately ℓ/2 positions. On the other hand ℓ = O(log n), so the whole space of strings into which V (G) is embedded has size polynomial in n. Using these properties, the reduction promised in Theorem 1.2 is designed by a careful construction. Notation. By log p we denote the base-2 logarithm of p. For a positive integer n, we denote [n] = {1, 2, . . . , n}. The length of a string x is denoted by |x|. For an alphabet Σ and two equallength strings x, y over Σ, the Hamming distance between x and y, denoted H(x, y), is the number of positions on which x and y have different letters. If Σ = {0, 1} is the binary alphabet, then the Hamming weight of a string x over Σ, denoted H(x), is the number of 1s in it. The complement of a string x over a binary alphabet, denoted x, is obtained from x by replacing all 0s with 1s and vice versa. Note that if |x| = |y| = n, then H(x, y) = n − H(x, y) = n − H(x, y) = H(x, y). 2 Selection gadget For the rest of this paper, we fix the following constants: ρ = 1/100, α = 1/10, β = 1/20. Since C is divisible by 100, we have that that ρℓ, αℓ, and βℓ are all integers. First, we prove that among binary strings of logarithmic length one can find a linearly-sized family of “almost orthogonal” strings of balanced Hamming weight. The proof is by a simple greedy argument. Lemma 2.1. There exist positive integers C and N , where C is divisible by 100, with the following property. Let n > N be any integer, and let us denote ℓ = C · ⌈log n⌉. Then there exists a set T ⊆ {0, 1}ℓ with the following properties: 3 1. |T | = n, 2. H(x) = ℓ/2 for each x ∈ T , and 3. (1/2 − ρ)ℓ < H(x, y) < (1/2 + ρ)ℓ for each distinct x, y ∈ T . Moreover, given n, T can be constructed in time polynomial in n. Proof. Let H2 (·) denote the binary entropy, i.e., H2 (p) = −p log p − (1 − p) log(1 − p) for p ∈ (0, 1). Suppose ℓ is some positive integer divisible by 100. Then it is well known that k   X ℓ ≤ 2ℓ·H2 (k/ℓ) (1) i i=0 for all integers k with 0 < k ≤ ℓ/2; cf. [6, Lemma 16.19]. Let us denote   (1/2−ρ)ℓ   ℓ X X ℓ ℓ A= . + i i i=0 i=(1/2+ρ)ℓ Then from (1) it follows that A ≤ 2 · 2σℓ , where σ = H2 (1/2 − ρ) < 1. Suppose now that ℓ = C · ⌈log n⌉ for some positive integers C and n > 1, where C is divisible by 100. Then n(ℓ + 1) · A ≤ 2n · (C⌈log n⌉ + 1) · 2σ·C⌈log n⌉ ≤ 2 · (2C + 1) · 2σC · n log n · 2σ·C log n ≤ (4C + 2) · 2σC · nσC+2 . Since σ < 1, we can choose C to be an integer divisible by 100 so that σC + 2 < C. Then, we can choose N large enough so that (4C + 2) · 2σC · nσC+2 ≤ nC for all integers n > N . Hence, nC . (2) ℓ+1 We now verify that this choice of C, N satisfies the required properties. Consider the following greedy procedure performed on {0, 1}ℓ . Start with T = ∅ and all strings of {0, 1}ℓ marked as unused. In consecutive rounds perform the following: nA ≤ 1. Pick any x ∈ {0, 1}ℓ with H(x) = ℓ/2 that was not yet marked as used, and add x to T . 2. Mark every y ∈ {0, 1}ℓ with H(x, y) ≤ (1/2 − ρ)ℓ or H(x, y) ≥ (1/2 + ρ)ℓ as used. It is clear that at each step of the procedure, the constructed family T satisfies properties (2) and (3). Hence, it suffices to prove that the procedure can be performed for at least n rounds. Note that the number of strings marked as used at each round is at most A. On the other hand, if D is the set of strings from {0, 1}ℓ that have Hamming weight exactly ℓ/2, then |{0, 1}ℓ | 2C⌈log n⌉ nC = ≥ . ℓ+1 ℓ+1 ℓ+1 From (2) we infer that |D| ≥ nA. This means that the algorithm will be able to find an unmarked x ∈ D for at least n rounds, and hence to construct the family T with |T | = n. It is easy to implement the algorithm in polynomial time using the fact that the size of {0, 1}ℓ is polynomial in n. |D| ≥ 4 From now on, we adopt the constants C, N given by Lemma 2.1 to the notation. Let us also fix n > N ; then let ℓ = C · ⌈log n⌉ and T be the set of strings given by Lemma 2.1, which we shall call selection strings. We define the set of forbidden strings F = F(T ) as follows: F = {y : y ∈ {0, 1}ℓ and H(x, y) ≤ (1 − α)ℓ for all x ∈ T }. In other words, F comprises all the strings that are not almost diametrically opposite to some string from T . The following lemma asserts the properties of T and F that we shall need later on. Lemma 2.2. Suppose u ∈ {0, 1}ℓ . Then the following assertions hold: 1. If u ∈ T , then H(u, y) ≤ (1 − α)ℓ for each y ∈ F. 2. If H(x, u) ≥ βℓ for all x ∈ T , then there exists y ∈ F such that H(u, y) ≥ (1 − β)ℓ. Proof. Property (1) follows directly from the definition of F, so we proceed to the proof of (2). / F. Suppose H(u, x) ≥ βℓ for all x ∈ T . If u ∈ F, then we could take y = u, so suppose that u ∈ This means that there exists x0 ∈ T , for which H(x0 , u) > (1 − α)ℓ; equivalently, H(x0 , u) < αℓ. On the other hand, we have that H(x0 , u) ≥ βℓ, so also H(x0 , u) ≥ βℓ. Construct y from u by taking any set of positions X of size βℓ on which u and x0 have the same letters, and flipping the letters on these positions (replacing 0s with 1s and vice versa). Such a set of positions always exists because α + β < 1. Then we have that H(x0 , y) = H(x0 , u) + βℓ, which implies that αℓ = βℓ + βℓ ≤ H(x0 , y) < (α + β)ℓ. We claim that y ∈ F; suppose otherwise. Since H(x0 , y) ≥ αℓ, then also H(x0 , y) ≤ (1 − α)ℓ. As y ∈ / F, there must exist some x1 ∈ T , x0 6= x1 , such that H(x1 , y) > (1 − α)ℓ; equivalently H(x1 , y) < αℓ. Hence, from the triangle inequality we infer that H(x0 , x1 ) = H(x0 , x1 ) ≤ H(x0 , y) + H(y, x1 ) < (2α + β)ℓ. This is a contradiction with the assumption that H(x0 , x1 ) ≥ (1/2 − ρ)ℓ, which is implied by 49 x0 , x1 ∈ T . Indeed, we have that 2α + β = 14 < 100 = 1/2 − ρ. Hence y ∈ F. By definition we have that H(u, y) = βℓ, which implies that H(u, y) = (1 − β)ℓ. Thus, y satisfies the required properties. 3 Main construction In this section we provide the proof of Theorem 1.2. Let (G, k) be the input instance of Clique, and let n = |V (G)|. Let C, N be the constants given by Lemma 2.1. We can assume that n > N , because otherwise the instance (G, k) can be solved in constant time. Let ℓ = C⌈log n⌉. We run the polynomial-time algorithm given by Lemma 2.1 that computes the set T ⊆ {0, 1}ℓ of selection strings. Let F = F(T ) be the set of forbidden strings, as defined in Section 2. Note that F can be computed in polynomial time directly from the definition, due to |{0, 1}ℓ | = nO(1) . We now present the construction of the output instance (S, L, d) of Closest String. Set 11 , and partition the set [L] of positions in strings of length L L = kℓ + γℓ, where γ = ρ + α = 100 into k + 1 blocks: • k blocks Bi for i ∈ [k] of length ℓ each, where Bi = {(i − 1)ℓ + 1, (i − 1)ℓ + 2, . . . , iℓ}; • special balancing block C of length γℓ, where C = {kℓ + 1, kℓ + 2, . . . , L}. 5 For w ∈ {0, 1}L and a contiguous subset of positions X, by w[X] we denote the substring of w formed by positions from X. Let us first discuss the intuition. The choice the solution string makes on consecutive blocks Bi will encode a selection of a k-tuple of vertices in G. Vertices of G will be mapped one-to-one to strings from T . The family of constraint strings S will consist of two subfamilies Ssel and Sadj with the following roles: • Strings from Ssel ensure that on each block Bi , the solution picks a substring that is close to some element of T . The selection of this element encodes the choice of the ith vertex from the k-tuple. • Strings from Sadj verify that vertices of the chosen k-tuple are pairwise different and adjacent, and hence they form a clique. A small technical caveat is that for strings from Ssel and from Sadj , the intended Hamming distance from the solution string will be slightly different. The role of the balancing block C is to equalize this distance by a simple additional construction. We proceed to the formal description. Since |V (G)| = |T |, let ι : V (G) → T be an arbitrary bijection. The family Ssel consists of strings a(i, y, φ, z), for all i ∈ [k], y ∈ F, φ being a function from [k]\{i} to {0, 1}, and z being a binary string of length γℓ. String a(i, y, φ, z) is constructed as follows: • On block Bi put the string y. • For each j ∈ [k] \ {i}, on block Bj put a string consisting of ℓ zeroes if φ(j) = 0, and a string consisting of ℓ ones if φ(j) = 1. • On balancing block C put the string z. Thus, |Ssel | = k · |F| · 2k−1 · 2γℓ ≤ 2k · nO(1) . Also, Ssel can be constructed in time 2k · nO(1) directly from the definition. The family Sadj consists of strings b(i, j, (u, v), ψ), for all i, j ∈ [k] with i < j, (u, v) being an ordered pair of vertices of G that are either equal or non-adjacent, and ψ being a function from [k] \ {i, j} to {0, 1}. String b(i, j, (u, v), ψ) is constructed as follows: • On block Bi put the string ι(u). • On block Bj put the string ι(v). • On block Bq , for q ∈ [k] \ {i, j}, put a string consisting of ℓ zeroes if ψ(q) = 0, and a string consisting of ℓ ones if ψ(q) = 1. • On balancing block C put a string consisting of γℓ zeroes.  Thus, |Sadj | ≤ k2 · n2 · 2k−2 ≤ 2k · nO(1) . Again, Sadj can be constructed in time 2k · nO(1) directly from the definition. Set S = Ssel ∪ Sadj and d = (k/2 + 1/2 + ρ) · ℓ. This concludes the construction. Its correctness will be verified in two lemmas that mirror the properties listed in Theorem 1.2. Lemma 3.1. If G contains a clique on k vertices, then there exists a string w ∈ {0, 1}L such that H(w, x) ≤ d for each x ∈ S. 6 Proof. Let {c1 , c2 , . . . , ck } be a k-clique in G. Construct w by putting ι(ci ) on block Bi , for each i ∈ [k], and zeroes on all the positions of the balancing block C. First, take any string a = a(i, y, φ, z) ∈ Ssel . Since ι(ci ) ∈ T and y ∈ F, by Lemma 2.2(1) we infer that H(w[Bi ], a[Bi ]) = H(ι(ci ), y) ≤ (1 − α)ℓ. For each j ∈ [k] \ {i}, since H(ι(cj )) = ℓ/2 due to ι(cj ) ∈ T , we have that H(w[Bj ], a[Bj ]) = H(ι(cj ), a[Bj ]) = ℓ/2, regardless of the value of φ(j). Finally, obviously H(w[C], a[C]) ≤ |C| = γℓ. Hence H(w, a) ≤ (1 − α)ℓ + (k − 1)ℓ/2 + γℓ = d. Second, take any string b = b(i, j, (u, v), ψ) ∈ Sadj . Since ci and cj are different and adjacent, whereas u and v are either equal or non-adjacent, we have (ci , cj ) 6= (u, v). Without loss of generality suppose that ci 6= u; the second case will be symmetric. Then H(w[Bi ], b[Bi ]) = H(ι(ci ), ι(u)) ≤ (1/2 + ρ)ℓ, due to property (3) of Lemma 2.1. Obviously, H(w[Bj ], b[Bj ]) ≤ |Bj | ≤ ℓ. Finally, for every q ∈ [k]\{i, j} we have that H(ι(cq )) = ℓ/2, and hence H(w[Bq ], b[Bq ]) = H(ι(cq ), b[Bq ]) = ℓ/2, regardless of the value of ψ(q). Strings w and b match on positions of C, so H(w[C], b[C]) = 0. Summarizing, H(w, b) ≤ (1/2 + ρ)ℓ + ℓ + (k − 2)ℓ/2 = d. Lemma 3.2. If there is a string w ∈ {0, 1}L such that H(w, x) < d + βℓ for each x ∈ S, then G contains a clique on k vertices. Proof. We first prove that on each block Bi , w is close to selecting an element of T . Claim 1. For each i ∈ [k] there exists a unique xi ∈ T such that H(w[Bi ], xi ) < βℓ. Proof. Uniqueness follows directly from property (3) of Lemma 2.1 and the triangle inequality, so it suffices to prove existence. Let u = w[Bi ]. For the sake of contradiction, suppose H(u, x) ≥ βℓ for each x ∈ T . From Lemma 2.2(2) we infer that there exists y ∈ F such that H(u, y) ≥ (1−β)ℓ. Let us take φ : [k]\{i} → {0, 1} defined as follows: φ(j) = 0 if in w the majority of positions of Bj contain a one, and φ(j) = 1 otherwise. Also, define z = w[C]. Consider string a = a(i, y, φ, z) ∈ Ssel . Then, it follows that • H(w[Bi ], a[Bi ]) = H(u, y) ≥ (1 − β)ℓ; • H(w[Bj ], a[Bj ]) ≥ ℓ/2 for each j ∈ [k] \ {i}; • H(w[C], a[C]) = H(w[C], w[C]) = |C| = γℓ. Consequently, H(w, a) ≥ (1 − β)ℓ + (k − 1)ℓ/2 + γℓ = d + βℓ. This is a contradiction with the assumption that H(w, x) < d + βℓ for each x ∈ S. y For each i ∈ [k], let ci = ι−1 (xi ). Claim 2. For all i, j ∈ [k] with i < j, vertices ci and cj are different and adjacent. Proof. For the sake of contradiction, suppose ci and cj are either equal or non-adjacent. Define ψ : [k] \ {i, j} → {0, 1} as follows: ψ(q) = 0 if in w the majority of positions of Bq contain a one, and ψ(q) = 1 otherwise. Then, for (ci , cj ) we have constructed string b = b(i, j, (ci , cj ), ψ) ∈ Sadj . Observe now that 7 • H(w[Bi ], b[Bi ]) = H(w[Bi ], xi ) > (1 − β)ℓ, since H(w[Bi ], xi ) < βℓ; • Similarly, H(w[Bj ], b[Bj ]) > (1 − β)ℓ; • H(w[Bq ], b[Bq ]) ≥ ℓ/2 for each q ∈ [k] \ {i, j}; • H(w[C], b[C]) ≥ 0. Consequently, H(w, b) ≥ 2(1 − β)ℓ + (k − 2)ℓ/2 = (k/2 + 1 − 2β)ℓ > d + βℓ. This is a contradiction with the assumption that H(w, x) < d + βℓ for each x ∈ S. y Claim 2 asserts that, indeed, {c1 , c2 , . . . , ck } is a k-clique in G. Lemmas 3.1 and 3.2 conclude the proof of Theorem 1.2, where c can be taken to be any constant d ≤ β2 = 40. larger than βℓ·k 4 Conclusions In this paper we have proved that Closest String does not have an EPTAS under the assumption of FPT 6= W[1]. Moreover, under the stronger assumption of the Exponential Time Hypothesis, one can also exclude PTASes with running time f (ε) · no(1/ε) , for any computable function f . However, the fastest currently known approximation scheme for Closest String has running time 2 nO(1/ε ) [11]. This leaves a significant gap between the known upper and lower bounds. Despite efforts, we were unable to close this gap, and hence we leave it as an open problem. References [1] A. Andoni, P. Indyk, and M. Pătraşcu. On the optimality of the dimensionality reduction method. In 47th Annual IEEE Symposium on Foundations of Computer Science (FOCS 2006), 21-24 October 2006, Berkeley, California, USA, Proceedings, pages 449–458. IEEE Computer Society, 2006. [2] C. Bazgan. Schémas d’approximation et complexité paramétrée. PhD thesis, Université Paris Sud, 1995. In French. [3] C. Boucher, C. Lo, and D. Lokshtanov. Consensus Patterns (probably) has no EPTAS. In Algorithms - ESA 2015 - 23rd Annual European Symposium, Patras, Greece, September 14-16, 2015, Proceedings, volume 9294 of Lecture Notes in Computer Science, pages 239–250. Springer, 2015. Full version available at http://www.ii.uib.no/~daniello/papers/ConsensusPatterns.pdf. [4] M. Cesati and L. Trevisan. On the efficiency of polynomial time approximation schemes. Inf. Process. Lett., 64(4):165–171, 1997. [5] M. Cygan, F. V. Fomin, L. Kowalik, D. Lokshtanov, D. Marx, M. Pilipczuk, M. Pilipczuk, and S. Saurabh. Parameterized Algorithms. Springer, 2015. [6] J. Flum and M. Grohe. Parameterized Complexity Theory. Texts in Theoretical Computer Science. An EATCS Series. Springer-Verlag, Berlin, 2006. [7] J. Gramm, R. Niedermeier, and P. Rossmanith. Fixed-parameter algorithms for Closest String and related problems. Algorithmica, 37(1):25–42, 2003. [8] M. Li, B. Ma, and L. Wang. Finding similar regions in many sequences. J. Comput. Syst. Sci., 65(1):73–96, 2002. [9] M. Li, B. Ma, and L. Wang. On the Closest String and Substring problems. J. ACM, 49(2):157–171, 2002. 8 [10] D. Lokshtanov, D. Marx, and S. Saurabh. Slightly superexponential parameterized problems. In Proceedings of the Twenty-Second Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2011, San Francisco, California, USA, January 23-25, 2011, pages 760–776. SIAM, 2011. [11] B. Ma and X. Sun. More efficient algorithms for Closest String and Substring problems. SIAM J. Comput., 39(4):1432–1443, 2009. [12] D. Marx. Closest substring problems with small distances. SIAM J. Comput., 38(4):1382–1410, 2008. [13] D. Marx. Parameterized complexity and approximation algorithms. Comput. J., 51(1):60–78, 2008. 9
8cs.DS
arXiv:1705.10607v3 [math.GR] 16 Nov 2017 AUTOMORPHISM GROUPS OF QUANDLES AND RELATED GROUPS VALERIY G. BARDAKOV, TIMUR R. NASYBULLOV, AND MAHENDER SINGH Abstract. In this paper we study different questions concerning automorphisms of quandles. For a conjugation quandle Q = Conj(G) of a group G we determine several subgroups of Aut(Q) and find necessary and sufficient conditions when these subgroups coincide with the whole group Aut(Q). In particular, we prove that Aut(Conj(G)) = Z(G) ⋊ Aut(G) if and only if either Z(G) = 1 or G is one of the groups Z2 , Z22 or Z3 , what solves [3, Problem 4.8]. For a big list of Takasaki quandles T (G) of an abelian group G with 2-torsion we prove that the group of inner automorphisms Inn(T (G)) is a Coxeter group, what extends the result [3, Theorem 4.2] which describes Inn(T (G)) and Aut(T (G)) for an abelian group G without 2-torsion. We study automorphisms of certain extensions of quandles and determine some interesting subgroups of the automorphism groups of these quandles. Also we classify finite quandles Q with 3 ≤ k-transitive action of Aut(Q). 1. Introduction A quandle is an algebraic system whose axioms are derived from the Reidemeister moves on oriented link diagrams. Such algebraic system were firstly introduced by Joyce [15] (under the name “quandle”) and Matveev [18] (under the name “distributive groupoid”) as an invariant for knots in R3 . More precisely, to each oriented diagram DK of an oriented knot K in R3 one can associate the quandle Q(K) which does not change if we apply the Reidemeister moves to the diagram DK . Moreover, Joyce and Matveev proved that two knot quandles Q(K1 ) and Q(K2 ) are isomorphic if and only if K1 and K2 are weak equivalent, i. e. there exists a homeomorphism of R3 (probably, orientation reversing) which maps K1 to K2 . Over the years, quandles have been investigated by various authors in order to construct new invariants for knots and links (see, for example, [5, 16, 19]). The knot quandle is a very strong invariant for knots in R3 , however, usually it is very difficult to understand if two knot quandles are isomorphic or not. Sometimes homomorphisms from knot quandles to some simpler quandles provide useful information which helps to understand if two knot quandles are not isomorphic. For example, Fox’s n-colourings (which are useful invariants for links in R3 ) are representations of the knot quandle into the dihedral quandle Rn on n elements [11, 21]. This leads to the necessity of studying quandles which are not necessarily knot quandles from the algebraic point of view. Quandles turned out to be useful in different branches of algebra, topology and geometry since they have connections to several different topics such as permutation groups [14], quasigroups [22], symmetric spaces [24], Hopf algebras [2]. In this paper we investigate different questions concerning automorphisms of quandles. We also study connections between groups of automorphisms of quandles and groups of automorphisms of 2010 Mathematics Subject Classification. Primary 20N02; Secondary 20B25, 57M27. Key words and phrases. Quandle, automorphism of a quandle, braid group, enveloping group, Coxeter group. 1 2 VALERIY G. BARDAKOV, TIMUR R. NASYBULLOV, AND MAHENDER SINGH some groups closely related to quandles. At this point, our approach is purely algebraic and we make no reference to knots. However, it would be interesting to explore implications of these results in knot theory. The paper is organized as follows. In Section 2 we recall definitions and notions used in the paper and give several examples of quandles. In Section 3 we recall the notion of the enveloping group GQ of a quandle Q and prove some properties of this group. In particular, we study relations between automorphism groups of Q and GQ (Proposition 3.4). In Section 4 we study the automorphism group of the conjugation quandle Q = Conj(G) of a group G and find some groups which are imbedded into Aut(Q). In particular, we prove that Aut(Conj(G)) = Z(G) ⋊ Aut(G) if and only if either Z(G) = 1 or G is one of the groups Z2 , Z22 or Z3 (Theorem 4.9). In Section 5 we study automorphism groups of core quandles (in particular, of Takasaki quandles). In Section 6 we classify quandles Q such that the automorphism group Aut(Q) acts 3 ≤ k-transitively on Q (Theorem 6.2). In Section 7 we study automorphisms of certain extensions of quandles and determine some interesting subgroups of the automorphism groups of these quandles (Theorem 7.3). In Section 8 we compare the group of inner automorphisms and the group of quasi-inner automorphisms for quandles and give a simple solution of the analogue of the Burnside’s question for quandles (Proposition 8.3). Finally, in Section 9 we introduce some new ways of constructing quandles from groups and quandles (Propositions 9.1 and 9.2). Acknowledgement. The authors are greatful to Jente Bosmans from Vrije Universiteit Brussel for several remarks and suggestions on Section 9. The results given in Sections 3, 5, 7, 8, 9 are supported by the Russian Science Foundation Project 16-41-02006 (V. Bardakov) and the DSTRSF Project INT/RUS/RSF/P-2 (M. Singh). The results presented in Sections 4, 6 are supported by the Research Foundation – Flanders (FWO), grant 12G0317N (T. Nasybullov). We are strongly grateful to them. 2. Definitions, notations and examples A quandle Q is an algebraic system with one binary operation (x, y) 7→ x ∗ y which satisfies the following three axioms: (1) x ∗ x = x for all x ∈ Q, (2) the map Sx : y 7→ y ∗ x is a bijection on Q for all x ∈ Q, (3) (x ∗ y) ∗ z = (x ∗ z) ∗ (y ∗ z) for all x, y, z ∈ Q. The simplest example of a quandle is the trivial quandle on a set X, that is the quandle Q = (X, ∗), where x ∗ y = x for all x ∈ X. A lot of interesting examples of quandles come from groups. Let G be a group. For elements x, y ∈ G denote by xy = y −1 xy the conjugate of x by y. For n an arbitrary integer n the set G with the operation x ∗ y = xy = y −n xy n forms a quandle. This quandle is called the n-th conjugation quandle of the group G and is denoted by Conjn (G). For the sake of simplicity we will use the symbol Conj(G) to denote the 1-st conjugation quandle Conj1 (G). Note that a quandle Conj0 (G) is trivial. If we define another operation ∗ on the group G, namely x ∗ y = yx−1 y, then the set G with this operation also forms a quandle. This quandle is called the core quandle of a group G and is denoted by Core(G). In particular, if G is an abelian group, then the quandle Core(G) is called the AUTOMORPHISM GROUPS OF QUANDLES AND RELATED GROUPS 3 Takasaki quandle of the abelian group G and is denoted by T (G). Such quandles were studied by Takasaki in [23]. If G = Zn is the cylcic group of order n, then the Takasaki quandle T (Zn ) is called the dihedral quandle on n elements and is denoted by Rn . In the quandle Rn = {a0 , a1 , . . . , an−1 } the operation is given by the rule ai ∗ aj = a2j−i(mod n) . If ϕ is an automorphism of an abelian group G, then the set G with the operation x∗y = ϕ(xy −1 )y forms a quandle. This quandle is called the Alexander quandle of the abelian group G with respect to the automorphism ϕ and is denote by Alex(G, ϕ). The Takasaki quandle T (G) is a particular case of the Alexander quandle Alex(G, ϕ) for ϕ : x 7→ x−1 . Alexander quandles were studied, for example, in [3, 9, 10]. The subset Z(Q) = {x ∈ Q | x ∗ y = x for all y ∈ Q} of a quandle Q is called the center of the quandle Q. In particular, if Q = Conj(G), then the center Z(Q) of the quandle Q coincides with the center Z(G) of the group G. For n 6= ±1 the sets Z(Conjn (G)) and Z(G) do not have to coincide. A bijection ϕ : Q → Q is called an automorphism of a quandle Q if for every elements x, y ∈ Q the equality ϕ(x ∗ y) = ϕ(x) ∗ ϕ(y) holds. In particular, if Q is the trivial quandle, then the group Aut(Q) of automorphisms of the quandle Q consists of all permutations of the elements from Q, i. e. Aut(Q) = Σ|Q| is the full permutation group of |Q| elements . From the second and the third axioms of a quandle it follows that the map Sx : y 7→ y ∗ x is an automorphism of a quandle. The subgroup hSx | x ∈ Qi of the group Aut(Q) is called the group of inner automorphisms of the quandle Q and is denoted by Inn(Q). Every automorphism from Inn(Q) is called an inner automorphism of the quandle Q. For the element x ∈ Q the subset {ϕ(x) | ϕ ∈ Inn(Q)} of Q is called the orbit of the element x and is denoted by Orb(x). The set of orbits of elements of a quandle Q is denoted by Orb(Q). A quandle Q is called connected if the set Orb(Q) has only one element, otherwise Q is called disconnected. The dihedral quandle Rn is connected if an only if n is odd. The n-th conjugation quandle Conjn (G) of a nontrivial group G is always disconnected. 3. Enveloping groups of quandles For a quandle Q denote by GQ the group with the set of generators Q and the set of relations x ∗ y = y −1 xy fo all x, y ∈ Q. The group GQ is called the enveloping group of the quandle Q. For example, if Q is a trivial quandle then the group GQ is the free abelian group of rank |Q|. The enveloping group GR3 of the dihedral quandle R3 on 3 elements is more interesting. It has 3 generators x0 , x1 , x2 and is defined by the following relations −1 −1 −1 −1 −1 x0 x1 x−1 0 = x2 = x1 x0 x1 , x1 x2 x1 = x0 = x2 x1 x2 , x0 x2 x0 = x1 = x2 x0 x2 . Using the first relation we remove the element x2 from the list of generators and obtain the following relations −1 −1 −1 −1 x0 x1 x0−1 = x1 x0 x−1 1 , x0 x1 x0 = x1 x0 x1 , x1 x0 x1 = x0 x1 x0 . 2 The first and the second relations together imply the equality x21 x0 x−2 1 = x0 , i. e. x1 belongs to the 2 center of GR3 . Analogically, the first and the third relation imply that x0 belongs to the center of GR3 . Therefore looking at the square of the first relation we have x20 = x21 , and then all the relation are equivalent to the relation x0 x1 x0 = x1 x0 x1 . So, we proved the following. 4 VALERIY G. BARDAKOV, TIMUR R. NASYBULLOV, AND MAHENDER SINGH Proposition 3.1. The enveloping group GR3 of the dihedral quandle R3 has two generators x0 , x1 and two relations x1 x0 x1 = x0 x1 x0 , x20 = x21 . In particular, GR3 is a homomorphic image of the braid group B3 = hσ1 , σ2 | σ1 σ2 σ1 = σ2 σ1 σ2 i on 3 strands. The subgroup P3 = hσ12 , σ22 , σ2 σ12 σ2−1 i of the braid group B3 is called the pure braid group on 3 strands. The group P3 is normal in B3 and we have the following short exact sequence of groups 1 → P3 → B3 → Σ3 → 1. Defining the homomorphism B3 → GR3 by the rule σ1 7→ x0 , σ2 7→ x1 , we have the following short exact sequence of groups 1 → Z → GR3 → Σ3 → 1, where Z = hx20 i is the center of GR3 . This extension does not split. In [12, Lemma 2.3] it is proved that the enveloping group GQ of a connected quandle Q can be decomposed GQ = [GQ , GQ ] ⋊ Z. This result emplies the following proposition which gives a split decomposition of the group GR3 . Proposition 3.2. The enveloping group GR3 is the semi-direct product GR3 = Z3 ⋊ Z. Proof. Using Proposition 3.1 and direct calculations it is easy to check that [GR3 , GR3 ] = Z3 .  In the general case we have the following proposition about enveloping groups. Proposition 3.3. Let Q be a quandle. (1) If Q has finitely many orbits, then the abelianization of the enveloping group GQ is isomorphic to Z|Orb(Q)| . (2) If Q is finite, then the derived subgroup of the enveloping group GQ is finitely generated. Proof. (1) Let Q = {xi | i ∈ I}, then GQ is generated by elements {ai | i ∈ I} and is defined by the relations a−1 i aj ai = as(i,j) , where the index s(i, j) is uniquely determined by the multiplication in Q xi ∗ xj = xs(i,j) . Modulo G′Q the relation a−1 i aj ai = as(i,j) has the form aj = as(i,j) and we have an isomorphism ab |Orb(Q)| between GQ and Z . −1 −1 (2) The commutator subgroup G′Q is generated by commutators a−1 i aj ai aj = as(i,j) aj for all i, j. The number of these commutators is finite.  The dihedral quandle R3 on 3 elements is connected, i. e. it has only 1 orbit. Therefore by Proposition 3.3 the abelianization of the enveloping group GR3 is isomorphic to Z. The same result follows from Proposition 3.1 since the enveloping group of the dihedral quandle R3 has the presentation GR3 = hx0 , x1 | x1 x0 x1 = x0 x1 x0 , x20 = x21 i. The natural map Q → GQ which maps an element from Q to the corresponding generator of GQ induces a homomorphism of quandles Q → Conj(GQ ). This homomorphism is not necessarily injective. For example, in [15, Section 6] Joyce noticed that if Q is a quandle with 3 elements x, y, z and operation x ∗ y = z, x ∗ z = x, z ∗ x = z, z ∗ y = x, y ∗ x = y, y ∗ z = y, then the map Q → GQ maps x and z to the same element and therefore it is not injective. The following result shows a relation between the automorphism group of Q and the automorphism group of GQ in the case when the natural map Q → GQ is injective. AUTOMORPHISM GROUPS OF QUANDLES AND RELATED GROUPS 5 Proposition 3.4. Let Q be a quandle such that the natural map Q → GQ which maps an element from Q to the correspoding generator of GQ is injective. If AutQ (GQ ) denotes the subgroup of Aut(GQ ) consisting of automorphisms which keep Q invariant, then the natural map φ : AutQ (GQ ) → Aut(Q) given by φ(f ) = f |Q is an isomorphism of groups. Proof. The map f |Q : Q → Q is obviously a bijection of Q for each f ∈ AutQ (GQ ). Moreover, if x, y ∈ Q, then f |Q (x ∗ y) = f |Q (y −1 xy) = f (y)−1 f (x)f (y) = f |Q (x) ∗ f |Q (y), i. e. φ is indeed the map from AutQ (GQ ) to Aut(Q), which is obviously a homomorphism. So, we need to prove that f is a bijection. If φ(f ) = φ(g) for f, g ∈ Aut(GQ ), then f (x) = g(x) for all x ∈ Q and then f = g since GQ is generated by the set Q. So, φ is an injective map. For the surjectivity, let α ∈ Aut(Q). Then the composition of α with the natural inclusion i : Q ֒→ GQ can be extended to a group homomorphism α′ : F (Q) → GQ , where F (Q) is the free group on Q. For the elements x, y ∈ Q we have  α′ (x ∗ y) = iα(x ∗ y) = i α(x) ∗ α(y) = α(y)−1 α(x)α(y) = α′ (y)−1 α′ (x)α′ (y) = α′ (y −1 xy), i. e. α′ induces a group homomorphism α̃ : GQ → GQ . It is easy to see that α̃ is an automorphism g −1 and φ(α̃) = α. of GQ which keeps Q ivariant with inverse α  Unfortunately, it is quite difficult to check if the natural map Q → GQ is injective or not. However, if it is, then by Proposition 3.4 the group Aut(Q) is a subgroup of the group Aut(GQ ). This subgroup is not necessarily normal in Aut(GQ ). Indeed, if Q = {x1 , x2 , . . . , xn } is the trivial quandle, then the natural map Q → GQ is injective and the enveloping group GQ is the free abelian group Zn of rank n. The group Aut(Q) is isomorphic to Σn and consists of all possible permutations of the elements from Q. The group Aut(GQ ) is the general linear group GLn (Z) which acts naturally on GQ = Zn . If Q contains at least 2 elements, then denote by  (  x1 7→ x2 , x1 7→ x1 + x2 , ϕ : x2 7→ x1 , ψ:  xi 7→ xi , i > 1.  xi 7→ xi , i > 2. The map ϕ belongs to the group Aut(Q) = Σn ≤ GLn (Z) and the map ψ belongs to the group Aut(GQ ) = GLn (Z). Since the automorphism ψ −1 ϕψ of GQ has the form   x1 7→ x1 , −1 ψ ϕψ : x2 7→ x1 − x2 ,   xi 7→ xi , i > 2, it does not belong to Aut(Q), therefore Aut(Q) is not a normal subgroup of Aut(GQ ). 4. Automorphisms of conjugation quandles n n Let G be a group and ϕ be an automorphism of G. Since ϕ xy = ϕ(x)ϕ(y) , every automorphism of G induces the automorphism of Conjn (G) and therefore Aut(G) ≤ Aut (Conjn (G)). Of course, the group Aut(G) is not necessarily normal in Aut (Conjn (G)). For example, if G is a cyclic group of prime order p ≥ 5, then the order of Aut(G) is equal to p − 1. The quandle 6 VALERIY G. BARDAKOV, TIMUR R. NASYBULLOV, AND MAHENDER SINGH Conj(G) is trivial and Aut (Conj(G)) = Σp . The only proper normal subgroup of Σp for p ≥ 5 is the alternating group Ap which has order p!/2 > p − 1. Therefore Aut(G) cannot be normal in Aut (Conj(G)). We will show that Aut(G) = Aut (Conj(G)) if and only if Z(G) = 1. Lemma 4.1. Let G be a group, Q = Conj(G) and ϕ be an automorphism of Q. Then for all x, y ∈ Q there exists an element z ∈ Z(G) such that ϕ(xy) = ϕ(x)ϕ(y)z. Proof. For all x, y, z ∈ Q we have ϕ(xyz ) = ϕ(x ∗ yz) = ϕ(x) ∗ ϕ(yz) = ϕ(x)ϕ(yz) . On the other side ϕ(xyz ) = ϕ((xy )z ) = ϕ(xy ∗ z) = ϕ(xy ) ∗ ϕ(z) = = ϕ(x ∗ y) ∗ ϕ(z) = (ϕ(x) ∗ ϕ(y)) ∗ ϕ(z) = ϕ(x)ϕ(y)ϕ(z) and we have ϕ(x)ϕ(yz) = ϕ(x)ϕ(y)ϕ(z) . Since x is an arbitrary element of the group G, the element ϕ(yz)(ϕ(y)ϕ(z))−1 must belong to Z(G).  Corollary 4.2. If G is a group with trivial center, then Aut(G) = Aut (Conj(G)). Proposition 4.3. If G is a group with nontrivial center, then Aut(G) 6= Aut (Conj(G)). Proof. Let 1 6= x ∈ Z(G) and ϕ denotes the bijection of Q = Conj(G) which fixes all elements of Q except 1 and x and such that ϕ(1) = x, ϕ(x) = 1. Let us show that ϕ ∈ Aut(Q). Let y, z be some elements from Q. If y ∈ {1, x}, then ϕ(y ∗ z) = ϕ(y z ) = ϕ(y) = ϕ(y) ∗ ϕ(z) since y, ϕ(y) ∈ Z(G). If y ∈ / {1, x}, then y z ∈ / {1, x}, and hence ϕ(y ∗ z) = ϕ(y z ) = y z = ϕ(y)ϕ(z) = ϕ(y) ∗ ϕ(z), i. e. ϕ is an automorphism of Q. Since ϕ(1) 6= 1, the map ϕ does not belong to Aut(G).  Corollary 4.4. Let G be a group. Then Aut(G) = Aut (Conj(G)) if and only if Z(G) = 1. In [3, Proposition 4.7] it is proved that for a group G there exists an embedding of groups Z(G) ⋊ Aut(G) ֒→ Aut (Conj(G)). We are going to prove that if G is a non-abelian group, then Aut(G) × Σ|Z(G)| is also imbedded into Aut (Conj(G)). Proposition 4.5. Let G be a non-abelian group. Then the group Aut (Conj(G)) contains a subgroup isomorphic to the direct product Aut(G) × Σ|Z(G)| . Proof. Consider the map f : Aut(G) → Aut(Conj(G)) which maps every automorphism ϕ of the group G to the map f (ϕ) : Conj(G) → Conj(G) which acts on Conj(G) by the following rule. ( ϕ(x), x ∈ / Z(G), f (ϕ)(x) = x, x ∈ Z(G). Since ϕ ∈ Aut(G), the map ϕ maps Z(G) to Z(G) and it maps G \ Z(G) to G \ Z(G). Therefore f (ϕ) is a bijection on Conj(G). It is easy to show that f (ϕ) preserves the operation of Conj(G), and hence it is an automorphism of Conj(G). For automorphisms ϕ, ψ ∈ Aut(G) and element x ∈ Z(G) we have f (ϕψ)(x) = x = f (ϕ)f (ψ)(x). If x ∈ / Z(G), then ψ(x) ∈ / Z(G), and hence f (ϕψ)(x) = ϕ(ψ(x)) = f (ϕ)(f (ψ)(x)) = f (ϕ)f (ψ)(x). Therefore f is a homomorphism from Aut(G) to Aut (Conj(G)). If f (ϕ) = f (ψ), then for all x ∈ / Z(G) we have ϕ(x) = f (ϕ)(x) = f (ψ)(x) = ψ(x). In particular, if x ∈ G \ Z(G) 6= ∅ and AUTOMORPHISM GROUPS OF QUANDLES AND RELATED GROUPS 7 y ∈ Z(G), then ϕ(x) = ψ(x), ϕ(xy) = ψ(xy). Therefore ϕ(y) = ψ(y) and ϕ = ψ. Hence f is an injective homomorphism from Aut(G) to Aut(Conj(G)). Consider the map g : Σ|Z(G)| → Aut(Conj(G)) which maps every permutation σ of the elements from Z(G) to the map g(σ) which acts on Conj(G) by the following rule. ( x, x∈ / Z(G), g(σ)(x) = σ(x), x ∈ Z(G). Similarly to the case of the map f it is easy to see that g is an injective homomorphism from Σ|Z(G)| to Aut (Conj(G)). Let H be a subgroup of Aut(Conj(G)) generated by H1 = f (Aut(G)) and H2 = g(Σ|Z(G)| ). Both groups H1 , H2 are obviously normal in H (moreover, H2 is normal in Aut(Conj(G))) and H1 ∩ H2 = 1, therefore H = H1 × H2 = Aut(G) × Σ|Z(G)| .  Corollary 4.6. Let G be a group. Then the group Aut (Conj(G)) contains a subgroup isomorphic to the group Z(G). Proof. The group Z(G) acts faithfully on Z(G) by right multiplications and therefore Z(G) is a subgroup of Σ|Z(G)| . If G is abelian then Conj(G) is the trivial quandle and Aut(Conj(G)) is isomorphic to Σ|Z(G)| . If G is not abelian, then by Proposotion 4.5 the group Σ|Z(G)| is a subgroup of Aut (Conj(G)).  The following result says that if G 6= 1 is a finite abelian group, then the conclusion of Proposition 4.5 is correct if and only if G = Z2 . Proposition 4.7. Let G be a finite abelian group. Then Aut(Conj(G)) contains a subgroup isomorphic to Aut(G) × Σ|Z(G)| if and only if G = 1 or G = Z2 . Proof. If G = 1 or G = Z2 , then Aut(G) = 1 and Aut(Conj(G)) = Aut(G) × Σ|Z(G)| . Conversely, since G is an abelian group, the quandle Conj(G) is the trivial quandle and Aut(Conj(G)) is the full permutation group Σ|G| which has the order |G|!. The group Aut(G) × Σ|Z(G)| is equal to the group Aut(G) × Σ|G| and has order |Aut(G)| · |G|!. Therefore |Aut(G)| = 1 and G = 1 or G = Z2 .  The following result describes all finite groups for which Aut(Conj(G)) = Aut(G) × Σ|Z(G)| . Theorem 4.8. Let G be a finite group. Then Aut(Conj(G)) = Aut(G) × Σ|Z(G)| if and only if Z(G) = 1 or G = Z2 . Proof. Corollary 4.4 and Proposition 4.7 imply that if Z(G) = 1 or G = Z2 , then Aut(Conj(G)) = Aut(G) × Σ|Z(G)| and we need to prove that groups with trivial center and Z2 are all groups for which Aut(Conj(G)) = Aut(G) × Σ|Z(G)| . Suppose that Z(G) 6= 1. Then according to Proposition 4.5 the group Aut(G) × Σ|Z(G)| consists of all automorphisms of the form ( ϕ(x), x ∈ / Z(G), (4.0.1) x 7→ σ(x), x ∈ Z(G), where ϕ is an automorphism of G and σ is a permutation of elements from Z(G). Following [3], for an element a ∈ Z(G) denote by ta the automorphism of the quandle Conj(G) of the form ta : x 7→ xa. 8 VALERIY G. BARDAKOV, TIMUR R. NASYBULLOV, AND MAHENDER SINGH Since Z(G) 6= 1, for an element 1 6= a ∈ Z(G) the map ta : x 7→ xa must have the form (4.0.1). If in G there exist two elements x, y ∈ / Z(G) such that xy ∈ / Z(G), then from equality (4.0.1) we have ϕ(x)ϕ(y) = ϕ(xy) = ta (xy) = axy. On the other hand from (4.0.1) we have ϕ(x) = ta (x) = ax and ϕ(y) = ta (y) = ay. Therefore a = 1, what contradicts the choice of a and we proved that for all elements x, y ∈ / Z(G) the product xy belongs to Z(G). It means that |G : Z(G)| ≤ 2 and G is abelian. Therefore by Proposition 4.7 we have G = Z2 .  As we already mentioned, in [3, Proposition 4.7] it is proved that the group Aut (Conj(G)) contains a subgroup isomorphic to the semidirect product Z(G) ⋊ Aut(G). The following theorem describes all finite groups which satisfy the equality Aut (Conj(G)) = Z(G) ⋊ Aut(G), what gives the answer to [3, Problem 4.8]. Theorem 4.9. Let G be a finite group. Then Aut (Conj(G)) = Z(G) ⋊ Aut(G) if and only if either Z(G) = 1 or G is one of the groups Z2 , Z22 or Z3 . Proof. The if-part of the theorem is simple. By Corollary 4.4 if the center of the group G is trivial, then Aut (Conj(G)) = Aut(G) = Z(G) ⋊ Aut(G). For groups Z2 , Z22 and Z3 we have the following equalities Aut(Conj(Z2 )) = Σ2 = Z2 = Z2 ⋊ Aut(Z2 ), Aut(Conj(Z22 )) = Σ4 = Z22 ⋊ Σ3 = Z22 ⋊ Aut(Z22 ), Aut(Conj(Z3 )) = Σ3 = Z3 ⋊ Σ2 = Z3 ⋊ Aut(Z3 ), and we need to prove that groups without center and the groups Z2 , Z22 and Z3 are all the groups for which Aut (Conj(G)) = Z(G) ⋊ Aut(G). For the element a ∈ Z(G) denote by ta the automorphism of the quandle Conj(G) of the form ta : x 7→ xa. The group generated by ta for all a ∈ Z(G) is isomorphic to Z(G) and the subgroup of Aut(Conj(G)) which is isomorphic to Z(G) ⋊ Aut(G) consists of the automorphisms of the form ta ϕ for a ∈ Z(G), ϕ ∈ Aut(G) (see [3, Proposition 4.7] for details). So, we need to prove that if every automorphism of Conj(G) has the form ta ϕ for some a ∈ Z(G) and ϕ ∈ Aut(G), then either Z(G) = 1 or G is one of the groups Z2 , Z22 or Z3 . Suppose that Z(G) 6= 1. For a permutation σ of the elements from Z(G) denote by f the automorphism of Conj(G) of the form ( x, x∈ / Z(G), f (x) = σ(x), x ∈ Z(G). Suppose that f = ta ϕ for a ∈ Z(G) and ϕ ∈ Aut(G). If in G there exist two elements x, y ∈ / Z(G) such that xy ∈ / Z(G), then x = f (x) = ta ϕ(x) = aϕ(x), y = f (y) = ta ϕ(y) = aϕ(y), xy = f (xy) = ta ϕ(xy) = aϕ(x)ϕ(y). These equalities imply that a = 1 and f = ϕ. Since Z(G) 6= 1, we can choose σ such that σ(1) 6= 1 and f cannot belong to Aut(G). Therefore for every two elements x, y ∈ / Z(G) the product xy AUTOMORPHISM GROUPS OF QUANDLES AND RELATED GROUPS 9 belongs to Z(G). It means that |G : Z(G)| ≤ 2, therefore G is abelian and |Aut(Conj(G))| = |Σ|G| | = |G|!. Since every automorphism of G fixes the unit element, we have |Aut(G)| ≤ (|G| − 1)! and since Aut (Conj(G)) = Z(G)⋊Aut(G) = G⋊Aut(G), we have the equality |Aut(G)| = (|G|−1)!, i. e. every permutation of nontrivial elements from G is an automorphism of G, in particular, all nontrivial elements of G have the same order. Suppose that in G there exist at least 5 distinct elements {1, x, y, xy, t}. Since every permutation of elements from G which fixes 1 is an automorphism of G, the map ϕ(1) = 1, ϕ(x) = x, ϕ(y) = y, ϕ(xy) = t can be extended to the automorphism of G. It means, that t = ϕ(xy) = ϕ(x)ϕ(y) = xy, what contradicts the fact that the elements {1, x, y, xy, t} are distinct. Therefore the order of G is less then or equal to 4 and since all nontrivial elements of G have the same order, G is one of the  groups Z2 , Z22 or Z3 . 5. Automorphisms of core quandles and Takasaki quandles The following proposition is an analogue of [3, Proposition 4.7] for core quandles of groups. Proposition 5.1. Let G be a group with the center Z(G). Then Aut(Core(G)) has a subgroup isomorphic to the group Z(G) ⋊ Aut(G). Proof. Denote by ∗ the operation in the quandle Core(G), i. e. x ∗ y = yx−1 y for all x, y ∈ G. If ϕ is an automorphism of G, then ϕ(yx−1 y) = ϕ(y)ϕ(x)−1 ϕ(y). Therefore ϕ(x ∗ y) = ϕ(x) ∗ ϕ(y) and ϕ induces the automorphism of Core(G). Denote by H1 the subgroup of Core(G) generated by all automorphisms induced by automorphisms from Aut(G). For an element a ∈ Z(G) denote by ta the bijection of Core(G) of the form ta : x 7→ ax, which is obviously an automorphism of Core(G). Denote by H2 the subgroup of Core(G) generated by ta for all a ∈ Z(G). Since ϕ(1) = 1 for every automorphism ϕ ∈ H1 , the intersection of H1 and H2 is trivial. For the automorphism ϕ ∈ H1 and the automorphism ta ∈ H2 we have ϕta ϕ−1 = tϕ(a) , therefore H2 is the normal subgroup of the group H generated by H1 , H2 . Hence H is the semidirect product H2 ⋊ H1 of H2 = Z(G) and H1 = Aut(G).  If G is an abelian group, then the core quandle Core(G) is the Takasaki quandle T (G) and Proposition 5.1 has strong modification which is proved in [3, Theorem 4.2]. Theorem 5.2. If G is an additive abelian group without 2-torsion, then (1) Aut (T (G)) = G ⋊ Aut(G), (2) Inn (T (G)) = 2G ⋊ Z2 . It is obvious that if G = Zn2 is an elementary abelian 2-group, then the Takasaki quandle T (G) is the trivial quandle on 2n elements. The group of automorphisms of this quandle is isomorphic to Σ2n and the group of inner automorphisms is trivial. Here we attempt to complement Theorem 5.2 considering finite abelian groups with 2-torsion. Let M = (mij ) be a symmetric n × n matrix with entries from N ∪ {∞} such that mii = 1 for all i = 1, . . . , n and mij > 1 for i 6= j. The Coxeter group W (M ) of type M is the group which has the following presentation W (M ) = {a1 , . . . , an | (ai aj )mij = 1 for all 1 ≤ i, j ≤ n}. 10 VALERIY G. BARDAKOV, TIMUR R. NASYBULLOV, AND MAHENDER SINGH More results about Coxeter groups can be found, for example, in [1]. Theorem 5.3. Let G be a finite additive abelian group with cyclic decomposition G = Zn1 ⊕ · · · ⊕ Znr ⊕ Znr+1 ⊕ · · · ⊕ Znk such that ni divides ni+1 for all i = 1, . . . k − 1 and nk > 2 is even and N be the number (Q Qk r j=1 nj · i=r+1 ni /2, Znr is the largest odd order component, N = Qk if there is no odd order component. i=1 ni /2 Then the group Inn (T (G)) is isomorphic to the Coxeter group W (M ), where M = (mij ) is the symmetric N × N matrix with mij = nk /2 for all i 6= j.  Proof. By the definition Inn T (G) = hSx | x ∈ T (G)i and it is easy to see that Sx2 = idT (G) for all x ∈ T (G). Note that the exponent of G is nk > 2. For the elements x, y ∈ T (G) using direct calculations we have (Sx Sy )nk /2 (z) = nk (x − y) + z = z  for all z ∈ T (G). Therefore the group Inn T (G) is generated by involutions Sx subject to the relations (Sx Sy )nk /2 = idT (G) for all x, y ∈ T (G). In order to determine distinct generators Sx of Inn(G), notice that Sx = Sy if and only if 2x = 2y. Let x = (x1 , . . . , xr , xr+1 , . . . , xk ) and y = (y1 , . . . , yr , yr+1 , . . . , yk ) be two elements of G. Then 2x = 2y if and only if xj = yj for all j = 1, . . . r and xi = yi ± n for all i = r + 1, . . . , k. Thus the number N of distinct involutions Sx Q Q in Inn(G) is equal to rj=1 nj · ki=r+1 ni /2 if Znr is the largest odd order component in G and  Qk i=1 ni /2 if there are no odd order components. This proves that Inn T (G) is isomorphic to W (M ), where M = (mij ) is an N × N matrix with mij = nk /2 for all i 6= j.  For an arbitrary group G a discription of the group of inner automorphisms Inn(Core(G)) as a quotient of some subgroup of the group (G × G) ⋊ Z2 is presented in [20, Proposition 4.14]. Theorem 5.3 and Theorem 5.2(2) give alternative description of Inn(Core(G)) in the case when G is an abelian group. If G = Zn is the cyclic group of order n, then the Takasaki quandle T (G) is the dihedral quandle Rn and Theorem 5.3 implies the following result. Corollary 5.4. Let n > 2 be an integer. Then the group of inner automorphisms Inn(R2n ) of the dihedral quandle R2n is isomorphic to the Coxeter group W (M ), where M = (mij ) is the n × n matrix with mij = n for all i 6= j.  Corollary 5.5. If G = Zk4 , then the group of inner automorphisms Inn T (G) is the elementary k abelian group Z22 . Proof. In this case N = 2k and Sx Sy = Sy Sx for all x, y ∈ T (G).  Corollary 5.6. The group Aut(R4 ) is isomorphic to the semidirect product (Z2 ⊕ Z2 ) ⋊ Z2 , where Z2 acts on Z2 ⊕ Z2 by permuting of the components. AUTOMORPHISM GROUPS OF QUANDLES AND RELATED GROUPS 11 Proof. The quandle R4 has 4 elements a0 , a1 , a2 , a3 . From Corollary 5.5 the group Inn(R4 ) is isomorphic to the group Z2 ⊕ Z2 = hSa0 i ⊕ hSa1 i. Let φ be the following automorphism of R4  a0 7→ a1 ,    a 7→ a , 1 0 φ:  a → 7 a 2 3,    a3 7→ a2 . It is easy to see that φ is not an inner automorphism of R4 and is of order 2. Moreover, φSa0 φ−1 = Sa1 and φSa1 φ−1 = Sa0 . Therefore the group H = (hSa0 i ⊕ hSa1 i) ⋊ hφi is a subgroup of Aut(R4 ). For the symmetric group Σ4 we can write Σ4 = H ∪ σ1 H ∪ σ2 H, where   a0 7→ a1 , a0 7→ a3 ,       a 7→ a , a 7→ a , 1 0 1 1 σ1 : σ2 :   a → 7 a , a → 7 a 2 2 2 2,       a3 7→ a3 , a3 7→ a0 . Since σ1 , σ2 6∈ Aut(R4 ), we have Aut(R4 ) ∼  =H∼ = (Z2 ⊕ Z2 ) ⋊ Z2 . Remark 5.7. The dihedral quandle R2n = {a0 , a1 , . . . , a2n−1 } is known to be disconnected with two orbits {a0 , a2 , . . . , a2n−2 } and {a1 , a3 , . . . , a2n−1 }. Define the map φ : R2n → R2n by the rule φ(ai ) = ai+1 , φ(ai+1 ) = ai for all i = 0, 2, . . . , 2n − 2. Direct calculations show that the map φ is an automorphism of R2n if and only if n = 1 or n = 2. Therefore the arguments from the proof of Proposition 5.6 do not work in the case of quandle R2n for n > 2. This observation also shows that a bijection of a quandle which permutes the orbits of the quandle is not neccessarily an automorphism. 6. Quandles with k-transitive action of the automorphism group Let a group G acts on a sex X from the left, i. e. there exists a homomorphism G → Σ|X| which maps an element g ∈ G to the permutation x 7→ gx of the set X. For the number k ≤ |X| we say that G acts k-transitively on X if for each pair of k-tuples (x1 , . . . , xk ) and (y1 , . . . , yk ) of distinct elements from X there exists an element g ∈ G such that gxi = yi for i = 1, . . . , k. For the sake of simplicity, if k > |X|, then we say that G acts k-transitively on X independently on G. If Q is a quandle, then the group of inner automorphisms Inn(Q) acts naturally on Q. If the group Inn(Q) acts k-transitively on Q, then we say that the quandle Q is k-transitive. In particular, the quandle Q is 1-transitive if and only if it is connected. McCarron proved that if Q is a finite 2 ≤ k-transitive quandle with at least four elements, then k = 2 [17, Proposition 5]. Moreover, the dihedral quandle R3 on 3 elements is the only 3-transitive quandle. Therefore higher order transitivity does not exist in quandles with at least four elements. We investigate the following problem from [3, Problem 6.7]: For an integer k ≥ 2 classify all finite quandles Q for which Aut(Q) acts k-transitively on Q. Lemma 6.1. Let Q be a quandle and ϕ be an automorphism of Q. Then ϕ (Z(Q)) = Z(Q). 12 VALERIY G. BARDAKOV, TIMUR R. NASYBULLOV, AND MAHENDER SINGH Proof. If x ∈ Z(Q), then for all y ∈ Q we have ϕ(x)∗ϕ(y) = ϕ(x∗y) = ϕ(x), therefore ϕ(x) ∈ Z(Q). Conversely, if ϕ(x) ∈ Z(Q), then for all y ∈ Q we have ϕ(x ∗ y) = ϕ(x) ∗ ϕ(y) = ϕ(x). Therefore x ∗ y = x for all y ∈ Q and x ∈ Z(Q).  Theorem 6.2. Let Q be a finite quandle. Then the following statements are equivalent: (1) Q is either trivial quandle or Q = R3 . (2) Aut(Q) = Σ|Q| . (3) Aut(Q) acts 3-transitively on Q. Proof. The implications (1) ⇒ (2) and (2) ⇒ (3) are obvious and the only thing which we need to prove is that the quandle Q with 3-transitive action of Aut(Q) is either trivial or is isomorphic to the dihedral quandle R3 . If Z(Q) 6= ∅, then since Aut(Q) acts 3-transitively (and therefore 1-transitively) on Q by Lemma 6.1 the quandle Q is trivial and the statement is proved. If Z(Q) = ∅, then |Q| ≥ 3 and for an element x ∈ Q there exists an element y ∈ Q such that z = x ∗ y 6= x. Since x 6= y, we have z = x ∗ y 6= y ∗ y = y, therefore x, y, z are three distinct elements. Let t be an arbitrary element of Q. If t ∈ / {x, y}, then since Aut(Q) acts 3-transitively on Q there exists an automorphism ϕ of Q such that ϕ(x) = x, ϕ(y) = y and ϕ(z) = t, but ϕ(z) = ϕ(x ∗ y) = ϕ(x) ∗ ϕ(y) = x ∗ y = z. Therefore Q = {x, y, z} has only three elements. Since Aut(Q) acts 3-transitively on Q, there exists an automorphism ϕ such that ϕ(x) = y, ϕ(y) = x, ϕ(z) = z, therefore y ∗ x = ϕ(x) ∗ ϕ(y) = ϕ(x ∗ y) = ϕ(z) = z = x ∗ y. Again since Aut(Q) acts 3-transitively on Q, there exists an automorphism ψ such that ψ(x) = z, ψ(y) = x, ψ(z) = y and therefore y = ψ(z) = ψ(x ∗ y) = ψ(x) ∗ ψ(y) = z ∗ x. Repeating this argument for all the possible triples (a1 , a2 , a3 ), where ai ∈ {x, y, z}, we have the following relation in Q x ∗ y = y ∗ x = z, x ∗ z = z ∗ x = y, y ∗ z = z ∗ y = x, i. e. Q = {x, y, z} is the dihedral quandle R3 .  Corollary 6.3. If Aut(Q) acts 3-transitively on Q, then for all k ≥ 3 it acts k-transitively on Q. The following question for k = 2 remains open. Question 6.4. Classify all finite quandles Q with 2-transitive action of Aut(Q). 7. Automorphisms of extensions of quandles Let Q be a quandle and S be a set. A map α : Q × Q → Σ|S| is called a constant quandle cocycle if it satisfies two conditions: (1) α(x ∗ y, z)α(x, y) = α(x ∗ z, y ∗ z)α(x, z) for all x, y, z ∈ Q, (2) α(x, x) = idS for all x ∈ Q. Examples of constant quandle cocycles can be found, for example, in [2]. The set of all constant quandle cocycles α : Q × Q → Σ|S| is denoted by C 2 (Q, S). For a quandle Q, a set S and a constant quandle cocycle α : Q×Q → Σ|S| consider the set Q×S = {(x, t) | x ∈ Q, t ∈ S} with the operation ∗ given by the rule (7.0.1) (x, t) ∗ (y, s) = (x ∗ y, α(x, y)(t)) AUTOMORPHISM GROUPS OF QUANDLES AND RELATED GROUPS 13 for x, y ∈ Q and s, t ∈ S. The set Q × S with the operation ∗ is a quandle which is called the non-abelian extension of Q by S with respect to α and is denoted by Q ×α S. Such quandles were introduced in [2]. There exists a surjective quandle homomorphism from Q ×α S onto Q, namely, projection onto the first component. On the other hand, for each x ∈ Q, the set {(x, t) | t ∈ S} is a trivial subquandle of Q ×α S. Two constant quandle cocycles α, β ∈ C 2 (Q, S) are said to be cohomologous if there exists a map λ : Q → Σ|S| such that α(x, y) = λ(x ∗ y)−1 β(x, y)λ(x) for all x, y ∈ Q. The relation of being cohomologous is an equivalence relation on C 2 (Q, S). The equivalence class of a constant quandle cocycle α is called the cohomology class of α and is denoted by [α]. The symbol H2 (Q, S) denotes the set of cohomology classes of constant quandle cocycles. The following result generalizes the result from [7, Lemma 4.8] formulated for Alexander quandles. Lemma 7.1. Let Q be a quandle and S be a set. If constant quandle cocycles α, β : Q × Q → Σ|S| are cohomologous, then the quandles Q ×α S and Q ×β S are isomorphic. Proof. Denote by ∗ the operation in the quandle Q ×α S and by ◦ the operation in the quandle Q×β S. Since constant quandle cocycles α and β are cohomologous, there exists a map λ : Q → Σ|S| such that α(x, y) = λ(x∗y)−1 β(x, y)λ(x) for all x, y ∈ Q. Denote by f the map f : X ×α S → X ×β S which maps the pair (x, t) to the pair (x, λ(x)(t)). The map f is obviously a bijection between Q ×α S and Q ×β S. Further, for (x, t), (y, s) ∈ Q ×α S we have f ((x, t) ∗ (y, s)) = f (x ∗ y, α(x, y)(t)) = (x ∗ y, λ(x ∗ y)α(x, y)(t)) = (x ∗ y, β(x, y)λ(x)(t)) = (x, λ(x)(t)) ◦ (y, λ(y)(s)) = f (x, t) ◦ f (y, s), i. e. f is an isomorphism of quandles.  Lemma 7.2. Let Q be a quandle, S be a set and α be a constant quandle cocycle. Then for φ ∈ Aut(Q) and θ ∈ Σ|S| the map (φ,θ) : C 2 (Q, S) → C 2 (Q, S) defined by the rule  (φ,θ) α(x, y) = θα φ−1 (x), φ−1 (y) θ −1 gives the left action of Aut(Q) × Σ|S| on C 2 (Q, S) which induces an action on H2 (Q, S). Proof. Using direct calculation it is easy to check that (φ,θ) α is a constant quandle cocycle and the map (φ,θ) : C 2 (Q, S) → C 2 (Q, S) is the left action of Aut(Q) × Σ|S| on C 2 (Q, S). If α, β are cohomologous constant cocycles, then there exists a map λ : Q → Σ|S| such that α(x, y) = λ(x ∗ y)−1 β(x, y)λ(x) for all x, y ∈ Q. Acting on this equality by the map (φ,θ) we have (φ,θ) α(x, y) = λ′ (x ∗ y)−1 (φ,θ) β(x, y)λ′ (x), where the map λ′ : Q → Σ|S| is given by λ′ (x) = θλ(φ−1 (x))θ −1 . Therefore (φ,θ) α and (φ,θ) β are   cohomologous and the map (φ, θ) which maps the class [α] to the class (φ,θ) α is a well defined map H2 (Q, S) → H2 (Q, S).  If a group G acts on a set X from the left and x ∈ X, then the set Gx = {g ∈ G | gx = x} forms a subgroup of G which is called the stabilizer of x. By Lemma 7.2 the group Aut(Q) × Σ|S| acts 14 VALERIY G. BARDAKOV, TIMUR R. NASYBULLOV, AND MAHENDER SINGH on the set C 2 (Q, S) of all constant quandle cocycles. The following result gives a relation between groups Aut(Q) × Σ|S| and Aut(Q ×α S). Theorem 7.3. Let Q be a quandle, S be a set and α : Q × Q → Σ|S| be a constant quandle cocycle. Then there exists an embedding (Aut(Q) × Σ|S| )α ֒→ Aut(Q ×α S). Proof. For an automorphism φ from Aut(Q) and a permutation θ from Σ|S| such that (φ, θ) belongs to (Aut(Q)× Σ|S|)α define the map γ : Q ×α S → Q ×α S by the rule γ(x, t) = (φ(x), θ(t)). The map γ is obviously a bijection of Q ×α S. Since (φ, θ) ∈ (Aut(Q) × Σ|S| )α , we have (φ,θ) α = α and by the  definition of the map (φ,θ) for all x, y ∈ Q we have the equality θα φ−1 (x), φ−1 (y) θ −1 = α(x, y). For the elements x, y ∈ Q, t, s ∈ S we have γ ((x, t) ∗ (y, s)) = γ ((x ∗ y, α(x, y)(t))) = (φ(x) ∗ φ(y), θα(x, y)(t)) = (φ(x) ∗ φ(y), α(φ(x), φ(y))θ(t)) = (φ(x), θ(t)) ∗ (φ(y), θ(s)) = γ(x, t) ∗ γ(y, s), i. e. γ is an automorphism of Q ×α S and we have an injective map  Ψ : Aut(Q) × Σ|S| α → Aut(Q ×α S) which maps a pair (φ, θ) to the automorphism γ. If (φ1 , θ1 ), (φ2 , θ2 ) ∈ Aut(Q) × Σ|S|   γ1 γ2 (x, t) = γ1 φ2 (x), θ2 (t) = φ1 φ2 (x), θ1 θ2 (t) .    Thus Ψ (φ1 , θ1 )(φ2 , θ2 ) = Ψ (φ1 , θ1 ) Ψ (φ2 , θ2 ) , and hence Ψ is a homomorphism.  α , then  Remark 7.4. If (φ, θ) is an element from Aut(Q) × Σ|S| and the map γ : Q ×α S → Q ×α S defined  by γ(x, t) = φ(x), θ(t) is an automorphism of Q ×α S, then reversing the preceeding calculations  it is easy to see that (φ, θ) ∈ Aut(Q) × Σ|S| α , i. e. the map γ defined by γ(x, t) = φ(x), θ(t) is an automorphism of Q ×α S if an only if (φ,θ) α = α. For an abelian group A denote by ψ : A → Σ|A| the map which maps the element a ∈ A to the map ψa (b) = b + a for all b ∈ A. Following [8] we call the function µ : Q × Q → A a quandle 2-cocycle if the map ψµ : Q × Q → Σ|A| is a constant quandle cocycle. Two quandle 2-cocycles µ, ν : Q × Q → A are said to be cohomologous if the corresponding constant quandle cocycles ψµ, ψν are homologous. The set of cohomology classes of quandle 2-cocycles is the second cohomology group H2 (Q, A) of the quandle Q with coefficients from the group A. For a given quandle 2-cocycle µ denote by the symbol E(Q, A, µ) the quandle Q ×ψµ A. By formula (7.0.1) the operation in E(Q, A, µ) has the form (x, a) ∗ (y, b) = (x ∗ y, a + µ(x, y)) for x, y ∈ Q and a, b ∈ A. The quandle E(Q, A, µ) is called an abelian extension of Q by A. Plenty of well-known quandles are abelian extensions of smaller quandles (see [6] for details). All results which are faithfull for non-abelian extensions of quandles are also correct for abelian extensions of quandles. In particular, Theorem 7.3 emplies the following result Corollary 7.5. Let Q be a quandle, A be an abelian group and µ : Q × Q →   A be a quandle 2-cocycle. Then there is an embedding Aut(Q) × Aut(A) µ ֒→ Aut E(Q, A, µ) . AUTOMORPHISM GROUPS OF QUANDLES AND RELATED GROUPS 15 8. Quasi-inner automorphisms Recall that an automorphism ϕ of a group G is called quasi-inner if for any element g ∈ G there exists an element h ∈ G such that ϕ(g) = h−1 gh. Since the conjugation by the element h defines the inner automorphism b h of the group G, then ϕ is quasi-inner automorphism if for every element g ∈ G there exists an inner automorphism b h of G such that ϕ(g) = b h(g). Every inner automorphism of G is obviously quasi-inner. In 1913, Burnside formulated the following question: Is it true that any quasi-inner automorphism of a group is inner? Burnside [4] answered this question negatively by constructing an example of a finite group which has a quasi-inner automorphism which is not inner. For quandles we can formulate two different definitions of a quasi-inner automorphism: (1) An automorphism ϕ of a quandle Q is called a quasi-inner automorphism in a strong sense if for every element x ∈ Q there exists an element y ∈ Q such that ϕ(x) = x ∗ y. (2) An automorphism ϕ of a quandle Q is called a quasi-inner automorphism in a weak sense if for every element x ∈ Q there exists an inner automorphism S ∈ Inn(Q) such that ϕ(x) = S(x). Every quasi-inner automorphism in a strong sense is obviously quasi-inner in a weak sense. However, in the general case the opposite is not correct since the group of inner automorphisms Inn(Q) = hSx | x ∈ Qi does not have to coincide with the set {Sx | x ∈ Q}. If Q is a conjugation quandle Conj(G) for some group G, then the two definitions of a quasi-inner automorphism are the same. If G is a 2-step nilpotent group, then the two definitions of a quasi-inner automorphism are equivalent also for quandles Conjn (G) for any n. Denote by QInn(Q) the set of all quasi-inner in a weak sense automorphisms of a quandle Q. The set QInn(Q) is obviously a subgroup of Aut(Q) which contains the group of inner automorphisms Inn(Q). If Q is the trivial quandle, then both groups Inn(Q), QInn(Q) are trivial. The following question is an analogue of Burnside’s problem for quandles. Question 8.1. Does there exist a quandle Q with Inn(Q) 6= QInn(Q)? If G is a group with non-inner quasi-inner automorphism ϕ constructed by Burnside, then the quandle Q = Conj(G) has non-inner quasi-inner in a strong sense automorphism induced by the automorphism ϕ, what gives a negative answer to Question 8.1. We are going to construct a simpler example of the quandle which is not a conjugation quandle and which possesses a non-inner quasiinner automorphism. Lemma 8.2. If Q is a connected quandle, then Aut(Q) = QInn(Q). Proof. Let φ be an automorphism of Q. Since Q is connected, for an element φ(x) ∈ Q there exists an inner automorphism S ∈ Inn(Q) such that φ(x) = S(x). Therefore Aut(Q) = QInn(Q).  Proposition 8.3. If n ≥ 5 is odd, then Inn(Rn ) 6= QInn(Rn ). Proof. By Theorem 5.2 for odd n the group Aut(Rn ) is isomorphic to the group Zn ⋊ Z∗n , where Z∗n is the multiplicative group of the ring Zn . Also by Theorem 5.2 for odd n the group Inn(Rn ) is isomorphic to the group Zn ⋊ Z2 . Therefore for odd n ≥ 5 the groups Inn(Rn ) and Aut(Rn ) do not coincide. Since for odd n the dihedral quandle Rn is connected, by Lemma 8.2 we have 16 VALERIY G. BARDAKOV, TIMUR R. NASYBULLOV, AND MAHENDER SINGH QInn(Rn ) = Aut(Rn ) 6= Inn(Q), i. e. there exists a quasi-inner automorphism of Rn which is not inner.  Remark 8.4. By Proposition 5.6 the group Aut(R4 ) is isomorphic to Inn(R4 ) ⋊ hφi, where φ is a non-inner automorphism of R4 . Direct calculations show that φ is not a quasi-inner automorphism, therefore Inn(R4 ) = QInn(R4 ). It would be interesting to explore whether a similar result holds for R2n for n > 2. 9. Constructions of new quandles using automorphisms In this section we describe some general approaches of constructing quandles using automorphism groups. If G is a group, then a map φ : G → Aut(G) is said to be compatible if for every element x ∈ G the following diagram commutes G φ // Aut(G) ιφ(x) φ(x)  G φ  // Aut(G), where ιφ(x) denotes the inner automorphism of Aut(G) of the form ιφ(x) : ϕ 7→ φ(x)ϕφ(x)−1 for all ϕ from Aut(G). For example, the map φ : x 7→ idG and the map φ : x 7→ x̂−1 which maps every element x to the inner automorphism x̂−1 : y 7→ xyx−1 induced by x−1 are both compatible. Proposition 9.1. Let G be a group and φ : G → Aut(G) be a compatible map such that φ(x)(x) = x for all x ∈ G. Then the set G with the operation x ∗ y = φ(y)(x) is a quandle. Moreover, if φ is an injective map which satisfies φ(xy) = φ(y)φ(x) for all x, y ∈ G, then x ∗ y = yxy −1 . Proof. We need to check three axioms of a quandle. The equality x ∗ x = φ(x)(x) = x for all x ∈ G is given as the condition of the proposition, therefore the first quandle axiom is faithful. For an element x the map Sx : y 7→ y ∗ x = φ(x)(y) is an automorphism of G and therefore is a bijection, i. e. the second quandle axiom is faithful. Since φ is a compatible map, for elements y, z ∈ G we have φ(z)φ(y) = φ (φ(z)(y)) φ(z) and therefore (x ∗ y) ∗ z = φ(z)(x ∗ y) = φ(z)φ(y)(x) = = φ(φ(z)(y))φ(z)(x) = φ(z)(x) ∗ φ(z)(y) = (x ∗ z) ∗ (y ∗ z), i. e. the third quandle axiom is faithful and the set G with the operation x ∗ y = ϕ(y)(x) is a quandle. If φ is a compatible map which satisfies the equality φ(xy) = φ(y)φ(x) for all x, y ∈ G, then φ(x)φ(y) = φ (φ(x)(y)) φ(x), therefore φ (φ(x)(y)) = φ(xyx−1 ) and if φ is injective, then y ∗ x = φ(x)(y) = xyx−1 .  For the compatible map φ : G → Aut(G) of the form x 7→ idG the quandle constructed in Proposition 9.1 is trivial. While for the compatible map φ : G → Aut(G) which maps an element x to the inner automorphism x̂−1 the quandle constructed in Proposition 9.1 is a quandle Conj−1 (G). The following proposition gives another interesting construction of a quandle. AUTOMORPHISM GROUPS OF QUANDLES AND RELATED GROUPS 17 Proposition 9.2. Let (Q1 , ∗) and (Q2 , ◦) be two quandles and let σ : Q1 → Conj−1 (Aut(Q2 )) and τ : Q2 → Conj−1 (Aut(Q1 )) be two homomorphisms. Then the set Q = Q1 ⊔ Q2 with the operation  x ∗ y, x, y ∈ Q1 ,    x ◦ y, x, y ∈ Q2 , x⋆y =  τ (y)(x), x ∈ Q1 , y ∈ Q2 ,    σ(y)(x) x ∈ Q2 , y ∈ Q1 . is a quandle if and only if the following conditions hold: (1) τ (z)(x) ∗ y = τ (σ(y)(z)) (x ∗ y) for x, y ∈ Q1 and z ∈ Q2 , (2) σ(z)(x) ◦ y = σ (τ (y)(z)) (x ◦ y) for x, y ∈ Q2 and z ∈ Q1 . Proof. We need to check three quandle axioms. For x ∈ Q the element x ⋆ x is equal to either x ∗ x or x ◦ x and is equal to x, therefore the first quandle axiom is faithful. For an element x ∈ Q1 the map Sx : y 7→ y ⋆ x acts as the map y 7→ y ∗ x on Q1 and as the map σ(x) : y 7→ σ(x)(y) on Q2 . Therefore for x ∈ Q1 the map Sx is a bijection on Q. Analogically, for x ∈ Q2 the map Sx is a bijection on Q and the second quandle axiom is faithful. Let x, y, z be elements from Q. If all elements x, y, z belong to Qi , then the third quandle axiom obviously works for elements x, y, z since it works in Qi . So, let x, y ∈ Q1 and z ∈ Q2 . In this case using equality (1) we have the equalities (x ⋆ y) ⋆ z = τ (z)(x ∗ y) = τ (z)(x) ∗ τ (z)(y) = (x ⋆ z) ⋆ (y ⋆ z), (z ⋆ x) ⋆ y = σ(x)(z) ⋆ y = σ(y)σ(x)(z) = σ(y)σ(x)σ(y)−1 (σ(y)(z))  = σ(x ∗ y) σ(y)(z) = σ(y)(z) ⋆ (x ⋆ y) = (z ⋆ y) ⋆ (x ⋆ y),  (x ⋆ z) ⋆ y = τ (z)(x) ∗ y = τ σ(y)(z) (x ∗ y) = (x ∗ y) ⋆ σ(y)(z) = (x ⋆ y) ⋆ (z ⋆ y), i. e. the third quandle axiom is faithfull for x, y ∈ Q1 and z ∈ Q2 . Similarly, using equality (2) we obtain the third quandle axiom for x, y ∈ Q2 and z ∈ Q1 .  For the trivial maps σ : Q1 → {idQ2 } and τ : Q2 → {idQ1 } the required conditions (1) and (2) of Proposition 9.2 are faithful. So, for quandles Q1 and Q2 we can always define a quandle structure on Q1 ⊔ Q2 . As an another example, let Q be an involutary quandle, i. e. a quandle where the equality (x ∗ y) ∗ y = x holds for all x, y ∈ Q, and let both quandles Q1 , Q2 be isomorphic to Q with isomorphisms ϕ : Q → Q1 and ψ : Q → Q2 . Using direct calculations it is easy to check that the maps σ : ϕ(x) 7→ Sψ(x) and τ : ψ(x) 7→ Sϕ(x) satisfy conditions (1) and (2) of Proposition 9.2 and therefore we can define a quandle structure on Q ⊔ Q for every involutary quandle Q (in particular, for every core quandle Core(G) of a group G). The quandle Q = hx, y, z | x ∗ y = z, x ∗ z = x, z ∗ x = z, z ∗ y = x, y ∗ x = y, y ∗ z = yi which we mentioned in Section 3 as a quandle for which the map Q → GQ is not injective, is obtained from two trivial quandles Q1 = {x, z}, Q2 = {y} using the procedure from Proposition 9.2, where the homomorphisms σ maps x and z to idQ2 , and the homomorphism τ maps y to the automorphism of Q1 which permute x and z. 18 VALERIY G. BARDAKOV, TIMUR R. NASYBULLOV, AND MAHENDER SINGH References [1] A. Björner, F. Brenti, Combinatorics of Coxeter groups, Graduate Texts in Mathematics, V. 231, Springer, New York, 2005. [2] N. Andruskiewitsch, M. Grana, From racks to pointed Hopf algebras, Adv. in Math., V. 178, N. 2, 2003, 177–243. [3] V. Bardakov, P. Dey, M. Singh, Automorphism groups of quandles arising from groups, Monatsh. Math., DOI 10.1007/s00605-016-0994-x. [4] W. Burnside, On the outer isomorphisms of a group, Proc. London Math. Soc., S2-11, N. 1, 1913, 40–42. [5] J. Carter, A survey of quandle ideas, Introductory lectures on knot theory, Ser. Knots Everything, World Sci. Publ., Hackensack, NJ, V. 46, 2012, 22–53, [6] J. Carter, M. Elhamdadi, M. Nikiforou, M. Saito, Extensions of quandles and cocycle knot invariants, J. Knot Theory Ramifications, V. 12, N. 6, 2003, 725–738. [7] J. Carter, M. Elhamdadi, M. Saito, Twisted quandle homology theory and cocycle knot invariants, Algebr. Geom. Topol, V. 2, 2002, 95–135. [8] J. Carter, S. Kamada, M. Saito, Diagrammatic computations for quandles and cocycle knot invariants, Diagrammatic morphisms and applications (San Francisco, CA, 2000), Contemp. Math., Amer. Math. Soc., Providence, RI, V. 318, 2003, 51–74. [9] W. Clark, M. Elhamdadi, M. Saito, T. Yeatman, Quandle colorings of knots and applications, J. Knot Theory Ramifications, V. 23, N. 6, 2014, 1450035. [10] W. Clark, M. Saito, Algebraic properties of quandle extensions and values of cocycle knot invariants, J. Knot Theory Ramifications, V. 25, N. 14, 2016, 1650080. [11] R. Fox, A quick trip through knot theory, Topology of 3-Manifolds, Prentice-Hall, 1962, 120–167. [12] A. Garcia Iglesias, L. Vendramin, An explicit description of the second cohomology group of a quandle, Math. Z., DOI 10.1007/s00209-016-1794-7 [13] E. Gorin, V. Lin, Algebraic equations with continuous coefficients and some problems of the algebraic theory of braids, Math. USSR-Sb., V. 7, N. 4, 1969, 569–596. [14] A. Hulpke, D. Stanovský, P. Vojtěchovský, Connected quandles and transitive groups, J. Pure Appl. Algebra, V. 220, N. 2, 2016, 735–758. [15] D. Joyce, A classifying invariant of knots, the knot quandle, J. Pure Appl. Algebra V. 23, 1982, 37–65. [16] S. Kamada, Knot invariants derived from quandles and racks, Invariants of knots and 3-manifolds (Kyoto, 2001), Geom. Topol. Monogr., Geom. Topol. Publ., Coventry, V. 4, 2002. 103-117. [17] J. McCarron, Small homogeneous quandles, ISSAC 2012-Proceedings of the 37th International Symposium on Symbolic and Algebraic Computation, ACM, New York, 2012, 257–264. [18] S. Matveev, Distributive groupoids in knot theory (Russian), Mat. Sb. (N.S.), V. 119(161), N. 1(9), 1982, 78–88. [19] S. Nelson, The combinatorial revolution in knot theory, Notices Amer. Math. Soc., V. 58, 2011, 1553–1561. [20] T. Nosaka, Central extensions of groups and adjoint groups of quandles, ArXiv:Math/1505.03077. [21] J. Przytycki, 3-coloring and other elementary invariants of knots, Banach Center Publications, V. 42 Knot theory, 1998, 275–295. [22] D. Stanovský, A guide to self-distributive quasigroups, or Latin quandles, Quasigroups Related Systems, V. 23, N. 1, 2015, 91–128. [23] M. Takasaki, Abstraction of symmetric transformation, Tohoku Math. J., V. 49, 1942, 145–207. [24] H. Tamaru, Two-point homogeneous quandles with prime cardinality, J. Math. Soc. Japan, V. 65, N. 4, 2013, 1117–1134. Sobolev Institute of Mathematics, 4 Acad. Koptyug avenue, 630090, Novosibirsk, Russia, and Novosibirsk State University, 2 Pirogova Str., 630090, Novosibirsk, Russia. E-mail address: [email protected] AUTOMORPHISM GROUPS OF QUANDLES AND RELATED GROUPS 19 Katholieke Universiteit Leuven KULAK, 53 E. Sabbelaan, 8500, Kortrijk, Belgium. E-mail address: [email protected] Department of mathematical sciences, Indian Institute of Science Education and Research (IISER) Mohali, Sector 81, S. A. S. Nagar, P. O. Manauli, 140306, Punjab, India. E-mail address: [email protected]
4math.GR
Bouveyron, Latouche and Mattei Exact Dimensionality Selection for Bayesian PCA Charles Bouveyron [email protected] Laboratoire MAP5, UMR CNRS 8145 Université Paris Descartes & Sorbonne Paris Cité arXiv:1703.02834v1 [stat.ME] 8 Mar 2017 Pierre Latouche [email protected] Laboratoire SAMM, EA 4543 Université Paris 1 Panthéon-Sorbonne Pierre-Alexandre Mattei [email protected] Laboratoire MAP5, UMR CNRS 8145 Université Paris Descartes & Sorbonne Paris Cité Abstract We present a Bayesian model selection approach to estimate the intrinsic dimensionality of a high-dimensional dataset. To this end, we introduce a novel formulation of the probabilisitic principal component analysis model based on a normal-gamma prior distribution. In this context, we exhibit a closed-form expression of the marginal likelihood which allows to infer an optimal number of components. We also propose a heuristic based on the expected shape of the marginal likelihood curve in order to choose the hyperparameters. In nonasymptotic frameworks, we show on simulated data that this exact dimensionality selection approach is competitive with both Bayesian and frequentist state-of-the-art methods. Keywords: Dimensionality reduction, Marginal likelihood, Multivariate analysis, Model selection, Principal components. 1. Introduction The computer age is characterized by a surge of multivariate data, which is often difficult to explore or describe. A natural way to deal with such datasets is to reduce their dimensionality in a interpretable way, trying not to loose too much information. Accordingly, a wide range of dimension-reduction techniques have been developed over the years. Principal component analysis (PCA), perhaps the earliest of these techniques, remains today one of the most widely used (Jolliffe and Cadima, 2016). Introduced by Pearson (1901) and rediscovered by Hotelling (1933) in the beginning of the twentieth century, PCA has had indeed an ubiquitous role in statistical analysis since the introduction of electronic computation in the 1950s. Recent exemples include climate research (Hannachi et al., 2006), genome-wide expression studies (Ringnér, 2008), massive text mining (Zhang and El Ghaoui, 2011) and even deep learning (Chan et al., 2015). For a more exhaustive overview of past applications of PCA, we defer the reader to the monograph of Jolliffe (2002) or the recent review paper of Jolliffe and Cadima (2016). Specifically, PCA consists in a simple procedure: the practitioner orthogonally projects his multivariate data on a space spanned by the eigenvectors associated with the largest eigenvalues of the empirical covariance matrix. The dimension of the representation learnt in this way is simply the number of eigenvectors – called principal components (PCs) – kept for the projection. However, it may come as a surprise that in spite of the popularity of this method, no authoritative solution has been widely accepted for choosing how many 1 Exact Dimensionality Selection for Bayesian PCA PCs should be computed. Common practice is to choose this dimension by considering the eigenvalues scree of the sample covariance matrix. This ad-hoc technique, popularized by Cattell (1966), has been largely modified and perfected over the last fifty years (Jackson, 1993; Zhu and Ghodsi, 2006), and is often chosen when PCA is used as a building block within a larger algorithmic framework – see e.g. Bouveyron et al. (2007) for an example in cluster analysis or Evangelopoulos et al. (2012) in latent semantic analysis. However, more refined approaches have also been developed. Earlier works were based on hypothesis testing (Jolliffe, 2002, section 6.1.4). Cross-validation, suggested by Wold (1978) and developed over the years (Bro et al., 2008), is known to be effective in a wide variety of settings (Josse and Husson, 2012). Another fruitful line of work follows the seminal article of Tipping and Bishop (1999), who recast PCA as a simple inferential problem. Their model, called probabilistic PCA (PPCA), led to several model-based methods for dimensionality selection, both from frequentist (Ulfarsson and Solo, 2008; Bouveyron et al., 2011; Passemier et al., 2017) and Bayesian (Bishop, 1999; Minka, 2000; Hoyle, 2008) perspectives. Most of the aforementioned methods are based on asymptotic considerations. However, it was recently proven that, in an asymptotic framework, hard thresholding the eigenvalues surprisingly suffices to provide an optimal dimensionality (Gavish and Donoho, 2014). Thus, the path to more efficient schemes for finding the number of PCs goes through the study of non-asymptotic criteria, which have been overlooked in the past. A natural non-asymptotic answer is provided by exact Bayesian model selection, which was previously used at the price of computationally expensive Markov chain Monte Carlo (MCMC) sampling (Hoff, 2007). We present here a prior structure based on the PPCA model that allows us to exhibit a closed-form expression of the marginal likelihood, leading to an efficient algorithm that selects the number of PCs without any asymptotic assumption. Specifically, we rely on a normal prior distribution over the loading matrix and a gamma prior distribution over the noise variance. Imposing a simple constraint on the hyperparameters of the respective distributions, we show that this allows the data to marginally follow a generalized Laplace distribution, leading to an efficient closed-form computation of the marginal likelihood. We also propose a heuristic based on the expected shape of the marginal likelihood curve in order to choose hyperparameters. With simulated data, we demonstrate that our approach is competitive compared to state-of-the-art methods, especially in non asymptotic settings and with less observations than variables. This setting is at the core of many practical problems, such as genomics and chemometrics. In Section 2, we briefly review PPCA and present several dimensionality selection techniques based on this model. The new normal-gamma prior is presented in Section 3 together with a derivation of the closed-form expression of the marginal likelihood. A heuristic to choose hyperparameters is also presented. Numerical experiments are provided in Section 4. 2. Choosing the intrinsic dimension in probabilistic PCA Let us assume that a centered independent and identically distributed (i.i.d.) sample x1 , ..., xn ∈ Rp is observed that we aim at projecting onto a d-dimensional subspace while retaining as much variance as possible. All the observations are stored in the n × p matrix X = (x1 , ..., xn )T . 2 Bouveyron, Latouche and Mattei 2.1 Probabilistic PCA The PPCA model Md assumes that, for all i ∈ {1, ..., n}, each observation is driven by the following generative model xi = Wyi + εi , (1) where yi ∼ N (0, Id ) is a low-dimensional Gaussian latent vector, W is a p × d parameter matrix called the loading matrix and εi ∼ N (0, σ 2 Ip ) is a Gaussian noise term. This model is an instance of factor analysis and was first introduced by Lawley (1953). Tipping and Bishop (1999) then presented a thorough study of this model. In particular, expanding a result of Theobald (1975), they proved that this generative model is indeed equivalent to PCA in the sense that the principal components of X can be retrieved using the maximum likelihood (ML) estimator WML of W. More specifically, if A is the p × d matrix of ordered principal eigenvectors of XT X and if Λ is the d × d diagonal matrix with corresponding eigenvalues, we have WML = A(Λ − σ 2 Id )1/2 R, (2) where R is an arbitrary orthogonal matrix. Under this sound probabilistic framework, dimension selection can be recast as a model selection problem, for which standard techniques are available. We review a few important ones in the next subsection. 2.2 Model selection for PPCA The problem of finding an appropriate dimension can be seen as choosing a "best model" within a family of models (Md )d∈{1,...,p−1} . A first popular approach would be to use likelihood penalization, leading to the choice d∗ ∈ argmaxd∈{1,...,p−1} {log p(X|WML , σML , Md ) − pen(d)}, where pen is a penalty which grows with d. These methods include the popular Akaike information criterion (AIC, Akaike, 1974), the Bayesian information criterion (BIC, Schwarz, 1978), or other refined approaches (Bai and Ng, 2002). However, their merits are mainly asymptotic, and our main interest in this paper is to investigate non-asymptotic scenarios. While the penalty term is usually necessary to avoid selecting the largest model, under a constrained PPCA model, called isotropic PPCA, Bouveyron et al. (2011) proved that regular maximum likelihood was suprinsingly consistent. While the theoretical optimality of this method is also asymptotic, the fact that it directly maximizes a likelihood criterion which is not derived based on asymptotic considerations makes it of particular interest within the scope of this paper. Another interesting set of techniques non-asymtotic in essence is Bayesian model selection (Kass and Raftery, 1995). While BIC does not actually approximates the marginal likelihood in the case of PPCA because of violated regularity conditions (Drton and Plummer, 2017), a more refined approach was followed by Minka (2000) who derived a Laplace approximation of the marginal likelihood. This technique, albeit asymptotic, has been proven empirically efficient in several small-sample scenarios. 3 Exact Dimensionality Selection for Bayesian PCA Another interesting framework considered in the literature is the case where both n and p grow to infinity. Several consistent estimators have been proposed, both from a penalization point of view (Bai and Ng, 2002; Passemier et al., 2017), using Stein’s unbiased risk estimator (Ulfarsson and Solo, 2008) or in a Bayesian context (Hoyle, 2008). While these high-dimensional scenarios are of growing importance, they fall beyond the scope of this paper, which is focused on the non-asymptotic setting (with potentially fewer observations than variables), for which very few automatic dimension selection methods are available. 3. Exact dimensionality selection for PPCA under a normal-gamma prior In this section, we present a prior structure that leads to a closed-form expression for the marginal likelihood of PPCA. 3.1 The model We consider the regular PPCA model already defined in (1), ∀i ∈ {1, ..., n}, xi = Wyi + εi , where yi ∼ N (0, Id ), W is a p × d parameter matrix, and εi ∼ N (0, σ 2 Ip ). We rely on a Gaussian prior distribution over the loading matrix W and a gamma prior distribution over the noise variance σ 2 . Specifically, we use a gamma prior σ 2 ∼ Gamma(a, b) with hyperparameters a > 0 and b > 0 together with i.i.d. Gaussian priors wjk ∼ N (0, φ−1 ) for j ∈ {1, ..., p} and k ∈ {1, ..., d} with some precision hyperparameter φ > 0. Within the framework of Bayesian model uncertainty (Kass and Raftery, 1995), the posterior probabilities of models can be written as, for all d ∈ {1, ..., p}, p(Md |X, a, b, φ) ∝ p(X|a, b, φ, Md )p(Md ), (3) where p(X|a, b, φ, Md ) = Z Rd×p ×R+ p(X|W, σ, Md )p(W|φ)p(σ|a, b)dWdσ, is the marginal likelihood of the data. Note that this expression also involves model prior probabilities – in this paper, we will simply consider a uniform prior ∀d ∈ {1, ..., p}, p(Md ) ∝ 1. Computing the high-dimensional integral of the marginal likelihood usually comes at the price of various approximations (Bishop, 1999; Minka, 2000; Hoyle, 2008) or expensive sampling (Hoff, 2007). However, with our specific choice of priors, and imposing a constraint on their respective hyperparameters, we obtain a closed-form expression for the marginal likelihood. 4 Bouveyron, Latouche and Mattei Theorem 1 Let d ∈ {1, ..., p}. Under the normal-gamma prior with b = φ/2, the logmarginal likelihood of model Md is given by log p(X|a, φ, Md ) = n X i=1 log p(xi |a, φ, Md ) np np log(2π) − log(2φ−1 ) − n log Γ(a + d/2) (4) 2 2 √ n n X p d−p X φ||xi ||2 + (a + log( log Ka+(d−p)/2 ( φ||xi ||2 ), ) )+ 2 2 =− i=1 i=1 where Kν is the modified Bessel function of the second kind of order ν ∈ R. A detailed proof of this theorem is given in the next subsection. To the best of our knowledge, this result is the first computation of the marginal likelihood of a PPCA model. It is worth mentioning that, in a slightly different context, Ando (2009) also derived the marginal likelihood of a factor analysis model, with Student factors. Similarly, Bouveyron et al. (2016) derived the exact marginal likelihood of the noiseless PPCA model, in order to obtain sparse PCs. While Gaussian priors for the loading matrix have been extensively used in the past (Bishop, 1999; Archambeau and Bach, 2009; Bouveyron et al., 2016), it is worth noticing that the use of a gamma prior for a variance parameter is rather peculiar. Indeed, most Bayesian hierarchical models choose inverse-gamma priors for variances. This choice is often motivated by its conjugacy properties (see e.g. George and McCulloch, 1993, for a linear regression example or Murphy, 2007, in a wider setting). The derivation provided in the next subsection notably explains why this gamma prior over σ 2 actually arises naturally. 3.2 Derivation of the marginal likelihood We begin by shortly reviewing the generalized Laplace distribution, which will prove to be key within the PPCA framework. This distribution was introduced by Kotz et al. (2001, p. 257). For a more detailed overview, see Kozubowski et al. (2013). Definition 2 A random variable z ∈ Rp is said to have a multivariate generalized asymetric Laplace distribution with parameters s > 0, µ ∈ Rp and Σ ∈ Sp+ if its characteristic function is !s 1 . ∀u ∈ Rp , φGALp (Σ,µ,s) (u) = 1 + 12 uT Σu − iµT u When µ = 0, the generalized Laplace distribution is elliptically contoured and is referred to as the symmetric generalized Laplace distribution. The elementary properties of the generalized Laplace distribution are discussed by Kozubowski et al. (2013). We list the ones that we consider in the proof of Theorem 1. Proposition 3 If z ∼ GALp (Σ, µ, s), we have E(z) = sµ and Cov(z) = s(Σ + µµT ). Moreover, if Σ is positive definite, the density of z is given by   T −1 QΣ (x) s−p/2 2eµ Σ x p √ Ks−p/2 (QΣ (x)C(Σ, µ)) , (5) ∀x ∈ R , fz (x) = (2π)p/2 Γ(s) det Σ C(Σ, µ) 5 Exact Dimensionality Selection for Bayesian PCA where QΣ (x) = p √ xT Σ−1 x and C(Σ, µ) = 2 + µT Σ−1 µ. Proposition 4 Let s1 , s2 > 0, µ ∈ Rp and Σ ∈ Sp+ . If z1 ∼ GALp (Σ, µ, s1 ) and z2 ∼ GALp (Σ, µ, s2 ) are independant random variables, then z1 + z2 ∼ GALp (Σ, µ, s1 + s2 ). (6) This proposition is a directed consequence of the expression of the characteristic function of the generalized Laplace distribution. Another appealing property of the multivariate generalized Laplace distribution is that it can be interpreted as an infinite scale mixture of Gaussians with gamma mixing distribution (a property called Gauss-Laplace transmutation by Ding and Blitzstein, 2015). Proposition 5 (Generalized Gauss-Laplace transmutation) Let s > 0 and Σ ∈ Sp+ . If u ∼ Gamma(s, 1) and x ∼ N (0, Σ) is independent of u, we have √ ux ∼ GALp (Σ, 0, s). (7) For a proof of this result, see Kotz et al. (2001, chap. 6). To prove Theorem 1, we first study the marginal distribution of the signal term. Following Mattei (2017), we can state the following lemma. Lemma 6 Let W be a p × d random matrix with i.i.d. columns following a N (0, φ−1 Ip ) distribution, y ∼ N (0, Id ) be a Gaussian vector independent from W. We obtain Wy ∼ GALp (2φ−1 Ip , 0, d/2). (8) Proof For each k ∈ {1, ..., d} let wk be the k-th column of W, uk = yk2 and ξ k = yk wk . To prove the lemma, we demonstrate that ξ 1 , ..., ξ d follow a GAL distribution and use the decomposition d X ξk . Wy = k=1 Let k ∈ {1, ..., d}. Since y is standard Gaussian, uk = yk2 follows a χ2 (1) distribution, or equivalently a Gamma(1/2, 1/2) distribution. Therefore, uk /2 ∼ Gamma(1/2, 1). Moreover, √ d note that uk wk = |yk |wk = yk sign(yk )wk = yk wk since |yk | and sign(yk ) are independent d and sign(yk )wk = wk . Therefore, according to Proposition 5, we have r uk √ ξk = 2wk ∼ GALp (2φ−1 Ip , 0, 1/2). 2 Since ξ 1 , ..., ξ d are i.i.d. and following a GALp (2φ−1 Ip , 0, 1/2) distribution, we can use Proposition 4 to conclude that Wy = d X k=1 ξk ∼ GALp (2φ−1 Ip , 0, d/2). We now focus on the second term of (1) involving the noise vector. 6 Bouveyron, Latouche and Mattei Lemma 7 Let εi |σ 2 ∼ N (0, σ 2 Ip ) and σ 2 ∼ Gamma(a, b) then  εi ∼ GALp b−1 Ip , 0, a . Proof Again, the Gauss-Laplace transmutation is considered. Indeed, the noise can be written as √ εi = bσ 2 ei , where ei ∼ N (0, b−1 Ip ). Therefore, the Gauss-Laplace transmutation allows to conclude. Now that we have proved that both the signal and the noise term follow marginally a generalized Laplace distribution, we use Proposition 4 which ensures that, assuming b = φ/2, the sum of the two generalized Laplace random vectors is a generalized Laplace random vector: xi ∼ GALp (2φ−1 Ip , 0, a + d/2). (9) Using the expression of the density of the generalized Laplace distribution, we eventually end up with the closed-form expression of the marginal likelihood of Theorem 1. 3.3 Choosing hyperparameters To obtain a closed-form expression of the marginal likelihood, we have shown that it is sufficient to assume that b = φ/2. Two hyperparameters remain henceforth to be tuned: the shape parameter of the gamma prior a and the precision hyperparameter φ. We developed data-driven heuristics for this purpose. A first observation is that, when d grows, σ is expected to decay because the signal part of the model can be more expressive. This prior information can be distilled into the model by roughly centering the gamma priors on estimates of σ̂. More precisely, our heuristic is to choose a such that E(σ) ∝ σ̂ for each d. In order for φ to control the diffusiveness of both the loading matrix and the variance, we specifically made the choice a = σ̂ 2 /φ. In our experiments, we chose the ML estimator σ̂ = σML (which is the mean of the p − d smallest eigenvalues of the covariance matrix, see Tipping and Bishop, 1999) but more complex estimates may be considered (Passemier et al., 2017). Regarding the remaining parameter φ, we propose a heuristic based on the following statements which can be made regarding the problem of dimension selection: • overestimation of d should be preferred to underestimation since loosing some information is much more damageable than having a representation not parsimonious enough, • consequently, the marginal likelihood curve as a function of the dimension should have two distinct phases: a first one when "signal dimensions" are added (before the true value of d), and a second one, when "noise dimensions" are added. Thus, we built a simple heuristic criterion to judge the relevance of a choice of φ by the shape of the marginal likelihood curve. First, if the slope of the first part of the curve (before the maximum) is lower than the slope of the second part, this means that this choice leads to underestimation and is therefore discarded. Second, the criterion is equal to the discrete second derivative of the marginal likelihood curve evaluated at the maximum, in 7 Exact Dimensionality Selection for Bayesian PCA φ<<φ* φ=φ* φ>φ* φ>>φ* Log−evidence φ<φ* 0 10 20 30 40 Dimensionality 0 10 20 30 40 Dimensionality 0 10 20 30 40 0 Dimensionality 10 20 30 40 Dimensionality 0 10 20 30 40 Dimensionality Figure 1: Different shapes of the marginal likelihood curve for growing values of φ. φ∗ corresponds to the maximum of the heuristic criterion that we describe is Subsection 3.3. The true dimensionality is 20. order to select a hyperparameter leading to a strong distinction between the two phases. This criterion is eventually maximized over a grid of values of φ. This scheme for hyperparameter choice is illustrated in Fig. 1 using the simpler simulation scheme described in Subsection 4.2. 4. Numerical experiments In this section, we perform some numerical experiments in order to highlight the main features of the proposed approach and to compare it with state-of-the-art methods. 4.1 Simulation scheme To assess the performance of our algorithm (referred hereafter as ngPPCA or NG, for short), we consider the following simulation scheme in the following experiments. We follow the simulation setup proposed in Bouveyron et al. (2011) based on their isotropic PPCA model. We therefore simulate data sets following the isotropic PPCA model which assumes that the covariance matrix of X has only two different eigenvalues a and b (instead of d + 1 in the PPCA model). In this case, the signal-to-noise ratio (SNR hereafter) is simply defined by SNR = ad . p−d In our simulation, b is set up to 1 and a > 1, which will control the strength of the signa, varies to explore different signal-to-noise ratios. Then, an orthonormal p × p matrix Q is drawn uniformly at random. The data is eventually generated according to a centered Gaussian distribution with covariance matrix p−d times d times z }| { z }| { Q diag(a, ..., a, 1, ..., 1 )Q. T Finally, the number p of variables is fixed to 50 in all experiments and the number n of observations varies in the range {40, 50, 70, 100}. 8 Bouveyron, Latouche and Mattei 4.2 Introductory examples We first conduct two small simulations to illustrate the behavior of our algorithm and its difference with the Laplace approximation of Minka (2000). We consider two scenario: a simple case and a harder and more realistic one. Simple scenario We consider a setup with n = 100 and SNR = 20. In this simple scenario, we first illustrate our heuristic for hyperparameter tuning by displaying marginal likelihood curves for different values of φ (Fig. 1). The heuristic criterion allows to find the desired shape, leading to a correct dimensionality estimation. A GIF animation displaying all values of the criterion for a large grid of 200 values of φ is provided as a online material1 . On Fig. 2, we compare the results of our algorithm with the Laplace approximation of the marginal likelihood of Minka (2000). In this case, both methods recover the true dimensionality of the data and are very confident with their choice (the posterior probability of the true model is higher than 99% with both approaches). The two curves have a similar shape, in compliance with the expected shape, as detailed in Subsection 3.3. Challenging scenario We now consider a setup with n = 40 and SNR = 20. A GIF animation illustrating hyperparameter tuning is provided online2 . Again, our results are compared with the Laplace approximation (Fig. 3). Regarding our exact approach (left panel), the marginal likelihood curve has an extremely similar shape to the one of the first simulation. This shape is satisfactory, and the maximum of our heuristic criterion actually corresponds to the true dimensionality. Although it also finds the correct dimensionality, the Laplace approximation wrongfully prefers simpler models. More precisely, the top two models chosen by the Laplace approximation are M20 (with posterior probability 69.3%) and M19 (with posterior probability 30.7%). In contrast, our algorithm favors M20 (with posterior probability 86.7%) and M21 (with posterior probability 13.3%). By prefering overestimation over underestimation, the exact method appears less likely to destroy valuable information, which would be damaging in a dimensionality selection context. As a summary, those experiments confirm the expected behaviors of NG vs. Laplace approximation: in the first scenario (n = 100), the asymptotic assumption of the Laplace approximation is much more relevant than in the second setup (n = 40). Our method, which does not rely on such an assumption, is much less impacted by the reduction of the sample size. 4.3 Benchmark comparison with other dimension selection methods This section now focuses on the comparison of our methodology with other dimension selection methods. We here consider all possible scenarios with n ∈ {40, 50, 70, 100} and a SNR grid going from 1.5 to 30 (50 repetitions are made for each case). We compare the performance of our technique based on the normal-gamma prior (NG) with the following four competitors: • the Laplace approximation of Minka (2000) which is a benchmark Bayesian method for dimension selection, 1. http://pamattei.github.io/animationeasy.gif 2. http://pamattei.github.io/animationhard.gif 9 −27000 Laplace log−evidence Exact log−evidence (NG prior) Exact Dimensionality Selection for Bayesian PCA −30000 −33000 −16500 −17000 −17500 −36000 0 10 20 30 40 0 10 Dimensionality 20 30 40 Dimensionality NG (our methodology) Laplace (Minka, 2000) Figure 2: Exact log-evidence for ngPPCA (left) and the Laplace approximation of Minka (2000) (right) for the simpler simulation scenario (n = 100). Both curves have the desirable properties detailed is Subsection 3.3 and find the correct dimensionality d = 20. −6000 −8000 Laplace log−evidence Exact log−evidence (NG prior) −7000 −9000 −10000 −11000 −6100 −6200 −12000 0 10 20 30 0 Dimensionality 10 20 30 Dimensionality NG (our methodology) Laplace (Minka, 2000) Figure 3: Exact log-evidence for ngPPCA (left) and the Laplace approximation of Minka (2000) (right) for the more challenging simulation scenario (n = 40). While both methods select the correct dimensionality d = 20, the Laplace approximation prefers underestimation which is not a satisfactory behavior. Our exact computation gives a much more acceptable curve. 10 Bouveyron, Latouche and Mattei Fraction of correct answers 1.00 0.75 n=100 0.50 GCV Laplace ML 0.25 NG (ours) PL 0.00 10 20 30 Signal−to−noise ratio Fraction of correct answers 1.00 0.75 n=70 0.50 GCV Laplace ML 0.25 NG (ours) PL 0.00 10 20 30 Signal−to−noise ratio 1.00 n=50 Fraction of correct answers GCV Laplace 0.75 ML NG (ours) PL 0.50 0.25 0.00 10 20 30 Signal−to−noise ratio 1.00 n=40 Fraction of correct answers GCV Laplace 0.75 ML NG (ours) PL 0.50 0.25 0.00 10 20 30 Signal−to−noise ratio Figure 4: Percentage of correctly estimated dimensions for different sample sizes (averaged 50 replications for each case) of ngPPCA (NG) and its competitors for different signal-to-noise ratios. From top to bottom, the data sample sizes are respectively n = 100, 70, 50 and 40. 11 Exact Dimensionality Selection for Bayesian PCA • the generalized cross-validation approximation (GCV) of Josse and Husson (2012) which is known to give state of the art results in many scenarios (see the vast simulation study of Josse and Husson, 2012) • the profile likelihood approach (PL) of Zhu and Ghodsi (2006) which represents screebased techniques and has been very popular in several different contexts (Fogel et al., 2007; Evangelopoulos et al., 2012) • the ML approach of Bouveyron et al. (2011), which maximizes a non-asymptotic criterion (the likelihood). Notice that is specifically adapted to this simulation scheme and this advantage allow us to consider this technique a gold-standard for the simulated data. The performance metric that we chose is the percentage of correct answers given by each algorithm, which is a standard measure used in other simulations studies (see e.g. Minka, 2000; Hoyle, 2008; Ulfarsson and Solo, 2008). Results are presented in Fig. 4. One can first notice that all methods vastly outperform the profile likelihood (PL) approach, which seems not well-suited for small sample sizes. Second, generalized crossvalidation gives often satisfactory results, but fails to be competitive with model-based methods (ML, Laplace and NG) when the SNR is high. The ML approach has a good behavior, especially when n is very small, this is partly explained by the fact that it is designed for this very simulation setup. Finally, our approach (NG), which consistently outperforms the other Bayesian method (the Laplace approximation), is the only method that gives satisfactory results in all settings (high and low SNR, moderate and small n). 5. Conclusion PCA is more of a descriptive and exploratory tool than a model. Therefore, no unique dimension selection method should be uniquely preferred – sometimes, very relevant information may actually lie within the last PCs (Jolliffe, 2002, section 3.4). However, PCA’s ubiquity in the statistical world makes necessary the search for guidance procedures to help the practitioner choose the number of PCs. This need is even more critical when the data are scarce or particularly expensive. Our work, by deviating from usually adopted asymptotic settings, is a step in that direction. Regarding future work, our exact computation of model posterior probabilities may be used to perform Bayesian model averaging (Hoeting et al., 1999) in predictive contexts. Potential applications could involve principal component regression (Jolliffe, 2002, chap. 8), image denoising (Deledalle et al., 2011), or deep learning (Chan et al., 2015). As a concluding note, this work comes as an illustration that exactly computing the marginal likelihood is sometimes easier than expected. Although both recent asymptotic approximations (Drton and Plummer, 2017) and the MCMC arsenal (Friel and Wyse, 2012) are well-equipped to deal with marginal likelihoods, we argue, like Lin et al. (2009), that finding exact expressions is an important task that should not be deemed untractable too hastily. 12 Bouveyron, Latouche and Mattei Acknowledgement Part of this work was conducted while PAM was visiting University College Dublin, funded by the Fondation Sciences Mathématiques de Paris (FSMP). References H. Akaike. A new look at the statistical model identification. IEEE Transactions on Automatic Control, 19(6):716–723, 1974. T. Ando. Bayesian factor analysis with fat-tailed factors and its exact marginal likelihood. Journal of Multivariate Analysis, 100(8):1717–1726, 2009. C. Archambeau and F. Bach. Sparse probabilistic projections. In Advances in neural information processing systems, pages 73–80, 2009. J. Bai and S. Ng. Determining the number of factors in approximate factor models. Econometrica, 70(1):191–221, 2002. C. M. Bishop. Bayesian PCA. In Advances in Neural Information Processing Systems, pages 382–388, 1999. C. Bouveyron, S. Girard, and C. Schmid. High-dimensional data clustering. Computational Statistics & Data Analysis, 52(1):502–519, 2007. C. Bouveyron, G. Celeux, and S. Girard. Intrinsic dimension estimation by maximum likelihood in isotropic probabilistic PCA. Pattern Recognition Letters, 32(14):1706–1713, 2011. C. Bouveyron, P. Latouche, and P.-A. Mattei. Bayesian variable selection for globally sparse probabilistic PCA. Technical report, HAL-01310409, 2016. R. Bro, K. Kjeldahl, A. K. Smilde, and H. A. L. Kiers. Cross-validation of component models: a critical look at current methods. Analytical and bioanalytical chemistry, 390 (5):1241–1251, 2008. R. B. Cattell. The scree test for the number of factors. Multivariate behavioral research, 1 (2):245–276, 1966. T.-H. Chan, K. Jia, S. Gao, J. Lu, Z. Zeng, and Y. Ma. PCANet: A simple deep learning baseline for image classification? IEEE Transactions on Image Processing, 24(12):5017– 5032, 2015. C.-A. Deledalle, J. Salmon, and A. S. Dalalyan. Image denoising with patch based PCA: local versus global. In Proceedings of the British Machine Vision Conference, pages 25.1– 25.10, 2011. P. Ding and J. K. Blitzstein. Representation for the Gauss-Laplace transmutation. arXiv preprint arXiv:1510.08765, 2015. 13 Exact Dimensionality Selection for Bayesian PCA M. Drton and M. Plummer. A Bayesian information criterion for singular models. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 79(2):323–380, mar 2017. ISSN 13697412. N. Evangelopoulos, X. Zhang, and V. R. Prybutok. Latent semantic analysis: five methodological recommendations. European Journal of Information Systems, 21(1):70–86, 2012. P. Fogel, S. S. Young, D. M. Hawkins, and N. Ledirac. Inferential, robust non-negative matrix factorization analysis of microarray data. Bioinformatics, 23(1):44, 2007. N. Friel and J. Wyse. Estimating the evidence–a review. Statistica Neerlandica, 66(3): 288–308, 2012. √ M. Gavish and D. L. Donoho. The optimal hard threshold for singular values is 4/ 3. IEEE Transactions on Information Theory, 60(8):5040–5053, 2014. E. I. George and R. E. McCulloch. Variable selection via gibbs sampling. Journal of the American Statistical Association, 88(423):881–889, 1993. A. Hannachi, I. T. Jolliffe, D. B. Stephenson, and N. Trendafilov. In search of simple structures in climate: simplifying EOFs. International journal of climatology, 26(1):7–28, 2006. J. A. Hoeting, D. Madigan, A. E. Raftery, and C. T. Volinsky. Bayesian model averaging: a tutorial. Statistical Science, pages 382–401, 1999. P. D. Hoff. Model averaging and dimension selection for the singular value decomposition. Journal of the American Statistical Association, 102(478):674–685, 2007. H. Hotelling. Analysis of a complex of statistical variables into principal components. Journal of educational psychology, 24(6):417, 1933. David C Hoyle. Automatic PCA dimension selection for high dimensional data and small sample sizes. Journal of Machine Learning Research, 9(Dec):2733–2759, 2008. D. A. Jackson. Stopping rules in principal components analysis: a comparison of heuristical and statistical approaches. Ecology, 74(8):2204–2214, 1993. I. Jolliffe. Principal component analysis. Wiley Online Library, 2002. I. T. Jolliffe and J. Cadima. Principal component analysis: a review and recent developments. Philosophical Transactions of the Royal Society of London A: Mathematical, Physical and Engineering Sciences, 374(2065), 2016. J. Josse and F. Husson. Selecting the number of components in principal component analysis using cross-validation approximations. Computational Statistics & Data Analysis, 56(6): 1869–1879, 2012. R. E. Kass and A. E. Raftery. Bayes factors. Journal of the american statistical association, 90(430):773–795, 1995. 14 Bouveyron, Latouche and Mattei S. Kotz, T. Kozubowski, and K. Podgórski. The Laplace distribution and generalizations: a revisit with applications to communications, exonomics, engineering, and finance. Number 183. Springer Science & Business Media, 2001. T. Kozubowski, K. Podgórski, and I. Rychlik. Multivariate generalized laplace distribution and related random fields. Journal of Multivariate Analysis, 113:59–72, 2013. D. N. Lawley. A modified method of estimation in factor analysis and some large sample results. Proceedings of the Uppsala Symposium on Psychological Factor Analysis, Uppsala, Sweden, pages 35–42, 1953. S. Lin, B. Sturmfels, and Z. Xu. Marginal likelihood integrals for mixtures of independence models. Journal of Machine Learning Research, 10(Jul):1611–1631, 2009. P.-A. Mattei. Multiplying a Gaussian matrix by a Gaussian vector (and the Gauss-Laplace transmutation). arXiv preprint arXiv:1702.02815, 2017. T. P. Minka. Automatic choice of dimensionality for PCA. In Advances in Neural Information Processing Systems, volume 13, pages 598–604, 2000. K. P. Murphy. Conjugate Bayesian analysis of the Gaussian distribution. Technical report, 2007. D. Passemier, Z. Li, and J. Yao. On estimation of the noise variance in high dimensional probabilistic principal component analysis. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 79(1):51–67, jan 2017. ISSN 13697412. K. Pearson. On lines and planes of closest fit to systems of point in space. Philosophical Magazine, 2(11):559–572, 1901. M. Ringnér. What is principal component analysis? Nature biotechnology, 26(3):303–304, 2008. G. Schwarz. Estimating the dimension of a model. The Annals of Statistics, 6(2):461–464, 1978. C. M. Theobald. An inequality with application to multivariate analysis. Biometrika, 62 (2):461–466, 1975. ISSN 00063444. M. E. Tipping and C. M. Bishop. Probabilistic principal component analysis. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 61(3):611–622, 1999. M. O. Ulfarsson and V. Solo. Dimension estimation in noisy PCA with SURE and random matrix theory. IEEE Transactions on Signal Processing, 56(12):5804–5816, 2008. S. Wold. Cross-validatory estimation of the number of components in factor and principal components models. Technometrics, 20(4):397–405, 1978. Y. Zhang and L. El Ghaoui. Large-scale sparse principal component analysis with application to text data. In Advances in Neural Information Processing Systems, pages 532–539, 2011. 15 Exact Dimensionality Selection for Bayesian PCA M. Zhu and A. Ghodsi. Automatic dimensionality selection from the scree plot via the use of profile likelihood. Computational Statistics & Data Analysis, 51(2):918–930, 2006. 16
10math.ST
To cite this article: Sami El-Ferik, Hashim A. Hashim, and Frank L. Lewis. ”Neuro-adaptive distributed control with prescribed performance for the synchronization of unknown nonlinear networked systems.” IEEE Transactions on Systems, Man, and Cybernetics: Systems (2017). Please note that where the full-text provided is the Author Accepted Manuscript or Post-Print version this may differ from the final Published version. arXiv:1802.07253v1 [math.OC] 20 Feb 2018 To cite this publication, please use the final published version. Personal use of this material is permitted. Permission from the author(s) and/or copyright holder(s), must be obtained for all other uses, in any current or future media, including reprinting or republishing this material for advertising or promotional purposes. Date of Submission: June 2016. Date of Acceptance: May 2017. Please contact us and provide details if you believe this document breaches copyrights. We will remove access to the work immediately and investigate your claim. 2 Neuro-adaptive distributed control with prescribed performance for the synchronization of unknown nonlinear networked systems Sami El-Ferik, Hashim. A. Hashim∗ , and Frank L. Lewis Abstract—This paper proposes a neuro-adaptive distributive cooperative tracking control with prescribed performance function (PPF) for highly nonlinear multiagent systems. PPF allows error tracking from a predefined large set to be trapped into a predefined small set. The key idea is to transform the constrained system into unconstrained one through transformation of the output error. Agents’ dynamics are assumed to be completely unknown, and the controller is developed for strongly connected structured network. The proposed controller allows all agents to follow the trajectory of the leader node, while satisfying necessary dynamic requirements. The proposed approach guarantees uniform ultimate boundedness of the transformed error and the adaptive neural network weights. Simulations include two examples to validate the robustness and smoothness of the proposed controller against highly nonlinear heterogeneous networked system with time varying uncertain parameters and external disturbances. Index Terms—Prescribed performance, Transformed error, Multi-agents, Neuro-Adaptive, Distributed adaptive control, Consensus, Transient, Steady-state error. I. Introduction The coordination of animals in social groups such as ants foraging, birds swarming, fish schooling and so forth have attracted the attention of researchers to develop distributed collaborative control of multi-agents in engineering applications especially robotic systems. Collaborative work between agents empower the group to execute hard and large tasks whcih the individual agent cannot simply achieve on its own. For instance, they are capable of simplifying mission by dividing it in several complementary tasks, exchanging vital information that may save the group, increasing productivity, and in certain cases, imitating biological behaviors. Combining collaborative framework with autonomous vehicles could be beneficial in many applications such as surveillance, inspection, space explorations and in many other areas where the agents are Sami El-Ferik is with the Department of Systems Engineering, King Fahd University of Petroleum and Minerals, Dhahran, 31261 e-mail: [email protected] ∗ Corresponding author, H. A. Hashim is with the Department of Electrical and Computer Engineering, University of Western Ontario, Ontario, Canada e-mail: [email protected]. Frank L. Lewis is with the Research Institute, The University of Texas at Arlington, Texas 76118 email:[email protected] Manuscript received April 19, 2017; revised –, –. required to work in a distributed manner and communicate using a particular network configuration. Hence, agents, often called nodes, are customized to follow at least one or more leaders. The network formed by such nodes is called a communication graph, and the vertices of the graph comprise of the nodes while its edges represent the connections between nodes. A graph may be undirected, and in such a case, there is no difference between the two vertices associated with an edge. On the other hand, it may be directed from one vertex to another, which indicates the direction of information flow between each of the nodes and its respective neighbors. In the literature, [1] is one of the pioneer work that addressed the consensus in multi-agent systems. Consensus for passive nonlinear systems has been studied in [2], and node consensus of cooperative tracking problem has been investigated in many research work such as [3], [4], [5] and [6]. Cooperative tracking control was studied for a single node in [7] and [8] and in for high order dynamics in [6]. Neural-Network-based robust adaptive control has been addressed in [9] to solve the consensus problem of multiagent systems connecting by an undirected graph type network topology. In [10], The same problem has been addressed but in the case of a network having a directed graph communication topology. also unlike [10], the control in [9] cannot solve the leader-following problem in case the leader possesses a time-varying state trajectory. [7] and [6] developed a neuro-adaptive distributed control for digraph-connected heterogeneous agents having unknown nonlinear dynamics. In [7], the authors considered nodes with single integrator and later on, in [6], high order systems have been addressed. Although, ,most of the previous studies assumed that the input function of the node dynamics is known. However, cooperative tracking control problems of systems with unknown input function were studied in [11] and [12]. Neuro-adaptive fuzzy was proposed to approximate unknown nonlinear dynamics and input functions, of which the centers of output membership functions were determined based on off-line trials [11]. One common ground shared by these studies is that they all considered both the unknown nonlinear dynamics and the input function to be linear in parameters (LIP); see [12], [13] for typical instances and [14] for pulse-modulated intermittent control. Ultimate stability of the tracking error was the main concern in all these studies. To cite this article: Sami El-Ferik, Hashim A. Hashim, and Frank L. Lewis. ”Neuro-adaptive distributed control with prescribed performance for the synchronization of unknown nonlinear networked systems.” IEEE Transactions on Systems, Man, and Cybernetics: Systems (2017). Model uncertainties and external disturbances affect considerably the closed loop performance of the controlled agents. In particular, the error is proven to be ultimately bounded and converge within a residual set having a size that depends on some unknown but bounded terms representing the model uncertainties and the external disturbances. The prediction of the steady-state or transient error behavior becomes almost impossible to establish analytically [15] and [16]. Prescribed performance simply means that the tracking error is confined within an arbitrarily small residual set, and the convergence error should be within a given range. In addition, the convergence rate has to be less than a prescribed value and they should be less than a prescribed constant. Prescribed performance with robust adaptive control was mainly developed to provide a smooth control input signal, soft tracking, and to address the problem of accurate computation of the upper bounds for systematic convergence. In summary, adaptive prescribed performance-based control ensures convergence of the error within a prescribed bound, an overshot less than a prescribed value, a uniform ultimate boundedness property for the transformed output error, and a smooth adaptive tracking. Developing cooperative adaptive control for multi-agent systems based on prescribed performance will yield many merits. Prescribed performance means secluding the system tracking output error to start within large set and convert systematically into an arbitrarily small set with predefined range [15] and [16]. The error with prescribed performance should have a convergence rate less than a predefined value and the maximum overshoot or undershoot should not exceed a certain limit. Prescribed performance with cooperative adaptive control will have the ability to increase the robustness of the control and reduce the control effort. The proper computations of upper and lower bounds of the prescribed performance functions provide soft tracking error with systematic convergence. Robust adaptive control with PPF was proposed in [15] to develop controllers for feedback linearizable systems. Since then, many papers considering prescribed performance used linearly parametrized neural network to approximate the unknown nonlinearities and disturbances (see for instance [17], [18] , [19] , [20], [21], [22] and [23]). The neuro-approximation-based adaptive control was developed for some particular system structures such as strict-feedback systems [17], affine systems [24], high order nonlinear systems [25]. These papers with made various assumptions regarding the continuity of the input matrix. Using trial and error methods in defining neural weights, adaptive control with prescribed performance was proposed for MIMO uncertain chaotic systems using model reference adaptive control in [26]. Almost all of these studies considered a single autonomous systems. In this paper, we propose a decentralized neuroadaptive cooperative control for a fleet of autonomous systems linked through a communication digraph. The different synchronization errors between all these nodes are expected to have dynamic responses that satisfy predefined characteristics determined by the designer. The dynamics of each node is subject to model uncertainties and to unknown but bounded external disturbances. The control scheme is based on prescribed performance for the transient as well as the steady-state dynamic performance for each node’s synchronization error. To our knowledge, this has never been treated before. In this paper, the original prescribed performance scheme as proposed in [15] will be modified to take into considerations the interactions between nodes created through the consensus algorithm in the presence of random disturbances at each time instant. Hence, stable, non-oscillatory dynamics with bounded and smooth decentralized control inputs are guaranteed. The rest of the paper is organized as follows. In Section II, preliminaries of graph theory and prescribed performance bounds will be presented. The problem formulation and local error synchronizations in the sense of PPF are presented in Section III. In Section IV, we develop the control law formulation and we prove stability of the connected digraph. Section V includes simulation results which verify the robustness of the proposed control. Finally, we conclude and suggest future directions of research in Section VI. Notations: The following notations are used throughout the paper. |·| : absolute value of a real number; k·k : Euclidean norm of a vector; k · kF : Frobenius norm of a matrix; Tr{·} : trace of a matrix; σ (·) : set of singular values of a matrix, with the maximum singular value σ̄ and the minimum singular value σ; P > 0 : indicates that the matrix P is positive definite (P ≥ 0 positive semi-definite; In : identity matrix with n-dimension. 1 : unity vector [1, . . . , 1]> ∈ Rn where n is the required appropriate dimension. II. Preliminaries A. Basic graph theory A graph is denoted by G = (V, E ) with a nonempty finite set of nodes (or vertices) V = {V1 , V2 , . . . , Vn }, and a set of edges (or arcs) E ⊆ V × V. (Vi , Vj ) ∈ E if there is an edge from node i to node j. The topology of a weighted graph is often described by the adjacency matrix A = [aij ] ∈ RN ×N with weights aij > 0 if (Vj , Vi ) ∈ E: otherwise aij = 0. Throughout the paper, the topology is fixed, i.e. A is time-invariant, and the selfconnectivity element aii = 0. A graph can be directed or undirected. A directed graph is called diagraph. The weighted in-degree of a node PNi is defined as the sum of i-th row of A, i.e., di = j =1 aij . Define the diagonal in-degree matrix D = diag(d1 , . . . , dN ) ∈ RN ×N and the graph Laplacian matrix L = D − A. The set of neighbors of a node i is Ni = {j|(Vj × Vi ) ∈ E}. If node j is a neighbor of node i, then node i can get information from To cite this article: Sami El-Ferik, Hashim A. Hashim, and Frank L. Lewis. ”Neuro-adaptive distributed control with prescribed performance for the synchronization of unknown nonlinear networked systems.” IEEE Transactions on Systems, Man, and Cybernetics: Systems (2017). node j , but not necessarily vice versa. For undirected graph, neighborhood is a mutual relation. A direct path from node i to node j is a sequence of successive edges in the form {(Vi , Vk ), (Vk , Vl ), . . . , (Vm , Vj }. A diagraph has a spanning tree, if there is a node (called the root), such that there is a directed path from the root to every other node in the graph. A diagraph is strongly connected, if for any ordered pair of nodes [Vi , Vj ] with i 6= j, there is directed path from node i to node j [5]). III. Problem Formulation Consider the following nonlinear dynamics for the ith node ẋi = fi (xi ) + ui + wi (1) where the state node is xi ∈ R, the control signal node ui ∈ R and the unknown disturbance for each node is wi ∈ R. fi (xi ) ∈ R is the unknown nonlinear dynamics and assumed to be Lipschitz. If we assumed agent state is a vector where xi ∈ Rn , n > 1 then each of ui , fi (xi ) and wi ∈ Rn and further results will include Kronecker products. From (1), the global graph dynamics can be described by ẋ = f (x) + u + w (2) where x = [x1 , . . . , xN ]> ∈ RN , u = [u1 , . . . , uN ]> ∈ RN , w = [w1 , . . . , wN ]> ∈ RN and f (x) = [f1 (x1 ) , . . . , fN (xN )]> ∈ RN . The leader state x0 is defined by the desired synchronization trajectory and the leader nonlinear dynamics is described as ẋ0 = f0 (x0 , t) (3) where x0 ∈ R is leader node state and f0 (x0 , t) ∈ R is the nonlinear function of the leader. Defining the local neighborhood synchronization error function for node i as in [27], [28] X ei = aij (xi − xj ) + bi (xi − x0 ) (4) j∈Ni with pinning gains aij ≥ 0 and aij > 0 for agent i directed to the state of agent j, bi ≥ 0 and bi > 0 for at least one agent i is directed toward the leader state. From (4), the global error dynamics is described by e = − ( L + B ) ( x0 − x ) = ( L + B ) ( x − x0 ) = ( L + B ) e0 (5) with e = [e1 , . . . , eN ]> ∈ RN , x0 = 1x0 ∈ RN , L ∈ RN ×N , B ∈ RN ×N , B = diag{bi } and 1 = [1, . . . , 1]> ∈ RN . Notice that e0 = x0 − x. The proof of equation (5) can be found in [3]. Remark 1. The communication graph is considered strongly connected. Thus, if bi 6= 0 for at least one i, i = 1, . . . , N then (L + B ) is an irreducible diagonally dominant M-matrix and hence nonsingular [29]. Remark 2. (see [3]) If agent state is xi ∈ Rn and the leader state x0 ∈ Rn where n > 0, then e, x ∈ RnN and equation (5) will be e = ((L + B ) ⊗ IN ) (x − 1x0 ) (6) where ⊗ is the Kronecker product. The derivative error dynamics of (5) is ė = (L + B ) (f (x) + u + w − f (x0 , t)) (7) For strong connected graph, B 6= 0 and we have ||e0 || ≤ ||e|| σ (L + B ) (8) where σ (L + B ) is the minimum singular value of L + B. In the case of multi-agent systems, Equation (6) reflects the coupling that has been created through the synchronization between the different states of each agent. Thus, these interactions no longer guarantee that the error dynamics of each agent will be confined within the desired performance functions, just based on knowledge of the sign ei (0), i = 1, ...N . A. Prescribed performance function Prescribed performance function (PPF) has been defined as a time function tool of tracking error e (t) such that e (t) starts within a predefined large set and decays systematically to a predefined small set [15], [16] and [26]. PPF has been developed to provide smooth tracking response with sufficient range of control signal and it guarantees the transient and tracking performance with prescribed characteristics. A performance function ρ (t) is associated with the error component e (t) and is defined as a smooth function such that ρ (t) : R+ → R+ is a positive decreasing function lim ρ (t) = ρ∞ > 0. The PPF can be written as t→∞ ρi (t) = (ρi0 − ρi∞ ) exp (−`i t) + ρi∞ (9) where ρi0 , ρi∞ and `i are appropriately defined positive constants. In order to overcome the difficulty caused through the synchronization algorithm and achieve the desired prescribed performance, the following time varying constraints are proposed: − δi ρi (t) < ei (t) < ρi (t) , if ei (t) > 0 (10) − ρi (t) < ei (t) < δi ρi (t) , if ei (t) < 0 (11) for all t ≥ 0 and 0 ≤ δi ≤ 1, and i = 1, ..., N . Remark 3. The dynamic constraints (10) and (11) represent a modification of the ones in [15], [30] and [26]. In these papers, the constraints are conditioned on e(0) as follows − δρ (t) < e (t) < ρ (t) , if e(0) > 0 (12) − ρ (t) < e (t) < δρ (t) , if e(0) < 0 (13) Due to the interaction between agents’ dynamics such constraints will lead to instability. Figure 1 illustrates how the tracking error in the case of multi-agent systems may exceed the lower or upper bounds (plot in green color). Upon crossing this reference, the system becomes unstable To cite this article: Sami El-Ferik, Hashim A. Hashim, and Frank L. Lewis. ”Neuro-adaptive distributed control with prescribed performance for the synchronization of unknown nonlinear networked systems.” IEEE Transactions on Systems, Man, and Cybernetics: Systems (2017). under the original formulation (12) and (13). However, the switching based on ei (t) provides the necessary control to keep the system stable. Figure 1 shows the full idea of tracking error with prescribed performance as it transits from a large to a smaller set in accordance with equations (10) and (11). Figure 1 shows how the error is trapped systematically within large set to a predefined small set. Fig. 1. Graphical representation of tracking error with prescribed performance (a) Prescribed performance of (10); (b) Prescribed performance of (11). In order to transform the error of nonlinear system from the constraints in (10) and (11) to unconstrained, consider the following relation of transformed error given in [15]   ei ( t ) i = ψ (14) ρi ( t ) or equivalently, e i ( t ) = ρ i ( t ) S ( i ) (15) and the transformed error   −1 ei (t) i = S ρi ( t )  δ + ei (t) /ρi (t)   ln i , 1  δ̄i − ei (t) /ρi (t) = δ + ei (t) /ρi (t) 2   ln i , δ̄i − ei (t) /ρi (t) with δ̄i > δ i if ei (t) ≥ 0 with δ i > δ̄i if ei (t) < 0 (18) One can notice in the previous set of equations, δ i and δ̄i exchange values depending on the sign of ei (t). One should note that the highest value of both involves subtracting the absolute value of ei (t) /ρi (t) and the lowest involves the addition of the absolute value of ei (t) /ρi (t). Accordingly and recalling that ρi (t) > 0, equations (18) δ̄i > δ i can be rewritten as  δ + |ei (t) |/ρi (t)   ln i , if ei (t) ≥ 0  1 δ̄i − |ei (t) |/ρi (t) i = (19) δ + |ei (t) |/ρi (t) 2   −ln i , if ei (t) < 0 δ̄i − |ei (t) |/ρi (t) Thus, the transformed error in (14) can be expressed in more compact form with δ̄i > δ i as follows:   1 δ i + |ei (t) |/ρi (t) i = sign (ei (t) /ρi (t)) · ln (20) 2 δ̄i − |ei (t) |/ρi (t) And to attenuate the effect of chattering, the following form of the transformed error is proposed     1 ξei (t) δ i + |ei (t) |/ρi (t) i = √ erf · ln (21) ρi ( t ) 2 π δ̄i − |ei (t) |/ρi (t) Rξe 2 where S (·) is a smooth function and ψ (·) is its inverse for i = 1, 2, . . . , N . In addition, S (·) is selected such that the following properties are satisfied: where erf (ξe/ρ) = Property 1. 1) S (i ) is smooth and strictly increasing. 2) −δ i < S (i ) < δ̄i , if ei (t) ≥ 0 −δ̄i < S (i ) < δ i , if e) i (t) < 0 limi →−∞ S (i ) = −δ i 3) if ei (t) ≥ 0 limi →+∞ S (i ) = δ̄i ) limi →−∞ S (i ) = −δ̄i if ei (t) < 0 limi →+∞ S (i ) = δ i Remark 4. The primary role of ξ is to make erf (ξe) as close as possible to sign(e). Ideally ξ is selected as big as possible. For instance, |erf (ξe)| u 1 when | ρe | ≥ ∆ = 2ξ . Therefore, if ξ = 200 then |erf (e/ρ)| u 1 when |e/ρ| ≥ 0.01. However, while the error function derivative is smooth and bounded, the more one selects a high gain ξ, the more the risk of chattering. where δ i and δ̄i are known positive constants that have to be selected according to the following relations: S ( i ) =  δ̄ exp (i ) − δ i exp (−i )   i ,  exp (i ) + exp (−i )  δ̄i exp (i ) − δ i exp (−i )   , exp (i ) + exp (−i ) with δ̄i > δ i if ei (t) ≥ 0 with δ i > δ̄i if ei (t) < 0 (16) Now, consider the general form of the smooth function S ( i ) = δ̄i exp (i ) − δ i exp (−i ) exp (i ) + exp (−i ) (17) parameter. √2 π e−a da. ξ > 0 is a design 0 For simplification, let’s define x := x (t), e := e (t),  :=  (t) and ρ := ρ (t). Then, after algebraic manipulations, the derivative of transformed error when |e|/ρ ≥ ∆/ξ can be approximated by:    1 1 1 ei ρ̇i ˙i = + ėi − (22) 2ρi δ i + |ei |/ρi ρi δ̄i − |ei |/ρi Remark 5. As mentioned earlier, the selection of the high gain ξ can make the absolute value of the error function converge to 1 for a very small ratio |e (t) |/ρ = ∆/ρ. In our analysis, we will use (22) to show that the control will generate a UUB error dynamic that will converge to a ball around zero with a radius that can be made as small as desired depending on the selection of ξ. Thus, the error may not converge to zero. To cite this article: Sami El-Ferik, Hashim A. Hashim, and Frank L. Lewis. ”Neuro-adaptive distributed control with prescribed performance for the synchronization of unknown nonlinear networked systems.” IEEE Transactions on Systems, Man, and Cybernetics: Systems (2017). Let 1 ri = 2ρi  1 1 + δ i + |ei |/ρi δ̄i − |ei |/ρi  (23) From (7) and (22), the global synchronization of the transformed error can be obtained as ˙ = R (L + B ) (f (x) + u + w − f (x0 , t)) − Υ̇ Υ −1 e (t) (24) where the control at the level of each node is of the form ui = −ci + ν; the value of ν will be clarified later in the paper, and it represents the necessary control actions to tackle the uncertainties and the Neural-Network approximation errors (see 37);  = [1 , . . . , N ]> ∈ RN , Υ = diag [ρi (t)] and Υ̇ = diag [ρ˙i (t)], i = 1, . . . , N ; R is such that R = diag [r1 (t) , . . . , rN (t)] with R > 0 and Ṙ < 0; Υ̇ Υ −1 < 0 with limt→∞ Υ̇ Υ −1 = 0. It should be noted that δ̄i and δ i define the dynamic boundaries of the initial (large) and final (small) set and they have a significant impact on the control effort up to small error tracking which is bounded by ρi∞ . Higher values of δ̄i and δ i require more time for the systematic convergence from large to small set. Whereas, the impact of `i and ξ can be noticed on the speed of convergence from large to small sets that implies values of `i and ξ have a direct impact on the range of control signal. Before proceeding further, the following definitions are needed (see [7]). Definition 1. The global neighborhood error e (t) ∈ RN is uniformly ultimately bounded (UUB) if there exists a compact set Ω ⊂ RN so that ∀e (t0 ) ∈ Ω there exists a bound B and a time tf (B, e (t0 )), both independent of t0 ≥ 0, such that ke (t)k ≤ B so that ∀t > t0 + tf . Definition 2. The control node trajectory x0 (t) given by (1) is cooperative UUB with respect to solutions of node dynamics (3) if there exists a compact set Ω ⊂ RN so that ∀ (xi (t0 ) − x0 (t0 )) ∈ Ω, there exist a bound B and a time tf (B, (x (t0 ) − x0 (t0 ))), both independent of t0 ≥ 0, such that kx (t0 ) − x0 (t0 )k ≤ B, ∀i, ∀t > t0 + tf . IV. Neuro Adaptive Distributed Control with Prescribed Performance This section presents the neural approximation of unknown nonlinearities and model uncertainties of a group of heterogeneous agents. The distributed control design is formulated for each local node to satisfy pre-defined prescribed characteristics. A. Neural Approximations The unknown nonlinearities of local agents in (1) can be approximated by fi (xi ) = Wi> φi (xi ) + αi (25) with φi (xi ) ∈ Rvi where vi is a sufficient number of neurons at each node, Wi ∈ Rvi and αi is the approximated error. According to [13], [31], the neural network can be approximated by a variety of sets including radial basis functions with centers and widths [32], sigmoid functions [33], etc. Tracking the local performance of each node will be attained through the compensation of unknown nonlinearities and using the available information of neighbor state agents. Therefore, the nonlinearities of local nodes can be approximated such as fˆi (xi ) = Ŵi> φi (xi ) (26) where Ŵi ∈ Rvi and fˆi (xi ) is the approximation of fi (xi ). One should mention a crucial and well known property of the NN structure adopted in (26) (for more details the reader is invited to see [13]). Property 2. For each continuous function fi : Rn −→ R and for every i > 0, there exist a bounded integer vi , and optimal synaptic weight vector Wi∗ ∈ Rvi , i = 1, . . . , N such that supx∈Ωx f (x) − Wi∗T φi (xi ) ≤ i where Ωx is a compact set. The global synchronization of f (x) for the graph G can be described as f (x) = W > φ (x) + α (27) W> with = diag{Wi }, i = 1, . . . , N , φ (x) = [φ1 (x1 ) , . . . , φN (xN )], α = [α1 , . . . , αN ] and the global estimate of f (x) fˆ (x) = Ŵ > φ (x) (28) and Ŵ > = diag{Ŵi }, i = 1, . . . , N . The error of estimating nonlinearities can be described by f˜ (x) = f (x) − fˆ (x) = W̃ > φ (x) + α (29) where W̃ = W − Ŵ is the parameter estimation error. Owing to property 2, there exist an unknown constant αM i > 0, such that |αi | ≤ αM i for i = 1, . . . , N . B. NN Adaptive Control Design of Distributed Agents As in [7], the following standard assumptions are required. Assumption 1. a. Leader states are bounded by kx0 k ≤ X0 . b. Leader unknown variable dynamics in (3) are bounded such as f (x0 , t) ≤ FM . c. Unknown disturbances are bounded by kwk ≤ wM . d. The variable φ in (27) and (28) is bounded by kφk ≤ φM . lemma 1. Let L be an irreducible matrix and B 6= 0 such as (L + B ) is nonsingular then we can define q = [q1 , . . . , qN ]> = (L + B )−1 · 1 (30) P = diag{pi } = diag{1/qi } (31) Then, P > 0 and the matrix Q defined as Q = P (L + B ) + (L + B )> P h i = P K (L + B ) + (L + B )> K P is also positive definite with K := P −1 . (32) To cite this article: Sami El-Ferik, Hashim A. Hashim, and Frank L. Lewis. ”Neuro-adaptive distributed control with prescribed performance for the synchronization of unknown nonlinear networked systems.” IEEE Transactions on Systems, Man, and Cybernetics: Systems (2017). The gist of the idea is that Q = K (L + B ) + (L + B )> K is diagonally strictly dominant and since it is a symmetric M-matrix, then it is positive definite. Based on this lemma, the following Preposition holds. Proposition 1. Let R a positive definite diagonal matrix, and L, B, P and K as defined in Lemma 1, then the matrix Q defined as Q = P R (L + B ) + (L + B )> R P (33) is positive definite. Proof: Since (L + B ) is is a nonsingular M-matrix and R > 0 is diagonal, then R (L + B ) is a non-singular M-Matrix. (L + B ) q = 1 > 0 (34) Let K = diag{qi } then R (L + B ) K1 = R (L + B ) q = R1 > 0 (35) which means strict diagonal dominance of R (L + B ) K. Q =P R (L + B ) + (L + B )> R P h i =P R (L + B ) K + K (L + B )> R P (36) h i R (L + B ) K + K (L + B )> R is symmetric and strictly diagonally dominant. Therefore, Q is positive definite. The control signal of local nodes is given by > ui = −ci − Ŵi φi (xi ) (37) with the control gain c > 0. Let the control signal for all nodes be u = −c − Ŵ > φ (x) (38) Let the NN local node tuning laws given by ˙ = F φ  r p (d + b ) − kF Ŵ Ŵ i i i i i i i i i i Theorem 1. Distributed Adaptive Control Protocol for Synchronization with Prescribed Performance. Consider the strong connected graph of the networked system in (1) under Assumption 1 with distributed adaptive control protocol (37) and neighborhood synchronization errors given in (4). Let the adaptive estimate be defined as in (39) and the local node NN tuning laws follow Fi = Πi Ivi and Πi > 0 and k > 0 are scalar gains. Each of c and k are defined to satisfy (40) and (41) cσ (Q) > c 2σ (Q) 1 φM σ̄ (P )σ̄ (A) 2 and from (24), the transformed error can be written as h i ˙ =R (L + B ) W̃ > φ (x) + α − c + w − f (x0 , t) (43) − R Υ̇ Υ −1 e Consider the following Lyapunov candidate function o 1 1 n (44) V = > P  + Tr W̃ > F −1 W̃ 2 2 where P is the positive and diagonal matrix defined in Lemma 1. F −1 is a block diagonal matrix defined in (39) with F := diag {Fi }. The derivative of (44) is n o 1 1 ˙ (45) V̇ = ˙> P  + > P ˙ + Tr W̃ > F −1 W̃ 2 2 Let P1 := P R = R P , such that Q in (36) is Q = P1 (L + B ) + (L + B )> P1 . One can write 1 V̇ ≤ − c > Q  + > P1 (L + B ) (α + w − f (x0 , t)) 2 n o ˙ + > P1 (L + B ) W̃ > φ (x) + Tr W̃ > F −1 W̃ − > P1 Υ̇ Υ −1 e (46) On the other hand e = Υ S (), which implies 1 > c Q  + > P1 (L + B ) (α + w − f (x0 , t)) 2 n o ˙ + > P1 (L + B ) W̃ > φ (x) + Tr W̃ > F −1 W̃ V̇ = − − > P1 Υ̇ S () (47) one should note that Λ := Λ (t) such that Λ = −P1 Υ̇ is a positive definite diagonal matrix for ∀t and lim Λ = 0 t→∞ (39) with Fi ∈ Rvi ×vi , Fi := Πi Ivi , Πi > 0 and k > 0 are scalar gains. k= Proof: In view of (38), the error function in (7) can be defined by   (42) ė = (L + B ) W̃ > φ (x) + α − c + w − f (x0 , t) 1 > c Q  + > P (L + B ) (α + w − f (x0 , t)) 2 n o ˙ + > P (L + B ) W̃ > φ (x) + Tr W̃ > F −1 W̃ V̇ ≤ − + > Λ δ (48) where δ̄ = max{δ̄1 , . . . , δ̄N }, equation (48) becomes 1 > c Q  + > P1 (L + B ) (α + w − f (x0 , t)) 2 n  o ˙ + φ ( x ) > P ( L + B ) + Tr W̃ > F −1 W̃ 1 V̇ ≤ − + > Λ δ̄ 1 (49) (40) 1 > c Q  + > P1 (L + B ) (α + w − f (x0 , t)) 2 n  o ˙ + φ ( x ) > P ( D + B ) + Tr W̃ > F −1 W̃ 1 n o − Tr W̃ > φ (x) > P1 A + > Λ δ̄ 1 (50) V̇ ≤ − (41) Therefore, the control node trajectory x0 (t) is cooperative UUB and all nodes synchronize close to x0 (t). To cite this article: Sami El-Ferik, Hashim A. Hashim, and Frank L. Lewis. ”Neuro-adaptive distributed control with prescribed performance for the synchronization of unknown nonlinear networked systems.” IEEE Transactions on Systems, Man, and Cybernetics: Systems (2017). Using the NN weight tuning law in (39) and since P and D + B are diagonal, one has 1 > c Q  + > P1 (L + B ) (α + w − f (x0 , t)) 2 n n o o + k Tr W̃ > W − W̃ − k Tr W̃ > φ (x) > P1 A V̇ ≤ − + > Λ δ̄ 1 also from (56), we have s 2V kzk ≤ , σ (S ) V̇ ≤ − z > H z + h> z (52) one can define V̇ ≤ 0 if and only if H is positive definite and khk kzk > (53) σ (H ) according to (44), we have 1 1 σ (P1 ) kk2 + W̃ 2 2Πmax 2 F 1 ≤ V ≤ σ̄ (P1 ) kk2 2 1 W̃ + 2Πmin 2 F (54) or     σ ( P1 ) 1 0 kk kk W̃ F ≤V 1 0 W̃ 2 Πmax   F   σ̄ (P1 ) 0 1 kk kk W̃ F ≤ 1 0 W̃ 2 Πmin F (55) 1 1 > z S z ≤ V ≤ z > S̄z 2 2 which is equivalent to 1 1 σ (S ) kzk2 ≤ V ≤ σ̄ (S̄ ) kzk2 2 2 hence, one can find the following relation V > 1 khk2 σ̄ (S̄ ) 2 2 σ (H ) (56) (57) selecting k as in (40) leads to cσ (Q) − 21 φM σ̄ (P )σ̄ 2 (A) (58) 2 which is positive under condition(39) and therefore z is UUB. Consequently, the sufficient conditions for (53) are σ (H ) = kk > W̃ F σ̄ (P1 ) (σ̄ (L + B ) BM ) + δ̄ σ̄ (Λ) + kWM σ (H ) > with β1 := (59) σ̄ (P1 ) (σ̄ (L + B ) BM ) + δ̄ σ̄ (Λ) + kWM (60) σ (H ) 2V σ̄ (S̄ ) (61) 2σ (H ) σ̄ (S̄ ) 2khk and β2 := √ which leads to σ (S ) using (56), one has s kk ≤ kzk ≤ (62) √ √ V ≤ σ̄ (S̄ ) σ (S ) q V (0) + β2 β1 q ||e (t0 ) ||2 + W̃ (t0 ) (63) 2 F (64) σ̄ (S̄ ) krk + ≡ B0 σ (S ) σ (H ) Therefore,  is L∞ and contained for all t > t0 in the compact set Ω0 = { (t) | k (t)k ≤ B0 }. These results hold under the assumption that x ∈ Ωx as per Property 2 for all t ≥ t0 ; and therefore, we need to establish that the proposed control law and the initial conditions do not force x to get out of the compact set Ωx . As such, the analysis follows [34] and [7] with slight modification. Let x0 ∈ Ωx0 . Suppose W̃ ∈ ΩW . Then (5) shows that √ 1 kx (t)k ≤ ke (t)k + N kx0 (t)k σ (L + B ) Owing to Property 1, kx (t)k ≤ with Πmin and Πmax are minimum and maximum values of Πi , respectively. Define the appropriate variables in (55) such that (55) is written as kzk ≥ consequently, equation (52) can be written as √ V̇ ≤ −β1 V + β2 V (51)  > W̃ F Let BM = αM + wM + FM , z = kk  > h = σ̄ (P1 ) (σ̄ (L + B ) BM ) + δ̄ σ̄ (Λ) kWM  1 c σ (Q) − 12 φM σ̄ (P1 ) σ̄ (L + B ) 2 H= − 12 φM σ̄ (P1 ) σ̄ (L + B ) k hence, (51) can be expressed as follows s √ 1 kS (rt0 )k + N kx0 (t)k ≡ B1 (65) σ (L + B ) The state is contained for all times t ≥ 0 in a compact set Ωx = {x (t) | kx (t)k ≤ B1 } and this completes the proof. It should be remarked that k and Πi are associated with nonlinearity compensation of adaptive estimate, c controls the speed of convergence to the desired tracking output and has to be selected to satisfy (40). Finally, the algorithm of nonlinear single node dynamics such as equation (1) can be summarized briefly as 1) Define the control design parameters such as δ̄i , δ i , ρi∞ , `i , ξ, Πi , k and c. 2) Evaluate local error synchronization from equation (4). 3) Evaluate the PPF from equation (9). 4) Evaluate ri from equation (23). 5) Evaluate transformed error from equation (21). 6) Evaluate control signal from equation (37). 7) Evaluate the neuro-adaptive estimate from equation (39). 8) Go to step 2. Remark 6. If we have xi ∈ Rn , n > 1, ui ∈ Rn , fi (xi ) ∈ Rn and wi ∈ Rn ,then the problem can be extended easily and the estimated weight will be written as ˙ = −F φ  r (p (d + b ) ⊗ I ) − kF Ŵ Ŵ n i i i i i i i i i i (66) To cite this article: Sami El-Ferik, Hashim A. Hashim, and Frank L. Lewis. ”Neuro-adaptive distributed control with prescribed performance for the synchronization of unknown nonlinear networked systems.” IEEE Transactions on Systems, Man, and Cybernetics: Systems (2017). V. Simulation Results 1 2 x & e2 2 Example 1: Consider the problem in [7] with strongly connected network composed of 5 nodes and one leader connected to node 3 as in Fig. 2. 0 x0 0.5 1 1.5 x4 2 3 0.5 1 6 1.5 1 (t) u4 2 e 1(t) 1 u5 & e5 2 5 0 -2 0 0.5 1 Time(sec) 1.5 2 0.5 (t) 1 6 4 2 0 -2 0 0.5 1 0 0.5 1 0 0.5 1 (t) e 3(t) (t) e 4(t) (t) 3 (t) 4 (t) 2 e 5(t) 1.5 (t) 2 1.5 5 2 2 1.5 4 2 0 -2 -4 -6 e 2(t) 1.5 3 2 0 -2 -4 -6 (t) 4 1 & e1 u3 & e4 u 0 u2 4 u1 2 0 x5 0 1 Agents x3 200 -200 5 x2 & e3 0 x1 2 0 -2 -4 -6 5 (t) 2 Time(sec) 4 2 Fig. 3. The output performance and control signal of example 1 using the transformed error in equation (14). 3 Leader 0 Fig. 2. Strongly connected graph with one leader and five agents [7]. The nonlinear dynamics of the graph are ẋ1 = x31 + u1 + a1 (t) cos (t) ẋ2 = x22 + u2 + a2 (t) cos (t) error and control signal response as illustrated on Fig. 5 and 4 respectively. Also, Fig. 4 compares the proposed neuro-adaptive distributed control with PPF and neuroadaptive distributed control without PPF [7]. With same design parameters, initial conditions and leader response x0 = 2cos(0.8t), the proposed algorithm illustrates high tracking performance with low control effort, whereas the control in [7] shows instability. ẋ3 = x43 + u3 + a3 (t) cos (t) ẋ4 = x4 + u4 + a4 (t) cos (t) ẋ5 = x55 + u5 + a5 (t) cos (t) where ai (t), i = 1, . . . , 5, represent random constants between 0 and 1 at each time instant and the leader dynamics is ẋ0 = f0 (x0 , t) = 0 with desired consensus value = 2. The following parameters were used in the simulation ρ∞ = 0.05 × 11×5 , ρ0 = 7 × 11×5 , ` = 7 × 11×5 , Πi = 150 Ivi ×vi , δ̄ = 7 × 11×5 , δ = 1 × 11×5 , vi = 3, c = 100, k = 0.8, ξ = 20, x0 = 2cos(0.8t) and xi (0) = [−2.5743, −0.9814, 1.2596, 1.1472, 2.5196]. Fig. 3 shows the output performance, control signal and transformed error respectively for the proposed control algorithm using the transformed error in (14) instead of that in (21). In all figures, x0 denotes the output response of the leader node, u0 denotes the control signal of the leader node and xi and ui are the output performance and control signal of the associated agent, respectively, for all i = 1, . . . , 5. Fig. 3 illustrates the quality of tracking and how it falls between the constraints of the PPF. Also, it can be noticed that the error obeys prescribed error boundaries as it started within large set and ended within small predefined set. However, the control input and transformed error are completely oscillatory. Now, the proposed neuro-adaptive distributed control with PPF has been improved to handle the problem of oscillation in control input and transformed error of Fig. 3 using the transformed error in (21). Fig. 4 and 5 present the output performance, control signal and transformed error respectively using the proposed control algorithm with the smooth error function, erf (), in the transformed error (21). The advantage of introducing such smooth function is reflected in the good tracking performance and with no oscillation in the behavior of transformed Fig. 4. The output performance and control signal of Example 1 of the neuro-adaptive control with PPF using the transformed error in equation (21) compared to the neuro-adaptive control in [7]. Fig. 5. Error and transformed error of neuro-adaptive control with PPF of Example 1 using the transformed error in equation (21). Example 2: Consider the same problem in Fig. 2 with 3 inputs and 3 outputs nonlinear systems. The nonlinear dynamics are defined by ẋ:,j = A x:,j + B u:,j + θj (t) x:,j + fj (x:,j ) + Dj (t) y:,j = C x:,j To cite this article: Sami El-Ferik, Hashim A. Hashim, and Frank L. Lewis. ”Neuro-adaptive distributed control with prescribed performance for the synchronization of unknown nonlinear networked systems.” IEEE Transactions on Systems, Man, and Cybernetics: Systems (2017). where 2 200 u11 u12 u21 u22 u31 u32 u13 u14 u15 u24 u25 u34 u35 y1  22 0 15 0  , B = I3×3 , C = I3×3 , 0 −3 u1 1 0 -1 x10 0 0.2 x11 x12 0.4 x13 0.6 x14 x15 0.8 0 -200 1 0 4 0.2 0.4 200 0.6 0.8 u23 1 0 u2 0 -2 x20 -4 0 0.2 x21 x22 0.4 x23 0.6 x24 -200 x25 0.8 1 0 4 0.2 0.4 200 0.6 0.8 u33 1 2 u3  a1,j x3,j x1,j + 0.2sin (x1,j a1,j ) fj (x:,j ) = −a2,j x1,j x3,j − 0.2a2,j cos (a2,j x3,j t) x1,j  , a3,j x1,j x2,j   1 + b1,j sin (b1,j t) , 1.2cos (b2,j t) Dj (t) =  sin (0.5b3,j t) + cos (b3,j t) − 1 y2 2 y3  −20 A= 0 0  0 0 x30 -2 0 0.2 x31 x32 0.4 x33 0.6 x34 -200 x35 0.8 1 0 0.2 Time(sec) 0.4 0.6 0.8 1 Time(sec) Fig. 6. Neuro-adaptive control with PPF output performance of Example 2 using the transformed error in equation (21).  1 θj ( t ) =  3c1,j sin (0.5t) 0.9sin (0.2c2,j t) , 0.5sin (0.13c3,j t)  2 θj ( t ) =  2c1,j sin (0.4c1,j t) cos (0.3t) 2.5sin (0.3c2,j t) + 0.3cos (t) , 0.6c3,j cos (0.15t) θj1 (t) θj2 (t) θj3 (t) 0.2 0.4 0.6 6 11 e 13 13 & e 12 12 11 -4 -6 11 0.8 1 13 13 4 2 0 12 0 -2  0 -2 & e 14 e 11 11 0 13 θj ( t ) =  -4 -6 & e 13 0.7sin (0.2c1,j t) 1.0sin (0.1c2,j t) , 1.5cos (0.7c3,j t) + 1.6c3,j sin (0.3t) 2 0 -2 14 3 θj ( t ) = & e 11 2   0.2 0.4 6 e 12 0.6 14 12 12 14 14 0.8 e 14 1 4 2 0 -2 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 Time(sec) 2 & e 15 0 -2 15 and -4 -6   1.5 0.5 0.7 1.3 0.7 a = 0.5 1.4 0.1 1.3 2.4 , 2.8 1.4 0.6 0.7 0.6   0.5 1.5 1.1 1.6 0.3 b = 0.7 1.2 1.3 0.5 0.3 , 1.1 1.4 1.6 0.6 1.0   1.5 2.5 0.5 1.7 0.7 c = 0.5 1.7 1.1 0.3 0.4 , 0.8 0.4 2.2 0.9 1.4 e 15 15 0 0.2 0.4 0.6 15 15 0.8 1 Time(sec) Fig. 7. Error and transformed error of output 1 of example 2 using the transformed error in equation (21). 2 -4 -6 0.2 0.4 0.6 21 -2 -4 -6 21 0.8 1 -6 23 0.1 0.2 0.3 0.4 0.5 0.6 e 23 0.7 & e 24 -4 -2 24 0 & e 23 2 0 23 2 -2 -4 0.9 0.2 0.4 0 0.2 0.4 -6 23 0.8 22 0 1 e 22 0.6 24 22 22 0.8 e 24 0.6 1 24 24 0.8 1 & e 25 Time(sec) 25 The leader dynamics is ẋ0 = f0 (x0 , t) = [0, 0, 0]> with initial conditions x0 (0) = [1.5, 2.7, 3.5]> equal to desired consensus and number of neurons vi = 6. The control parameters of the problem were defined as ρ∞ = 0.05 × 13×5 , ρ0 = 7 × 13×5 , ` = 7 × 13×5 , Πi = 150Ivi ×vi , δ̄ = 7 × 13×5 , δ = 1 × 13×5 , c = 100, k = 0.8, ξ = 50. Initial conditions of e 21 21 0 0 & e 22 & e 21 21 0 22 2 -2 6 25 e 25 25 25 4 2 0 -2 0 0.2 0.4 0.6 0.8 1 Time(sec) Fig. 8. Error and transformed error of output 2 of Example 2 using the transformed error in equation (21). x1 (0) = [0.8678, −0.5058, 1.5501]> 31 31 2 6 32 -2 0.2 0.4 0.6 0.8 1 0 & e 34 34 & e 33 0 33 32 -2 0 -4 32 2 0.2 0.4 0.6 2 -2 e 32 4 0 -6 33 0 0.2 0.4 34 1 34 34 4 2 0 e 33 0.6 6 0.8 e 34 33 33 0.8 -2 1 0 0.2 0.4 0.6 0.8 1 Time(sec) 2 & e 35 0 -2 35 The robustness of the proposed controller against time varying uncertain parameters, time varying external disturbances, and high nonlinearities are tested in this example. Fig. 6 shows the output performance and the control input of the proposed controller for this MIMO case. The tracking errors and their associated transforms are depicted in Fig. 7, 8 and 9. The control signal is smooth and the dynamic performance satisfy the prescribed dynamic constraints. e 31 & e 32 31 4 0 x4 (0) = [1.4068, −3.3671, 0.8756]> x5 (0) = [1.0541, 0.2989, −1.4818]> 6 32 31 x3 (0) = [2.1855, −2.5301, −1.3017] > & e 31 x2 (0) = [−0.7777, 0.3450, −2.5642]> -4 -6 35 0 0.2 0.4 0.6 e 35 35 0.8 35 1 Time(sec) Fig. 9. Error and transformed error of output 3 of Example 2 using the transformed error in equation (21). To cite this article: Sami El-Ferik, Hashim A. Hashim, and Frank L. Lewis. ”Neuro-adaptive distributed control with prescribed performance for the synchronization of unknown nonlinear networked systems.” IEEE Transactions on Systems, Man, and Cybernetics: Systems (2017). VI. Conclusion A distributed cooperative neuro-adaptive control has been proposed based on prescribed performance for multiagent systems. Neural network has been used to estimate system nonlinearities. The controller is developed for strongly connected network. The control signal is chosen properly to ensure graph stability as well as track the leader trajectory with an error subject to dynamic prescribed constraints. The controller successfully enables the agents to synchronize to the desired trajectory in a very short time with small residual error. Simulation examples have been presented by considering highly nonlinear heterogeneous systems with time varying parameters, uncertainties and disturbances. Only first order nonlinear systems have been considered. Higher order nonlinear systems will be considered in the future. Acknowledgment The author(s) would like to acknowledge the support provided by King Abdulaziz City for Science and Technology (KACST) through the Science and Technology Unit at King Fahd University of Petroleum and Minerals (KFUPM) for funding this work through project No. 09SPA783-04 as part of the National Science, Technology and Innovation Plan. References [1] J. A. Fax and R. M. Murray, “Information flow and cooperative control of vehicle formations,” IEEE Transactions on Automatic Control, vol. 49, no. 9, pp. 1465–1476, 2004. I [2] N. Chopra and M. W. Spong, “Passivity-based control of multiagent systems,” in Advances in robot control, pp. 107–134, Springer, 2006. I [3] F. L. Lewis, H. Zhang, K. Hengster-Movric, and A. Das, Cooperative control of multi-agent systems: optimal and adaptive design approaches. Springer Science & Business Media, 2013. I, III, 2 [4] R. Olfati-Saber, J. 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. I [5] W. Ren and R. W. Beard, Distributed consensus in multi-vehicle cooperative control. Springer, 2008. I, II-A [6] H. Zhang and F. L. Lewis, “Adaptive cooperative tracking control of higher-order nonlinear systems with unknown dynamics,” Automatica, vol. 48, no. 7, pp. 1432–1439, 2012. I [7] A. Das and F. L. Lewis, “Distributed adaptive control for synchronization of unknown nonlinear networked systems,” Automatica, vol. 46, no. 12, pp. 2014–2021, 2010. I, III-A, IV-B, IV-B, V, 2, V, 4 [8] Y. Cao and W. Ren, “Distributed coordinated tracking with reduced interaction via a variable structure approach,” IEEE Transactions on Automatic Control, vol. 57, no. 1, pp. 33–48, 2012. I [9] Z.-G. Hou, L. Cheng, and M. Tan, “Decentralized robust adaptive control for the multiagent system consensus problem using neural networks,” IEEE Transactions on Systems, Man, and Cybernetics, Part B: Cybernetics, vol. 39, no. 3, pp. 636–647, 2009. I [10] L. Cheng, Z.-G. Hou, M. Tan, Y. Lin, and W. Zhang, “Neuralnetwork-based adaptive leader-following control for multiagent systems with uncertainties,” IEEE Transactions on Neural Networks, vol. 21, no. 8, pp. 1351–1358, 2010. I [11] D. C. Theodoridis, Y. S. Boutalis, and M. A. Christodoulou, “Direct adaptive neuro-fuzzy trajectory tracking of uncertain nonlinear systems,” International Journal of Adaptive Control and Signal Processing, vol. 26, no. 7, pp. 660–688, 2012. I [12] S. El-Ferik, A. Qureshi, and F. L. Lewis, “Neuro-adaptive cooperative tracking control of unknown higher-order affine nonlinear systems,” Automatica, vol. 50, no. 3, pp. 798–808, 2014. I [13] F. W. Lewis, S. Jagannathan, and A. Yesildirak, Neural network control of robot manipulators and non-linear systems. CRC Press, 1998. I, IV-A, IV-A [14] Z.-W. Liu, X. Yu, Z.-H. Guan, B. Hu, and C. Li, “Pulsemodulated intermittent control in consensus of multiagent systems,” IEEE Transactions on Systems, Man, and Cybernetics: Systems, 2016. I [15] C. P. Bechlioulis and G. A. Rovithakis, “Robust adaptive control of feedback linearizable MIMO nonlinear systems with prescribed performance,” IEEE Transactions on Automatic Control, vol. 53, no. 9, pp. 2090–2099, 2008. I, III-A, 3, III-A [16] H. A. Hashim, S. El-Ferik, and F. L. Lewis, “Adaptive synchronisation of unknown nonlinear networked systems with prescribed performance,” vol. 48, pp. 885–898, Taylor & Francis, 2017. I, III-A [17] C. P. Bechlioulis and G. A. Rovithakis, “Adaptive control with guaranteed transient and steady state tracking error bounds for strict feedback systems,” Automatica, vol. 45, no. 2, pp. 532– 538, 2009. I [18] S. Tong, S. Sui, and Y. Li, “Fuzzy adaptive output feedback control of mimo nonlinear systems with partial tracking errors constrained,” IEEE Transactions on Fuzzy Systems, vol. 23, no. 4, pp. 729–742, 2015. I [19] Y. Li and S. Tong, “Prescribed performance adaptive fuzzy output-feedback dynamic surface control for nonlinear largescale systems with time delays,” Information Sciences, vol. 292, pp. 125–142, 2015. I [20] Y. M. Li, S. C. Tong, L. Liu, and G. Feng, “Adaptive output-feedback control design with prescribed performance for switched nonlinear systems,” Automatica, vol. 80, pp. 225–231, 2017. I [21] Y. Karayiannidis, D. Papageorgiou, and Z. Doulgeri, “A modelfree controller for guaranteed prescribed performance tracking of both robot joint positions and velocities,” IEEE Robotics and Automation Letters, vol. 1, no. 1, pp. 267–273, 2016. I [22] J. Na, “Adaptive prescribed performance control of nonlinear systems with unknown dead zone,” International Journal of Adaptive Control and Signal Processing, vol. 27, no. 5, pp. 426– 446, 2013. I [23] Y. Yang, C. Ge, H. Wang, X. Li, and C. Hua, “Adaptive neural network based prescribed performance control for teleoperation system under input saturation,” Journal of the Franklin Institute, vol. 352, no. 5, pp. 1850–1866, 2015. I [24] J. Wang, N. Hovakimyan, and C. Cao, “Verifiable adaptive flight control: unmanned combat aerial vehicle and aerial refueling,” Journal of guidance, control, and dynamics, vol. 33, no. 1, pp. 75–87, 2010. I [25] A. K. Kostarigka and G. A. Rovithakis, “Adaptive dynamic output feedback neural network control of uncertain MIMO nonlinear systems with prescribed performance,” IEEE Transactions on Neural Networks and Learning Systems, vol. 23, no. 1, pp. 138–149, 2012. I [26] H. A. H. Mohamed, Improved robust adaptive control of highorder nonlinear systems with guaranteed performance. M.Sc, King Fahd University Of Petroleum & Minerals, 2014. I, III-A, 3 [27] X. Li, X. Wang, and G. Chen, “Pinning a complex dynamical network to its equilibrium,” Circuits and Systems I: Regular Papers, IEEE Transactions on, vol. 51, no. 10, pp. 2074–2087, 2004. III [28] S. Khoo, L. Xie, and Z. Man, “Robust finite-time consensus tracking algorithm for multirobot systems,” Transactions on Mechatronics, IEEE/ASME, vol. 14, no. 2, pp. 219–228, 2009. III [29] Z. Qu, Cooperative control of dynamical systems: applications to autonomous vehicles. Springer Science & Business Media, 2009. 1 [30] M. Wang and A. Yang, “Dynamic learning from adaptive neural control of robot manipulators with prescribed performance,” IEEE Transactions on Systems, Man, and Cybernetics: Systems, 2017. 3 To cite this article: Sami El-Ferik, Hashim A. Hashim, and Frank L. Lewis. ”Neuro-adaptive distributed control with prescribed performance for the synchronization of unknown nonlinear networked systems.” IEEE Transactions on Systems, Man, and Cybernetics: Systems (2017). [31] K. Hornik, M. Stinchcombe, and H. White, “Multilayer feedforward networks are universal approximators,” Neural networks, vol. 2, no. 5, pp. 359–366, 1989. IV-A [32] T. Poggio and F. Girosi, “Regularization algorithms for learning that are equivalent to multilayer networks,” Science, vol. 247, no. 4945, pp. 978–982, 1990. IV-A [33] N. E. Cotter, “The Stone-Weierstrass theorem and its application to neural networks.,” IEEE transactions on neural networks/a publication of the IEEE Neural Networks Council, vol. 1, no. 4, pp. 290–295, 1989. IV-A [34] H. Xu and P. A. Ioannou, “Robust adaptive control for a class of mimo nonlinear systems with guaranteed error bounds,” IEEE Transactions on Automatic Control, vol. 4 8, no. 5, pp. 728–742, 2003. IV-B
3cs.SY
arXiv:cs/9911001v2 [cs.PL] 26 Nov 1999 Semantics of Programming Languages: A Tool-Oriented Approach∗ Jan Heering Paul Klint CWI CWI and University of Amsterdam P.O. Box 94079, 1090 GB Amsterdam, The Netherlands P.O. Box 94079, 1090 GB Amsterdam, The Netherlands [email protected] [email protected] Abstract By paying more attention to semantics-based tool generation, programming language semantics can significantly increase its impact. Ultimately, this may lead to “Language Design Assistants” incorporating substantial amounts of semantic knowledge. 1 The Role of Programming Language Semantics Programming language semantics has lost touch with large groups of potential users [39]. Among the reasons for this unfortunate state of affairs, one stands out. Semantic results are rarely incorporated in practical systems that would help language designers to implement and test a language under development, or assist programmers in answering their questions about the meaning of some language feature not properly documented in the language’s reference manual. Nevertheless, such systems are potentially more effective in bringing semantics-based formalisms and techniques to the places they are needed than their dissemination in publications, courses, or even exemplary (but little-used) programming languages. The current situation in which semantics, languages, and tools are drifting steadily further apart is shown in Figure 1. The tool-oriented approach to semantics aims at making semantics definitions more useful and productive by generating as many language-based tools from them as possible. This will, we expect, reverse the current trend as shown in Figure 2. The goal is to produce semantically wellfounded languages and tools. Ultimately, we envision the emergence of “Language Design Assistants” incorporating substantial amounts of semantic knowledge. Table 1 lists the semantics definition methods we are aware of. Examples of their use can be found in [40]. Petri nets, process algebras, and other methods that do not specifically address the semantics of programming languages, are not included. Dating back to the sixties, attribute grammars and denotational semantics are among the oldest methods, while abstract state machines (formerly called evolving algebras), coalgebra semantics, and program algebra are the latest additions to the field. Ironically, while attribute grammars are popular with tool builders, semanticists do not consider them a particularly interesting definition method. Since we will only discuss the various methods in general terms without going into technical details, the reader need not be familiar with them. In any case, the differences between them, while often hard to decipher because the field is highly fragmented and appropriate “dictionaries” are lacking, do not affect our main argument. Table 2 lists a representative language development system (if any) for the semantics definition methods of Table 1. The last entry, Software Refinery, which has its origins in knowledge-based software ∗ This research was supported in part by the Telematica Instituut under the Domain-Specific Languages project. 6             @@ R Semantics Languages Tools Figure 1: Semantics, languages, and tools are drifting steadily further apart.     Semantics ? TG/LDAs       @ I      Languages Tools Figure 2: In the tool-oriented approach, semantics, languages, and tools are kept together by Tool Generation (TG) and, ultimately, Language Design Assistants (LDAs). Semantics Axiomatic [4] Attribute grammars [12] Denotational [38] Algebraic [7] Structural operational [35]/ Natural [23] Action [31] Abstract state machines [19] Coalgebraic [21] Program algebra [8] Definition in terms of Pre- and postconditions Attribute propagation rules Lambda-expressions Equations/rewrite rules Inference rules Action expressions Transition rules Behavioral specification rules Equations Table 1: Current approaches to programming language semantics. Semantics Attribute grammars Denotational Algebraic Structural operational/ Natural Action Abstract state machines (Operational) System Synthesizer Generator [36] PSG [5] ASF+SDF Meta-Environment [14] Centaur [9] Developed at Cornell University Technical University of Darmstadt CWI and University of Amsterdam ASD [13] Gem-Mex [3] Software Refinery [29] CWI and University of Aarhus University of L’Aquila Reasoning Systems, Palo Alto INRIA Sophia-Antipolis Table 2: Some representative language development systems. environments research at Kestrel Institute, does not fit any of the current semantics paradigms. The pioneering Semanol system [2] is, to the best of our knowledge, no longer in use and is not included. The systems listed have widely different capabilities and are in widely different stages of development. Before discussing their characteristics and applications in Section 3, we first explain the general ideas underlying the tool-oriented approach to programming language semantics. These were shaped by our experiences with the ASF+SDF Meta-Environment (Table 2) over the past ten years. Finally, we discuss Language Design Assistants in Section 4. 2 A Tool-Oriented Approach to Semantics The tool-oriented approach to semantics aims at making semantics definitions more useful and productive by generating as many language-based tools from them as possible. This affects many aspects of the way programming language semantics is practiced and upsets some of its dogmas. Table 3 lists some of the tools that might be generated. In principle, the language definition has to be augmented with suitable tool-specific information for each tool to be generated, and this may require tool-specific language extensions to the core semantics definition formalism. In practice, this is not always necessary since semantics definitions tend to contain a good deal of implicit information that may be extracted and used for tool generation. Scanner/Parser Prettyprinter Syntax-directed editor Typechecker (Abstract) interpreter(s) Dataflow analyzer Call graph extractor Partial evaluator Optimizer Program slicer Origin tracker Debugger Code generator Compiler Profiler Test case generator Test coverage analyzer Regression test tool Complexity analyzer (metrics) Documentation generator Cluster analysis tool Systematic program modification tool Table 3: Tools that might be derived from a language definition. The first entry of Table 3, scanner and parser generation, is standard technology. Lex and Yacc are well-known examples of stand-alone generators for this purpose. Their input formalisms are close to regular expressions and BNF, the de facto standard formalisms for regular and context-free grammars, respectively. Unfortunately, for most of the other tools in Table 3 there are no such standard formalisms. The key features of the tool-oriented approach are: • Language definitions are primarily tool generator input. They do not have to provide any kind of theoretical “explanation” of the constructs of the language in question nor do they have to become part of a language reference manual. • An interpreter that can act, among other things, as an “oracle” to programmers needing help will be among the first tools to be generated. • Writing (large) language definitions loses its esoteric character and becomes similar to any other kind of programming. Semantics formalisms tend to do best on small examples, but lose much of their power as the language definitions being written grow. In the tool-oriented approach, semantics formalisms have to be modular and separate generation (the analogue of separate compilation) has to be supported. Libraries of language constructs become important. • The tool-oriented approach may require addition of tool-specific features to the core formalism. This leads to an open-ended rather than a “pure” style of semantics description. • The scope of the tool-oriented approach includes, for instance, System Generated tools Synthesizer Generator scanner/parser (LALR), prettyprinter, syntax-directed editor, incremental typechecker, incremental translator, . . . PSG ASD scanner/parser, syntax-directed editor, incremental typechecker (even for incomplete program fragments), interpreter scanner/parser (generalized LR), prettyprinter, syntaxdirected editor, typechecker, interpreter, origin tracker, translator, renovation tools, . . . scanner/parser (LALR), prettyprinter, syntax-directed editor, typechecker, interpreter, origin tracker, translator, . . . scanner/parser, syntax-directed editor, checker, interpreter Gem-Mex scanner/parser, typechecker, interpreter, debugger Software Refinery scanner/parser (LALR), prettyprinter, syntax-directed editor, object-oriented parse tree repository (including dataflow relations), Y2K/Euro tools, program slicer, . . . ASF+SDF MetaEnvironment Centaur Semantic engine incremental attribute evaluator functional language interpreter conditional rewrite rule engine inference rule engine conditional rewrite rule engine transition rule engine tree manipulation engine Table 4: Tool generation capabilities of representative language development systems. – Domain-specific and little languages [15, 37]. Many of the tools in Table 3 are as useful for DSLs as they are for programming languages. – Software maintenance and renovation tools [16]. Some of these are included at the end of Table 3. – Compiler toolkits such as CoSy [1], Cocktail [18], OCS [22], SUIF [42], and PIM [6, 17]. 3 Existing Language Development Systems Table 4 summarizes the tool generation capabilities of the representative language development systems listed in Table 2. All of them can generate lexical scanners, parsers, and prettyprinters, many of them can produce syntax-directed editors, typecheckers, and interpreters, and a few can produce various kinds of software renovation tools. To this end, they support one or more specification formalisms, but these differ in generality and application domain. For instance, the Synthesizer Generator supports attribute grammars with incremental attribute evaluation, which is particularly suitable for typechecking, static analysis and translation, but less suitable for dynamic semantics. The ASF+SDF Meta-Environment supports conditional rewrite rules rather than attribute grammars, and these can be used for defining dynamic semantics as well. Software Refinery comes with a full-blown functional language in which a wide range of computations on programs can be expressed. Other systems provide more specialized specification formalisms. PSG, for instance, uses context relations to describe incremental typechecking (even for incomplete program fragments) and denotational definitions for dynamic semantics. Gem-Mex supports a semi-visual formalism optimized for the definition of programming language semantics and tool generation. It can generate a typechecker, an interpreter, and a debugger. Table 4 is far from complete. Some other language development systems are SIS [30], PSP [32], GAG [24], SPS [41], MESS [28], Actress [11], Pregmatic [10], LDL [20], and Eli [26]. Many of the tools listed in Table 3 are not generated by any current system. Ample opportunities for tool generation still exist in areas like optimization, dynamic program analysis, testing, and maintenance. 4 Toward Language Design Assistants The logical next step beyond semantics-based tool generation would lead to a situation similar to that of computer algebra. Large parts of mathematics are being incorporated in computer algebra systems. Conversely, computer algebra itself has become a fruitful mathematical activity, yielding new results of general mathematical interest. In the case of semantics, we see opportunities for “Language Design Assistants” incorporating a substantial amount of both formal and informal semantic knowledge. The latter is found, for instance, in language design rationales and discussion documents produced by standardization bodies. Development of such assistants will not only push semantics even further toward practical application, but also give rise to new theoretical questions. The Language Design Assistants we have in mind would support the human language designer by providing design choices and performing consistency checks during the design process. Operational knowledge about typical issues like typing rules, scope rules, and execution models should be incorporated in them. Major research questions arise here regarding the acquisition, representation, organization, and abstraction level of the required knowledge. For instance, should it be organized according to any of the currently known paradigms of object-oriented, functional, or logic programming? Or should a higher level of abstraction be found from which these and other, new, paradigms can be derived? How can constraints on the composition of certain features be expressed and checked? Another key question is how to construct a collection of “language feature components” that are sufficiently general to be reusable across a wide range of languages. Similar considerations apply to tool development. By incorporating knowledge about tool generation in the Language Design Assistant we can envision a Tool Generation Assistant that helps in constructing tools in a more advanced way than the tool generation we had in mind in the previous sections. To make this perspective somewhat more tangible, consider the relatively simple case of an if-thenelse-like conditional construct that has to be modelled as a language feature component. Table 5 gives an impression of the wide range of issues that has to be addressed before such a generic conditional construct can be specialized into a concrete if-then-else-statement or conditional expression in a specific language. It is a research question to design an abstract framework in which these and similar questions can be expressed and answered. Another major question is how to organize the specialization process from language feature component to concrete language construct. The main alternatives are parameterization and transformation [27]. Using parameterization, specialization of the component in question amounts to instantiating its parameters. Since parameters have to be identified beforehand and instantiation is usually a rather simple mechanism, the adaptability/reusability of a parameterized component is limited. Using transformations, on the other hand, a language feature component is designed without explicit parameters. Specialization is achieved by applying appropriate transformation rules to it to obtain the desired specific case. Clearly, this approach is more flexible since any part of the language feature component can be modified by the transformation rules and can thus effectively act as a parameter. The relation between this approach of meta-level transformation and parameterized modules is largely unexplored. What is the type of the expression controlling the selection of one of the two branches. How is the controlling expression evaluated (short circuit vs. full evaluation)? Is the controlling expression evaluated concurrently with other program parts (with speculative execution of the conditional as a special case)? Can the controlling expression have side-effects? Can the controlling expression cause exceptions? Are jumps from outside into the branches allowed? Is the selected branch evaluated concurrently with other program parts? Can the evaluation of the selected branch cause side-effects? Can the evaluation of the selected branch cause exceptions? Does the evaluation of the conditional construct yield a value? Table 5: Some of the possible parameters of a generic conditional construct. Although we are not aware of research on Language Design Assistants from the broad perspective sketched here, there is some work pointing in the same general direction: • The Language Designer’s Workbench sketched as future work in [34, 28] has some of the same goals. • Action semantics [31] also emphasizes libraries of reusable language constructs. • Plans (no longer pursued) for the Language Development Laboratory [20] included a library of reusable language constructs, a knowledge base containing knowledge of languages and their compilers/interpreters, and a tool for language design. • The “design and implementation by selection” of languages described in [33, 25] is a case study in high-level interactive composition of predefined language constructs. Acknowledgements We would like to thank Jan Bergstra, Mark van den Brand, Arie van Deursen, Ralf Lämmel, and Jan Rutten for useful comments on earlier versions. References [1] Ace bv. The CoSy compilation system, 1999. www.ace.nl/products/cosy.htm. [2] E. R. Anderson, F. C. Belz, and E. K. Blum. SEMANOL(73)—A metalanguage for programming the semantics of programming languages. Acta Informatica, 6:109–134, 1976. [3] M. Anlauff, P. W. Kutter, and A. Pierantonio. Formal aspects and development environments for Montages. In M. P. A. Sellink, editor, 2nd International Workshop on the Theory and Practice of Algebraic Specifications (ASF+SDF ’97), Electronic Workshops in Computing. Springer/British Computer Society, 1997. [4] K. R. Apt and E.-R. Olderog. Verification of Sequential and Concurrent Programs. Springer, 2nd edition, 1997. [5] R. Bahlke and G. Snelting. The PSG system: From formal language definitions to interactive programming environments. ACM Transactions on Programming Languages and Systems, 8:547– 576, 1986. [6] J. A. Bergstra, T. B. Dinesh, J. Field, and J. Heering. Toward a complete transformational toolkit for compilers. ACM Transactions on Programming Languages and Systems, 19(5):639–684, 1997. [7] J. A. Bergstra, J. Heering, and P. Klint, editors. Algebraic Specification. ACM Press/Addison-Wesley, 1989. [8] J. A. Bergstra and M. E. Loots. Program algebra for component code. Technical Report P9811, Programming Research group, University of Amsterdam, 1998. To appear in Formal Aspects of Computing. [9] P. Borras, D. Clément, Th. Despeyroux, J. Incerpi, G. Kahn, B. Lang, and V. Pascual. Centaur: The System. ACM SIGPLAN Notices, 24(2):14–24, 1989. Proceedings of the ACM SIGSOFT/SIGPLAN Software Engineering Symposium on Practical Software Development Environments. [10] M. G. J. van den Brand. Pregmatic: A Generator for Incremental Programming Environments. PhD thesis, Katholieke Universiteit Nijmegen, 1992. [11] D. F. Brown, H. Moura, and D. A. Watt. Actress: Action semantics directed compiler generator. In U. Kastens and P. Pfahler, editors, Compiler Construction (CC ’92), volume 641 of Lecture Notes in Computer Science, pages 95–109. Springer-Verlag, 1992. [12] P. Deransart, M. Jourdan, and B. Lorho. Attribute Grammars: Definitions, Systems and Bibliography, volume 323 of Lecture Notes in Computer Science. Springer-Verlag, 1988. [13] A. van Deursen. Executable Language Definitions: Case Studies and Origin Tracking Techniques. PhD thesis, University of Amsterdam, 1994. www.cwi.nl/∼arie/papers/pschrift.ps.gz. [14] A. van Deursen, J. Heering, and P. Klint, editors. Language Prototyping: An Algebraic Specification Approach, volume 5 of AMAST Series in Computing. World Scientific, 1996. [15] A. van Deursen and P. Klint. Little languages: Little maintenance? Journal of Software Maintenance, 10:75–92, 1998. [16] A. van Deursen, P. Klint, and C. Verhoef. Research issues in software renovation. In J.-P. Finance, editor, Fundamental Approaches to Software Engineering (FASE ’99), volume 1577 of Lecture Notes in Computer Science, pages 1–23. Springer-Verlag, 1999. [17] J. Field, J. Heering, and T. B. Dinesh. Equations as a uniform framework for partial evaluation and abstract interpretation. ACM Computing Surveys, 30(3es), 1998. Electronic supplement: 1998 Symposium on Partial Evaluation (SOPE ’98). [18] J. Grosch and H. Emmelmann. A tool box for compiler construction. In D. Hammer, editor, Compiler Compilers (CC ’90), volume 477 of Lecture Notes in Computer Science. Springer-Verlag, 1990. [19] Y. Gurevich. Evolving algebras 1993: Lipari guide. In E. Börger, editor, Specification and Validation Methods, pages 7–36. Oxford University Press, 1995. [20] J. Harm, R. Lämmel, and G. Riedewald. The Language Development Laboratory. In M. Haveraaen and O. Owe, editors, Selected papers from the 8th Nordic Workshop on Programming Theory (NWPT ’96), Research Report 248, pages 77–86. University of Oslo, Department of Informatics, 1997. www.cwi.nl/∼ralf. [21] B. Jacobs and J. Rutten. A tutorial on (co)algebras and (co)induction. Bulletin of the EATCS, 62:222–259, 1997. www.cwi.nl/∼janr. [22] T. P. Justice and T. Budd. OCS: An object-oriented compiler construction toolkit. Technical Report 93-60-10, Oregon State University, Department of Computer Science, 1993. [23] G. Kahn. Natural Semantics. In F. J. Brandenburg, G. Vidal-Naquet, and M. Wirsing, editors, Fourth Symposium on Theoretical Aspects of Computer Science (STACS ’87), volume 247 of Lecture Notes in Computer Science, pages 22–39. Springer-Verlag, 1987. [24] U. Kastens. The GAG-System — A tool for compiler construction. In B. Lorho, editor, Methods and Tools for Compiler Construction, pages 165–181. Cambridge University Press, 1984. [25] U. Kastens and P. Pfahler. Compositional design and implementation of domain-specific languages. In R. N. Horspool, editor, IFIP TC2 WG 2.4 Working Conference on System Implementation 2000: Languages, Methods and Tools, pages 152–165. Chapman and Hall, 1998. [26] U. Kastens, P. Pfahler, and M. Jung. The Eli system. In K. Koskimies, editor, Compiler Construction (CC ’98), volume 1383 of Lecture Notes in Computer Science, pages 294–297. Springer-Verlag, 1998. [27] R. Lämmel. Declarative aspect-oriented programming. In O. Danvy, editor, Proceedings of the 1999 ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation (PEPM ’99), BRICS Notes Series NS-99-1, pages 131–146, 1999. [28] P. Lee. Realistic Compiler Generation. MIT Press, 1989. [29] L. Markosian, P. Newcomb, R. Brand, S. Burson, and T. Kitzmiller. Using an enabling technology to reengineer legacy systems. Communications of the ACM, 37(5):58–70, May 1994. [30] P. D. Mosses. SIS — Semantics Implementation System: Reference manual and user guide. Technical Report DAIMI MD-30, Computer Science Department, Aarhus University, 1979. [31] P. D. Mosses. Action Semantics. Cambridge University Press, 1992. [32] L. Paulson. A semantics-directed compiler generator. In Principles of Programming Languages (POPL ’82), pages 224–233. ACM, 1982. [33] P. Pfahler and U. Kastens. Language design and implementation by selection. In Proceedings First ACM SIGPLAN Workshop on Domain-Specific Languages (DSL ’97), Technical Report, pages 97– 108. University of Illinois at Urbana-Champaign, 1997. [34] U. F. Pleban. Formal semantics and compiler generation. In H. Morgenbrod and W. Sammer, editors, Programmierumgebungen und Compiler, pages 145–161. Teubner-Verlag, 1984. [35] G. D. Plotkin. A structural approach to operational semantics. Technical Report DAIMI FN-19, Aarhus University, 1981. [36] T. Reps and T. Teitelbaum. The Synthesizer Generator: A System for Constructing Language-Based Editors. Springer-Verlag, third edition, 1989. [37] P. H. Salus, editor. Handbook of Programming Languages Vol. III: Little Languages and Tools. Macmillan Technical Publishing, 1998. [38] D. A. Schmidt. Denotational Semantics: A Methodology for Language Development. Allyn and Bacon, 1986. [39] D. A. Schmidt. On the need for a popular formal semantics. ACM Computing Surveys, 28(4es), 1996. Electronic supplement: Strategic Directions in Computing Research. [40] K. Slonneger and B. L. Kurtz. Formal Syntax and Semantics of Programming Languages: A Laboratory Based Approach. Addison-Wesley, 1995. [41] M. Wand. A semantic prototyping system. SIGPLAN Notices, 19(6):213–221, 1984. Proceedings of the ACM SIGPLAN ’84 Symposium on Compiler Construction. [42] R. P. Wilson, R. S. French, C. S. Wilson, S. P. Amarasinghe, J. M. Anderson, S. W. K. Tjiang, S.-W. Liao, C.-W. Tseng, M. W. Hall, M. S. Lam, and J. L. Hennessy. SUIF: An infrastructure for research on parallelizing and optimizing compilers. ACM SIGPLAN Notices, 29(12):31–37, 1994.
6cs.PL
HIERARCHICAL DEEP LEARNING ARCHITECTURE FOR 10K OBJECTS CLASSIFICATION Atul Laxman Katole1, Krishna Prasad Yellapragada1, Amish Kumar Bedi1, Sehaj Singh Kalra1 and Mynepalli Siva Chaitanya1 1 Samsung R&D Institute India - Bangalore, Bagmane Constellation Business Park, Doddanekundi Circle, Bangalore, India ABSTRACT Evolution of visual object recognition architectures based on Convolutional Neural Networks & Convolutional Deep Belief Networks paradigms has revolutionized artificial Vision Science. These architectures extract & learn the real world hierarchical visual features utilizing supervised & unsupervised learning approaches respectively. Both the approaches yet cannot scale up realistically to provide recognition for a very large number of objects as high as 10K. We propose a two level hierarchical deep learning architecture inspired by divide & conquer principle that decomposes the large scale recognition architecture into root & leaf level model architectures. Each of the root & leaf level models is trained exclusively to provide superior results than possible by any 1-level deep learning architecture prevalent today. The proposed architecture classifies objects in two steps. In the first step the root level model classifies the object in a high level category. In the second step, the leaf level recognition model for the recognized high level category is selected among all the leaf models. This leaf level model is presented with the same input object image which classifies it in a specific category. Also we propose a blend of leaf level models trained with either supervised or unsupervised learning approaches. Unsupervised learning is suitable whenever labelled data is scarce for the specific leaf level models. Currently the training of leaf level models is in progress; where we have trained 25 out of the total 47 leaf level models as of now. We have trained the leaf models with the best case top-5 error rate of 3.2% on the validation data set for the particular leaf models. Also we demonstrate that the validation error of the leaf level models saturates towards the above mentioned accuracy as the number of epochs are increased to more than sixty. The top-5 error rate for the entire two-level architecture needs to be computed in conjunction with the error rates of root & all the leaf models. The realization of this two level visual recognition architecture will greatly enhance the accuracy of the large scale object recognition scenarios demanded by the use cases as diverse as drone vision, augmented reality, retail, image search & retrieval, robotic navigation, targeted advertisements etc. KEYWORDS Convolutional Neural Network [CNN], Convolutional Deep Belief Network [CDBN], Supervised & Unsupervised training 1. INTRODUCTION Deep learning based vision architectures learn to extract & represent visual features with model architectures that are composed of layers of non-linear transformations stacked on top of each other [1]. They learn high level abstractions from low level features extracted from images utilizing supervised or unsupervised learning algorithms. Recent advances in training CNNs with gradient descent based backpropagation algorithm have shown very accurate results due to inclusion of rectified linear units as nonlinear transformation [2]. Also extension of unsupervised learning algorithms that train deep belief networks towards training convolutional networks have exhibited promise to scale it to realistic image sizes [4]. Both the supervised and unsupervised learning approaches have matured and have provided architectures that can successfully classify objects in 1000 & 100 categories respectively. Yet both the approaches cannot be scaled realistically to classify objects from 10K categories. The need for large scale object recognition is ever relevant today with the explosion of the number of individual objects that are supposed to be comprehended by artificial vision based solutions. This requirement is more pronounced in use case scenarios as drone vision, augmented reality, retail, image search & retrieval, industrial robotic navigation, targeted advertisements etc. The large scale object recognition will enable the recognition engines to cater to wider spectrum of object categories. Also the mission critical use cases demand higher level of accuracy simultaneously with the large scale of objects to be recognized. In this paper, we propose a two level hierarchical deep learning architecture that achieves compelling results to classify objects in 10K categories. To the best of our knowledge the proposed method is the first attempt to classify 10K objects utilizing a two level hierarchical deep learning architecture. Also a blend of supervised & unsupervised learning based leaf level models is proposed to overcome labelled data scarcity problem. The proposed architecture provides us with the dual benefit in the form of providing the solution for large scale object recognition and at the same time achieving this challenge with greater accuracy than being possible with a 1-level deep learning architecture. 2. RELATED WORKS We have not come across any work that uses 2-level hierarchical deep learning architecture to classify 10K objects in images. But object recognition on this large scale using shallow architectures utilizing SVMs is discussed in [5]. This effort presents a study of large scale categorization with more than 10K image classes using multi-scale spatial pyramids (SPM) [14] on bag of visual words (BOW) [13] for feature extraction & Support Vector Machines (SVM) for classification. This work creates ten different datasets derived from ImageNet each with 200 to 10,000 categories. Based on these datasets it outlines the influence on classification accuracy due to different factors like number of labels in a dataset, density of the dataset and the hierarchy of labels in a dataset. The methods are proposed which provide extended information to the classifier on the relationship between different labels by defining a hierarchical cost. This cost is calculated as the height of the lowest common ancestor in WordNet. Classifiers trained on loss function using the hierarchical cost can learn to differentiate and predict between similar categories when compared to those trained on 0-1 loss. The error rate for the classification of entire 10K categories is not conclusively stated in this work. 3. PROBLEM STATEMENT Supervised learning based deep visual recognition CNN architectures are composed of multiple convolutional stages stacked on top of each other to learn hierarchical visual features [1] as captured in Figure 1. Regularization approaches such as stochastic pooling, dropout, data augmentation have been utilized to enhance the recognition accuracy. Recently the faster convergence of these architectures is attributed to the inclusion of Rectified Linear Units [ReLU] nonlinearity into each of the layer with weights. The state of the art top 5 error rate reported is 4.9% for classification into 1K categories [6] that utilizes the above mentioned generic architectural elements in 22 layers with weights. Unsupervised learning based architecture model as convolutional DBN learns the visual feature hierarchy by greedily training layer after layer. These architectures have reported accuracy of 65.4% for classifying 101 objects [4]. Both the architectures are not yet scaled for classification of 10K objects. We conjecture that scaling a single architecture is not realistic as the computations will get intractable if we utilize deeper architectures. Figure 1. Learning hierarchy of visual features in CNN architecture 4. PROPOSED METHOD We employ divide & conquer principle to decompose the 10K classification into root & leaf level distinct challenges. The proposed architecture classifies objects in two steps as captured below: 1. Root Level Model Architecture: In the first step the root i.e. the first level in architectural hierarchy recognizes high level categories. This very deep vision architectural model with 14 weight layers [3] is trained using stochastic gradient descent [2]. The architectural elements are captured in the table 1. 2. Leaf Level Model Architecture: In the second step, the leaf level recognition model for the recognized high level category is selected among all the leaf models. This leaf level model is presented with the same input object image which classifies it in a specific category. The leaf level architecture in the architectural hierarchy recognizes specific objects or finer categories. This model is trained using stochastic gradient descent [2]. The architectural elements are captured in the table 2. CDBN based leaf level models can be trained with unsupervised learning approach in case of scarce labelled images [4]. This will deliver a blend of leaf models trained with supervised & unsupervised approaches. In all a root level model & 47 leaf level models need to be trained. We use ImageNet10K dataset [5], which is compiled from 10184 synsets of the Fall-2009 release of ImageNet. Each leaf node has at least 200 labelled images which amount to 9M images in total. Figure 2. Two Levels – Hierarchical Deep Learning Archtecture 5. SUPERVISED TRAINING In vision the low level features [e.g. pixels, edge-lets, etc.] are assembled to form high level abstractions [e.g. edges, motifs] and these higher level abstractions are in turn assembled to form further higher level abstractions [e.g. object parts, objects] and so on. Substantial number of the recognition models in our two-level hierarchical architecture is trained utilizing supervised training. The algorithms utilized for this method are referred to as error-back propagation algorithm. These algorithms require significantly high number of labelled training images per object category in its data set. 5.1. CNN based Architecture CNN is a biologically inspired architecture where multiple trainable convolutional stages are stacked on the top of each other. Each CNN layer learns feature extractors in the visual feature hierarchy and attempts to mimic the human visual system feature hierarchy manifested in different areas of human brain as V1 & V2 [10]. Eventually the fully connected layers act as a feature classifier & learn to classify the extracted features by CNN layers into different categories or objects. The fully connected layers can be likened to the V4 area of the brain which classifies the hierarchical features as generated by area V2. The root level & the leaf level CNN models in our architecture are trained with supervised gradient descent based backpropagation method. In this learning method, the cross entropy objective function is minimized with the error correction learning rule/mechanism. This mechanism computes the gradients for the weight updates of the hidden layers by recursively computing the local error gradient in terms of the error gradients of the next connected layer of neurons. By correcting the synaptic weights for all the free parameters in the network, eventually the actual response of the network is moved closer to the desired response in statistical sense. Table 1. CNN architecture layers [L] with architectural elements for root level visual recognition architecture Layer No. Type Input Size #kernels 1 Convolutional 225 x 225 x 3 3x3x3 2 Max Pool 223 x 223 x 64 3x3 3 Convolutional 111 x 111 x 64 3 x 3 x 64 4 Convolutional 111 x 111 x 128 3 x 3 x 128 5 Max Pool 111 x 111 x 128 3x3 6 Convolutional 55 x 55 x 128 3 x 3 x 128 7 Convolutional 55 x 55 x 256 3 x 3 x 256 8 Max Pool 55 x 55 x 256 3x3 9 Convolutional 27 x 27 x 256 3 x 3 x 256 10 Convolutional 27 x 27 x 384 3 x 3 x 384 11 Convolutional 27 x 27 x 384 3 x 3 x 384 12 Max Pool 27 x 27 x 384 3x3 13 Convolutional 13 x 13 x 384 3 x 3 x 384 14 Convolutional 13 x 13 x 512 3 x 3 x 512 15 Convolutional 13 x 13 x 512 3 x 3 x 512 16 Max Pool 13 x 13 x 512 3x3 17 Convolutional 7 x 7 x 512 1 x 1 x 512 18 Full-Connect 12544 4096 19 Full-Connect 4096 2048 20 Full-Connect 2048 128 128-Softmax 128 5.2. Architectural Elements Architectural elements for the proposed architecture are:  Enhanced Discriminative Function: We have chosen deeper architectures & smaller kernels for the root & leaf models as they make the objective function more discriminative. This can be interpreted as making the training procedure more difficult by making it to choose the feature extractors from higher dimensional feature space.  ReLU Non-linearity: We have utilized ReLU nonlinearities as against sigmoidal i.e. non-saturating nonlinearities in each layer as it reduces the training time by converging upon the weights faster [2].  Pooling: The output of convolutional-ReLU combination is fed to a pooling layer after alternative convolutional layers. The output of the pooling layer is invariant to the small changes in location of the features in the object. The pooling method used is either maxpooling OR stochastic pooling. Max Pooling method averages the output over the neighborhood of the neurons where-in the poling neighborhoods can be overlapping or non-overlapping. In majority of the leaf models we have used Max Pooling approach with overlapping neighborhoods. Alternatively we have also used Stochastic Pooling method when training for few models. In Stochastic Pooling the output activations of the pooling region are randomly picked from the activations within each pooling region, following multinomial distribution. This distribution is computed from the neuron activation within the given region [12]. This approach is hyper parameter free. The CNN architecture for stochastic pooling technique is captured in table 3.  Dropout: With this method the output of each neuron in fully connected layer is set to zero with probability 0.5. This ensures that the network samples a different architecture when a new training example is presented to it. Besides this method enforces the neurons to learn more robust features as it cannot rely on the existence of the neighboring neurons. Table 2. CNN architecture layers [L] with architectural elements for leaf level visual recognition architecture with Max pooling strategy Layer No. Type Input Size #kernels 1 Convolutional 225 x 225 x 3 7x7x3 2 Max Pool 111 x 111 x 64 3x3 3 Convolutional 55 x 55 x 64 3 x 3 x 64 4 Convolutional 55 x 55 x 128 3 x 3 x 128 5 Max Pool 55 x 55 x 128 3x3 6 Convolutional 27 x 27 x 128 3 x 3 x 128 7 Convolutional 27 x 27 x 256 3 x 3 x 256 8 Max Pool 27 x 27 x 256 3x3 9 Convolutional 13 x 13 x 256 3 x 3 x 256 10 Convolutional 13 x 13 x 384 3 x 3 x 384 12 Max Pool 13 x 13 x 384 3x3 13 Convolutional 7 x 7 x 384 1 x 1 x 384 14 Full-Connect 6272 2048 15 Full-Connect 2048 2048 16 Full-Connect 2048 256 256-Softmax 256 Table 3. CNN architecture layers [L] with architectural elements for leaf level visual recognition architecture with stochastic pooling strategy Layer No. Type Input Size #kernels 1 Convolutional 225 x 225 x 3 7x7x3 2 Stochastic Pool 111 x 111 x 64 3x3 3 Convolutional 55 x 55 x 64 3 x 3 x 64 4 Convolutional 55 x 55 x 128 3 x 3 x 128 5 Stochastic Pool 55 x 55 x 128 3x3 6 Convolutional 27 x 27 x 128 3 x 3 x 128 7 Convolutional 27 x 27 x 256 3 x 3 x 256 8 Stochastic Pool 27 x 27 x 256 3x3 9 Convolutional 13 x 13 x 256 3 x 3 x 256 10 Convolutional 13 x 13 x 384 3 x 3 x 384 12 Stochastic Pool 13 x 13 x 384 3x3 13 Convolutional 7 x 7 x 384 1 x 1 x 384 14 Full-Connect 6272 2048 15 Full-Connect 2048 2048 16 Full-Connect 2048 256 256-Softmax 256 5.3. Training Process We modified libCCV open source CNN implementation to realize the proposed architecture which is trained on NVIDIA GTX™ TITAN GPUs. The root & leaf level models are trained using stochastic gradient descent [2]. The leaf models are trained as batches of 10 models per GPU on the two GPU systems simultaneously. The first 4 leaf models were initialized and trained from scratch for 15 epochs with learning rate of 0.01, and momentum of 0.9. The rest of the leaf models are initialized from the trained leaf models and trained with learning rate as 0.001. The root model has been trained for 32 epochs with learning rate of 0.001, after having been initialized from a similar model trained on ImageNet 1K dataset. It takes 10 days for a batch of 20 leaf models to train for 15 epochs. Currently the root model and 25/47 leaf models have been trained in 5 weeks. Full realization of this architecture is in progress and is estimated to conclude by second week of September’15. 6. UNSUPERVISED TRAINING Statistical Mechanics has inspired the concept of unsupervised training fundamentally. Specifically statistical mechanics forms the study of macroscopic equilibrium properties of large system of elements starting from the motion of atoms and electrons. The enormous degree of freedom as necessitated by statistical mechanics foundation makes the use of probabilistic methods to be the most suitable candidate for modelling features that compose the training data sets [9]. 6.1. CDBN based Architecture The networks trained with statistical mechanics fundamentals model the underlying training dataset utilizing Boltzmann distribution. To obviate the painfully slow training time as required to train the Boltzmann machines, multiple variants of the same have been proposed where the Restricted Boltzmann Machine [RBM] is the one that has provided the best possible modelling capabilities in minimal time. The resulting stacks of RBM layers are greedily trained layer by layer [4] resulting in the Deep Belief Networks [DBN] that successfully provides the solution to image [1- 4], speech recognition [8] and document retrieval problem domains. DBN can be described as multilayer generative models that learn hierarchy of non-linear feature detectors. The lower layer learns lower level features which feeds into the higher level and help them learn complex features. The resulting network maximizes the probability that the training data is generated by the network. But DBN has its own limitations when scaling to realistic image sizes [4]. First difficulty is to be computationally tractable with increasing image sizes. The second difficulty is faced with lack of translational invariance when modelling images. To scale DBN for modelling realistic size images the powerful concept of Convolutional DBN [CDBN] had been introduced. CDBN learns feature detectors that are translation invariant i.e. the feature detectors can detect the features that can be located at any location in an image. We perform the block Gibbs sampling using conditional distribution as suggested in [4] to learn the convolutional weights connecting the visible and hidden layers where v and h are activations of neurons in visible & hidden layers respectively. Also bj are hidden unit biases and ci are visible unit biases. W forms the weight matrix connecting the visible and hidden layer. The Gibbs sampling is conducted utilizing (1) & (2). (1) (2) The weights such learnt give us the layers for Convolutional RBMs [CRBM]. The CRBMs can be stacked on top of each other to form CDBN. We had probabilistic Max Pooling layers after convolutional layers [4]. MLP is introduced at the top to complete the architecture. This concept is captured in Figure 3. We train the first two layers in the leaf architecture with unsupervised learning. Later we abandon unsupervised learning and use the learnt weights in the first two layers to initialize the weights in CNN architecture. The CNN architecture weights are then fine-tuned using backpropagation method. The architecture used for training with unsupervised learning mechanism is same as captured in table 2. Also a two-level hierarchical deep learning architecture can be constructed entirely with CDBN as depicted in Figure 4. Figure 3. Convolutional DBN constructed by stacking CRBMs which are learnt one by one. 6.2. Training Process We have used Contrastive Divergence CD-1 mechanism to train the first two layers of the architecture as specified for unsupervised learning. The updates to the hidden units in the positive phase of CD-1 step were done with sampling rather than using the real valued probabilities. Also we had used mini-batch size of 10 when training. We had monitored the accuracy of the training utilizing 1. Reconstruction Error: It refers to the squared error between the original data and the reconstructed data. While it does not guarantee accurate training, but during the course of training it should generally decrease. Also, any large amount of increase suggests the training is going wrong. 2. Printing learned Weights: The learned weighs needs to be eventually visualized as oriented, localized edge filters. Printing weights during training helps identify whether the weights are “approaching” that filter-like shape. When the ratio of variance of reconstructed data to variance of input image exceeds 2, we decrease the learning rate by factor of 0.9 and reset the values of weights and hidden bias updates to ensure that weights don’t explode. The initial momentum was chosen to be 0.5 which is increased finally to 0.9. The initial learning rate is chosen to be 0.1. Figure 4. Proposed 2 Level Hierarchical Deep Learning Architecture constructed entirely utilizing CDBNs for classification/Recognition of 10K+ objects 7. TWO-LEVEL HIERARCHY CREATION The 2-level hierarchy design for classification of 10K objects categories requires decision making on the following parameters – 1. Number of leaf models to be trained and 2. Number of output nodes in each leaf model. To decide these parameters, we first build a hierarchy tree out of the 10184 synsets (classes) in ImageNet10K dataset (as described in section 7.1). Then using a set of thumb-rules (described in section 7.2), we try to split and organize all the classes into 64 leaf models, each holding a maximum of 256 classes. 7.1. Building Hierarchical Tree Using the WordNet IS A relationship, all the synsets of ImageNet10K dataset are organized into a hierarchical tree. The WordNet ISA relationship is a file that lists the parent-child relationships between synsets in ImageNet. For example a line “n02403454 n02403740” in the relationship file refers to the parent synset to be n02403454 (cow) and child synset as n02403740 (heifer). However the ISA file can relate a single child to multiple parents, i.e. heifer is also the child of another category n01321854 (young mammal). As the depth of a synset in ImageNet hierarchy has no relationship to its semantic label, we focused on building the deepest branch for a synset. We utilized a simplified method that exploits the relationship between synset ID and depth; the deeper a category nXXX the larger its number XXX. Hence we used the parent category of heifer as cow, instead of young mammal. The algorithm Htree as depicted in Figure 5a & 5b is used to generate the hierarchy tree. In this paper, the results from the ninth (9th) iteration are used as base tree. A sample illustration is captured in Figure 6. 7.2. Thumb-rules for Building Hierarchical Tree From the Hierarchy tree, it is evident that the dataset is skewed towards the categories like flora, animal, fungus, natural objects, instruments etc. that are at levels closer to the tree root i.e. 80% of the synsets fall under 20% of the branches. Figure 5a. Pseudo-code for Hierarchy Tree Generation (HTree) Algorithm Figure 5b. Pseudo-code for Hierarchy Tree Generation (HTree) Algorithm Figure 6. Hierarchy Tree Generated by HTree algorithm at iterations 8, 9 & 10 for ImageNet10K. The categories at Depth-9 are part of leaf-1 model. Taking into account the number of models to be trained and the time & resources required for fine-tuning each model, the below thumb-rules were decided to finalize the solution parameters: 1. The ideal hierarchy will have 64 leaf models each capable of classifying 256 categories 2. The synsets for root and leaf level models have to be decided such that the hierarchy tree is as flat as possible 3. The total number of synsets in a leaf model should be less than 256 and 4. If leaf level models have more than 256 sub-categories under it, the remaining subcategories will be split or merged with another leaf. 7.3. Final Solution Parameters The final solution parameters are as follows, 47 leaf models and with each leaf model classifying 200 ~ 256 synsets. 8. RESULTS We formulate the root & leaf models into 2-level hierarchy. In all a root level model & 47 leaf level models need to be trained. Each leaf level model recognizes categories that range from 45 to 256 in numbers. We use ImageNet10K dataset [7], which is compiled from 10184 synsets of the Fall-2009 release of ImageNet. Each leaf node has at least 200 labelled images which amount to 9M images in total. The top 5 error rates for 25 out of 47 leaf level models have been computed. The graph in Fig. 5 plots the top 5 errors of leaf models vis-à-vis the training epochs. We observe that when the leaf models are trained with higher number of training epochs the top 5 error decreases. The top 5 error rate for the complete 10K objects classification can be computed upon training of all the 47 models as required by the 2-level hierarchical deep learning architecture. Figure 7. Graph captures the decrease in top-5 error rate with increase in increase in number of epochs when training with supervised training method Training for classification of 10K objects with the proposed 2-level hierarchical architecture is in progress and is estimated to be completed by mid of September’15. In this architecture, the root model & the 46/47 leaf models are based on CNN architecture and trained with supervised gradient descent. Utilizing unsupervised learning we have trained a leaf model Leaf-4 that consists of man-made artifacts with 235 categories. The model for Leaf-4 is CDBN based architecture as described in Section 6. We have trained the first layer of this CDBN architecture with contrastive divergence (CD-1) algorithm. Later on the first layer weights are utilized to initialize the weights for leaf-4 model in supervised setting. The same are then fine-tuned with back-propagation utilizing supervised learning. The feature extractors or kernels learnt with supervised & unsupervised learning are captured in Fig. 7. We intend to compute the top 5 error rates for categories using the algorithm as captured in the Fig. 9. Figures 10 – 13 depict the Top-5 classification results using this 2-level hierarchical deep learning architecture. From top-left, the first image is the original image used for testing. The remaining images represent the top-5 categories predicted by the hierarchical model, in descending order of their confidence. 9. CONCLUSIONS The top-5 error rate for the entire two-level architecture is required to be computed in conjunction with the error rates of root & leaf models. The realizations of this two level visual recognition architecture will greatly simply the object recognition scenario for large scale object recognition problem. At the same time the proposed two level hierarchical deep learning architecture will help enhance the accuracy of the complex object recognition scenarios significantly that otherwise would not be possible with just 1-level architecture. Figure 8. : The left image depicts the first layer 64 numbers of 7*7 filter weights learned by leaf-4 utilizing CD-1. The right image depicts the same first layer weights after fine-tuning with back propagation. The trade of with the proposed 2-level architecture is the size of the hierarchical recognition model. The total size of the 2-level recognition models including the root & leaf models amounts to approximately 5 GB. This size might put constraints towards executing the entire architecture on low-end devices. The same size is not a constraint when executed with high end device or cloud based recognition where RAM size is higher. Besides we can always split the 2level hierarchical model between device & cloud which paves the way for object recognition utilizing the novel device-cloud collaboration architectures. The proposed 10K architecture will soon be available for classifying large scale objects. This breakthrough will help enable applications as diverse as drone vision, industrial robotic vision, targeted advertisements, augmented reality, retail, robotic navigation, video surveillance, search & information retrieval from multimedia content etc. The hierarchical recognition models can be deployed and commercialized in various devices like Smart phones, TV, Home Gateways and VR head set for various B2B and B2C use cases. Figure 9. Algorithm to compute top 5 error rates for 10K categories as evaluated by 2-level hierarchical deep learning algorithm Figure 10. The test image belongs to Wilson's warbler. The predicted categories in order of confidence are a) Yellow Warbler b) Wilsons Warbler c) Yellow Hammer d) Wren, Warbler e) Audubon's Warbler Figure 11. The test image belongs to fruit Kumquat. The predicted categories in order of confidence are a) Apricot b) Loquat c) Fuyu Persimmon d) Golder Delicious e) Kumquat Figure 12. The test image belongs to Racing Boat. The top-5 predicted categories are a) Racing Boat b) Racing shell c) Outrigger Canoe d) Gig e) Rowing boat Figure 13. The test image belongs to category Oak. The top-5 predicted categories are a) Live Oak b) Shade Tree c) Camphor d) Spanish Oak ACKNOWLEDGEMENTS We take this opportunity to express gratitude and deep regards to our mentor Dr. Shankar M Venkatesan for his guidance and constant encouragement. Without his support it would not have been possible to materialize this paper. REFERENCES [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] Yann LeCun, Koray Kavukvuoglu and Clément Farabet, “Convolutional Networks and Applications in Vision,” in Proc. International Symposium on Circuits and Systems (ISCAS'10), IEEE, 2010 A. Krizhevsky Ilya Sutskever G. Hinton. "ImageNet classification with deep convolutional neural networks", in NIPS, 2012 K. Simonyan, A. Zisserman, “Very Deep Convolutional Networks for Large-Scale Image Recognition”, in arXiv technical report, 2014 H Lee, R Grosse, R Ranganath, AY Ng, "Convolutional deep belief networks for scalable unsupervised learning of hierarchical representations" in Proceedings of the 26th International Conference on Machine Learning, Montreal, Canada, 2009 Jia Deng, Alexander C. Berg, Kai Li, and Li Fei-Fei, “What Does Classifying More Than 10,000 Image Categories Tell Us?” in Computer Vision–ECCV 2010 Sergey Ioffe, Christian Szegedy, "Batch Normalization - Accelerating Deep Network Training by Reducing Internal Covariate Shift", in arXiv:1502.03167v3 J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei., “ImageNet: A Large-Scale Hierarchical Image Database”, in CVPR09, 2009. George E. Dahl, Dong Yu, Li Deng, Alex Acero, “Context-Dependent Pre-Trained Deep Neural Networks for Large-Vocabulary Speech Recognition” in IEEE Transactions on Audio, Speech & Language Processing 20(1): 30-42 (2012) S. Haykin, "Neural Networks: A Comprehensive Foundation", 3rd ed., New Jersey, Prentice Hall, 1998. G. Orban, "Higher Order Visual Processing in Macaque Extrastriate Cortex" ,Physiological Reviews, Vol. 88, No. 1, pp. 59-89, Jan. 2008, DOI: 10.1152/physrev.00008.2007. CCV-A Modern Computer Vision Library, "libccv.org", [Online] 2015, http://libccv.org/ Matthew D. Zeiler and Rob Fergus,”Stochastic Pooling for Regularization of Deep Convolutional Neural Networks”, in ICLR, 2013. [13] [14] C. R. Dance, J. Willamowski, L. Fan, C. Bray and G. Csurka, "Visual categorization with bags of keypoints", in ECCV International Workshop on Statistical Learning in Computer Vision, 2004. S. Lazebnik, C. Schmid and J. Ponce, "Beyond bags of features: Spatial pyramid matching for recognizing natural scene categories", in IEEE Computer Society Conf. Computer Vision and Pattern Recognition, 2006. AUTHORS Atul Laxman Katole Atul Laxman Katole has completed his M.E in Jan 2003 in Signal Processing from Indian Institute of Science, Bangalore and is currently working at Samsung R&D Institute India-Bangalore. His technical areas of interest include Artificial Intelligence, Deep Learning, Object Recognition, Speech Recognition, Application Development and Algorithms. He has seeded & established teams in the domain of Deep Learning with applications to Image & Speech Recognition. Krishna Prasad Yellapragada Krishna Prasad Yellapragada is currently working as a Technical Lead at Samsung R&D Institute India-Bangalore. His interests include Deep Learning, Machine Learning & Content Centric Networks. Amish Kumar Bedi Amish Kumar Bedi has completed his B.Tech in Computer Science from IIT Roorkee, 2014 Batch. He is working in Samsung R&D Institute IndiaBangalore' since July 2014. His technical areas of interest include Deep Learning/Machine Learning and Artificial Intelligence. Sehaj Singh Kalra Sehaj Sing Kalra has completed his B.Tech in Computer Science from IIT Delhi, batch of 2014. He is working in Samsung R&D Institute India Bangalore since June 2014. His interest lies in machine learning and its applications in various domains, specifically speech and image. I also find Artificial Intelligence, NLP and Data Mining interesting. Mynepalli Siva Chaitanya Mynepalli Siva Chaitanya has completed his B.Tech in Electrical Engineering from IIT Bombay, batch of 2014. He is working in Samsung R&D Institute India - Bangalore since June 2014. His area of interest includes Neural Networks and Artificial Intelligence.
9cs.NE
Scale-Dependent Pedotransfer Functions Reliability for Estimating Saturated Hydraulic Conductivity Behzad Ghanbarian1*, Vahid Taslimitehrani2 and Yakov A. Pachepsky3 1 Bureau of Economic Geology, Jackson School of Geosciences, University of Texas at Austin, Austin, TX 78713 2 3 * PhysioSigns Inc., Sunnyvale, CA 94086 Environmental Microbial Safety Lab., USDA-ARS, Beltsville, MD 20705 Corresponding author’s email address: [email protected] Abstract Saturated hydraulic conductivity Ksat is a fundamental characteristic in modeling flow and contaminant transport in soils and sediments. Therefore, many models have been developed to estimate Ksat from easily measureable parameters, such as textural properties, bulk density, etc. However, Ksat is not only affected by textural and structural characteristics, but also by sample dimensions e.g., internal diameter and height. Using the UNSODA database and the contrast pattern aided regression (CPXR) method, we recently developed sample dimension-dependent pedotransfer functions to estimate Ksat from textural data, bulk density, and sample dimensions. The main objectives of this study were evaluating the proposed pedotransfer functions using a larger database, and comparing them with seven other models. For this purpose, we selected more than 1 nineteen thousands soil samples from all around the United States. Results showed that the sample dimension-dependent pedotransfer functions estimated Ksat more accurately than seven other models frequently used in the literature. Keywords: Contrast pattern aided regression, Pedotransfer function, Sample dimensions, Saturated hydraulic conductivity 1. Introduction Saturated hydraulic conductivity Ksat is essential in modeling surface and subsurface flow as well as solute transport in soils and sediments. Its estimation has been intensively investigated over the past several decades by soil physicists and hydrologists. Many empirical (e.g., Hazen, 1892; Puckett et al., 1985; Nemes et al., 2005; Parasuraman et al., 2006; Ghanbarian-Alavijeh et al., 2010), quasi-physical (e.g., Kozeny, 1927; Carman, 1937; Ahuja et al., 1984;1989; Rawls et al. 1993; Arya et al. 1999; Timlin et al. 1999), and physically-based (e.g., Katz and Thompson 1986; Xu and Yu 2008; Skaggs, 2011; Porter et al. 2013; Hunt et al. 2014; Ghanbarian et al. 2016) models as well as numerical techniques (see e.g., Zhang et al. 2005; Elliot et al. 2010; Mostaghimi et al. 2013; Ghanbarian and Daigle 2015; Dal Ferro and Morari 2015) were developed to estimate Ksat from other available properties. Among them, pedotransfer functions i.e., regressionbased models making use of available information to provide estimates of other related factors that are needed (Warrick, 2003), attracted a great deal of attention mainly due to their relatively high efficiency and simplicity. Pedotransfer functions also have limitations. For example, Schaap and Leij (1998a) showed that the performance of pedotransfer functions may strongly depend on data that were used to train (or develop) 2 and test (or validate). Nonetheless, pedotransfer functions have been actively developed to link soil hydraulic properties to readily measureable characteristics e.g., soil texture, bulk density, and organic matter content. To estimate the saturated hydraulic conductivity from other soil parameters pedotransfer functions have been developed using various techniques, such as multiple linear regression (e.g., Brakensiek et al., 1984; Cosby et al., 1984; Saxton et al., 1986; Jabro 1992), artificial neural networks (e.g., Schaap and Leij, 1998b; Schaap et al., 1998; 2001; Parasuraman et al., 2006; Ghanbarian-Alavijeh et al., 2010), genetic programming (e.g., Parasuraman et al., 2007), decision tree analysis (e.g., Shirley, 2011; Jorda et al., 2015), group method of data handling (e.g., Nemes et al., 2005), support vector machines (e.g., Twarakavi et al., 2009), and contrast pattern aided regression (Ghanbarian et al., 2015). Minasny and McBratney (2000) evaluated eight proposed pedotransfer functions for estimation of saturated hydraulic conductivity Ksat using published Australian soil data sets comprised different field and laboratory measurements over large areas and limited predictive variables. They found that the published PTFs of Dane and Puckett (1994), Cosby et al. (1984), and Schaap et al. (1998) gave the best estimations for sandy, loamy, and clayey soils, respectively. Sobieraj et al. (2001) evaluated the performance of nine Ksat pedotransfer functions including the Rosetta model (see their Table 3) in modeling the storm flow generated in a rainforest catchment and found them inaccurate. At shallow depths e.g., 0-0.1 m, pedotransfer functions, except Jabro (1992), commonly underestimated Ksat, while at subsequent depths e.g., 0.1-0.4 m pedotransfer functions, except Campbell and Shiozawa (1994), typically overestimated Ksat. 3 Gwenzi et al. (2011) evaluated five PTFs including Cosby et al. (1984), Jabro (1992), Puckett et al. (1985), Dane and Puckett (1994), and Saxton et al. (1986). They showed that all evaluated Ksat models underestimated by an order of magnitude, suggesting that application of water balance simulation models based on such PTFs may constitute a bias in model outputs. More recently, Ghanbarian et al. (2015) proposed sample dimension-dependent pedotransfer functions to estimate saturated hydraulic conductivity Ksat using the contrast pattern aided regression (CPXR) method and soil samples from the UNSODA database. They showed that including sample dimensions i.e., sample internal diameter and height (or length) substantially improved Ksat estimations. Although numerous studies assessed the performance of different pedotransfer functions in estimation of water content and soil water retention curve, such evaluations for Ksat pedotransfer functions and estimations are limited in the literature and particularly restricted to assessments at small scales. Therefore, the main objective of this study was to use a large database including soil samples from all around the United States for (1) evaluating the sample dimension-dependent pedotransfer functions developed by Ghanbarian et al. (2015) using the contrast pattern aided regression (CPXR) method in estimation of saturated hydraulic conductivity Ksat from clay, silt, and sand contents, geometric mean diameter and standard deviation of diameters of soil particles, bulk density, and sample dimensions (i.e., internal diameter and height), and (2) comparing performance of the proposed CPXR-based pedotransfer functions with performance of seven other pedotransfer functions frequently applied in the literature. 4 2. Materials and Methods Here, we first describe datasets used in this study and then present proposed pedotransfer functions available in the literature for estimating saturated hydraulic conductivity from clay, silt, and sand content as well as bulk density. 2.1. Datasets The entire database used in this study includes 24 datasets and 19822 soil samples selected from the USKSAT database (Pachepsky and Park, 2015) and different states in the nation. The number of samples, Ksat measurement method, and average and standard deviation of different parameters for each dataset are summarized in Table 1. The average Ksat value varying between 12.3 (Jabro, 1992) and 1328.5 cm/day (Romkens et al., 1986), near three orders of magnitude variation, indicates different types of soils with various structures. This is an order of magnitude greater than the average Ksat range that Schaap et al. (1998) investigated through 620 soil samples from 30 sources in the United States. In the Results and Discussion section below, we however, show that the measured Ksat value actually spans even much more than 3 orders of magnitude (about 8) representing a very wide range of soils. Figure 1 showing the percentage of samples in each USDA soil texture class and the distribution of samples on the ternary diagram also implies various types of soils with different textures used in this study. 2.2. Saturated hydraulic conductivity pedotransfer functions There are tremendous amount of models in the literature estimating the saturated hydraulic conductivity from other properties. However, the focus of our study is Ksat 5 estimation from frequently available characteristics, such as soil textural data i.e., sand, silt, and clay content and bulk density for soil mapping purposes at large scales. In Table 2, we list 7 models commonly used in the literature including Brakensiek et al. (1984), Campbell and Shiozawa (1994), Cosby et al. (1984), Jabro (1992), Puckett et al. (1985), Dane and Puckett (1994), and Saxton et al. (1986). Both Campbell and Shiozawa (1994) and Puckett et al. (1985) used the same database consisting of 42 samples (six Ultisols taken at seven locations in the lower coastal Plain of Alabama). The Cosby et al. (1984) model was proposed based on 1448 samples from Holtan et al. (1968) and Rawls et al. (1976). Jabro (1992) presented his model using 350 soil samples collected from the literature e.g., Southern Cooperation Series Bulletins. Dane and Puckett (1994) developed their model using 577 samples (Ultisols from lower coastal Plain of Alabama). The Saxton et al. (1986) model was developed using a database including 230 selected data points uniformly spaced on the hydraulic conductivity curves for 10 textures classes reported by Rawls et al. (1982). All these models, except Brakensiek et al. (1984), estimate Ksat from sand, silt, and clay content and bulk density 𝜌! . The Brakensiek et al. (1984) model, however, requires porosity value as well, which was estimated by 1 − 𝜌! 𝜌! in which 𝜌! , the particle density, was assumed to be approximately equal to 2.65 g/cm3 for all samples. We should point out that we eliminated the Jabro (1992) dataset (see Table 1) from this model evaluation process since the assessment of the Jabro (1992) model using the same dataset used to develop it would be biased and not supported. In addition, the Jabro (1992) model estimates Ksat from logarithms of clay and silt content (see Table 2). As a consequence, the Jabro (1992) model returns unrealistic Ksat estimate for samples with 6 either zero clay or silt content. Removing the Jabro (1992) dataset as well as those samples with either zero clay or silt content resulted in n = 19480 in evaluation of the Jabro (1992) model. The sample dimension-dependent model of Ghanbarian et al. (2015) presented in Table 3 consists of 14 patterns each of which corresponds to a specific model. Most patterns given in Table 3 match more than 10% (i.e., support > 10%) of the training data. As Ghanbarian et al. (2015) noted, even patterns with supports less than that still match about 10 samples of the training data. Moreover, patterns having relatively small supports often have large ARR (average residual reduction) values, implying that the matching samples of each such pattern represent an important data group where the baseline model f0 makes very large prediction errors and those errors are reduced significantly by the local model (see Table 3) corresponding to each pattern (Ghanbarian et al., 2015). To estimate Ksat using the Ghanbarian et al. (2015) model, first the relevant pattern that the data match with is found, and then using the corresponding local model given in Table 3 Ksat is estimated. One should expect that one soil sample may match more than one pattern. In that case, all relevant patterns should be identified and used to estimate Ksat. The weighted average of all Ksat values estimated by different patterns and local models then represents the Ghanbarian et al. (2015) model estimation. In case a sample does not match any pattern, Ksat is estimated using the baseline model f0 given in Table 3. The detail of the CPXR approach can be found in Ghanbarian et al. (2015). The Java code for Ksat estimation by the Ghanbarian et al. (2015) model and other models presented in Table 2 is given in the Supplementary Material. 7 In order to compare statistically the accuracy of the discussed models in the estimation of Ksat, the root mean square log-transformed error (RMSLE) and mean log-transformed error (MLE) parameters were determined as follows 𝑅𝑀𝑆𝐿𝐸 = ! 𝑀𝐿𝐸 = ! ! ! ! !!! ! !!![log log 𝐾!"# 𝐾!"# !"# !"# − log 𝐾!"# − log 𝐾!"# !"#$ ! !"#$ ] (1) (2) where n is the number of values, and (Ksat)cal and (Ksat)meas are the calculated (estimated) and measured saturated hydraulic conductivities, respectively. 3. Results and Discussion Comparison of the performance of the selected models in the estimation of saturated hydraulic conductivity Ksat from sand, silt and clay content as well as bulk density is shown in Fig. 2. As can be seen, the Campbell and Shiozawa (1994) and Puckett et al. (1985) models with MLE = -0.96 and -0.41 tend to underestimate Ksat considerably over 8 orders of magnitude variation, while the Dane and Puckett (1994), Saxton et al. (1986) and Ghanbarian et al. (2015) models estimates are distributed more or less around the 1:1 line (MLE = 0.09, -0.06, and 0.08, respectively). Interestingly, although the Puckett et al. (1985) and Campbell and Shiozawa (1994) models were developed using the same exponential function and dataset (42 samples from the lower coastal Plain of Alabama) and have similar trend in Ksat underestimation, the Puckett et al. (1985) model is almost 25% more accurate than the Campbell and Shiozawa (1994) model (RMSLE = 0.92 vs. 1.27). Such a discrepancy in Ksat estimation implies that the Puckett et al. (1985) model could more efficiently detect nonlinear interactions between input and output variables than the Campbell and Shiozawa (1994) model. The MLE values for different Ksat models 8 and USDA soil texture classes presented in Table 4 also show that both Puckett et al. (1985) and Campbell and Shiozawa (1994) tend to underestimate Ksat for all soil texture classes, particularly intermediate to fine textured soils, while the Jabro (1992) model has a tendency to overestimate Ksat. As can be observed in Fig. 2, although the value of mean log-transformed error of the Cosby et al. (1984) model is near zero (MLE = -0.001), the Ksat estimations are biased since the model overestimates at lower Ksat (fine-textured soils) and underestimates at higher Ksat values (coarse-textured soils). In this model, the measured Ksat spans around 8 orders of magnitude (log(Ksat) varies between -2 to near 6), while the estimated log(Ksat) value is restricted to a much narrower range approximately between 0 and 3. The obtained results are, however, consistent with the results of Minasny and McBratney (2000) who found that the Cosby et al. (1984) model gave the best Ksat estimations for loamy soils with intermediate Ksat. Using 462 soil samples from Australia, Minasny and McBratney (2000) reported RMSLE = 6.41, 2.58, 2.71, 3.08, and 3.53 [ln(mm/hr)] for the Campbell and Shiozawa (1994), Cosby et al. (1984), Dane and Puckett (1994), Brakensiek et al. (1984), and Saxton et al. (1986) models, respectively, meaning the Cosby et al. (1984) model was the most accurate. These RMSLE values, however, are not comparable with those we present in Fig. 2 because (1) the Ksat units is different (mm/hr vs. cm/day), (2) the statistical parameter calculated in Minasny and McBratney (2000) is the root mean square natural log-transformed error, while that we report is root mean square log-transformed error, and (3) the number of samples in Minasny and McBratney (2000) is 462, whereas n in our study is 19822, resulted into RMSLE values much smaller than those reported by Minasny and McBratney (2000). 9 Figure 2 also shows that the Jabro (1992) model tends to overestimate Ksat substantially (MLE = 0.57). Although our results obtained at large scale might be in contrast with the results of Gwenzi et al. (2011) who reported that the Jabro (1992) model underestimated Ksat by an order of magnitude, the number of samples in our study compared to that in Gwenzi et al. (2011) is much larger and one thus expect the obtained results to be more general. The RMSLE values for different Ksat models and USDA soil texture classes are given in Table 5. As the bold RMSLE values in Table 5 indicate the most accurate model estimating Ksat for different soil texture classes precisely is Ghanbarian et al. (2015). Among all the models evaluated in this study and shown in Fig. 2, the estimations of the Ghanbarian et al. (2015) model are more appropriately and uniformly distributed around the 1:1 line indicating the most accurate model. Comparison of the RMSLE parameter calculated for each model shows that the value of RMSLE = 0.56 for the Ghanbarian et al. (2015) model is considerably smaller than that determined for other models. After Ghanbarian et al. (2015), the Dane and Puckett (1994) model estimates Ksat slightly better than the Saxton et al. (1986) and Cosby et al. (1984) models. Interestingly, both Dane and Puckett (1994) and Puckett et al. (1985) models have the same exponential function and input variable i.e., clay. However, the Dane and Puckett (1994) model with RMSLE = 0.73 estimated Ksat more accurately than the Puckett et al. (1985) model with RMSLE = 0.92. The main reason probably is in the former 577 soil samples were used to construct a relationship between Ksat and clay content, while in the latter only 42 samples. As a consequence, the larger the training database, the more reliable the validation results are. Figure 2 also shows that the Brakensiek et al. (1984) model estimated Ksat more 10 accurately than the Puckett et al. (1985) and Campbell and Shiozawa (1994) models. One should note that the calculated RMSLE value for the Jabro (1992) model is not directly comparable with those determined for other models since this model is using logarithms of clay and silt contents and, therefore, the number of samples suitable to evaluate this model is 342 less than that used to assess others. Results of our study confirm that the sample dimension-dependent Ghanbarian et al. (2015) model is the most accurate in the estimation of the soil saturated hydraulic conductivity Ksat. The main reasons for that are discussed below. First, the model proposed by Ghanbarian et al. (2015) is sample dimension-dependent, which means it requires more input variables such as sample height (or length) and internal diameter to estimate Ksat. The influence of sample dimension on Ksat has been well documented in the literature. For example, recently Pachepsky et al. (2014) showed the similarity of scale (sample dimension) dependencies in soils and sediments. They observed that as the characteristic size increased, Ksat value first increased by one or two orders of magnitude and then stabilized. More recently, Ghanbarian et al. (2015) showed that the influence of sample dimensions (internal diameter and height) and soil water retention curve on the estimation of the saturated hydraulic conductivity was comparable in both CPXR and multiple linear regression (MLR) methods (for more evidence comprehensive results see Ghanbarian et al. (2015) and references therein). Second, the Ghanbarian et al. (2015) model was developed using a novel and modern data mining technique, introduced recently by Dong and Taslimitehrani (Taslimitehrani and Dong, 2014; Dong and Taslimitehrani, 2015) and called contrast pattern aided regression (CPXR), while all other models were proposed using simple algorithms such 11 as multiple linear regressions (MLRs). Ghanbarian et al. (2015) compared CPXR-based pedotransfer functions with MLR-based ones in estimation of Ksat and demonstrated that under all circumstances the CPXR method performed batter than the MLR technique. The main advantage of the CPXR method compared to multiple linear regression-based models is that CPXR is capable to detect complex and nonlinear interactions between input variables that define different subgroups of data with highly distinct predictor– response relationships, and to extract nonlinear patterns among input and output variables. One more advantage of the CPXR technique is that the model can be reported in the readable and transparent form (Table 3) and, unlike results of artificial neural networks or support vector machine application, can be visually inspected and analyzed. 5. Conclusion In this study, we evaluated various models available in the literature to estimate soil saturated hydraulic conductivity Ksat. Using a large database including 19822 soil samples from all round the United States we compared the reliability of Brakensiek et al. (1984), Campbell and Shiozawa (1994), Cosby et al. (1984), Jabro (1992), Puckett et al. (1985), Dane and Puckett (1994), and Saxton et al. (1986) models. In addition to these models, the Ghanbarian et al. (2015) model estimating Ksat from textural data, bulk density as well as sample dimensions e.g., height (or length) and internal diameter was also assessed. As we emphasized before, the assessment of models estimating Ksat from other soil properties is limited in the literature. In addition, the existing evaluations are mainly restricted to fairly small databases and small scales, and therefore the obtained results reported in the literature might be in contradiction. Our results based on 19822 12 measurements including a very wide range of soils from all around the nation are unique and general. We conclusively showed that the proposed sample dimension-dependent pedotransfer functions of Ghanbarian et al. (2015) estimated Ksat substantially more accurately than seven other frequently used previously published models. Acknowledgment The USKSAT database used in this study is available upon request to Yakov Pachepsky ([email protected]). Publication was authorized by the director, Bureau of Economic Geology. 13 References Ahuja, L.R., J.W. Naney, R.E. Green, and D.R. Nielsen. 1984. Macro-porosity to characterize spatial variability of hydraulic conductivity and effects of land management. Soil Sci. Soc. Am. J. 48:699–702. Ahuja, L.R., D.K. Cassel, R.R. Bruce, and B.B. Barnes. 1989. Evalua- tion of spatial distribution of hydraulic conductivity using effective porosity data. Soil Sci. 148:404– 411. Arya, L. M., Leij, F. J., Shouse, P. J., & van Genuchten, M. T. (1999). Relationship between the hydraulic conductivity function and the particle-size distribution. Soil Science Society of America Journal, 63(5), 1063-1070. Bathke, D.K. and G. R. Cassel. 1991. Anistropic Variation of Profile Characteristics and Saturated Hydraulic Conductivity in an Ultisol Landscape. Soil Sci. Soc. Am. J.55:333–339. Baumhardt, R. L., Robert J. Lascano, and Dan R. Krieg. 1995. Physical and Hydraulic Properties of a Pullman and Amarillo Soil on the Texas South Plains. Vol. 95-1. Lubbock, TX: Texas Agricultural Experiment Station. Brakensiek, D.L., Rawls, W.J., Stephenson, G.R., 1984. Modifying SCS hydrologic soil groups and curve numbers for rangeland soils. ASAE paper no. 84203, St. Joseph, MI. Bruce, R.R. 1972. Hydraulic Conductivity Evaluation of the Soil Profile from Soil Water Retention Relations. Soil Sci. Soc. Am. J.36: 555–561. 14 Bruce, R. R., J. H. Dane, V. L. Quisenberry, N. L. Powell, and A. W. Thomas. 1983. Physical Characteristics of Soils in the Southern Region: Cecil. South. Co-op. Ser. Bull. 267 GA. Ag. Exp. Sta., Athens. Buol, S.W. and R.J. Southard. 1988. Division S-5-SOIL GENESIS, MORPHOLOGY, AND CLASSIFICATION Subsoil Blocky Structure Formation in Some North Carolina Paleudults and Paleaquults. Soil Sci. Soc. Am. J.52: 1069-1076. Available at: www.soils.org/publications/sssaj/abstracts/52/4/SS0520041069. Campbell, G.S., Shiozawa, S., 1994. Prediction of hydraulic properties of soils using particle-size distribution and bulk density data. In: van Genuchten, M.Th., et al. (Eds.). Proceedings of the International Workshop on Indirect Methods for Estimating the Hydraulic Properties of Unsaturated Soils. University of California, Riverside, CA, pp. 317-328. Carlisle, V.W. , C. T. Hallmark, F. Sodek, III, R. E. Caldwell, L. C. Hammond, and V. E. Berkeiser. 1981. Characterization Data For Selected Florida Soils. Soil Conservation Service, University of Florida, Institute of Food and Agricultural Sciences, Soil Sciences Department, Soil Characterization Laboratory. Carlisle, V. W., R. E. Caldwell, F. Sodek, III, L. C. Hammond, F. G. Calhoun, M. A. Granger, and H. L. Breland. 1978. Characterization Data for Selected Florida Soils. Univ. of Florida, Gainesville, FL. Carman, P.C. 1937. Fluid flow through granular beds. Trans. Inst. Chem. Eng. 15:150166. Coelho, M.A. 1974. Spatial Variability of Water Related Soil Physical Properties. Department of Soils, Water and Engineering, The University of Arizona. 15 Cosby, B.J., Hornberger, G.M., Clapp, R.B., Ginn, T.R., 1984. A statistical exploration of soil moisture characteristics to the physical properties of soils. Water Resour. Res. 20, 682-690. Dal Ferro, N., & Morari, F. (2015). From real soils to 3D-printed soils: reproduction of complex pore network at the real size in a silty-loam soil. Soil Science Society of America Journal, 79(4), 1008-1017. Dane, J.H. 1980. Comparison of Field and Laboratory Determined Hydraulic Conductivity Values. Soil Sci. Soc. Am. J.44:228–231. Dane, J.H., Puckett, W., 1994. Field soil hydraulic properties based on physical and mineralogical information. In: van Genuchten, M.Th., et al. (Eds.). Proceedings of the International Workshop on Indirect Methods for Estimating the Hydraulic Properties of Unsaturated Soils. University of California, Riverside, CA, pp. 389-403. Dane, J. H., D. K. Cassel, J. M. Davidson, W. L. Pollans, and V. L. Quisenberry. 1983. Physical Characteristics of Soils of the Southern Region: Troup and Lakeland Series. Vol. 266. Auburn: Alabama Agricultural Experiment Station, Auburn U. Print. Dong, G., & Taslimitehrani, V. (2015). Pattern-aided regression modeling and prediction model analysis. Knowledge and Data Engineering, IEEE Transactions on, 27(9), 24522465. Elliot, T. R., Reynolds, W. D., & Heck, R. J. (2010). Use of existing pore models and Xray computed tomography to predict saturated soil hydraulic conductivity. Geoderma, 156(3), 133-142. 16 Ghanbarian, B., & Daigle, H. (2015). Permeability in two-component porous media: Effective-medium approximation compared with lattice-Boltzmann simulations. Vadose Zone Journal. 15(2) doi:10.2136/vzj2015.05.0071. Ghanbarian-Alavijeh, B., Liaghat, A. M., & Sohrabi, S. (2010). Estimating saturated hydraulic conductivity from soil physical properties using neural networks model. World Acad. Sci. Eng. Technol, 4, 108-113. Ghanbarian, B., Taslimitehrani, V., Dong, G., & Pachepsky, Y. A. (2015). Sample dimensions effect on prediction of soil water retention curve and saturated hydraulic conductivity. Journal of Hydrology, 528, 127-137. Ghanbarian, B., Torres-Verdín, C., & Skaggs, T. H. (2016). Quantifying tight-gas sandstone permeability via critical path analysis. Advances in Water Resources, 92, 316-322. Gwenzi, W., Hinz, C., Holmes, K., Phillips, I. R., & Mullins, I. J. (2011). Field-scale spatial variability of saturated hydraulic conductivity on a recently constructed artificial ecosystem. Geoderma, 166(1), 43-56. Habecker, M.A., K. McSweeney and F.W. Madison. 1990. Identification and Genesis of Fragipans in Ochrepts of North Central Wisconsin. Soil Sci. Soc. Am. J.54:139–146. Hazen, A. 1892. Some physical properties of sands and gravels, with special reference to their use in filtration. 24th Annual Rep., Massachusetts State Board of Health, Pub. Doc. No. 34, 539–556. Holtan, H. N., C. B. England, G. P. Lawless, and G. A. Schumaker. 1968. Moisturetension data for selected soils on experimental watersheds, Rep. ARS 41-144, 609 pp., Agric. Res. Serv., Beltsville, MD. 17 Hubbard, R.K., C. R. Berdanier, H. F. Perkins, and R. A. Leonard. 1985. Characteristics of Selected Upland Soils of the Georgia Coastal Plain. USDA-ARS. ARS-37. U.S. Government Printing Office, Washington, DC. Hunt, A. G., R. P. Ewing, and B. Ghanbarian (2014), Percolation Theory for Flow in Porous Media, Lecture Notes Phys., vol. 880, 3rd ed., Springer, Heidelberg, Germany. Jabro, J. D. 1992. Estimation of saturated hydraulic conductivity of soils from particle size distribution and bulk density data. Am. Soc. Agric. Eng. 35: 557–560. Jorda, H., Bechtold, M., Jarvis, N., & Koestel, J. (2015). Using boosted regression trees to explore key factors controlling saturated and near-saturated hydraulic conductivity. European Journal of Soil Science, 66(4), 744-756. Katz, A. J., & Thompson, A. H. (1986). Quantitative prediction of permeability in porous rock. Physical review B, 34(11), 8179-8181. Kool, J.B., K. A. Albrecht, J. C. Parker, J. C. Baker. 1954. Physical & Chemical characterization of the Groseclose soil mapping unit. Blacksburg, VA, Virginia Agric. Exp. Sta., Virginia Polytechnic Institute and State University. Bulletin 86-4 Kozeny, J. 1927. Über Kapillare Leitung des Wassers im Boden. Sitzungsber. Akad. Wiss. Wien 136:271–306. Minasny, B., & McBratney, A. B. (2000). Evaluation and development of hydraulic conductivity pedotransfer functions for Australian soil. Soil Research, 38(4), 905-926. Mostaghimi, P., Blunt, M. J., & Bijeljic, B. (2013). Computations of absolute permeability on micro-CT images. Mathematical Geosciences, 45(1), 103-125. 18 Nemes, A., Rawls, W. J., & Pachepsky, Y. A. (2005). Influence of organic matter on the estimation of saturated hydraulic conductivity. Soil Science Society of America Journal, 69(4), 1330-1337. Pachepsky, Y.A., A.K. Guber, A.M. Yakirevich, L. McKee, R.E. Cady, and T.J. Nicholson. 2014. Scaling and Pedotransfer in Numerical Simulations of Flow and Transport in Soils. Vadose Zone Journal 13, doi:10.2136/vzj2014.02.0020 Pachepsky, Y., & Park, Y. (2015). Saturated hydraulic conductivity of US soils grouped according to textural class and bulk density. Soil Science Society of America Journal, 79(4), 1094-1100. Parasuraman, K., Elshorbagy, A., & Si, B. C. (2006). Estimating saturated hydraulic conductivity in spatially variable fields using neural network ensembles. Soil Science Society of America Journal, 70(6), 1851-1859. Parasuraman, K., Elshorbagy, A., & Si, B. C. (2007). Estimating saturated hydraulic conductivity using genetic programming. Soil Science Society of America Journal, 71(6), 1676-1684. Peele, T. C., O. W. Beale, and F. F. Lesesne. 1970. The Physical Properties of Some South Carolina Soils. South Carolina Experiment Station, Clemson University. Technical Bulletin 1037. Porter, L.B., R.W. Ritzi, L.J. Mastera, D.F. Dominic, and B. Ghanbarian-Alavijeh. 2013. The Kozeny–Carman equation with a percolation threshold. Ground Water 51:92–99. Price, K., C. R. Jackson, and A. J. Parker. 2010. Variation of Surficial Soil Hydraulic Properties across Land Uses in the Southern Blue Ridge Mountains, North Carolina, USA. Journal of Hydrology 383(3-4): 256-68. 19 Puckett, W. E., J. H. Dane, and B. F. Hajek. 1985. Physical and Mineralogical Data to Determine Soil Hydraulic Properties. Soil Sci. Soc. Am. J.49:831–836. Radcliffe, D.E., L. T. West, G. O. Ware, and R. R. Bruce. 1990. Infiltration in Adjacent Cecil and Pacolet Soils. Soil Sci. Soc. Am. J.54:1739–1743. Rawls, W., P. Yates, and L. Asmussen. 1976. Calibration of selected infiltration equations for the Georgia Coastal Plain. Rep. USDA-ARS-S-113, 110 pp., Agric. Res. Serv., Beltsville, MD. Rawls, W. J., Brakensiek, D. L., & Saxtonn, K. E. (1982). Estimation of soil water properties.Transactions of the ASAE, 25(5), 1316-1320. Rawls, W. J., Brakensiek, D. L., & Logsdon, S. D. (1993). Predicting saturated hydraulic conductivity utilizing fractal principles. Soil Science Society of America Journal, 57(5), 1193-1197. Rawls, W. J., D. Gimenez, and R. Grossman. 1998. Use of Soil Texture, Bulk Density, and Slope of the Water Retention Curve to Predict Saturated Hydraulic Conductivity. Trans. ASAE. 41:983–988. Robbins, C. W. 1977. Hydaulic Conductivity and Moisture Retention Characteristics of Southern Idaho's Silt Loam Soils. Res. Bull 99. Moscow, ID, Agric. Exp. Sta., Univ. of Idaho. Römkens, M J M., H. M. Selim, H. D. Scott, R. E. Phillips, and F. D. Whisler. 1986. Physical Characteristics of Soils in the Southern Region: Captina, Gigger, Grenada, Loring, Olivier, and Sharkey. Vol. 264. Mississippi Agricultural and Forestry Experiment Station: Mississippi State. 20 Römkens, M. J. M., H. M. Selim, R. E. Phillips, and F. D. Whisler. 1985. Physical Characteristics of Soils in the Southern Region: Vicksburg, Memphis, Maury Series. Vol. 266. Auburn, AL: Alabama Agricultural Experiment Station, Auburn U. Saxton, K.E., Rawls, W.J., Romberger, J.S., Pependick, R.I., 1986. Estimating generalized soil water characteristics from soil texture. Soil Sci. Soc. Am. J. 55, 12311238. Schaap, M. G., & Leij, F. J. (1998a). Database-related accuracy and uncertainty of pedotransfer functions. Soil Science, 163(10), 765-779. Schaap, M. G., & Leij, F. J. (1998b). Using neural networks to predict soil water retention and soil hydraulic conductivity. Soil and Tillage Research, 47(1), 37-42. Schaap, M. G., Leij, F. J., & van Genuchten, M. T. (1998). Neural network analysis for hierarchical prediction of soil hydraulic properties. Soil Science Society of America Journal, 62(4), 847-855. Schaap, M. G., Leij, F. J., & van Genuchten, M. T. (2001). ROSETTA: a computer program for estimating soil hydraulic parameters with hierarchical pedotransfer functions. Journal of hydrology, 251(3), 163-176. Sharratt, B. S. 1990. Water Retention, Bulk Density, Particle Size, and Thermal and Hydraulic Conductivity of Arable Soils in Interior Alaska. Vol. 83. Fairbanks, Alaska, Agricultural and Forestry Experiment Station, School of Agriculture and Land Resources Management, U of Alaska Fairbanks. Shirley, A. C. (2011). Estimating saturated hydraulic conductivity for southeastern soils using decision tree analysis. Master thesis. University of Georgia. 21 Skaggs, T. H. (2011). Assessment of critical path analyses of the relationship between permeability and electrical conductivity of pore networks.Advances in Water Resources, 34(10), 1335-1342. Sobieraj, J. A., Elsenbeer, H., & Vertessy, R. A. (2001). Pedotransfer functions for estimating saturated hydraulic conductivity: implications for modeling storm flow generation. Journal of Hydrology, 251(3), 202-220. Southard, R. J. and S. W. Buol. 1988. Subsoil Saturated Hydraulic Conductivity in Relation to Soil Properties in the North Carolina Coastal Plain. Soil Sci. Soc. Am. J. 52: 1091–1094. Taslimitehrani, V., & Dong, G. 2014. A New CPXR Based Logistic Regression Method and Clinical Prognostic Modeling Results Using the Method on Traumatic Brain Injury. InBioinformatics and Bioengineering (BIBE), 2014 IEEE International Conference on (pp. 283-290). IEEE (http://knoesis.org/library/download/BIBE2.pdf). Timlin, D. J., Ahuja, L. R., Pachepsky, Y., Williams, R. D., Gimenez, D., & Rawls, W. (1999). Use of Brooks-Corey parameters to improve estimates of saturated conductivity from effective porosity. Soil Science Society of America Journal, 63(5), 1086-1092. Twarakavi, N.K.C., Simunek, J., Schaap, M.G., 2009. Development of pedotransfer functions for estimation of soil hydraulic parameters using support vector machines. Soil Sci. Soc. Am. J. 73, 1443–1452. Warrick, A. W. (2003). Soil water dynamics. Oxford University Press, USA. 22 Xu, P., and B. Yu. 2008. Developing a new form of permeability and Kozeny–Carman constant for homogeneous porous media by means of fractal geometry. Adv. Water Resour. 31:74–81. Zhang, X., Deeks, L. K., Bengough, A. G., Crawford, J. W., & Young, I. M. (2005). Determination of soil hydraulic conductivity with the lattice Boltzmann method and soil thin-section technique. Journal of Hydrology, 306(1), 59-70. Zobeck, T. M., N. R. Fausey, and N. S. Al-Hamdan. 1985. Effect of Sample CrossSectional Area on Saturated Hydraulic Conductivity in Two Structured Clay Soils. Trans. ASAE. 28: 791–794. 23 Table 1. The average and standard deviation (in parentheses) of salient properties of soil samples (n = 19822) from various references in the USKSAT database used in this study. Sample height (cm) Sample diameter (cm) Ksat (cm/day) 4 (0) 5.4 (0) 110.5 (207.0) 23.8 (11.8) 7.5 (0) 7.6 (0) 89.3 (159.8) 25.3 (9.4) 29.8 (8.0) 7.6 (0) 7.6 (0) 46.5 (106.7) 59.9 (5.0) 14.9 (3.2) 51 (0) 5 (0) 42.3 (12.2) Constant head 1.54 (0.11) 46.8 (13.5) 20.8 (4.3) 32.4 (13.7) 6 (0) 5.4 (0) 145.9 (224.1) 257 Constant head 1.47 (0.18) 52.2 (22.1) 23.5 (12.5) 24.3 (15.3) 9.4 (0) 9.74 (0) 325.7 (461.5) Dane et al. (1983) 120 Constant head 1.54 (0.09) 91.9 (3.9) 4.6 (5.2) 3.8 (1.8) 6.4 (1.9) 6.8 (1.1) 1149.0 (889.3) Romkens et al. (1986) 72 Constant head 1.46 (0.10) 12.9 (9.2) 64.6 (9.4) 22.5 (7.2) 5.9 (1.1) 7 (0.83) 1328.5 (4583.5) Bathke and Cassel (1991) 25 7.6 (0) 7.6 (0) 421.7 (1183.3) Dane (1980) 6 6 (0) 5.4 (0) 235.9 (166.6) Samples no. Measurement method Kool et al. (1954) 74 Falling head Hubbard et al. (1985) 41 Constant head 1.71 (0.16) 67.8 (12.4) 8.4 (3.1) Boul and Southard (1988) 27 Constant head 1.55 (0.08) 44.8 (8.5) Robbins (1977) 15 Hydraulic head 1.33 (0.06) 25.2 (6.7) Bruce et al. (1983) 73 Peele et al. (1970) Reference Bulk density Sand% Silt% Clay% 1.41 (0.14) 17.5 (8.1) 53.7 (11.1) 29.1 (16.4) Constant-head permeameter 1.36 (0.16) 44.9 (17.9) 20.9 (10.0) 28.4 (14.7) Pressure head * 1.57 (0.09) 83.6 (1.8) 13.2 (1.0) 3.2 (1.7) 1.49 (0.04) 14.8 (1.3) 44.7 (8.3) 40.5 (7.0) 10.5 (8.2) 12.2 (10.0) 56.9 (8.5) Zobeck et al. (1985) 6 Miscellaneous Jabro (1992) 18 Constant head 1.53 (0.07) 17.3 (6.7) 25.8 (6.1) 7.6 (0) 7.6 (0) 12.3 (8.4) Bruce (1972) 3 Constant head 1.60 (0.05) 56.7 (18.9) 20.0 (3.6) 23.3 (17.2) 6.2 (0) 6.0 (0) 841.7 (718.1) Habecker et al. (1990) 14 Falling-head permeameter 1.45 (0.32) 35.8 (21.1) 54.2 (21.4) 10.0 (2.1) 7.5 (0) 7.6 (0) 277.1 (522.9) Radcliffe et al. (1990) 9 Constant head 1.52 (0.09) 52.0 (12.9) 19.3 (5.1) 28.7 (16.0) 7.6 (0) 7.6 (0) 209.3 (198.4) Coelho (1974) 175 Falling head 1.45 (0.16) 39.4 (21.8) 35.4 (14.4) 24.5 (11.1) 7.6 (0) 7.6 (0) 90.6 (186.5) Southard and Boul (1988) 27 Constant head 1.55 (0.08) 44.5 (8.4) 25.4 (9.2) 30.1 (7.4) 7.6 (0) 7.6 (0) 13.9 (23.3) Rawls et al. (1998) 166 Constant Head 1.52 (0.13) 90.3 (9.7) 3.4 (3.3) 6.3 (8.6) 5.4 (0) 3.0 (0) 640.1 (737.2) Carlisle et al. (1978) 780 Constant Head 1.50 (0.25) 83.7 (16.7) 5.7 (5.9) 10.4 (12.8) 5.4 (0) 3.0 (0) 548.5 (823.1) Carlisle et al. (1981) 17869 Constant Head 1.53 (0.17) 85.8 (15.9) 5.6 (7.3) 8.7 (11.9) 5.4 (0) 3.0 (0) 548.6 (725.6) Baumhardt et al. (1995) 4 Constant Head 1.42 (0.17) 40.4 (24.0) 22.9 (16.3) 36.8 (11.9) 50 (0) 75 (0) 101.6 (75.3) Romkens et al. (1985) 36 Constant Head 1.41 (0.05) 12.8 (10.5) 69.2 (9.5) 18.1 (8.4) 7.5 (0) 7.5 (0) 21.3 (37.3) Sharratt (1990) 14 Unknown 1.30 (0.23) 36.5 (25.0) 56.7 (23.1) 6.8 (3.9) 2.0 (0) 5.0 (0) 334.9 (1009.8) 9 Constant Head 1.12 (0.24) 56.1 (4.0) 15.6 (1.7) 7.5 (0) 7.5 (0) 62.4 (66.6) Price et al. (2010) * 28.0 (2.6) Including constant head blocks, constant head cores, and falling head permeameter. 24 129.4 (171.1) Table 2. Some proposed pedotransfer functions frequently used in the literature to estimate soil saturated hydraulic conductivity Ksat. Ksat (cm/day) model* Ksat = 24exp[19.52348ϕ − 8.96847 − 0.028212Cl + 0.00018107Sa2 − 0.0094125Cl2 − 8.395215ϕ2 + 0.077718ϕSa − 0.00298ϕ2Sa2 − 0.019492 ϕ2Cl2 + 0.0000173Sa2Cl + 0.02733ϕCl2 + 0.001434ϕSa2 − 0.0000035Cl2Sa] Campbell and Shiozawa (1994) Ksat = 129.6exp(-0.07Si – 0.167Cl) Cosby et al. (1984) Ksat = 60.96×10(-0.6 + 0.0126Sa – 0.0064Cl) Reference Brakensiek et al. (1984) Jabro (1992) Ksat = 24×[9.56 – 0.81log(Si) – 1.09log(Cl) – 4.64ρb] Puckett et al. (1985) Ksat = 376.7exp(-0.1975Cl) Dane and Puckett (1994) Ksat = 729.22exp(-0.144Cl) Saxton et al. (1986) Ksat = 24exp(12.012 – 0.0755Sa) * Sa: sand (%), Si: silt (%), Cl: clay (%), ρb: bulk density (g cm-3), and ϕ: porosity. 25 Table 3. Patterns, criteria, baseline regression model f0, and pedotransfer functions for the CPXR model developed by Ghanbarian et al. (2015) to estimate soil saturated hydraulic conductivity from sand, silt, and clay content, geometric mean and geometric standard deviation of particles, bulk density, and sample dimensions i.e., length and internal diameter. See the context for more detail about Ksat estimation using the baseline, criteria, and local models. Log(Ksat) [cm/day] Baseline model f0: −1180 + 11.89×Sa + 11.90×Si + 11.85×Cl + 5.25×dg + 0.028×σg − 3.86×ρb − 0.039×ID Criteria ARR 1 0.495 ≤ dg < 0.74, Cl < 15.8, 1.55 ≤ σg < 6.96, 0.2 ≤ Si < 20. 3, 74.4 ≤ Sa < 99.1, 1.23 ≤ ρb <1.6 1.5 Support (%) 16.0 2 49.6 ≤ Sa < 74.4, 2.5 ≤ L < 36.9, 3.2 ≤ ID < 7.5 2.3 14.6 3 40.5 ≤ Si < 60.6, 0.004 ≤ dg < 0.25, 6.96 ≤ σg < 12.38, 1.23 ≤ρb < 1.6 3.1 8.0 4 0.2 ≤ Si < 20.3, Cl < 15.8, 1.55 ≤ σg < 6.96, 74.4 ≤ Sa < 99.1 0.9 32.4 5 6.6 5.2 1.6 6.1 7 0.2 ≤ Si < 20.3, 0.004 ≤ dg < 0.25, 2.5 ≤ L < 36.9 6.96 ≤ σg < 12.38, Cl < 15.8, 2.5 ≤ L < 36.9, 3.2 ≤ ID < 7.5, 20. 3 ≤ Si < 40.5, 49.6 ≤ Sa < 74.4, 0.004 ≤ dg < 0.25 60.6 ≤ Si < 80.7, 2.5 ≤ L <36.9, 1.23 ≤ ρb < 1.6, 0.004 ≤ dg < 0.25, 0.1 ≤ Sa < 24.9 3.4 14.1 8 49.6 ≤ Sa < 74.4, 2.5 ≤ L < 36.9, 20.3 ≤ Si < 40.5, 3.2 ≤ ID < 7.5 2.1 12.7 9 15.8 ≤ Cl < 31.5, 2.5 ≤ L <36.9, 0.004 ≤ dg < 0.25, 1.23 ≤ ρb < 1.6 2.4 14.6 10 49.6 ≤ Sa < 74.4, 2.5 ≤ L < 36.9, 1.23 ≤ ρb < 1.6, 3.2 ≤ ID < 7.5 4.3 8.0 11 20.3 ≤ Si < 40.5, 2.5 ≤ L < 36.9, Cl < 15.8, 49.6 ≤ Sa < 74.4 0.9 15.0 12 1.55 ≤ σg < 6.96, Cl < 15.8 0.9 36.6 13 Cl < 15.8, 0.004 ≤ dg < 0.25, 2.5 ≤ L < 36.9 0.5 25.4 14 Cl <15.8, 2.5 ≤ L < 36.9 0.4 59.2 Pattern 6 Pattern Local model corresponding to each pattern 1 −1355.1 + 14.07×Sa + 9.91×Si − 50.2×dg + 18.39×σg − 12.99×ρb − 0.24×ID − 0.014×L 2 70.74 − 0.52×Sa − 0.64×Si − 30.4×dg − 1.73×σg − 4.66×ρb + 2.67×ID − 0.025×L 3 52.1 + 0.58×Sa − 0.56×Si − 230.6×dg − 2.68×σg − 1.18×ρb + 0.35×ID − 0.064×L 4 −1033.7 + 10.4×Sa + 9.7×Si + 7.6×Cl + 4.56×dg + 4.54×σg − 5.14×ρb − 0.2×ID − 0.0006×L 5 53.5 + 0.095×Sa − 0.54×Si − 73.4×dg − 1.58×σg − 7.77× ρb − 0.36×ID + 0.42×L 6 762.4 − 2.28×Sa − 7.1×Si − 770.8×dg − 22.7×σg − 2.07×ρb − 3.88×ID − 1.72×L 7 −50.5 − 1.59×Sa + 0.56×Si + 587.4×dg + 7.4×σg − 20.55×ρb + 0.43×ID − 0.18×L 8 −243.4 + 1.07×Sa + 2.16×Si + 156.74×dg + 5.04×σg − 1.42×ρb + 6.12×ID + 1.14×L 9 13.7 + 0.042×Sa − 0.104×Si − 60.1×dg − 0.035×σg − 2.84×ρb + 0.16×ID − 0.011×L 10 281.9 − 1.395×Sa − 2.37×Si − 142.4×dg − 5.28×σg − 22.61×ρb + 0.46×ID − 2.86×L 11 148.4 − 0.45×Sa − 1.3×Si − 145.3×dg − 4.2×σg − 4.3×ρb − 0.053×ID − 0.086×L 12 −896.5 + 9.2×Sa + 9.1×Si + 9.72×Cl − 5.4×dg − 1.37×σg − 4.7×ρb − 0.18×ID − 0.0005×L 13 −76.04 + 0.146×Sa − 0.66×Si − 144.7×dg − 3.13×σg − 1.32×ρb + 0.03×ID − 0.0606×L 14 −204.9 + 2.17×Sa + 2.15×Si + 2.4×Cl + 2.54×dg − 0.32×σg − 3.79×ρb − 0.2×ID + 0.086×L Sa: sand (%), Si: silt (%), Cl: clay (%), ρb: bulk density (g cm-3), dg: geometric mean diameter (mm), σg: geometric standard deviation (mm), ARR: average residual reduction. Other CPXR-based pedotransfer functions estimating soil saturated hydraulic 26 conductivity (SHC or Ksat) from other soil properties are available online at http://www.knoesis.org/resources/researchers/vahid/behzad.html 27 Table 4. Mean log-transformed error (MLE) of different models used in this study to estimate Ksat for 12 USDA soil texture classes. USDA soil texture class Ksat model Sa * LSa SaL L SiL Si SaCL CL SiCL SaC SiC C MLE Brakensiek et al. (1984) Campbell and Shiozawa (1994) Cosby et al. (1984) 0.18 0.59 0.76 -0.09 -0.74 -0.73 0.49 -0.77 -1.03 -0.32 -1.87 -1.08 -0.82 -0.66 -0.70 -1.80 -2.63 -3.11 -1.10 -2.35 -3.23 -1.96 -3.97 -3.11 -0.32 0.23 0.62 0.28 -0.21 -0.79 0.76 0.33 -0.18 0.63 -0.34 0.42 Jabro (1992) 0.77 0.17 0.16 0.36 0.41 1.52 0.21 0.04 0.42 0.42 0.04 0.93 Puckett et al. (1985) -0.29 -0.06 -0.13 -0.49 -0.36 -0.11 -0.75 -1.41 -1.48 -1.80 -2.75 -2.85 Dane and Puckett (1994) 0.05 0.41 0.51 0.27 0.32 0.37 0.14 -0.34 -0.45 -0.59 -1.38 -1.30 Saxton et al. (1986) 0.15 0.13 -0.19 -0.18 0.17 1.15 -0.86 -1.07 -0.49 -1.33 -1.25 -0.82 Ghanbarian et al. (2015) 0.03 0.30 0.39 0.16 0.30 0.36 0.06 -0.25 -0.17 -0.46 -0.70 -0.40 * Sa: Sand, LSa: Loamy sand, SaL: Sandy loam, L: Loam, SiL: Silt loam, Si: Silt, SaCL: Sandy clay loam, CL: Clay loam, SiCL: Silty clay loam, SaC: Sandy clay, SiC: Silty clay, and C: Clay 28 Table 5. Root mean square log-transformed error (RMSLE) of different models used in this study to estimate Ksat for 12 USDA soil texture classes. USDA soil texture class Ksat model Sa * LSa SaL L SiL Si SaCL CL SiCL SaC SiC C RMSLE Brakensiek et al. (1984) Campbell and Shiozawa (1994) Cosby et al. (1984) 0.62 0.92 1.10 0.82** 1.21 1.02 1.02 1.29 1.40 1.05 2.21 1.87 0.94 0.96 1.11 2.04 2.84 3.22 1.44 2.57 3.40 2.16 4.06 3.35 0.58 0.77 1.04 0.95 1.02 1.10 1.15 1.07 1.04 1.10 0.94 1.12 Jabro (1992) 1.10 0.93 0.95 1.02 1.14 1.71 0.98 1.16 1.10 1.12 1.18 1.59 Puckett et al. (1985) 0.55 0.68 0.82 1.10 1.09 0.86 1.18 1.71 1.83 2.03 2.88 3.15 Dane and Puckett (1994) 0.48 0.80 0.95 0.98 1.04 0.90 0.89 1.03 1.14 1.09 1.62 1.77 Saxton et al. (1986) 0.46 0.65 1.06 0.88 1.06 1.37 1.24 1.51 1.10 1.65 1.72 1.51 Ghanbarian et al. (2015) 0.42 0.64 0.77 0.82 0.83 0.87 0.70 0.74 0.80 0.80 1.01 0.82 * Sa: Sand, LSa: Loamy sand, SaL: Sandy loam, L: Loam, SiL: Silt loam, Si: Silt, SaCL: Sandy clay loam, CL: Clay loam, SiCL: Silty clay loam, SaC: Sandy clay, SiC: Silty clay, and C: Clay ** Bold numbers denote the least RMSLE values and most accurate model in each soil texture class 29 Soil texture Clay Silty clay Sandy clay Silty clay loam Clay loam Sandy clay loam Silt Silt loam Loam Sandy loam Loamy sand Sand 2.6 0.1 1.8 0.4 0.9 10.6 0.2 1.0 0.8 11.4 9.2 61.0 0.1 1 10 Percentage of samples 100 Fig. 1. Percentage of samples in each USDA soil texture class and distribution of samples on the ternary diagram (n = 19822). 30 -2 -2 2 6 10 Log(Calculated Ksat) [cm/day] 6 2 Jabro (1992) RMSLE = 1.08 MLE = 0.57 -6 -6 -2 2 6 6 10 6 10 -6 PuckeS et al. (1985) RMSLE = 0.92 MLE = -0.41 2 -2 6 Dane and PuckeS (1994) RMSLE = 0.73 MLE = 0.09 6 2 2 6 10 -6 -2 2 6 Ghanbarian et al. (2015) RMSLE = 0.56 MLE = 0.08 2 -6 -6 -2 2 6 10 Log(Measured Ksat) [cm/day] -6 -2 2 6 10 Log(Measured Ksat) [cm/day] -2 -6 10 -6 -2 Log(Measured Ksat) [cm/day] 6 2 -2 -6 10 -2 Log(Measured Ksat) [cm/day] 10 -6 Log(Calculated Ksat) [cm/day] Log(Calculated Ksat) [cm/day] 2 -2 Saxton et al. (1986) RMSLE = 0.78 MLE = -0.06 6 -2 2 Log(Measured Ksat) [cm/day] 10 2 Log(Measured Ksat) [cm/day] 10 -2 6 -6 -6 Log(Measured Ksat) [cm/day] Cosby et al. (1984) RMSLE = 0.78 MLE = -0.001 -2 -6 -6 Log(Calculated Ksat) [cm/day] 2 -2 -6 10 6 Log(Calculated Ksat) [cm/day] 2 10 Campbell and Shiozawa (1994) RMSLE = 1.27 MLE = -0.96 Log(Calculated Ksat) [cm/day] 6 10 Brakensiek et al. (1984) RMSLE = 0.85 MLE = 0.24 Log(Calculated Ksat) [cm/day] Log(Calculated Ksat) [cm/day] 10 10 Log(Measured Ksat) [cm/day] Fig. 2. Comparison of the saturated hydraulic conductivity Ksat estimated using eight different methods with the measured ones for all the data used in this study (n = 19822). Note that the number of samples in the elavuation of Jabro (1992) model is 19480 because some samples with either zero silt or clay content were removed from the entire database. The red dashed line represents the 1:1 line. 31
5cs.CE
On Efficiently Finding Small Separators in Temporal Graphs Philipp Zschoche∗, Till Fluschnik†, Hendrik Molter‡, and Rolf Niedermeier arXiv:1711.00963v4 [cs.DS] 19 Feb 2018 Institut für Softwaretechnik und Theoretische Informatik, TU Berlin, Germany, {zschoche,till.fluschnik,h.molter,rolf.niedermeier}@tu-berlin.de Abstract Vertex separators, that is, vertex sets whose deletion disconnects two distinguished vertices in a graph, play a pivotal role in algorithmic graph theory. For many realistic models of the real world it is necessary to consider graphs whose edge set changes with time. More specifically, the edges are labeled with time stamps. In the literature, these graphs are referred to as temporal graphs, temporal networks, time-varying networks, edge-scheduled networks, etc. While there is an extensive literature on separators in “static” graphs, much less is known for the temporal setting. Building on previous work, we study the problem of finding a small vertex set (the separator) in a temporal graph with two designated terminal vertices such that the removal of the set breaks all temporal paths connecting one terminal to the other. Herein, we consider two models of temporal paths: paths that contain arbitrarily many hops per time step (nonstrict) and paths that contain at most one hop per time step (strict). We settle the hardness dichotomy (NP-hardness versus polynomial-time solvability) of both problem variants regarding the number of time steps of a temporal graph. Moreover we prove both problem variants to be NP-complete even on temporal graphs whose underlying graph is planar. We show that on temporal graphs whose underlying graph is planar, if additionally the number of time steps is constant then the problem variant for strict paths is solvable in quasi linear time. Finally, for general temporal graphs we introduce the notion of a temporal core (vertices whose incident edges change over time). We prove that on temporal graphs with constant-sized temporal core, the non-strict variant is solvable in polynomial time, where the degree of the polynomial is independent of the size of the temporal core, while the strict variant remains NP-complete. 1 Introduction In complex network analysis, nowadays it is very common to have access and process graph data where the interactions in the data set are time-stamped. When using static graphs as a mathematical model for problem instances, the dynamics of interactions are not reflected and important information of the data might not be captured. A straightforward approach to incorporate the dynamics of interactions into the model is to use temporal graphs. A temporal graph is, informally speaking, a graph where the edge set may change over a discrete time interval. Having the dynamics of interactions represented in the model, it is essential to adapt definitions of connectivity and paths ∗ Supported by the Stiftung Begabtenförderung berufliche Bildung (SBB). Supported by the DFG, project DAMM (NI 369/13). ‡ Partially supported by DFG, project MATE (NI 369/17). † 1 s 2,4 3 z G1 : 1,2 1 1,2 1,3 2 G2 : G3 : G4 : 4 2 1 (a) A temporal graph G. (b) Layers of G. Figure 1: Subfigure (a) shows a temporal graph G and subfigure (b) its four layers G1 , . . . , G4 . The gray squared vertex forms a strict temporal (s, z)-separator, but no temporal (s, z)-separator. The two squared vertices form a temporal (s, z)-separator. to respect the temporal nature of the model. This directly affects the notion of separators in the temporal setting. Vertex separators are a fundamental primitive in static network analysis and it is folklore that they can be computed in polynomial time. In contrast to the static case, Kempe et al. [23] showed that the temporal analogue of this problem is NP-hard. Temporal graphs are a well-established concept in the literature and are also referred to as evolving [15] and time-varying [24] graphs, temporal networks [22, 23, 27], multidimensional networks [7], link streams [33], and edge-scheduled networks [6]. In this work, we use the well-established model in which each edge has a time stamp [1, 7, 20, 22, 23, 27]. Assuming discrete time steps, this is equivalent to a sequence of static graphs over a fixed set of vertices [28]. Formally, we define a temporal graph as follows. Definition 1.1 (Temporal Graph). An undirected temporal graph G = (V, E, τ ) is an ordered  V triple consisting of a set V of vertices, a set E ⊆ 2 × {1, . . . , τ } of time-edges, and a maximal time label τ ∈ N. See Figure 1 for an example with τ = 4, that is, a temporal graph with four time steps also referred to as layers. The static graph obtained from a temporal graph G by removing the time stamps from all time-edges we call the underlying graph of G. Many real-world applications have temporal graphs as underlying mathematical models. Consider for instance a public transportation network where the edges correspond to bus or train connections between stations (vertices). It is natural to model these connections with time stamps. Other examples include information spreading in social networks, communication in social networks, biological pathways or spread of diseases [22]. A fundamental question in temporal graphs, addressing issues such as connectivity [4, 27], survivability [24], and robustness [31], is whether there is a “time-respecting” path from a distinguished start vertex s to a distinguished target vertex z.1 We thoroughly study the computational complexity of separating s from z in a given temporal graph by deleting few vertices with the aim to identify tractable cases. To this end, we consider two very similar but still significantly differing path models (both used in the literature) in temporal graphs, leading to two corresponding models of temporal separation. 1 The sink is usually denoted by t in the literature. To be consistent with Michail [28] we use z instead as we reserve t to refer to points in time. 2 Table 1: Overview on our results. Herein, NP-c. abbreviates NP-complete, n and m denote the number of vertices and time-edges, respectively, G↓ refers to the underlying graph of an input temporal graph, and γ ∈ N denotes some fixed constant. a (Prop 3.2) b (Thm 4.3) c (Cor 3.6) d (Thm 4.8) e (Thm 5.3) f (Obs 5.2) General (s, z)-Separation Temporal Strict Temporal 2≤τ ≤4 5≤τ NP-completea O(n · m) b NP-c.a Planar G↓ with τ Temporal core general const. const. size NP-c.c NP-c.c open O(m log m) d O(nγ + m log m) NP-c.f e The two models. We start with the introduction of the “non-strict” model [23]. Given a temporal graph G = (V, E, τ ) with two distinct vertices s, z ∈ V , a temporal (s, z)-path of length ` in G is a sequence P = (({s = v0 , v1 }, t1 ), ({v1 , v2 }, t2 ), . . . , ({v`−1 , v` = z}, t` )) of time-edges in E, where vi 6= vj for all i, j ∈ {0, . . . , `} with i 6= j and ti ≤ ti+1 for all i ∈ {1, . . . , ` − 1}. A vertex set S is a temporal (s, z)-separator if there is no temporal (s, z)-path in G − S := (V \ S, {({v, w}, t) ∈ E | v, w ∈ V \ S}, τ ). We can now state the central problem of our paper. Temporal (s, z)-Separation Input: A temporal graph G = (V, E, τ ), two distinct vertices s, z ∈ V , and k ∈ N. Question: Does G admit a temporal (s, z)-separator of size at most k? Our second model is the “strict” variant. A temporal (s, z)-path P is called strict if ti < ti+1 for all i ∈ {1, . . . , ` − 1}. In the literature, strict temporal paths are also known as journeys [1, 2, 27, 28]. A vertex set S is a strict temporal (s, z)-separator if there is no strict temporal (s, z)-path in G − S. Thus, our second main problem, Strict Temporal (s, z)-Separation, is defined in complete analogy to Temporal (s, z)-Separation, just replacing (non-strict) temporal separators by strict ones. While the strict variant appears natural, the non-strict variant can be viewed as a more conservative version of the problem. For instance, in a disease-spreading scenario the spreading speed might be unclear. To ensure containment of the spreading by separating patient zero (s) from a certain target (z), a temporal (s, z)-separator might be the safer choice. Our contributions. In the following we summarize our results; see Table 1 for a survey. • In Section 3, we investigate the computational hardness of both problems under restrictions of the number of layers and under the restriction that the underlying graph is planar. We prove that both Temporal (s, z)-Separation and Strict Temporal (s, z)-Separation are NP-complete for all τ ≥ 2 and τ ≥ 5, respectively, strengthening a result by Kempe et al. [23] (they show NP-hardness for all τ ≥ 12). Moreover, we prove that both problems are NP-complete on temporal graphs that have a planar underlying graph. To this end, we prove that Length-Bounded (s, z)-Separation (for the problem definition, see Section 3) is NP-hard on planar graphs. • In Section 4, we identify tractable cases of both problems on temporal graphs with few layers. For the non-strict problem, our hardness result is already tight.2 For the strict variant, we 2 Temporal (s, z)-Separation with τ = 1 is equivalent to (s, z)-Separation on static graphs. 3 identify a dichotomy in the computational complexity by proving polynomial-time solvability of Strict Temporal (s, z)-Separation for τ ≤ 4. As a side product, we give a linear-time algorithm for the Single-Source Shortest Strict Temporal Paths problem, improving the best known running time [34] by a log-factor. Moreover, we prove that for constantly many layers, Strict Temporal (s, z)-Separation on planar graphs is solvable in O(|E| log |E|) time. • In Section 5, we introduce the notion of temporal cores in temporal graphs. Informally, the temporal core of a temporal graph is the set of vertices whose edge-incidences change over time. We prove that on temporal graphs with temporal core of constant size, Temporal (s, z)-Separation is solvable in O(|V |γ + |E| log |E|) time, where γ ∈ N is some fixed constant being independent of the size of the temporal core, while Strict Temporal (s, z)-Separation remains NP-complete even if the temporal core is empty. A particular virtue of our work is that our results point out that the choice of the model (strict versus non-strict) for a problem can have a crucial impact on the computational complexity of said problem. This is noticeable since the literature so far used both models without discussing the subtle differences in computational complexity. Related work. Our main reference is the work of Kempe et al. [23] who proved that Temporal (s, z)-Separation is NP-hard. In contrast, Berman [6] proved that computing temporal (s, z)-cuts (edge deletion instead of vertex deletion) is polynomial-time solvable. In the context of survivability of temporal graphs, Liang and Modiano [24] studied cuts where an edge deletion only last for δ consecutive time stamps. Moreover, they studied a temporal maximum flow defined as the maximum number of sets of journeys where each two journeys in a set do not use a temporal edge within some δ time steps. A different notion of temporal flows on temporal graphs was introduced by Akrida et al. [2]. They showed how to compute in polynomial time the maximum amount of flow passing from a source vertex s to a sink vertex z until a given point in time. The vertex-variant of Menger’s Theorem [26] states that the maximum number of vertex-disjoint paths from s to z equals the size of a minimum-cardinality (s, z)-separator. In static graphs, Menger’s Theorem allows for finding a minimum-cardinality (s, z)-separator via maximum flow computations. However, Berman [6] proved that the vertex-variant of an analogue to Menger’s Theorem for temporal graphs, asking for the maximum number of (strict) temporal paths instead, does not hold. Kempe et al. [23] proved that the vertex-variant of the former analogue to Menger’s Theorem holds true if the underlying graph excludes a fixed minor. Mertzios et al. [27] proved another analogue of Menger’s Theorem: the maximum number of strict temporal (s, z)-path which never leave the same vertex at the same time equals the minimum number of node departure times needed to separate s from z, where a node departure time (v, t) is the vertex v at time point t. Michail and Spirakis [29] introduced the time-analogue of the famous Traveling Salesperson problem and studied the problem on temporal graphs of dynamic diameter d ∈ N, that is, informally speaking, on temporal graphs where every two vertices can reach each other in at most d time steps at any time. Erlebach et al. [14] studied the same problem on temporal graphs where the underlying graph has bounded degree, bounded treewidth, or is planar. Additionally, they introduced a class of temporal graphs with regularly present edges, that is, temporal graphs where each edge is associated with two integers upper- and lower-bounding consecutive time steps of absence of the edge. Axiotis and Fotakis [4] studied the problem of finding the smallest temporal subgraph of a temporal graph such that single-source temporal connectivity is preserved on temporal graphs where the underlying 4 graph has bounded treewidth. 2 Preliminaries As a convention, N denotes the natural numbers without zero. For n ∈ N, we use [n] := [1, n] = {1, . . . , n}. Static graphs. We use basic notations from (static) graph theory [13]. Let G = (V, E) be an undirected, simple graph. We use V (G) and E(G) to denote the set of vertices and set of edges of G, respectively. We denote by G − V 0 := (V \ V 0 , {{v, w} ∈ E | v, w ∈ V \ V 0 }) the graph G without the vertices in V 0 ⊆ V . For V 0 ⊆ V , G[V 0 ] := G − (V \ V 0 ) denotes the induced subgraph of G by V 0 . A path of length ` is sequence of edges P = ({v1 , v2 }, {v2 , v3 }, . . . , {v` , v`+1 }) where vi 6= vj for all i, j ∈ [` − 1] with i 6= j. We set V (P ) = {v1 , v2 , . . . , v`+1 }. Path P is an (s, z)-path if s = v1 and z = v`+1 . A set S ⊆ V of vertices is an (s, z)-separator if there is no (s, z)-path in G − S. Temporal graphs. Let G = (V, E, τ ) be a temporal graph. The graph Gi (G) = (V, Ei (G)) is called layer i of the temporal graph G = (V, E, τ ) if and only if {v, w} ∈ Ei (G) ⇔ ({v, w}, i) ∈ E. The underlying graph G↓ (G) of a temporal graph G = (V, E, τ ) is defined as G↓ (G) := (V, E↓ (G)), where E↓ (G) = {e | (e, t) ∈ E}. (We write Gi , Ei , G↓ , and E↓ for short if G is clear from the context.) For X ⊆ V we define the induced temporal subgraph of X by G[X] := (X, {({v, w}, t) ∈ E | v, w ∈ X}, τ ). We say that G is connected if its underlying graph G↓ is connected. Let s, z ∈ V . S The vertices visited by P are denoted by V (P ) = `i=1 ei . For surveys concerning temporal graphs we refer to [8, 21, 22, 28]. Strict and non-strict temporal separators. Throughout the whole paper we assume that the underlying graph of the temporal input graph G is connected and that there is no time-edge between s and z. Furthermore, in accordance with Wu et al. [34] we assume that the time-edge set E is ordered by ascending labels. Moreover, we can assume that the number of layers is at most the number of time-edges: Lemma 2.1. Let I = (G = (V, E, τ ), s, z, k) be an instance of (Strict) Temporal (s, z)Separation. There is an algorithm which computes in O(|E|) time an instance I 0 = (G0 = (V, E 0 , τ 0 ), s, z, k) of (Strict) Temporal (s, z)-Separation which is equivalent to I, where τ 0 ≤ |E 0 |. Observe that a layer of a temporal graph that contains no edge is irrelevant for Temporal (s, z)-Separation. This also holds true for the strict case. Hence, we can delete such a layer from the temporal graph. This observation is formalized in the following two data reduction rules. Reduction Rule 2.1. Let G = (V, E, τ ) be a temporal graph and let [t1 , t2 ] ⊆ [1, τ ] be an interval where for all t ∈ [t1 , t2 ] the layer Gt is an edgeless graph. Then for all ({v, w}, t0 ) ∈ E where t0 > t2 replace ({v, w}, t0 ) with ({v, w}, t0 − t2 + t1 − 1) in E. Reduction Rule 2.2. Let G = (V, E, τ ) be a temporal graph. If there is a non-empty interval [t1 , τ ] where for all t0 ∈ [t1 , τ ] the layer Gt0 is an edgeless graph, then set τ to t1 − 1. We prove next that both reduction rules are exhaustively applicable in linear time. 5 2 s 1 1 b a 1 1 2 7 c 7, 8 z s (a) Reduction Rule 2.1 is applicable 1 1 b a 1 1 3 c 3, 4 z (b) Reduction Rule 2.1 is not applicable Figure 2: Figure 2a shows a temporal graph where Reduction Rule 2.1 is applicable. In particular, layers 3, 4, 5, 6 are edgeless. Figure 2b shows the same temporal graph after Reduction Rule 2.1 was applied exhaustively. Lemma 2.2. Reduction Rules 2.1 and 2.2 do not remove or add any temporal (s, z)-path from/to the temporal graph G = (V, E, τ ) and can be exhaustively applied in O(|E|) time. Proof. First we discuss Reduction Rule 2.1. Let G = (V, E, τ ) be a temporal graph, s, z ∈ V , [tα , tβ ] ⊆ [τ ] be an interval where for all t ∈ [tα , tβ ] the layer Gt is an edgeless graph. Let P = ((e1 , t1 ), . . . , (ei , ti ), (ei+1 , tj ), . . . , (en , tn )) be a temporal (s, z)-path, and let G0 be the graph after we applied Reduction Rule 2.1 once on G. We distinguish three cases. Case 1: If tβ > tn , then no time-edge of P is touched by Reduction Rule 2.1. Hence, P also exists in G0 . Case 2: If ti < tα < tβ < ti+1 , then there is a temporal (s, z)-path ((e1 , t1 ), . . . , (ei , ti ), (ei+1 , tj − tβ + tα − 1), . . . , (en , tn − tβ + tα − 1)) in G0 , because ti < ti+1 − tβ + tα − 1. Case 3: If tβ < t1 , then there is clearly a temporal (s, z)-path ((e1 , t1 − tβ + tα − 1), . . . , (en , tn − tβ + tα − 1)) in G0 The other direction works analogously. We look at a temporal (s, z)-path in G0 and compute the corresponding temporal (s, z)-path in G. Reduction Rule 2.1 can be exhaustively applied by iterating over the by time-edges (ei , ti ) in the time-edge set E ordered by ascending labels until the first t1 , t2 with the given requirement appear. Set x0 := −t2 +t1 −1. Then we iterate further over E and replace each time-edge (e, t) with (e, t+x0 ) until the next t1 , t2 with the given requirement appear. Then we set x1 = x0 − t2 + t1 − 1 and iterate further over E and replace each time-edge (e, t) with (e, t + x1 ). We repeat this procedure until the end of E is reached. Since we iterate over E only once, this can be done in O(|E|) time. Reduction Rule 2.2 can be executed in linear time by iterating over all edges and taking the maximum label as t1 . Note that the sets V and E remain untouched by Reduction Rule 2.2. Hence, the application of Reduction Rule 2.2 does not add or remove any temporal (s, z)-path. A consequence of Lemma 2.2 is that the maximum label τ can be upper-bounded by the number of time-edges and hence the input size. Proof of Lemma 2.1. Let G = (V, E, τ ) be a temporal graph, where Reduction Rules Pτ2.1 and 2.2 are not applicable. Then for each t ∈ [τ ] there is a time-edge (e, t) ∈ E. Thus, τ ≤ i=1 |{(e, t) ∈ E | t = i}| ≤ |E|. Regarding our two models, we have the following connection: Lemma 2.3. There is a linear-time computable many-one reduction from Strict Temporal (s, z)-Separation to Temporal (s, z)-Separation that maps any instance (G = (V, E, τ ), s, z, k) to an instance (G0 = (V 0 , E 0 , τ 0 ), s, z, k 0 ) with k 0 = k and τ 0 = 2 · τ . 6 Proof. Let I = (G = (V, E, τ ), s, z, k) be an instance of Strict Temporal (s, z)-Separation. We construct an equivalent instance I 0 = (G0 = (V 0 , E 0 , τ 0 = 2τ ), s, z, k 0 = k) in lineartime. Set V 0 = V ∪ VE , where VE := {e(v,w),i , e(w,v),i | e ∈ E} is called the set of edge-vertices. Next, let E 0 be initially empty. For each ({v, w}, t) ∈ E, add the time-edges ({v, e(v,w),t }, 2t − 1), ({e(v,w),t , w}, 2t), ({w, e(w,v),t }, 2t − 1), ({e(w,v),t , v}, 2t) to E 0 . This completes the construction of G0 . Note that this can be done in O(|V | + |E|) time. It holds that |V 0 | = |V | + 2 · |E| and that |E 0 | = 4 · |E|. We claim that I is a yes-instance if and only if I 0 is a yes-instance. ⇒: Let S be a temporal (s, z)-separator in G of size at most k. We claim that S is also a temporal (s, z)-separator in G0 . Suppose towards a contradiction that this is not the case. Then there is a temporal (s, z)-path P in G0 − S. Note that the vertices on P alternated between vertices in V and VE . As each vertex in VE corresponds to an edge, there is a temporal (s, z)-path in G − S induced by the vertices of V (P ) ∩ V . This is a contradiction. ⇐: Observe that from any temporal (s, z)-separator, we can obtain a temporal (s, z)-separator of not larger size that only contains vertices in V . Let S 0 be a temporal (s, z)-separator in G0 of size at most k only containing vertices in S. We claim that S 0 is also a temporal (s, z)-separator in G0 . Suppose towards a contradiction that this is not the case. Then there is a temporal (s, z) path P in G − S 0 . Note that we can obtain a temporal (s, z)-path P 0 in G0 − S 0 by adding for all consecutive vertices v, w, where v appears before w at time-step t on P , the vertex e(v,w),t . This is a contradiction. 3 Hardness Results In this section we establish some preliminary hardness results. We observe that both Temporal (s, z)-Separation and Strict Temporal (s, z)-Separation are strongly related to the NP-complete Length-Bounded (s, z)-Separation (LBS) problem [9, 32]: Given an undirected graph G = (V, E), two distinct vertices s, z ∈ V , and two integers k, ` ∈ N, is there a subset S ⊆ V such that |S| ≤ k and there is no (s, z)-path in G − S of length at most `? We get the following straight-forward reduction. Observation 3.1. There is a polynomial-time reduction from LBS to Strict Temporal (s, z)Separation that maps any instance (G, s, z, k, `) of LBS to an instance (G = (G1 , . . . , G` ), s, z, k) with Gi = G for all i ∈ [`] of Strict Temporal (s, z)-Separation. Baier et al. [5] showed that Length-Bounded (s, z)-Separation is NP-complete, even if the lower bound ` for the path length is five, and hence Strict Temporal (s, z)-Separation is NP-complete for all τ ≥ 5. This at hand, Lemma 2.3 implies that Temporal (s, z)-Separation is NP-complete for all τ ≥ 10. However, through closer inspection we get that the non-strict variant is already NP-complete for all τ ≥ 2. This improves a previous result by Kempe et al. [23] who showed NP-completeness of Temporal (s, z)-Separation and Strict Temporal (s, z)-Separation for all τ ≥ 12. We summarize in the following. Proposition 3.2. Temporal (s, z)-Separation is NP-complete for all τ ≥ 2 and Strict Temporal (s, z)-Separation is NP-complete for all τ ≥ 5. Proof. We will make use of the NP-complete Vertex Cover problem. 7 1 2 v v 1 1 2 sv 2 zv 1 w 1 s 1 sw 2 1 zw 1 w sx x z 2 zx 1 2 2 2 1 2 1 x Figure 3: The Vertex Cover instance (G, 1) (left) and the corresponding Temporal (s, z)-Separation instance from the reduction of Proposition 3.2 (right). The edge-edges are dashed (red), the vertex-edges are solid (green), and the vertex gadgets are in dotted boxes. Vertex Cover Input: A graph G = (V, E) and k ∈ N. Question: Is there a subset V 0 ⊆ V of size at most k such that for all {v, w} ∈ E it holds {v, w} ∩ V 0 6= ∅? Let (G = (V, E), k) be an instance of Vertex Cover. We say that V 0 ⊆ V is a vertex cover in G of size k if |V 0 | = k and V 0 is a solution to (G = (V, E), k). We refine the gadget of Baier et al. [5, Theorem 3.9] and reduce from Vertex Cover to Temporal (s, z)-Separation. Let I := (G = (V, E), k) be a Vertex Cover instance and n := |V |. We construct a Temporal (s, z)-Separation instance I 0 := (G0 = (V 0 , E 0 , 2), s, z, n + k), where V 0 := V ∪ {sv , tv : v ∈ V } ∪ {s, z} are the vertices and the time-edges are defined as vertex-edges z }| { E := {({s, sv }, 1), ({sv , v}, 1), ({v, zv }, 2), ({zv , z}, 2), ({s, v}, 2), ({v, z}, 1) : v ∈ V } ∪ 0 {({sv , zw }, 1), ({sw , zv }, 1) : {v, w} ∈ E} . | {z } edge-edges Note that |V 0 | = 3 · n + 2, |E 0 | = 6 · |V 0 | + 2 · |E|, and I 0 can be computed in polynomial time. For each vertex v ∈ V there is a vertex gadget which consists of three vertices sv , v, zv and six vertex-edges. In addition, for each edge {v, w} ∈ E there is an edge gadget which consists of two edge-edges {sv , zw } and {zv , sw }. See Figure 3 for an example. We prove that I is a yes-instance if and only if I 0 is a yes-instance. ⇒: Let X ⊆ V be a vertex cover of size k 0 ≤ k for G. We claim that S := (V \ X) ∪ {sv , zv | v ∈ X} is a temporal (s, z)-separator. There are |V | − |X| = n − k 0 vertices not in the vertex cover X and for each of them there is exactly one vertex in S. For each vertex in the vertex cover X there are two vertices in S. Hence, |S| = n − k 0 + 2k 0 ≤ n + k. 8 First, we consider the vertex-gadget of a vertex v ∈ V . Note that in the vertex-gadget of v, there are two distinct temporal (s, z)-separators {v} and {sv , zv }. Hence, every temporal (s, z)-path in G0 −S contains an edge-edge. Second, let e = {v, w} ∈ E and let Pe and Pe0 be the temporal (s, z)paths which contain the edge-edges of edge-gadget of e such that V (Pe ) = {s, sv , zw , z} and V (Pe0 ) = {s, sv , zv , z}. Since X is a vertex cover of G we know that at least one element of e is in X. Thus, sv , zv ∈ S or sv , zv ∈ S, and hence neither Pe nor Pe0 exist in Ĝ − S. It follows that S is a temporal (s, z)-separator in G0 of size at most n + k, as there are no other temporal (s, z)-path in G0 . ⇐: Let S be a temporal (s, z)-separator in G0 of size ` ≤ n + k and let v ∈ V . Recall that there are two distinct temporal (s, z)-separators in the vertex gadget of v, namely {v} and {sv , zv }, and that all vertices in V 0 \ {s, z} are from a vertex gadget. Hence, ` is of the form ` = n + k 0 ≤ n + k. We start with a preprocessing to ensure that for vertex gadget only one of these two separators are in S. Let Sv = S ∩ {v, sv , zw }. We iterate over Sv for each v ∈ V : Case 1: If Sv = {v} or Sv = {sv , zv } then we do nothing. Case 2: If Sv = {v, sv , zv } then we remove v from S and decrease ` by one. One can observe that all temporal (s, z)-paths which are visiting v are still separated by sv or wv . Case 3: If Sv = {v, sv } then we remove v from S and add zv . One can observe that S is still a temporal (s, z)-separator of size ` in G0 . Case 4: If Sv = {v, zv } then we remove v from S and add sv . One can observe that S is still a temporal (s, z)-separator of size ` in G0 . That is a complete case distinction because neither {sv } nor {zv } separate all temporal (s, z)-paths in the vertex gadget in v. Now we construct a vertex cover X for G by taking v into X if both sv and zv are in S. Since there are n vertex gadgets in G0 each containing either one or two vertices from S, it follows that |X| = |S| − n = k 0 ≤ k, Assume towards a contradiction that X is not a vertex cover of G. Then there is an edge {v, w} ∈ E where v, w 6∈ X. Hence, sv , zv , sw , zw 6∈ S and v, w ∈ S. This contradicts the fact that S is a temporal (s, z)-separator in G0 , because P = (({s, sv }, 1), ({sv , zw }, 1), ({zw , z}, 2)) is a temporal (s, z)-path in G0 − S. It follows that X is a vertex cover of G of size at most k. In the next section we prove that the bound on τ is tight in the strict case (note that for the non-strict case the tightness is obvious). This is the first case where we can observe a significant difference between the strict and the non-strict variant of our separation problem. Since Length-Bounded (s, z)-Separation is W[1]-hard with respect to the postulated separator size [19], from Observation 3.1 and Lemma 2.3 we obtain the following. Corollary 3.3. Both Temporal (s, z)-Separation and Strict Temporal (s, z)-Separation are W[1]-hard with respect to k. Furthermore, we show NP-completeness of Temporal (s, z)-Separation and Strict Temporal (s, z)-Separation for the restricted class of planar temporal graphs, that is, temporal graphs that have a planar underlying graph. To this end, we prove NP-hardness for Length-Bounded (s, z)-Separation on planar graphs—a result which we consider to be of independent interest; note that NP-completeness on planar graphs was only known for the edge-deletion variant of LBS on undirected graphs [17] and weighted directed graphs [30]. Theorem 3.4. Length-Bounded (s, z)-Separation on planar graphs is NP-hard. 9 k+1 1 s .. . v z Cs5 ... .. . ··· C.s6 .. ··· 1 . . Cs . Gs .. ··· Cs4 . .. . .. . .. . Cs2 ... .. . .. . .. . ··· Cs3 ··· .. ··· 1 . . Cv . . Gv .. ··· . .. . .. . .. . Cv2 ... .. . .. . .. . ··· ··· .. ··· 1 . . Cz . . Gz .. ··· . .. . .. . .. . .. . ··· Figure 4: A planar graph G (left) with edge costs (above edges) and the obtained G0 in the reduction from Theorem 3.4. The connector sets are highlighted in gray. The edge-gadgets are indicated by dashdotted lines. Roughly, the idea behind Theorem 3.4 is to reduce from an NP-complete planar edge-weighted edge-deletion variant of Length-Bounded (s, z)-Separation which has constant vertex degree. Since the degree is constant, one can replace a vertex with a grid-like gadget. Proof. We give a many-one reduction from the NP-complete [17] edge-weighted variant of LengthBounded (s, z)-Cut, referred to as Planar Length-Bounded (s, z)-Cut, where the input graph G = (V, E) is planar, has edge costs c : E → {1, k + 1}, has maximum degree ∆ = 6, the degree of s and z is three, and s and z are incident to the outerface, to Length-Bounded (s, z)-Separation. Let I := (G = (V, E, c), s, z, `, k) be an instance of Planar Length-Bounded (s, z)-Cut, and we assume k to be even3 . We construct an instance I 0 := (G0 , s0 , z 0 , `0 , k) of Length-Bounded (s, z)-Separation as follows. Construction. For each vertex v ∈ V , we introduce a vertex-gadget Gv which is a grid of size (2k+ 2) × (2k + 2), that is, a graph with vertex set {uvi,j | i, j ∈ [2k + 2]} and edge set {{uvi,j , uvi0 ,j 0 } | |i − i0 | + |j − j 0 | = 1}. There are six pairwise disjoint subsets Cv1 , . . . , Cv6 ⊆ V (Gv ) of size k + 1 that we refer to as connector sets. As we fix and orientation of Gv such that uv1,1 is in the top-left, there are two connector sets are on the top of Gv , two on the bottom of Gv , one on the left of Gv , and one on the right of Gv . Formally, Cv1 = {uv1,k+2 , . . . , uv1,2k+2 }, Cv2 = {uvk/2,2k+2 , . . . , uv3k/2,2k+2 }, Cv3 = {uv2k+2,k+2 , . . . , uv2k+2,2k+2 }, Cv4 = {uv2k+2,1 , . . . , uv2k+2,k+1 },Cv5 = {uvk/2,1 , . . . , uv3k/2,1 }, and Cv6 = {uv1,1 , . . . , uv1,k+1 }. Note that all (x, y)-paths are of length at most k 0 := (2k + 2)2 − 1, for all x, y ∈ V (Gv ), because there are only (2k + 2)2 vertices in V (Gv ). Let φ(G) be a plane embedding of G. We say that an edge e incident with vertex v ∈ V is at position i on v if e is ith edge incident with v when counted clockwise with respect to φ(G). For each edge e = {v, w}, we introduce an edge-gadget Ge that differs on the weight of e, as follows. Let e be at position i ∈ {1, . . . , 6} on v and at position j ∈ {1, . . . , 6} on w. If c(e) = 1, then Ge is constructed as follows. Add a path consisting of (` + 1) · k 0 − 1 vertices and connect 3 If k is odd, since s and z are incident with the outerface, then we can add a path of length ` − 1 with endpoints s and z and set the budget for edge deletions to k + 1. 10 one endpoint with each vertex in Cvi by an edge and connect the other endpoint with each vertex in Cwj by an edge. If c(e) = k + 1, then Ge is constructed as follows. We introduce a planar matching between the vertices in Cvi and Cwj . That is, for instance, we connect vertex uv1,k+2+p with uv1,2k+2−p for each p ∈ {0, . . . , k}, if i = j = 1, or we connect vertex uv1,1+p with uv2k+2,3k/2−p for each p ∈ {0, . . . , k}, if i = 6 and j = 2 (we omit the remaining cases). Then, replace each edge by a path of length at least (` + 1) · k 0 + 1 where its endpoints are identified with the endpoints of the replaced edge. Hence, a path between two vertex-gadgets has length at least (` + 1) · k 0 + 1. 0 0 0 0 Next, we choose connector sets Csi and Czj such that no vertex v ∈ Csi ∪ Czj is adjacent to a vertex from an edge-gadget. Such i0 and j 0 always exist because the degree of s and z is three. 0 Now, we add two special vertices s0 and z 0 and edges between s0 and each vertex in Csi , as well as 0 between z 0 and each vertex in Czj . Finally, we set `0 := 2 + (` + 1) · k 0 + ` ((` + 1) · k 0 + 1) . Note that G0 can be computed in polynomial time. Moreover, one can observe that G0 is planar by obtaining an embedding from φ. Correctness. We claim that I is a yes-instance if and only if I 0 is a yes-instance. ⇒: Let I be a yes-instance. Thus, there is a solution C ⊂ E with c(C) ≤ k such that there is no (s, z)-path of length at most ` in G − C. We construct a set S ⊂ V (G0 ) of size at most k by taking for each {v, w} ∈ C one arbitrary vertex from the edge-gadget G{v,w} into S. Note that since c(C) ≤ k, each edge in C is of cost one. Assume towards a contradiction that there is a shortest (s0 , z 0 )-path P 0 of length at most `0 in G0 − S. Since a path between two vertex-gadgets has length at least (` + 1) · k 0 + 1, we know that P 0 goes through at most ` edge-gadgets. Otherwise P 0 would be of length at least 2 + (` + 1) · [(` + 1) · k 0 + 1] = 2 + (` + 1) · k 0 + ` · [(` + 1) · k 0 + 1] + 1 = `0 + 1. Now, we reconstruct an (s, z)-path P in G corresponding to P 0 by taking an edge e ∈ E into P if P 0 goes through the edge-gadget Ge . Hence, the length of P is at most `. This contradicts that there is no (s, z)-path of length at most ` in G − C. Consequently, there is no (s0 , z 0 )-path of length at most `0 in G0 − S and I 0 is a yes-instance. ⇐: Let I 0 be a yes-instance. Thus, there is a solution S ⊆ V (G0 ) of minimum size (at most k) such that there is no (s0 , z 0 )-path of length at most `0 in G0 − S. Since S is of minimum size, it follows from the following claim that V (Gv ) ∩ S = ∅ for all v ∈ V . Claim 3.5. Let Gv be a vertex-gadget and i, j ∈ {1, . . . , 6} with i 6= j. Then, for each vertex set S ⊆ V (Gv ) of size at most k it holds that there are v1 ∈ Cvi \ S and v2 ∈ Cvj \ S such that there is a (v1 , v2 )-path of length at most k 0 in Gv − S. Proof of Claim 3.5. Let Gv be a vertex-gadget and Cvi , Cvj two connector sets of Gv , where i, j ∈ {1, . . . , 6} and i 6= j. We add vertices a and b and edges {a, a0 } and {b, b0 } to Gv , where a0 ∈ Cvi and b0 ∈ Cvj . There are 62 different cases in which i 6= j. It is not difficult to see that in each case there are k + 1 vertex-disjoint (a, b)-paths. The claim then follows by Menger’s Theorem [26]. Note that by minimality of S, it holds that V (Ge ) ∩ S = ∅ for all e ∈ E with c(e) = k + 1. We construct an edge set C ⊆ E of cost at most k by taking {v, w} ∈ E into C if there is a y ∈ V (G{v,w} ) ∩ S. Assume towards a contradiction that there is a shortest (s, z)-path P of length at most ` in G−C. We reconstruct an (s0 , z 0 )-path P 0 in G0 which corresponds to P as follows. First, we take an 0 0 edge {s0 , v} ∈ E(G0 ) such that v ∈ Csi \ S. Such a v always exists, because |Csi | = k + 1 and |S| ≤ k. 11 Let {s, w} ∈ E be the first edge of P and at position i on w. Then we add a (v, v 0 )-path Ps in Gs −S, such that v 0 ∈ Csi \ S. Due to Claim 3.5, such a (v, v 0 )-path Ps always exists in Gs − S and is of length at most k 0 . We take an edge-gadget Ge into P 0 if e is in P . Recall, that an edge-gadget is a path of length (` + 1) · k 0 + 1. Due to Claim 3.5, we can connect the edge-gadgets G{v1 ,v2 } , G{v2 ,v3 } of two consecutive edges {v1 , v2 }, {v2 , v3 } in P by a path of length at most k 0 in Gv2 . Let {vp , z} be the last 0 edge in P , be at position j on z, v ∈ Czj , and v 0 ∈ Czj . We add a (v, v 0 )-path of length k 0 in Gz − S (Claim 3.5). Note that P 0 visits at most ` + 1 vertex-gadgets and ` edge-gadgets. The length of P 0 is at most 2 + (` + 1) · k 0 + ` [(` + 1) · k 0 + 1] = `. This contradicts that S forms a solution for I 0 . It follows that there is no (s, z)-path of length at most ` in G − C and I is a yes-instance. As Observation 3.1 and Lemma 2.3 are planarity preserving, we get the following: Corollary 3.6. Both Temporal (s, z)-Separation and Strict Temporal (s, z)-Separation on planar temporal graphs is NP-complete. 4 On Temporal Graphs with Few Layers Consider the situation where a commuter wants to reach her working place (z) from home (s) by public transport. There is a certain time when she needs to be at work and a certain time span that she is willing to spend traveling from her home to work. Hence, considering the available transportation network, only a certain time interval is relevant. If we restrict the transportation network to this time interval, then it is reasonable to assume only few layers to be present. In this scenario, if there is no temporal (s, z)-separator of size k, then the commuter can reach her working place in time, even if k transport hubs are blocked. In the previous section we showed that (Strict) Temporal (s, z)-Separation is NP-complete already for (five) two layers (Proposition 3.2). In this section we determine for any smaller number of layers whether the respective problems are polynomial-time solvable. It is folklore that a minimum (s, z)-separator in static graphs can be computed in polynomial time. Thus, Temporal (s, z)-Separation is polynomial-time solvable for τ = 1. The strict variant is more interesting: We show in this section that a dichotomy takes place when τ increases from four to five, that is, if τ ≤ 4 we can solve Strict Temporal (s, z)-Separation in O(|V | · |E|) time. Furthermore, we show that Strict Temporal (s, z)-Separation on planar temporal graphs is solvable in O(|E| · log |E|) time for any arbitrary but fixed number of layers. Studying planar temporal graphs is well-motivated for instance in the context of transportation, since many street networks can be modeled by planar graphs. Strict Static Expansion. A key tool [2, 6, 23, 27, 34] is the time-expanded version of a temporal graph which reduces reachability and other related questions in temporal graphs to similar questions in directed graphs. Here, we introduce a similar tool for strict temporal (s, z)paths. Let G = (V, E, τ ) be a temporal graph and let V = {v1 , . . . , vn−2 } ∪ {s, z}. For each v ∈ {v1 , . . . , vn−2 }, we define the sets φ(v) := {t, t + 1 | t ∈ [τ ], ∃w : ({v, w}, t) ∈ E} and ~ φ(v) := {(t, t0 ) ∈ φ(v)2 | t < t0 ∧ @t00 ∈ φ(v) : t < t00 < t0 }. The strict static expansion of (G, s, z) is a directed acyclic graph H := (V 0 , A) where V 0 = {s, z}∪{ut,j | j ∈ [n−2]∧t ∈ φ(vj )} and A = A0 ∪As ∪ Az ∪ Acol , A0 := {(ui,j , ui+1,j 0 ), (ui,j 0 , ui+1,j ) | ({vj , vj 0 }, i) ∈ E}, As := {(s, ui+1,j ) | ({s, vj }, i) ∈ E}, ~ j ) ∧ j ∈ [n − 2]} (referred Az := {(ui,j , z) | ({vj , z}, i) ∈ E}, and Acol := {(ut,j , ut0 ,j ) | (t, t0 ) ∈ φ(v 12 1 s 1 u1,2 u2,1 u2,2 u3,1 u3,2 u3,3 u4,2 u4,3 u5,2 u5,3 s 2 v1 u1,1 3 v2 4 v3 z z 4 Figure 5: A temporal graph G (left) and the strict static expansion H for (G, s, z) (right). One strict temporal (s, z)-path in G and its corresponding (s, z)-path in H are marked (green). to as column-edges of H). Observe that each strict temporal (s, z)-path in G has a one-to-one correspondence to some (s, z)-path in H. We refer to Figure 5 for an example. Lemma 4.1. Let G = (V, E, τ ) be a temporal graph, where s, z ∈ V are two distinct vertices. The strict static expansion for (G, s, z) can be computed in O(|E|) time. Proof. Let G = (V, E, τ ) be a temporal graph, where V = {v1 , . . . , vn−2 } ∪ {s, z} and s, z ∈ V are two distinct vertices. Note that |V | ≤ |E| because G is connected. We construct the strict static expansion H = (S, A) for (G, s, z) as in four steps follows: First, we initiate for each j ∈ [n − 2] an empty linked list. Second, we iterate over the set E with non-decreasing labels and for each ({vj , vj 0 }, t): (i) Add ut,j , ut+1,j , ut,j 0 , ut+1,j 0 to S if they do not already exist. If we added a vertex ua,b then we push a to the b-th linked list. (ii) Add (ui,j , ui+1,j 0 ), (ui,j 0 , ui+1,j ) to A. This can be done in O(|E|) time. Observe, that the two consecutive entries in the i-th linked list is ~ i ). Third, we iterate over each linked list in increasing order to add the column-edges an entry in φ(v to A. Note that the sizes of all linked lists sum up to O(|E|). Last, we add s and z to S as well as the edges in As and Az to A. Note that the |S| as well as |A| can be upper-bounded by O(|E|). We employed a constant number of procedures each running in O(|E|) time. Thus, H can be computed in O(|E|) time. Single-Source Shortest Strict Temporal Paths. We say a strict temporal (s, z)-path is shortest if there is no strict temporal (s, z)-path of length `0 < `. As a subroutine hidden in our algorithmic results, we need to solve the Single-Source Shortest Strict Temporal Paths problem on temporal graphs: find shortest strict paths from a source vertex s to all other vertices in the temporal graph. Indeed, we provide a linear-time algorithm for this. We believe this to be of independent interest; it improves (with few adaptations to the model; for details see Section 4) previous results by Wu et al. [34], but in contrast to the algorithm of Wu et al. [34] our subroutine cannot be adjusted to the non-strict case. 13 Proposition 4.2. Single-Source Shortest Strict Temporal Paths is solvable in Θ(|E|) time, where |E| is the number of time-edges. On a high level, the algorithm of Proposition 4.2 constructs a directed acyclic graph from the temporal graph and then solves Single-Source Shortest Paths on the constructed directed acyclic graph in linear time (see Cormen et al. [10, Section 24.2]). The following proof makes use of a strict static expansion of a temporal graph. Proof. By Lemma 4.1, we compute the strict static expansion H = (S, A) of (G, s, z) in O(|E|) time and define a weight function ( 0, if (x, y) is a column-edge, ω : A → {0, 1}, (x, y) 7→ 1, otherwise. Observe that H with ω is a weighted directed acyclic graph and that the weight of an (s, z)-path in H with ω is equal to the length of the corresponding strict temporal (s, z)-path in G. Hence, we can use an algorithm, which makes use of the topological order of S on H, to compute for all v ∈ S a shortest (s, v)-path in H in O(|S| + |A|) = O(|E|) time (cf. Cormen et al. [10, Section 24.2]). Now we iterate over S and construct the shortest strict temporal (s, wj )-path in G from the shortest (s, ut,j )-path in H, where wj ∈ V , t ∈ {1, . . . , τ } and ut,j ∈ S. This can be done in O(|E|) time because |S| ∈ O(|E|). Consequently, the overall running time is O(|E|). Since the shortest strict temporal (s, z)-path in G can have length |E|, this algorithm is asymptotically optimal. Adaptations of Proposition 4.2 for the Model of Wu et al. [34]. Wu et al. [34] considered a model where the temporal graph is directed and a time-edge e has a traversal time φ(e) ∈ N ∪ {0}. In the context of strict temporal path φ(e) is always one. They excluded the case where φ(e) = 0, but pointed out that their algorithms can be adjusted to allow φ(e) = 0. However, this is not possible for our algorithm, because then the strict static expansion can contain cycles. Hence, we assume that φ(e) > 0 for all directed time-edges e. Let G = (V, E, τ ) be a directed temporal graph. We denote a directed time-edge from v to w in layer t by ((v, w), t) ∈ E. First, we initiate τ many linked lists. Without loss of generality we assume that τ ≤ |E|, see Lemma 2.1. Second, we construct a directed temporal graph G0 = (V 0 , E 0 , τ ), where V = V 0 and E 0 is empty in the beginning. Then we iterate over the time-edge set E by ascending labels. If ((v, w), t) ∈ E has φ((v, w)) = 1 then we add ((v, w), t) to E 0 . If ((v, w), t) ∈ E has φ((v, w)) > 1 then we add a new vertex x(v,w) to V 0 and add time-edge ((v, x(v,w) ), t) to E 0 and ((x(v,w) , w), t0 ) to the t0 -th linked list, where t0 = t + φ((v, w)) − 1. We call ((v, x(v,w) ), t) the original edge of (v, w) and ((x(v,w) , w), t0 ) the connector edge of (v, w). If we reach a directed time-edge with label t for the first time, then we add all directed time-edges from the t-th linked list to E 0 . Observe that for each strict temporal (s, z)-path in G there is a corresponding strict temporal (s, z)-path in G0 , additionally we have that E 0 is ordered by ascending labels and that G0 can be constructed in O(|E|) time. To construct a strict static expansion for a directed temporal graph G, we modify the edge set A0 := {(ui,j , ui+1,j 0 ), j 0 ) | ((vj , vj 0 ), i) ∈ E}, where ((vj , vj 0 ), i) ∈ E. Finally, we adjust the weight function ω from the algorithm of Proposition 4.2 such that ω(e) = 0 if e is a columnedges of correspond to a connector-edges, and ω(e) =Pφ(e) otherwise. Observe that for a strict temporal (s, z)-path P = (e1 , . . . , e` ) of traversal time `i=1 φ(ei ) the corresponding (s, z)-path in the strict static expansion is of weight of the traversal time of P . 14 Temporal Graphs with 4 Layers. Now we are ready to give a polynomial-time algorithm for Strict Temporal (s, z)-Separation on temporal graphs with τ ≤ 4. Theorem 4.3. Strict Temporal (s, z)-Separation for maximum label τ ≤ 4 can be solved in O(|V | · |E|) time. Our algorithm executes the following steps: 1. As a preprocessing step, remove unnecessary time-edges and vertices from the graph. 2. Compute an auxiliary graph called directed path cover graph of the temporal graph. 3. Compute a separator for the directed path cover graph. In the following, we explain each of the steps in more detail. The preprocessing reduces the temporal graph such that it has the following properties. Definition 4.4. A temporal graph G = (V, E, τ ) with two distinct vertices s, z ∈ V is reduced if (i) for each time-edge e ∈ E there is a strict temporal (s, z)-path which contains e, and (ii) there is no strict temporal (s, z)-path of length at most two in G. This preprocessing step can be performed in polynomial time: Lemma 4.5. Let I = (G = (V, E, τ ), s, z, k) be an instance of Strict Temporal (s, z)-Separation. In O(k · |E|) time, one can either decide I or construct an instance I 0 = (G0 = (V 0 , E 0 , τ ), s, z, k 0 ) of Strict Temporal (s, z)-Separation such that I 0 is equivalent to I, G0 is reduced, |V 0 | ≤ |V |, |E 0 | ≤ |E|, and k 0 ≤ k. The following proof makes use of a strict static expansion of a temporal graph. See Section 4 for more details. Proof. First, we remove all time-edges which are not used by a strict temporal (s, z)-path. Let I = (G = (V, E, τ )s, z, k) be an instance of Strict Temporal (s, z)-Separation. We execute the following procedure. (i) Construct the strict static expansion H = (S, A) of (G, s, z). (ii) Perform a breadth-first search in H from s and mark all vertices in the search tree as reachable. Let R(s) ⊆ S be the reachable vertices from s. (iii) Construct H 0 := (R(s), A0 ), where A0 := {(w, v) : (v, w) ∈ A and v, w ∈ R(s)}. Observe that H 0 is the reachable part of H from s, where all directed arcs change their direction. (iv) If z ∈ / R(s), then our instance I is a yes-instance. (v) Perform a breadth-first search from z in H 0 and mark all vertices in the search tree as reachable. Let R(z) ⊆ R(s) be the reachable set of vertices from z. In the graph H[R(s) ∩ R(z)] = H[R(z)], all vertices are reachable from s and from each vertex the vertex z is reachable. (vi) Output the temporal graph G0 := (V 0 , E 0 , τ ), where V 0 := {vi ∈ V | ∃j : xj,i ∈ R(z)} and E 0 := {({vj , vj 0 }, i) : (x(i−1),j , xi,j 0 ) ∈ E(H[R(z)])}. One can observe that G0 is a temporal subgraph of G. Note that all subroutines are computable in O(|E|) time (see Lemma 4.1). Consequently, G0 can be computed in O(|E|) time. We claim that for each time-edge in E 0 there is a strict temporal (s, z)-path in G0 which contains it. Let e = ({vj , vj 0 }, i) ∈ E 0 and assume towards a contradiction that there is no strict temporal (s, z)-path P in G0 which contains e. From the construction of G0 we know that (x(i−1),j , xi,j 0 ) ∈ E(H[R(z)]) or (x(i−1),j 0 , xi,j ) ∈ E(H[R(z)]). Hence, there is an (s, z)-path in H which contains either (x(i−1),j , xi,j 0 ) or (x(i−1),j 0 , xi,j ). Thus, there is a corresponding strict temporal (s, z)-path in G as well as in G0 which contains ({vj , vj 0 }, i). This is a contradiction. 15 V(1,3) 2 V(2,2) V(3,1) 2 t s 2 1 z s z V(1,2) V(2,1) Figure 6: The left side depicts an excerpt of a reduced temporal graph with maximum time-edge label τ = 4. Dashed arcs labeled with a number x indicate a shortest strict temporal path of length x. The right side depicts the directed path cover graph D from s to z of the reduced temporal graph. A gray arc from vertex set V(i,j) to vertex set V(i0 ,j 0 ) denotes that for two vertices v ∈ V(i,j) and w ∈ V(i0 ,j 0 ) there can be an arc from v to w in D. Take as an example the square-shaped vertex in V(2,2) and the diamond-shaped vertex in V(2,1) . Furthermore, we claim that a strict temporal (s, z)-path P in G if and only if P is a strict temporal (s, z)-path in G0 . Let P be a strict temporal (s, z)-path in G. Since P is a strict temporal (s, z)-path in G there is a corresponding (s, z)-path P 0 in H. Note that P 0 is a witness that all vertices in V (P 0 ) are in R(s) as well as in R(z). It follows from the construction of G0 that P is also a strict temporal (s, z)-path in G0 . The other direction works analogously. Let P be a strict temporal (s, z)-path in G0 of length two, where V (P ) = {s, z, v}. One can observe that each strict temporal (s, z)-separator must contain v. By Proposition 4.2, we can compute the shortest strict temporal (s, z)-path Ps in G0 in O(|E|) time and check whether Ps is of length two. If this is the case, then we remove vertex v ∈ V (Ps ) \ {s, z} and decrease k by one. Note that I is a no-instance if we can find k + 1 vertex-disjoint strict temporal (s, z)-path of length two and that, this can be done in O(k · |E|) time. If we have not decided yet whether I is a yes- or no-instance, then we construct the Strict Temporal (s, z)-Separation instance I 0 = (G0 = (V 0 , E 0 , τ ), s, z, k 0 ), where k 0 is k minus the number of vertex-disjoint strict temporal (s, z)-path of length two we have found. Finally, observe that I 0 is a yes-instance if and only if I is a yes-instance, G0 is reduced, and that we only removed vertices and time-edges. Thus, |V 0 | ≤ |V | and |E 0 | ≤ |E|. Lovász et al. [25] showed that the minimum size of an (s, z)-separator for paths of length at most four in a graph is equal to the number of vertex-disjoint (s, z)-paths of length at most four in a graph. We adjust their idea to strict temporal paths on temporal graphs. The proof of Lovász et al. [25] implicitly relies on the transitivity of connectivity in static graphs. This does not hold for temporal graphs; hence, we have to put in some extra effort to adapt their result to the temporal case. To this end, we define a directed auxiliary graph. Definition 4.6 (Directed Path Cover Graph). Let G = (V, E, τ = 4) be a reduced temporal graph, and s, z ∈ V be two distinct vertices. The directed path cover graph from s to z of G is a directed ~ such that (v, w) ∈ E ~ if and only if (i) v, w ∈ V , (ii) ({v, w}, t) ∈ E for some t ∈ [τ ], graph D = (V, E) (iii) v ∈ V(i,j) and w ∈ V(i0 ,j 0 ) such that i < i0 or v ∈ V(2,2) and w ∈ V(2,1) . Herein, a vertex x ∈ V 16 is in the set V(i,j) if the shortest strict temporal (s, x)-path is of length i and the shortest strict temporal (x, z)-path is of length j. Figure 6 depicts a generic directed path cover graph of a reduced temporal graph with τ = 4. Note that by Definition 4.4 of reduced temporal graphs, the set V(1,1) is always empty and hence not depicted. This is a crucial property that allows us to prove the following. Lemma 4.7. Let G = (V, E, τ = 4) be a reduced temporal graph, and let s, z ∈ V be two distinct vertices. Then the directed path cover graph D from s to z of G can be computed in O(|V | · |E|) time and S ⊆ V \ {s, z} is a strict temporal (s, z)-separator in G if and only if S is an (s, z)-separator in D. We introduce some notation we will use in the following proof. The departure time (arrival time) of a temporal (s, z)-path P = ((e1 , t1 ), . . . , (e` , t` )) is t1 (t` ), the traversal time of P is t` − t1 , and the length of P is `. Proof. Let G = (V, E, τ = 4) be a reduced temporal graph, and s, z ∈ V two distinct vertices. In ~ from s to z of G, we need to know the order to compute the directed path cover graph D = (V, E) shortest strict temporal (s, v)-path and the shortest strict temporal (v, z)-path in G for all v ∈ V . This can be done in O(|V | · |E|) time by Proposition 4.2. Now we iterate over the time-edge set E ~ Hence, the directed and check for each ({v, w}, t) whether there is an arc between v and w in E. ~ path cover graph D = (V, E) from s to z of G can be computed in O(|V | · |E|). We say that a strict temporal (s, z)-path P of length n in G is chordless if G[V (P )] does not contain a strict temporal (s, z)-path P 0 of length n − 1. If such a P 0 exists, we call P 0 a chord of P . Obviously, for a set X of vertices, if G−X does not contain any chordless strict temporal (s, z)-path, then G − X does not contain any strict temporal (s, z)-path. Now, we discuss the appearance of the directed path cover graph D. Assume towards a contradiction that there is a vertex v ∈ V(1,1) . Since G is reduced, there is no strict temporal (s, z)-paths of length two. Thus, if there is a vertex v ∈ V(1,1) , then there must be time-edges ({s, v}, t1 ) and ({v, z}, t2 ) such that t2 ≤ t1 . We distinguish two cases. Case 1: Let t2 ≤ t1 ≤ 2. Since G is reduced, we know that there is a strict temporal (s, z)-path P which contains ({v, z}, t2 ). The strict temporal (s, z)-path P must be of length at least three, because G is reduced Observe that the length of a strict temporal (s, z)-path is a lower bound for the arrival time. Hence, the arrival time of P is at least three. This is a contradiction because ({v, z}, t2 ) is the last time-edge of P and, therefore, t2 ≤ 2 is equal to the arrival time. Consequently, v ∈ / V(1,1) . Case 2: Let 3 ≤ t2 ≤ t1 . Since G is reduced, we know that there is a strict temporal (s, z)-path P which contains ({s, v}, t1 ). The strict temporal (s, z)-path P must be of length at least three because G is reduced. Observe that ({s, v}, t1 ) is the first time-edge of P . Hence, the departure time of P is at least three. Since, P is of length at least three, the arrival time of P is at least five. This is a contradiction because the maximum label is four. Consequently, v ∈ / V(1,1) . Observe that the sets V(1,3) , V(2,2) , V(3,1) , V(1,2) , V(2,1) are a partition of V , because all strict temporal (s, z)-paths are of length at most four and V(1,1) = ∅. In Figure 6, we can see the appearance of the directed path cover graph D from s to z of G. 17 We claim that for each chordless strict temporal (s, z)-path P in G, there is an (s, z)-path PD such that V (P ) = V (PD ). Let P be a chordless strict temporal (s, z)-path in G. Since G is reduced, P is of length three or four. Case 1: Let the length of P be three and V (P ) = {s, v1 , v2 , z} such that v1 is visited before v2 . Since there is no strict temporal (s, z)-path of length two, P forces v1 into V(1,2) and v2 ∈ V(2,1) . It is easy to see that v1 ∈ V(1,2) , just by the existence of P . That v1 ∈ V(1,2) is, just by the existence of P , easy to see. For v2 ∈ V(2,1) , we need that there is no strict temporal (s, v2 )-path of length one. Assume towards a contradiction that there would be a strict temporal (s, v2 )-path of length one or in other words there is a time-edge ({s, v2 }, t) ∈ E. All labels of the time-edge between v2 and z are at least three thus t is at least three, otherwise there is a strict temporal (s, z)-path of length two. There must be a strict temporal (s, z)-path P 0 which uses the time-edge ({s, v2 }, t), otherwise G is not reduced. Furthermore, P 0 must be of length at least three, otherwise G is not reduced. Thus, P 0 has departure time at most two. The time-edge ({s, vw }, t) is the first time-edge in P 0 because it is incident with s. Hence, t < 2. This contradicts the existence of a strict temporal (s, v2 )-path of length one, and hence v2 ∈ V(2,1) . From Definition 4.6, we know that there is an (s, z)-path PD such that V (P ) = V (PD ). Case 2: Let the length of P be four. Thus, it looks as follows. P = (({s, v1 }, 1), ({v1 , v2 }, 2), ({v2 , v3 }, 3), ({v3 , z}, 4)). It immediately follows that the shortest strict temporal (s, v1 )-path is of length one. Furthermore, the shortest strict temporal (s, v2 )-path is of length two, otherwise P would not be chordless. Now, we claim that v3 ∈ V(2,1) ∪V(3,1) . Assume towards a contradiction that v3 ∈ / V(2,1) ∪V(3,1) . Observe that v3 ∈ / V(2,2) because ({v3 , z}, 4) is a shortest strict temporal (v3 , z)-path of length one. Thus, there is a time-edge ({s, v3 }, t) ∈ E. This time-edge must be part of a strict temporal (s, z)-path, because G is reduced. Since v2 6= z, we have t ≤ 3. Note that (({s, v3 }, t ≤ 3), ({v3 , z}, 4)) would be a strict temporal (s, z)-path of length two. Hence, ({s, v3 }, t) ∈ / E and v3 ∈ V(2,1) ∪ V(3,1) . From Definition 4.6 we know that there is an (s, z)-path PD such that V (P ) = V (PD ). Let S ⊆ (V \ {s, z}) be an (s, z)-separator in D. Until now, we know that S is also a strict temporal (s, z)-separator in G, because for each chordless strict temporal (s, z)-path in G there is an (s, z)-path in D. Let L ⊆ (V \ {s, z}) be a strict temporal (s, z)-separator in G. It remains to be shown that L is an (s, z)-separator in D. Assume towards a contradiction that L is not an (s, z)-separator in D. Thus, there is an (s, z)path PD in D − L. The length of PD is either three or four, see Figure 6. Case 1: Let the length of PD be three and V (PD ) = {s, v1 , v2 , z} such that v1 is visited before v2 . Thus, v1 ∈ V(1,2) and v2 ∈ V(2,1) , see Figure 6. From Definition 4.6, we know that there are time-edges ({s, v1 }, t1 ), ({v1 , v2 }, t2 ), ({v2 , z}, t3 ) ∈ E. Note that each time-edge in G must be part of a strict temporal (s, z)-path and that there are no strict temporal (s, z)-paths of length two. Hence, t1 ∈ {1, 2}, t2 ∈ {2, 3}, and t3 ∈ {3, 4}. Since (({s, v1 }, t1 ), ({v1 , v2 }, t2 ), ({v2 , z}, t3 )) is not a strict temporal (s, z)-path in G by our assumption, we have either t1 = t2 = 2 or t2 = t3 = 3. 18 Case 1.1: Let t1 = t2 = 2. The time-edge ({v1 , v2 }, t2 = 2) must be part of a strict temporal (s, z)-path, and therefore we have either ({s, v2 }, 1) ∈ E or ({s, v1 }, 1) ∈ E. As time-edge ({s, v2 }, 1) cannot exist, v2 ∈ V(2,1) . Hence, ({s, v1 }, 1) ∈ E, t1 = 1 6= 2, (({s, v1 }, t1 ), ({v1 , v2 }, t2 ), ({v2 , z}, t3 )) is a strict temporal (s, z)-path in G, and it holds that {v1 , v2 } ∩ L 6= ∅. This contradicts the existence of PD in D − L. Case 1.2: Let t2 = t3 = 3. There is a strict temporal (s, z)-path which contains the timeedge ({v1 , v2 }, t3 = 3). Since t3 = 3, there is either a ({v1 , z}, 4) ∈ E or ({v2 , z}, 4) ∈ E. The time-edge ({v1 , z}, 4) cannot exist because v1 ∈ V(1,2) . Hence ({v2 , z}, 4) ∈ E, t3 = 4 6= 3, (({s, v1 }, t1 ), ({v1 , v2 }, t2 ), ({v2 , z}, t3 )) is a strict temporal (s, z)-path in G, and {v1 , v2 } ∩ L 6= ∅. This contradicts the existence of PD in D − L. Case 2: Let the length of PD be four, and V (PD ) = {s, v1 , v2 , v3 , z} such that v1 is visited before v2 and v2 is visited before v3 . Considering Figure 6, one can observe that v1 ∈ V(1,3) ∪ V(1,2) and v2 ∈ V(2,2) . From Definition 4.6, we know that there are time-edges ({s, v1 }, t1 ), ({v1 , v2 }, t2 ), ({v2 , v3 }, t3 ), ({v3 , z}, t4 ) ∈ E. There is a strict temporal (s, z)-path P containing ({v1 , v2 }, t2 ) because G is reduced. Since v2 ∈ V(2,2) , we know that P is of length four and the first two time-edges of P . Now assume towards a contradiction that P visits v2 before v1 . Hence, ({v1 , v2 }, t2 ) is the third time-edge in P . The first two time-edges of P are a strict temporal (s, v2 )-path of length two and arrival time at least two. Thus, t2 ≥ 3. Observe that there is no strict temporal (v1 , z)path of length one and hence there is no time-edge ({v1 , z}, 4), because v1 ∈ V(1,2) ∪ V(1,3) . This contradicts P visiting v2 before v1 . Consequently, the strict temporal (s, z)-path P visits v1 before v2 and ({v1 , v2 }, t2 ) is the second time-edge in P . Hence, t2 = 2 and there is a time-edge ({s, v1 }, 1) in P . This implies t1 = 1. The vertex v3 ∈ V(2,1) ∪ V(3,1) , see Figure 6. There is a strict temporal (s, z)-path which contains ({v2 , v3 }, t3 ), because G is reduced. Since v3 ∈ V(2,1) ∪ V(3,1) and v2 ∈ V(2,2) , all strict temporal (s, v2 )-paths and strict temporal (s, v3 )-paths have length at least two and thus also arrival time at least two. Hence, t3 ≥ 3. Because v2 6= z 6= v3 and there is a strict temporal (s, z)-path which contains ({v2 , v3 }, t3 ), we have t3 < 4 ⇒ t3 = 3 and there is either a time-edge ({v2 , z}, 4) ∈ E or ({v3 , z}, 4) ∈ E. The time-edge ({v2 , z}, 4) cannot exist, otherwise there would be a strict temporal (v2 , z)-path of length one, but v2 ∈ V(2,2) . This implies that ({v3 , z}, 4) ∈ E and t4 = 4. Hence, the time-edge sequence (({s, v1 }, t1 ), ({v1 , v2 }, t2 ), ({v2 , v3 }, t3 ), ({v3 , z}, t4 )) forms a strict temporal (s, z)-path and {v1 , v2 , v3 } ∩ L 6= ∅. This contradicts the existence of PD in D − L. In summary, PD cannot exist in D − L. Consequently, L is an (s, z)-separator in D. Figure 7 shows that if τ = 5 we can construct a reduced temporal graph where the set V(1,1) is not empty. This indicates why our algorithm fails for τ = 5. Finally, with Lemmata 4.5 and 4.7 we can prove Theorem 4.3. Proof of Theorem 4.3. Let I := (G = (V, E, τ = 4), s, z, k) be an instance of Strict Temporal (s, z)-Separation. First, apply Lemma 4.5 in time O(k · |E|) time to either decide I or to obtain an instance I 0 = (G0 = (V 0 , E 0 , τ ), s, z, k 0 ) of Strict Temporal (s, z)-Separation. In the second case, compute the directed path cover graph D from s to z of G0 in O(|V 0 | · |E 0 |) time (by Lemma 4.7). Next, check whether D has an (s, z)-separator of size at most k 0 in O(k 0 · |E 0 |) time by 19 V(1,1) 3 s 1 x 3 v 2 4 y z 5 Figure 7: A reduced temporal graph with maximum label τ = 5 where the vertex set V(1,1) of the directed path cover graph is not empty. The red and green edges are strict temporal paths and show that edges ({s, v}, 3) and ({v, z}, 3) are not removed when the graph is reduced (Definition 4.4). Furthermore, v is not removed since (({s, v}, 3), ({v, z}, 3)) is not a strict temporal path. a folklore result [18]. By Lemma 4.7, D has an (s, z)-separator of size k 0 if and only if G0 has a strict temporal (s, z)-separator of size k 0 . Since by Lemma 4.5 we have that G0 is reduced, |V 0 | ≤ |V |, |E 0 | ≤ |E|, and k 0 ≤ k, the overall running time is O(|V | · |E|). Planar Temporal Graphs. We employ the optimization variant of Courcelle’s Theorem to show that Strict Temporal (s, z)-Separation on planar temporal graphs is efficiently solvable, if the maximum label τ is a constant. Theorem 4.8. Strict Temporal (s, z)-Separation on planar temporal graphs can be solved in O(|E| · log |E|) time, if the maximum label τ is constant. To prove Theorem 4.8, we first introduce MSO and state the optimization variant of Courcelle’s Theorem. Monadic second-order ( MSO) logic consists of a countably infinite set of (individual) variables, unary relation variables, and a vocabulary. A formula in monadic second-order logic on graphs is constructed from the vertex variables, edge variables, an incidence relation between edge and vertex variables inc(e, x), the relations =, ∧, ∨, ¬, and the quantifiers ∀ and ∃. We will make use of many folklore shortcuts, for example: 6=, ⊆ , v ∈ V to check whether v is a vertex variable, and e ∈ E to check whether e is an edge variable. The treewidth tw(G) of a graph G measures how tree-like a graph is. In this paper we are using the following theorem and the treewidth of a graph as a black box. For formal definitions of treewidth and MSO, refer to Courcelle and Engelfriet [11]. Theorem 4.9 (Arnborg et al. [3], Courcelle and Engelfriet [11]). There exists an algorithm that, given (i) an MSO formula ρ with free monadic variables X1 , . . . , Xr , (ii) an affine function α(x1 , . . . , xr ), and (iii) a graph G, finds the minimum (maximum) of α(|X1 |, . . . , |Xr |) over evaluations of X1 , . . . , Xr for which formula ρ is satisfied on G. The running time is f (|ρ|, tw(G)) · |G|, where |ρ| is the length of ρ, and tw(G) is the treewidth of G. Proof of Theorem 4.8. Let I = (G = (V, E, τ ), s, z, k) be an instance of Strict Temporal (s, z)Separation, where the underlying graph of G is planar. We define the optimization variant of Strict Temporal (s, z)-Separation in monadic second order logic (MSO) and show that it is sufficient to solve the Strict Temporal (s, z)-Separation on a temporal graph where we can upper-bound the treewidth of the underlying graph by a function only depending on τ . 20 We define the edge-labeled graph L(G) to be the G↓ of G with the edgePτ underlying graph τ i−1 labeling ω : E(G↓ ) → [2 − 1] with ω({v, w}) = , where 1{v,w}∈Ei = 1 if i=1 1{v,w}∈Ei · 2 and only if ({v, w}, i) ∈ E, and 0 otherwise. Observe that in binary representation, the i-th bit of ω({v, w}) is one if and only if {v, w} exists at time point i. To compute L(G) we first iterate over the time-edge set E and add an edge  {v, w} to the edge set E of the underlying graph L(G) whenever we find a time-edge {v, w}, t ∈ E. Furthermore, we associate with each edge in E an integer ω{v,w} which is initially zero, and gets an increment of 2t−1 for each time-edge {v, w}, t ∈ E. With the appropriate data structure, this can be done in O(|E| · log |E|) time. Observe, that in the end ω{v,w} = ω({v, w}). Finally, we copy the vertex set of G, and hence compute L(G) in O(|V | + |E| · log |E|) = O(|E| · log |E|) time. Arnborg et al. [3] showed that it is possible to apply Theorem 4.9 to graphs in which edges have labels from a fixed finite set, either by augmenting the graph logic to incorporate predicates describing the labels, or by representing the labels by unquantified edge set variables. Since Theorem 4.9 gives a linear-time algorithm with respect to the input size, we can conclude that if the size of that label set depends on τ , then Theorem 4.9 still gives a linear-time algorithm for arbitrary but fixed τ , the size of the MSO formula, and the treewidth. We will define the optimization variant of W Strict in MSO on  W Temporal (s, z)-Separation τ L(G). First, the MSO formula layer(e, t) := i=1 j∈σ(i,2τ −1) t = i ∧ ω(e) = j checks whether an edge e is present in the layer t, where σ(i, j) := {x ∈ [j] | i-th bit of x is 1}. Note that the length of layer(e, t) is upper-bounded by a some function in 2O(τ) . Second, we can write an MSO formula tempadj(v, w, t) := ∃e∈E inc(e, v) ∧ inc(e, w) ∧ layer(e, t) to determine whether two vertices v and w are adjacent at time point t. Since the length of layer(e, t) is upper-bounded by some function in 2O(τ ) , the length of tempadj(v, w, t) is upper-bounded by some function in 2O(τ ) as well. Third, there is an MSO formula  path(S) := ∃x1 ,...,xτ +1 ∈V \S x1 = s ∧ xτ +1 = z ∧ τ ^ i=1  xi = xi+1 ∨ tempadj(xi , xi+1 , i) to check whether there is a strict temporal (s, z)-path which does not visit any vertex in S. Observe, that the length of path(S) is upper-bounded by some function in 2O(τ ) . Finally, with Theorem 4.9 we can solve the optimization variant of Strict Temporal (s, z)-Separation by the formula φ(S) := S ⊆ (V \ {s, z}) ∧ ¬path(S) and the affine function α(x) = x in f (τ, tw(G↓ )) · |V | time, where f is some computable function. This gives us an overall running time of O(f (τ, tw(G↓ )) · |E| · log |E|) to decide I for Strict Temporal (s, z)-Separation. Note that every strict temporal (s, z)-path in G and its induced (s, z)-path in G↓ have length at most τ . Hence, we can remove all vertices from G↓ which are not reachable from s by a path of length at most τ . We can find the set of vertices N which is reachable by a path of length τ by a breadth first search from s in linear time. Therefore, it is sufficient to solve the Strict Temporal (s, z)-Separation on G[N ∪ {s}]. Observe, that L(G[N ∪ {s}]) has diameter at most 2 · τ and is planar. The treewidth of a planar graph is at most three times the diameter (see Flum and Grohe [16]). Thus, (the optimization variant of) Strict Temporal (s, z)-Separation can be solved in f 0 (τ ) · |E| · log |E| time, where f 0 is a computable function. For any constant τ , this yields a running time of O(|E| · log |E|). 21 5 On Temporal Graphs with Small Temporal Cores In several real-world scenarios it is a reasonable assumption that an instance of (Strict) Temporal (s, z)-Separation has a small number of vertices that are adjacent to temporal edges, that is, edges that appear in some but not all layers. Consider for instance the following setting: An employee at a university in Berlin uses her bike every day to ride from her apartment (s) to the university campus (z). To cover large distances, there is the possibility to take the bike onto the city train. So the transportation network consists of a potentially large number of traffic nodes connected by bike lanes (static edges, that is, they appear in every layer) and a manageable number of city railway station that are potentially connected by both bike lanes and railway lines (temporal edges, as city trains are not always available). If a temporal (s, z)-separator of size k does not exist, then the employee can reach the university by bike, even if k traffic hubs are blocked. In this section, we investigate the complexity of computing (Strict) Temporal (s, z)-Separation in temporal graphs where the number of vertices that are adjacent to temporal edges is small. We call the set of such vertices the temporal core of the temporal graph. Definition 5.1S(TemporalTcore). For a temporal graph G = (V, E, τ ), the vertex set W = {v ∈ V | ∃{v, w} ∈ ( τi=1 Ei ) \ ( τi=1 Ei )} ⊆ V is called the temporal core. For Strict Temporal (s, z)-Separation, we can observe that the hardness reduction described in Observation 3.1 produces an instance with an empty temporal core. Hence, we get the following result. Observation 5.2. Strict Temporal (s, z)-Separation is NP-complete for all |W | ≥ 0 and τ ≥ 5. In stark contrast, Temporal (s, z)-Separation on temporal graphs with constant-sized temporal core can be solved in polynomial running time where the degree of the polynomial does not depend on the size of the temporal core. Formally, we show the following. Theorem 5.3. Temporal (s, z)-Separation is solvable in 2|W |·(log |W |+2) ·|V |O(1) +O(|E| log |E|) time. Proof. To solve an instance of Temporal (s, z)-Separation using the temporal core, we use an algorithm by Cygan et al. [12] for Node Multiway Cut as a sub-procedure (see step (4) below). Recall the definition of Node Multiway Cut: Node Multiway Cut Input: An undirected graph G = (V, E), a set of terminal T ⊆ V , and an integer k. Question: Is there a set S ⊆ (V \ T ) of size at most k such there is no (t1 , t2 )-path for every distinct t1 , t2 ∈ T ? We remark that Cygan et al.’s algorithm can be modified to obtain a solution S. Let instance I = (G = (V, E, τ ), s, z, k) of Temporal (s, z)-Separation with temporal core4 W ⊆ V be given. Without loss of generality, we assume that s, z ∈ W , otherwise we add two vertices one being incident only with s only in layer one, and the other being incident only with z b of a temporal only in layer one. Furthermore, we need the notion of a maximal static subgraph G b = (V, E) b graph G = (V, E): It contains all edges that appear in every layer, more specifically G T b= with E i∈[τ ] Ei . Our algorithm works as follows. 4 Note that we can compute the temporal core in O(|E| log |E|) time. 22 w2 W2 w3 W3 W1 W3 s z w1 W1 SW S Figure 8: Illustration of the idea behind the proof of Theorem 5.3. Left-hand side: Sketch of a temporal graph G (enclosed by the ellipse) with temporal (s, z) separator S (red hatched) and induced partition {SW , W1 , W2 , W3 }, where SW = W ∩ S. The outer rings of W1 , W2 , W3 contain the open neighborhood of the sets. Right-hand side: Sketch of the constructed graph G0 (enclosed by the ellipse). The partition {SW , W1 , W2 , W3 } is guessed in steps (1) and (2). The nodes w1 , w2 , w3 with edges to the neighborhood of W1 , W2 , W3 , respectively, are created in step (3). (1) Guess a set SW ⊆ (W \ {s, z}) of size at most k. (2) Guess a number r and a partition {W1 , . . . , Wr } of W \ SW such that s and z are not in the same Wi , for some i ∈ [r]. b − W and adding a vertex wi for each part Wi . Add edge (3) Construct the graph G0 by copying G sets {{v, wi } | v ∈ NGb (Wi ) \ W } for all i ∈ [r] and for all i, j ∈ [r] add an edge {wi , wj } if NGb (Wi ) ∩ Wj 6= ∅. (4) Solve the Node Multiway Cut instance I 0 = (G0 , {w1 , . . . , wr }, k − |SW |). (5) If a solution S 0 is found for I 0 and S 0 ∪ SW is a solution for I, then output yes. (6) If all possible guesses in (1) and (2) are considered without finding a solution for I, then output no. See Figure 8 for a visualization of the constructed graph G0 . Since we do a sanity check in step (5) it suffices to show that if G has a temporal (s, z)-separator of size at most k, then there is a partition {SW , W1 , . . . , Wr } of W where s and z are in different parts such that (i) the Node Multiway Cut instance I 0 has a solution of size at most k − |SW |, and (ii) if S 0 is a solution to I 0 , then SW ∪ S 0 is a temporal (s, z)-separator in G. Correctness: Let S be a temporal (s, z)-separator of size at most k in G. First, we set SW = S ∩ W . b − S with Ci ∩ W 6= ∅ for all i ∈ [r]. Now we Let C1 , . . . , Cr be the connected components of G construct a partition {SW , W1 , . . . , Wr } of W such that Wi = W ∩ Ci for all i ∈ [r]. It is easy to see that s and z are in different parts of this partition. Observe that for i, j ∈ [r] with i 6= j the b − S. Hence, w1 , . . . , wr are vertices v ∈ Wi and u ∈ Wj are in different connected components of G 0 in different connected components of G −(S \SW ). Thus S \SW is a solution of size at most k−|SW | of the Node Multiway Cut instance I 0 = (G0 , {w1 , . . . , wr }, k − |SW |), proving (i). For the correctness, it remains to prove (ii). Let S 0 be a solution of size at most k − |SW | of the Node Multiway Cut instance I 0 . We need to prove that S 0 ∪SW forms a temporal (s, z)-separator in G. Clearly, if S 0 = S \ SW , we are done by the arguments before. Thus, assume S 0 6= S \ SW . Since S 0 is a solution to I 0 , we know that w1 , . . . , wr are in different connected components of G0 −S 0 . Hence, for i, j ∈ [r] with i 6= j the vertices v ∈ Wi , u ∈ Wj are in different connected components b − (S 0 ∪ SW ). of G Now assume towards a contradiction that there is a temporal (s, z)-path P in G − (S 0 ∪ SW ). 23 Observe that {s, z} ⊆ V (P ) ∩ W . Hence, we have two different vertices u1 , u2 ∈ V (P ) ∩ W such that there is no temporal (u1 , u2 )-path in G − S and all vertices that are visited by P between u1 b − S, and hence there and u2 are contained in V \ W . Note that u1 and u2 are disconnected in G are i, j ∈ [r] with i 6= j such that u1 ∈ Wi and u2 ∈ Wj . Since P does not visit any vertices b − (S 0 ∪ SW ), and hence wi and wj in (S 0 ∪ SW ) we can conclude that u1 and u2 are connected in G are connected in G0 − S 0 . This contradicts the fact that S 0 is a solution for I 0 . Running time: It remains to show that the our algorithm runs in the proposed time. For the guess in step (1) there are at most 2|W | many possibilities. For the guess in step (2) there are at most B(|W |) ≤ 2|W |·log(|W |) many possibilities, where B is the Bell function. Step (3) and the sanity check in step (5) can clearly be done in polynomial time. b − (W \ {s, z}). If k ≥ |W \ {s, z}| + |L|, then (W \ Let L be a minimum (s, z)-separator in G {s, z}) ∪ L is a temporal (s, z)-separator of size at most k for G. Otherwise, we have that k − |L| < |W |. Cygan et al. [12] showed that Node Multiway Cut can be solved in 2k−b · |V |O(1) time, where b := maxx∈T min{|S| | S ⊆ V is an (x, T \ {x})-separator}. Since s and z are not in the same Wi for any i ∈ [r], we know that |L| ≤ b. Hence, k − b ≤ k − |L| < |W | and step (4) can be done in 2|W | · |V |O(1) time. Thus we have an overall running time of 2|W |·(log |W |+2) · |V |O(1) + O(|E| log |E|). We conclude that the strict and the non-strict variant of Temporal (s, z)-Separation behave very differently on temporal graphs with a constant-sized temporal core. While the strict version stays NP-complete, the non-strict version becomes polynomial-time solvable. 6 Concluding Discussion and Outlook One general conclusion is, informally speaking, that the temporal path model strongly matters when assessing the computational complexity of finding small separators in temporal graphs. This phenomenon has, so far, been neglected in the literature. We showed that Temporal (s, z)-Separation and Strict Temporal (s, z)-Separation are already NP-hard on temporal graphs with τ ≥ 2 and τ ≥ 5, respectively. Completing the picture, we showed that for both problems the respective constants are tight, that is, each problem becomes polynomial-time solvable if the number of layers is below the respective constant. We showed that (Strict) Temporal (s, z)-Separation on temporal graphs with planar underlying graphs remains NP-complete. However, we proved that on this graph class if additionally the number τ of layers is a constant, then Strict Temporal (s, z)-Separation is solvable in O(|E| · log |E|) time. We leave open whether Temporal (s, z)Separation admits a similar statement. Finally, while introducing the temporal core notion, we proved that Temporal (s, z)-Separation is solvable in polynomial time on temporal graphs with constant-sized core. We discuss two further research directions that we consider to be particularly interesting: Temporal graph classes. We initiated a study of (Strict) Temporal (s, z)-Separation on planar temporal graphs. Future research could include a continuation of the study on both problems on planar temporal graphs from a parameterized complexity and approximation point of view. We point out that we think that planar temporal graphs are of particular interest, as the underlying graphs of several temporal graphs, for instance commuting traffic in street or public transport networks, are planar or “almost” planar. 24 Furthermore, there are notions of temporal graph classes that could be of both practical and/or theoretical interest. Future research may include a study on specific temporal graph classes, including the viewpoint of parameterized complexity. Temporal graph parameters. A second natural direction is to study structural parameters of temporal graphs. For instance, we introduced and studied the notion of a temporal core. As a small temporal core allows for efficiently solving Temporal (s, z)-Separation, one may ask for further structural parameters of temporal graphs that allow for tractability. References [1] E. C. Akrida, L. Gąsieniec, G. B. Mertzios, and P. G. Spirakis. On temporally connected graphs of small cost. In Proceedings of the 13th International Workshop on Approximation and Online Algorithms (WAOA ’15), pages 84–96. Springer, 2015. 2, 3 [2] E. C. Akrida, J. Czyzowicz, L. Gąsieniec, Ł. Kuszner, and P. G. Spirakis. Temporal flows in temporal networks. In Proceedings of the 10th International Conference on Algorithms and Complexity (CIAC ’17), pages 43–54. Springer, 2017. 3, 4, 12 [3] S. Arnborg, J. Lagergren, and D. Seese. Easy problems for tree-decomposable graphs. Journal of Algorithms, 12(2):308–340, 1991. 20, 21 [4] K. Axiotis and D. Fotakis. On the size and the approximability of minimum temporally connected subgraphs. In Proceedings of the 43rd International Colloquium on Automata, Languages, and Programming (ICALP ’16), volume 55 of LIPIcs, pages 149:1–149:14. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, 2016. 2, 4 [5] G. Baier, T. Erlebach, A. Hall, E. Köhler, P. Kolman, O. Pangrác, H. Schilling, and M. Skutella. Length-bounded cuts and flows. ACM Transactions on Algorithms, 7(1):4:1–4:27, 2010. 7, 8 [6] K. A. Berman. Vulnerability of scheduled networks and a generalization of Menger’s Theorem. Networks, 28(3):125–134, 1996. 2, 4, 12 [7] S. Boccaletti, G. Bianconi, R. Criado, C. I. Del Genio, J. Gómez-Gardenes, M. Romance, I. Sendina-Nadal, Z. Wang, and M. Zanin. The structure and dynamics of multilayer networks. Physics Reports, 544(1):1–122, 2014. 2 [8] A. Casteigts, P. Flocchini, W. Quattrociocchi, and N. Santoro. Time-varying graphs and dynamic networks. International Journal of Parallel, Emergent and Distributed Systems, 27 (5):387–408, 2012. 5 [9] H. Corley and D. Y. Sha. Most vital links and nodes in weighted networks. Operations Research Letters, 1(4):157 – 160, 1982. 7 [10] T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein. Introduction to Algorithms, 3rd Edition. MIT press, 2009. 14 [11] B. Courcelle and J. Engelfriet. Graph Structure and Monadic Second-order Logic: a Languagetheoretic Approach, volume 138. Cambridge University Press, 2012. 20 25 [12] M. Cygan, M. Pilipczuk, M. Pilipczuk, and J. O. Wojtaszczyk. On multiway cut parameterized above lower bounds. ACM Trans. Comput. Theory, 5(1):3:1–3:11, 2013. 22, 24 [13] R. Diestel. Graph Theory, 5th Edition, volume 173 of Graduate Texts in Mathematics. Springer, 2016. 5 [14] T. Erlebach, M. Hoffmann, and F. Kammer. On temporal graph exploration. In Proceedings of the 42nd International Colloquium on Automata, Languages, and Programming (ICALP ’15), pages 444–455. Springer, 2015. 4 [15] A. Ferreira. Building a reference combinatorial model for MANETs. IEEE Network, 18(5): 24–29, 2004. 2 [16] J. Flum and M. Grohe. Parameterized Complexity Theory. Texts in Theoretical Computer Science. An EATCS Series. Springer Verlag, Berlin, 2006. 21 [17] T. Fluschnik, D. Hermelin, A. Nichterlein, and R. Niedermeier. Fractals for kernelization lower bounds, with an application to length-bounded cut problems. In Proceedings of the 43rd International Colloquium on Automata, Languages, and Programming (ICALP ’16), volume 55, pages 25:1–25:14. Schloss Dagstuhl – Leibniz-Zentrum fuer Informatik, 2016. Full version: https://arxiv.org/abs/1512.00333. 9, 10 [18] L. R. Ford and D. R. Fulkerson. Maximal flow through a network. Canadian Journal of Mathematics, 8(3):399–404, 1956. 20 [19] P. A. Golovach and D. M. Thilikos. Paths of bounded length and their cuts: Parameterized complexity and algorithms. Discrete Optimization, 8(1):72–86, 2011. 9 [20] A.-S. Himmel, H. Molter, R. Niedermeier, and M. Sorge. Adapting the Bron-Kerbosch algorithm for enumerating maximal cliques in temporal graphs. Social Network Analysis and Mining, 7(1):35:1–35:16, 2017. 2 [21] P. Holme. Modern temporal network theory: a colloquium. European Physical Journal B, 88 (9):234, 2015. 5 [22] P. Holme and J. Saramäki. Temporal networks. Physics Reports, 519(3):97–125, 2012. 2, 5 [23] D. Kempe, J. Kleinberg, and A. Kumar. Connectivity and inference problems for temporal networks. Journal of Computer and System Sciences, 64(4):820–842, 2002. 2, 3, 4, 7, 12 [24] Q. Liang and E. Modiano. Survivability in time-varying networks. IEEE Transactions on Mobile Computing, 16(9):2668–2681, 2017. 2, 4 [25] L. Lovász, V. Neumann-Lara, and M. Plummer. Mengerian theorems for paths of bounded length. Periodica Mathematica Hungarica, 9(4):269–276, 1978. 16 [26] K. Menger. Zur allgemeinen Kurventheorie. Fundamenta Mathematicae, 10(1):96–115, 1927. 4, 11 26 [27] G. B. Mertzios, O. Michail, I. Chatzigiannakis, and P. G. Spirakis. Temporal network optimization subject to connectivity constraints. In Proceedings of the 40th International Colloquium on Automata, Languages, and Programming (ICALP ’13), pages 657–668. Springer, 2013. 2, 3, 4, 12 [28] O. Michail. An introduction to temporal graphs: An algorithmic perspective. Internet Mathematics, 12(4):239–280, 2016. 2, 3, 5 [29] O. Michail and P. G. Spirakis. Traveling salesman problems in temporal graphs. Theoretical Computer Science, 634:1–23, 2016. 4 [30] F. Pan and A. Schild. Interdiction problems on planar graphs. Discrete Applied Mathematics, 198:215–231, 2016. 9 [31] S. Scellato, I. Leontiadis, C. Mascolo, P. Basu, and M. Zafer. Evaluating temporal robustness of mobile networks. IEEE Trans. Mob. Comput., 12(1):105–117, 2013. 2 [32] B. Schieber, A. Bar-Noy, and S. Khuller. The complexity of finding most vital arcs and nodes. Technical report, College Park, MD, USA, 1995. 7 [33] T. Viard, M. Latapy, and C. Magnien. Computing maximal cliques in link streams. Theoretical Computer Science, 609:245–252, 2016. 2 [34] H. Wu, J. Cheng, Y. Ke, S. Huang, Y. Huang, and H. Wu. Efficient algorithms for temporal path computation. IEEE Transactions on Knowledge and Data Engineering, 28(11):2927–2942, 2016. 4, 5, 12, 13, 14 27
8cs.DS
Inner amenability, property Gamma, McDuff II1 factors and stable equivalence relations by Tobe Deprez1 and Stefaan Vaes2 arXiv:1604.02911v2 [math.OA] 15 Nov 2016 Abstract We say that a countable group G is McDuff if it admits a free ergodic probability measure preserving action such that the crossed product is a McDuff II1 factor. Similarly, G is said to be stable if it admits such an action with the orbit equivalence relation being stable. The McDuff property, stability, inner amenability and property Gamma are subtly related and several implications and non implications were obtained in [E73, JS85, V09, K12a, K12b]. We complete the picture with the remaining implications and counterexamples. 1 Introduction Murray and von Neumann proved in [MvN43] that the hyperfinite II1 factor R is not isomorphic to the free group factor L(F2 ), by showing that R has property Gamma while L(F2 ) has not. Recall that a tracial von Neumann algebra (M, τ ) has property Gamma if there exists a net of unitariespun ∈ M such that un → 0 weakly and limn kxun − un xk2 = 0 for all x ∈ M , where kxk2 = τ (x∗ x). We say that a countable group G has property Gamma when L(G) does. In [E73], it was shown that if G has property Gamma, then G is inner amenable : there exists a conjugation invariant mean m on G such that m(U ) = 0 for every finite subset U ⊂ G. The converse does not hold : an inner amenable group G with infinite conjugacy classes (icc) but not having property Gamma was constructed in [V09]. If a II1 factor M admits non commuting central sequences, more precisely if the central sequence algebra M ′ ∩ M ω is non abelian, then M ∼ = M ⊗ R and M is said to be McDuff, see [McD69]. The counterpart of the McDuff property for equivalence relations was introduced in [JS85] and is called stability. A countable ergodic probability measure preserving (pmp) equivalence relation R is called stable if R ∼ = R × R0 , where R0 is the unique hyperfinite ergodic pmp equivalence relation. In [JS85, Theorem 3.4], stability is characterized in terms of central sequences. Clearly, if R is stable, the II1 factor L(R) is McDuff. Again, both the McDuff property and stability are closely related to inner amenability. If G is a countable group and G y (X, µ) is a free ergodic pmp action (X, µ), we consider the group measure space II1 factor M = L∞ (X) ⋊ G and the orbit equivalence relation R = R(G y X). By [JS85], if R is stable, the group G is inner amenable. Actually, already if M is McDuff, G must be inner amenable (see Proposition 4.1 below). We say that a group G is stable, resp. McDuff, if G admits a free ergodic pmp action G y (X, µ) such that the orbit equivalence relation R(G y X) is stable, resp. the crossed product L∞ (X) ⋊ G is McDuff. Here and in what follows all probability spaces are assumed to be standard. We thus have the following subtly related notions for a countable group G : inner amenability, property Gamma, the McDuff property and stability. Figure 1 summarizes all implications and 1 KU Leuven, Department of Mathematics, Leuven (Belgium), [email protected] Supported by a PhD fellowship of the Research Foundation Flanders (FWO). 2 KU Leuven, Department of Mathematics, Leuven (Belgium), [email protected] Supported in part by European Research Council Consolidator Grant 614195, and by long term structural funding – Methusalem grant of the Flemish Government. 1 non implications between these properties. The main contribution of this article is to fill in all the arrows that were unknown so far. So, we prove that Kida’s counterexamples of [K12a] provide icc groups with property Gamma that are not McDuff. We also adapt the example of [PV08] of a (necessarily non icc) property (T), but yet McDuff group G to obtain an icc McDuff group that is not stable. G has property Gamma [E73] [K12b] [V09] [K12a] Thm 2.1 [K12b] G is inner amenable Thm 2.1 [K12a] [JS85] Prop 4.1 G is McDuff G is stable Thm 3.2 Figure 1: Implications and non implications for a countable discrete icc group G. The dashed arrows are proven in this article. For later use, recall from [J99, Theorem 1.2] that a subgroup H of a countable group G has relative property (T) if and only if for every unitary representation π : G → U (K) and every bounded sequence of vectors ξn ∈ K satisfying limn kπ(g)ξn − ξn k = 0 for all g ∈ G, we have that limn kPH (ξn ) − ξn k = 0, where PH : K → KH denotes the orthogonal projection of K onto the closed subspace of π(H)-invariant vectors. In the context of tracial von Neumann algebras, this characterization of relative property (T) gives the following well known lemma. For completeness, we include a proof. Lemma 1.1. Let (M, τ ) be a tracial von Neumann algebra with N ⊂ M . Let G be a countable group and H < G a subgroup with Let π : G → U (M ) be a homomorphism satisfying π(g)N π(g)∗ = B = π(H)′ ∩ N = {x ∈ N | π(h)x = xπ(h) ∀h ∈ H}. Denote by EB preserving conditional expectation. von Neumann subalgebra the relative property (T). N for all g ∈ G. Define : N → B the unique trace If (an ) is a bounded sequence in N satisfying limn kπ(g)an − an π(g)k2 = 0 for all g ∈ G, then limn kan − EB (an )k2 = 0. Proof. It suffices to observe that (Ad π(g))g∈G defines a unitary representation of G on L2 (N ) and that EB is the orthogonal projection of L2 (N ) onto the subspace of H-invariant vectors. 2 An icc group with property Gamma that is not McDuff In [K12a], Kida constructed the first icc groups G that have property Gamma (and in particular, are inner amenable) but that are not stable, meaning that they do not admit a stable free 2 ergodic pmp action. We prove here that these groups are not even McDuff, meaning that they do not admit a free ergodic pmp action with the crossed product being McDuff. Fix a property (T) group H that admits a central element a ∈ Z(H) of infinite in [C05], one could take n ≥ 3, define H ⊂ SL(n + 2, Z) given by     1 0  1 b c A ∈ SL(n, Z) , b ∈ Z1×n ,  0 In H = 0 A d and take a =   c ∈ Z , d ∈ Zn×1 0 0 1 0 0 order. As  1 0 . 1 Given two non zero integers p, q with |p| = 6 |q|, we define G as the HNN extension G = hH, t | t−1 ap t = aq i . (2.1) Theorem 2.1. Kida’s group G defined in (2.1) is icc, has property Gamma, but is not McDuff. Proof. Analyzing reduced words in HNN extensions, it is easy to check that G is icc and that H < G is a relatively icc subgroup, meaning that {hgh−1 | h ∈ H} is infinite for every g ∈ G\H (see e.g. [S05]). Ozawa already proved that L(G) has property Gamma and his proof can be found in [K12a, Theorem 1.4]. For completeness, we include the following slightly easier proof. We claim that there exists a sequence of Borel functions fn : R → T satisfying fn (x + 1) = fn (x) for all x ∈ R, Z 1 Z 1 |fn (px) − fn (qx)|2 dx = 0 . (2.2) fn (x) dx = 0 and lim lim n 0 n 0 Denote by (ug )g∈G the canonical unitary elements of L(G). Given such a sequence of functions R1 fn and denoting by c fn (k) = 0 fn (x)e−2πikx dx the Fourier coefficients of fn , we can define the unitary elements un ∈ L(H) given by X c un = fn (k) upk a . k∈Z Then (2.2) says that τ (un ) → 0 and ku∗t un ut − un k2 → 0. Since moreover un ∈ Z(L(H)), it follows that (un ) is a non trivial central sequence in L(G), so that L(G) has property Gamma. To prove the existence of fn satisfying (2.2), define Λ = Z[p−1 , q −1 ]⋊Z as the semidirect product of the abelian group Z[p−1 , q −1 ] with Z acting by the automorphisms given by multiplication with a power of p/q. Define the action Λ yα R given by (x, k) · y = x + (p/q)k y and equip R with the Lebesgue measure class. Since Λ is an amenable group, it follows from [CFW81] that the orbit equivalence relation R(Λ y R) is hyperfinite and thus, not strongly ergodic. This provides us with a sequence of unitary elements fn ∈ L∞ (R) tending to 0 weakly and being approximately Λ-invariant in the sense that α(x,k) (fn ) − fn → 0 strongly for all (x, k) ∈ Λ. Restricting fn to the interval [0, 1) and then extending fn periodically, we find a sequence satisfying (2.2). Choose a free ergodic pmp action G y (X, µ). We prove that the II1 factor M = L∞ (X) ⋊ G is not McDuff. Let un ∈ U (M ) be a central sequence. Put B = L(H)′ ∩ M . Since H has property (T), by Lemma 1.1, we have that kun − EB (un )k2 → 0, where EB : M → B is the unique trace preserving conditional expectation. Since H < G is relatively icc, it follows that B ⊂ B1 , where B1 = L∞ (X) ⋊ H. We also define B2 = L∞ (X) ⋊ tHt−1 . Since kun − EB1 (un )k2 → 0 and kun − u∗t un ut k2 → 0, we get that kun − EB2 (un )k2 → 0. Since H ∩ tHt−1 ⊂ Z(H), we conclude that kun − ED (un )k2 → 0, where D = L∞ (X) ⋊ Z(H). 3 Define C = L∞ (X)H ⋊Z(H), where L∞ (X)H denotes the von Neumann algebra of H-invariant functions. We claim that the subalgebras B, D ⊂ M form a commuting square with B P∩D = C. To prove this claim, it suffices to take a ∈ B and prove that ED (a) ∈ C. Let a = g∈G ag ug with ag ∈ L∞ (X) for all g ∈ G be the Fourier decomposition of a. Since a commutes with P L(H), we get in particular that ah ∈ L∞ (X)H for all h ∈ Z(H). Since ED (a) = h∈Z(H) ah uh , the claim follows. Since kun − EB (un )k2 → 0 and kun − ED (un )k2 → 0, we conclude that kun − EC (un )k2 → 0. Because C is abelian, M is not McDuff. 3 An icc McDuff group that is not stable There are two obvious obstructions for stability of a group G : non inner amenability and property (T). In [PV08, Theorem 6.4.2] using [E10], an example of a McDuff property (T) group G is constructed. In particular, G is an example of a McDuff group that is not stable. However by [PV08, Theorem 6.4.1], a McDuff property (T) group can never be icc. In this section, we construct examples of icc McDuff groups that are not stable. We do this by giving the following obstruction for stability and by combining the methods of [PV08] and [V09]. Proposition 3.1. If a countable group G admits a subgroup H < G with the relative property (T) and the relative icc property, then G is not stable. Proof. Let G y (X, µ) be a free ergodic pmp action and denote by R = R(G y X) the associated orbit equivalence relation. Write A = L∞ (X) and M = A ⋊ G. We denote by NM (A) = {u ∈ U (M ) | uAu∗ = A} the normalizer of A inside M . To prove that R is not stable, by [JS85, Theorem 3.4], we have to show that all central sequences (un ) and (pn ) in M with un ∈ NM (A) and pn a projection in A for all n satisfy kun pn − pn un k2 → 0. Put B = L(H)′ ∩ M and also define D = AH as the algebra of H-invariant functions in A. Denote by EB : M → B and ED : A → D the unique trace preserving conditional expectations. Since H < G has the relative property (T), by Lemma 1.1, we get that kun − EB (un )k2 → 0 and kpn − ED (pn )k2 → 0. Since H < G is relatively icc, we have B ⊂ A ⋊ H. Therefore, B and D commute. It follows that kun pn − pn un k2 → 0. For every countable group H, we denote by Hf its FC-radical, defined as the normal subgroup of H consisting of all elements that have a finite conjugacy class. Also recall that a group is said to be virtually abelian if it admits an abelian subgroup of finite index. We denote by CH (K) the centralizer in H of a subset K ⊂ H. To construct an icc McDuff group that is not stable, we start with the property (T) group of [PV08, Theorem 6.4] : a residually finite property (T) group H such that the FC-radical Hf is not virtually abelian. In [E10], it was proved that such a group indeed exists. From [PV08, Theorem 6.4], we know that H is McDuff. We then perform the same iterative amalgamated free product construction as in [V09] in order to embed H as a relatively icc subgroup of a larger group G in such a way that G remains McDuff. T Fix a decreasing sequence of finite index normal subgroups Ln ⊳ H with n Ln = {e}. Enumerate Hf = {hn | n ∈ N}. Note that for every n ∈ N, CH (h1 , . . . , hn ) is a finite index subgroup of H. Then,   \ g CH (h1 , . . . , hn ) g−1  Hn := Ln ∩  g∈H 4 is a decreasing sequence of finite index normal subgroups of H with Hf ∩ Hn . T n Hn = {e}. Put Kn = Define inductively H = G0 ⊂ G1 ⊂ G2 ⊂ · · · as the amalgamated free product Gn+1 = Gn ∗Kn (Kn × Z), where we view Kn ⊂ H = G0 ⊂ Gn . Define G as the direct limit of G0 ⊂ G1 ⊂ · · · . Theorem 3.2. The group G constructed above is icc, has the McDuff property, but is not stable. Proof. We first prove that H < G is relatively icc. Take g ∈ G \ H. Take n ≥ 0 such that g ∈ Gn+1 \ Gn . We have Gn+1 = Gn ∗Kn (Kn × Z) and Kn < H < Gn . Since Hf is infinite amenable and H has property (T), Hf < H has infinite index. So Kn has infinite index in H and it follows that {hgh−1 | h ∈ H} is an infinite set. To prove that G is icc, it suffices to prove that every h ∈ H with h 6= e has an infinite conjugacy class. Take n ≥ 0 such that h ∈ H \ Kn . Let t be the generator of Z in the description Gn+1 = Gn ∗Kn (Kn × Z). Since h ∈ Gn \ Kn , the elements tk ht−k , k ∈ Z, are all distinct. Since H has property (T), it follows from Proposition 3.1 that G is not stable. It remains to construct a free ergodic pmp action G y (X, µ) such that L∞ (X) ⋊ G is McDuff. For every n ≥ 0, we have Gn+1 = Gn ∗Kn (Kn × Z) and we define the homomorphism πn,n+1 : Gn+1 → Gn given by the identity map on Gn and by mapping Z to {e}. Writing πn,m = πn,n+1 ◦ · · · ◦ πm−1,m for all n ≤ m, we obtain a compatible system of homomorphisms πn,m : Gm → Gn that combine into a homomorphism πn : G → Gn . In particular, π0 : G → H. By induction on n, one checks that Km is a normal subgroup of Gn+1 for all n ≥ 0 and all m ≥ n, and that gπ0 (g)−1 commutes with Kn for every g ∈ Gn+1 . Denote by H yβ (Y, ν) the profinite action given as the inverse limit of H y H/Hn . Define G yα Y by α(g) = β(π0 (g)). Note that α is an ergodic pmp action. For every n ≥ 1, we consider the Bernoulli action βn of Gn /Kn−1 on Xn = [0, 1]Gn /Kn−1 equipped with the product measure µn = λGn /Kn−1 . We define G yαn Xn by αn (g) = βn (πn (g)). Note that αn is a weakly mixing pmp action. We define (X, µ) as the product of (Y, ν) and all (Xn , µn ), n ≥ 1. We define G y X as the diagonal action. Since each αn is weakly mixing and α is ergodic, the diagonal action G y (X, µ) is ergodic. When g ∈ G \ {e}, take n ≥ 1 such that g ∈ Gn \ Kn−1 . Since the Bernoulli action βn is essentially free, the set {x ∈ Xn | αn (g)(x) = x} has measure zero and thus also {x ∈ X | g ·x = x} has measure zero. We conclude that G y X is essentially free. Denote M = L∞ (X) ⋊ G and let τ : M → C be the tracial state on M . To prove that M is McDuff, we use the method of [PV08, Theorem 6.4]. Denote by θ : L∞ (Y ) → L∞ (X) and θn : L∞ (Xn ) → L∞ (X) the natural ∗-homomorphisms induced by the coordinate maps X → Y and X → Xn . The definition of Hk implies that for every h ∈ Hf , we have Hk ⊂ CH (h) for all k large enough. So for every h ∈ Hf , we can define the element X vh = θ(1sHk ) ush−1 s−1 s∈H/Hk whenever k is such that Hk ⊂ CH (h). A direct computation shows that τ (vh ) = 0 for every h ∈ Hf \ {e} and that h 7→ vh is a homomorphism from Hf to U (L(H)′ ∩ M ). When g ∈ Gn+1 , we have that gπ0 (g)−1 commutes with Kn . It follows that vh commutes with L(Gn+1 ) whenever h ∈ Kn . When h ∈ Kn , we also get that vh commutes with θ(1rHm ) for all r ∈ H and all m ≤ n and that vh commutes with θm (L∞ (Xm )) for all m ≤ n + 1. So, 5 choosing any sequence hn ∈ Kn \ {e}, we get that (vhn )n is a central sequence of unitaries in M with τ (vhn ) = 0 for all n. Since Kn is a finite index subgroup of Hf , we know that Kn is non abelian. We can thus choose sequences hn , h′n ∈ Kn such that hn h′n 6= h′n hn for all n. The corresponding central sequences (vhn ) and (vh′n ) satisfy τ (vhn vh′n vh∗ n vh∗ ′n ) = 0 for all n ≥ 0. So, M is a McDuff II1 factor. 4 All McDuff groups are inner amenable For icc groups G, the following result is a consequence of the main theorem in [C81]. In the non icc case, we need a small extra argument, because we follow the convention that a group G is inner amenable if there exists a conjugation invariant mean on G that gives weight zero to all finite subsets of G and not only to the subset {e}. Proposition 4.1. Every McDuff group G is inner amenable. Proof. Let G be a group that is not inner amenable. Let G yα (X, µ) be any free ergodic pmp action. Denote A = L∞ (X) and M = A ⋊ G. Let xn ∈ U (M ) be an arbitrary central sequence. We prove that limn kxn − EA (xn )k2 = 0. P Write xn = g∈G an (g) ug with an (g) ∈ A for every g ∈ G. Fix g ∈ G \ {e}. Since limn kp xn − xn pk2 = 0 for all p ∈ A, we have limn kp an (g) − an (g) αg (p)k2 = 0 for all p ∈ A. Let p1 ∈ A be a maximal projection satisfying p1 αg (p1 ) =P 0. Put p2 = αg (p1 ) and p3 = 1 − (p1 + p2 ). Since the action α is essentially free, we get that i pi = 1 and pi αg (pi ) = 0 for all i. It follows that limn kpi an (g)k2 = 0 for every i, so that limn kan (g)k2 = 0 for all g ∈ G \ {e}. Define the unit vectors ξn ∈ ℓ2 (G) given by ξn (g) = kan (g)k2 . In the previous paragraph, we proved that limn ξn (g) = 0 for every g ∈ G \ {e}. As in [C81], the vectors ξn are approximately conjugation invariant. Since G is not inner amenable, the functions ξn must satisfy limn ξn (e) = 1, meaning that limn kxn − EA (xn )k2 = 0. So, we have proved that every central sequence xn ∈ U (M ) satisfies limn kxn − EA (xn )k2 = 0. It follows that M ′ ∩ M ω is abelian, so that M is not McDuff. References [C81] M. Choda, Inner amenability and fullness. Proc. Amer. Math. Soc. 86 (1982), 663-666. [CFW81] A. Connes, J. Feldman and B. Weiss, An amenable equivalence relation is generated by a single transformation. Ergodic Theory Dynam. Systems 1 (1981), 431-450. [C05] Y. de Cornulier, Finitely presentable, non-Hopfian groups with Kazhdan’s property (T) and infinite outer automorphism group. Proc. Amer. Math. Soc. 135 (2007), 951-959. [E73] E.G. Effros, Property Γ and inner amenability. Proc. Amer. Math. Soc. 47 (1975), 483-486. [E10] M. Ershov, Kazhdan groups whose FC-radical is not virtually abelian. Preprint. (2010), available at http://people.virginia.edu/~mve2x/Research/Kazhdan_infFC0706.pdf. [J99] P. Jolissaint, On property (T) for pairs of topological groups. Enseign. Math. 51 (2005), 31-45. [JS85] V.F.R. Jones and K. Schmidt, Asymptotically invariant sequences and approximate finiteness. Amer. J. Math. 109 (1987), 91-114. [K12a] Y. Kida, Inner amenable groups having no stable action. Geom. Dedicata 173 (2014), 185-192. 6 [K12b] Y. Kida, Stability in orbit equivalence for Baumslag-Solitar groups and Vaes groups. Groups Geom. Dyn. 9 (2015), 203-235. [McD69] D. McDuff, Central sequences and the hyperfinite factor. Proc. London Math. Soc. (3) 21 (1970), 443-461. [MvN43] F.J. Murray and J. von Neumann, Rings of operators IV, Ann. Math. 44 (1943), 716-808. [PV08] S. Popa and S. Vaes, On the fundamental group of II1 factors and equivalence relations arising from group actions. In Quanta of Maths, Proceedings of the Conference in honor of A. Connes’ 60th birthday, Clay Mathematics Institute Proceedings 11 (2011), pp. 519-541. [S05] Y. Stalder, Moyennabilité intérieure et extensions HNN. Ann. Inst. Fourier (Grenoble) 56 (2006), 309-323. [V09] S. Vaes, An inner amenable group whose von Neumann algebra does not have property Gamma. Acta Math. 208 (2012), 389-394. 7
4math.GR
Robust Attitude Tracking Control of Aerobatic Helicopters: A Geometric Backstepping Approach Nidhish Raja,1 , Ravi N Banavarb,2 , Abhisheka,3 , Mangal Kotharia,3 a Department of Aerospace Engineering, IIT Kanpur, Kanpur, UP, India 208016 b Systems and Control Group, IIT Bombay, Mumbai, India 400076 arXiv:1709.05652v1 [cs.SY] 17 Sep 2017 Abstract Robust attitude tracking control of a small-scale aerobatic helicopter using geometric and backstepping techniques is presented in this article. A nonlinear coupled rotor-fuselage dynamics model of the helicopter is considered, wherein the rotor flap dynamics is modeled as a first order system, while the fuselage is as a rigid body dynamically coupled to the rotor system. The robustness of the controller in the presence of both structured and unstructured disturbances is explored. The structured disturbance is due to uncertainty in the rotor parameters, and the unstructured perturbation is modeled as an exogenous torque acting on the fuselage. The performance of the controller is demonstrated in the presence of both types of disturbances through simulations for a small-scale unmanned helicopter. This work is, possibly, the first systematic attempt at designing a globally defined robust attitude tracking controller for an aerobatic helicopter which retains the rotor dynamics and incorporates the uncertainties involved. 1. Introduction Small-scale conventional helicopter Unmanned Aerial Vehicles (UAVs) are being used for a wide variety of missions ranging from surveillance, precision agriculture, movie making, pipeline inspection, real estate, wild life monitoring etc. to name a few. These helicopters with a single main rotor and a tail rotor are capable of performing extreme 3D aerobatic maneuvers (Gavrilets, Frazzoli, Mettler, Piedmonte, and Feron, 2001; Abbeel, Coates, and Ng, 2010; Gerig, 2008). These maneuvers may be critical towards the survivability of the vehicle under extreme circumstances such as in the presence of strong wind-gust, flight in a cluttered and congested environment and combat scenarios. These aggressive maneuvers involve large angle rotations with high angular velocity, inverted flight, split-S, pirouette etc. This necessitates a tracking controller which is globally defined and is capable of achieving such aggressive rotational maneuvers. The attitude tracking problem of a helicopter is significantly different from that of a rigid body. A smallscale helicopter is modeled as a coupled interconnected system consisting of a fuselage and a rotor. The control moments generated by the rotor excite the rigid body dynamics of the fuselage which in-turn affects the rotor loads and its dynamics causing nonlinear coupling. The key differences between the rigid body tracking problem and the attitude tracking of a helicopter are the following: 1) the presence of large aerodynamic damping in the rotational dynamics and 2) the required control moment for tracking cannot be applied instantaneously due to the rotor blade dynamics. The control moments are produced by the rotor subsystem which inherently has a first order dynamics (Mettler, 2013). The significance of including the rotor dynamics in controller design for helicopters has been extensively studied in the literature (Hall Jr and Bryson Jr, 1973; Takahashi, 1994; Ingle and Celi, 1994; Panza and Lovera, 2014). Hall Jr and Bryson Jr (1973) have shown the importance of rotor state feedback in achieving tight attitude control for large scale helicopters, Takahashi (1994) compares H∞ attitude controller design for the cases with and without rotor state feedback. In a similar work, Ingle and Celi (1994) have investigated the effect of including rotor dynamics on various controllers, namely LQG, Eigenstructure Assignment and H∞ , for meeting stringent handling quality requirements. They conclude that the controllers designed to meet the high bandwidth requirements with the rotor dynamics were more robust and required lower control activity than the ones designed without including the rotor dynamics. Panza and Lovera (2014) used rotor state feedback and designed an H∞ controller which is robust and also fault tolerant with respect to failure of the rotor state sensor. Previous attempts to small-scale helicopter attitude control are mostly based on attitude parametrization such as Euler angles, which suffer from singularity issues, or quaternions which have Email addresses: [email protected] (Nidhish Raj), [email protected] (Ravi N Banavar ), [email protected] (Abhishek ), [email protected] (Mangal Kothari ) 1 Doctoral student, IIT Kanpur,India. 2 Professor, Systems and Control Engineering, IIT Bombay, India. 3 Assistant Professor, Department of Aerospace Engineering, IIT Kanpur, India. 1 ambiguity in representation. Tang, Yang, Qian, and Zheng (2015) explicitly consider the rotor dynamics and design stabilizing controller based on sliding mode technique using Euler angles and hence confined to small angle maneuvers. Raptis, Valavanis, and Moreno (2011) have designed position tracking controller for smallscale helicopter wherein the inner loop attitude controller was based on rotation matrix, but does not consider the rotor dynamics. Marconi and Naldi (2006, 2007) designed a position tracking controller for flybared (with stabilizer bar) miniature helicopter which is robust with respect to large variations in parameters, but have made the simplifying assumption of disregarding the rotor dynamics by taking a static relation between the flap angles and the cyclic input. Stressing the significance of rotor dynamics, Ahmed and Pota (2009); Ahmed, Pota, and Garratt (2010) developed a backstepping based stabilizing controller using Euler angles for a smallscale flybared helicopter with the inclusion of servo and rotor dynamics. They have provided correction terms in the controller to incorporate the effect of servo and rotor dynamics. For near hover conditions, Zhu and Huo (2013) have developed a robust nonlinear controller disregarding the flap dynamics. Frazzoli, Dahleh, and Feron (2000) developed a coordinate chart independent trajectory tracking controller on the configuration manifold SE(3) for a small-scale helicopter, but the flap dynamics was not taken into account. The synthesis of a robust attitude tracking control for a small-scale flybarless aerobatic helicopter is presented in this paper. A coupled rotor-fuselage model of the helicopter, wherein the fuselage is modeled as a rigid body and the rotor as a first order system, is considered. Disturbances are added to both the fuselage and rotor dynamics. The disturbance added to the fuselage dynamics is unstructured and captures the effect of exogenous torque acting on the helicopter and is lumped together as ∆ f (t) in (1). This torque could arise due to center of mass misalignment from the main rotor shaft axis or the moment due to a tethered load attached to a point different from the center of mass or the effect of wind/rotor-downwash on the fuselage. On the other hand, for the rotor dynamics, structured disturbance in the form of uncertainties in parameters is considered. The parameters of the rotor dynamics, rotor stiffness Kβ , K t and time constants τm , τ t , are estimated from flight data by means of system identification and hence prone to be erroneous. As discussed in this paper, with the controller proposed in Raj, Banavar, Abhishek, and Kothari (2017), the tracking completely fails by using an overestimated value of the main rotor time constant, τm , in the controller. In this paper, a robust attitude tracking controller is designed using notions of geometric control and the backstepping approach which renders the solutions of the associated error dynamics to be uniformly ultimately bounded. It is observed through numerical simulations that the proposed controller is capable of performing aggressive rotational maneuvers in the presence of the aforementioned structured and unstructured disturbances. The paper is organized as follows: Section 2 describes the rotor-fuselage dynamics of a small-scale helicopter, explains the effect of aerodynamic damping, and motivates the need for a robust attitude tracking controller. Section 3 presents the proposed robust attitude tracking controller for the helicopter rotor-fuselage dynamics. The efficacy of the proposed controller is demonstrated through numerical simulation in Section 4. 2. Helicopter Model Unlike quadrotors, a helicopter modeled as a rigid body does not capture all the dynamics required for high bandwidth attitude control purposes. Hence we consider here a hybrid model of a small scale flybarless helicopter which consists of a fuselage and a rotor. The fuselage is modeled as a rigid body and the rotor as a first order system which generates the required control moment. The inclusion of the rotor model is crucial, since it introduces the significant aerodynamic damping in the system, which is an integral part of the dynamics of the helicopter. This clearly distinguishes the helicopter control problem from that of rigid bodies in space and robotics applications, where this interplay is not present. rotor tip path plane Ob hub plane Xb Oe Xe Ye Yb fuselage Zb Ze Figure 1: Fuselage and tip path plane. The rotational equations of motion of the fuselage are given by, Ṙ = Rω̂, J ω̇ + ω × Jω = M + ∆ f (t), 2 (1) where R ∈ SO(3) is the rotation matrix which transforms vectors from body fixed frame, (Ob , X b , Yb , Z b ), to inertial frame of reference, (Oe , X e , Ye , Ze ). M ¬ [M x , M y , Mz ] is the external moment acting on the fuselage due to the rotor, ∆ f is the disturbance torque bounded by ∆ f (t) < δ f and J is the body moment of inertia of the fuselage. ω = [ω x , ω y , ωz ] is the angular velocity of the fuselage expressed in the body frame. The ˆ is a Lie algebra isomorphism from R3 to so(3) given by hat operator, (·),  −ωz 0 ωx 0 ω̂ =  ωz −ω y  ωy −ω x  . 0 The first order tip path plane (TPP) equations for the rotor are considered, as they capture the required dynamics for gross movement of the fuselage (Mettler, 2013). The coupled flap equation for the rotor as given in Mettler (2013); Chen (1980) are ȧ = − kβ 1 1 1 a− b − ωy − ωx + θa , τm 2ΩIβ Ωτm τm kβ 1 1 1 b+ a − ωx + ωy + θb , ḃ = − τm 2ΩIβ Ωτm τm (2) where a and b are respectively the longitudinal and lateral tilt of the rotor disc with respect to the hub plane as shown in Fig. 2. τm is the main rotor time constant and θa and θ b are the control inputs to the rotor subsystem. They are respectively the lateral and longitudinal cyclic blade pitch angles actuated by servos through a swash plate mechanism. kβ is the blade root stiffness, Ω is the main rotor angular velocity, and Iβ is the blade moment of inertia about the flap hinge. The above equation introduces cross coupling through flap angle and angular velocity. It can be rewritten as kβ ωx  1 1  a− b − ωy + θa − , τm 2ΩIβ τm Ω ωy  kβ 1 1  ḃ = − θb + . b+ a − ωx + τm 2ΩIβ τm Ω ȧ = − (3) Note that the effect of the angular velocity cross coupling can be effectively canceled using the fuselage angular velocity feedback, since the rotor angular velocity, Ω, can be measured accurately using an on-board autopilot. T rotor disc kβ hub plane b h Yb fuselage Zb Figure 2: Rotor-fuselage coupling. The coupling of rotor and fuselage occurs through the rotor hub. The rolling moment, M x and pitching moment M y , acting on the fuselage due to the rotor flapping consists of two components – due to tilting of the thrust vector, T , and due to the rotor hub stiffness, kβ , and are given by M x = (hT + kβ )b, M y = (hT + kβ )a, (4) where h is the distance of the rotor hub from the center of mass. For small-scale helicopters, the rotor hub stiffness kβ is much larger than the component due to tilting of thrust vector, hT (see Table 1). Thus, a nominal 3 variation in thrust would result in only a small variation of the equivalent hub stiffness, Kβ ¬ (hT + kβ ). The control moment about yaw axis, Mz , is applied through tail rotor which, due to it’s higher RPM, has a much faster aerodynamic response than the main rotor flap dynamics. The tail rotor along with the actuating servo is modeled as a first order system with τ t as the tail rotor time constant, Ṁz = −Mz /τ t + K t θ t /τ t . (5) The main rotor dynamics (2) and tail rotor dynamics could be written in terms of the control moments and a pseudo-control input θ ¬ [θ b + ω y /Ω, θa − ω x /Ω, θ t ] as, Ṁ = AM − Kω x y + KAτ θ , (6) where  −1/τm A ¬  −k 0 k −1/τm 0  0 0 , −1/τ t  1/τm Aτ ¬  0 0 0 1/τm 0  0 0 , 1/τ t  Kβ K ¬ 0 0 0 Kβ 0  0 0 , Kt (7) ω x y ¬ [ω x , ω y , 0], k ¬ kβ /(2ΩIβ ), and M ¬ [M x , M y , Mz ]. The symmetric and skew symmetric parts of A are denoted by −Aτ and Ak respectively. Note that the combined rotor-fuselage dynamics given by (1) and (6) cannot be given the form of a simple mechanical system (Bullo and Lewis, 2004) as the actuator dynamics is first order. This precludes the equations of motion being written in the usual form of a geodesic on a Riemannian manifold. The aerodynamic damping comes in through the presence of negative angular velocity terms in (2). A positive angular velocity builds up negative flap angles, leading to negative moment and vice versa. The effect of the damping on the attitude dynamics of a small-scale helicopter (parameters in Table 1) is depicted in Fig 3. An initial angular velocity of 360 deg/s about the roll axis is damped to zero in less than a second. The maximum damping moment generated in the process is 17 N-m, which is a significant torque for a rigid body of this size. Aerobatic maneuvers involve attitude trajectories of large angular velocities, therefore there is a need to design controllers which cancel the damping effect. The effect of damping can be canceled effectively by augmenting the control input with angular velocity feedback. Exact cancellation requires the knowledge of the true value of the main rotor time constant, τm . An overestimate of τm if used for canceling ω x y would result in a positive feedback of the angular velocity, which could make the attitude dynamics unstable as shown in Fig 4. We restrict our analysis to the case where the rotor stiffness parameters are known perfectly, although it can be easily extended to include such uncertainties. This assumption is justified as it has been observed through numerical simulations that even a significant error in K does not lead to tracking instability. This motivates the attempt made in this paper to make the attitude controller robust with respect to uncertainty in the main rotor time constant. 10 7 Mx ωx 6 ωy 4 ω (rad/s) My 5 damping moment (N-m) 5 3 2 1 0 -1 0 -5 -10 -15 -2 -3 -20 0 0.2 0.4 0.6 0.8 1 time (s) 0 0.2 0.4 0.6 0.8 1 time (s) (b) Damping Moment generated (a) Angular Velocity Figure 3: The effect of aerodynamic damping on attitude dynamics of small-scale helicopter. Response to an initial condition of 360 deg/s about roll axis The estimates of rotor time constants are given by τ̄m = (1 + αm )τm and τ̄ t = (1 + α t )τ t where the uncertainty parameters αm , α t satisfy |αm | < αm,max < 1 and |α t | < α t,max < 1. Define the maximum 4 variation in parameters to be α ¬ max{αm,max , α t,max }. The estimates of Aτ and A are given by  1/τ̄m Āτ ¬  0 0 Using the above relations we have  1 + αm  0 Aτ Ā−1 = τ 0 0 1/τ̄m 0 0 1 + αm 0  0 0 , 1/τ̄ t  0 0 , 1 + αt Ā = −Āτ + Ak . (8) max I − Aτ Ā−1 = α. τ (9) αm ,α t 3. Robust Attitude Tracking for Helicopter Given a twice differentiable attitude reference command (R d (t), ωd (t), ω̇d (t)), the objective is to design an attitude tracking controller for the helicopter. The combined rotor-fuselage dynamics is reproduced here for convenience Ṙ = Rω̂, (10a) J ω̇ + ω × Jω = M + ∆ f (t), (10b) Ṁ = AM − Kω x y + KAτ θ . (10c) In order to apply the backstepping approach, first the tracking problem is transformed to stabilization of the error dynamics. Then, a robust attitude tracking controller for the fuselage subsystem is designed, as is described in Lee, Leok, and Harris McClamroch (2011), which is subsequently extended to include the rotor dynamics. The configuration space of fuselage subsystem is the Lie group SO(3). As is pointed out by Maithripala, Berg, and Dayawansa (2006), a general tracking problem on a Lie group can be reduced to a configuration stabilization problem about the identity element of the group. This is possible on a Lie group since the error between any two configurations can be naturally defined using the group operation. Such an operation is not always defined on a general configuration manifold. For the set of rotation matrices, SO(3), the rotation error matrix between the current rotation R and the desired rotation R d is defined as R e ¬ R Td R. R e transforms a vector from the current body frame to the desired body frame. To obtain the fuselage error dynamics, differentiate R e Ṙ e = R Td Ṙ + Ṙ Td R = R Td Rω̂ − ω̂d R Td R = R e (ω̂ − R Te ω̂d R e ). (11) Defining eω ¬ ω − R Te ωd , then Ṙ e reduces to Ṙ e = R e êω . (12) Differentiate J eω to obtain the fuselage error dynamics J ėω = −ω × Jω + J(êω R Te ωd − R Te ω̇d ) + M + ∆ f . (13) Defining e M ¬ M − Md as the difference between the actual and desired moment acting on the fuselage due to the rotor. Differentiating e M gives the rotor error dynamics, ė M = Ae M + AMd − Ṁd − Kω x y + KAτ θ . (14) The equilibrium of the error dynamics corresponding to zero tracking error and hence meant to be stabilized is (R e , eω , e M ) = (I, 0, 0). The tracking error stabilizing controller has proportional derivative plus feed-forward components. The proportional action is derived from a tracking error function ψ : SO(3) → R which is defined as 1 (15) ψ(R e ) ¬ t r[I − R e ]. 2 ψ has a single critical point within the sub level set about the identity I, Γ2 ¬ {R ∈ SO(3)|ψ(R) < 2}. This sublevel set represents the set of all rotations which are less than π radians from the identity I. The derivative of ψ is given by d 1 1 ψ(R e (t)) = t r(−Ṙ e (t)) = − t r(R e êω ) dt 2 ‹2 1 1 = − tr (R e − R Te )êω = eR · eω , 2 2 5 (16) where the rotation error vector is 1 [R e − R Te ]∨ , (17) 2 ˆ The above derivation uses the fact that − 1 t r(â b̂) = a · b where (·)∨ : so(3) → R3 is the inverse of hat map (·). 2 and the trace of the product of symmetric and skew symmetric matrices is zero. The total derivative of eR is eR ¬ 1 1 (Ṙ e − Ṙ Te )∨ = (R e êω + êω R Te )∨ 2 2 = B(R e )eω , ėR = (18) where B(R e ) ¬ 21 [t r(R Te )I − R Te ]. Since ψ is positive definite and quadratic within the sub level set Γξ2 ¬ {R ∈ SO(3)|ψ(R) ≤ ξ2 } for some positive ξ2 < 2, this makes ψ uniformly quadratic about the identity (Bullo and Lewis, 2004). This implies there exists positive constants b1 = 1/2 and b2 = 1/(2 − ξ2 ) (Lee, 2011) such that b1 keR k2 ≤ ψ(R) ≤ b2 keR k2 . (19) The following definition of ultimate boundedness taken from Khalil (2002) has been given here for the sake of completeness. Definition 1. Consider the system ẋ = f (x, t) (20) where f : [0, ∞) × D → Rn is piecewise continuous in t and locally Lipschitz in x on [0, ∞) × D, and D ⊂ Rn contains the origin (equilibrium). The solutions of (20) are uniformly ultimately bounded with ultimate bound b if there exist positive constants b and c, independent of t 0 , and for every a ∈ (0, c), there is T = T (a, b) ≥ 0, independent of t 0 , such that kx(t 0 )k ≤ a =⇒ kx(t)k ≤ b, ∀t ≥ t 0 + T. (21) The following lemma uses Lyapunov analysis to show ultimate boundedness for (20) and is a variation of Theorem 4.18 in Khalil (2002). Lemma 1. Let D ⊂ Rn be a domain that contains the origin and V : [0, ∞) × D → R be a continuously differentiable function such that « k1 kxk2 ≤ V (t, x) ≤ k2 kxk2 (22) ∀x ∈ Λcc2 ¬ {x ∈ D|c1 ≤ V ≤ c2 , 0 < c1 < c2 }, ∀t ≥ 0, 1 V̇ ≤ −k3 kxk2 for positive k1 , k2 , k3 and consider the sublevel set L c− ¬ {x ∈ Rn |V ≤ c2 } ⊂ D. Then, for every initial condition 2 x(t 0 ) ∈ L c− , the solution of (20) is uniformly ultimately bounded with ultimate bound b, i.e. there exists T ≥ 0 2 such that  ‹1/2 k2 kx(t 0 )k e−γ(t−t 0 ) , ∀t 0 ≤ t ≤ t 0 + T (23a) kx(t)k ≤ k1 ∀t ≥ t 0 + T kx(t)k ≤ b, where γ = k3 2k2 , b= € Š1/2 c1 k1 (23b) . Proof. See Appendix. „ The following theorem presents the main result of the paper. Theorem 1. For all initial conditions starting in the set S ¬ {(R e , eω , e M ) ∈ SO(3) × R3 × R3 |ψ(R e ) + 21 ẽω · J ẽω + 12 e M · e M ≤ ξ2 } for a positive ξ2 < 2, the solutions of the error dynamics (12), (13), and (14) are rendered uniformly ultimately bounded by the following choice of control input θ = (K Āτ )−1 (−ĀMd + Ṁd − ẽω + Kω x y + µ r ), (24) where ẽω = eω + kR eR , Md = −kω ẽω − eR − kR J Beω + ω × Jω − J(êω R Te ωd − R Te ω̇d ) + µ f , µr = kδ r k2 e M −α , 1 − α kδ r k ke M k + ε r µf = δ r = ẽω + Ak Md − Ṁd − Kω x y , 6 −δ2f ẽω δ f kẽω k + ε f , (25) (26) for some kR > 0, kω > 0 and ε f > 0, ε r > 0 such that ε ¬ ε f + ε r < ξ2 λmin (W ) . λmax (U2 ) (27) The ultimate bound is given by ‹1/2 λmax (U2 ) ε . b= λmin (U1 )λmin (W )  The matrices U1 , U2 and W are given by    2 1 0 0 2−ξ2 1 1 0 λmin (J) 0 , U2 ¬  0 U1 ¬ 2 0 2 0 1 0 (28)   0 kR 0 , W ¬  0 0 1 0 λmax (J) 0 0 kω 0  0 . 0 λmin (Aτ ) (29) Proof. Consider the following positive definite quadratic function in the sublevel set Γξ2 , V1 ¬ ψ. The time derivative of this function, V̇1 = eR · eω , can be made negative definite by setting the virtual control input eω = −kR eR . A change of variable ẽω = eω + kR eR would make V̇1 = −kR keR k2 + eR · ẽω . The error dynamics for ẽω is given by ˙ẽω = ėω + kR ėR = J −1 (−ω × Jω + J(êω R T ωd − R T ω̇d ) + M + ∆ f ) + kR Beω . e e (30) A candidate Lyapunov function for the fuselage dynamics is given by V2 = V1 + 12 ẽω · J ẽω . V̇2 is given by V̇2 = V̇1 + ẽω · J ˙ẽω = −kR keR k2 + ẽω · (eR − ω × Jω + J(êω R Te ωd − R Te ω̇d ) + M + ∆ f + kR J Beω ) (31) Setting M = Md from (25) in the above equation would result in δ2f ẽω ‚ 2 2 V̇2 = −kR keR k − kω kẽω k + ẽω · ∆ f − Œ δ f kẽω k + ε f ≤ −kR keR k2 − kω kẽω k2 + kẽω k δ f − = −kR keR k2 − kω kẽω k2 + ε f δ2f kẽω k2 δ f kẽω k + ε f (32) δ f kẽω k δ f kẽω k + ε f 2 < −kR keR k − kω kẽω k2 + ε f . Adding and subtracting Md in (31) would give V̇2 = −kR keR k2 − kω kẽω k2 + ẽω · (∆ f + µ f + e M ) < −kR keR k2 − kω kẽω k2 + ε f + e M · ẽω . (33) Augmenting the above Lyapunov function for the fuselage with the quadratic form 21 e M · e M gives a candidate Lyapunov function for the complete rotor-fuselage dynamics, V3 = V2 + 12 e M · e M . The derivative of V3 is bounded by V̇3 = V̇2 + e M · ė M < −kR keR k2 − kω kẽω k2 + ε f + e M · ẽω + e M · (Ae M + AMd − Ṁd − Kω x y + KAτ θ ). (34) Since −Aτ is the symmetric part of A, the above inequality can be written as V̇3 < −kR keR k2 − kω kẽω k2 − e M · Aτ e M + ε f + e M · (ẽω + AMd − Ṁd − Kω x y + KAτ θ ). (35) Setting θ from (24) would make the above inequality −1 V̇3 < −z · W z + ε f + e M · ((I − Aτ Ā−1 τ )δ r + Aτ Āτ µ r ) (36) where z = (keR k kẽω k ke M k), and δ r and W are given in (26) and (29) respectively. Now consider the last term of the above inequality −1 ζ ¬ e M · ((I − Aτ Ā−1 τ )δ r + Aτ Āτ µ r ), ζ ≤ max I − Aτ Ā−1 ke M k kδ r k + e M · Aτ Ā−1 τ τ µr . αm ,α t 7 (37) Setting µ r from (26) and using the relation in (9) would result in ζ ≤ α ke M k kδ r k − Since Aτ Ā−1 τ is positive definite and kAτ Ā−1 τ k 1−α kδ r k2 α e M · Aτ Ā−1 . τ eM 1−α kδ r k ke M k + ε r (38) > 1, α kδ r k2 ke M k2 kδ r k ke M k + ε r α kδ r k ke M k = εr < εr kδ r k ke M k + ε r (39) V̇3 < −z · W z + ε, (40) ζ ≤ α ke M k kδ r k − Therefore, where ε = ε f + ε r . Next the ultimate boundedness for the tracking error dynamics is shown. V3 is positive definite and quadratic when ψ(R e ) ≤ ξ2 for some positive ξ2 < 2. This is guaranteed when V3 ≤ ξ2 . As a result, V3 satisfies the following inequality in the sublevel set Lξ− ¬ {(R e , ẽω , e M ) ∈ SO(3) × R3 × R3 |V ≤ ξ2 } 2 z · U1 z ≤ V3 ≤ z · U2 z (41) λmin (U1 ) kzk2 ≤ V3 ≤ λmax (U2 ) kzk2 (42) or for positive definite U1 and U2 given by (29). V̇3 along the solution of error dynamics is guaranteed to be negative definite when − z · W z + ε ≤ − kzk2 λmin (W ) + ε ≤ −V3 or λmin (W ) +ε≤0 λmax (U2 ) § ª λmax (U2 ) V3 ≥ ε ¬ ξ1 λmin (W ) (43) (44) or in the superlevel set Lξ+ ¬ {(R e , ẽω , e M ) ∈ SO(3) × R3 × R3 |V ≥ ξ1 }. 1 ξ Condition (22) of lemma 1 is satisfied in the set Λξ2 ¬ Lξ− ∩ Lξ+ and ξ1 < ξ2 is met by (27). Therefore it follows 1 1 2 from lemma 1 that the solutions of the rotor-fuselage error dynamics are uniformly ultimately bounded and the ultimate bound is given by (28). „ Remark 1. ε f and ε r could be independently set based on the uncertainties associated with the fuselage and rotor dynamics. This is an important design flexibility for a helicopter since it allows for adjusting the robustness of the controller for exogenous torque independent of uncertainties in rotor parameters. The exogenous torque depends on the type of mission the helicopter flies (e.g. externally attached payload, cable suspended load), while the rotor parameters remain constant for a given rotor hub and blade properties. Remark 2. The proposed controller requires flap angle feedback, which in the case of a large scale helicopter can be easily measured as described in Kufeld, Balough, Cross, and Studebaker (1994). For a small scale helicopter the instrumentation required for flap angle measurement is challenging because of the rotor being hingeless in flap. However, an observer for the flap angle can be implemented with the assumption that the remaining states are available. The attitude and angular velocity can be independently estimated using onboard inertial measurement unit as proposed in Mahony, Hamel, and Pflimlin (2008). 4. Simulation Results The tracking controller given by (24) was simulated for a 10 kg class model helicopter whose parameters are given in table 1. The helicopter was given an initial attitude of 80 deg in pitch angle and 90 deg/s of pitch-rate and was subjected to a sinusoidal roll angle input with an amplitude of twenty degree and a frequency of 1 Hertz. Simulations were performed separately for structured, unstructured and combined structured plus unstructured uncertainties. In the case of structured uncertainty, the main rotor time constant used for controller implementation was assumed to be 30 percent more than the true value. The tracking error dynamics was unstable when the nominal controller, i.e. without the robustification term µ M , was used as shown in Fig. 4. On the other hand, the robust controller performs satisfactorily as is evident from Fig. 5. Unstructured disturbance was introduced by adding disturbance torque of the form ∆ f (t) = Ad ∗ 8 [sin(Ωd t), cos(Ωd t), 0)]. In this case, the performance of the controller with and without the robustification term µ f can be compared from Figs. 6 and 7. Figure 8 shows the performance of the proposed robust controller with the combined structured and unstructured disturbances. The following controller parameters were used for simulation kR = 2.8, kω = 2.5, ε f = 0.1, δ f = 3.4, Ad = 2.3, Parameter [J x x J y y Jzz ] (kg-m2 ) τm (s) kβ (N -m) Iβ (k g-m2 ) Ω (r ad/s) h (m) Kβ (k g-m2 ) ε M = 0.1, 3 . Ωd = 2π Values [0.095 0.397 0.303] 0.06 129.09 0.0327 157.07 0.174 137.7 Table 1: Helicopter parameters 100 4 40 2 ω (rad/s) roll angle (deg) 60 ref roll rate roll rate response pitch rate response 6 ref roll command roll pitch 80 20 0 -20 0 -2 -40 -4 -60 -6 -80 0 1 2 3 4 0 5 1 2 3 5 (b) Roll rate tracking response (a) Roll tracking response 4 25 b a 3 θb 20 θa 15 2 1 cyclic angle (deg) flap angle (deg) 4 time (s) time (s) 0 -1 -2 10 5 0 -5 -10 -3 -15 -4 -20 -25 -5 0 1 2 3 4 5 0 1 2 3 time (s) time (s) (d) Cyclic angle (c) Flap angle Figure 4: Nominal controller response for structured uncertainty 9 4 5 100 5 ref roll command roll pitch 80 3 60 2 ω (rad/s) roll angle (deg) ref roll rate roll rate response pitch rate response 4 40 20 1 0 0 -1 -20 -2 -40 -3 0 1 2 3 4 5 0 1 2 3 time (s) (a) Roll tracking response 5 (b) Roll rate tracking response 8 1 b a 0.5 0 4 -0.5 2 -1 -1.5 -2 -2 -4 -6 -3 -8 -3.5 1 2 3 4 5 θa 0 -2.5 0 θb 6 cyclic angle (deg) flap angle (deg) 4 time (s) -10 0 1 2 time (s) 3 time (s) (c) Flap angle (d) Cyclic angle Figure 5: Robust controller response for structured uncertainty 10 4 5 100 5 ref roll command roll pitch 80 3 60 2 ω (rad/s) roll angle (deg) ref roll rate roll rate response pitch rate response 4 40 20 1 0 0 -1 -20 -2 -40 -3 0 1 2 3 4 5 0 1 2 3 time (s) (a) Roll tracking response 5 (b) Roll rate tracking response 8 1.5 b a 1 0.5 4 0 2 -0.5 -1 -1.5 -2 -4 -6 -2.5 -8 -3 1 2 3 4 5 time (s) θa 0 -2 0 θb 6 cyclic angle (deg) flap angle (deg) 4 time (s) -10 0 1 2 3 time (s) (c) Flap angle (d) Cyclic angle Figure 6: Nominal controller response for unstructured uncertainty 11 4 5 100 5 ref roll command roll pitch 80 3 60 2 ω (rad/s) roll angle (deg) ref roll rate roll rate response pitch rate response 4 40 20 1 0 0 -1 -20 -2 -40 -3 0 1 2 3 4 5 0 1 2 3 time (s) (a) Roll tracking response 5 (b) Roll rate tracking response 2 10 b a 1 θb θa 5 0 cyclic angle (deg) flap angle (deg) 4 time (s) -1 -2 0 -5 -10 -3 -15 -4 0 1 2 3 4 5 0 1 2 3 time (s) time (s) (d) Cyclic angle (c) Flap angle Figure 7: Robust controller response for unstructured uncertainty 12 4 5 100 5 ref roll command roll pitch 80 3 60 2 ω (rad/s) roll angle (deg) ref roll rate roll rate response pitch rate response 4 40 20 1 0 0 -1 -20 -2 -40 -3 0 1 2 3 4 5 0 1 2 3 time (s) 4 5 time (s) (a) Roll tracking response (b) Roll rate tracking response 2 10 b a 1 θb 8 θa 6 cyclic angle (deg) flap angle (deg) 0 -1 -2 4 2 0 -2 -4 -3 -6 -4 -8 -10 -5 0 1 2 3 4 5 0 1 2 3 time (s) time (s) (d) Cyclic angle (c) Flap angle Figure 8: Robust controller response for structured and unstructured uncertainty 13 4 5 5. Conclusion The paper classifies the possible uncertainties associated with a rotor-fuselage model of a helicopter into structured and unstructured disturbances. The proposed controller is robust with respect to both these uncertainties and the tracking error is shown to be ultimately bounded. The ultimate bound of the tracking error can be made arbitrarily small by an appropriate choice of the design parameters ε f and ε r , being only restricted by control input saturation. To the best of the authors’ knowledge, this is the first time that a robust attitude tracking controller is designed for an aerobatic helicopter which retains the rotor dynamics, is globally defined, and classifies the uncertainties involved into two classes. APPENDIX Proof of Lemma 1 Proof. L c− and L c− are positively invariant sets since V̇ (x(t)) along the solutions of (20) are negative definite 1 2 on their respective boundaries. From (22) V̇ ≤ −k3 kxk2 ≤ −k3 V k2 V (x(t)) Z t k3 dV ≤− dt V k v(x(t 0 )) t0 2  ‹ k3 V (x(t)) ln ≤ − (t − t 0 ) V (x(t 0 )) k2 Z (.1) V (x(t)) ≤ V (x(t 0 ))e−2γ(t−t 0 ) k1 kx(t)k2 ≤ k2 kx(t 0 )k2 e−2γ(t−t 0 ) which leads to (23a) and is valid for all x(t) ∈ Λcc2 . Therefore, kx(t)k continuously decreases in Λcc2 until it 1 1 enters the sublevel set L c− in finite time T . This leads to 1 V (x(t)) ≤ c1 ∀t ≥ t 0 + T, k1 kx(t)k2 ≤ c1 ,  ‹1/2 c1 kx(t)k ≤ , k1 and hence the ultimate bound (23b). (.2) „ References References Pieter Abbeel, Adam Coates, and Andrew Y Ng. Autonomous helicopter aerobatics through apprenticeship learning. The International Journal of Robotics Research, 29(13):1608–1639, 2010. Bilal Ahmed and Hemanshu R Pota. Flight control of a rotary wing uav using adaptive backstepping. In Control and Automation, 2009. ICCA 2009. IEEE International Conference on, pages 1780–1785. IEEE, 2009. Bilal Ahmed, Hemanshu R Pota, and Matt Garratt. Flight control of a rotary wing uav using backstepping. International Journal of Robust and Nonlinear Control, 20(6):639–658, 2010. Francesco Bullo and Andrew D Lewis. Geometric control of mechanical systems: modeling, analysis, and design for simple mechanical control systems, volume 49. Springer Science & Business Media, 2004. Robert TN Chen. Effects of primary rotor parameters on flapping dynamics. 1980. Emilio Frazzoli, Munther A Dahleh, and Eric Feron. Trajectory tracking control design for autonomous helicopters using a backstepping algorithm. In American Control Conference, 2000. Proceedings of the 2000, volume 6, pages 4102–4107. IEEE, 2000. Vladislav Gavrilets, Emilio Frazzoli, Bernard Mettler, Michael Piedmonte, and Eric Feron. Aggressive maneuvering of small autonomous helicopters: A human-centered approach. The International Journal of Robotics Research, 20(10):795–807, 2001. 14 Marco Beat Gerig. Modeling, guidance, and control of aerobatic maneuvers of an autonomous helicopter. PhD thesis, ETH ZURICH, 2008. WE Hall Jr and AE Bryson Jr. Inclusion of rotor dynamics in controller design for helicopters. Journal of Aircraft, 10(4):200–206, 1973. Steven J Ingle and Roberto Celi. Effects of higher order dynamics on helicopter flight control law design. Journal of the American Helicopter Society, 39(3):12–23, 1994. H.K. Khalil. Nonlinear Systems. Pearson Education. Prentice Hall, 2002. ISBN 9780130673893. URL https: //books.google.co.in/books?id=t_d1QgAACAAJ. R Kufeld, Dwight L Balough, Jeffrey L Cross, and Karen F Studebaker. Flight testing the uh-60a airloads aircraft. In ANNUAL FORUM PROCEEDINGS-AMERICAN HELICOPTER SOCIETY, volume 5, pages 557–557. American Helicopter Society, 1994. T. Lee. Robust Adaptive Geometric Tracking Controls on SO(3) with an Application to the Attitude Dynamics of a Quadrotor UAV. ArXiv e-prints, August 2011. T. Lee, M. Leok, and N. Harris McClamroch. Nonlinear Robust Tracking Control of a Quadrotor UAV on SE(3). ArXiv e-prints, September 2011. Robert Mahony, Tarek Hamel, and Jean-Michel Pflimlin. Nonlinear complementary filters on the special orthogonal group. IEEE Transactions on automatic control, 53(5):1203–1218, 2008. DH Sanjeeva Maithripala, Jordan M Berg, and Wijesuriya P Dayawansa. Almost-global tracking of simple mechanical systems on a general class of lie groups. IEEE Transactions on Automatic Control, 51(2):216– 225, 2006. L Marconi and R Naldi. Robust nonlinear control for a miniature helicopter for aerobatic maneuvers. In Proceedings 32nd Rotorcraft Forum, Maasctricht, The Netherlands, pages 1–16, 2006. Lorenzo Marconi and Roberto Naldi. Robust full degree-of-freedom tracking control of a helicopter. Automatica, 43(11):1909–1920, 2007. Bernard Mettler. Identification modeling and characteristics of miniature rotorcraft. Springer Science & Business Media, 2013. Simone Panza and Marco Lovera. Rotor state feedback in helicopter flight control: robustness and fault tolerance. In Control Applications (CCA), 2014 IEEE Conference on, pages 451–456. IEEE, 2014. Nidhish Raj, Ravi N. Banavar, Abhishek, and Mangal Kothari. Attitude tracking control for aerobatic helicopters: A geometric approach. CoRR, abs/1703.08800, 2017. URL http://arxiv.org/abs/1703. 08800. Ioannis A Raptis, Kimon P Valavanis, and Wilfrido A Moreno. A novel nonlinear backstepping controller design for helicopters using the rotation matrix. IEEE Transactions on Control Systems Technology, 19(2):465–473, 2011. Marc D Takahashi. H-infinity helicopter flight control law design with and without rotor state feedback. Journal of Guidance, control, and Dynamics, 17(6):1245–1251, 1994. Shuai Tang, QiuHui Yang, ShaoKe Qian, and ZhiQiang Zheng. Attitude control of a small-scale helicopter based on backstepping. Proceedings of the Institution of Mechanical Engineers, Part G: Journal of Aerospace Engineering, 229(3):502–516, 2015. Bing Zhu and Wei Huo. Robust nonlinear control for a model-scaled helicopter with parameter uncertainties. Nonlinear Dynamics, 73(1-2):1139–1154, 2013. 15
3cs.SY
The Competition Complexity of Auctions: A Bulow-Klemperer Result for Multi-Dimensional Bidders Alon Eden∗ Michal Feldman† Ophir Friedler‡ Inbal Talgam-Cohen§ arXiv:1612.08821v1 [cs.GT] 28 Dec 2016 S. Matthew Weinberg¶ December 30, 2016 Abstract A seminal result of Bulow and Klemperer [1989] demonstrates the power of competition for extracting revenue: when selling a single item to n bidders whose values are drawn i.i.d. from a regular distribution, the simple welfare-maximizing VCG mechanism (in this case, a second price-auction) with one additional bidder extracts at least as much revenue in expectation as the optimal mechanism. The beauty of this theorem stems from the fact that VCG is a priorindependent mechanism, where the seller possesses no information about the distribution, and yet, by recruiting one additional bidder it performs better than any prior-dependent mechanism tailored exactly to the distribution at hand (without the additional bidder). In this work, we establish the first full Bulow-Klemperer results in multi-dimensional environments, proving that by recruiting additional bidders, the revenue of the VCG mechanism surpasses that of the optimal (possibly randomized, Bayesian incentive compatible) mechanism. For a given environment with i.i.d. bidders, we term the number of additional bidders needed to achieve this guarantee the environment’s competition complexity. Using the recent duality-based framework of Cai et al. [2016] for reasoning about optimal revenue, we show that the competition complexity of n bidders with additive valuations over m independent, regular items is at most n + 2m − 2 and at least log(m). We extend our results to bidders with additive valuations subject to downward-closed constraints, showing that these significantly more general valuations increase the competition complexity by at most an additive m − 1 factor. We further improve this bound for the special case of matroid constraints, and provide additional extensions as well. ∗ Computer Science, Tel-Aviv University. [email protected]. Work done in part while the author was visiting the Simons Institute for the Theory of Computing. † Computer Science, Tel-Aviv University, and Microsoft Research. [email protected]. ‡ Computer Science, Tel-Aviv University. [email protected]. § Computer Science, Hebrew University of Jerusalem. [email protected]. ¶ Computer Science, Princeton University. [email protected]. Work done in part while the author was a research fellow at the Simons Institute for the Theory of Computing. 1 Introduction A great deal of research in recent years has been devoted to the design of simple mechanisms, motivated in part by their desirability in practical settings [see 15, 44, 39, 40, and many subsequent works]. Different measures of mechanism complexity have been considered, including computation and communication complexity, as well as the simplicity of the mechanism’s description, and its dependence on details of the economic environment. This last measure is motivated by early work that has come to be known as Wilson’s doctrine [64], by which simple detail-free mechanisms should be preferred in complex settings in order to alleviate the risks introduced by various assumptions. Indeed, Wilson considered the “progress of game theory” to depend on freeness from such assumptions. This idea is reflected in the distinction between prior-independent and prior-dependent mechanisms. In both cases it is assumed that there exist populations (prior distributions) from which the bidders are drawn. The difference is that prior dependent mechanisms are custom-made to these priors, the details of which are assumed to be fully known. By contrast, the designer of a prior-independent mechanism assumes no knowledge of these priors. In terms of practical applicability, prior-dependent mechanisms risk overfitting to particular beliefs, whereas prior-independent mechanisms are inherently robust. Of course, if we could get exactly the same guarantees from prior-independent mechanisms as prior-dependent ones (as is the case for welfare maximization by the VCG mechanism [62, 22, 37]), we would simply demand that all mechanisms be prior-independent. But this is provably not the case for revenue optimization, where the best prior-dependent mechanisms strictly outperform the best prior-independent ones (as is the case for Myerson’s mechanism [52]). So the game becomes to understand the tradeoff between simplicity and optimality. One approach in this direction that has achieved remarkable success in the past decade is to apply the lens of approximation, and address questions of the form: “what fraction of the optimal revenue can be achieved by a ‘simple’ mechanism?” [59, 15, 44, 17, 18, 29, 56, 46, 39, 2, 47, 3, 31, 58, 5, 66, 19, 36].1 While these works certainly offer an explanation for the ubiquity of simple mechanisms in practice, they don’t quite tell the whole story. The lens of approximation views the environment as fixed, and tries to find a suitable auction that generates as much revenue as possible. But in some settings, particularly in high-stakes markets where small constant fractions amount to large losses, constant-factor approximation guarantees – even with matching impossibility results – may be unsatisfactory. However, once we enter the realm of practically-motivated questions, there’s no reason to view the environment as fixed – the seller could, for instance, spend additional effort recruiting extra bidders to attend the auction instead of treating the number of participants as given. Indeed, a typical economist might (reasonably) demand the optimal revenue and settle for nothing less, and instead pose the question as seeking the minimum cost change to the environment so that a simple mechanism achieves this guarantee. A beautiful result in this spirit is the Bulow-Klemperer (BK) theorem [8], which asserts that in the sale of a single item to n symmetric bidders, whose valuations are drawn from the same (regular) distribution, running the (simple and prior-independent) VCG mechanism (second-price auction in this case) with n + 1 bidders extracts at least as much revenue in expectation as Myerson’s optimal (prior-dependent) mechanism with n bidders. The beauty of this theorem stems from the fact that VCG is a simple and standard mechanism, completely oblivious to the bidder distribution, yet by recruiting a single additional bidder, its revenue surpasses that of the optimal auction. The original BK result was made possible by the work of Myerson [52], thanks to which 1 Some of these works study prior independence [59, 44, 29, 56, 2, 31, 36], and others propose mechanisms that are inherently simple and robust, such as “sell each item separately.” 1 revenue optimization is extremely well-understood in single-dimensional settings. In contrast, revenue optimization is extremely poorly-understood in multi-dimensional settings, even with additive bidders (at least until recently), owing to complicating factors such as randomization [61, 53, 7, 40], non-monotonicity [41], computational intractability [24, 21, 20], and other factors which do not arise in single-dimensional settings [54, 25, 26, 35, 34]. BK results and competition complexity. In this paper, we establish the first full BK results for a wide range of multi-dimensional settings. By full BK results, we mean theorem statements of the form “the revenue of mechanism M with n + C symmetric bidders drawn from any population F is at least as large in expectation as the optimal revenue with n bidders, as long as F satisfies condition X”,2 where: (a) M is simple and prior-independent – and in this paper we further restrict to M = VCG as in the original BK result, (b) the revenue of M is required to surpass the optimal revenue without additional bidders (no approximation loss whatsoever), and (c) the optimal revenue refers to the optimum among all, possibly randomized, Bayesian incentive compatible (BIC) and Bayesian individually rational (BIR)3 mechanisms.4 For the minimum C such that a full BK statement holds for an environment (number of bidders n, number of items m, class X of valuations and distributions), we say that the environment has competition complexity C. The competition complexity thus measures how much competition is needed before the revenue of a simple mechanism reaches a strong revenue benchmark. Competition complexity complements in a sense the measure of sample complexity [23, 45, 49, 55, 51, 50, 30], which measures how much data is needed before the revenue of a (non-simple) mechanism approximates a benchmark. 1.1 Our Results and Techniques Before we state our results, we remark that it is not even a priori clear that any number of additional bidders suffices to reach the optimal revenue (rather than just approximate it). In fact, without an independence assumption on the bidders’ distributions, already there exist distributions over additive valuations for two items for which the revenue of VCG with any (finite) number of bidders never surpasses the revenue of the optimal mechanism for just one bidder (this result is a direct corollary of [40]5 ). We consider the following distributions over valuation functions v: For every item j, P vj is independently drawn from a distribution Fj , and for every set of items S, v(S) = maxT ⊆S,T ∈I { j∈T vj }, for some downward-closed set system ([m], I). Such valuations are called “additive subject to downward-closed constraints I, with independent items.” When all Fj are regular, we say “independent, regular items”. For example, when I = 2[m] , v is just an additive valuation function. We also consider extensions where the constraints I are themselves randomly drawn (independently of item values), and in such instances replace “downward-closed constraints I” with “randomly drawn downward-closed constraints”. 2 Note that X encompasses both the class of valuations of the bidders, and typically also independence and regularity conditions on their distribution. 3 BIC means that it is a Bayes-Nash equilibrium for all bidders to bid their true value. BIR means that agents’ expected utility in this equilibrium is non-negative. 4 This is in contrast to the work of [56] which uses a strictly lower benchmark, namely, the optimum among all deterministic DSIC mechanisms. More on this in Section 1.2. 5 When bidders’ values are correlated, [40] shows there can be an infinite gap between the revenue of the optimal randomized mechanism and the optimal deterministic one, even with one bidder and two items. This implies there cannot be a finite bound on the competition complexity since the revenue of VCG from each item is bounded by the optimal revenue for each item, which is a concave function of the number of bidders by revenue submodularity [32]. 2 Theorem: We obtain the following competition complexity results: • The competition complexity of n bidders with additive valuations over m independent, regular items is at most n + 2(m − 1) and at least Ω(log m). • The competition complexity of n bidders with additive valuations subject to downward-closed constraints I over m independent, regular items is greater than the competition complexity of n additive bidders over m independent, regular items by at most m − 1. There exist constraints for which this is tight.6 • For all matroid set systems ([m], I), the competition complexity of n bidders with additive valuations subject to matroid constraints I over m independent, regular items is greater than the competition complexity of n additive bidders over m independent, regular items by at most ρ, where ρ is the maximum number of disjoint independent sets in I that span (but do not include) item j, over all items j. There exist constraints for which this is tight. • The competition complexity of n bidders with additive valuations subject to randomly drawn downwards-closed constraints over m independent, regular items is greater than the competition complexity of n additive bidders over m independent, regular items by at most 2(m − 1). A direct implication of the above theorem is that the competition complexity of n bidders with additive valuations subject to downward-closed constraints over m independent, regular items is at most n+3(m−1) and at least m−1. Note that for k-uniform matroids, ρ = m−k , and so ρ = m−1 for unit-demand valuations (and ρ = 0 for additive valuations). The final bullet accommodates markets where, for instance, bidders are equally likely to be additive or unit-demand, independently of their values. Our techniques. At a high level, our approach breaks down into three steps: (1) Find a suitable upper bound on the optimal revenue for many additive bidders, using the duality framework of [13]. (2) Prove that, for additive bidders, VCG with additional bidders surpasses this benchmark, using coupling arguments and probabilistic tools. (3) Prove a “reduction” from arbitrary downwardclosed set systems to additive bidders, at the cost of m − 1 additional bidders. Step One: Revenue Upper Bound. While we make use of the duality framework developed in [13], the upper bounds they derive for additive bidders provably don’t suffice for our goals. Specifically, for a single additive bidder and any C > 0, there exists a distribution that is additive over two independent, regular items where the revenue of VCG with C + 1 bidders does not exceed their bound (the example appears in Section 3.1). So our first step is to provide a new bound (still using their framework) that is suitable for our setting. Without getting into much detail, our bound can be viewed as taking a similar approach to theirs, but in “quantile space” as opposed to “value space.” That is, whenever their approach compares two random variables by their value, we instead compare them by their quantile.7 We postpone further details to Section 3.3, but note here that we do expect our approach to be useful for future BK results, and multi-dimensional mechanism design in general. Step Two: Covering with Extra Bidders. After finding a suitable bound, we need to show that the revenue of VCG with additional bidders surpasses this bound. The key tools here are 6 In fact, regularity can be replaced here (and in the next item) with any property X of one-dimensional distributions. 7 The quantile of a random variable X drawn from distribution with CDF F is F (X). 3 coupling arguments between random variables representing the revenue of VCG with additional bidders and the random variable from Step One. We wish to highlight the unique challenge in targeting a full BK result as opposed to an approximation, and postpone the details of the argument to Section 4. Whereas in single-dimensional settings, a closed formula for the optimal revenue is well-understood, the optimal revenue in multidimensional settings is the expectation of an extremely bizarre random variable. Any tractable bound on the optimal revenue is therefore necessarily loose, meaning that one needs to be extra careful so as to avoid sacrificing constant-factors. Moreover, all known bounds (including ours, and others from Cai et al.’s framework) are still not “obviously” simple to analyze. To simplify the analysis at the cost of constant-factors, one can upper bound maximums by sums, indicator random variables by 1, etc. For instance, the now-standard “core-tail” decomposition follows from a sequence of operations like this. But since we want a full BK result, these simplifications are too lossy, necessarily complicating the analysis. As a (surprisingly relevant) example, consider two random variables X and Y with the same expectation, and imagine that we wish to design an auction that gets revenue at least E[max{X, Y }]. If we are willing to lose a factor of two, we can simply design an auction that gets revenue at least E[X] = E[Y ] and be done. But if we really refuse to lose constant factors, we’re forced to design a better auction.8 Step Three: Reduction from arbitrary downward-closed feasibility constraints to additive bidders. While we believe our result for additive bidders is already exciting in its own right, we are able to extend it to far more general settings by reduction. More specifically, we first show that the revenue of the optimal mechanism for additive bidders upper bounds the optimal revenue for bidders who are additive subject to any downward-closed constraints (assuming item values are drawn from the same distributions). From here, we show that the revenue of VCG with η + m − 1 bidders who are additive subject to downward-closed constraints is at least as large as the revenue of VCG with η additive bidders (assuming item values are drawn from the same distributions). Chaining these inequalities together, we conclude that the competition complexity increases by at most m − 1 relative to additive bidders. Note that a similar result of [56] for unit-demand bidders can be naturally extended (with some work) to additive bidders subject to matroid constraints, but an entirely new combinatorial approach is necessary for arbitrary downward-closed constraints, and this result may be of independent interest. Moreover, this reduction now allows future research to focus exclusively on improved BK results for additive bidders, as they will immediately extend far more generally. Computational remarks. It is well known that running VCG for the most general environments where our results hold is NP-hard (see, e.g., [63]). Still, we wish to note the following: • Even our result on additive bidders is the first full BK result beyond single-dimensional settings, and VCG can be implemented in poly-time in this setting, in fact whenever the feasibility constraints form a matroid. • Even in environments where it is NP-hard to implement VCG, competition complexity is a meaningful measure in its own right. • The settings that motivate full BK results versus approximations may be exactly those where practitioners find a way to solve NP-hard problems – high stakes instances where anything less 8 Incidentally, we’ll encounter this exact obstacle with X = the “highest virtual value” and Y = the “second-highest value.” Both E[X] and E[Y ] capture the expected revenue of a second-price auction, but it’s not obvious how one should design an auction achieving revenue E[max{X, Y }]. See Section 4. 4 than the optimum is unsatisfactory. The above bullets explain why it is important to understand the competition complexity of VCG, even when it is computationally intractable. Still, we provide additional competition complexity results in Appendix D.1 for a computationally efficient maximal-in-range (MIR) mechanism. Specifically, we show that the MIR mechanism that optimizes over the space of matchings (which can be done in poly-time) also witnesses that the competition complexity of n bidders with additive valuations subject to downward-closed constraints over m independent, regular items is at most n + 3(m − 1). 1.2 Related Work Other BK and Prior-Independent Results. The most related work to ours is [56], which proves the only previous multi-dimensional BK result. Their result holds only for unit-demand bidders (again over independent, regular items), and compares to the optimal deterministic, dominant strategy incentive compatible (DSIC) mechanism,9 where bounds on the optimal revenue are known due to [17]. Due to the weaker benchmark, they are able to bound the competition complexity as m, which is tight. Variants of BK results in single-dimensional settings are established in [44, 32]. There is now a rich literature on prior-independent mechanisms in both single- and multi-dimensional settings [59, 29, 1, 2, 31, 36]. Recently, a growing literature is also considering mechanism design with limited samples from the population (whereas prior-independent mechanisms get zero samples) [e.g., 23, 30]. In comparison to the present paper, all of these results either study single-dimensional settings, or incur some approximation loss. Related Techniques. As already discussed, we use the recent duality framework of [13] to develop our revenue upper bounds. In concurrent work, the same framework is utilized to prove approximation results for simple mechanisms in settings with many “XOS bidders over independent items” [14], a single bidder with values that exhibit “limited complementarity” (by the present authors) [33], and dynamic auctions [48]. So step one of our approach bears similarity to the comparable steps in these works, but each work addresses unrelated problems with techniques specific to the problem at hand. It is also worth noting that [13] “merely” provides a framework for deriving upper bounds on the attainable revenue, and not the upper bound to be used always. Indeed, judging by recent applications of their framework, even selecting the appropriate bound for a given setting seems to be a bit of an art itself (although the approach across different works is of course similar). Related Themes in TCS. BK results resemble in spirit ideas from “beyond worst-case complexity”, and in particular the concept of resource augmentation, where the idea is to compare the performance of an algorithm that is endowed with more resources to an optimal outcome in an environment with less resources. Examples of such results (which are also referred to as bicriteria results) appear in online paging [60], network routing games [57], truthful job scheduling [16], and buffer management [4]. 9 A mechanism is DSIC if it is in ever bidder’s interest to tell the truth, no matter what the other bidders report. It is known that BIC mechanisms can strictly outperform the best randomized, DSIC mechanism in multi-dimensional settings [65]. 5 1.3 Organization. Preliminaries appear in Section 2. Section 3.1 is a warm-up section in which we address a single additive bidder and symmetric items (whose values are drawn i.i.d. from a single distribution). This simple case presents a key idea, which guides us to develop a new duality-based upper-bound in Section 3.3, using the framework of [13]. In Section 4 we present our main results for multiple additive bidders, and Section 5 generalizes our results to additive subject to feasibility constraints, with additional generalizations presented in Sections C and D for matroid and asymmetric feasibility constraints. Section 6 lists open research directions. 2 Preliminaries There are m heterogeneous items and n bidders. Every item j is associated with a distribution Fj with support Tj . Each bidder i’s value for item j, vij , is drawn independently from distribution Fj . Write T = ×j∈[m] Tj and F = ×j∈[m] Fj . Let fj (y) = Prx←Fj [y = x] be the density of Fj and write f (v) = ×j∈[m] fj (vj ). Let ϕj (·) denote Myerson’s virtual value for Fj .10 In this work we assume that Fj is regular for every j, i.e., ϕj (·) is monotone. We consider bidders that are additive subject to feasibility constraints. That is, each bidder i has a downward-closed feasibility constraint set system ([m], Ii ), where Ii ⊆ 2[m] , and bidder i’s value for a set S (given {vij } and Ii ) is X vi (S) = max { vij }. T ⊆S,T ∈Ii j∈T If Ii = I for every bidder i, then we say that bidders are symmetric with respect to their feasibility constraints. If Ii = 2[m] , then bidder i’s valuation is additive. We sometimes refer to additive bidders as unconstrained bidders. Let v = (v1 , . . . , vn ) denote the value profile of the n agents, sampled from F n .11 Let vj = (v1j , . . . , vnj ) be the values of the agents for item j. Let vi,−j denote the values sampled for agent i without item j. Given a vector of real values a, let a(i) denote the i-th highest value in a. Let ϕj (vj )+ = max{ϕj (vj ), 0}. Let IA denote an indicator random variable for an event A. Auction Design. A mechanism is a pair of an allocation and payment functions. Both are functions of the submitted bids. We use pi (·) to denote bider i’s (possibly randomized) payment function. As standard, we study mechanisms that are Bayesian Individually Rational (BIR), i.e., mechanisms in which the expected utility of an agent is non-negative, and Bayesian Incentive Compatible (BIC), i.e., mechanisms where truth-telling maximizes an agent’s expected utility (in both cases, the expectation is over the randomness of the mechanism and other agents’ valuations and strategies). Given a value distribution F , denote by Rev theP expected revenue of the optimal BIR-BIC mechanism; i.e., the mechanism that maximizes Ev∼F [ i∈[n] [pi (v)]] over all BIR-BIC mechanisms. When a single item is for sale, the second price auction with lazy reserves first sets a reserve prices ri for each bidder i, and then solicits a bid from each bidder. It then allocates the item to the highest bidder i if its bid surpasses ri , in which case the payment is the maximum over the second highest bid and ri (if vi < ri , then the item remains unallocated). 10 11 i (v) For continuous distributions, ϕj (v) = v − 1−F . fi (v) ` For a distribution G, let G denote ×j∈[`] G. 6 Competition Complexity. Let OPT(F, n) denote the revenue of the optimal BIR-BIC mechanism for n bidders with valuations drawn i.i.d. from F . Let also Rev(M, F, k) denote the expected revenue of mechanism M when played by k bidders with valuations drawn i.i.d. from F . Then when we use the term “competition complexity,” we formally mean: Definition 2.1 The competition complexity C with respect to a prior-independent mechanism M of n bidders and a class of distributions D is the minimum c such that for all F ∈ D, OPT(F, n) ≤ Rev(M, F, n + c). When M = VCG, we drop “with respect to M ”. Definition 2.2 [Classes of distributions considered.] • Additive over independent items: A distribution F is additive over m independent items if there exist one-dimensional distributions F1 , . . . , FmP , and drawing {v(·)} ← F amounts to drawing ~v = (v1 , . . . , vm ) ← ×j Fj and setting v(S) = j∈S vj . • Subject to constraints I: A distribution F is additive subject to constraints I over m independent items if there exist one dimensional distributions F1 , . . P . , Fm , and drawing v(·) ← F amounts to drawing ~v ← ×j Fj and setting v(S) = maxT ⊆S,T ∈I { j∈T vj }. • Subject to randomly drawn constraints: A distribution F is additive subject to randomly [m] drawn constraints over m independent items if there exists a distribution F0 over 22 (set systems over [m]), and one-dimensional distributions F1 , . . . , Fm , and drawing v(·) ←P F amounts to drawing I ← F0 , ~v ← ×j Fj (independently), and setting v(S) = maxT ⊆S,T ∈I { j∈T vj }. When all referenced Fi are regular, we say “independent, regular items”. Classic Bulow-Klemperer. Theorem 2.3 ([8], in the language of competition complexity) The competition complexity of n bidders with valuations for a single, regular item is 1. Discrete vs. Continuous Distributions. Like [13], we only explicitly consider distributions with finite support. Like their results, all of our results immediately extend to continuous distributions as well via a discretization argument of [27, 58, 43, 42, 6]. We refer the reader to [13] for the formal statement and proof. Tie Breaking. Throughout the paper, we assume that there are no ties in the values of the agents. If there are ties, we break them lexicographically (first by agent’s i.d., then by item’s i.d.). With this tie breaking, we can also assume that there exists a unique welfare maximizing allocation of items to agents — given two allocations with the same welfare, we break ties in the symmetric difference according to the agent’s i.d. and then the item’s i.d. Duality Benchmarks. Equation (1) presents the upper bound on Rev from [13] when there is a single bidder (for details the reader is referred to Appendix A. In particular, Eq. (7)). Let Aj be the event that ∀j 0 6= j : vj > vj 0 and let Āj be the event that ∃j 0 : vj < vj 0 , then:   XX + Rev ≤ fj (vj ) ϕj (vj ) · Pr [Aj ] + vj · Pr [Āj ] (1) j v−j vj 7 v−j 3 Warm-up: Single Bidder In this section, we give an upper bound on the competition complexity of a single additive bidder. These results will convey intuition regarding the techniques used in proving BK results in more complex settings, and for the benchmark we will use in order to prove our results. 3.1 Symmetric Items 0 0 Consider a single additive bidder, and Pidentically distributed items, i.e., Fj = Fj for all j and j , and therefore, ϕj = ϕ for all j. Let j Myem (j) be the expected revenue from selling each item separately to m single-parameter i.i.d. bidders using Myerson’s optimal mechanism. We write a sum over items even though they are identically distributed because in Section 3.3 we describe how the proof changes when items are not necessarily identically distributed. P Lemma 3.1 j Myem (j) ≥ Rev. Proof: Consider the following mechanism M for selling item j to m single-parameter i.i.d. bidders: Run the second price auction with a personal lazy reserve price of ϕ−1 (0) only for bidder j (and a lazy reserve of 0 for all other bidders). Let u denote the value profile of the m bidders. To analyze the expected revenue of this mechanism we consider the revenue from bidder j — a random variable denoted by pj (u) — separately from the revenue from the other bidders, denoted by p−j (u). By the optimality of Myerson’s mechanism, it holds that Myem (j) ≥ Eu [pj (u)] + Eu [p−j (u)]. We couple u and v by simply setting u = v. Consider first pj (u). By Myerson’s theorem, the expected revenue from bidder j equals his expected virtual surplus [52]. By our coupling, and since the items are identically distributed, bidder j is allocated in Mechanism M with precisely the same probability P that event Aj occurs and the bidder’s virtual surplus is non-negative. We get that Eu [pj (u)] = vj fj (vj ) · ϕ(vj )+ · Prv−j [Aj ]. Consider next p−j (u). Using the fact that in the second price auction P bidders other than j win whenever event Āj occurs and pay at least vj , we have Eu [p−j (u)] ≥ vj fj (vj ) · vj · Prv−j [Āj ]. Comparing the bounds on pj (u) and p−j (u) summed over all items to Equation (1) completes the proof. Corollary 3.2 The competition complexity of a single bidder whose valuation is additive over m i.i.d. regular items is at most m. Proof: Consider the revenue of VCG with additional m bidders. By additivity, VCG is separable over the items, and therefore, the revenue is exactly the sum of second price auctions run for each item separately with m+1 bidders. By applying the classic Bulow-Klemperer theorem on each item P separately, we get that VCG with m + 1 bidders gives revenue greater than j Revm (j) ≥ Rev, where the last inequality follows from Lemma 3.1. We note that this proof does not extend when the items are not identically distributed. The reason for this is that now the probability that bidder j wins in the single parameter environment is not identical to the probability that event Aj happens. In fact, next we present an example where the previous benchmark used in [13] fails to provide any meaningful bounds on the competition complexity when items’ values are drawn from different distributions. 8 3.2 Example Where the Previous Benchmark Fails Proposition 3.3 For every C > 0, there exists a value distribution F that is additive over 2 (noni.i.d.) independent, regular items, where Rev(VCG, F, C + 1) is less than the benchmark of Cai et al. [13] for one bidder with valuations drawn from F (Equation (1)). Proof: Consider a market with a single bidder and only two items. Item a is distributed according to the equal revenue distribution capped at some value k; i.e., ( 1 − 1/x x<k Fa (x) = , 1 x=k 1 supported on [1, k]. Item b is distributed according to the following CDF: Fb (x) = 1 − x−k+1 , supported on [k, ∞). One can verify that both distributions are indeed regular. Consider the benchmark (1) proposed by [13], which in the case of two items is interpreted as the expected virtual value of the item with the highest value of the two plus the expected value of the item with the lower value of the two. Since item b always has a higher value than item a, this is exactly the expected virtual value of item b plus the expected value of item a. The expected value of item a is Z 0 k 1 (1 − F (x))dx + k · = 1 + k Z 1 k 1 dx + 1 = 2 + ln k. x As for the expected virtual value of item b, one can readily compute that E[ϕb (x)] = k.12 Combining the expected value of item a and the expected virtual value of item b, we get that the benchmark is at least 2 + ln k + k. Now consider running VCG using ` bidders in total (` − 1 additional bidders). Since running VCG with additive bidders is the same as running VCG for each item separately, we analyze how much revenue we get by running VCG for each item. We first analyze the revenue from running Myerson’s optimal mechanism on item a with ` bidders (which is an upper bound on running VCG). The expected revenue of the optimal single-bidder auction is 1. By revenue submodularity ([32]), the expected revenue of running the optimal mechanism is a concave function of the number of bidders. Thus, the expected revenue of the optimal auction with ` bidders is at most `. We now compute the revenue of the optimal mechanism for item b with ` bidders. For a single bidder, the optimal mechanism sets a take-it-or-leave-it price of k on the item, and gets an expected revenue of k. For two bidders, the optimal mechanism is VCG with monopoly reserves. Since the monopoly reserve is k, this is equivalent to just running VCG. We compute the expected revenue of VCG the following way — fix bidder 1, and compute her expected payment. Bidder 2’s value sets a random threshold for bidder 1. If the quantile of bidder 2’s value is q, then the bidder 1’s expected payment is exactly the probability her value is above v(q) times v(q). This is exactly R(q). Therefore, the expected payment of bidder 1 is exactly the area under the revenue curve, which is equal to (k + 1)/2. By symmetry, bidder 2’s expected payment is (k + 1)/2 as well, and the expected revenue overall is k + 1. Again, by submodularity of revenue, since the second bidder adds 1 to the expected revenue, the expected revenue of VCG with ` bidders is at most k + ` − 1. We get that the expected revenue obtained by running VCG on both items with ` bidders is at most k + 2` − 1. Therefore, ` has to be at least (ln k + 3)/2 = Ω(ln k) in order to cover 12 One easy way to shortcut this computation is the apply Myerson’s Theorem (revenue = virtual welfare) and immediately conclude that E[ϕb (x)] = k · (1 − F (k)) = k. 9 Figure 1: The revenue curve of distribution Fb used in the example. the benchmark. Since k can be arbitrary large, this benchmark is not suitable in providing any meaningful bound on the competition complexity for this market. 3.3 Asymmetric Items In this section we present a new upper bound on the optimal revenue and demonstrate its applicability by showing that it implies a competition complexity result for the case of asymmetric items (and an additive bidder). New Duality-Based Bound: Quantile Based Regions. As previously discussed, the proof of the case where the items are sampled from the same distribution does not extend when the items are not i.i.d. The reason is that the probability of the jth sample to be the highest one is not the same as the probability of bidder j to have the highest value for item j, since the samples of the bidders’ values for item j are i.i.d., while the values of the single bidder for the different items in the original scenario are not i.i.d. The intuition behind the new benchmark we use is that we want to mimic the bidders’ i.i.d. samples, even if the items themselves are not i.i.d. For each item j, we define item j’s region Rj = {v : ∀j 0 6= j Fj (vj ) > Fj 0 (vj 0 )}, that is, for each bidder, region j is defined as the region where the bidder’s value is of the highest quantile according to the items’ distributions. Using this definition, we give a new upper bound on the revenue. Theorem 3.4 (New upper bound on Rev) For every product distribution F , and n additive bidders, whose valuations are sampled i.i.d. from F , Rev ≤ m X j=1   E v∼F n + max ϕj (vij ) · Ivi ∈Rj + vij · Ivi ∈R / j  . (2) i∈[n] Let Bj be the event that ∀j 0 6= j : Fj (vj ) ≥ Fj 0 (vj 0 ) and let B̄j be the event that ∃j 0 : Fj (vj ) < Fj 0 (vj 0 ). A direct corollary of Theorem 3.4 gives the following on the revenue from a single bidder. 10 Corollary 3.5 For every product distribution F , the revenue of a single additive bidder, whose valuation is sampled from F , is upper bounded by   XX + fj (vj ) ϕj (vj ) · Pr [Bj ] + vj · Pr [B̄j ] . (3) j v−j vj v−j Now, one may notice that the probability of event Bj equals exactly the probability that in m i.i.d. samples from Fj , the jth sample is the highest. The derivation of the new upper bound, which uses the duality-based framework of [13], and the resulting corollary, are deferred to Appendix A. In particular, corollary 3.5 stems from Eq. (8). Application to a Single Additive Bidder, Asymmetric Items. With the new bound in hand, we show how to sidestep the impossibility result of Proposition 3.3 associated with the upper bound of [13]. Theorem 3.6 The competition complexity of a single bidder whose valuation is additive over m independent, regular items is at most m. Proof: The proof is almost identical to the proof in Section 3.1. We state what changes in the proof of Proposition 3.1 when we use the upper bound in (3). u is now a vector of i.i.d. draws from Fj , whereas v is a vector of independent draws from F1 , F2 , . . . , Fm . We couple u and v so that Fj 0 (vj 0 ) = Fj (uj 0 ) for every coordinate j 0 . Still, bidder j is allocated in mechanism M with precisely the probability that event Bj occurs and its virtual value is positive (we are using here the monotonicity of Fj , i.e., that uj > uj 0 for all j 0 6= j iff Fj (vj ) = Fj (uj ) > Fj (uj 0 ) = Fj 0 (vj 0 ) for all j 0 6= j). And in the second price auction, bidders other than j win whenever event B̄j occurs, and pay at least vj . 4 Main Result: Bulow-Klemperer for Multiple Additive Bidders In this section, we are given an instance with n additive bidders and m heterogeneous item, where bidders’ valuations are drawn i.i.d. from the product of regular distributions F . We show that by adding n + 2m − 2 bidders and running VCG, we are able to get at least as much revenue as the optimal obtainable revenue by any BIC mechanism with the original n bidders. Theorem 4.1 The competition complexity of n bidders with additive valuations over m independent, regular items is at most n + 2m − 2, and at least Ω(log m). The remainder of this section contains a proof of the upper bound, with some missing proofs of claims deferred to Appendix B. The lower bound is proved in Appendix E, and makes use of the same “i.i.d. equal revenue” example from [39]. 4.1 An Upper Bound on Item j’s Contribution to the Revenue Fix some item j, and consider j’s contribution to the upper bound on the revenue given in Eq. (2), i.e.,    + Revj = E max ϕj (vij ) · Ivi ∈Rj + vij · Ivi ∈R . / j v∼F n i∈[n] For a given valuation profile v, let “(i)” be the index of the bidder with the ith highest valuation for item j. The next key lemma gives a bound on Revj , which is useful in proving our BK result. 11 Lemma 4.2 Revj is upper bounded by           / Rj · Prn v(1) ∈ / Rj . E n max ϕj v(1)j , v(2)j | v(1) ∈ Rj · Prn v(1) ∈ Rj + E n v(1)j | v(1) ∈ v∼F v∼F Proof: v∼F v∼F We consider two cases. If, v(1) ∈ / Rj , then v(1)j ≥ vij ≥ ϕj (vij )+ · Ivi ∈Rj + vij · Ivi ∈R / j for every bidder i, and therefore, v(1)j   + ≥ max ϕj (vij ) · Ivi ∈Rj + vij · Ivi ∈R / j . i∈[n] On the other hand, if v(1) ∈ Rj , then   = max ϕj (vij )+ · Ivi ∈Rj + vij · Ivi ∈R / j i∈[n]    + max ϕj v(1)j , max ϕj (vij )+ · Ivi ∈Rj + vij · Ivi ∈R ≤ / j i6=(1) n o +   max ϕj v(1)j , v(2)j = max ϕj v(1)j , v(2)j . We get that Revj h i   E n max ϕj v(1)j , v(2)j · Iv(1) ∈Rj + v(1)j · Iv(1) ∈R / j v∼F       = E n max ϕj v(1)j , v(2)j | v(1) ∈ Rj · Pr n v(1) ∈ Rj v∼F v∼F     / Rj · Pr n v(1) ∈ / Rj . + E v(1)j | v(1) ∈ n ≤ v∼F v∼F 4.2 (4) A Single Parameter Lemma In this section we prove our main technical lemma. Lemma 4.3 Consider the case with a single item for sale and 2n + 2m − 2 bidders whose values are drawn i.i.d. from Fj . The expected revenue obtained by running VCG (just on item j) is at least Revj . We first show that proving this lemma immediately yields a proof for Theorem 4.1. Proof of Theorem 4.1 (based on Lemma 4.3): For additive bidders, running VCG is equivalent to running VCG on each item separately. Applying Lemma 4.3, we get that Rev ≤ m X j=1 Revj ≤ m X E 2n+2m−2 j=1 vj ∼Fj VCG(vj ) = E VCG(v). v∼F 2n+2m−2 In proving Lemma 4.3, we make use of the following property of VCG, which is folklore knowledge (proof appears in Appendix B for completeness): 12 Observation 4.4 (Folklore) Consider a set of bidders drawn i.i.d. from a regular distribution and a single item for sale. The optimal mechanism that always sells an item is the VCG mechanism. In order to prove Lemma 4.3, we introduce a mechanism for selling a single good to a set of 2n+2m−2 bidders drawn from Fj , and show that the expected revenue of this mechanism is at least the bound on Revj in Eq. (4). Moreover, this mechanism always sells the item, and therefore, by Observation 4.4, VCG gets at least as much revenue, so a bound on the revenue of this mechanism is sufficient to prove Lemma 4.3. Our single-item mechanism, SingleParam-j, is given in Fig. 2. SingleParam-j Input: 2n + 2m − 2 bids sampled i.i.d. from distribution Fj . 1. Consider the bidders in some arbitrary, predetermined order. Rename the bidders as follows: (a) Rename the first n bids to u(1)j , u(2)j , . . . , u(n)j , where u(i)j is the ith highest bid of the first n bids. Let uj denote this n-dimensional vector. (b) Rename the next m − 1 bids to u(1)1 , u(1)2 , . . . , u(1)j−1 , u(1)j+1 , . . . , u(1)m according to their arbitrary order. Let u(1)−j denote this (m − 1)-dimensional vector. (c) Rename the last n + m − 1 bids to w(1)j , w(2)j , . . . , w(n+m−1)j , where w(i)j is the ith highest bid of the last n + m − 1 bids. Let w denote this (n + m − 1)-dimensional vector. 2. Let j 0 ← arg maxk6=j u(1)k . 3. If u(1)j 0 > u(1)j : • Allocate the item to u(1)j 0 . 4. Else:  (a) If ϕj u(1)j > w(2)j : • Allocate the item to u(1)j . (b) Else: • Allocate the item to w(1)j . 5. Charge the winner according to Myerson’s payment identity. Figure 2: A single parameter mechanism with expected revenue at least Revj . We first note that mechanism SingleParam-j is truthful since the allocation of every bidder is monotone in the bidder’s valuation [52]. Before giving the full proof of Lemma 4.3, we give the intuition. The trick is trying to couple the various events v(1) ∈ Rj , ϕj (v(1)j ) > v(2)j , etc. that affect the random variable related to Revj (Eq. (4)) with events that determine the different cases in the mechanism SingleParam-j. The reader can get a good idea for which events will be coupled based on our decision for how to allocate the item in SingleParam-j. However, the complete analysis is a bit subtle and in particular requires the following probabilistic claim (proof appears in Appendix B.1) in addition to the proper coupling. Claim 4.5 For any regular distribution F ,     E max ϕ a(1) , a(2) |a(1) > b(1) ≤ a∼F ` b∼F k E a∼F ` b∼F k c∼F `+k 13     max ϕ a(1) , c(2) |a(1) > b(1) . Note that in the LHS above, the random variables a(1) and a(2) are correlated, but come from ` bidders. In the RHS, a(1) and c(2) are independent, but c comes from ` + k bidders. We proceed to prove our main technical lemma. Proof of Lemma 4.3: Consider the values vj and v(1)−j in the upper bound of Revj in Eq. (4) and uj and u(1)−j as defined in the renaming phase of SingleParam-j. Couple the values whenever vj = uj and Fj 0 (v(1)j 0 ) = Fj (u(1)j 0 ) for every j 0 6= j. To see that this is a valid coupling, observe that both vj and uj are vectors of n i.i.d. samples from Fj , and that Fj 0 (v(1)j 0 ) and Fj (u(1)j 0 ) are sampled uniformly over the interval [0, 1] for all j 0 , independent from other samples. We next analyze the expected revenue obtained by SingleParam-j. For the bidders in uj , we compute their expected virtual value, and for the other bidders, we compute their expected payment. We distinguish between two cases: Case (1): u(1)j 0 > u(1)j for some j 0 (the condition checked in step 3 of the mechanism). In this case the item goes to some bidder u(1)j 0 . Since bidder u(1)j 0 pays the minimum value at which she is allocated, her payment is at least u(1)j . The probability for this case is  0   0  Pr ∃j : u(1)j < u(1)j 0 = Pr ∃j : Fj (u(1)j ) < Fj (u(1)j 0 ) u(1)−j ∼Fjm−1 uj ∼Fjn u(1)−j ∼Fjm−1 uj ∼Fjn = = Pr v(1)−j ∼F−j vj ∼Fjn  0  ∃j : Fj (v(1)j ) < Fj 0 (v(1)j 0 )   Pr n v(1) ∈ / Rj , v∼F where the second equality follows from the coupling and the last equality follows from the definition of Rj and the independence of the samples. 0 Case (2): u(1)j 0 < u(1)j  for all j . This event happens with the complementary probability of Case (1), which is Prv∼F n v(1) ∈ Rj . In this case,  the winner is determined according to the condition in Step 4a of our mechanism. I.e., if ϕ u j (1)i > w(2)j , then the winner is bidder u(1)i ; otherwise if   ϕj u(1)i < w(2)j , the winner is w(1)j , and by the payment identity, her payment is at least w(2)j . Combining the two cases, the expected revenue of SingleParam-j is at least     u(1)j | ∃j 0 6= j : u(1)j < u(1)j 0 · Pr n v(1) ∈ / Rj E v∼F u(1)−j ∼Fjm−1 uj ∼Fjn h + E u(1)−j ∼Fjm−1 uj ∼Fjn i    ϕj u(1)j · Iϕj (u(1)j )≥w(2)j + w(2) · Iϕj (u(1)j )<w(2)j | ∀j 0 6= j : u(1)j > u(1)j 0 · Pr n v(1) ∈ Rj . v∼F w∼Fjn+m−1 We bound each summand of the bound above separately. For the first summand, we have      u(1)j | ∃j 0 6= j : u(1)j < u(1)j 0 = u(1)j | ∃j 0 6= j : Fj u(1)j < Fj u(1)j 0 E E u(1)−j ∼Fjm−1 uj ∼Fjn u(1)−j ∼Fjm−1 uj ∼Fjn = E v(1)−j ∼F−j vj ∼Fjn =    v(1)j | ∃j 0 6= j : Fj v(1)j < Fj 0 v(1)j 0   / Rj , E n v(1)j | v(1) ∈ v∼F 14 where the second equality follows by the coupling, and the last equality follows by the definition of Rj and the independence of samples.  For the second summand, we first notice that ϕj u(1)j · Iϕj (u(1)j )≥w(2)j + w(2) · Iϕj (u(1)j )<w(2)j =   max ϕj u(1)j , w(2) . We have     max ϕj u(1)j , w(2) | ∀j 0 6= j : u(1)j > u(1)j 0 E u(1)−j ∼Fjm−1 uj ∼Fjn w∼Fjn+m−1 ≥  E u(1)−j ∼Fjm−1 uj ∼Fjn = E  v(1)−j ∼F−j vj ∼Fjn =   max ϕj u(1)j , u(2)j   max ϕj v(1)j , v(2)j    E n max ϕj v(1)j , v(2)j v∼F | ∀j 0 6= j : u(1)j > u(1)j 0    | ∀j 0 6= j : Fj v(1)j > Fj 0 v(1)j 0  | v(1) ∈ Rj , where the inequality follows Claim 4.5, the first equality follows by the coupling and the last equality follows by the definition of Rj and the independence of samples. Consequently, the revenue of SingleParam-j is at least           / Rj · Pr n v(1) ∈ / Rj + E max ϕj v(1)j , v(2)j | v(1) ∈ Rj · Pr n v(1) ∈ Rj , E v(1)j | v(1) ∈ v∼F n v∼F v∼F n v∼F which is greater than Revj according to Lemma 4.2. Since Revj is a mechanism that always sells the item, applying Observation 4.4 completes the proof of Lemma 4.3. 5 Generalizations: Additive Subject to Downward-Closed In this section we generalize our results beyond additive bidders, to bidders whose valuations are additive subject to downwards-closed constraints. In Section 5.1 we consider distributions where the constraints are fixed for the entire distribution, and downwards-closed. In Section 5.3, we state the following extensions (all proofs are in the appendix): • In the special case that the constraints are matroids, we obtain improved guarantees on the competition complexity (Theorem 5.6, proved in Appendix C). • In the case that the constraints themselves are part of the distribution (“additive subject to randomly drawn downward-closed constraints”), we obtain slightly weaker guarantees (Theorem 5.7, proved in Appendix D). • Finally, we extend our results to the competition complexity with respect to a poly-time maximal-in-range mechanism. This complements our results with respect to VCG in settings for which VCG cannot be implemented in poly-time (Theorem 5.8, proved in Appendix D.1). 5.1 Symmetric General Downward-Closed Constraints In this section, the bidders have valuations that are additive subject to identical downward-closed feasibility constraints, represented by the set system ([m], I). We can assume without loss of generality that for every item j, {j} ∈ I. Our main result in this section is the following: 15 Theorem 5.1 (Competition complexity for downward-closed) Let the competition complexity of n additive bidders over m independent, regular items be X = X(n, m). Then the competition complexity of n additive bidders subject to downward-closed constraints I over m independent regular items is at most X + m − 1. Theorem 5.1 relies on the Lemma 5.2 below. Corresponding lemmas for matroids and asymmetric feasibility constraints appear in Appendices C and D, respectively (in particular, Lemmas C.2 and D.1). To state our main lemma we use the following notation: fix a product of m regular distributions F ; let VCGAdd denote the expected VCG revenue from selling the m items to n adn ditive bidders whose values are i.i.d. draws from F ; let VCGDC n0 denote the expected VCG revenue from selling them to n0 ≥ n bidders with i.i.d. values drawn from F , whose valuations are additive subject to n0 identical downward-closed feasibility constraints. Intuitively, if n0 ≈ n, the expected revenue from VCG with the n unconstrained bidders is higher than the revenue from VCG with the n0 constrained bidders, since in the former all bidders compete for all items. Lemma 5.2 gives a bound on how much larger n0 should be relative to n such that this intuition ceases to hold. Add Lemma 5.2 (Main lemma for downward-closed) VCGDC n+m−1 ≥ VCGn . The proof of Lemma 5.2 appears in Section 5.2. This lemma can be thought of as quantifying the extra competition complexity required due to the feasibility constraints of the bidders (in comparison to unconstrained additive bidders), and is the main technical hurdle in proving Theorem 5.1. At a high level, the proof is as follows: First, observe that however VCG decides to allocate the items, it always has the option to reallocate item j to a bidder who currently receives nothing. So whoever receives item j pays at least the highest value for item j among all bidders who receive nothing, and the trick is comparing this random variable with n + m − 1 bidders to the second-highest value from n bidders. Due to the potential complexity of arbitrary downward-closed feasibility constraints, the random variable denoting the highest value for item j among bidders who receive nothing depends quite intricately on the values of all bidders for all other items, and one cannot reason about this random variable with the same Greedy-type arguments one might use for feasibility constraints that are matroids, and a more careful combinatorial argument is required instead. Given Lemma 5.2 (proved shortly), we can prove the main theorem of this section: Proof of Theorem 5.1: Fix a product of regular distributions F , and a downward-closed feasibildenote the optimal expected revenue that ity set system. We use the following notation: let RevAdd n can be achieved from selling the m items to n additive bidders whose values are i.i.d. draws from denote the optimal expected revenue from selling them to such bidders whose F , and let RevDC n valuations are subject to the downward-closed constraint. Note first that for every feasibility set system, RevAdd ≥ RevDC n n . This follows from the following three facts: • Without loss of generality, the optimal mechanism for agents subject to downwards-closed constraints I only allocates sets in I. • The designer of a mechanism for additive bidders is free to restrict herself to allocating only sets in I. • Subject to this restriction, it is immaterial whether a bidder is additive or additive subject to I. So in particular, there exists an optimal mechanism for bidders constrained by I that is truthful for unconstrained bidders, and the optimal mechanism can only get better. By our assumption that the competition complexity of additive bidders is X = X(n, m), we Add DC Add know that VCGAdd n+X ≥ Revn . We can now apply Lemma 5.2 to get VCGn+X+m−1 ≥ VCGn+X . 16 Putting everything together, Add Add VCGDC ≥ RevDC n+X+m−1 ≥ VCGn+X ≥ Revn n . We have shown that the competition complexity of additive bidders subject to downward-closed constraints is X + m − 1, and this completes the proof of Theorem 5.1. 5.2 Proof of Main Lemma (5.2) for Downward-Closed We first introduce a lemma that gives a lower bound on the revenue of VCG with bidders subject to identical downward-closed constraints. Lemma 5.3 Consider a set of bidders with identical downward-closed feasibility constraint, and the outcome of VCG. For each item j, let vj∗ be the highest value of an unallocated bidder for item P j (a bidder that does not receive any item). The revenue of VCG is at least j∈[m] vj∗ . Proof: Recall that in the VCG mechanism, each bidder pays his externality on the environment; i.e., the difference in welfare of other bidders when he is not allocated and we he is. Let A and Ā = [n] \ A be the respective sets of allocated and unallocated bidders. Fix a bidder i ∈ A, and let Si be the feasible set of items he receives in VCG. Let W be the welfare of the VCG outcome. The welfare of all bidders but i for this allocation is W − vi (Si ). Consider now the following allocation — allocate the items not in Si as in the allocation of the VCG mechanism, and distribute the items in Si among the unallocated bidders, where each item j ∈ Si is allocated for a bidder i0 ∈ Ā that has value vj∗ for item j. Notice that since the bidders allocated items in Si receive subsets of a feasible set of items, their allocation is also feasible due to the downward-closedness of the feasibility set. The welfare of the purposed allocation is P W − vi (Si ) + j∈Si vj∗ . Since we described some allocation of items to all bidders but i, the welfare of the optimal P allocation to bidders without i is at least as high. We get that the payment of bidder i is at least j∈Si vj∗ . Summing over all bidders completes the proof of the lemma. Add Our goal is to show that VCGDC n+m−1 ≥ VCGn . Recall that with additive bidders, VCG Add decomposes over the items. Therefore, VCGn is the sum of expected revenues obtained from selling every item j separately to n single-parameter bidders, whose i.i.d. values are drawn from Fj , using the VCG auction (in this case VCG is equivalent to the second-price auction). To prove the lemma it is thus sufficient to show that for every item j, the expected revenue from selling j separately to n single-parameter bidders – i.e., the expectation of the second highest among n i.i.d. random samples from Fj , denoted by E[u(2:n)j ] – is at most the expected payment for item j in VCG with n + m − 1 constrained bidders (the contribution of selling item j to VCGDC n+m−1 ). In the remainder of the proof we shall argue that in VCG with n + m − 1 constrained bidders, there are always at least n bidders whose values for item j are i.i.d. draws from Fj , such that at most a single bidder from this set can be allocated. Since by Lemma 5.3, the payment for item j is at least the highest value for j among the unallocated bidders. This will show that the expected payment for j is ≥ E[u(2:n)j ], completing the proof. From now on, fix an item j, and fix the values of the n + m − 1 constrained bidders for all items but j. Consider the welfare-maximizing allocation of all items but j to the n + m − 1 bidders. We denote this allocation by OPT−j , and the set of allocated bidders by A. Clearly since we have allocated m − 1 items, |A| ≤ m − 1, and |Ā| = n + m − 1 − |A| ≥ n (where Ā = N \ A). We notice the following: Claim 5.4 If item j is allocated to an bidder i ∈ Ā, no other bidder in Ā is allocated an item. 17 Proof: We argue that if j is allocated to an bidder i ∈ Ā, the allocation of all other items in OPT is identical to their allocation in OPT−j , and so precisely one bidder in Ā is allocated by VCG, as required. Items are allocated as in OPT−j due to the downward-closedness of the constraints on the bidders’ additive valuations; we now show that assuming otherwise leads to a contradiction: Consider the allocation OPT−j , and assume for contradiction that after a bidder i ∈ Ā is allocated item j, to get to allocation OPT we need to perform additional reallocations of items. Since we can assume there’s a unique optimal allocation (as described in Section 2), this means that we need additional reallocations to get to the optimal welfare. Because valuations are additive subject to downward-closed constraints, if we can increase the total welfare by item reallocations when bidder i has item j, we can get the same increase in welfare by these reallocations when bidder i does not have item j. This contradicts the optimality of OPT−j , and completes the proof of the claim. We now further fix the values of the bidders in A for item j, so that all remaining randomness is in the values of the bidders in Ā for item j. The information we currently have allows us to compute an optimal allocation if in the optimal allocation j is allocated to an bidder i ∈ A. We denote this allocation by OPTj∈A . More importantly, it lets us identify a set of bidders in Ā of size at least n − 1 which will not be allocated if j will be allocated to an bidder in A. Claim 5.5 Before sampling the values of item j for set Ā, one can identify a set à ⊆ Ā such that |Ã| ≥ n − 1, and none of the bidders in à will be allocated in case item j is allocated to an bidder in A in OPT. Proof: Whenever j is allocated to some bidder i ∈ A, OP T is OPTj∈A . As mentioned above, OPTj∈A can be computed, even though we do not know the value of item j to bidders in Ā, simply compute the welfare-maximizing allocation in which j is allocated to a bidder in A. We will now prove the existence of n − 1 unallocated bidders from Ā in OPTj∈A . Our proof is by the following charging argument: We show a chain of reallocations which starts from allocation OPT−j and leads to allocation OPTj∈A , and argue that it ends with at least n − 1 bidders in Ā unallocated. Start with bidder i ∈ A who gets item j in OPTj∈A . We say bidder i vacates an item j 0 if j 0 is allocated to i in OPT−j but not in OPTj∈A ; we say bidder i snatches an item j 0 if j 0 is not allocated to i in OPT−j but i adds it to his allocation. Let i vacate and snatch items until i’s allocation reaches his allocation in OPTj∈A . To continue the chain we place the following bidders from A into a “queue” (provided that they are not already in the queue): those from whom i snatched an item and those who end up grabbing an item that i vacated. Importantly, when a bidder i0 enters the queue, there is a unique item to which his entrance can be charged : either an item that was snatched from him by i, or an item that i vacated and he grabbed. We now take the next bidder from the queue and repeat the process (letting this bidder vacate and snatch items until he reaches his allocation in OPTj∈A , and placing bidders in the queue as described above), until the queue is empty. Notice that by the assumption of a unique optimal allocation, each bidder from A not entered to the queue has the same allocation in OPTj∈A and OPT−j . This is true since items of such an bidder are not snatched by bidders in Ā; otherwise, this would contradict OPT−j ’s optimality. We use this chain of reallocations to show a one-to-one mapping from bidders in A \ {i} to items that are allocated to bidders in A both in OPT−j and OPTj∈A . The mapping is as follows: • Each bidder who is entered to the queue since an item of his was snatched by a different bidder in A is mapped to a snatched item. • Each bidder who is entered to the queue since he grabbed a vacated item is mapped to an item he grabbed. • Each bidder in A \ {j} not entered to the queue is mapped to an item allocated to him. 18 This mapping implies bidders in A have at least |A| items allocated to them in OPTj∈A — item j is allocated to bidder i ∈ A, and all other bidders are mapped to a distinct item that is allocated to a bidder in A. This implies that we have at most m − |A| items allocated to Ā in OPTj∈A . Since |Ā| = m + n − 1 − |A|, it must hold that n − 1 bidders from Ā are unallocated in OPTj∈A . Using the two claims above, we can now prove Lemma 5.2. Proof of Lemma 5.2: Let à ⊆ Ā be a set of n − 1 bidders as guaranteed to exist by Claim 5.5. If |Ã| < n, take an arbitrary bidder i0 from Ā \ à and add him to à (such an bidder is guaranteed to exist since |Ā| ≥ n as mentioned above). We now have a set of at least n bidders whose value for item j is yet to be sampled. The values of these bidders for item j are i.i.d. draws from Fj , as required (this is known as the principle of deferred decision). To complete the proof, we now claim that at most one of the bidders from à ∪ {i0 } is allocated in OPT. We consider two cases — If j is allocated to an bidder in Ā, then by Claim 5.4, this is the only bidder from Ā who is allocated an item in OPT, and therefore, the claim follows. If j is allocated to and bidder in A, then by Claim 5.5, all bidders in à that are different from i0 are unallocated in OPT, and the claim follows. This implies that the payment for item j in VCGDC n+m−1 is at least the second highest of n i.i.d draws from Fj , exactly the payment for item j in VCGAdd n . This completes the proof of the lemma, and therefore, of Theorem 5.1. 5.3 Extensions For the special case that the constraints are a matroid, we obtain improved bounds on the competition complexity. A proof and definition of disjoint spanning number appear in Appendix C, but we note here that the disjoint spanning number is always at most m − 1. Theorem 5.6 (Competition complexity for matroids) Let the competition complexity of n bidders with valuations that are additive over m independent, regular items be X = X(n, m), and let I be a matroid with disjoint spanning number ρ. Then the competition complexity of n additive bidders with valuations that are additive subject to constraints I over m independent, regular items is at most X + ρ. For distributions that are additive subject to randomly drawn downward-closed constraints, we obtain the following slightly weaker guarantee on competition complexity (proof in Appendix D). Theorem 5.7 (Competition complexity for randomly drawn downward closed constraints) Let the competition complexity of n bidders with additive valuations over m independent, regular items be X = X(n, m). Then the competition complexity of n bidders with additive valuations subject to randomly drawn downwards-closed constraints over m independent, regular items is at most X + 2(m − 1). Finally, we extend our results to the competition complexity with respect to a poly-time maximal-in-range mechanism. Specifically, we consider the maximal-in-range mechanism that only considers allocations that are matchings (i.e. that allocate each bidder at most one item), and denote this mechanism by VCGUD . Note that VCGUD can be implemented in poly-time. A proof appears in Appendix D.1. Theorem 5.8 (Competition complexity with respect to poly-time MIR mechanism) Let the competition complexity of additive regular bidders be X = X(n, m). Then the competition complexity with respect to VCGUD of n bidders with additive valuations subject to randomly drawn downwards-closed constraints over m independent regular items is at most X + m − 1. 19 6 Discussion and Future Work We present the first full BK results in multi-dimensional settings, and show that the competition complexity of n buyers with additive valuations subject to downward-closed feasibility constraints, over independent, regular items is at most n + 3m − 3, and at least m − 1. For the special case of additive (with no constraints), the competition complexity is at most n + 2m − 2 and at least Ω(log m). For those who are approximation-minded in the traditional sense, an easy corollary is that for fixed m, as n → ∞, VCG itself guarantees a 2-approximation to the optimal revenue.13 An obvious open question is to close the gaps in the above bounds, at least in the special case of additive or unit-demand. Even more concretely: is the right dependence on m for additive bidders linear or logarithmic (or in between)? Is any dependence on n necessary? The latter is especially enticing: if the answer is no, then VCG itself approaches the optimal revenue as n → ∞. Another direction is to consider other prior-independent mechanisms in order to get better guarantees. For instance, maybe the Ω(log m) lower bound can be circumvented by considering a different prior-independent mechanism, or perhaps the better of two prior independent mechanisms, a la [3].14 Overall, while we believe our results to already be quite substantial, we strongly feel there is a wealth of open problems in the direction of competition complexity. References [1] Azar, P., Daskalakis, C., Micali, S., and Weinberg, S. M. 2013. Optimal and efficient parametric auctions. In Proceedings of the Twenty-Fourth Annual ACM-SIAM Symposium on Discrete Algorithms. Society for Industrial and Applied Mathematics, 596–604. [2] Azar, P. D., Kleinberg, R., and Weinberg, S. M. 2014. Prophet inequalities with limited information. In Proceedings of the Twenty-Fifth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2014, Portland, Oregon, USA, January 5-7, 2014. 1358–1377. [3] Babaioff, M., Immorlica, N., Lucier, B., and Weinberg, S. M. 2014. A simple and approximately optimal mechanism for an additive buyer. In Proceedings of the 55th Symposium on Foundations of Computer Science. 21–30. [4] Barman, S., Chawla, S., and Umboh, S. 2012. A bicriteria approximation for the reordering buffer problem. In European Symposium on Algorithms. Springer, 157–168. [5] Bateni, M., Dehghani, S., Hajiaghayi, M., and Seddighin, S. 2015. Revenue maximization for selling multiple correlated items. In Algorithms-ESA 2015. Springer, 95–105. [6] Bei, X. and Huang, Z. 2011. Bayesian incentive compatibility via fractional assignments. In Proceedings of the twenty-second annual ACM-SIAM symposium on Discrete Algorithms. SIAM, 720–733. [7] Briest, P., Chawla, S., Kleinberg, R., and Weinberg, S. M. 2010. Pricing randomized allocations. In Proceedings of the twenty-first annual ACM-SIAM symposium on Discrete Algorithms. Society for Industrial and Applied Mathematics, 585–597. 13 This requires two easy steps, and a formal proof is in Appendix F. Of course, randomizing over the two would still lose a constant factor. The idea would be that you still need to learn something about your population in order to apply such a result, but just which of the two mechanisms is better. 14 20 [8] Bulow, J. and Klemperer, P. 1996. Auctions versus negotiations. American Economic Review 86, 1, 180–194. [9] Cai, Y., Daskalakis, C., and Weinberg, S. M. 2012a. An algorithmic characterization of multi-dimensional mechanisms. In Proceedings of the 44th Symposium on Theory of Computing Conference, STOC 2012, New York, NY, USA, May 19 - 22, 2012. 459–478. [10] Cai, Y., Daskalakis, C., and Weinberg, S. M. 2012b. Optimal multi-dimensional mechanism design: Reducing revenue to welfare maximization. In 53rd Annual IEEE Symposium on Foundations of Computer Science, FOCS 2012, New Brunswick, NJ, USA, October 20-23, 2012. 130–139. [11] Cai, Y., Daskalakis, C., and Weinberg, S. M. 2013a. Reducing revenue to welfare maximization: Approximation algorithms and other generalizations. In Proceedings of the TwentyFourth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2013, New Orleans, Louisiana, USA, January 6-8, 2013. 578–595. [12] Cai, Y., Daskalakis, C., and Weinberg, S. M. 2013b. Understanding incentives: Mechanism design becomes algorithm design. In 54th Annual IEEE Symposium on Foundations of Computer Science, FOCS 2013, 26-29 October, 2013, Berkeley, CA, USA. 618–627. [13] Cai, Y., Devanur, N. R., and Weinberg, S. M. 2016. A duality based unified approach to Bayesian mechanism design. In Proceedings of the 48th Annual ACM Symposium on Theory of Computing. 926–939. [14] Cai, Y. and Zhao, M. 2016. Manuscript. Simple Mechanisms for Subadditive Buyers via Duality. [15] Chawla, S., Hartline, J. D., and Kleinberg, R. 2007. Algorithmic pricing via virtual valuations. In Proceedings of the 8th ACM Conference on Economics and Computation. 243–251. [16] Chawla, S., Hartline, J. D., Malec, D., and Sivan, B. 2013. Prior-independent mechanisms for scheduling. In Proceedings of the forty-fifth annual ACM symposium on Theory of computing. ACM, 51–60. [17] Chawla, S., Hartline, J. D., Malec, D. L., and Sivan, B. 2010a. Multi-parameter mechanism design and sequential posted pricing. 311–320. [18] Chawla, S., Malec, D. L., and Sivan, B. 2010b. The power of randomness in bayesian optimal mechanism design. In Proceedings of the 11th ACM conference on Electronic commerce. ACM, 149–158. [19] Chawla, S. and Miller, J. B. 2016. Mechanism design for subadditive agents via an ex ante relaxation. In Proceedings of the 2016 ACM Conference on Economics and Computation. EC ’16. ACM, New York, NY, USA, 579–596. [20] Chen, X., Diakonikolas, I., Orfanou, A., Paparas, D., Sun, X., and Yannakakis, M. 2015. On the complexity of optimal lottery pricing and randomized mechanisms. In IEEE 56th Annual Symposium on Foundations of Computer Science, FOCS 2015, Berkeley, CA, USA, 17-20 October, 2015. 1464–1479. 21 [21] Chen, X., Diakonikolas, I., Paparas, D., Sun, X., and Yannakakis, M. 2014. The complexity of optimal multidimensional pricing. In Proceedings of the Twenty-Fifth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2014, Portland, Oregon, USA, January 5-7, 2014. 1319–1328. [22] Clarke, E. H. 1971. Multipart pricing of public goods. Public Choice 11, 17–33. [23] Cole, R. and Roughgarden, T. 2014. The sample complexity of revenue maximization. In Proceedings of the 46th Annual ACM Symposium on Theory of Computing. 243–252. [24] Daskalakis, C., Deckelbaum, A., and Tzamos, C. 2013. Mechanism design via optimal transport. In Proceedings of the fourteenth ACM conference on Electronic commerce. ACM, 269–286. [25] Daskalakis, C., Deckelbaum, A., and Tzamos, C. 2014. The complexity of optimal mechanism design. In Proceedings of the Twenty-Fifth Annual ACM-SIAM Symposium on Discrete Algorithms. Society for Industrial and Applied Mathematics, 1302–1318. [26] Daskalakis, C., Deckelbaum, A., and Tzamos, C. 2015. Strong duality for a multiplegood monopolist. In Proceedings of the Sixteenth ACM Conference on Economics and Computation. ACM, 449–450. [27] Daskalakis, C. and Weinberg, S. M. 2012a. Symmetries and optimal multi-dimensional mechanism design. In Proceedings of the 13th ACM Conference on Electronic Commerce. ACM, 370–387. [28] Daskalakis, C. and Weinberg, S. M. 2012b. Symmetries and Optimal Multi-Dimensional Mechanism Design. In the 13th ACM Conference on Electronic Commerce (EC). [29] Devanur, N. R., Hartline, J. D., Karlin, A. R., and Nguyen, C. T. 2011. Priorindependent multi-parameter mechanism design. In Proceedings of the 7th International Workshop on Internet and Network Economics. 122–133. [30] Devanur, N. R., Huang, Z., and Psomas, C. 2016. The sample complexity of auctions with side information. In Proceedings of the 48th Annual ACM SIGACT Symposium on Theory of Computing, STOC 2016, Cambridge, MA, USA, June 18-21, 2016. 426–439. [31] Dhangwatnotai, P., Roughgarden, T., and Yan, Q. 2015. Revenue maximization with a single sample. Games and Economic Behavior 91, 318–333. [32] Dughmi, S., Roughgarden, T., and Sundararajan, M. 2012. Revenue submodularity. Theory of Computing 8, 1, 95–119. [33] Eden, A., Feldman, M., Friedler, O., Talgam-Cohen, I., and Weinberg, M. 2016. A simple and approximately optimal mechanism for a buyer with complements. Manuscript. [34] Giannakopoulos, Y. and Koutsoupias, E. 2014. Duality and optimality of auctions for uniform distributions. In Proceedings of the fifteenth ACM conference on Economics and computation. ACM, 259–276. [35] Giannakopoulos, Y. and Koutsoupias, E. 2015. Selling two goods optimally. In Automata, Languages, and Programming - 42nd International Colloquium, ICALP 2015, Kyoto, Japan, July 6-10, 2015, Proceedings, Part II. 650–662. 22 [36] Goldner, K. and Karlin, A. R. 2016. A prior-independent revenue-maximizing auction for multiple additive bidders. [37] Groves, T. 1973. Incentives in teams. Econometrica 41, 617–631. [38] Gul, F. and Stacchetti, E. 1999. Walrasian equilibrium with gross substitutes. Journal of Economic Theory 87, 95–124. [39] Hart, S. and Nisan, N. 2012. Approximate revenue maximization with multiple items. In Proceedings of the 13th ACM Conference on Economics and Computation. 656. [40] Hart, S. and Nisan, N. 2013. The menu-size complexity of auctions. In Proceedings of the 14th ACM Conference on Economics and Computation. 565–566. [41] Hart, S. and Reny, P. J. 2015. Maximal revenue with multiple goods: Nonmonotonicity and other observations. Theoretical Economics 10, 3, 893–922. [42] Hartline, J. D., Kleinberg, R., and Malekian, A. 2011. Bayesian incentive compatibility via matchings. In Proceedings of the twenty-second annual ACM-SIAM symposium on Discrete Algorithms. SIAM, 734–747. [43] Hartline, J. D. and Lucier, B. 2010. Bayesian algorithmic mechanism design. In Proceedings of the forty-second ACM symposium on Theory of computing. ACM, 301–310. [44] Hartline, J. D. and Roughgarden, T. 2009. Simple versus optimal mechanisms. In Proceedings of the 10th ACM Conference on Economics and Computation. 225–234. [45] Huang, Z., Mansour, Y., and Roughgarden, T. 2015. Making the most of your samples. In Proceedings of the Sixteenth ACM Conference on Economics and Computation, EC ’15, Portland, OR, USA, June 15-19, 2015. 45–60. [46] Kleinberg, R. and Weinberg, S. M. 2012. Matroid prophet inequalities. In Proceedings of the forty-fourth annual ACM symposium on Theory of computing. ACM, 123–136. [47] Li, X. and Yao, A. C.-C. 2013. On revenue maximization for selling multiple independently distributed items. Proceedings of the National Academy of Sciences 110, 28, 11232–11237. [48] Liu, S. and Psomas, C.-A. 2016. On bulow-klemperer type theorems for dynamic auctions. Manuscript. [49] Mohri, M. and Medina, A. M. 2014. Learning theory and algorithms for revenue optimization in second price auctions with reserve. In Proceedings of the 31th International Conference on Machine Learning, ICML 2014, Beijing, China, 21-26 June 2014. 262–270. [50] Morgenstern, J. and Roughgarden, T. 2015. On the pseudo-dimension of nearly optimal auctions. In Advances in Neural Information Processing Systems 28: Annual Conference on Neural Information Processing Systems 2015, December 7-12, 2015, Montreal, Quebec, Canada. 136–144. [51] Morgenstern, J. and Roughgarden, T. 2016. Learning simple auctions. In Proceedings of the 29th Conference on Learning Theory, COLT 2016, New York, USA, June 23-26, 2016. 1298–1318. 23 [52] Myerson, R. B. 1981. Optimal auction design. Mathematics of operations research 6, 1, 58–73. [53] Pavlov, G. 2011. A property of solutions to linear monopoly problems. The B.E. Journal of Theoretical Economics. [54] Rochet, J.-C. and Chone, P. 1998. Ironing, sweeping, and multidimensional screening. Econometrica 66, 4, 783–826. [55] Roughgarden, T. and Schrijvers, O. 2016. Ironing in the dark. In Proceedings of the 2016 ACM Conference on Economics and Computation, EC ’16, Maastricht, The Netherlands, July 24-28, 2016. 1–18. [56] Roughgarden, T., Talgam-Cohen, I., and Yan, Q. 2015. Robust auctions for revenue via enhanced competition. Working paper; a preliminary version appeared in EC’12. [57] Roughgarden, T. and Tardos, É. 2002. How bad is selfish routing? Journal of the ACM (JACM) 49, 2, 236–259. [58] Rubinstein, A. and Weinberg, S. M. 2015. Simple mechanisms for a subadditive buyer and applications to revenue monotonicity. In Proceedings of the Sixteenth ACM Conference on Economics and Computation. ACM, 377–394. [59] Segal, I. 2003. Optimal pricing mechanisms with unknown demand. American Economic Review 93, 3, 509–529. [60] Sleator, D. D. and Tarjan, R. E. 1985. Amortized efficiency of list update and paging rules. Commun. ACM 28, 2, 202–208. [61] Thanassoulis, J. 2004. Haggling over substitutes. Journal of Economic theory 117, 2, 217–245. [62] Vickrey, W. 1961. Counterspeculation, auctions, and competitive sealed tenders. J. of Finance 16, 8–37. [63] Welsh, D. J. 2010. Matroid theory. Courier Corporation. [64] Wilson, R. B. 1987. Game-theoretic analyses of trading processes. Advances in Economic Theory: Fifth World Congress, 33–70. [65] Yao, A. C. 2016. On solutions for the maximum revenue multi-item auction under dominantstrategy and bayesian implementations. [66] Yao, A. C.-C. 2015. An n-to-1 bidder reduction for multi-item auctions and its applications. In Proceedings of the Twenty-Sixth Annual ACM-SIAM Symposium on Discrete Algorithms. SIAM, 92–109. 24 A Duality Framework Reduced Forms. Reduced forms are defined for probabilities over type spaces T = ×i∈[n] Ti , where Ti is the type space of agent i. The reduced form of an auction stores for all bidders i, items j, and types vi , what is the probability that agent i will receive item j when reporting vi to the mechanism (over the randomness in the mechanism and randomness in other agents reported types, assuming they come from F−i ) as πij (vi ), as well as pi (vi ), which is the expected price bidder i pays when reporting type vi (over the same randomness). It is easy to see that if a buyer that is additive subject to constraints, his expected value for reporting type vi0 to the mechanism is just vi · πi (vi0 ), so long as the mechanism only ever awards each type of each bidder a set of items that fit their constraints (i.e. whenever a type of each bidder is subject to constraints I, the mechanism awards them a subset of items in I). There always exists an optimal mechanism with this property, and there is furthermore a trivial transformation to turn any BIC-BIR mechanism without this property into one with this property that achieves exactly the same revenue (see, e.g. [28]). We say that a reduced form is feasible if there exists some feasible mechanism that matches the probabilities promised by the reduced form.15 Definition A.1 (Reworded from [13], 2 and 3)PA mapping λi : Ti × Ti → R+ P Definitions 0 16 Given λ , the 0 is flow-conserving if for all v ∈ Ti : i v 0 ∈Ti λi (v , v). v 0 ∈Ti λi (v, v ) ≤ fi (v) + corresponding virtual value function Φi , is a transformation from vectors in Ti to valuation vectors in Ti× (the closure of Ti under linear combinations) and satisfies: 1 X Φi (v) = v − λi (v 0 , v)(v 0 − v). fi (v) 0 v ∈Ti Equipped with these definitions we can state the main theorem of the framework from [13]. Theorem A.2 (Revenue ≤ Virtual Welfare [13]) Let λi be flow conserving for all i, and M = (π, p) any BIC and BIR mechanism. Then the revenue of M is ≤ the virtual welfare w.r.t. the virtual value function Φ(·) corresponding to λ. That is: n X X i=1 vi ∈Ti fi (vi ) · pi (vi ) ≤ n X X fi (vi ) · πi (vi ) · Φi (vi ). i=1 vi ∈Ti Therefore, the task of finding a good bound reduces to finding good flow conserving duals. In order to find flow conserving duals we begin with the following definition: S Definition A.3 (Upward-closed region) A region (subset) of types R ⊆ i Ti is upward closed 0 ,v 0 with respect to item j if for every vi ∈ R ∩ Ti , all types vi0 = (vij i−j ) ∈ Ti such that vij ≥ vij , are also in R. We use Rj to denote an upward-closed region with respect to item j. A method for designing flow conserving duals is the following: first, partition the type space T into upward-closed regions. Then, define the duals as follows: for a type vi ∈ Rj ∩ Ti , i.e., in a region 0 ,v 0 that is upward closed w.r.t. j. Let vi0 = (vij i−j ) be the type so that vij is the P largest value that 0 0 is smaller than vij (if exists). If vi is also in Rj , then set λi (vi , vi ) = f (vi ) + v̂i ∈Ti λi (v̂i , vi ), and otherwise set λ(vi , vi0 ) = 0. Set all other duals to 0. Let Φi (·) be the resulting virtual transformation. The following lemma is essentially a restatement of Claims 1 and 2 in [13] to upwards closed regions. 15 For a more comprehensive description of reduced forms and their applications, see [13, P9, 10, 11, 12]. This is equivalent to stating that there exists a λi (v, ⊥) ≥ 0 such that λi (v, ⊥) + v0 ∈Ti λi (v, v 0 ) = fi (v) + P 0 v 0 ∈Ti λi (v , v), which might look more similar to the wording of Definition 2 in [13]. 16 25 Lemma A.4 ([13]) Let vi ∈ Ti be some valuation for which vi ∈ Rj for some j ∈ {1, . . . , m}. Then Φik (vi ) = vik if k 6= j and Φij (vi ) = ϕij (vij ) otherwise. Using the region-based flow, and assuming each item j has exactly one upward-closed region Rj associated with it (as is the case throughout the entire paper), we get the following upper bound on the revenue of any BIR-BIC mechanism. Theorem A.5 For any set of upward-closed regions R1 , . . . , Rm , the optimal revenue a seller can obtain by a BIC and BIR mechanism is Rev ≤ max π = max π n X X m X i=1 vi ∈Ti j=1 n X X m X   fi (vi ) · πij (vi ) ϕij (vij ) · Ivi ∈Rj + vij · Ivi ∈R / j   + fi (vi ) · πij (vi ) ϕij (vij ) · Ivi ∈Rj + vij · Ivi ∈R / j . (5) i=1 vi ∈Ti j=1 Proof: The inequality is a direct corollary of Theorem A.2 and Lemma A.4, and the equality follows since the max is achieved whenever πij (vi ) = 0 for each vi ∈ Rj such that ϕij (vij ) < 0. A.1 Single Additive Bidder Case Since there is only a single additive bidder, with no feasibility constraints, the bound in (5) simplifies to:   XX Rev ≤ f (v) ϕj (vj )+ · Iv∈Rj + vj · Iv∈R / j v∈T = Ev∼F = j m  hX j=1 m XX ϕj (vj )+ · Iv∈Rj + vj · Iv∈R / j  i  fj (vj ) ϕj (vj ) · Pr [v ∈ Rj ] + vj · Pr [v ∈ / Rj ] . + v−j j=1 vj v−j (6) In [13], the regions are defined as follows: Rj contains all valuations v = (v1 , . . . , vm ) for which vj > vk for every k 6= j (breaking ties lexicographically). Therefore, they get the following bound:   XX + Rev ≤ fj (vj ) ϕj (vj ) · Pr [∀k : vj ≥ vk ] + vj · Pr [∃k : vj < vk ] . (7) j v−j vj v−j Instead, we define regions as follows: Rj contains all valuations v = (v1 , . . . , vm ) for which Fj (vj ) > Fk (vk ) for every k 6= j (breaking ties lexicographically), and therefore, our single bidder bound has the form:   XX + Rev ≤ fj (vj ) ϕj (vj ) · Pr [∀k : Fj (vj ) ≥ Fk (vk )] + vj · Pr [∃k : Fj (vj ) < Fk (vk )] . (8) j A.2 vj v−j v−j Multiple Additive Bidder Case We now present the proof of Theorem 3.4, which is the multiple additive bidder benchmark we use to prove our main result . 26 Proof of Theorem 3.4 Notice that in Equation (5), since there are no feasibility constraints, πij (·) can allocate each item to the non-negative, maximizing, virtual value. Therefore:     n X m X  Rev ≤ max Ev∼F n  πij (vi ) ϕij (vij )+ · Ivi ∈Rj + vij · Ivi ∈R / j π i=1 j=1     m X  = Ev∼F n  max ϕij (vij )+ · Ivi ∈Rj + vij · Ivi ∈R / j j=1 = m X  E v∼F n j=1 B i∈[n]   + max ϕij (vij ) · Ivi ∈Rj + vij · Ivi ∈R . / j i∈[n] Missing Proofs of Section 4 Proof of Observation 4.4: Since the expected revenue of a mechanism is the expected virtual value of the allocated bidder, the optimal mechanism that always sells an item allocates the item to the bidder with the highest virtual value. Since the bidders are drawn i.i.d. from a regular distribution, the bidder with the highest virtual value is also the bidder with the highest value. Thus, the optimal mechanism that always sells an item allocates the item to the bidder with the highest value; this is exactly the allocation rule of VCG. B.1 Proof of Claim 4.5 Before proving the claim, we introduce the following definitions and lemmas. Definition B.1 Random variable A first-order stochastically dominates (FOSD) random variable B if for every x, Pr [A > x] ≥ Pr [B > x]. Definition B.2 Consider two random variables X and Y . We say that X, Y are positively correlated if for every x and y, Pr[X > x|Y > y] ≥ Pr[X > x]. (I.e., X|Y >y FOSD X for every y.) Lemma B.3 If X, Y are positively correlated and Ye is independent of X and FOSD Y , then E[max{X, Y }] ≤ E[max{X, Ye }]. Proof: We prove the claim for Yb that has exactly the same marginals as Y buth is independent i of X. Since Ye FOSD Yb and both are independent of X, it is immediate that E max{X, Ye } ≥ h i E max{X, Yb } ≥ E [max{X, Y }] as desired. First, notice that Z ∞ [max{X, Y }] = Pr [max{X, Y } > x] dx E 0 Z ∞ = Pr [X > x] + Pr [Y > x] − Pr [X > x and Y > x] dx, (9) 0 and similarly Z ∞ h i h i h i b Pr [X > x] + Pr Yb > x − Pr X > x and Yb > x dx E max{X, Y } = Z0 ∞ h i = Pr [X > x] + Pr [Y > x] − Pr X > x and Yb > x dx, 0 27 (10) where the second equality holds since Yb and Y have the same marginals. Subtracting (10) from (9) yields Z ∞ h i h i b Pr X > x and Yb > x − Pr [X > x and Y > x] dx E [max{X, Y }] − E max{X, Y } = Z0 ∞ h i i h = Pr X > x|Yb > x Pr Yb > x − Pr [X > x|Y > x] Pr [Y > x] dx Z0 ∞ Pr [Y > x] (Pr [X > x] − Pr [X > x|Y > x]) dx = 0 ≤ 0, where the third equality follows from the fact that Yb has the same marginals as Y and from the independence of X and Yb , and the inequality follows from the fact that X and Y are positively correlated. ` k Lemma  B.4 For any regular distribution F , and a and b sampled from F and F respectively, ϕ a(1) |a >b and a(2) |a >b are positively correlated. (1) (1) (1) (1) Proof: Fix some value of x, and let v be the (highest) value for which ϕ(v) = x, where ϕ is the virtual valuation function of F . We have      Pr ϕ a(1) > x | a(1) > b(1) = Pr a(1) > v | a(1) > b(1) a∼F ` b∼F k a∼F ` b∼F k ≤ ≤ = Pr   a(1) > v | a(1) > b(1) ∧ a(1) > y Pr   a(1) > v |a(1) > b(1) ∧ a(2) > y Pr    ϕ a(1) > x | a(1) > b(1) ∧ a(2) > y , a∼F ` b∼F k a∼F ` b∼F k a∼F ` b∼F k where the first and last equalities follow by the regularity of F , and the last inequality follows from the fact that whenever a(2) > y then also a(1) > y. This immediately implies a positive correlation  between ϕ a(1) |a >b and a(2) |a >b . (1) (1) (1) (1) Lemma B.5 For every distribution F , a and b sampled from F ` and F k and c sampled from F `+k , c(2) FOSD a(2) |a >b . (1) Proof: (1) Fix some value x in the support of F . We need to show that     Pr c(2) > x ≥ Pr a(2) > x | a(1) > b(1) . c∼F `+k a∼F ` b∼F k For a given vector c sampled from F `+k , let ca be the first ` coordinates of c, and cb be the last k coordinates. We notice that the event that c(1) resides in the first ` coordinates is independent of the event that c(2) > x. Therefore, h i   Pr c(2) > x = Pr c(2) > x|ca(1) > cb(1) c∼F `+k c∼F `+k h i ≥ Pr ca(2) > x|ca(1) > cb(1) c∼F `+k   = Pr a(2) > x | a(1) > b(1) , a∼F ` b∼F k 28 where the inequality follows since whenever ca(2) > x then also c(2) > x, and the last equality follows by renaming ca to a and cb to b. Combining the aforementioned three lemmas three lemmas yields  the claim. Proof of Claim 4.5: Consider the random variables X = ϕ a(1) |a >b , Y = a(2) |a (1) (1) (1) >b(1) , and Ŷ = c(2) . By Lemma B.4 X and Y are positively correlated, and by Lemma B.5 Ŷ FOSD Y . In addition, Ŷ and X are independent. The Claim then follows from Lemma B.3. C Additive Subject to Matroid Feasibility Constraints In this section we establish an improved version of Lemma 5.2 for the special case of matroids. We use the following notation: given a product of regular distributions F and a n0 bidders subject to identical matroid feasibility constraints, let VCGMat n0 denote the expected VCG revenue from selling the m items to n0 bidders with i.i.d. values drawn from F , whose valuations are additive subject to the matroid constraint. Let ([m], I) be a matroid set system with rank function r. A set S ⊂ M spans an element j ∈ M \ S if r(S ∪ {j}) = r(S) (i.e., the rank of S does not increase when j is added to it). We introduce the following parameter ρ of a matroid ([m], I), which we call the matroid’s disjoint spanning number : Definition C.1 (Disjoint spanning number) For an element j of the matroid, let a disjoint spanning collection of j be a family I 0 ⊂ I of disjoint independent sets such that every I ∈ I 0 spans j. Let ρj denote the maximum size |I 0 | over all disjoint spanning collections I 0 of j.17 We define ρ := maxj {ρj }. As an example, we state the value of ρ for two kinds of simple matroids: Example C.1 (Examples of disjoint spanning numbers) For k-uniform matroids where k < m, ρ = d(m − 1)/ke. For partition matroids, ρ is the size of the largest partition. We can now state our main lemma for matroids, which shows the extra competition complexity arising from imposing matroid constraints on additive bidders: Lemma C.2 (Main lemma for matroids) For every n + ρ bidders with a matroid feasibility Add constraint whose maximum disjoint spanning number is ρ, VCGMat n+ρ ≥ VCGn . The proof of Theorem 5.6 is the same as the proof of Theorem 5.1 only with Lemma 5.2 replaced by Lemma C.2. Before proving Lemma C.2, we briefly discuss its relation to the work of [56] for the special case of unit-demand bidders. C.1 Unit-demand Valuations [56] [56] prove a version of Lemma C.2 for the case of unit-demand bidders. Such bidders can alternatively be described as additive bidders subject to 1-uniform matroid constraints. In particular, [56] Add show that VCGUD n+m ≥ VCGn+1 , which is precisely what we get if we apply Lemma C.2 to 1-uniform matroids, using that the disjoint spanning number ρ of 1-uniform matroids is equal to m − 1 (Example C.1). In fact this is the same inequality shown in Lemma 5.2 for general downward-closed 17 For example, in a graphical matroid, ρj would be the maximum number of cycles that share the edge j and are otherwise disjoint. 29 constraints. We conclude that the case of unit-demand bidders is the “hardest” one in terms of competition complexity, not only among matroids but also among all downward-closed set systems. We generalize the result of [56] in two ways: first, by extending it to all downward-closed constraints (Lemma 5.2); second, by introducing a parameterized version for all matroids using the environment disjoint spanning number as the parameter (Lemma C.2). In terms of techniques, our result for matroids uses a stability argument similar to that in [56]. Our result for general downward-closed uses a different charging argument as described in Section 5.2. Both results use the principle of deferred decision as used in the analysis of [56] in order to argue that the values of unallocated bidders (which determine VCG payments) are sufficiently high in expectation. C.2 Proof of Main Lemma (4.3) for Matroids The next claim will be used in the proof of Lemma C.2. It follows easily from the definitions of matroid rank function and spanning in matroids. Claim C.3 Consider a matroid ([m], I). For every subset of elements S ⊆ [m], and for every two elements j, j 0 ∈ [m] \ S such that S spans j but does not span j 0 , S ∪ {j} does not span j 0 . Moreover, for every subset S 0 ⊆ S ∪ {j}, S 0 does not span j 0 . We state the following claim for all gross substitutes valuations, and apply it in the proof of Lemma C.2 to the subclass of additive valuations subject to matroid constraints. The claim uses the language of vacated and snatched items as defined in the proof of Lemma 5.2. Claim C.4 Consider a welfare-maximizing allocation OPT−j of the m − 1 items in M \ {j} to n bidders with gross substitutes valuations. A welfare-maximizing allocation OPT of the m items in M to the n bidders can be found by a chain of reallocations starting from OPT−j , where in each step a bidder snatches either item j (in the first step) or a single vacated item (in subsequent steps), and possibly vacates another single item. Proof: [Sketch] Let p−j be a vector of Walrasian prices supporting the welfare-maximizing allocation OPT−j [38], i.e., each bidder is allocated his demand (utility-maximizing bundle of items) at prices p−j , and no unallocated item is priced above 0. Now add item j with an initial price pj that is prohibitively high. We show a descending-price process that transforms OPT−j into OPT. This process establishes the existence of a chain of reallocations as claimed above (its computational properties are irrelevant in our context). Start by lowering pj until there is a single18 bidder i who is no longer getting his demand or until pj reaches 0.19 If pj = 0 we have found OPT (to see this, observe that since each bidder is allocated his demand given current prices and no item with positive price is unallocated, we have reached a Walrasian equilibrium whose allocation is welfare-maximizing by the first welfare theorem [38]). Otherwise, by the single improvement property of gross substitutes [38], and since prices p−j support the allocation of items M \ j, bidder i can improve his utility by and only by snatching the single item whose price has been reduced, which in the first step is item j, and then possibly vacating another single item. If no item is vacated, we have again reached a welfare-maximizing equilibrium allocation OPT. Otherwise, if an item j 0 was vacated, then we repeat the above process of lowering the price of item j 0 . This process must end with a welfare-maximizing allocation OPT, thus completing the proof sketch. 18 19 We are assuming no ties here to simplify the exposition. In full formality, pj should be lowered by -increments and  should be taken to 0. 30 We now prove our main lemma for matroids. Add Proof of Lemma C.2: Our goal is to show that VCGMat n+ρ ≥ VCGn . As in the proof of Lemma 5.2, it is sufficient to identify n out of the n + ρ constrained bidders whose values for item j are i.i.d. draws from Fj , such that the VCG payment for j is at least as high as the second highest value of these bidders for j. This establishes that the contribution from selling item j to VCGMat n+ρ is at least E[u(2:n)j ], which is exactly the contribution from selling item j to VCGAdd . n As in the proof of Lemma 5.2 we fix an item j, and fix the values of the n constrained bidders for all items but j. We denote the welfare-maximizing allocation of all items but j to the n constrained bidders by OPT−j . Diverging from the proof of Lemma 5.2, we denote by A the set of bidders whose allocation in OPT−j spans j. Notice that |A| ≤ ρj ≤ ρ, and so |Ā| ≥ n. We further fix the values of the bidders in A for item j, so that all remaining randomness is in the values of bidders in Ā for item j, which are i.i.d. random samples from Fj . We denote by OPT the random welfare-maximizing allocation of all items (including j) to the n bidders. Assume first that item j is allocated in OPT to a bidder i in Ā. As in the proof of Lemma 5.2, the allocation of the other items in OPT−j does not change in OPT. Since all bidders in Ā but i still have allocations that do not span item j, the VCG payment for j is at least as high as the second-highest value of the bidders in Ā for j. Assume now that item j is allocated in OPT to a bidder in A. Note that as in the proof of Lemma 5.2, we can find OPT without knowing vĀj (if there are several welfare-maximizing allocations, we assume that VCG finds the one implied by Claim C.4). By Claim C.4 we know that the bidders in Ā have changed their allocation only by “single improvements” involving snatching an item and possibly vacating another. In fact, in all such single improvement but one, an item was vacated. Since bidders’ valuations are additive subject to matroid constraints, a bidder i with allocation Si vacates an item j 0 if and only if he first snatches an item j 00 such that Si spans j 00 . By Claim C.3, this means that the eventual allocation of bidder i in OPT still does not span item j. We conclude that the VCG payment for j is at least as high as the second-highest value of the bidders in Ā for j. We get that in both cases, the payment for j is at least the second-highest value of the bidders in Ā. Since the set Ā is determined before sampling the values for item j, this completes the proof of the lemma. D Additive Subject to Asymmetric Downward Closed Feasibility Constraints In this section, we consider the case of heterogeneous downward-closed feasibility set systems for the bidders. Let ([m], Ii ) denote the feasibility set system of bidder i. For our results to hold, we add the mild assumption that {j} ∈ Ii for every bidder i and item j. We first point out the part where the proof for symmetric feasibility constraints fails. Unlike the case where bidders have symmetric feasibility constraints, the payment of an bidder is not lower bounded by the sum of the highest values of the unallocated bidders to the items; this is in contrast to Lemma 5.320 . Therefore, we need a new lower bound on the revenue of VCG. Before stating the new lower bound, we introduce the following notation. We order the items in lexicographic order, and for a given set S, we define: 20 To see this, consider an additive bidder who is allocated two items, a and b, by the VCG mechanism, and two unit demand bidders, 1 and 2, where v1 (a) = 3, v1 (b) = 5, v2 (a) = 1, v2 (b) = 4. The payment of the additive bidder is 3 + 4 = 7 < 3 + 5 = 8. 31 • 1∗ (S) = arg maxi∈S vi (1) (the bidder in set S with the highest value for item 1). • S>j = S \ {1∗ (S), 2∗ (S), . . . , j ∗ (S)}, contains all bidders except for 1∗ (S), 2∗ (S), . . . , j ∗ (S). • j ∗ (S) = arg maxi∈S>j−1 vi (j). • rj (S) = vj ∗ (S) (j) (the value of item j to bidder j ∗ (S)). We give a lower bound on the revenue of VCG given the above definitions. Lemma D.1 Consider a set of bidders with asymmetric downward-closed feasibility constraint, and the outcome of VCG. Let Ā be the set of unallocated bidders. Assuming the number of bidders  P is at least 2m, the revenue of VCG is at least j∈[m] rj Ā . Proof: Let A and Ā = [n] \ A be the respective sets of allocated and unallocated bidders. Let S = (S1 , . . . , Sn ) be the allocation returned by VCG, and let W be the welfare of this allocation. Fix an agent i that received an item. The welfare of all agents but i for this outcome is W − vi (Si ). Consider now the following allocation — allocate the items not in Si as in S, and distribute each  item j ∈ Si to an unallocated bidder j ∗ Ā (notice that this is well defined since the number of agents is assumed to be at least 2m). By construction, j ∗ (Ā) 6= j 0 ∗ (Ā) for every j 6= j 0 . Therefore, each bidder in Ā gets at most a single item, which is feasible under P our assumption that {j} ∈ Ii for every i, j. The welfare of the proposed allocation is W − vi (Si ) + j∈Si rj (Ā). Since we described some allocation of items to all bidders but i, the welfare of the optimal allocation to bidders without i is at least as high. In VCG, each agent pays her “externality on the other agents” (i.e., the loss in welfare of the other agents due to her existence). We get that the payment of bidder i is at least P j∈Si rj (Ā). Summing over all bidders completes the proof of the lemma. Similarly to the proof of Theorem 5.1 and Corollary 5.6, we prove a lemma that shows how many extra bidders are needed for the revenue of VCG with arbitrary downward closed constrained bidders to exceed the revenue of VCG with unconstrained bidders. To this end we fix a product the expected VCG revenue from distribution F of m regular distributions, and denote by VCGAsym n0 selling m items to n0 ≥ n bidders with i.i.d. values drawn from F , whose valuations are additive subject to n0 (not-necessarily identical) downward-closed feasibility constraints. Lemma D.2 For every n + 2(m − 1) bidders with arbitrary downward closed feasibility constraint, Add VCGAsym n+2m−2 ≥ VCGn . Lemma D.2 is useful in its own right, but also can be used to imply a competition complexity result extending Theorem 5.1 to the case where feasibility constraints are not fixed for the entire population. We now prove Lemma D.2, and begin by showing a useful property of the notations used in order to bound VCG’s revenue. Lemma D.3 For any two sets of of bidders S and T such that S ⊆ T , and for every j ∈ [m], S>j−1 ⊆ T>j−1 . Proof: The proof is by induction on j. For j = 1, S>0 = S ⊆ T = T>0 . Now suppose the claim is true for some j S>j−1 ⊆ T>j−1 . Consider two cases: if j ∗ (S) = j ∗ (T ) (denote this bidder by j ∗ ), then, by the induction hypothesis, S>j = S>j−1 − {j ∗ } ⊆ T>j−1 − {j ∗ } = T>j ; otherwise, if j ∗ (S) 6= j ∗ (T ), then by the induction hypothesis, j ∗ (S) ∈ T>j−1 , thus j ∗ (T ) ∈ T>j−1 \ S>j−1 . Therefore, T>j = T>j−1 − {j ∗ (T )} ⊇ S>j−1 ⊃ S>j . 32 As a corollary, we get: Corollary D.4 For any two sets of of bidders S and T such that S ⊆ T , and for every j ∈ [m], rj (S) ≤ rj (T ). Proof: From the above lemma, j ∗ (S) ∈ T>j−1 . Therefore, by the definition of rj , it holds that rj (T ) ≥ rj (S). We now prove the main lemma for bidders with asymmetric feasibility constrains. Proof of Lemma D.2: Let S̄ be the set of bidders unallocated by VCG on the n + 2(m − 2) constrained bidders. We prove that for every j, the expected value of rj (S̄) is at least as high as the expectation of the second highest value of n draws from Fj . This argument suffices to prove the lemma since the latter is exactly what is paid for item j in VCG with unconstrained bidders. As in previous proofs, the proof uses again the principle of deferred decisions. Consider first sampling values of all items but j, and then sample the value of item j for all bidders that are allocated some item in the optimal allocation that does not allocate j. Similarly to the proof of Lemma 5.2, we can identify a set à of n + m − 1 bidders out of which at most a single bidder is going to be allocated by VCG. Furthermore, the value of item j for these agents is yet to be determined. We denote the random set that will be left unallocated after putting item j back in by Ã+j . Consider the set of bidders Ã<j = {`∗ (Ã) : ` < j}. We claim that no matter which bidder will be allocated from à in the final allocation (if any), all bidders remaining from Ã<j will be in +j ∗ +j Ã+j <j = {` (à ) : ` < j}. Otherwise, there would be an bidder in Ã>j−1 which is not in Ã>j−1 , contradicting Lemma D.3. Notice now that the set Ã<j is of size at most m − 1, and therefore, the set Ã>j−1 is of size at least n + m − 1 − (m − 1) = n. Furthermore, the set Ã>j−1 is determined before sampling the ∗ +j values of item j for these bidders. Since at most a single bidder from Ã>j−1 is in Ã+j <j , j (à ) is one of the two bidders with the highest value for item j in Ã>j−1 . Therefore, by Corollary D.4, rj (S̄) ≥ rj (Ã+j ), which is at least the payment for item j in VCG with n unconstrained bidders. Applying Lemma D.1 gives us that the revenue of VCG with n + 2(m − 1) constrained bidders is at least the revenue of VCG with n constrained ones, as desired. Proof of Theorem 5.7: First, draw the constraints independently for each bidder. As constraints are drawn independently of values, we can apply Lemma D.2, and conclude that for all constraints that could possibly have been drawn, the expected revenue of VCG for n+2m−2 bidders subject to these (asymmetric) constraints is at least the expected revenue of n additive bidders, conditioned on the drawn constraints. Therefore, when taking an expectation over the randomly drawn constraints, the theorem statement holds. D.1 Competition Complexity of Maximum in Range VCG We furthermore show how to overcome the intractability of VCG for general downward-closed feasibility constraints, even when the constraints are asymmetric across agents. Recall that VCGUD is defined to run VCG, and restrict the outcomes to matchings – i.e., every agent gets at most a single item. This is a maximal-in-range mechanism, and hence, truthful. Furthermore, since finding maximum weight matchings is tractable, this is also a poly-time prior independent mechanism. We can now ask the following question — what is the the competition complexity of this mechanism (if well defined). We first provide a lower bound on the revenue of VCGUD . 33 Observation D.5 Consider a set of agents with asymmetric downward-closed feasibility constraint, and the outcome of VCGUD . For each item j, let vj∗ be the highest value of an unallocated agent P for item j. The revenue of VCGUD is at least j∈[m] vj∗ . Proof: Similarly to the proof of Lemma 5.3, this follows from taking the optimal allocation, removing the agent that is allocated item j, and allocating this item to the unallocated agent with the highest value for this item. Notice that we can use this observation, and an essentially identical proof to the proof of Lemmas 5.2 and C.2 (and similar to the claims used in [56]), to show the following: Lemma D.6 For every n+m−1 bidders with a asymmetric downward closed feasibility constraints, VCGUD n+m−1 ≥ VCGAdd n . This in turn yields the following upper bound on the competition complexity of VCGUD , that is, the number of extra bidders one needs to add to the original environment in order the get revenue greater than the optimal revenue of the original environment using mechanism VCGUD , and a complete proof of Theorem 5.8. E Lower Bounds on the Competition Complexity Theorem E.1 The competition complexity of a single bidder with additive valuations over m independent regular items is Ω(log m). Proof: Consider a single additive bidder with m items i.i.d. distributed according to the equalrevenue distribution with CDF F (x) = 1 − 1/x. In Lemma 8 in [39], it was shown that the optimal revenue for this setting satisfies Rev(F m ) ≥ m · log m/4. Now consider a setting with a single item and k bidders, all distributed according to F . The expected revenue of the optimal single-bidder auction is 1. By revenue submodularity [32], the expected revenue of running the optimal mechanism is a concave function of the number of bidders. Thus, the expected revenue of the optimal auction with k bidders is at most k (and it can actually be shown to be exactly k). Consequently, the expected revenue of running VCG in the single item, k bidder setting is upper bounded by k. Consider now the original setting with a single additive bidder and m items i.i.d. distributed according to the equal-revenue distribution. Based on the analysis above, and the linearity of VCG with additive bidders, the expected revenue of running VCG with k − 1 additional bidders (i.e., with k bidders) is at most m · k. Thus, in order to surpass the optimal revenue Rev(F m ), the number of additional bidders (k − 1) should be at least as large as log m/4 − 1 = Ω(log m). This establishes the assertion of the theorem. F 1/2 approximation of VCG as n goes to ∞ Here we show that as a direct corollary of our results, running VCG in large markets yields a 2-approximation on the optimal revenue for additive bidders. Theorem F.1 For any distribution of regular items F , whenever n  m, then running VCG on n bidders (without recruiting additional bidders) yields a revenue ≈ half of the optimal revenue. 34 Proof: Consider a market with n additive bidders with values sampled from F . According to TheAdd orems 4.1, VCGAdd 2n+m−1 ≥ Revn . Since VCG decomposes across items for additive bidders, and n−m since n > m, revenue submodularity applies [32]. Therefore, VCGAdd ≥ 2n+m−1−m VCGAdd n 2n+m−1 ≥ Add Add n−m ≈n→∞ Revn /2. 2n−1 Revn 35
8cs.DS
City versus wetland: Predicting urban growth in the Vecht area with a cellular automaton model M. Tendürüsa , A.G. Baydinb,∗, M.A. Eleveldc , A.J. Gilbertc arXiv:1304.1609v1 [nlin.CG] 5 Apr 2013 a Faculty of Earth and Life Sciences, Vrije Universiteit Amsterdam, De Boelelaan 1085 1081 HV Amsterdam, The Netherlands b Department of Applied Physics, Chalmers University of Technology 412 96 Göteborg, Sweden c Institute of Environmental Studies, Vrije Universiteit Amsterdam, De Boelelaan 1087 1081 HV Amsterdam, The Netherlands Abstract There are many studies dealing with the protection or restoration of wetlands and the sustainable economic growth of cities as separate subjects. This study investigates the conflict between the two in an area where city growth is threatening a protected wetland area. We develop a stochastic cellular automaton model for urban growth and apply it to the Vecht area surrounding the city of Hilversum in the Netherlands, using topographic maps covering the past 150 years. We investigate the dependence of the urban growth pattern on the values associated with the protected wetland and other types of landscape surrounding the city. The conflict between city growth and wetland protection is projected to occur before 2035, assuming full protection of the wetland. Our results also show that a milder protection policy, allowing some of the wetland to be sacrificed, could be beneficial for maintaining other valuable landscapes. This insight would be difficult to achieve by other analytical means. We conclude that even slight changes in usage priorities of landscapes can significantly affect the landscape distribution in near future. Our results also point to the importance of a protection policy to take the value of surrounding landscapes and the dynamic nature of urban areas into account. Keywords: Urban growth, stochastic modeling, cellular automata, wetland, landscape protection 2010 MSC: 91D10, 68U20, 68Q80, 91B72, 91B70 1. Introduction Landscape is defined, in the European Landscape Convention of the Council of Europe (2000), as “a zone or area as perceived by local people or visitors, ∗ Corresponding author Email address: [email protected] (A.G. Baydin) Preprint submitted to Elsevier April 8, 2013 whose visual features and character are the result of the action of natural and/or cultural (that is, human) factors”. While human activity is one of the actors in the formation of landscapes, it is also a cause of their destruction. Today, there are unfortunately many landscapes throughout the world that are under serious threat due to factors such as intense use of land, pollution, and insufficient regional planning. Wetlands, the low-lying marshy swampy lands, are a type of landscape under direct threat by the current pattern of human development. Even though wetlands have been historically considered as a type of wasteland, their importance as integral parts of ecosystems has become increasingly realized during the last few decades (Whigham et al., 1992). Now it is known that they strongly support wildlife habitats, improve water quality, buffer storms, and control erosion and flooding (Kusler and Kentula, 1990). Besides their high natural significance, they also have a high economic value as a natural resource and as areas for recreation. In most developed countries, there are currently many environmental management policies in effect to protect wetlands, while trying to permit their utilization as a natural resource to continue. In this study we intend to analyze a situation where a developing urban area lies very close to a wetland under protection. Urban growth is practically inevitable in a sustainable economy (Henderson, 2005). But can a city resist growing to protect a wetland? When will the city threaten the wetland or when will the wetland threaten the city? For how long will it be feasible to protect the wetland? We investigate and discuss these questions here with a case study of the Vecht area in the Netherlands, home to an internationally renowned wetland, and the city of Hilversum lying at the border of the protected area (Fig. 1). Our main aim is to investigate the conflicting dynamics of continuing urban expansion and the protection of the local wetland. We present urban growth projections, based on the current distribution of landscapes and their associated importance in terms of natural and economic value, using a stochastic cellular automaton (CA) model. The model produces quantitative and visual information on the changing distribution of landscapes in the Vecht area for the near future (up to year 2055) and is used to predict the anticipated date of clash between the growing city and the wetland. We also study outcomes of several different scenarios with different protection priorities. We believe that insights from this and similar models can be significantly valuable in short and long term regional planning works. We provide a brief description of the area in our case study in Section 2. This is followed by the details of the method, employed computational model, and data sources in Section 3, the results of three different runs with the model in Section 4, and the conclusions drawn in Section 5. 2. The study area 2.1. The Vecht area and its urban development policy The Vecht area is the floodplain of the river Vecht, forming an important part of the delta river system of the Netherlands. It covers a roughly rectangular 2 Figure 1: Overview of the Vecht area (rectangle), the nearby city of Hilversum, other major cities of the Randstad conurbation, and the Green Heart of the Netherlands (shaded area in the middle) (Image from Landsat 7. Source: USGS EarthExplorer). area of about 8 km by 20 km and includes wetlands, small lakes, streams, and fen-grassland patches, which create a characteristic flora and fauna with very high biological diversity. The history of the area through the last centuries has been a unique combination of natural and economic processes: early on dominated by peat extraction forming small ponds, transformation of these into larger lakes via erosion, and the later recovery of the lost land via drainage and regulation of water tables. The area still has a dynamic structure in terms of economy and nature, now being trapped in the middle of the Randstad conurbation and considered an important part of the National Ecological Network designated by the Netherlands Environmental Assessment Agency. The Randstad (also known as Deltametropool) is a conurbation in the western Netherlands where an increased agglomeration of large cities is underway. It is formed mainly by the cities of Amsterdam, Leiden, the Hague, Rotterdam, Utrecht, and Hilversum. These cities surround the Green Heart of the Netherlands, a major open space, of which the Vecht area is a part (Van Eck et al., 2005; IDG, 1997). Fig. 1 gives an overview of the location of the Vecht area relative to the Green Heart and the Randstad. While the Green Heart provides a valuable natural environment and an attractive leisure area for the population, the adjacent cities create new jobs and ask for growing urban development. The entire Vecht area is also a part of the “wet axis” of the National Ecological Network outlined by the Dutch Nature Policy Plan (LNV, 1997) that aims to connect fragmented natural habitats to improve the region’s ecology. 3 This work, in turn, forms a part of a larger plan, Natura 2000, of the European Union for the protection of seriously threatened habitats and the establishment of special protection areas throughout Europe (LNV, 2005). The simultaneous high demand for urban development and nature preservation make the task of spatial planning of urban areas in the region highly challenging. Although there are planning decisions applied strictly to keep the environmental quality high and the development sustainable, progress is yet insufficient as noted in the yearly VINEX reports of the Ministry of Public Housing, Spatial Planning and Environment (VROM, 2003). VINEX states that there is a lack of communication and cooperation between municipalities (dealing with construction works) and provinces (dealing with the connection of natural habitats). 2.2. The city of Hilversum Since Hilversum is located so close to the Vecht area (Fig. 2), it is immediately surrounded by valuable landscapes, comprising not only natural wetlands and wetlands arranged as recreation areas, but also the Cornebos Forest, which is an old forest attracting rare birds, and the heathland of Westerheide (VVV, 2006). These areas are highly important in terms of their ecological value. Arable lands and pastures nearby also possess economic and ecological importance. Pasturelands, to some extent, form a transition zone between the wetland and urban areas and provide nesting areas for many bird species. Because of the complex structure of the surrounding landscape, city planning in Hilversum is strict. The city has managed to maintain a stable population for the last 10 years to save the protected landscape from harm, but despite low population growth, the extent of the city keeps growing. The number of new housings in a region is suggested as an alternative measure of city growth by Glaeser and Marshall (1994). Fig. 3 shows the data published by Statistics Netherlands (Het Centraal Bureau voor de Statistiek - CBS), indicating a clear trend of increase in the number of residential buildings, even though the population remains more or less steady during the same period. This suggests that the phenomenon commonly referred to as “urban sprawl” is in effect in the area, confirming Kasanko et al. (2006). 3. Method We develop a stochastic cellular automaton (CA) model for urban growth, which is built upon the concept of a total importance value 1 for each landscape onto which the city may grow. The model is kept as simple as possible at this stage to examine growth dynamics with clarity. We implement the model in C# programming language and provide the core source code in the appendix. The CA model is further described in Section 3.2. 1 A simplistic metric summarizing the economic, natural and other values associated with a piece of land. 4 Figure 2: The Vecht area and its immediate neighbor, Hilversum (Landsat 7 pseudocolor from bands 1-2-4. Source: USGS EarthExplorer). 5 Figure 3: Change in the population and the number of residential buildings in the city of Hilversum during the last decade. Source: Statistics Netherlands - CBS StatLine (available online: http://www.cbs.nl/en-GB/menu/cijfers/statline) 3.1. Input and assumptions For making projections with the model, we first need to adopt a reasonable average annual rate of urban growth. We assume, by investigating historical maps of the Vecht area, one can get a fairly accurate projection of the middleterm growth rate, provided that the maps are sufficiently detailed. For this purpose, we analyze a collection of topographic maps of the region covering a period between 1850 and 1951, with the majority belonging to the 20th century (Table 1). The reason for not including more recent maps is that during most of this selected period there were no restrictions in place to protect natural habitats, and as such, the measured growth rate would reflect unrestrained factors affecting the growth. This is favorable because it would reproduce the unbounded growth pattern of the city, while the limiting pressure of landscape protection will be dynamically imposed by the CA model in each simulation step on top of this basis growth rate. For our measurements, we define the area of the city of Hilversum on each historical map by supervised classification using RSI-ENVI 4.1 software. We conclude that an annual urban growth rate of around 2% is a reasonable value to assume, after observing trends of growth in historical data and giving more 6 Table 1: The list of employed spatial data. Data Source Scale / resolution Date Topographic map of Amsterdam and Hilversum Dienst der Militaire Verkenningena 1 : 50 000 1850 Topographic map Topografische Inrichting 1 : 50 000 1909, 1913, 1924, 1931 combined Topographic map of Utrecht and Amersfoort Netherlands Ministry of War, Topographic Service 1 : 50 000 1951 Satellite image GeoCoverTM 2000 – Landsat 7 ETM+ NASAb 14.25 m/pixel c. 2000 Vecht area restoration plan Van den Bergh et al. (2001) and Gilbert et al. (2004) N/A 2004 a b Provided by Geudeke and Zandvliet (1990). Accessible online (https://zulu.ssc.nasa.gov/mrsid) as compressed MrSIDTM color imagery. weight to the trend during the latter half of the 20th century. This value is also checked against the short-term projected economic growth rate by Statistics Netherlands and is consistent. For defining the boundaries of the protected wetland area in our model, we employ a suggested restoration plan provided by Van den Bergh et al. (2001) and Gilbert et al. (2004), which they use to analyze and evaluate land-use scenarios for wetland areas in the Netherlands, but just taking the present situation into account. 3.2. The model While being simple discrete systems of recurrently applied rules, cellular automaton (CA) models have a demonstrated ability to replicate important features of complexity observed in natural processes, as well as having a number of advantages over continuous mathematical models, which are well discussed in CA literature (Schiff, 2008). Using CA models for describing urban growth has been receiving increasing attention in the field of urban planning to study the effects of growth and to make predictions in diverse geographic settings (Itami, 1994; Couclelis, 1997; Torrens and O’Sullivan, 2001). A well-known CA model of 7 this kind is the SLEUTH (Slope, Land cover, Exclusion, Urbanization, Transportation, and Hillshade) model2 developed by the United States Geological Survey (USGS, 2003), incorporating factors such as the effect of transportation networks and slopes, in addition to the spreading of the existing urban area (Jantz et al., 2003). Here, we believe that a simpler model will be sufficient for the purposes of this study. The Vecht area is relatively small compared to the scales urban CA models are frequently applied to and this means that the effect of excluding advanced features in the model, such as breeding,3 will be insignificant. Another important factor is the characteristic flatness of the topography of the Netherlands, where most of the country including the Vecht area is virtually void of any hills or slopes (RDG, 1979). This renders factors like slope resistance, a very important part of general urban CA models, irrelevant in this case. In our CA model, we consider the area under study as a grid of cells, where each cell is one of 6 types: urban, wetland, heathland, forest, pasture, or water. All cell types except the water type can be urbanized. For initializing the model with the current distribution of landscapes in the region, we employ a recent satellite image (from the GeoCoverTM 2000 set distributed by NASA based on Landsat 7 ETM+, Table 1) and process it with the supervised classification technique. The 6 cell types are assigned real numbers ranging from 0 to 1 representing their importance, where a value of 0 means no protection at all for the cells of that type and a value of 1 means total protection of cells of that type under all circumstances. Each year, according to the annual growth rate, a number of new cells are appended to the existing urban area by converting neighboring non-urban cells (i.e. wetland, heathland, forest or pasture) into urban cells. This is done as follows: (1) A random cell is selected on the grid, and then checked for whether it is non-urban or not, and if it has at least one urban neighbor. The random selection continues until such a cell is found. (2) The selected cell is then converted into an urban cell, with a probability inversely proportional to the landscape importance value assigned to its type. (3) For every year during the simulation, this random selection and conversion cycle continues until the required number of new urban cells for that year are created. The model permits the formation of diverse development scenarios by assigning different importance values to different landscape types. The flowchart in Fig. 4 gives an outline of the model’s working. The number of new urban cells created each year is simply N0 = r × N (1) 0 where N is the number of new urban cells, r is the annual growth rate, and N is the number of present urban cells. The annual growth rate of urban area 2 http://www.ncgia.ucsb.edu/projects/gig/ 3 A type of growth in urban CA models, in which a new isolated urban cell is occasionally formed without any adjacent urban cells 8 is held fixed during a run, based on the assumption that the expected growth rate of a city should be independent of its size (Cordoba, 2004). Figure 4: Flowchart of the employed urban growth model. We take a cautious approach by presuming an ultimate date of reasonable prediction for this model before the year 2055, thinking that calculations covering longer periods would become more diverted by the accumulation of errors introduced by assumptions, selected parameters such as the growth rate, and the intrinsic limitations of the CA modeling approach (Yeh and Li, 2006). Also, the trends and priorities in the Vecht area and in the Netherlands in general are likely to be changed beyond terms longer than this. 4. Results and discussion Going back to the questions at the beginning: 9 4.1. Can the city resist growing to protect the wetland? This part cannot be answered solely with the aid of the model, but literature and experiences may help. Economic growth is always desired and has a direct influence on the growth of cities. A similar situation described by Karen (2001) in Merced County in the United States, an area that has to deal with urban growth and wetland recreation simultaneously in California’s Central Valley, exemplifies how complex the situation could become. It has been noted that $ 27.7 million per year is spent for the maintenance of the wetland recreation area, and the wetland contributes $ 41 million per year back to the local economy and provides jobs for more than 800 people. The paradox posed by this situation can immediately be seen: the effort to protect the wetland turns back as a contribution to the local economy, which in turn promotes urban growth and threatens the wetland. At the same time, wetlands are now recognized globally as a cornerstone and focal point of economic development in both the developed and developing countries and ways are sought after that can balance their protection and use. Wetland restoration in the Vecht area presents many valuable economic benefits to nearby cities, such as income from increased tourism and fishing; and for the city of Hilversum, economic growth is foreseeable. This growth should be planned in a way which ensures the survival of the wetland and the other landscapes in the region. 4.2. When will the city threaten the wetland or when will the wetland threaten the city? To answer this question, we design the first run with the model using parameters thought to represent current policies / priorities in the region. Wetland importance value was set to 1.00 (i.e. it is impossible to destroy wetland) to make sure that it will be protected under all circumstances. Used parameter values are summarized in Table 2. The main result from our simulation, in addition to the projected spatial distribution on the map, is the amount of loss in the area of each landscape type present. Here, the resulting distribution of different landscapes is summarized in Table 2 for years 2030 and 2055 (as the amount of area lost and as a ratio of the projected area to the current area) and the projected distribution of landscapes are presented in Fig. 5 from 2015 to 2055 with 20 years interval. Note that the annual urban growth rate during all runs is assumed as 2.0 %, as explained in Section 3. We predict that the clash between the wetland area and the city boundary will become significant by the year 2035, well within a timescale to grant considering in the current recreation and urban plans of the Vecht area. 4.3. How long is this wetland going to be protected? The results of the first run in the previous section indicate a deficiency with that scenario. While the wetland is successfully protected, this comes at the cost of losing other valuable landscapes. The most noticeable is the decrease in 10 Figure 5: The first run of the model with definite protection for the wetland and decreasing importance values for heathland, forest and pasture (details in Table 2). Resulting distribution of landscapes is shown between 2015 and 2055 with 20 year intervals. Table 2: Parameters and results for the first run. Definite protection for wetland, decreasing importance for heathland, forest and pasturea . Landscape Importance 2030 Amount Remaining lost (km2 ) (% of original) 2055 Amount Remaining lost (km2 ) (% of original) Wetland Heathland Forest Pasture 1.00 0.95 0.80 0.65 0 1.39 5.01 10.17 0 3.62 14.47 26.64 a 100.0 74.58 88.22 90.82 100.0 34.03 66.01 72.95 Annual growth rate is 2.0 %. The simulation starts from year 2005. the total forest area to almost 66% of its original amount by 2055 (Table 2). One may argue that the proximity of the forest to the urban area makes it more prone to depletion, but it should still be possible to prevent an amount of this loss by trying to adjust the protection priorities. The other two runs of the model in this section are designed to investigate whether permitting some loss of wetland helps to save a greater amount of the forest. With this purpose, the model was run many times, giving different importance values to each type of landscape and observing the results. Here we present results from two such runs. Table 3 and Fig. 6 present a situation where the wetland importance parameter is reduced to 0.90, in an effort to prevent the drastic loss of forest in the first run. Surprisingly, it is noticed that with a little sacrifice of the wetland, one has the potential to save a significant amount of forest: around 82% remaining by 2055, in contrast to the figure of 66% in the first run (compare Table 2 and Table 3). The results of a more radical change in protection policy are presented in Table 4 and Fig. 7, where we assign wetland, heathland and forest equal protection priorities. This results in a situation in which a more even distribution of all 11 Figure 6: The second run of the model, with the wetland importance reduced to 0.90, in an effort to prevent the drastic loss of forest in the first run (details in Table 3). The resulting distribution of landscapes is shown between 2015 and 2055 with 20 year intervals. Table 3: Parameters and results for the second run. The second run with the model, . Landscape Importance 2030 Amount Remaining lost (km2 ) (% of original) 2055 Amount Remaining lost (km2 ) (% of original) Wetland Heathland Forest Pasture 0.90 0.90 0.85 0.65 0.87 1.69 2.75 9.13 2.46 4.35 7.69 23.55 a 97.30 69.27 93.53 91.76 92.39 20.68 81.93 78.75 Annual growth rate is 2.0 %. The simulation starts from year 2005. resources is achieved while still maintaining the wetland above others. An issue to recognize here is how this is achieved while the wetland is assigned the same importance value as the other landscapes. This is the result of the particular geographical distribution of landscapes in this region: forest and heathland are under immediate threat by the growth of Hilversum, while the wetland lies at some distance, as compared to these. If wetland protection is considered of highest importance in the Vecht area, then the city of Hilversum will totally grow on other landscapes. In this case, these landscapes will be in danger of irreversible loss to keep the wetland safe. The results presented here indicate that setting a conventional, absolute constraint with the purpose of protecting a type of landscape can lead to other serious problems as a side effect. We conclude that an environmental management project should take the complex interaction and the unique spatial arrangement of different landscapes in a region into account, instead of simply putting particular regions into protected status according to the immediate perceived threat of the day. 12 Figure 7: The third run of the model with equal importance for the wetland, heathland and forest (details in Table 4). Resulting distribution of landscapes is shown between 2015 and 2055 with 20 year intervals. Table 4: Parameters and results for the third run. Equal importance for wetland, heathland and foresta . Landscape Importance 2030 Amount Remaining lost (km2 ) (% of original) 2055 Amount Remaining lost (km2 ) (% of original) Wetland Heathland Forest Pasture 0.80 0.80 0.80 0.65 1.16 2.28 2.33 8.69 3.38 4.35 6.95 23.29 a 96.40 58.36 94.52 92.15 89.54 20.65 83.67 78.98 Annual growth rate is 2.0 %. The simulation starts from year 2005. 4.4. Further discussion There is another way to protect those landscapes from the threatening urban growth in Hilversum, and it is even more effective: promoting a vertical growth (i.e. higher buildings) instead of the current trend of lateral growth. This solution can be a very efficient in protecting the valuable landscapes in the Vecht area, but there is no indication that this will be happening in the near future. An important insight gained from this study is on the mode of propagation of a growing city in such a configuration of landscapes and the speed at which this occurs. This type of information can be very useful in environmental management projects by making it easier to pick which urban areas in the proximity of a protected area to get included in the protection plan (by predicting whether an urban area will pose a significant threat during the course of the protection plan). Another issue of importance is how the suggested protection priorities, as represented in our model by the so-called importance values, could be implemented in reality, while how these priorities should be determined remains a separate subject. The issue often exceeds environmental considerations and in13 volves other factors such as community demand for each landscape type. A recent study by Kaplan and Austin (2004) on community preferences about neighboring different landscapes, for instance, has shown that there is a considerably greater desire for forests than other landscapes, regardless any benefits that might be obtained from these. 5. Conclusions Although urban growth is a dynamic and complex process, significant insight can still be gained by experimentation with computational models. An investigation of the Vecht area and the city of Hilversum is particularly useful in demonstrating this modeling and prediction approach, given the diversity of landscapes present in the region and the immediate threat posed on these by urban growth. We predict that the pressure to protect the designated wetland area will probably keep the city away from the wetland until around 2035, after which the expected clash between the city and the protection area will occur. But up to that time, the city would have to grow into other valuable landscapes, including forests. This leads to our suggestion that, to protect not only the wetland but also the diversity of other landscapes, the protection pressure on the wetland should be reduced to a level bringing the anticipated clash to an earlier date, while still preserving a considerable amount of wetland. This way, we believe, a more even distribution of all resources is achieved while still maintaining the wetland above others. An important aspect to recognize here is how this can be achieved even while the wetland is assigned the same importance value as the other landscapes. It is certain that landscapes will change continuously. But this change should be monitored and controlled in a way that is most beneficial for nature and human society. By investigating this interplay through experiments with different protection scenarios, this study shows that even a slight adjustment in the utilization priorities of landscapes is capable of achieving important changes in the distribution of landscapes that we will be depending on in the near future. 6. References References Cordoba, J. C., 2004. A generalized gibrat’s law for cities. Tech. rep., Rice University, Houston. Couclelis, H., 1997. From cellular automata to urban models: New principles for model development and implementation. Environment and Planning B: Planning and Design 24, 165–174. Council of Europe, 2000. European Landscape Convention (ETS no. 176). Florence. 14 Geudeke, P. W., Zandvliet, K. (Eds.), 1990. Grote Historische Atlas van Nederland 1:50 000. Wolters-Noordhoff, Ch. West Nederland 1839–1859. Gilbert, A. J., Van Herwijnen, M., Lorenz, C. M., 2004. From spatial models to spatial evaluation in the analysis of wetland restoration in the Vecht river basin. Regional Environmental Change 4, 118–131. Glaeser, E. L., Marshall, A., 1994. Cities, information, and economic growth. Cityscape: A Journal of Policy Development and Research 1, 9–47. Henderson, J. V., 2005. Handbook of Economic Growth, Volume 1. North Holland, Amsterdam, The Netherlands, Ch. Urbanization and Growth, pp. 1543– 1591. IDG, 1997. The Randstad and the Green Heart. IDG Newsletter. Information and Documentation Centre for the Geography of the Netherlands (IDG). Itami, R. M., 1994. Simulating spatial dynamics: cellular automata theory. Landscape and Urban Planning 30, 27–47. Jantz, C. A., Goetz, S. J., Shelley, M. K., 2003. Using the sleuth urban growth model to simulate the impacts of future policy scenarios on urban land use in the baltimore-washington metropolitan area. Environment and Planning B: Planning and Design 30, 251–271. Kaplan, R., Austin, M. E., 2004. Out in the country: Sprawl and the quest for nature nearby. Landscape and Urban Planning 69, 235–243. Karen, G. W., July 2001. Land use and economics study: Grassland ecological area, merced county, ca. Tech. rep., Grassland Water District, Los Banos, CA. Kasanko, M., Barredo, J. I., Lavalle, C., McCormick, N., Demicheli, L., Sagris, V., Brezger, A., 2006. Are european cities becoming dispersed? a comparative analysis of 15 european urban areas. Landscape and Urban Planning 77, 111– 130. Kusler, J. A., Kentula, M. E. (Eds.), 1990. Wetland Creation and Restoration: The Status of the Science. Island Press, Washington D.C. LNV, 1997. Natuurbeleidsplan (Nature Policy Plan). Ministerie van Landbouw, Natuur en Visserij [Ministry of Agriculture, Nature and Fisheries] (LNV), Den Haag, The Netherlands. LNV, 2005. Ecological Networks: Experiences in the Netherlands. Ministerie van Landbouw, Natuur en Voedselkwaliteit [Ministry of Agriculture, Nature and Food Quality] (LNV), Den Haag, The Netherlands. RDG, 1979. The Geology of the Netherlands. Rijks Geologische Dienst [Geological Survey of the Netherlands] (RDG), Haarlem, The Netherlands. 15 Schiff, J. L. (Ed.), 2008. Cellular Automata: A Discrete View of the World. Wiley-Intercience, Hoboken, N. J. Torrens, P. M., O’Sullivan, D., 2001. Cellular automata and urban simulation: Where do we go from here? Environment and Planning B: Planning and Design 28, 163–168. USGS, 2003. Project Gigalopolis: Urban and Land Cover Modeling. U.S. Geological Survey (USGS), http://www.ncgia.ucsb.edu/projects/gig, accessed May 12, 2006. Van den Bergh, J., Barendregt, A., Gilbert, A., Van Herwijnen, M., Van Horssen, P., Kandelaars, P., Lorenz, C., 2001. Spatial economichydroecological modelling and evaluation of land use impacts in the Vecht wetlands area. Environmental Modeling & Assessment 6, 87–100. Van Eck, J. R., Daalhuizen, F., Van den Broek, L., Van Oort, F., Raspe, O., 2005. The randstad as a network city. In: 45th Congress of the European Regional Science Association (ERSA) on Land Use and Water Management in a Sustainable Network Society. August 23–27. VROM, 2003. Voortgang verstedelijking VINEX (Vierde Nota over de Ruimtelijke Ordening - Extra) 1995–2005. Ministerie Volksgezondheid, Ruimtelijk Ordening en Milieu [Ministry of Public Housing, Spatial Planning and Environment] (VROM), Den Haag, The Netherlands. VVV, 2006. The Official City Guide for Hilversum, Central Holland. Vereniging voor Vreemdelingen Verkeer [Tourism Association of the Netherlands] (VVV). Whigham, D. F., Dykyjova, D., Hejny, S. (Eds.), 1992. Wetlands of the World: Inventory, Ecology and Management. Volume 1: Africa, Australia, Canada and Greenland, Mediterranean, Mexico, Papua New Guinea, South Asia, Tropical South America, United States. Vol. 15-2 of Handbook of Vegetation Sciences. Kluwer Academic Publishers, Dodrecht, The Netherlands. Yeh, A. G. O., Li, X., 2006. Errors and uncertainties in urban cellular automata. Computers, Environment and Urban Systems 30 (1), 10–28. 16 Appendix A. Code for the CA model Following is the core C# code of the CA urban growth model used in this study. For brevity, only the portion central to the working of the model is presented, leaving out auxiliary code such as for the interface. The code was compiled and executed on Microsoft .NET Framework version 2.0.50727. namespace HilversumVecht { p u b l i c c l a s s CAModel { p r i v a t e enum CellType { F o r e s t , Heathland , Urban , Wetland , Water , Canal , Void } // P r e d e f i n e d RGB v a l u e s f o r : // 1 . Reading t h e c e l l t y p e s from t h e i n i t i a l map presented to the c l a s s // as a bitmap v i a t h e c o n s t r u c t o r ( Bitmap i n i t i a l M a p ) . // 2 . Producing t h e o u t p u t bitmap w h i l e t h e model i s running . p r i v a t e s t a t i c C o l o r ModelMapForestColor = C o l o r . FromArgb ( 1 2 1 , 1 7 4 , 4 ) ; p r i v a t e s t a t i c C o l o r ModelMapHeathlandColor = C o l o r . FromArgb ( 2 1 9 , 1 9 8 , 2 1 5 ) ; p r i v a t e s t a t i c C o l o r ModelMapUrbanAreaColor = C o l o r . FromArgb ( 2 3 1 , 5 6 , 1 3 ) ; p r i v a t e s t a t i c C o l o r ModelMapWetlandColor = C o l o r . FromArgb ( 1 3 , 1 1 1 , 5 5 ) ; p r i v a t e s t a t i c C o l o r ModelMapWaterColor = C o l o r . FromArgb ( 4 6 , 1 4 3 , 2 1 0 ) ; p r i v a t e s t a t i c C o l o r ModelMapCanalColor = C o l o r . FromArgb ( 1 0 7 , 1 7 5 , 2 2 0 ) ; p r i v a t e s t a t i c C o l o r ModelMapVoidColor = C o l o r . FromArgb ( 1 9 5 , 2 1 2 , 1 4 4 ) ; p r i v a t e CellType [ , ] ModelMap ; p r i v a t e i n t Width , Heig ht ; p r i v a t e f l o a t F o r e s t V a l u e , WetlandValue , HeathlandValue , P a s t u r e V a l u e ; p r i v a t e b o o l Abort ; p r i v a t e Random rnd ; // The c o n s t r u c t o r o f t h e c l a s s . p u b l i c CAModel ( i n t width , i n t h e i g h t , Bitmap i n i t i a l M a p , f l o a t f o r e s t V a l u e , f l o a t wetlandValue , f l o a t heathlandValue , f l o a t p a s t u r e V a l u e ) { Width = width ; He igh t = h e i g h t ; F o r e s t V a l u e = f o r e s t V a l u e ; WetlandValue = wetlandValue ; HeathlandValue = h e a t h l a n d V a l u e ; P a s t u r e V a l u e 17 = pastureValue ; rnd = new Random ( ) ; ModelMap = ReadModelMap ( i n i t i a l M a p ) ; } // Reads t h e i n i t i a l l a n d s c a p e d i s t r i b u t i o n from t h e bitmap . p r i v a t e CellType [ , ] ReadModelMap ( Bitmap map) { CellType [ , ] r e t = new CellType [ Width , Hei ght ] ; f o r ( i n t x = 0 ; x < Width ; x++) f o r ( i n t y = 0 ; y < He ight ; y++) r e t [ x , y ] = ColorToCellType (map . G e t P i x e l ( x , y) ) ; return r e t ; } // C o n v e r t s a c o l o r i n t h e i n i t i a l l a n d s c a p e d i s t r i b u t i o n bitmap t o a C e l l T y p e v a l u e . p r i v a t e s t a t i c CellType ColorToCellType ( C o l o r c ) { i f ( c == ModelMapForestColor ) return CellType . F o r e s t ; e l s e i f ( c == ModelMapHeathlandColor ) return CellType . Heathland ; e l s e i f ( c == ModelMapWetlandColor ) return CellType . Wetland ; e l s e i f ( c == ModelMapUrbanAreaColor ) return CellType . Urban ; else return CellType . Void ; } // C o n v e r t s a C e l l T y p e v a l u e i n t o t h e c o r r e s p o n d i n g c o l o r f o r p r o d u c i n g t h e bitmap o u t p u t . p r i v a t e s t a t i c C o l o r CellTypeToColor ( CellType c ) { i f ( c == CellType . F o r e s t ) return ModelMapForestColor ; e l s e i f ( c == CellType . Heathland ) return ModelMapHeathlandColor ; e l s e i f ( c == CellType . Wetland ) return ModelMapWetlandColor ; e l s e i f ( c == CellType . Urban ) return ModelMapUrbanAreaColor ; e l s e i f ( c == CellType . Void ) return ModelMapVoidColor ; else return C o l o r . Yellow ; } 18 // Main method f o r r u n n i n g t h e model . p u b l i c void Run( f l o a t growthRate , i n t s t e p s ) { Abort = f a l s e ; f l o a t i n i t i a l F o r e s t A r e a = CountArea ( CellType . Forest ) ; f l o a t i n i t i a l W e t l a n d A r e a = CountArea ( CellType . Wetland ) ; f l o a t i n i t i a l H e a t h A r e a = CountArea ( CellType . Heathland ) ; f l o a t i n i t i a l U r b a n A r e a = CountArea ( CellType . Urban ) ; f l o a t i n i t i a l O t h e r A r e a = Width ∗ He ight − initialUrbanArea − initialWetlandArea − initialForestArea ; i n t f a , wa , ha , ua ; f l o a t p e r c e n t F o r e s t A r e a , percentWetlandArea , percentUrbanArea , percentHeathArea , percentOtherArea ; Bitmap map = new Bitmap ( Width , Hei ght ) ; f o r ( i n t i = 0 ; ( i < s t e p s ) && ! Abort ; i ++) { UpdateModelMap ( growthRate ) ; f a = CountArea ( CellType . F o r e s t ) ; wa = CountArea ( CellType . Wetland ) ; ha = CountArea ( CellType . Heathland ) ; ua = CountArea ( CellType . Urban ) ; percentForestArea = ( fa / i n i t i a l F o r e s t A r e a ) ∗ 1 0 0 ; percentWetlandArea = ( wa / initialWetlandArea ) ∗ 100; percentUrbanArea = ( ua / i n i t i a l U r b a n A r e a ) ∗ 1 0 0 ; percentHeathArea = ( ha / i n i t i a l H e a t h A r e a ) ∗ 100; percentOtherArea = ( ( Width ∗ He ight − f a − wa − ua − ha ) / initialOtherArea ) ∗ 100; map = WriteModelMap ( ) ; } } // The annual u p d a t e t o t h e g r i d . p r i v a t e void UpdateModelMap ( f l o a t growthRate ) { i n t px , py , t i m e o u t ; i n t s t e p s = ( i n t ) ( ( growthRate / 1 0 0 ) ∗ CountArea ( CellType . Urban ) ) ; f o r ( i n t i = 0 ; i < s t e p s ; i ++) { // Timeout i n t r o d u c e d f o r performance c o n c e r n s timeout = 100000; 19 while ( t i m e o u t > 0 ) { px = rnd . Next ( 1 , Width ) ; py = rnd . Next ( 1 , He ight ) ; i f ( ModelMap [ px , py ] != CellType . Urban ) { i f ( UrbanNeighbors ( px , py ) > 2 ) { i f ( ModelMap [ px , py ] == CellType . Void ) { i f ( P a s t u r e V a l u e <= rnd . NextDouble ( ) ) { ModelMap [ px , py ] = CellType . Urban ; break ; } } e l s e i f ( ModelMap [ px , py ] == CellType . F o r e s t ) { i f ( F o r e s t V a l u e <= rnd . NextDouble ( ) ) { ModelMap [ px , py ] = CellType . Urban ; break ; } } e l s e i f ( ModelMap [ px , py ] == CellType . Wetland ) { i f ( WetlandValue <= rnd . NextDouble ( ) ) { ModelMap [ px , py ] = CellType . Urban ; break ; } } else { i f ( HeathlandValue <= rnd . NextDouble ( ) ) { ModelMap [ px , py ] = CellType . Urban ; break ; } } } } timeout −−; 20 } } } // Produces t h e o u t p u t bitmap from t h e c u r r e n t g r i d ( v a r i a b l e ”ModelMap ”) . p r i v a t e Bitmap WriteModelMap ( ) { Bitmap r e t = new Bitmap ( Width , H eigh t ) ; f o r ( i n t x = 0 ; x < Width ; x++) f o r ( i n t y = 0 ; y < He ight ; y++) r e t . S e t P i x e l ( x , y , I n t e g e r T o C o l o r ( ModelMap [ x, y]) ) ; return r e t ; } // Counts t h e number o f urban n e i g h b o r s o f a g i v e n cell . p r i v a t e i n t UrbanNeighbors ( i n t x , i n t y ) { //Moore n e i g h b o r h o o d int r e t = 0 ; i f ( ModelMap [ x − 1 , y − 1 ] == CellType . Urban ) r e t ++; i f ( ModelMap [ x , y − 1 ] == CellType . Urban ) r e t ++; i f ( ModelMap [ x + 1 , y − 1 ] == CellType . Urban ) r e t ++; i f ( ModelMap [ x − 1 , y ] == CellType . Urban ) r e t ++; i f ( ModelMap [ x + 1 , y ] == CellType . Urban ) r e t ++; i f ( ModelMap [ x − 1 , y + 1 ] == CellType . Urban ) r e t ++; i f ( ModelMap [ x , y + 1 ] == CellType . Urban ) r e t ++; i f ( ModelMap [ x + 1 , y + 1 ] == CellType . Urban ) r e t ++; return r e t ; } // Counts t h e t o t a l number o f c e l l s o f a g i v e n C e l l T y p e on t h e g r i d . p r i v a t e i n t CountArea ( CellType c ) { int r e t = 0 ; f o r ( i n t x = 0 ; x < Width ; x++) f o r ( i n t y = 0 ; y < He ight ; y++) i f ( ModelMap [ x , y ] == c ) r e t ++; 21 return r e t ; } } } 22
5cs.CE
Types for BioAmbients∗ Sara Capecchi Angelo Troina Dipartimento di Informatica, Università di Torino {capecchi,troina}@di.unito.it The BioAmbients calculus is a process algebra suitable for representing compartmentalization, molecular localization and movements between compartments. In this paper we enrich this calculus with a static type system classifying each ambient with group types specifying the kind of compartments in which the ambient can stay. The type system ensures that, in a well-typed process, ambients cannot be nested in a way that violates the type hierarchy. Exploiting the information given by the group types, we also extend the operational semantics of BioAmbients with rules signalling errors that may derive from undesired ambients’ moves (i.e. merging incompatible tissues). Thus, the signal of errors can help the modeller to detect and locate unwanted situations that may arise in a biological system, and give practical hints on how to avoid the undesired behaviour. 1 Introduction BioAmbients [23] is a variant of the Ambient Calculus [11], in which compartments are described as a hierarchy of boundary ambients. This hierarchy can be modified by suitable operations that have an immediate biological interpretation; for example, the interactions between compounds that reside in the cytosol and in the nucleus of a cell could be modelled via parent–child communications. Thus, BioAmbients is quite suitable for the representation of various aspects of molecular localization and compartmentalization, such as the movement of molecules between compartments, the dynamic rearrangement that occurs between cellular compartments, and the interaction between the molecules in a compartmentalized context. A stochastic semantics for BioAmbients is given in [8], and an abstract machine for this semantics is developed in [20]. In [17] BioAmbients is extended with an operator modelling chain-like biomolecular structures and applied within a DNA transcription example. In [21] a technique for pathway analysis is defined in terms of static control flow analysis. The authors then apply their technique to model and investigate an endocytic pathway that facilitates the process of receptor mediated endocytosis. In this paper we extend the BioAmbients calculus with a static type system that classifies each ambient with a group type G specifying the kind of compartments in which the ambient can stay [10]. In other words, a group type G describes the properties of all the ambients and processes of that group. Group types are defined as pairs (S, C), where S and C are sets of group types. Intuitively, given G =(S, C), S denotes the set of ambient groups where ambients of type G can stay, while C is the set of ambient groups that can be crossed by ambients of type G. On the one hand, the set S can be used to list all the elements that are allowed within a compartment (complementary, all the elements which are not allowed, i.e. repelled). On the other hand, the set C lists all the elements that can cross an ambient, thus modelling permeability properties of a compartment. Starting from group types as bases, we define a type system ensuring that, in a well-typed process, ambients cannot be nested in a way that violates the group hierarchy. Then, we extend the operational ∗ This research is funded by the BioBITs Project (Converging Technologies 2007, area: Biotechnology-ICT), Regione Piemonte. E. Merelli and P. Quaglia (Eds.) From Biology To Concurrency and back 2010 (FBTC’10) EPTCS 19, 2010, pp. 103–115, doi:10.4204/EPTCS.19.7 c S. Capecchi, A. Troina This work is licensed under the Creative Commons Attribution License. Types for BioAmbients 104 semantics of BioAmbients, exploiting the information given by the group types, with rules rising warnings and signalling errors that may derive from undesired compartment interactions. For example, while correctness of the enter/accept capabilities (that are used to move a compartment to the inside of another compartment) can be checked statically, the merge capability (which merges two compartments into one) and the exit/expel capabilities (which are used to move a compartment from the inside to the outside of another compartment) could cause the movement of an ambient of type G within an ambient of type G′ which does not accept it. In these cases, for example when incompatible tissues come in contact, an error signal is raised dynamically and the execution of the system is blocked. The modeller can exploit these signals as helpful debugging information in order to detect and locate the unwanted situations that may arise in a biological system. Intuitively, they give practical hints on how to avoid the undesired behaviour. In the last few years there has been a growing interest on the use of type disciplines to enforce biological properties. In [3] a type system has been defined to ensure the wellformedness of links between protein sites within the Linked Calculus of Looping Sequences (see [4]). In [16] three type systems are defined for the Biochemical Abstract Machine, BIOCHAM (see [1]). The first one is used to infer the functions of proteins in a reaction model, the second one to infer activation and inhibition effects of proteins, and the last one to infer the topology of compartments. In [15] we have defined a type system for the Calculus of Looping Sequences (see [6]) to guarantee the soundness of reduction rules with respect to the requirement of certain elements, and the repellency of others. Finally, in [14] we have proposed a type system for the Stochastic Calculus of Looping sequences (see [5]) that allows for a quantitative analysis and models how the presence of catalysers (or inibitors) can modify the speed of reactions. 1.1 Summary The remainder of the paper is organised as follows. In Section 2 we recall the original BioAmbients’ syntax. In Section 3 we define our type system and in Section 4 we give our typed operational semantics. In Section 5 me formulate two motivating examples, namely we use our type system to analyse blood transfusions (rising errors in the case incompatible blood types get mixed) and spore protection against bacteriophage viruses. Finally, in Section 6 we draw our conclusions. 2 BioAmbients: Syntax In this section we recall the BioAmbients calculus. Ambients represent bounded mobile entities that can be nested forming hierarchies. They provide an intuitive mean to model both membrane-bound compartments, where the components of a compartment are isolated from the external environment, and molecular compartments i.e. multi molecular complexes in which molecules can be partially isolated from the environment. Capabilities are used to model movements changing ambients hierarchies: they can be employed to model membranes fusion, molecules movement, complexes formation. Finally, communications model interactions between components within or across ambients boundaries. The syntax is defined in Figure 1 and is the same as that of [23]. The only difference is that in our syntax ambients names are not optional. We give a name to each ambient in order to associate its type to it. Ambient names are ranged over by a, a1 , b . . ., channel names are ranged over by c, c1 , . . ., capability names are ranged over by h, h1 , . . .. We use n, m to range over unspecified names and P,Q, R, T to range over processes. S. Capecchi, A. Troina 105 Capabilities syncronise using names (h) and allow an ambient (1) to enter in a sibling ambient accepting it (enter h /accept h), (2) to leave the parent ambient ( exit h /expel h), (3) to merge with a sibling forming a unique ambient (merge⊕ h /merge− h). Communications on channels ($c!{m},$c?{m}) are prefixed by directions ($) denoting different kinds of communications: local communications (loc) within the same ambient, sibling communications (sts) between sibling ambients, parent/child (ptc,ctp) between nested ambients. Concerning processes syntax: inaction 0 is a special case of summation (I = ∅) and denotes the process doing nothing; restriction (ν n)P restricts the scope of the name n to P; P | Q denotes the parallel composition of P and Q; !P stands for process replication; a[[P]] describes a process P P P confined in an ambient named a; communication and capability choices ( i∈I πi .Pi , i∈I Mi .Pi ) generalise communication and capability prefixes respectively ( π.P, S .P ) and represent standard choices. 3 The Type System We classify ambients names with group types as in [10, 12]. Intuitively, the type G of an ambient denotes the set of ambients where that particular ambient can stay: it describes, in terms of other group types (possibly including G), the properties of all the ambients and processes of that group. Group types consist of two components and are of the form (S, C), where S and C are sets of group types. The intuitive meanings of the types’ sets are the following: • S is the set of ambient groups where the ambients of group G can stay; • C is the set of ambient groups that G-ambients can cross, i.e., those that they may be driven into or out of, respectively, by enter and exit capabilities. Clearly for all G C(G)⊆ S(G). If G= (S, C) is a group type, we write S(G) and C(G) respectively to denote the components S and C of G. We call GUniv the type of universal environments where each ambient can stay in. Types syntax is given in Figure 2. Besides group types we have: • Capability types: (G1 ,G2 )ℓ is the type associated to a name h through which ambients of types G1 and G2 can perform the movements described by ℓ. • Channel types γ: the types of the channels arguments which can be groups (G) , capabilities (s) or channels (γ). Notation 1. Let M be a capability prefix and s=(G1 ,G2 )(M1 ,M2 ) be a capability type, we say M ∈ s if either M = M1 or M = M2 . We now define well-formedness for capability types. Definition 1 (s-Well-formedness). A capability type (G1 ,G2 )ℓ is well formed iff none of the following holds: 1. ℓ= enter/accept and ∃Gi ∈ G2 , G j ∈ G1 : Gi < C(G j ) 2. ℓ= exit/expel and ∃Gi ∈ G2 , G j ∈ G1 : Gi < C(G j ) Intuitively, a capability type (G1 ,G2 )ℓ describing the entrance(exit) of an ambient of type G j ∈ G1 into(out of) an ambient of type Gi ∈ G2 is not correct if G j cannot (cross)stay in Gi . We now define the environment Γ mapping names to types: Γ ::= ∅ | Γ, m : t Types for BioAmbients 106 ::= | | $c!{m} $c?{m} ::= | | | | loc sts ptc ctp ::= | | | | | | enter accept exit expel merge⊕ merge− S ::= Mh P ::= | | | | | | | | | 0 (ν n)P P|Q !P a[[P]] π.P S .P P π .P Pi∈I i i i∈I Mi .Pi π $ M Actions Output Input Directions Intra-Ambient Inter-siblings Parent to child Child to parent Capabilities Prefixes Entry Accept Exit Expel Merge with Merge into Capabilities Processes Empty process Restriction Composition Replication Ambient Communication prefix Capability prefix Communication choice Capability choice Figure 1: BioAmbients: Syntax. S. Capecchi, A. Troina G1 . . .Gn t s ℓ γ ::= ::= ::= ::= 107 G|s|γ (G1 ,G2 )ℓ enter/accept | exit/expel | merge⊕/merge− ch{t} Group types Channels arguments Capability types Labels Channels Figure 2: Type syntax. we assume that we can write Γ, m: t only if m does not occur in Γ, i.e. m < Dom(Γ) (Dom(Γ) denotes the domain of Γ, i.e., the set of names occurring in Γ). An environment Γ is well formed if for each name the associated type is well formed. In the following we define compatibility between a group type and an argument type. Definition 2 (s-G Compatibility). Given a capability type s=(G1 ,G2 )ℓ and a group type G we define their compatibility as follows: s ≍ G iff s is well formed and at least one between G ∈ G1 and G ∈ G2 holds. We can check the safety of BioAmbients processes using the rules in Figure 3. Let Γ be type environment from which we derive the type of names (rule ⌊Name⌋); typing rules for processes have the shape : Γ ⊢ P : G⊲∆ where P is a process, G is a set of group types representing the types of the ambients in P and ∆ is a set of capability types collecting the capabilities in P. ⌊Inact⌋ derives any group type G for the empty process (indeed the empty process can stay in every type of ambient); ⌊Par⌋ gives to parallel composition of processes P and Q the union of the sets of groups G1 and G2 obtained by typing P and Q; rule ⌊Amb⌋ checks whether a process P can be safely nested in an ambient a of type G: if P is typed with a set of types G we have to ensure that every type Gk in G can stay in an ambient of type G; moreover, all capability types collected in ∆ while typing P must be compatible with G; since the scope of the capabilities is the enclosing ambient, once the capabilities in ∆ have been checked to be admissible, ∆ is emptied; rule ⌊Cap⌋ verifies the correspondence between the type of a name used for capability synchronization and the capability prefix used with it and then adds the type to ∆; rule ⌊Choice⌋ gives to the choice between P and Q the union of the sets of groups G1 and G2 derived by typing P and Q. We now show an example motivating the presence of the C set of ambient groups that can be crossed. Hydrophilic molecules are typically charge–polarized and capable of hydrogen bonding, thus enabling it to dissolve more quickly in water than in oil. Hydrophobic molecules instead tend to be non–polar and thus prefer other neutral molecules and non–polar solvents. As a consequence, hydrophobic molecules in water tend to cluster together forming micelles. Hydrophobic molecules can cross cell membranes in a natural (and slow) way, even if there is no particular transporter on the membrane. On the contrary, hydrophilic molecules can cross membranes only with dedicated transporters (conveyers). We can model these crossing properties with our type system. Namely, we can represent cells with or without conveyers as ambients of type GCConv and GC respectively; molecules can be of type G H phi (hydrophilic) and G H pho (hydrophobic). Finally, transporters have type GConv . Molecules of types G H phi and G H pho can stay in both GCConv and GC cells but only G H pho molecules can cross GC cells. The sets S and C associated to the types are given in Figure 4. Types for BioAmbients 108 Γ ⊢ 0 : G ⊲ ∅ ⌊Inact⌋ Γ ⊢ P : G⊲∆ Γ ⊢ (ν c)P : G ⊲ ∆ Γ⊢a:G Γ ⊢ P : G1 ⊲ ∆1 ⌊Restr⌋ Γ, n : t ⊢ n : t ⌊Name⌋ Γ ⊢ Q : G2 ⊲ ∆2 Γ ⊢ P | Q : G1 ,G2 ⊲ ∆1 ∪ ∆2 ⌊Par⌋ Γ ⊢ P : G⊲∆ Γ ⊢!P : G ⊲ ∆ Γ ⊢ P : G ⊲ ∆ G ∈ S(Gk ), ∀Gk ∈ G s≍G ∀ s∈∆ Γ ⊢ a[[P]] : G ⊲ ∅ Γ ⊢ c : ch{t} Γ, n : t ⊢ P : G ⊲ ∆ Γ ⊢ $c?{n}.P : G ⊲ ∆ Γ⊢h: s ⌊Input⌋ M ∈ s Γ ⊢ P : G⊲∆ ⌊Cap⌋ Γ ⊢ Mh.P : G ⊲ ∆ ∪ {s} Γ ⊢ c : ch{t} ⌊Amb⌋ Γ ⊢ P : G⊲∆ Γ ⊢ m : t Γ ⊢ $c!{m}.P : G ⊲ ∆ Γ ⊢ P : G1 ⊲ ∆1 Γ ⊢ Q : G2 ⊲ ∆2 Γ ⊢ P + Q : G1 ,G2 ⊲ ∆1 ∪ ∆2 ⌊Repl⌋ ⌊Out⌋ ⌊Choice⌋ Figure 3: Typing rules. Group types G S(G) C(G) GC GCConv GConv G H phi G H pho GUniv GUniv GCConv GCConv , GC GCConv , GC GUniv GUniv GUniv GCConv GCConv , GC Figure 4: Types for molecules and cells. Let Γ = cellC : GCConv , cell : GC , conv : GConv , h′ : (G H phi ,GC )exit/expel , h′′ : (G H pho ,GC )enter/accept , mol1 : G H phi , mol2 : G H pho , h1 : ({G H phi ,G H pho },GConv )enter/accept , h2 : (GConv ,GCConv )exit/expel , h3 : (GConv ,GCConv )enter/accept , h4 : ({G H phi ,G H pho },GConv )exit/expel A cell with conveyors can be modeled as an ambient of type GCConv with nested conveyors and molecules: cellC[[!conv[[P]] | mol1 [[enter h.exit h4 ]] | mol2 [[exit h′ + enter h.exit h4 ]] | expel h′ ]] where P = accept h.enter h1 .exit h2 .enter h3 .expel h4 . Thus we model the conveyor as first accepting molecules through h then exiting the current cell through h2 , entering a new cell through h3 and finally releasing it through h4 . Molecules of type G H pho (mol1 ) can enter inside the conveyor through h and finally be expelled by it, after the transport, through h4 ; instead molecules of type G H pho (mol2 ) can also pass the membrane cell without the use of a conveyor (through h′ ). 4 Typed Operational semantics In this section we extend the semantics of BioAmbients by adding rules which rise errors as a consequence of undesired behaviour. The structural congruence of BioAmbients remains unchanged, we recall S. Capecchi, A. Troina 109 P | Q≡Q | P P | 0≡P (ν n)(ν m)P ≡(ν m)(ν n)P (ν n)a[[P]] ≡a[[(ν n)P]] (ν m)P ≡(ν n)P[m ← n] if n< fn(P) !P ≡P | !P (P | Q) | R≡P | (Q | R) (ν n)0 ≡0 (ν n)P | Q ≡P | (ν n)Q if n< fn(P) $c?{m}.P≡$c?{n}.P[m ← n] if n< fn(P) !0 ≡0 Figure 5: Structural congruence. it in Figure 5. Rules for ambients movements and communications model reactions which may happen when two complementary prefixes on the same name n occur in parallel. Safety of communications and enter/accept capabilities can be statically checked by typing rules: enter/accept capabilities are ensured to be well formed, i.e. they cannot move an ambient a[[. . .]] of type G in an ambient b[[. . .]] of type G’ if G′ < S(G) (see Definiton 1). On the other hand, a static control of exit/expel and merge⊕/merge− capabilities would require too many constraints in the definition of group types: we should check the relation between the group types involved in all possible exit/expel and merge⊕/merge− interactions; as a consequence the type system would be very restrictive discarding also safe reductions just because of the presence of potentially unsafe capability prefixes in a choice. For this reason we check exit/expel and merge⊕/merge− reductions at run-time, signalling errors when they arise. The reduction rules are in Figure 6. Rule ⌊RedIn⌋ reduces the synchronization (thorough a name h) of enter h/accept h capability to the entrance of an ambient a[[. . .]] in an ambient b[[. . .]]. As explained above, if this rule is applied to a well typed process after the reduction the nesting of ambients is safe. Rule ⌊RedOut⌋ reduces the synchronization of exit h/expel h prefixes to the exit of an ambient b[[. . .]] out of an ambient a[[. . .]]. We put a warning W(Gb ) in parallel with the new sibling ambients, since we do not know in which ambient b[[. . .]] will arrive once exited from a[[. . .]]: e.g. b[[. . .]] could be nested in an ambient where it cannot stay. Two rules model the reduction of warned ambients inside another ambient: ⌊Red Amb WarnOK⌋ reduces the warning parallel to a safe one if the exit did not produced an unsafe nesting; on the contrary, in case of unsafe nesting ⌊Red Amb Warning⌋ generates an error; finally rule ⌊Red Amb⌋ models reduction inside an ambient when there are no warnings. Rule ⌊Merge⌋ reduces the synchronization of merge⊕ h/merge− h prefixes to the fusion of two sibling ambients into a single one: the merge− prefix ”brings” all the processes in parallel with the prefixed one into the sibling ambient. We cannot check statically which processes will be in parallel with the prefixed one when the reduction rule is applied: we perform this check at runtime raising an error in case of unsafe nesting due to the merging of two sibling ambients (rule ⌊Red Merge Warning⌋). Concerning communications, rules are unchanged w.r.t. [23], they model names substitutions due to communications between processes located in same ambient (⌊Red Local⌋), in parent-child ambients (⌊Red Parent Output⌋, ⌊Red Parent Input⌋) and in sibling ambients ⌊Red Sibling⌋. Note that in the rules of our operational semantics there are no checks on the sets C since capability types should be well formed (thus satisfying the conditions for C sets). Let Error Gi [[G j ]] range over expelError Gi [[G j ]] and mergeError Gi [[G j ]]. A well typed process either reduces to another well typed process or generates an error. Theorem 1. If Γ ⊢ P : G ⊲ ∆ then ′ ′ • either P −→ P′ or P −→ P′ | W(G) and ∃ Γ′ ,G , ∆′ such that Γ ⊢ P′ : G ⊲ ∆′ • or ∃ Gi , G j such that P −→ Error Gi [[G j ]] Types for BioAmbients 110 a[[(T + enter h.P) | Q]] | b[[(T ′ + accept h.R) | S ]] −→ b[[a[[P | Q]] | R | S ]] Γ ⊢ b : Gb a[[b[[(T + exit h.P) | Q]] | (T ′ + expel h.R) | S ]] −→ b[[P | Q]] | a[[R | S ]] | W(Gb ) P −→ R | W(Gi ) Γ ⊢ a : Ga Ga ∈ S(Gi ) ⌊Red In⌋ ⌊Red Out⌋ ⌊Red Amb WarnOK⌋ a[[P]] −→ a[[R]] P −→ R | W(Gi ) Γ ⊢ a : Ga Ga < S(Gi ) ⌊Red Amb Warning⌋ a[[P]] −→ expelError Ga [[Gi ]] P −→ Q ⌊Red Amb ⌋ a[[P]] −→ a[[Q]] Γ ⊢ a : Ga Γ ⊢ R : GR Γ ⊢ S : GS ∀Gi ∈ (GR ,GS ), Ga ∈ S(Gi ) a[[(T + merge⊕ h.P) | Q]] | b[[(T ′ + merge− h.R) | S ]] −→ a[[P | Q | R | S ]] Γ ⊢ a : Ga Γ ⊢ R : GR Γ ⊢ S : GS ∃Gi ∈ (GR ,GS ), Ga < S(Gi ) a[[(T + merge⊕ h.P) | Q]] | b[[(T ′ + merge− h.R) | S ]] −→ mergeError Ga [[Gi ]] (T + loc c?{m}.P) | (T ′ + loc c!{n}.Q) −→ P[m ← n] | Q ⌊Red Merge⌋ ⌊Red Merge Error⌋ ⌊Red Local⌋ (T + ptc c!{n}.P) | a[[(T ′ + ctp c?{m}.Q)]] | R −→ P | a[[Q[m ← n] | R]] ⌊Red Parent Output⌋ a[[(T + ctp c!{n}.P) | R]] | (T ′ + ptc c?{n}.Q) −→ a[[R | P]] | Q[m ← n] ⌊Red Parent Input⌋ a[[(T + sts c!{n}.P) | R]] | b[[(T ′ + sts c?{m}.Q) | S ]] −→ a[[R | P]] | b[[Q[m ← n] | S ]] P −→ Q P −→ Q ⌊Red Res⌋ (ν n)P −→ (ν n)Q ⌊Red Par⌋ ⌊Red Sibling⌋ P ≡ P′ , P −→ Q, Q ≡ Q′ P | R −→ Q | R P′ −→ Q′ ⌊Red ≡⌋ Figure 6: Operational Semantics Proof. By induction on the definition of →. Note that our semantics does not reduce the warnings W(G) at top level. While they do not affect the system evolution, they could be useful in a compositional setting. In particular, if the entire process should be nested, at some point, into another ambient, the warnings keep the conditions on the admissible ambients (without the need to recompute the whole type of the system). 5 Motivating Examples In this section we provide a couple of simple but motivating examples. In the following we will use a instead of a[[0]] and we assume S(G)=C(G) whenever C is not explicitly represented. S. Capecchi, A. Troina 111 Group types of basic elements S(G) S(Ga ) S(Gb ) S(Gr ) S(Ga ) S(Gb ) S(Gr ) G A− , G AB− , G A+ , G AB+ G B− , G AB− , G B+ , G AB+ G A+ ,G B+ , G AB+, GO+ G B+ , G B− , GO+ ,GO− G A+ , G A− , GO+ , GO− G A− ,G B− , G AB−, GO− Figure 7: Types for blood groups. 5.1 Blood transfusion This example has been inspired by [7]. A blood type is a classification of blood based on the presence or absence of inherited antigenic substances on the surface of red blood cells: these antigens are the A antigen and the B antigen. Blood type A contains only A antigens, blood type B contains only B antigens, blood type AB contains both and the blood type O contains none of them. The immune system will produce antibodies that can specifically bind to a blood group antigen that is not recognized as self: individuals of blood type A have Anti-B antibodies, individuals of blood type B have Anti-A antibodies, individuals of blood type O have both Anti-A and Anti-B antibodies, and individuals of blood type AB have none of them. These antibodies can bind to the antigens on the surface of the transfused red blood cells, often leading to the destruction of the cell: for this reason, it is vital that compatible blood is selected for transfusions. Another antigen that refines the classification of blood types is the RhD antigen: if this antigen is present, the blood type is called positive, else it is called negative. Unlike the ABO blood classification, the RhD antigen is immunogenic, meaning that a person who is RhD negative is very likely to produce Anti-RhD antibodies when exposed to the RhD antigen, but it is also common for RhD-negative individuals not to have Anti-RhD antibodies. We model blood transfusion as a system consisting of a set of closed tissues. Tissues contain blood cells and antibodies according to the classification described above, then they can join each other performing a transfusion of different blood types. We model a red blood cell as an ambient whose type represents the blood type; thus, the groups representing blood types are: G A+ , G A− , G B+ , G B− , G AB+ , G AB−, GO+ , GO− . We represent A,B, RhD antigen and Anti-A, Anti-B and Anti-RhD antibodies as ambients of type Ga , Gb , Gr , Ga , Gb , Gr respectively. The sets S(G) associated to the different blood types are given in Figure 7. Finally, we model a tissue (which contains the red cells) as an ambient of type Gi ∈ {G A+ ,G A− ,G B+ ,G B− ,G AB+,G AB− ,GO+ ,GO− }. We model blood transfusion as the reduction between two tissues having complementary merge capabilities (merge− for the donor, merge⊕ for the receiver). For instance let us consider a tissue t1 represented by an ambient of type G A+ and two potential donors t2 and t3 of types G B+ and GO+ respectively: P = t1 [[!(merge⊕h1 + merge⊕h2 +. . . merge⊕hn ) | a1 | b1 | r1 ]] | t2 [[merge− h1 | b1 | r2 ]] | t3 [[merge− h2 | r3 ]] P is well typed with Γ = t1 : G A+ , t2 : G B+ , t3 : GO+ , a1 : Ga , b1 : Gb , r1 : Gr , r2 : Gr , r3 : Gr , b1 : Gb , h1 : (G A+ ,G B+ )merge⊕/merge− , h2 : (G A+ ,GO+ )merge⊕/merge− , . . . Types for BioAmbients 112 (a) (b) (e) (c) (d) Figure 8: A bacterium (a) could be represented as a membrane containing the bacterium’s DNA. A resistent (coated) spore (b) is represented as a bacterium surrounded by its coat. A bacteriophage (c) is depicted with the outer capsid, containing the genetic material, and the hypodermic syringe, used to inject its genetic material into the bacteria cells (d). They cannot inject coated cells (e). Thus, the tissue t1 can potentially receive blood from many donors (merge⊕h1 + merge⊕h2 +. . . merge⊕hn ), and, because for example of some human error, may also receive blood which is not compatible to its own. Let us consider two possible reductions. The first one: t1 [[!(merge⊕h1 + merge⊕h2 +. . . merge⊕hn ) | a1 | b1 | r1 ]] | t2 [[merge− h1 | b1 | r2 ]] −→ mergeError G A+ [[Gb ]] results in an error because of a wrong transfusion causing the presence of an antigen of type Gb in a tissue of type G A+ . The second one: t1 [[!(merge⊕h1 + merge⊕h2 + . . . merge⊕hn ) | a1 | b1 | r1 ]] | t3 [[merge− h2 | r3 ]] → t1 [[!(merge⊕h1 + merge⊕h2 + . . . merge⊕hn ) | a1 | b1 | r1 | r3 ]] models a transfusion between compatible blood types, namely A+ and O+. 5.2 Bacteriophage viruses In this section we use our system to model the interaction between bacteria and bacteriophage viruses (see Figure 8). We assume that a bacterium consists of a cellular membrane containing its DNA. The sporulation mechanism allows producing inactive and very resistant bacteria forms, called spores which are surrounded by a membrane (coat) protecting them from virus attacks. A spore can germinate and then produce a new bacterium. A bacterium can safely stay in ambients containing viruses if it is protected by its coat. The types involved in this model are: G EnvOk , G EnvVirus are the types of environments respectively virus-free and virus-friendly; G Bact ,GCoat are the types of the bacteria and the protecting membrane. GVir is the type of viruses. The corresponding (relevant) S groups are shown in Figure 9. Now let us consider a bacteria b2 surrounded by a coat b1 (we omit the description of the DNA inside the bacterium): P = b1 [[b2 [[exit h | enter h2 ]] | !(expel h + enter h1 + enter h2 )]] P is well typed with: Γ = h : (G Bact ,GCoat )exit/expel , h1 : (GCoat ,G EnvOK )enter/accept , h2 : (GCoat ,G EnVirus )enter/accept , b1 : GCoat , b2 : G Bact , a1 : G EnvVirus a2 : G EnvOk S. Capecchi, A. Troina 113 Group types of basic elements S(G) G Bact GCoat GVir G EnvOk G EnvOk , G EnvVirus G EnvVirus Figure 9: Bacteria-Viruses Example: Types We represent the chance of the bacterium to get rid of the coat as an exit/expel capability through the name h which allows the bacterium to germinate (exiting from its protecting membrane). The coat (containing the bacterium) can move in every environment, while the bacterium can only enter G EnvOk environments; this is modeled by the use of suitable enter/accept capabilities. We now put the two environments a1 (allowing viruses) and a2 (virus-free) in parallel with the bacterium b1 . There are three possible behaviour (in the following we put labels on transitions for the sake of readability): 1. The bacterium gets rid of the coat and then can enter only in a2 : b1 [[b2 [[exit h | enter h2 ]] | !(expel h + enter h1 + enter h1 )]] | a1 [[!accept h1 ]] | a2 [[!accept h2 ]] exit/expel(h) → b1 [[!(expel h + enter h1 + enter h1 )]] | b2 [[enter h2 ]] | W(a1 [[!accept h1 ]]) | a2 [[!accept h2 ]] enter/accept(h2 ) → b1 [[!(expel h + enter h1 + enter h1 )]] | a1 [[!accept h1 ]] | a2 [[b2 [[]] | !accept h2 ]] 2. The coat can move in the ambient a1 and then expel the bacterium in this hostile environment (thus generating an error): b1 [[b2 [[exit h | enter h2 ]] | !(expel h + enter h1 + enter h1 )]] | a1 [[!accept h1 ]] | a2 [[!accept h2 ]] enter/accept(h1 ) → a1 [[b1 [[b2 [[exit h | enter h2 ]] | !(expel h + enter h1 + enter h2 )]] | !accept h1 ]] | a2 [[!accept h2 ]] exit/expel(h) → a1 [[b1 [[!(expel h + enter h1 + enter h2 )]] | W(b2 [[exit h | enter h2 ]]) | !accept h1 ]] | a2 [[!accept h2 ]] → expelError G EnvVirus [[G Bact ]] 3. The coat can move in the ambient a2 and then expel the bacterium: b1 [[b2 [[exit h | enter h2 ]] | !(expel h + enter h1 + enter h1 )]] | a1 [[!accept h1 ]] | a2 [[!accept h2 ]] enter/accept(h2 ) → a2 [[b1 [[b2 [[exit h | enter h2 ]] | !(expel h + enter h1 + enter h2 )]] | !accept h2 ]] | a1 [[!accept h1 ]] exit/expel(h) → a2 [[b1 [[!(expel h + enter h1 + enter h2 )]] | W(b2 [[exit h | enter h2 ]]) | !accept h2 ]] | a1 [[!accept h1 ]] → b1 [[!(expel h + enter h1 + enter h1 )]] | a1 [[!accept h1 ]] | a2 [[b2 [[enter h2 ]] | !accept h2 ]] 6 Conclusions The most common approach of biologists to describe biological systems is based on the use of deterministic mathematical means (like, e.g., ODE), and makes it possible to abstractly reason on the behaviour of 114 Types for BioAmbients biological systems and to perform a quantitative in silico investigation. This kind of modelling, however, becomes more and more difficult, both in the specification phase and in the analysis processes, when the complexity of the biological systems taken into consideration increases. This has probably been one of the main motivations for the application of Computer Science formalisms to the description of biological systems [24]. Other motivations can also be found in the fact that the use of formal methods from Computer Science permits the application of analysis techniques that are practically unknown to biologists, such as, for example, static analysis and model checking. Different formalisms have either been applied to (or have been inspired from) biological systems. The most notable are automata-based models [2, 18], rewrite systems [13, 19], and process calculi [24, 25, 23, 9, 22]. Automata-based models have the advantage of allowing the direct use of many verification tools, such as, for example, model checkers. On the other side, models based on rewrite systems describe biological systems with a notation that can be easily understood by biologists. However, automata-like models and rewrite systems are not compositional. The possibility to study in a componentwise way the behaviour of a system is, in general, naturally ensured by process calculi, included those commonly used to describe biological systems. In this paper we have laid the foundations for a type system for the BioAmbients calculus suitable to guarantee compatible compartments nesting (due to some intrinsical biological properties). In this framework, the correctness of the enter/accept capabilities can be checked statically, while the merge capability and the exit/expel capabilities could cause the movement of an ambient of type G within an ambient of type G′ and dynamically rise an error. We used our type discipline to model how incompatible blood transfusion could cause the system to rise an error, or to represent the movement of bacteria spore into friendly environments where they can germinate and restart their activity. Acknowledgments We would like to warmly thank Mariangiola Dezani-Ciancaglini who encouraged us to write this paper and gave us crucial suggestions. References [1] Biocham. available at http://contraintes.inria.fr/BIOCHAM/. [2] Rajeev Alur, Calin Belta, Vijay Kumar, and Max Mintz. Hybrid modeling and simulation of biomolecular networks. In Hybrid Systems: Computation and Control, volume 2034 of LNCS, pages 19–32. SpringerVerlag, 2001. [3] Bogdan Aman, Mariangiola Dezani-Ciancaglini, and Angelo Troina. Type disciplines for analysing biologically relevant properties. In Proc. of MeCBIC’08, volume 227 of ENTCS, pages 97 – 111. Elsevier, 2009. [4] Roberto Barbuti, Andrea Maggiolo-schettini, and Paolo Milazzo. Extending the calculus of looping sequences to model protein interaction at. In Proc. of ISBRA’07, volume 4463 of LNBI, pages 638 – 649. Springer-Verlag, 2006. [5] Roberto Barbuti, Andrea Maggiolo-Schettini, Paolo Milazzo, Paolo Tiberi, and Angelo Troina. Stochastic calculus of looping sequences for the modelling and simulation of cellular pathways. Transactions on Computational Systems Biology, IX:86 – 113, 2008. [6] Roberto Barbuti, Andrea Maggiolo-Schettini, Paolo Milazzo, and Aangelo Troina. A calculus of looping sequences for modelling microbiological systems. Fundamenta Informaticæ, 72(1–3):21–35, 2006. [7] Livio Bioglio, Mariangiola Dezani-Ciancaglini, Paola Giannini, and Angelo Troina. Type directed semantics for the calculus of looping sequences. Submitted to IJSI, 2009. [8] Linda Brodo, Pierpaolo Degano, and Corrado Priami. A stochastic semantics for Bioambients. In Proc. of PaCT’07, volume 4671 of LNCS, pages 22 – 34. Springer-Verlag, 2007. S. Capecchi, A. Troina 115 [9] Luca Cardelli. Brane calculi - interactions of biological membranes. In Computational Methods in Systems Biology, pages 257 – 278. Springer, 2004. [10] Luca Cardelli, Giorgio Ghelli, and Andrew D. Gordon. Types for the ambient calculus. Information and Computation, 177(2):160 – 194, 2002. [11] Luca Cardelli and Andrew D. Gordon. Mobile ambients. In Proc. of FOSSACS’98, volume 1378 of LNCS, pages 140 – 155. Springer-Verlag, 1998. [12] Mario Coppo, Mariangiola Dezani-Ciancaglini, Elio Giovannetti, and Ivano Salvo. M3: Mobility types for mobile processes in mobile ambients. Electronic Notes in Theoretical Computer Science, 78:144 – 177, 2003. CATS’03, Computing: the Australasian Theory Symposium. [13] Vincent Danos and Cosimo Laneve. Core formal molecular biology. In Proc. of ESOP’03, volume 2618 of LNCS, pages 302 – 318. Springer-Verlag, 2003. [14] Mariangiola Dezani-Ciancaglini, Paola Giannini, and Angelo Troina. A Type System for a Stochastic CLS. In Proc. of MeCBIC’09, volume 11 of EPTCS, pages 91 – 106, 2009. [15] Mariangiola Dezani-Ciancaglini, Paola Giannini, and Angelo Troina. A Type System for Required/Excluded Elements in CLS. In Proc. of DCM’09, volume 9 of EPTCS, pages 38 – 48, 2009. [16] François Fages and Sylvain Soliman. Abstract interpretation and types for systems biology. Theoretical Computer Science, 403(1):52–70, 2008. [17] Cheng Fu, Zhengwei Qiand, and Jinyuan You. biomolecules modelling. 314:455 – 459, 2005. A bioambients based framework for chain-structured [18] Hiroshi Matsuno, Atsushi Doi, Masao Nagasaki, and Satoru Miyano. Hybrid Petri Net representation of gene regulatory networks. In Proc. of PSB’00, pages 338 – 349, 2000. [19] Gheorghe Păun. Membrane Computing. An Introduction. Springer-Verlag, 2002. [20] Andrew Phillips. An abstract machine for the stochastic bioambient calculus. In Proc. of MeCBIC’08, volume 227 of ENTCS, pages 143 – 159, 2009. [21] Henrik Pilegaard, Flemming Nielson, and Hanne Riis Nielson. Pathway analysis for bioambients. Journal of Logic and Algebraic Programming, 77(1-2):92 – 130, 2008. Proc. of NWPT’06. [22] Corrado Priami and Paola Quaglia. Beta binders for biological interactions. In Computational Methods in Systems Biology, volume 3082, pages 20–33, 2005. [23] Aviv Regev, Ekaterina M. Panina, William Silverman, Luca Cardelli, and Ehud Shapiro. Bioambients: an abstraction for biological compartments. Theoretical Computer Science, 325(1):141 – 167, 2004. Computational Systems Biology. [24] Aviv Regev and Ehud Shapiro. Cells as computation. Nature, 419(6905):343, September 2002. [25] Aviv Regev and Ehud Shapiro. The π-calculus as an abstraction for biomolecular systems. Modelling in Molecular Biology, pages 219 – 266, 2004.
5cs.CE
arXiv:1412.1261v2 [cs.DS] 22 Feb 2017 On the Complexity of Various Parameterizations of Common Induced Subgraph Isomorphism∗ Faisal N. Abu-Khzam† Édouard Bonnet‡ Florian Sikora§ Abstract In the Maximum Common Induced Subgraph problem (henceforth MCIS), given two graphs G1 and G2 , one looks for a graph with the maximum number of vertices being both an induced subgraph of G1 and G2 . MCIS is among the most studied classical NP-hard problems. It remains NP-hard on many graph classes including forests. In this paper, we study the parameterized complexity of MCIS. As a generalization of Clique, it is W[1]-hard parameterized by the size of the solution. Being NP-hard even on forests, most structural parameterizations are intractable. One has to go as far as parameterizing by the size of the minimum vertex cover to get some tractability. Indeed, when parameterized by k := vc(G1 ) + vc(G2 ) the sum of the vertex cover number of the two input graphs, the problem was shown to be fixed-parameter tractable, with an algorithm running in time 2O(k log k) . We complement this result by showing that, unless the ETH fails, it cannot be solved in time 2o(k log k) . This kind of tight lower bound has been shown for a few problems and parameters but, to the best of our knowledge, not for the vertex cover number. We also show that MCIS does not have a polynomial kernel when parameterized by k, unless NP ⊆ coNP/poly. Finally, we study MCIS and its connected variant MCCIS on some special graph classes and with respect to other structural parameters. 1 Introduction A common induced subgraph of two graphs G1 and G2 is a graph that is isomorphic to an induced subgraph of both graphs. The problem of finding a common induced subgraph with the maximum number of vertices (or edges) has many applications in a number of domains including bioinformatics and chemistry [17, 21, 25, 29, 30]. In the decision version of the problem, we are given an integer k and the question is to decide whether there is a solution with at least k vertices. We say that the solution size k is the natural parameter of the problem. Concerning its classical complexity, Maximum Common Induced Subgraph is NP-complete, and remains so on forests. When the common subgraph is required to be connected, the problem is in P for trees [16]. Moreover, Maximum Common Induced Subgraph is also in P when the two input graphs are connected and (both) have bounded treewidth and bounded degree [4]. A particular case of Maximum Common Induced Subgraph is the well known Induced Subgraph Isomorphism (ISI) decision problem, where the question posed is whether G1 is isomorphic to an induced subgraph of G2 . In other words, it is equivalent to Maximum Common Induced Subgraph where k = |G1 |. In this case, G1 is called the pattern graph and G2 is called the host graph. ISI is known to be NP-hard, even when G2 is an interval graph and G1 is a proper interval graph, but it becomes polynomial-time solvable when G1 is in addition ∗ An extended abstract of this work appears in [2] American University, Beirut, Lebanon [email protected] ‡ Middlesex University, Department of Computer Science, Hendon, [email protected] § Université Paris-Dauphine, PSL Research University, CNRS, LAMSADE, [email protected] † Lebanese 1 London, Paris, UK France, connected [19]. Unlike Subgraph Isomorphism, Induced Subgraph Isomorphism remains NP-hard when both the host graph and the pattern graph consist of a disjoint union of paths [11]. From the parameterized complexity viewpoint, the problem is W[1]-hard in general for the natural parameter, by a straightforward reduction from k-Clique. Therefore MCIS is also W[1]-hard. Moreover, ISI (and, therefore, MCIS) remains W[1]-hard even when both graphs are interval graphs [24]. On the other hand, ISI is FPT on nowhere dense graphs, being expressible by a first-order formula of length function of the natural parameter k [18]. This generalizes what was previously known about ISI on H-minor free graphs [15] and graphs of bounded degree [8]. We observe that whenever ISI in FPT on a certain graph class, then so is MCIS. To see this, note that an arbitrary instance (G1 , G2 , k) of MCIS can be reduced in fpt-time to instances of ISI by enumerating each graph H on k vertices and checking whether H is an induced subgraph of G1 and G2 . This implies that ISI and MCIS have the same parameterized complexity with respect to the natural parameter. Another way of dealing with the hardness of a problem is to study its complexity with respect to auxiliary (or structural) parameters, to better understand its algorithmic behavior (see for example [13]). Being NP-hard on disjoint union of chordless paths [11], MCIS is hard on graphs with bounded treewidth as well as graphs where the size of the minimum feedback vertex set is bounded. Thus the problem is paraNP-hard when parameterized by the treewidth of the input graphs, or by a bound on the sizes of their minimum feedback vertex sets. Therefore, we need to look for “bigger” parameters. And indeed, if the parameter k is a bound on the sizes of the minimum vertex covers of the input graphs, then the problem is in FPT, with a running time of O((24k)k ) = 2O(k log k) [1]. In this paper, we show that this algorithm cannot be significantly improved: unless the Exponential Time Hypothesis (ETH) fails, there is no algorithm solving MCIS in time O∗ (2o(k log k) ), where the O∗ notation suppresses the polynomial factors. We also prove that MCIS does not have a polynomial-size kernel in this case unless NP ⊆ coNP/poly. These two latter results answer open problems raised in [1]. Finally, we show that Maximum Common Connected Induced Subgraph (MCCIS), where the solution should be a connected graph, is also fixed-parameter tractable when parameterized by k := vc(G1 ) + vc(G2 ). 2 Preliminaries Two finite graphs G1 = (V1 , E1 ) and G2 = (V2 , E2 ) are isomorphic if there is a bijection π : V1 → V2 such that ∀u, v ∈ V1 : uv ∈ E1 ⇔ π(u)π(v) ∈ E2 . Given a graph G = (V, E), a graph G′ = (V ′ , E ′ ) is an induced subgraph of G if V ′ ⊆ V and E ′ = E(V ′ ) = {uv ∈ E | u, v ∈ V ′ }, i.e. E ′ is the edge set with both extremities in V ′ . We also say that G′ is the subgraph of G induced by V ′ . The girth of a graph G is the length of the shortest cycle contained in G. Contracting an edge uv consists of deleting uv and replacing the vertices u and v by a single vertex w in the incidence relation (edges incident on u or v become incident on w). A graph H is a minor of graph G if H is obtained from a subgraph of G by applying zero or more edge contractions. Given a fixed graph H, a family F of graphs is said to be H-minor free if H is not a minor of any element of F . The Maximum Common Induced Subgraph problem is defined formally as follows. Maximum Common Induced Subgraph (MCIS): • Input: Two graphs G1 = (V1 , E1 ) and G2 = (V2 , E2 ). • Output: An induced subgraph G′1 of G1 isomorphic to an induced subgraph G′2 of G2 with a maximum number of vertices. Maximum Common Connected Induced Subgraph (MCCIS) is defined as MCIS with the additional restriction that the solution must be connected. For completeness, we also give the definition of Induced Subgraph Isomorphism: 2 Induced Subgraph Isomorphism (ISI): • Input: Two graphs G1 = (V1 , E1 ) and G2 = (V2 , E2 ). • Output: An induced subgraph G′2 of G2 isomorphic to G1 if it exists. Induced Connected Subgraph Isomorphism (ICSI) is defined as ISI but G1 must be connected. Parameterized complexity A parameterized problem (I, k) is fixed-parameter tractable (or in the class FPT) with respect to parameter k if it can be solved in f (k) · |I|c time (i.e. in fpttime), where f is any computable function and c is a constant (see [12, 27] for more details about fixed-parameter tractability). The parameterized complexity hierarchy is composed of the classes FPT ⊆ W[1] ⊆ W[2] ⊆ · · · ⊆ XP. The class XP contains problems solvable in time f (k) · |I|g(k) , where f and g are unrestricted functions. A problem is said to be paraNP-hard if it is NP-hard even for a constant value of the parameter (it hence cannot be in XP). A W[1]-hard problem is not fixed-parameter tractable, unless FPT = W[1], and one can prove W[1]-hardness by means of a parameterized reduction from a W[1]-hard problem. This is a mapping of an instance (I, k) of a problem A1 in g(k) · |I|O(1) time (for any computable function g) into an instance (I ′ , k ′ ) for A2 such that (I, k) ∈ A1 ⇔ (I ′ , k ′ ) ∈ A2 and k ′ ≤ h(k) for some function h. A powerful technique to design parameterized algorithms is kernelization. In short, kernelization is a polynomial-time self-reduction algorithm that takes an instance (I, k) of a parameterized problem P as input and computes an equivalent instance (I ′ , k ′ ) of P such that |I ′ | 6 h(k) for some computable function h and k ′ 6 k. The instance (I ′ , k ′ ) is called a kernel in this case. If the function h is polynomial, we say that (I ′ , k ′ ) is a polynomial kernel. It is well known that a problem is in FPT iff it has a kernel, but this equivalence yields super-polynomial kernels (in general). To design efficient parameterized algorithms, a kernel of polynomial (or even linear) size in k is important. However, some lower bounds on the size of the kernel can be shown unless some polynomial hierarchy collapses. To show this result, we will use the cross composition technique developed by Bodlaender et al. [7]. Definition 1 (Polynomial equivalence relation [7]). An equivalence relation R on Σ∗ is said to be polynomial if the following two conditions hold: (i) There is an algorithm that given two strings x, y ∈ Σ∗ decides whether x and y belong to the same equivalence class in time (|x| + |y|)O(1) . (ii) For any finite set S ⊆ Σ∗ the equivalence relation R partitions the elements of S into at most (maxx∈S |x|)O(1) classes. Definition 2 (OR-cross-composition [7]). Let L ⊆ Σ∗ be a set and let Q ⊆ Σ∗ × N be a parameterized problem. We say that L cross-composes into Q if there is a polynomial equivalence relation R and an algorithm which, given t strings x1 , x2 , . . . , xt belonging P to the same equivalence t class of R, computes an instance (x∗ , k ∗ ) ∈ Σ∗ × N in time polynomial in i=1 |xi | such that: (i) (x∗ , k ∗ ) ∈ Q ⇔ xi ∈ L for some 1 6 i 6 t. (ii) k ∗ is bounded by a polynomial in maxti=1 |xi |+log t. Proposition 3 ([7]). Let L ⊆ Σ∗ be a set which is NP-hard under Karp reductions. If L cross-composes into the parameterized problem Q, then Q has no polynomial kernel unless NP ⊆ coNP/poly. The Exponential Time Hypothesis (ETH) is a conjecture by Impagliazzo et al. asserting that there is no 2o(n) -time algorithm for 3-SAT on instances with n variables [20]. The ETH, together with the sparsification lemma [20], even implies that there is no 2o(n+m) -time algorithm solving 3-SAT. Many algorithmic lower bounds have been proved under the ETH, see for example [22]. We say that a parameterized problem is fixed-parameter enumerable if all feasible solutions can be enumerated in O(f (k)|I|c ) time, where f is a computable function of the parameter k only, and c is a constant. 3 3 Parameterized Complexity with respect to the natural parameter We study the parameterized complexity of Induced Subgraph Isomorphism, Maximum Common Induced Subgraph, Induced Connected Subgraph Isomorphism, and Maximum Common Connected Induced Subgraph with respect to the natural parameter. We will in particular study these problems in graphs of bounded degeneracy, chordal graphs, and graphs of large girth. Theorem 4. MCIS, MCCIS, ISI, and ICSI are W[1]-complete. Proof. Since those problems are W[1]-hard by a straightforward reduction from k-Clique, it suffices to show membership in W[1]. In [9], it is shown that if a problem can be reduced in FPT time to simulating a non-deterministic single-taped Turing machine halting in at most f (k) steps, for some function f , then it is in W[1]. The Turing machine can have an alphabet and a set of states of size depending on the size of the input of the initial problem. In our case, we can design a Turing machine that guesses in 2k steps the corresponding right k vertices in G1 (for I(C)SI this part is not necessary) and the right k vertices in G2 (our alphabet being isomorphic to an indexing of V (G1 ) ∪ V (G2 )) and then check in time O(k 2 ) whether the two induced subgraphs are isomorphic (and that they are connected for ICSI and MCCIS). In [26] it was shown that Maximum Induced Matching1 is W[1]-hard on bipartite graphs. This implies that MCIS is W[1]-hard on bipartite graphs. In fact, we show that MCIS remains W[1]-hard on more restricted graph classes, namely C4 -free bipartite graphs with degeneracy 2. In particular, those graphs have girth at least 6. This result tells us two things about MC(C)IS. The first is that the fixed-parameter algorithm of Cai et al. [8, Theorem 1] cannot be extended from bounded degree to bounded degeneracy (note that some W-hard problems on general graphs become FPT on graphs with bounded degeneracy, such as the W[2]-complete Dominating Set problem [5]). The second is that short cycles are not making MC(C)IS W[1]-hard; they are W[1]hard even without them. In [28], the authors present fixed-parameter algorithms on graphs of girth 5, for some problems which are W-hard on general graphs. MCIS and MCCIS are also resistant to this approach. Theorem 5. Induced Subgraph Isomorphism and Induced Connected Subgraph Isomorphism are W[1]-complete even when both graphs are C4 -free bipartite graphs with degeneracy at most 2. Proof. The incidence graph I(G) of any graph G = (V, E), obtained by subdividing each edge of G once, has degeneracy 2. Indeed, graph I(G) is the bipartite graph (V ⊎ E, F ) where the edges of F are all the ue for which u ∈ V , e ∈ E, and u is an endpoint of e. All the vertices e ∈ E of I(G) have degree 2. Therefore, they can be removed first. Then, what is left in I(G) is the independent set V . We transform any input G = (V, E), k > 3 of k-Clique, into the instance I(Kk ), I(G) of I(C)SI, where both graphs have degeneracy 2. The problem consists of finding the incidence graph of a k-clique within the incidence graph of G. We show that it is equivalent to finding a k-clique in G. Obviously, if there is a k-clique S in G, then the graph I(G)[S ∪ E(S)] is isomorphic to I(Kk ). Now, let us assume that I(Kk ) is isomorphic to an induced subgraph of I(G). We denote by a1 , . . . , ak the vertices of I(Kk ) with degree k − 1, and by b1 , . . . , b(k) the vertices of 2 I(Kk ) with degree 2. We denote by ψ : V (I(Kk )) → V (I(G)) the isomorphism from graph I(Kk ) to an induced subgraph of I(G). Let ui = ψ(ai ) for each i ∈ [k], and vj = ψ(bj ) for each j ∈ [ k2 ]. We set S = {u1 , . . . , uk , v1 , . . . , v(k) }. For every i ∈ [k], ui ∈ V since the degree of ai in I(Kk ) is 2  k − 1 > 2 (hence, the degree of ui in S is also k − 1 > 2). Now, for every j ∈ [ k2 ], vj ∈ E since 1 where one looks for a largest subset of vertices that induce a disjoint union of edges 4 vj has two neighbors in V (recall that I(G) is bipartite). Therefore, u1 , . . . , uk are k vertices in V  inducing precisely k2 edges. Hence, {u1 , . . . , uk } is a k-clique in G. Membership in W[1] comes from Theorem 4. Corollary 6. Maximum Common Induced Subgraph and Maximum Common Connected Induced Subgraph remain W[1]-complete on bipartite graphs of girth 6 and degeneracy 2. The absence of triangles and cycles of length four in the input graphs does not make the problems tractable. We show that the absence of a long induced cycle does not help either (in [6], the authors show that the W[2]-hard problem Dominator Coloring is in FPT when the input graph is chordal). More specifically, all four problems are W[1]-hard on chordal graphs. In fact, we can even show that these problems remain W[1]-hard on a proper subclass of chordal graphs called split graphs. A split graph is a graph whose vertex set can be partitioned into a set inducing a clique and an independent set. Theorem 7. ISI (hence MCIS) and ICSI (hence MCCIS) remain W[1]-hard on split graphs. Proof. Similarly to the previous construction, we define I ′ (G) as the graph (V ⊎ E, F ) where the edges of F are the edges ue for which u ∈ V , e ∈ E, and u is an endpoint of e, plus all the edges uv with u, v ∈ V . The graph I ′ (G) is split: V induces a clique in I ′ (G) and E induces an independent set. From an instance G of k-Clique with k > 3, we build the equivalent instance I ′ (Kk ), I ′ (G) of MC(C)IS and I(C)SI. The soundness can be obtained in the same way as in the previous proof. Let us now say some words about the complexity of the connected version. First we note that MCIS is NP-hard on forests while MCCIS is solvable in polynomial-time in this case: given two forests G1 and G2 , run the polynomial-time MCIS algorithm of Akutsu on every pair of trees from G1 and G2 [3]. From the parameterized complexity standpoint, Maximum Common Connected Induced Subgraph is FPT whenever Induced Subgraph Isomorphism is FPT 2 since the enumeration of all O(2k ) possible induced connected subgraphs can be used as described in the introduction. The converse is true on classes of graphs which are closed by adding a universal vertex (i.e., a vertex linked to all the other vertices). An instance (G1 , G2 , k) of ISI can be reduced to an equivalent instance (G′1 , G′2 , k + 1) of MCCIS by letting G′i be the graph obtained by adding a vertex to Gi that is made adjacent to all other vertices of Gi . 4 Structural parameterization Let us first recall that tw(G) 6 fvs(G) + 1 6 vc(G) + 1, where tw(G) (resp. fvs(G), vc(G)) represents the treewidth (resp. the feedback vertex set number, the vertex cover number) of G [14]. As noted before, if the parameter is the combination of tw(G1 ) and tw(G2 ) then MCIS is known to be W[1]-hard. Even more, if the parameter is the combination of fvs(G1 ) and fvs(G2 ) (which is bigger than the combination of the treewidth), then the problem is not even in XP since Maximum Common Induced Subgraph and Induced Subgraph Isomorphism are NP-hard on disjoint union of chordless paths, a case where the parameter is equal to 0 [11, 16]. Theorem 8 ([11, 16]). Maximum Common Induced Subgraph is paraNP-hard when parameterized by fvs(G1 ) + fvs(G2 ) (and hence by tw(G1 ) + tw(G2 )). One can extend this result to make it valid for the connected version. Theorem 9. Induced Connected Subgraph Isomorphism, and as a corollary Maximum Common Connected Induced Subgraph, are paraNP-hard when parameterized by fvs(G1 ) + fvs(G2 ). Proof. Given an instance of Induced Subgraph Isomorphism on forests G1 and G2 (each with at least 2 trees), we build an instance of Induced Connected Subgraph Isomorphism by 5 adding a universal vertex (connected to every node) in G1 and in G2 . Both graph have thus a feedback vertex set of value one. One can see that these two universal vertices must be matched together since they are the only ones with sufficiently high degree. Then, there is a solution for Induced Subgraph Isomorphism iff there is a solution for Induced Connected Subgraph Isomorphism. The result of course holds for MCCIS, too. It was shown in [1] that MCIS is in FPT if the parameter is the combination of vc(G1 ) and vc(G2 ). Accordingly, the problem has a kernel, but no polynomial bound is known on its size. We show that, in this case, the kernel cannot be polynomial unless NP ⊆ coNP/poly. Theorem 10. Unless NP ⊆ coNP/poly, Maximum Common Induced Subgraph has no polynomial kernel when parameterized by the sum of the sizes of vertex covers in the two input graphs. Proof. We will define an OR-cross-composition from the NP-complete Clique, problem, where the given instance is a tuple (Gc , l) and the question is whether the graph Gc contains a clique on l vertices. Given t instances, (Gc1 , l1 ), (Gc2 , l2 ), . . . , (Gct , lt ), of Clique, where Gci is a graph and li ∈ N, ∀1 6 i 6 t, we define our equivalence relation R such that any strings that are not encoding valid instances are equivalent, and (Gci , li ), (Gcj , lj ) are equivalent iff |V (Gci )| = |V (Gcj )|, and li = lj . Hereafter, we assume that V (Gci ) = {1, . . . , n} and li = l, for any 1 6 i 6 t. We will build an instance of Maximum Common Induced Subgraph parameterized by the vertex cover (G1 , G2 , l′ , Z) where G1 and G2 are two graphs, l′ ∈ N and Z ⊆ V (G2 ) is a vertex cover of G2 computed in fpt-time, such that there is a solution of size l′ for Maximum Common Induced Subgraph iff there is an i, 1 6 i 6 t such that there is a solution of size l in Gci . We will now describe how to build G1 and G2 . To build G2 (see also Figure 1): • V (G2 ) = {p, q, r} ∪ {ai | 1 6 i 6 t} ∪ {euv | 1 6 u < v 6 n} ∪ {xi | 1 6 i 6 n}, • E(G2 )1 = {pq, pr, qr}, • E(G2 )2 = {rai | 1 6 i 6 t}, • E(G2 )3 = {ai euv | uv ∈ E(Gci )}, • E(G2 )4 = {euv xu , euv xv | ∀1 6 u < v 6 n}, • E(G2 ) = E(G2 )1 ∪ E(G2 )2 ∪ E(G2 )3 ∪ E(G2 )4 . p q r a1 ... a2 at ai euv ∈ E(G2 ) ⇔ uv ∈ E(Gci ) e1,2 e1,3 ... e1,n e2,3 . . . en−1,n euv vu , euv vv ∈ E(G2 ), ∀1 6 u < v 6 n x1 ... x2 xn Figure 1: Illustration of the construction of G2 . To build G1 (see also Figure 2): 6 l 2  } ∪ {xi | 1 6 i 6 l}, • V (G1 ) = {p, q, r, a} ∪ {ei | 1 6 i 6 • E(G1 )1 = {pq, pr, qr, ra}, • E(G1 )2 = {aei | 1 6 i 6 l 2  }, • E(G1 )3 = {ei xu , ei xv | ∀1 6 i 6 l 2  , ei = uv}, • E(G1 ) = E(G1 )1 ∪ E(G1 )2 ∪ E(G1 )3 . p q r a e1 ... e2 e( l ) ei vu , ei vv ∈ E(G1 ), ∀1 6 i 6 x1 ... x2 2 l 2  , ei = uv xl Figure 2: Illustration of the construction of G1 . We set l′ = |V (G1 )|, and Z = {p, r} ∪ {euv |1 6 u < v 6 n}. It is easy to see that Z is indeed + 2, which is polynomial in n and hence a vertex cover for G2 and that its size is equal to n(n−1) 2 in the size of the largest instance. Note that the size of the graph G1 does not depend on t and is polynomial in n, so the size of its vertex cover is also polynomial in n and independent of t. Let us show that G1 is an induced subgraph of G2 iff at least one of the Gci ’s has a clique of size l. (⇐) Suppose that Gci has a clique of size l. We denote by S ⊆ V (Gci ) a clique of size exactly l in Gci . We show that there is an induced subgraph S ′ of G2 of size l′ , isomorphic to G1 . We set V (S ′ ) = {p, q, r} ∪ {ai } ∪ {euv | ∀uv ∈ E(S)} ∪ {xu |u ∈ S}. One can easily check that this subgraph is isomorphic to G1 . (⇒) Assume now that G1 is an induced subgraph of G2 . Denote by S ′ the subgraph of G2 isomorphic to G1 . Note that the only triangle in G2 is pqr. Indeed, T (V (G2 ) \ {p}) is bipartite. The triangle pqr in G1 has therefore to match pqr in G2 . Moreover, r in G1 has to match r in G2 since p and q have no edges besides the clique pqr. The vertex a in G1 can only match a vertex ai for some i ∈ {1, . . . , t}. Then, e1 up to e( l ) in G1 has to match 2l vertices in {euv | 2 1 6 u < v 6 n} of G2 which correspond to actual edges in Gci . Finally, x1 up to xl in G1 has to match l vertices among the xj ’s in G2 . Note that the number of edges in E(G1 )3 between the  ej ’s and the xj ’s is exactly 2 2l = l(l − 1). More precisely, each ej touches 2 edges in E(G1 )3 and  each xj touches l − 1 edges in E(G1 )3 . In order to get a match in G2 , one should find a set of 2l edges inducing exactly l vertices. So, this set of l vertices is a clique in Gci . Note that the parameter of MCIS in the previous reduction is exactly the size of G1 and the graphs used in the proof are connected. Therefore, we have the following: Corollary 11. Induced Subgraph Isomorphism and Maximum Common Connected Induced Subgraph, parameterized by a bound on the minimum vertex covers of input graphs, do not have a polynomial-size kernel unless NP ⊆ coNP/poly. The algorithm of [1] is not single-exponential for parameter sum of the vertex cover numbers. In fact, we show that a single-exponential algorithm is very unlikely. This is, to the best of our knowledge, the first result of this type for parameter vertex cover. 7 Theorem 12. Under the ETH, IS(C)I cannot be solved in time 2o(k log k) when parameter k is the sum of the vertex cover number of both graphs. Proof. We give a reduction from k×k Permutation Clique which linearly preserves the parameter k. It is known that this problem does not admit an algorithm with running time 2o(k log k) unless the ETH fails [23]. In the k × k Permutation Clique problem, one is given a graph over the set of vertices [k]×[k] and the goal is to find a clique of size k such that in each row and in each column exactly one vertex is part of the clique, where a row is the set of vertices {(i, 1), (i, 2), . . . , (i, k)} for some i ∈ [k], and a column is the set of vertices {(1, j), (2, j), . . . , (k, j)} for some j ∈ [k]. We first describe how the graph G2 is built from any instance G = ([k] × [k], E) of k × k Permutation Clique. For each row (resp. column) index i ∈ [k], we add two vertices ri1 and ri2 (resp. c1i and c2i ) that we link by an edge. For j ∈ [2], we set Rj = {r1j , r2j , . . . , rkj } (resp. Cj = {cj1 , cj2 , . . . , cjk }) and R = R1 ∪ R2 (resp. C = C1 ∪ C2 ). Then, to distinguish row indices from column indices, we add a clique Dr of size 6, and we link one designated vertex r of Dr to all the vertices in R. We also add a clique D of size 5 with a special vertex v in D such that v is linked to all the vertices in R1 ∪ C1 . Finally, for each edge e = (i, j)(i′ , j ′ ) of G with i 6= i′ and j 6= j ′ 2 , we add a vertex v(e, 1) that we link to the four vertices ri1 , c1j , ri2′ , and c2j ′ , and a vertex v(e, 2) that we link to the four vertices ri2 , c2j , ri1′ , and c1j ′ . This ends the construction of G2 (see Figure 3). The pattern G1 depends only on k and is defined as the graph one obtains following the above construction when G have all the edges of the form (i, i)(i′ , i′ ) and no other edges (in other words, G has a k-clique on the diagonal and nothing else). Both G1 and G2 haveR∪C∪Dr ∪D as a vertex cover of size 4k+11. G2 has |E|+4k+11 = O(k 4 ) vertices and G1 has 2 k2 + 4k + 11 = O(k 2 ) vertices. To avoid confusion about vertices in G1 and G2 we will denote the vertices and sets of vertices of G1 with a tilde. We now show that the reduction is valid. Suppose there is a solution {(a1 , b1 ), . . . , (ak , bk )} to the instance of k × k Permutation Clique. Then, G1 is an induced subgraph of G2 with the following mapping. We map r̃ to r and ṽ to v. We map D̃r \ {r̃} to Dr \ {r} and D̃ \ {ṽ} to D \ {v} in an arbitrary way. Then, for each i ∈ [k] and j ∈ [2], we map r̃ij to raj i and c̃ji to rbji . We observe that this mapping is one-to-one since (a1 , b1 ), . . . , (ak , bk ) is a permutation clique, i.e., {a1 , a2 , . . . , ak } = [k] = {b1 , b2 , . . . , bk }. Finally, for any j ∈ [2], and any i 6= i′ ∈ [k] we map ṽ(e, j) to v((ai , bi )(ai′ , bi′ ), j). Note that vertex v((ai , bi )(ai′ , bi′ ), j) always exists precisely because {(a1 , b1 ), . . . , (ak , bk )} is a clique. Conversely, if there is a solution to the IS(C)I instance, we will show that there is a permutation k-clique in G. There is only one clique of size 6 in G2 , so the clique D̃r of size 6 has to be mapped to Dr . Then, r̃, as the unique vertex of D̃r of degree larger than 5, should be mapped to r. Now, for the same reasons, D̃ should be mapped to D and ṽ to v. Vertices of R̃1 ∪ C˜1 are the only 2k unmatched vertices having ṽ as a neighbor, so those vertices should be matched to the only 2k unmatched vertices having v as a neighbor, namely R1 ∪ C1 . For similar reasons, R̃ should be mapped to R. Now, R̃2 ∪ C˜2 can only be mapped to R2 ∪ C2 as the only unmatched vertices having exactly one neighbor in R̃1 ∪ C˜1 (R1 ∪ C1 ). Thus, the 4k vertices of R̃∪ C̃ can only be mapped to R∪C, such that for j ∈ [2], R̃j is mapped to Rj and C̃j is mapped to Cj . The edges r̃i1 r̃i2 and ri1 ri2 (resp. c̃1i c̃2i and c11 c2i ) further constrains the mapping: if r̃i1 is mapped to ri1′ then r̃i2 has to be mapped to ri2′ (resp. if c̃1i is mapped to c1i′ then c̃2i has to be mapped to c2i′ ). Hence, we can see the mapping from R̃ ∪ C̃ to R ∪ C as two permutations σr and σc on k elements, such that for j ∈ [2], for i ∈ [k], r̃ij is mapped to rσj r (i) and c̃ji is mapped to cjσc (i) . Then, the current partial mapping can be extended to a solution only if {(σr (1), σc (1)), . . . , (σr (k), σc (k))} is a clique in G. Indeed, ∀j ∈ [2], ∀i 6= i′ ∈ [k], ṽ((i, i)(i′ , i′ ), j) can only be mapped to a potential v((σr (i), σc (i))(σr (i′ ), σc (i′ )), j) so that vertex has to exist, meaning that there should be an edge in G between (σr (i), σc (i)) and (σr (i′ ), σc (i′ )). An algorithm solving IS(C)I in time poly(|G1 |, |G2 |)2o(k log k) with k := vc(G1 ) + vc(G2 ) would therefore translate into an algorithm running in time 2o(k log k) for k × k Permutation Clique 2 We ignore the other edges since they are not relevant in finding a permutation clique. 8 r42 v(e1 , 1) v(e1 , 2) r32 R2 r22 v(e2 , 1) v(e2 , 2) r12 r R r41 Dr r31 R1 r21 r11 c11 c12 C1 c13 c14 C c21 c22 C2 c23 c24 v D Figure 3: The overall construction of G2 . We represented only two edges of G: e1 = (2, 1)(3, 2) and e2 = (3, 1)(4, 3). For the sake of readability, the edges encoding e1 are enhanced to distinguish them easily from the edges encoding e2 . 9 and contradict the ETH. Despite the fact that ISI and MCIS have the same parameterized complexity with respect to the natural parameter, they exhibit different behaviors when considering structural parameters. In fact, the latter is paraNP-hard when parameterized by the vertex cover of only one of the two graphs, whereas ISI is FPT when parameterized by the vertex cover of the second (host) graph. To see this, note that when the host graph has a vertex cover of size k, the minimum size of a vertex cover in the pattern graph must be bounded by the parameter k; otherwise we have a NO-instance. The claim follows from the fixed-parameter tractability of MCIS in this case [1]. Given the negative result of Theorem 9, the next question we pose is whether MCCIS is in FPT with respect to the size of a minimum vertex cover. In [1], a parameterized algorithm is presented for MCIS when the parameter is a bound on the minimum vertex cover number of the input graphs. However, that algorithm cannot help us much for solving MCCIS since it relies on the existence of a feasible solution of size at least ≈ n − k which consists of mapping the two big independent sets of the two graphs onto each other. Of course, this is not a feasible solution for MCCIS. In the following we prove that MCCIS is fixed-parameter tractable w.r.t. k := vc(G1 ) + vc(G2 ). Theorem 13. Maximum Common Connected Induced Subgraph parameterized by k := vc(G1 ) + vc(G2 ) is fixed-parameter tractable. Proof. In time O∗ (2k ) (even O∗ (1.2738k ) [10]), we can find minimum vertex covers C1 and C2 in G1 and G2 respectively. Let I (j) be the independent set V (Gj ) \ Cj for j ∈ {1, 2}. By assumption, our parameter k is max(C1 , C2 ), so we can enumerate all tripartitions of C1 and C2 in time O∗ (9k ). We denote by C1,m , C1,u and C1,i (respectively C2,m , C2,u and C2,i ) the three sets of a tripartition of C1 (respectively C2 ). For j ∈ {1, 2}, Cj,u corresponds to the vertices of Cj that are not matched, so they may be deleted. Cj,m comprises the vertices matched to C3−j,m (that is, to the vertex cover of the other graph), and Cj,i are the vertices matched to I (3−j) , the independent set of the other graph. See Figure 4. We observe that for j ∈ {1, 2}, I (j) can be partitioned into at most 2k classes of twins: (j) (j) (j) I1 , I2 , . . . I2k . A class of twins in this context is a set of vertices with an identical neighborhood in the vertex cover and there are at most 2k subsets of Cj . Potentially, some classes can be empty: they correspond to a subset of the vertex cover Cj that is not the (exact) neighborhood of any vertex in I (j) . At this point, we can enumerate the mappings between C1,m and C2,m in time O∗ (k k ) and 2 the mappings between Cj,i and I (3−j) in time O∗ ((2k )k ) = O∗ (2k ). Indeed, to match a vertex u 2 with a vertex v or a twin of v is equivalent. Thus, in time O∗ ((9k)k 2k ) we can enumerate all the (1) solutions of MCIS where only vertices of I could still be matched to vertices of I (2) . The optimal map of the independent sets can be done in polynomial time by matching the greatest number of vertices in each equivalent twin class (which is the size of the smaller of the two equivalent twin (j) (3−j) classes), where a twin class Ir in I (j) is equivalent to a twin class Is in I (3−j) if the vertices (j) (3−j) of N (Ir ) \ Cj,u and N (Is ) \ C3−j,u are in one-to-one correspondence. To find a solution for MCCIS, the algorithm described in the above proof enumerates all 2 possible maximal common induced subgraphs in time O∗ ((9k)k 2k ). The current bottleneck to improve it is when we try to match vertices of the vertex cover with vertices of the independent set. For the not connected version of the problem, a trivial argument can bound the size of the independent set (if this one is big, there is a trivial solution), which cannot be used for the connected version. As such, it can be used as an enumeration algorithm for MCIS. Corollary 14. Maximum Common Induced Subgraph parameterized by k := vc(G1 ) + vc(G2 ) is fixed-parameter enumerable. Let us finish this section with some general considerations. Note that for ISI, the parameter vc + fvs is not the same as fvs + vc. In the latter, the parameter is a bound on the vertex cover of 10 I (1) = G1 [V1 \ C1 ] C1 (1) I1 ... (1) I2k (2) I1 ... C1,i C1,m C1,u C2,i C2,m C2,u G1 G2 (2) I2k I (2) = G2 [V2 \ C2 ] C2 Figure 4: Illustration of the proof of Theorem 13. Dashed boxes represent the classes inside the independent set. Arrows represent the matching between sets of vertices. Sets C1 (resp. C2 ) represents a vertex cover for G1 (resp. G2 ). G2 (as well as the feedback vertex set of G1 ) which makes ISI in FPT, while it remains open for vc+fvs. We also note that ISI is not in XP w.r.t. vc(G1 ) by a simple reduction from Independent Set: let G2 be an edgeless graph on k vertices, then its vertex cover number is 0. We now turn our attention to the case where MCIS is parameterized by a combination of the natural parameter and some structural parameter. We note that, in general, such parameterization reduces the problem’s complexity. This is most often due to the fixed-parameter tractability of MCIS in H-minor free graphs (again, since ISI is FPT in this case [15]). For example, consider the case where the parameter is the sum of some bound t on the feedback vertex set of the input graphs and the natural parameter k. The problem is FPT in this case since graphs of t-feedback vertex set are H-minor free where H is the “fixed” graph consisting of a disjoint union of t + 1 triangles. The same applies to parameterization by treewidth and the natural parameter by considering H to be the complete graph on t + 2 vertices, for example. 5 Conclusion We studied the Maximum Common Induced Subgraph and Maximum Common Connected Induced Subgraph problems with respect to the solution size on special graph classes such as forests, bipartite graphs, bounded degree graphs, bounded degeneracy graphs, graphs without small (length 3 or 4) cycles. The two problems are fixed-parameter tractable on H-minor free graphs, which include forests, and bounded degree graphs, but they are W[1]-complete on bipartite graphs of girth 6 and degeneracy 2. This ruled out at the same time two approaches to get fixedparameter algorithms on subclasses of graphs for W-hard problems. We then considered the use of structural parameters, such as a bound on the minimum vertex covers of the input graphs. Although both MCIS and MCCIS are in FPT in this case, we proved that no kernel of polynomial bound can be obtained unless NP ⊆ coNP/poly and that they cannot be solved in time 2o(k log k) under the ETH. We noted that MCIS is not even in XP with respect to other (smaller) auxiliary parameters, such as treewidth and feedback vertex set. A few open problems remain to be addressed. For example, is MCIS/MCCIS in FPT when parameterized by the combination of the vertex cover number and the feedback vertex set number, or by the vertex cover number and the treewidth? Moreover, it would be interesting to know whether the algorithm for MCCIS of Theorem 13 can be improved to match the lower bound. 11 References [1] F. N. Abu-Khzam. Maximum common induced subgraph parameterized by vertex cover. Inf. Process. Lett., 114(3):99–103, 2014. [2] F. N. Abu-Khzam, E. Bonnet, and F. Sikora. On the complexity of various parameterizations of common induced subgraph isomorphism. In J. Kratochvı́l, M. Miller, and D. Froncek, editors, Combinatorial Algorithms - 25th International Workshop, IWOCA 2014, volume 8986 of LNCS, pages 1–12. Springer, 2014. [3] T. Akutsu. An RNC algorithm for finding a largest common subtree of two trees. IEICE Transactions on Information and Systems, 75(1):95–101, 1992. [4] T. Akutsu. A polynomial time algorithm for finding a largest common subgraph of almost trees of bounded degree. IEICE Transactions on Fundamentals of Electronics, Communications and Computer Sciences, 76(9):1488–1493, 1993. [5] N. Alon and S. Gutner. Linear time algorithms for finding a dominating set of fixed size in degenerated graphs. Algorithmica, 54(4):544–556, 2009. [6] S. Arumugam, K. R. Chandrasekar, N. Misra, G. Philip, and S. Saurabh. Algorithmic aspects of dominator colorings in graphs. In C. S. Iliopoulos and W. F. Smyth, editors, Combinatorial Algorithms - 22nd International Workshop, IWOCA, volume 7056 of LNCS, pages 19–30. Springer, 2011. [7] H. L. Bodlaender, B. M. P. Jansen, and S. Kratsch. Kernelization lower bounds by crosscomposition. SIAM J. Discrete Math., 28(1):277–305, 2014. [8] L. Cai, S. M. Chan, and S. O. Chan. Random Separation: A New Method for Solving FixedCardinality Optimization Problems. In H. L. Bodlaender and M. A. Langston, editors, 2nd International Workshop Parameterized and Exact Computation (IWPEC 2006), volume 4169 of LNCS, pages 239–250. Springer, 2006. [9] M. Cesati. The turing way to parameterized complexity. J. Comput. Syst. Sci., 67(4):654–685, 2003. [10] J. Chen, I. A. Kanj, and G. Xia. Improved upper bounds for vertex cover. Theor. Comput. Sci., 411(40-42):3736–3756, Sept. 2010. [11] P. Damaschke. Induced subgraph isomorphism for cographs is np-complete. In Proc. Workshop on Graph Theoretic Concepts in Computer Science, volume 484 of LNCS, pages 72–78. Springer, 1991. [12] R. G. Downey and M. R. Fellows. Fundamentals of Parameterized Complexity. Texts in Computer Science. Springer, 2013. [13] M. R. Fellows, B. M. P. Jansen, and F. A. Rosamond. Towards fully multivariate algorithmics: Parameter ecology and the deconstruction of computational complexity. Eur. J. Comb., 34(3):541–566, 2013. [14] M. R. Fellows, B. M. P. Jansen, and F. A. Rosamond. Towards fully multivariate algorithmics: Parameter ecology and the deconstruction of computational complexity. Eur. J. Comb., 34(3):541–566, 2013. [15] J. Flum and M. Grohe. Fixed-parameter tractability, definability, and model-checking. SIAM Journal on Computing, 31(1):113–145, 2001. [16] M. R. Garey and D. S. Johnson. Computers and Intractability: A guide to the theory of NP-completeness. W.H. Freeman, San Francisco, 1979. 12 [17] H. M. Grindley, P. J. Artymiuk, D. W. Rice, and P. Willett. Identification of tertiary structure resemblance in proteins using a maximal common subgraph isomorphism algorithm. Journal of Molecular Biology, 229(3):707–721, 1993. [18] M. Grohe, S. Kreutzer, and S. Siebertz. Deciding first-order properties of nowhere dense graphs. In D. B. Shmoys, editor, Symposium on Theory of Computing, STOC 2014, pages 89–98. ACM, 2014. [19] P. Heggernes, P. van ’t Hof, D. Meister, and Y. Villanger. Induced subgraph isomorphism on proper interval and bipartite permutation graphs. Theoretical Computer Science, 562:252 – 269, 2015. [20] R. Impagliazzo, R. Paturi, and F. Zane. Which problems have strongly exponential complexity? Journal of Computer and System Sciences, 63(4):512–530, Dec. 2001. [21] I. Koch, T. Lengauer, and E. Wanke. An algorithm for finding maximal common subtopologies in a set of protein structures. J. of Comp. Biology, 3(2):289–306, 1996. [22] D. Lokshtanov, D. Marx, and S. Saurabh. Known algorithms on graphs of bounded treewidth are probably optimal. In Proc. 22nd Annual ACM-SIAM Symposium on Discrete Algorithms, SODA ’11, pages 777–789. SIAM, 2011. [23] D. Lokshtanov, D. Marx, and S. Saurabh. Slightly superexponential parameterized problems. In Proc. 22nd Annual ACM-SIAM Symposium on Discrete Algorithms, SODA ’11, pages 760–776. SIAM, 2011. [24] D. Marx and I. Schlotter. Cleaning interval graphs. Algorithmica, 65(2):275–316, 2013. [25] J. McGregor and P. Willett. Use of a maximal common subgraph algorithm in the automatic identification of the ostensible bond changes occurring in chemical reactions. J. of Chemical Information and Computer Science, 21:137–140, 1981. [26] H. Moser and S. Sikdar. The parameterized complexity of the induced matching problem. Discrete Applied Mathematics, 157(4):715–727, 2009. [27] R. Niedermeier. Invitation to Fixed Parameter Algorithms. Lecture Series in Mathematics and Its Applications. Oxford University Press, 2006. [28] V. Raman and S. Saurabh. Short cycles make W -hard problems hard: FPT algorithms for W -hard problems in graphs with no short cycles. Algorithmica, 52(2):203–225, 2008. [29] J. W. Raymond and P. Willett. Maximum common subgraph isomorphism algorithms for the matching of chemical structures. Journal of Computer-Aided Molecular Design, 16:521–533, 2002. [30] A. Yamaguchi, K. F. Aoki, and H. Mamitsuka. Finding the maximum common subgraph of a partial k-tree and a graph with a polynomially bounded number of spanning trees. Inf. Process. Lett., 92(2):57–63, 2004. 13
8cs.DS
PROC. OF THE 6th EUR. CONF. ON PYTHON IN SCIENCE (EUROSCIPY 2013) 3 Bloscpack: a compressed lightweight serialization format for numerical data Valentin Haenel∗† arXiv:1404.6383v2 [cs.MS] 29 Apr 2014 F Abstract—This paper introduces the Bloscpack file format and the accompanying Python reference implementation. Bloscpack is a lightweight, compressed binary file-format based on the Blosc codec and is designed for lightweight, fast serialization of numerical data. This article presents the features of the file-format and some some API aspects of the reference implementation, in particular the ability to handle Numpy ndarrays. Furthermore, in order to demonstrate its utility, the format is compared both feature- and performance-wise to a few alternative lightweight serialization solutions for Numpy ndarrays. The performance comparisons take the form of some comprehensive benchmarks over a range of different artificial datasets with varying size and complexity, the results of which are presented as the last section of this article. Index Terms—applied information theory, python, numpy, file format, serialization, blosc 1 compression/decompression, I NTRODUCTION When using compression during storage of numerical data there are two potential improvements one can make. First, by using compression, naturally one can save storage space. Secondly—and this is often overlooked—one can save time. When using compression during serialization, the total compression time is the sum of the time taken to perform the compression and the time taken to write the compressed data to the storage medium. Depending on the compression speed and the compression ratio, this sum maybe less than the time taken to serialize the data in uncompressed format i.e. writeuncompressed > writecompressed + timecompress The Bloscpack file format and Python reference implementation aims to achieve exactly this by leveraging the fast, multithreaded, blocking and shuffling Blosc codec. 2 B LOSC Blosc [Blosc] is a fast, multitreaded, blocking and shuffling compressor designed initially for in-memory compression. Contrary to many other available compressors which operate sequentially on a data buffer, Blosc uses the blocking technique [Alted2009], [Alted2010] to split the dataset into individual blocks. It can then operate on each block using a different thread which effectively leads to a multithreaded * Corresponding author: [email protected] † Independent Copyright © 2014 Valentin Haenel. This is an open-access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited. http://creativecommons.org/licenses/by/3.0/ compressor. The block size is chosen such that it either fits into a typical L1 cache (for compression levels up to 6) or L2 cache (for compression levels larger than 6). In modern CPUs L1 and L2 are typically non-shared between other cores, and so this choice of block size leads to an optimal performance during multi-thread operation. Also, Blosc features a shuffle filter [Alted2009] (p.71) which may reshuffle multi-byte elements, e.g. 8 byte doubles, by significance. The net result for series of numerical elements with little difference between elements that are close, is that similar bytes are placed closer together and can thus be better compressed (this is specially true on time series datasets). Internally, Blosc uses its own codec, blosclz, which is a derivative of FastLZ [FastLZ] and implements the LZ77 [LZ77] scheme. The reason for Blosc to introduce its own codec is mainly the desire for simplicity (blosclz is a highly streamlined version of FastLZ), as well as providing a better interaction with Blosc infrastructure. Moreover, Blosc is designed to be extensible, and allows other codecs than blosclz to be used in it. In other words, one can consider Blosc as a meta-compressor, in that it handles the splitting of the data into blocks, optionally applying the shuffle filter (or other future filters), while being responsible of coordinating the individual threads during operation. Blosc then relies on a "real" codec to perform that actual compression of the data blocks. As such, one can think of Blosc as a way to parallelize existing codecs, while allowing to apply filters (also called pre-conditioners). In fact, at the time when the research presented in this paper was conducted (Summer 2013), a proof-of-concept implementation existed to integrate the well known Snappy codec [Snappy] as well as LZ4 [LZ4] into the Blosc framework. As of January 2014 this proof of concept has matured and as of version 1.3.0 Blosc comes equipped with support for Snappy [Snappy], LZ4 [LZ4] and even Zlib [zlib]. Blosc was initially developed to support in-memory compression in order to mitigate the effects of the memory hierarchy [Jacob2009]. More specifically, to mitigate the effects of memory latency, i.e. the ever growing divide between the CPU speed and the memory access speed–which is also known as the problem of the starving CPUs [Alted2009]. The goal of in-memory compression techniques is to have a numerical container which keeps all data as in-memory compressed blocks. If the data needs to be operated on, it is decompressed only in the caches of the CPU. Hence, data 4 PROC. OF THE 6th EUR. CONF. ON PYTHON IN SCIENCE (EUROSCIPY 2013) can be moved faster from memory to CPU and the net result is faster computation, since less CPU cycles are wasted while waiting for data. Similar techniques are applied successfully in other settings. Imagine for example, one wishes to transfer binary files over the internet. In this case the transfer time can be significantly improved by compressing the data before transferring it and decompressing it after having received it. As a result the total compressed transfer time, which is taken to be the sum of the compression and decompression process and the time taken to transfer the compressed file, is less than the time taken to transfer the plain file. For example the well known UNIX tool rsync [rsync] implements a -z switch which performs compression of the data before sending it and decompression after receiving it. The same basic principle applies to in-memory compression, except that we are transferring data from memory to CPU. Initial implementations based on Blosc exist, c.f. Blaze [Blaze] and carray [CArray], and have been shown to yield favourable results [Personal communication with Francesc Alted]. 4.3 3 The Bloscpack format and reference implementation builds a serialization format around the Blosc codec. It is a simple chunked file-format well suited for the storage of numerical data. As described in the Bloscpack format description, the big-picture of the file-format is as follows: N UMPY The Numpy [VanDerWalt2011], [Numpy] ndarray is the de-facto multidimensional numerical container for scientific python applications. It is probably the most fundamental package of the scientific python ecosystem and widely used and relied upon by third-party libraries and applications. It consists of the N-dimensional array class, various different initialization routines and many different ways to operate on the data efficiently. 4 E XISTING L IGHTWEIGHT S OLUTIONS There are a number of other plain (uncompressed) and compressed lightweight serialization formats for Numpy arrays that we can compare Bloscpack to. We specifically ignore more heavyweight solutions, such as HDF5, in this comparison. • NPY • NPZ • ZFile 4.1 NPY NPY [NPY] is a simple plain serialization format for numpy. It is considered somewhat of a gold standard for the serialization. One of its advantages is that it is very, very lightweight. The format specification is simple and can easily be digested within an hour. In essence it simply contains the ndarray metadata and the serialized data block. The metadata amounts to the dtype, the order and the shape or the array. The main drawback is that it is a plain serialization format and does not support compression. 4.2 NPZ NPZ is, simply put, a Zip file which contains multiple NPY files. Since this is a Zip file it may be optionally compressed, however the main uses case is to store multiple ndarrays in a single file. Zip is an implementation of the DEFLATE [DEFLATE] algorithm. Unlike the other evaluated compressed formats, NPZ does not support a compression level setting. ZFile ZFile is the native serialization format that ships with the Joblib [Joblib] framework. Joblib is equipped with a caching mechanism that supports caching input and output arguments to functions and can thus avoid running heavy computations if the input has not changed. When serializing ndarrays with Joblib, a special subclass of the Pickler is used to store the metadata whereas the datablock is serialized as a ZFile. ZFile uses zlib [zlib] internally and simply runs zlib on the entire data buffer. zlib is also an implementation of the DEFLATE algorithm. One drawback of the current ZFile implementation is that no chunking scheme is employed. This means that the memory requirements might be twice that of the original input. Imagine trying to compress an incompressible buffer of 1GB: in this case the memory requirement would be 2GB, since the entire buffer must be copied in memory as part of the compression process before it can be written out to disk. 5 B LOSCPACK F ORMAT |-header-|-meta-|-offsets-| |-chunk-|-checksum-|-chunk-|-checksum-|...| The format contains a 32 byte header which contains various options and settings for the file, for example a magic string, the format version number and the total number of chunks. The meta section is of variable size and can contain any metadata that needs to be saved alongside the data. An optional offsets section is provided to allow for partial decompression of the file in the future. This is followed by a series of chunks, each of which is a blosc compressed buffer. Each chunk can be optionally followed by a checksum of the compressed data which can help to protect against silent data corruption. The chunked format was initially chosen to circumvent a 2GB limitation of the Blosc codec. In fact, the ZFile format suffers from this exact limitation since zlib—at least the Python bindings—is also limited to buffers of 2GB in size. The limitation stems from the fact that int32 are used internally by the algorithms to store the size of the buffer and the maximum value of an int32 is indeed 2GB. In any case, using a chunked scheme turned out to be useful in its own right. Using a modest chunk-size of e.g. 1MB (the current default) causes less stress on the memory subsystem. This also means that in contrast to ZFile, only a small fixed overhead equal to the chunk-size is required during the compression and decompression process, for example when compressing or decompression from/to an external storage medium. With version 3 the format was enhanced to allow appending data to an existing Bloscpack compressed file. This is achieved by over-allocating the offsets and metadata section with dummy values to allow chunks to be appended later and metadata to be enlarged. One caveat of this is that we can BLOSCPACK: A COMPRESSED LIGHTWEIGHT SERIALIZATION FORMAT FOR NUMERICAL DATA not pre-allocate an infinite amount of space and so only a limited amount of data can potentially be appended. However, to provide potential consumers of the format with as much flexibility as possible, the amount of space to be pre-allocated is configurable. For an in-depth discussion of the technical details of the Bloscpack format the interested reader is advised to consult the official documentation [Bloscpack]. This contains a full description of the header layout, the sizes of the entries and their permissible values. 6 C OMMAND L INE I NTERFACE Initially, Bloscpack was conceived as a command-line compression tool. At the time of writing, a Python API is in development and, in fact, the command-line interface is being used to drive and dog-food the Python API. Contrary to existing tools such as gzip [gzip], bloscpack doesn’t use command-line options to control its mode of operation, but instead uses the subcommand style. Here is a simple example: $ ./blpk compress data.dat $ ./blpk decompress data.dat.blp data.dcmp Another interesting subcommand is info which can be used to inspect the header and metadata of an existing file: $ ./blpk info data.dat.blp [...] The Bloscpack documentation contains extensive descriptions of the various options and many examples of how to use the command line API. 7 PACKING N UMPY A RRAYS As of version 0.4.0 Bloscpack comes with support for serializing Numpy ndarrays. The approach is simple and lightweight: the data buffer is saved in Blosc compressed chunks as defined by the Bloscpack format. The shape, dtype and order attributes—the same ones saved in the NPY format—are saved in the metadata section. Upon de-serialization, first an empty ndarray is allocated from the information in the three metadata attributes. Then, the Bloscpack chunks are decompressed directly into the pre-allocated array. The Bloscpack Python API for Numpy ndarray is very similar to the simple NPY interface; arrays can be serialized/deserialized using single function invocations. Here is an example of serializing a Numpy array to file: >>> >>> >>> >>> >>> >>> import numpy as np import bloscpack as bp a = np.linspace(0, 100, 2e8) bp.pack_ndarray_file(a, ’a.blp’) b = bp.unpack_ndarray_file(’a.blp’) assert (a == b).all() And here is an example of serializing it to a string: >>> >>> >>> >>> >>> >>> import numpy as np import bloscpack as bp a = np.linspace(0, 100, 2e8) b = bp.pack_ndarray_str(a) c = bp.unpack_ndarray_str(b) assert (a == c).all() 5 The compression parameters can be configured as keyword arguments to the pack functions (see the documentation for detail). 8 C OMPARISON TO NPY The [NPY] specification lists a number of requirements for the NPY format. To compare NPY and Bloscpack featurewise, let us look at the extent to which Bloscpack satisfies these requirements when dealing with Numpy ndarrays. 1. Represent all NumPy arrays including nested record arrays and object arrays. Since the support for Numpy ndarrays is very fresh only some empirical results using toy arrays have been tested. Simple integer, floating point types and string arrays seem to work fine. Structured arrays are also supported (as of 0.4.1), even those with nested data types. Finally, object arrays also seem to survive the round-trip tests. 2. Represent the data in its native binary form. Since Bloscpack will compress the data it is impossible to represent the data in its native binary form. 3. Be contained in a single file. Using the metadata section of the Bloscpack format all required metadata for decompressing a Numpy ndarray can be included alongside the compressed data. 4. Support Fortran-contiguous arrays directly. If an array has Fortran ordering we can save it in Fortran ordering in Bloscpack. The order is saved as part of the metadata and the contiguous memory block is saved as is. The order is set during decompression and hence the array is deserialized correctly. 5. Store all of the necessary information to reconstruct the array including shape and dtype on a machine of a different architecture [...] Endianness [...] Type. As mentioned above all integer types as well as string and object arrays are handled correctly and their shape is preserved. As for endianness, initial toy examples with large-endian dtypes pass the roundtrip test 6. Be reverse engineered. In this case reverse engineering refers to the ability to decode a Bloscpack compressed file after both the Bloscpack code and file-format specification have been lost. For NPY this can be achieved if one roughly knows what to look for, namely three metadata attributes and one plain data block. In the Bloscpack case, things are more difficult. First of all, the header does have a larger number of entries which must first be deciphered. Secondly the data is compressed and without knowledge of the compression scheme and implementation this will be very difficult to reverse engineer. 7. Allow memory-mapping of the data. 6 PROC. OF THE 6th EUR. CONF. ON PYTHON IN SCIENCE (EUROSCIPY 2013) Since the data is compressed it is not possible to use the mmap primitive to map the file into memory in a meaningful way. However, due to the chunkwise nature of the storage, it is theoretically possible to implement a quasi-mem-mapping scheme. Using the chunk offsets and the typesize and shape from the Numpy ndarray metadata, it will be possible to determine which chunk or chunks contain a single element or a range and thus load and decompress only those chunks from disk. 8. Be read from a file-like stream object instead of an actual file. This has been part of the Bloscpack code base since very early versions since it is essential for unit testing w/o touching the file system, e.g. by using a file-like StringIO object. In fact this is how the Numpy ndarray serialization/de-serialization to/from strings is implemented. 9. Be read and written using APIs provided in the numpy package. Bloscpack does not explicitly aspire to being part of Numpy. 9 9.2 Timing The timing algorithm used was a modified version of the timeit tool which included in the Python standard library. This supports deactivation of the Python interpreters garbage collector during the run and executing code before and after each run. For example, when measuring decompression speed without the Linux file system cache, one needs to clear this cache before each run and it is imperative that this operation does not enter into the timing. Also, when measuring compression speed, one needs to make sure sync is executed after the run, to ensure the data is actually written out to the storage medium. Contrary to clearing the file system cache, the time required by the sync operation must enter the timing to not contaminate the results. B ENCHMARKS The benchmarks were designed to compare the following three alternative serialization formats for Numpy ndarrays: NPY, NPZ and ZFile with Bloscpack. To this end, we measured compression speed, decompression speed, both with and without the Linux file system cache and compression ratio for a number of different experimental parameters. 9.1 then the minimum across all sets was taken as the final value for the datapoint. For the small size, 10 sets with 10 runs were performed. For the mid size, 5 sets with 5 runs were performed. And finally, for the large size, 3 sets with 3 runs each were performed. Parameters Three different array sizes were chosen: • small 1e4 8 = 80000 Bytes = 80KB • mid 1e7 8 = 80000000 Bytes = 80MB • large 2e8 * 8 = 1600000000 Bytes = 1.4 GB Three different dataset complexities were chosen: • low arange (very low Kolmogorov complexity* ) • medium sin + noise • high random numbers And lastly two different storage mediums were chosen: • ssd encrypted (LUKS) SSD • sd SD card The SD card was chosen to represent a class of very slow storage, not because we actually expect to serialize anything to an SD card in practice. To cut down on the number of data points we choose only to evaluate the compression levels 1, 3 and 7 for ZFile and 1, 3, 7 and 9 for Bloscpack. Although NPZ is a compressed format it does not support modifying the compression level. This results in using 1 + 1 + 3 + 4 = 9 different codec values. This configuration leads to 3 * 3 * 2 * 9 = 160 data points. Additionally to account for fluctuations, each datapoint was run multiple times depending on the size of the dataset. In each case of number of sets each with a number of runs were performed. Then, the mean across runs for each set and 9.3 Hardware The machine used was a Lenovo Carbon X1 ultrabook with an Intel Core i7-3667U Processor [CPU]. This processor has 2 physical cores with active hyperthreading resulting in 4 threads. The CPU scaling governor was set to performance which resulted in a CPU frequency of 2.0Ghz per core. The CPU has three levels of cache at: 32K, 256K and 4096k as reported by Linux sysfs. The memory bandwidth was reported to be 10G/s write and 6G/s read by the Blosc benchmarking tool. Interestingly this is in stark contrast to the reported maximum memory bandwidth of 25G/s which is advertised on the manufacturers data sheet. The operating system used was Debian Stable 7.1 with the following 64bit kernel installed from Debian Backports: 3.9-0.bpo.1-amd64 #1 SMP Debian 3.9.6-1~bpo70+1 x86_64 GNU/Linux. The IO bandwidth of the two storage media was benchmarked using dd : $ dd if=/dev/zero of=outputfile bs=512 count=32M $ dd if=outputfile of=/dev/null • • SSD: 230 MB/s write / 350 MB/sd read SD: 20 MB/sd read/write *. The inquisitive reader will note the following caveat at this stage. Perhaps Kolmogorov complexity is not the correct choice of complexity measure to define low entropy data for a Lempel-Ziv style dictionary encoder. In fact, any sequence of consecutive integers by definition has high LempelZiv complexity and is not compressible. However, as will be shown during the benchmarks later on, Bloscpack is actually very good at compressing these kinds of sequences, whereas ZFile and NPZ are not. This is a result of the fact that arange generated muti-byte type integer data and the shuffle filter for Bloscpack can optimize this very well. At this stage we simply state that the proposed low entropy dataset has been sufficient for the benchmarks. An in-depth treatment of the effects the shuffle filter has on the Lempel-Ziv complexity is beyond the scope of this paper and will perhaps be the subject of a future publication. BLOSCPACK: A COMPRESSED LIGHTWEIGHT SERIALIZATION FORMAT FOR NUMERICAL DATA 9.4 Disabled OS Defaults Additionally certain features of the operating system were disabled explicitly while running the benchmarks. These optimizations were chosen based on empirical observations while running initial benchmarks, observing suspicious behaviour and investigating possible causes. While there may be other operating system effects, the precautions listed next were found to have observably detrimental effects and disabling them lead to increased reliability of the results. First, the daily cronjobs were disabled by commenting out the corresponding line in /etc/crontab. This is important because when running the benchmarks over night, certain IO intensive cronjobs might contaminate the benchmarks. Secondly, the Laptop Mode Tools were disabled via a setting in /etc/laptop-mode/laptop-mode.conf. These tools will regulate certain resource settings, in particular disk write-back latency and CPU frequency scaling governor, when certain system aspects—e.g. the connectivity to AC power—change and again this might contaminate the benchmarks. 10 V ERSIONS U SED The following versions and git-hashes—where available—were used to acquire the data reported in this article: • benchmark-script: NA / 7562c6d • bloscpack: 0.4.0 / 6a984cc • joblib: 0.7.1 / 0cfdb88 • numpy: 1.7.1 / NA • conda: 1.8.1 / NA • python: ’Python 2.7.5 :: Anaconda 1.6.1 (64-bit)’ The benchmark-script and results files are available from the repository of the EuroScipy2013 talk about Bloscpack [Haenel2013]. The results file analysed are contained in the csv file results_1379809287.csv. 10.1 Bloscpack Settings In order to reduce the overhead when running Bloscpack some optional features have not be enabled during the benchmarks. In particular, no checksum is used on the compressed chunks and no offsets to the chunks are stored. 11 R ESULTS The results of the benchmark are presented in the figures 1, 2, 3, 4 and 5. Figures 1 to 4 show timing results and are each a collection of subplots where each subplot shows the timing results for a given combination of dataset size and entropy. The dataset size increases horizontally across subplots whereas the dataset entropy increases vertically across subplots. Figures 1 and 2 show results for the SSD storage type and figures 3 and four show results for the SD storage type. Figures 1 and 3 compare Bloscpack with NPY whereas figures 2 and 4 compare Bloscpack with NPZ and ZFile. NPY is shown separately from NPZ and ZFile since their performance characteristics are so different that they can not be adequately compared visually on the same plot. For all timing 7 plots black bars indicate compression time, white is used to denote decompression time w/o the file system cache and gray identifies decompression time with a hot file system cache. For all timing plots, larger values indicate worse performance. Lastly, figure 5 shows the compression ratios for all examined formats. In Fig. 1 we can see how Bloscpack compares to NPY on the SSD storage type. The first thing to note, is that for small datasets (first column of subplots), Bloscpack does not lag behind much compared to NPY for compression and is actually slightly faster for decompression. However the absolute differences here are in the millisecond range, so one might perhaps argue that Bloscpack and NPY are on par for small datasets. As soon as we move to the medium size datasets first gains can be seen. Especially for the low entropy case where Bloscpack beats NPY for both compression and decompression w/o file system cache. For the medium entropy case, Bloscpack is slightly faster for a few settings, at least for the compression and decompression cases. Surprisingly, for the decompression with a hot file system cache, Bloscpack is actually 2 times slower under the compression levels 7 and 9. One possibility for this might be that, even though the file contents are in memory, reading from the file necessitates an initial memory-to-memory copy, before the data can actually be decompressed. For the high entropy case, Bloscpack is mostly slightly slower than NPY. For the large dataset the results are simply a scaled version of the medium dataset size results and yield no additional insights. Fig. 2 shows the comparison between Bloscpack, NPZ and ZFile on the SSD storage type. In this comparison, the speed of the Blosc compressor really shines. For every combination of dataset size and entropy the is a compression level for Bloscpack that can compress faster than any of the competitors. In the extreme case of the large size and the low entropy, Bloscpack is over 300 times faster during compression than NPZ (302 seconds for NPZ vs. 0.446 seconds for Bloscpack). Even for the high entropy case, where very very little compression is possible due to the statistics of the dataset, Bloscpack is significantly faster during compression. This is presumably because Blosc will try to compress a buffer, finish very quickly because there is no work to be done and then it simply copies the input verbatim. One very surprising result here is that both NPZ and ZFile with level 7 take extraordinary amounts of time to compress the low entropy dataset. In fact they take the longest on the low entropy dataset compared to the medium and high entropies. Potentially this is related to the high Lempel-Ziv complexity of that dataset, as mentioned before. Recall that both NPZ and ZFile use the DEFLATE algorithm which belongs to the class of LZ77 dictionary encoders, so it may suffer since it no shuffle filter as in the case of Blosc is employed. Figures 3. and 4. show the same results as figures 1. and 2. respectively but but for the SD storage class. Since the SD card is much slower than the SSD card the task is strongly IO bound and therefore benefits of compression can be reaped earlier. For example, Bloscpack level 7 is twice as fast as NPY during compression on the medium size medium entropy dataset. For the low entropy dataset at medium and large sizes, Bloscpack 8 PROC. OF THE 6th EUR. CONF. ON PYTHON IN SCIENCE (EUROSCIPY 2013) is about an order of magnitude faster. For the high entropy dataset Bloscpack is on par with NPY because the overhead of trying to compress but not succeeding is negligible due to the IO boundedness resulting from the speed of the SD card. When comparing Bloscpack to NPZ and ZFile on the SD card, the IO boundedness means that any algorithm that can achieve a high compression ratio in a reasonable amount of time will perform better. For example for medium size and medium entropy, NPZ is actually 1.6 times faster than Bloscpack during compression. As in the SSD case, we observe that NPZ and ZFile perform very slowly on low entropy data. Lastly in Figure 5. we can see the compression ratios for each codec, size and entropy. This is mostly just a sanity check. NPY is always at 1, since it is a plain serialization format. Bloscpack gives better compression ratios for low entropy data. NPZ and ZFile give better compression ratios for the medium entropy data. And all serializers give a ratio close to zero for the high entropy dataset. 12 C ONCLUSION This article introduced the Bloscpack file-format and python reference implementation. The features of the file format were presented and compared to other serialization formats in the context of Numpy ndarrays. Benchmarking results are presented that show how Bloscpack can yield performance improvements for serializing Numpy arrays when compared to existing solutions under a variety of different circumstances. 13 F UTURE W ORK As for the results obtained so far, some open questions remain unsolved. First of all, it is not clear why Bloscpack at level 7 and 9 gives comparatively bad results when decompressing with a hot file system cache. Also the bad performance of ZFile and NPY on the so-called low entropy dataset must be investigated and perhaps an alternative can be found that is not biased towards Bloscpack. Additionally, some mathematical insights into the complexity reduction properties of Blosc’s shuffle filter would be most valuable. Lastly, more comprehensive benchmarks need to be run. This means, first finding non-artificial benchmark datasets and establishing a corpus to run Bloscpack and the other solutions on. Furthermore, It would be nice to run benchmarks on other architectures for machines with more than 2 physical cores, non-uniform memory access and an NFS file-system as commonly found in compute clusters. 14 G RATITUDE The author would like to thank the following people for advice, helpful comments and discussions: Pauli Virtanen, Gaël Varoquaux, Robert Kern and Philippe Gervais. Also, the author would like to specially thank Stéfan van der Walt and Francecs Alted for reviewing drafts of this paper. R EFERENCES [Alted2009] Francesc Alted. The Data Access Problem EuroScipy 2009 Keynote Presentation http://www.blosc.org/docs/ StarvingCPUs.pdf [Alted2010] Francesc Alted. Why modern CPUs are starving and what can be done about it, Computing in Science & Engineering, Vol. 12, No. 2. (March 2010), pp. 68-71 http://www.blosc.org/docs/StarvingCPUs-CISE-2010.pdf [DEFLATE] Peter. Deutsch DEFLATE Compressed Data Format Specification version 1.3 RFC1951 1996 http://tools.ietf.org/ html/rfc1951 [Haenel2013] Valentin Haenel. Introducing Bloscpack EuroScipy 2013 Presentation https://github.com/esc/ euroscipy2013-talk-bloscpack [Jacob2009] Bruce Jacob. The Memory System: You Can’t Avoid It, You Can’t Ignore It, You Can’t Fake It Synthesis Lectures on Computer Architecture 2009, 77 pages, [VanDerWalt2011] Stefan Van Der Walt, S. Chris Colbert, Gaël Varoquaux The NumPy array: a structure for efficient numerical computation Computing in Science and Engineering 13, 2 (2011) 22-30 [LZ77] Ziv, Jacob; Lempel, Abraham (May 1977). A Universal Algorithm for Sequential Data Compression. IEEE Transactions on Information Theory 23 (3): 337–343. [NPY] Robert Kern. The NPY format https://github.com/numpy/ numpy/blob/master/doc/neps/npy-format.txt [Joblib] Joblib http://pythonhosted.org/joblib/ [zlib] Zlib http://www.zlib.net/ [gzip] Gzip http://www.gzip.org/ [rsync] Rsync http://rsync.samba.org/ [Blaze] Blaze http://blaze.pydata.org/ [CArray] CArray http://carray.pytables.org/docs/manual/ [Numpy] Numpy http://www.numpy.org/ [FastLZ] FastLZ http://fastlz.org/ [Snappy] Snappy http://code.google.com/p/snappy/ [LZ4] LZ4 http://code.google.com/p/lz4/ [Blosc] Blosc http://blosc.org [Bloscpack] Bloscpack https://github.com/Blosc/bloscpack [CPU] Intel® Core™ i7-3667U Processor BLOSCPACK: A COMPRESSED LIGHTWEIGHT SERIALIZATION FORMAT FOR NUMERICAL DATA small size - low entropy 9 medium size - low entropy large size - low entropy (npy, 0) (bloscpack, 7) (bloscpack, 3) codec,level codec,level codec,level (bloscpack, 9) compress decompress dc_no_cache (bloscpack, 1) 0.000 0.002 0.004 0.006 0.008 0.010 0.012 0.0 0.1 0.2 0.3 0.4 0.5 0.6 small size - medium entropy medium size - medium entropy 0 2 4 6 8 10 12 large size - medium entropy (npy, 0) (bloscpack, 7) (bloscpack, 3) codec,level codec,level codec,level (bloscpack, 9) (bloscpack, 1) 0.000 0.002 0.004 0.006 0.008 0.010 0.012 0.0 0.1 0.2 0.3 0.4 0.5 0.6 small size - high entropy medium size - high entropy 0 2 4 6 8 10 12 large size - high entropy (npy, 0) (bloscpack, 7) (bloscpack, 3) codec,level codec,level codec,level (bloscpack, 9) (bloscpack, 1) 0.000 0.002 0.004 0.006 0.008 0.010 0.012 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0 2 Fig. 1: Compare Bloscpack and NPY on the SSD storage type. 4 6 8 10 12 10 PROC. OF THE 6th EUR. CONF. ON PYTHON IN SCIENCE (EUROSCIPY 2013) small size - low entropy medium size - low entropy large size - low entropy (zfile, 7) (zfile, 3) (npz, 1) (bloscpack, 9) (bloscpack, 7) codec,level codec,level codec,level (zfile, 1) compress decompress dc_no_cache (bloscpack, 3) (bloscpack, 1) 0.000 0.005 0.010 0.015 0.020 0 1 2 3 4 5 6 7 8 small size - medium entropy 0 medium size - medium entropy 50 100 150 large size - medium entropy (zfile, 7) (zfile, 3) (npz, 1) (bloscpack, 9) (bloscpack, 7) codec,level codec,level codec,level (zfile, 1) (bloscpack, 3) (bloscpack, 1) 0.000 0.005 0.010 0.015 0.020 0 1 2 3 4 5 6 7 8 small size - high entropy 0 medium size - high entropy 50 100 150 large size - high entropy (zfile, 7) (zfile, 3) (npz, 1) (bloscpack, 9) (bloscpack, 7) codec,level codec,level codec,level (zfile, 1) (bloscpack, 3) (bloscpack, 1) 0.000 0.005 0.010 0.015 0.020 0 1 2 3 4 5 6 7 8 0 50 Fig. 2: Compare Bloscpack, NPZ and ZFile on the SSD storage type. 100 150 BLOSCPACK: A COMPRESSED LIGHTWEIGHT SERIALIZATION FORMAT FOR NUMERICAL DATA small size - low entropy 11 medium size - low entropy large size - low entropy (npy, 0) (bloscpack, 7) (bloscpack, 3) codec,level codec,level codec,level (bloscpack, 9) compress decompress dc_no_cache (bloscpack, 1) 0.0000.0050.0100.0150.0200.0250.030 0 small size - medium entropy 1 2 3 4 5 0 medium size - medium entropy 20 40 60 80 100 large size - medium entropy (npy, 0) (bloscpack, 7) (bloscpack, 3) codec,level codec,level codec,level (bloscpack, 9) (bloscpack, 1) 0.0000.0050.0100.0150.0200.0250.030 0 small size - high entropy 1 2 3 4 5 0 medium size - high entropy 20 40 60 80 100 large size - high entropy (npy, 0) (bloscpack, 7) (bloscpack, 3) codec,level codec,level codec,level (bloscpack, 9) (bloscpack, 1) 0.0000.0050.0100.0150.0200.0250.030 0 1 2 3 4 5 0 20 Fig. 3: Compare Bloscpack and NPY on the SD storage type. 40 60 80 100 12 PROC. OF THE 6th EUR. CONF. ON PYTHON IN SCIENCE (EUROSCIPY 2013) small size - low entropy medium size - low entropy large size - low entropy (zfile, 7) (zfile, 3) (npz, 1) (bloscpack, 9) (bloscpack, 7) codec,level codec,level codec,level (zfile, 1) compress decompress dc_no_cache (bloscpack, 3) (bloscpack, 1) 0.0000.0050.0100.0150.0200.0250.0300.0350.040 0 small size - medium entropy 2 4 6 8 0 medium size - medium entropy 50 100 150 200 large size - medium entropy (zfile, 7) (zfile, 3) (npz, 1) (bloscpack, 9) (bloscpack, 7) codec,level codec,level codec,level (zfile, 1) (bloscpack, 3) (bloscpack, 1) 0.0000.0050.0100.0150.0200.0250.0300.0350.040 0 small size - high entropy 2 4 6 8 0 medium size - high entropy 50 100 150 200 large size - high entropy (zfile, 7) (zfile, 3) (npz, 1) (bloscpack, 9) (bloscpack, 7) codec,level codec,level codec,level (zfile, 1) (bloscpack, 3) (bloscpack, 1) 0.0000.0050.0100.0150.0200.0250.0300.0350.040 0 2 4 6 8 0 50 Fig. 4: Compare Bloscpack, NPZ and ZFile on the SD storage type. 100 150 200 BLOSCPACK: A COMPRESSED LIGHTWEIGHT SERIALIZATION FORMAT FOR NUMERICAL DATA codec,level size: 'mid' entropy: 'high' size: 'large' entropy: 'high' codec,level size: 'small' entropy: 'high' (zfile, 7) (zfile, 3) (zfile, 1) (npy, 0) (npz, 1) (bloscpack, 9) (bloscpack, 7) (bloscpack, 3) (bloscpack, 1) 0.0 size: 'large' entropy: 'medium' codec,level size: 'mid' entropy: 'medium' codec,level size: 'small' entropy: 'medium' codec,level size: 'large' entropy: 'low' 0.2 0.4 0.6 0.8 1.0 1.2 0.0 codec,level (zfile, 7) (zfile, 3) (zfile, 1) (npy, 0) (npz, 1) (bloscpack, 9) (bloscpack, 7) (bloscpack, 3) (bloscpack, 1) size: 'mid' entropy: 'low' codec,level codec,level (zfile, 7) (zfile, 3) (zfile, 1) (npy, 0) (npz, 1) (bloscpack, 9) (bloscpack, 7) (bloscpack, 3) (bloscpack, 1) codec,level size: 'small' entropy: 'low' 13 0.2 0.4 0.6 0.8 1.0 1.2 0.0 Fig. 5: Compression ratios for all examined formats 0.2 0.4 0.6 0.8 1.0 1.2 14 PROC. OF THE 6th EUR. CONF. ON PYTHON IN SCIENCE (EUROSCIPY 2013)
6cs.PL
A BOUND FOR THE INDEX OF A QUADRATIC FORM AFTER SCALAR EXTENSION TO THE FUNCTION FIELD OF A QUADRIC arXiv:1607.07529v1 [math.NT] 26 Jul 2016 STEPHEN SCULLY Abstract. Let q be an anisotropic quadratic form defined over a general field F . In this article, we formulate a new upper bound for the isotropy index of q after scalar extension to the function field of an arbitrary quadric. On the one hand, this bound offers a refinement of a celebrated bound established in earlier work of Karpenko-Merkurjev and Totaro; on the other, it is a direct generalization of Karpenko’s theorem on the possible values of the first higher isotropy index. We prove its validity in two important cases: (i) the case where char(F ) 6= 2, and (ii) the case where char(F ) = 2 and q is quasilinear (i.e., diagonalizable). The two cases are treated separately using completely different approaches, the first being algebraic-geometric, and the second being purely algebraic. 1. Introduction A basic, yet fundamental tool in the study of quadratic forms over general fields is that of scalar extension. Among its many uses, perhaps the most significant is that of forcing some quadratic form of interest to acquire a non-trivial zero, assuming that none exist in the base field (that is, forcing an anisotropic form to become isotropic). This has the effect of lowering the “anisotropic dimension” of the form, which, apart from providing a natural means by which to argue inductively, can often lead one to witness non-trivial behaviour in other quadratic forms of interest as the field of definition is enlarged. In order to draw meaningful conclusions, the challenge is typically then one of determining restrictions of a general nature on this kind of behaviour. What those restrictions are, however, will depend heavily on the particular choice of extension field. In order to maintain as much control as possible, it is often desirable to choose an extension for which the restrictions are most severe. Philosophically, this means that one should choose an extension which, in the sense of valuation theory, is “generic” for the problem at hand. For the purpose of forcing an anisotropic quadratic form to become isotropic, there is a canonical choice of extension having this property; namely, the function field of the projective quadric defined by the vanishing of that form. For these and other reasons, studying the effect of scalar extension to function fields of quadrics has been a dominant theme in much of the research carried out in the algebraic theory of quadratic forms since the early 1970s. One problem of central interest in this area is the following: Let p and q be anisotropic quadratic forms of dimension ≥ 2 over a general field F , and let P and Q denote the projective F -quadrics defined by the vanishing of p and q, respectively. Under what circumstances does q become isotropic over the function field F (p) of the quadric P ? From an algebraic-geometric perspective, this simply amounts to asking for necessary and sufficient conditions in order for there to exist a rational map P 99K Q over F . Nevertheless, the fact that we impose no constraints on the triple (F, q, p) endows the problem with a depth and complexity which belies its initial appearance. In fact, it is 2010 Mathematics Subject Classification. 11E04, 14E05, 15A03. Key words and phrases. Quadratic forms, isotropy indices, quadrics and quadratic Grassmannians, rational maps between quadratic Grassmannians. 1 2 STEPHEN SCULLY entirely unreasonable to hope for a complete solution in this generality; as a vast literature accumulated over the past three decades amply demonstrates, the problem is already considerably involved in low-dimensional situations (see, e.g., [Kah08, §8.2]). In the present article, we will thus be concerned with a weaker variant of this problem which seeks to investigate restrictions of a particular kind on the isotropy index i0 (qF (p) ) of q after scalar extension to the field F (p). Recall here that if φ is a quadratic form defined on a finite-dimensional vectors space V over a field, then its isotropy index i0 (φ) is defined as the maximal dimension of a subspace of V on which q is uniformly zero (that is, a totally isotropic subspace of V ). As such, the integer i0 (qF (p) ) can not only detect the isotropy of q over F (p), but measure the extent to which it persists; in the language of algebraic geometry, our problem is not only concerned with identifying necessary conditions in order for there to exist a rational map from P to Q, but from P to the variety of totally isotropic subspaces of any prescribed dimension in Q. The restrictions which we are interested in here are of a very general nature; namely, those imposed by only the most basic discrete invariants of p and q. In this respect, our problem has a long and rich history dating back to the late 1960s and the classic “subform theorem” of Cassels and Pfister. While many important contributions have been made over the years by a large number of authors, one of the most notable results established to date in this direction is a penetrating upper bound for the integer i0 (qF (p) ) involving just three invariants of p and q: the dimension of q, the dimension of p, and the first higher isotropy index of p, defined as the integer i1 (p) := i0 (pF (p) ). Originally conjectured by Izhboldin ([Izh04]), and having its origin in the seminal work of Hoffmann ([Hof95]), the bound was first established in the case where char(F ) 6= 2 by Karpenko and Merkurjev ([KM03, Cor. 4.2]), and later in full generality by Totaro (see [Tot08, Thm. 5.2]): Theorem 1.1 (Karpenko-Merkurjev, Totaro). Let p and q be anisotropic quadratic forms of dimension ≥ 2 over a field F . If qF (p) is isotropic, then i0 (qF (p) ) ≤ dim(q) − dim(p) + i1 (p). Unlike much of the work which came before it, Theorem 1.1 was established using methods of algebraic geometry. Indeed, both sets of authors exploited the aforementioned geometric interpretation of the integer i0 (qF (p)) in order to bring the theory of algebraic cycles to bear on the problem. This built upon foundational ideas of Vishik, who had earlier obtained non-trivial results in the same direction ([Vis99]). The theorem is all the more significant due to the fact that a considerable amount is known concerning the integer i1 (p). In fact, there is a precise conjectural description of its possible values due to Hoffmann, and this conjecture has been verified in the case where char(F ) 6= 2 by Karpenko ([Kar03]). Unfortunately, Karpenko’s proof makes essential use of a powerful fact which is not yet available in characteristic 2: the existence of Steenrod-type operations on the Chow groups of smooth projective varieties with Z/2Z coefficients. Hoffmann’s conjecture therefore remains open in the latter setting. In recent work of the author, however, completely different (and purely algebraic) methods were used to settle the conjecture for a special class of forms in characteristic 2. More specifically, it was shown in [Scu14, Thm 1.3] that if char(F ) = 2, then Hoffmann’s conjecture on i1 (p) holds in the case where p is quasilinear, meaning that p is isometric to a form of Fermat type, i.e., a weighted sum of squares a1 X12 + a2 X22 + · · · + an Xn2 . We are left with the following general result: Theorem 1.2 (Karpenko, Scully). Let p be an anisotropic quadratic form of dimension ≥ 2 over a field F , and let s = v2 dim(p) − i1 (p) . Assume that either (1) The characteristic of F is not 2, or 3 (2) The characteristic of F is 2 and p is quasilinear. Then i1 (p) ≤ 2s . Here the notation v2 (n) stands for the 2-adic order of the integer n. It is worth remarking that while Hoffmann’s conjecture is essentially wide open for non-quasilinear forms in characteristic 2, non-trivial partial results have been obtained by Hoffmann-Laghribi ([HL06]) and also by Haution as a by-product of his efforts to develop the geometric machinery which is currently absent from the characteristic-2 setting (see [Hau13],[Hau15]). Theorems 1.1 and 1.2 represent important landmarks for the theory of quadratic forms. Put together, they lead to the (highly applicable) conclusion that i0 (qF (p) ) is typically not much more than dim(q) − dim(p). Geometrically speaking, this may be interpreted more concretely as the fact that an anisotropic quadric cannot be “rationally compressed” to another quadric of “sufficiently lower” dimension. This striking behaviour was already observed in the aforementioned work of Hoffmann, who proved a less refined variant of Theorem 1.1 in which the integer dim(p) − i1 (p) is replaced by the largest power of 2 strictly less than dim(p) (at least when char(F ) 6= 2 - see [Hof95]). It should be noted that this observation has since gone on to have a great influence on developments in closely related topics within the theory of algebraic groups (see, e.g., [Kar10]). The main aim of the current article is to present a new upper bound for the integer i0 (qF (p) ) which is, on the one hand, complementary to that of Karpenko-Merkurjev-Totaro, and, on the other, is a direct generalization of Hoffmann’s conjecture on the possible values of the first higher isotropy index. As such, it both strengthens and unifies an important part of the existing literature. As per Theorem 1.2, however, we must limit our considerations to quasilinear forms when working in the characteristic-2 setting; nevertheless, the results which we do obtain give a firm indication that the bound should hold without restriction. Our main theorem is thus the following; as the reader will readily observe, Theorem 1.2 above is nothing else but the special case in which q = p: Theorem 1.3. Let p and q be anisotropic quadratic forms of dimension ≥ 2 over a field  F , and let s = v2 dim(p) − i1 (p) . Assume that either (1) The characteristic of F is not 2, or (2) The characteristic of F is 2 and q is quasilinear. Then i0 (qF (p) ) ≤ max (dim(q) − dim(p), 2s ) . Although we restrict to quasilinear forms in characteristic 2, it is worth stressing that it is the proof of this case of Theorem 1.3 which is, to the author’s mind, the most striking part of the paper. Furthermore, contrary to the more traditional order of events, the characteristic 6= 2 case of the theorem was in fact preceded by the quasilinear case; indeed, the stated bound was only discovered by way of a conceptual trivialization established in the quasilinear setting. This is an effective advertisement for the study of quasilinear quadratic forms; intrinsic interest aside, the quasilinear case can sometimes serve as a guiding light for investigations into the general theory. To give a another illustration of the unifying power of Theorem 1.3, we now show how it may be used to give a short proof of a well-known and deep result in characteristic 6= 2 which was originally conjectured by Knebusch in [Kne77] and proven by Fitzgerald in [Fit81];1 by contrast, this result does not follow directly from Theorems 1.1 and 1.2. 1An analogous result holds for quasilinear forms in characteristic 2 (see [Lag04a, Prop. 1.7]), and this may also be deduced from Theorem 1.3 in a similar way. 4 STEPHEN SCULLY Example 1.4. (Fitzgerald, see [Fit81, Thm. 1.6]) Let p and q be anisotropic quadratic forms of dimension ≥ 2 over afield F of characteristic 6= 2. If q becomes hyperbolic over F (p) i.e., i0 (qF (p) ) = 12 dim(q) , and dim(p) > 12 dim(q), then q is similar to a Pfister form. Proof. Fitzgerald’s original proof involved rather subtle manipulations of the CasselsPfister subform theorem ([EKM08, Thm. 22.5]), among other standard results from the classical algebraic theory of quadratic forms. Given Theorem 1.3, however, the statement follows in a straightforward manner. Indeed, since 1 i0 (qF (p) ) = dim(q) > dim(q) − dim(p) 2 by hypothesis, the theorem tells us in this case that dim(q) = 2i0 (qF (p) ) ≤ 2s+1 ,  where s = v2 dim(p) − i1 (p) . Now, as q becomes hyperbolic over F (p), the Cassels-Pfister subform theorem implies that dim(p) ≤ dim(q). By the definition of s, we therefore have (1.1) 2s < dim(p), dim(q) ≤ 2s+1 . Suppose now that q is not similar to a Pfister form. Then there exists an extension L of F such that (i) qL is isotropic and (ii) its anisotropic kernel (qL )an is similar to a Pfister form (for example, we can take L to be the penultimate entry in the generic splitting tower of q – see [EKM08, §25]). But (qL )an becomes hyperbolic over L(pL ), and so another application of the Cassels-Pfister subform theorem, together with (1.1), shows that  2s < dim (qL )an < 2s+1 . Since (qL )an , being similar to a Pfister form, has dimension equal to a power of 2, this is not possible. We thus conclude that q is similar to a Pfister form, as desired.  The characteristic 6= 2 case of Theorem 1.3 is proved in §4 below (in fact, we get a slightly more refined assertion – see Theorem 4.1). The argument makes use of the theory of Chow correspondences in a similar way to the proofs of the aforementioned results of KarpenkoMerkurjev-Totaro and Karpenko, though we present it using the more conceptual language of Chow motives. Here we rely crucially on the most recent advance in the study of motivic decompositions of quadrics due to Vishik ([Vis11]). Since Vishik’s work involves heavy use of the aforementioned Steenrod operations on Chow groups modulo 2, this approach to Theorem 1.3 is certainly limited to characteristic 6= 2 at present. In order to treat the case where char(F ) = 2 and q is quasilinear, we are therefore forced to proceed in an entirely different manner. Here we follow the pattern of ideas developed in [Scu14]. Primary to Theorem 1.3, our main result in this setting concerns a certain structural decomposition of the anisotropic kernel of the form qF (p) – see Theorem 6.6 below. This result (which may be viewed as a generalization of [Scu14, Thm. 5.1]) takes place on the level of quadratic forms themselves, and the quasilinear part of Theorem 1.3 emerges as nothing more than a dimension-theoretic consequence of its validity (again, we actually get a slightly better statement – see Corollaries 6.18 and 6.20). Most interestingly, the quasilinear cases of Theorem 1.1 and 1.2 are also immediate dimension-theoretic consequences of Theorem 6.6, as are some additional new results which seem to have no known analogues in the characteristic 6= 2 theory, conjectural or otherwise (see §6.C). We are therefore left with a conceptually satisfying unification of several important statements in this setting, both old and new. Taking all of this into account, it would be interesting to know whether this algebraic approach to the isotropy problem (and Theorem 6.6 in particular) admits some kind of generalization beyond the quasilinear case. 5 For the convenience of the reader, the proofs of the two cases of Theorem 1.3 are each preceded by a separate section of preliminaries particular to the relevant situation. Definitions, basic concepts and results common to both are given in the next section. Finally, we remark that, just as in [Scu14], the proofs of our main results on quasilinear quadratic forms readily generalize to give analogous results for quasilinear p-forms of any prime degree p (i.e., Fermat-type forms of degree p in characteristic p). For the sake of transparency, however, we refrain from working in this generality here. Terminology. In this text, the word scheme means a scheme of finite-type over a field. The word variety then means an integral scheme. 2. Diagonalizable quadratic forms Let F be a field and V a finite-dimensional F -vector space. By a quadratic form on V , we mean a map q : V → F such that (i) q(λv) = λ2 q(v) for all (λ, v) ∈ F × V , and (ii) the associated “polar form” bq : V × V → F given by bq (v, w) = q(v + w) − q(v) − q(w) is F -bilinear. If the F -linear map from V to its dual space given by v 7→ bq (v, −) is bijective, then we say that q is non-degenerate. The present article is concerned with quadratic forms which are diagonalizable, in the sense that they arise as the diagonal part of a symmetric bilinear form over their field of definition. More precisely, q is said to be diagonalizable if there exists a symmetric bilinear form b on Vq such that q(v) = b(v, v) for all v ∈ Vq . If char(F ) 6= 2, then every quadratic form over F has this property; indeed, we can (and must) take b = 21 bq in this case. By contrast, if char(F ) = 2, then q is diagonalizable if and only if it is quasilinear, i.e., if and only if q(v + w) = q(v) + q(w) for all v, w ∈ Vq . As such our discussion will concern the entire theory of quadratic forms over fields of characteristic 6= 2, but only the quasilinear part of the characteristic-2 theory. Terminology. In this section, by a quadratic form over F (or simply a form over F ), we shall mean a diagonalizable quadratic form on some finite-dimensional F -vector space. We now recall some basic concepts and results concerning diagonalizable quadratic forms over arbitrary fields. The reader is referred to [EKM08] for a comprehensive discussion. 2.A. Basic concepts. Let q be a quadratic form over F . The F -vector space on which q is defined will be denoted by Vq . The dimension of this vector space will be called the dimension of q, and will be denoted by dim(q). The set {q(v) | v ∈ Vq } consisting of all elements of F represented by q will be denoted by D(q). Given a field extension L of F , there is a unique quadratic form on the L-vector space Vq ⊗F L which extends q and whose polar form extends bq . We denote this form by qL . If R is a subring of L containing F , then D(qR ) will denote the subset {q(w) | w ∈ Vq ⊗F R} of D(qL ) ∩ R. Given a ∈ F ∗ , we will write aq for the quadratic form v 7→ aq(v) on the vector space Vq . Let p be another quadratic form over F . If there exists a bijective F -linear map f : Vp →  Vq such that q f (v) = p(v) for all v ∈ Vp , then we will say that p and q are isometric, and write p ≃ q. If p ≃ aq for some a ∈ F ∗ , then we will say that p and q are similar. An element a ∈ F ∗ for which aq ≃ q is said to be a similarity factor of q. The set G(q)∗ = {a ∈ F ∗ | aq ≃ q} of all similarity factors of q is evidently a subgroup of F ∗ . We will write G(q) for the union G(q)∗ ∪ {0}. Note that we have F 2 ⊆ G(q).  The assignment v + w 7→ p(v) + q(w) (v, w) ∈ Vp × Vq defines a quadratic form p ⊥ q on Vp ⊕Vq called the orthogonal sum of p and q. Given a positive integer n, n·q will denote 6 STEPHEN SCULLY the orthogonal sum of n copies of q (note that n · q 6= nq). If there exists a quadratic form r over F such that q ≃ p ⊥ r, then we will say that p is a subform of q. The tensor product p ⊗ q is the unique quadratic form on Vp ⊗ Vq such that (i) the polar form of p ⊗ q is given by the Kronecker product bp ⊗ bq , and (ii) for all (v, w) ∈ Vp × Vq , p ⊗ q maps the element v ⊗ w to p(v)q(w). If there exists a quadratic form r over F such that q ≃ p ⊗ r, then we will say that q is divisible by p. a1 , . . . , an ∈ F , we write ha1 , ..., an i for the quadratic form (λ1 , . . . , λn ) 7→ PnGiven elements 2 on the F -vector space F ⊕n . Every quadratic form over F (in the sense we are a λ i=1 i i considering) is clearly isometric to one of this type. A vector v ∈ Vq is said to be isotropic (with respect to q) if q(v) = 0. An F -linear subspace of Vq consisting entirely of isotropic vectors is said to be totally isotropic. We will say that q is isotropic if Vq contains a non-zero isotropic vector, and anisotropic otherwise. Equivalently, q is anisotropic if the projective quadric Q = {q = 0} ⊂ P(Vq ) has no F -rational points. If char(F ) 6= 2, then this implies that Q is smooth ([EKM08, Prop. 22.1]). By contrast, if char(F ) = 2 and q is non-zero, then Q is totally singular (in the sense that it has no smooth points at all), irrespective of whether q is anisotropic or not. The isotropy index of q, denoted i0 (q), is defined to be the maximal dimension of a totally isotropic subspace of Vq . If char(F ) 6= 2, then i0 (q) is more commonly known as the Witt index of q. In any characteristic, the integer i0 (q) is insensitive to making purely transcendental extensions of the base field (see [EKM08, Lem. 7.15]). 2.B. Decomposition of isotropic forms. To any quadratic form q over F , one may associate an anisotropic quadratic form qan over F known as the anisotropic part of q. The precise nature of this form depends on the characteristic of F . If char(F ) 6= 2, then the assignment (x, y) 7→ xy defines a quadratic form H on the F vector space F ⊕2 known as the hyperbolic plane over F . Up to isometry, H is the unique non-degenerate isotropic form of dimension 2 over F . If, in this case, q is non-degenerate, then the Witt decomposition theorem (see [EKM08, Thm. 8.5]) characterizes qan as the unique anisotropic form over F (up to isometry) such that q ≃ i0 (q) · H ⊥ qan . Note, in particular, that we have dim(qan ) = dim(q) − 2i0 (q) in this situation. If char(F ) = 2 (so that q is quasilinear), then the additivity of q implies that the set U of all isotropic vectors in Vq is, in fact, an F -linear subspace of Vq . In particular, the isotropy index of q, i0 (q), is nothing else but the dimension of U . In this case, the form qan may be defined as the restriction of q to the quotient space Vq /U . Up to isometry, qan is then the unique anisotropic form over F such that q ≃ i0 (q) · h0i ⊥ qan . From another point of view, the additivity of q also implies that the set D(q) consisting of all elements of F represented by q is an F 2 -linear subspace of F . The form qan may then also be characterised up to isometry as the unique anisotropic form over F such that D(qan ) = D(q) (see Proposition 5.1 below). It is important to note that in this setting we have dim(qan ) = dim(q) − i0 (q), as opposed to the aforementioned dim(qan ) = dim(q) − 2i0 (q) which prevails for nondegenerate forms in characteristic 6= 2. Nevertheless, in all characteristics, we see that the dimension of qan measures the extent to which q is isotropic. If dim(qan ) ≤ 1, then we say that q is split. Note that if F is algebraically closed, then every quadratic form over F is split. Moreover, if char(F ) = 2, then one only requires that F be perfect in order to make the same conclusion. For example, there are no non-split forms over a finite field of characteristic 2. 2.C. Function fields of quadrics. Let q be a quadratic form over F . If q is not split, then it is irreducible as an element of the symmetric algebra S(Vq∗ ), and so the projective quadric Q is an integral F -scheme, as is its affine cone {q = 0} ⊂ A(Vq ) (see [EKM08, 7 Ch. IV]) In this case, we will write F (q) for the function field of the former and F [q] for that of the latter. The field F [q] is of course a degree-1 purely transcendental extension of F (q). If L is a field extension of F , then we will simply write L(q) instead of L(qL ) whenever it is defined. Note that if q ≃ ha0 , a1 , . . . , an i for some ai ∈ F with a0 , a1 6= 0, then we have F -isomorphisms  q −1 2 2 a0 (a1 + a2 S2 + · · · + an Sn ) F (q) ≃ F (S) and F [q] ≃ Frac F [T ]/(a0 T02 + ··· +  an Tn2 ) ≃ F (U ) q 2 a−1 0 (a1 U1 + ··· +  an Un2 ) , where S = (S2 , . . . , Sn ), T = (T0 , . . . , Tn ) and U = (U1 , . . . , Un ) are systems of algebraically independent variables over F . Evidently, the form qF (q) is isotropic. 2.D. The Knebusch splitting pattern. Let q be a non-zero quadratic form over F . In [Kne76], Knebusch introduced the following construction (at least in the case where char(F ) 6= 2): Set F0 = F , q0 = qan , and recursively define • Fr = Fr−1 (qr−1 ) (provided qr−1 is not split), and • qr = (qFr )an (provided Fr is defined). Note that if qr is defined, then dim(qr ) < dim(qr−1 ), since an anisotropic quadratic form becomes isotropic over the function field of the quadric which it defines. As such, Knebusch’s process is finite, terminating at the first non-negative integer h(q) for which qh(q) is split. The integer h(q) is called the height of q, and the tower of fields F = F0 ⊂ F1 ⊂ · · · ⊂ Fh(q) is called the Knebusch splitting tower of q. For each 0 ≤ r ≤ h(q), we set jr (q) = i0 (qFr ). If q is not split and r ≥ 1, then the integer jr (q) − jr−1 (q) will be called the r-th higher isotropic index of q, and will be denoted by ir (q). In this case, the form qr will be called the r-th higher anisotropic kernel of q. When char(F ) 6= 2, the tower F = F0 ⊂ F1 ⊂ · · · ⊂ Fh(q) is usually referred to as the generic splitting tower of q, as it is generic (in a valuation-theoretic sense) among all towers of extensions of F which ultimately split q. In particular, if K is any field extension of F , then there exists in this case an integer r ∈ [0, h(q)] such that i0 (qK ) = i0 (qFr ). This is easily deduced from the following more specific statement: Lemma 2.1 (see [Kne76, §5]). Let q be a quadratic form over a field F of characteristic 6= 2 with Knebusch splitting tower F = F0 ⊂ F1 ⊂ · · · ⊂ Fh(q) , and let r be an integer in [0, h(q) − 1]. If K is a field extension of F such that i0 (qK ) > jr (q), then the free compositum K · Fr+1 is a purely transcendental extension of K. Lemma 2.1 follows from the fact that any smooth projective quadric which admits a rational point is a rational variety ([EKM08, Prop. 22.9]). This is not the case for totally singular quadrics (see [Hof04, Rem. 7.4 (iii)]), whence the characteristic restriction. 2.E. Pfister and quasi-Pfister forms. Let n be a positive integer. Given a1 , . . . , an ∈ F ∗ , we write hha1 , . . . , an ii for the 2n -dimensional quadratic form over F defined as the n-fold tensor product h1, −a1 i ⊗ · · · ⊗ h1, −an i. If char(F ) 6= 2, then forms of this type are known as (n-fold) Pfister forms. If char(F ) = 2, they are more commonly referred to as (nfold) quasi-Pfister forms (in order to distinguish them from the symmetric bilinear forms which also bear Pfister’s name). In either case, any such form π is round (or multiplicative), meaning that G(π) = D(π). If char(F ) = 2, then the only round anisotropic forms over F are those which are quasi-Pfister ([Hof04, Prop. 7.14]). By contrast, if char(F ) 6= 2, there 8 STEPHEN SCULLY can be non-Pfister anisotropic round forms; in this case, the anisotropic Pfister forms over F are precisely those anisotropic forms π which are strongly multiplicative in the sense that G(πK ) = D(πK ) for every field extension K of F (see [EKM08, Theorem 23.2]). 3. Some preliminaries in characteristic 6= 2 We begin our investigations with the case of fields of characteristic different from 2. Here we will make use of a certain interplay which exists in this setting between the Knebusch splitting pattern of an anisotropic quadratic form and some discrete motivic invariants of its associated quadric. We therefore begin by recalling some basic concepts and results concerning this interaction. For the remainder of this section, F will denote an arbitrary field of characteristic 6= 2. 3.A. Motivic decomposition type and upper motives. For readable introductions to the theory of Chow motives, with particular emphasis on motives of quadrics, the reader is referred to [Vis04] or [EKM08]. If k is a field, then we write Chow (k) for the additive category of Grothendieck-Chow motives over k with integral coefficients (as defined, for example, in [Vis04, §1]). If X is a smooth projective variety over k, then we will write M (X) to denote its motive as an element of Chow (k). In the special case where X = Spec(k), we simply write Z instead of M (X), thus suppressing its dependency on the base field k. Given an integer i and an object M of Chow (k), we will write M {i} for the i-th Tate twist of M . In particular, Z{i} will denote the Tate motive with shift i in Chow (k). If K is a field extension of k, we write MK to denote the image of an object M in Chow (k) under the natural scalar extension functor Chow (k) → Chow (K). Now, let X be a smooth projective quadric of dimension n ≥ 1 over our fixed field F of characteristic 6= 2. By a result of Vishik (see [Vis98] or [Vis04, §3]), any direct summand of M (X) decomposes into a finite direct sum of indecomposable objects in Chow (F ). Furthermore, this decomposition is unique up to reordering of the summands. In the case where X is split (i.e., X is the vanishing locus of a split quadratic form over F ), the full decomposition of M (X) was obtained by Rost ([Ros90]), who showed that M (X) decomposes into a certain direct sum of Tate motives. Since every smooth projective quadric over an algebraically closed field is split, it follows that M (XF ) decomposes into a direct sum of Tate motives in Chow (F ), where F denotes a fixed algebraic closure of F . The precise statement is the following: (L n Z{i} if n is odd (3.1) M (XF ) ≃ Li=0 n n ( i=0 Z{i}) ⊕ Z{ 2 } if n is even (see [Vis04, Prop. 2.2]). If N is an indecomposable direct summand of M (X), then it follows that NF uniquely decomposes into a direct sum of a subset of the Tate motives appearing in the decomposition of M (XF ). Moreover, the subsets which arise from distinct indecomposable summands of M (Q) are necessarily disjoint (see [Vis04, §4]). The complete motivic decomposition of X over F therefore determines a partition of the Tate motives which appear in (3.1). This partition is an important discrete invariant of X known as its motivic decomposition type. The motivic decomposition type of X interacts nontrivially with other known discrete invariants of X. In particular, it interacts with the Knebusch splitting pattern of its underlying form, and this interaction has been exploited to obtain deep results concerning the latter invariant in recent years. In order to prove the characteristic 6= 2 part of Theorem 1.3, we will need the most recent advance in the study of the motivic decomposition type of anisotropic quadrics, which is a far-reaching result due to Vishik ([Vis11]). First, following [Kar13], we define the upper motive of X to be the 9 unique indecomposable direct summand U (X) of M (X) such that the trivial Tate motive Z is isomorphic to a direct summand of M (X). Vishik’s result then gives the following information regarding U (X) in the anisotropic case (we recall that an anisotropic quadric in characteristic 6= 2 is necessarily smooth – see §2.A above): Theorem 3.1 (Vishik, see [Vis11, Thm. 2.1]). Let φ be an anisotropic quadratic form of dimension ≥ 2 over F with associated (smooth) projective quadric X. Write dim(φ) − i1 (φ) = 2r1 − 2r2 + · · · + (−1)t−1 2rt for uniquely determined integers r1 > r2 > · · · > rt−1 > rt +1 ≥ 1, and, for each 1 ≤ l ≤ t, set t l−1 X X i−1 ri −1 (−1) 2 + ǫ(l) (−1)j−1 2rj , Dl = i=1 j=l where ǫ(l) = 1 if l is even and ǫ(l) = 0 if l is odd. Then, for any 1 ≤ l ≤ t, the Tate motive Z{Dl } is isomorphic to a direct summand of U (X)F . We will also make use the following more elementary observation (also due to Vishik) which relates two anisotropic quadrics on the motivic level in the situation where one of the quadrics is stably birational to the variety of totally isotropic subspaces of prescribed dimension in the other (see also [Vis04, Thm. 4.17] for a strengthening of this result): Theorem 3.2 (Vishik, cf. [Vis99, Prop. 1], [Vis04, Thm. 4.15]). Let p and q be anisotropic quadratic forms of dimension ≥ 2 over F with associated (smooth) projective quadrics P and Q, respectively. Suppose that, for every field extension K of F , we have i0 (pK ) > 0 ⇔ i0 (qK ) > l. Then U (P ){l} is isomorphic to a direct summand of M (Q). 3.B. A criterion for stable birational equivalence of smooth projective quadrics. Let p and q be anisotropic quadratic forms of dimension ≥ 2 over F . If qF (p) is isotropic, then i0 (qF (p) ) ≥ i1 (q) (see §2.D), and so dim(q)−i1 (q) ≥ dim(p)−i1 (p) by an application of Theorem 1.1. In order to make use of Theorem 3.2 above in the situation of Theorem 1.3, we will need the following complementary statement, also due to Karpenko and Merkurjev: Theorem 3.3 (Karpenko-Merkurjev, see [KM03, Thm. 4.1]). Let p and q be anisotropic quadratic forms of dimension ≥ 2 over F . If qF (p) is isotropic, and dim(q) − i1 (q) = dim(p) − i1 (p), then pF (q) is isotropic as well. Remark 3.4. In [Tot08], Totaro showed that Theorem 3.3 is also valid in characteristic 2 (irrespective of any smoothness assumptions). We shall not need this result here. 4. Main results: The characteristic 6= 2 case In this section, we show that Theorem 1.3 is valid in characteristic 6= 2. Following the previous section, F will denote an arbitrary field of characteristic 6= 2 throughout. Note that if p is an anisotropic quadratic form of dimension ≥ 2 over F , then Theorem 1.2 asserts that the integer i1 (p) − 2v2 (dim(p)−i1 (p)) is non-positive. The characteristic 6= 2 case of Theorem 1.3 therefore follows from the following more refined statement: Theorem 4.1. Let p and q be anisotropic quadratic forms of dimension ≥ 2 over F , and let s = v2 dim(p) − i1 (p) . Then i0 (qF (p) ) ≤ max (dim(q) − dim(p) + i1 (p) − 2s , 2s ) . 10 STEPHEN SCULLY Proof. In order to simplify the notation, set i := i0 (qF (p) ). Our assertion then reads (4.1) i ≤ max (dim(q) − dim(p) + i1 (p) − 2s , 2s ) . The idea of the proof is now the following: Let P and Q be the (necessarily smooth) projective F -quadrics defined by the vanishing of p and q, respectively. Assuming that (4.1) fails to holds, we show (modulo an inductive assumption) that a certain shift of the upper motive of P is a direct summand of the motive of Q (see §3.A above). We then show that this is not possible by using Theorem 3.1 to analyse the motivic decomposition types of P and Q. The key observation here is the following: Lemma 4.2. Suppose, in the above situation, that (4.1) does not hold. Then, for any field extension K of F , we have i0 (pK ) > 0 ⇔ i0 (qK ) ≥ i. Proof. Let F = F0 ⊂ F1 ⊂ · · · ⊂ Fh(q) be the Knebusch splitting tower of q and let q1 , . . . , qh(q) be its higher anisotropic kernel forms (see §2.D). Recall that for each integer k ∈ [0, h(q)], jk (q) denotes the isotropy index i0 (qFk ) of q over Fk . Since (4.1) fails to hold by hypothesis, we have i > 1. In particular, qF (p) is isotropic. Thus, by the genericity of Knebusch’s construction, there exists an integer r ∈ [0, h(q) − 1] such that jr+1 (q) = i (again, see §2.D). We claim that pFr+1 is isotropic. In order to prove this claim, we may clearly assume that pFr is anisotropic (in fact, one can show that this is indeed the case, but we don’t need to know that here). Working under this assumption, let us now set  µ := dim(qr ) − i1 (qr ) − dim(pFr ) − i1 (pFr ) . Since i = jr+1 (q) > jr (q), qr becomes isotropic over Fr (p). As Fr+1 = Fr (qr ) by definition, Karpenko and Merkurjev’s Theorem 3.3 shows that, to prove our claim, it suffices to check that µ = 0. By the remarks preceding Theorem 3.3, we certainly have µ ≥ 0. To see that equality holds here, let us first note that Fr (p) is a purely transcendental extension of F (p) by Lemma 2.1. Since isotropy indices are insensitive to purely transcendental extensions (§2.A), it follows that i1 (pFr ) = i1 (p). In particular, we have  (4.2) µ = dim(qr ) − i1 (qr ) − dim(p) − i1 (p) . Now, since i > dim(q) − dim(p) + i1 (p) − 2s by hypothesis, we see that  dim(p) − i1 (p) + µ = dim(qr ) − i1 (qr ) = dim(q) − 2jr (q) − ir+1 (q) = dim(q) − jr+1 (q) − jr (q) = dim(q) − i − jr (q)  < dim(p) − i1 (p) + 2s − jr (q), and so µ < 2s − jr (q). On the other hand, since we are also assuming that i > 2s , we have i1 (qr ) = jr+1 (q) − jr (q) = i − jr (q) > 2s − jr (q). By Karpenko’s theorem (see Theorem 1.2), it follows that dim(qr ) − i1 (qr ) is divisible by 2t for some integer t satisfying 2t ≥ i1 (qr ) > 2s − jr (q). But, by (4.2), we have  dim(qr ) − i1 (qr ) = dim(p) − i1 (p) + µ. As dim(p)−i1 (p) is (by definition) divisible by 2s , it follows that µ is divisible by min(2s , 2t ). Since 0 ≤ µ < 2s − jr (q) < min(2t , 2s ), this shows that µ = 0, and thus proves our initial claim that pFr+1 is isotropic. Finally, to complete the proof, let K be any field extension of F . If i0 (pK ) > 0, then K(p) is, by Lemma 2.1, a purely transcendental extension of 11 K, and so i0 (qK ) = i0 (qK(p) ) ≥ i0 (qF (p) ) ≥ i. Conversely, if i0 (qK ) ≥ i, then Lemma 2.1 again shows that the compositum L := K · Fr+1 is a purely transcendental extension of K, and so i0 (pK ) = i0 (pL ) ≥ i0 (pFr+1 ) > 0. The conditions i0 (pK ) > 0 and i0 (qK ) ≥ i are therefore equivalent, which is what we wanted to prove.  We now return to the proof of Theorem 4.1. We will argue by induction on dim(q), the case where dim(q) = 2 being trivial. Assume now that dim(q) > 2 and that the theorem is valid for all forms of dimension < dim(q) over F . Under this inductive hypothesis, we will show that (4.1) is valid for q. For this, we will use the following trivial observation: Lemma 4.3. Let q be a quadratic form over F and let K be a field extension of F . Then, for any integer i ∈ [0, i0 (qK )], there exists a subform q ′ ⊂ q such (1) dim(q ′ ) ≤ dim(q) − i. ′ ) = i (q ) − i. (2) i0 (qK 0 K Proof. It is enough to treat the case where i = 1. We argue in this case by induction on dim(q). The case where dim(q) = 0 is trivial. Assume now that dim(q) > 0, and let U be a totally isotropic K-linear subspace of Vq ⊗F K of dimension i0 (qK ). If W is a hyperplane in Vq , then the intersection of U and W ⊗F K in Vq ⊗F K has K-dimension at least i0 (qK ) − 1. In particular, if r is a codimension-1 subform of q, then i0 (rK ) ≥ i0 (qK ) − 1. By the induction hypothesis, r admits a subform q ′ of dimension ≤ dim(q) − i such that ′ ) = i (q ) − i. Since r is a subform of q, so is q ′ , and the result therefore follows.  i0 (qK 0 K Now, suppose, for the sake of contradiction, that inequality (4.1) is not valid for q. Then i > 2s , and so, by Lemma 4.3, there exists a subform q ′ of codimension at least i − (2s + 1) in q such that i0 (qF′ (p) ) = 2s + 1. But then the statement of our theorem fails to hold for the pair (q ′ , p). By our inductive assumption, we therefore conclude that q ′ = q, and so i = 2s + 1. Now, since (4.1) fails to hold, Lemma 4.2 shows that the condition of Theorem 3.2 is satisfied with l = i − 1 = 2s , and hence U (P ){2s } is isomorphic to a direct summand of M (Q). Note, however, that U (P ){2s } is not isomorphic to the upper motive U (Q) of Q. Indeed, since 2s ≥ 1, the trivial Tate motive Z is not isomorphic to a direct summand of U (P ){2s }F . Thus, U (Q) and U (P ){2s } are (isomorphic to) distinct indecomposable direct summands of M (Q). To complete the proof, we will now obtain a contradiction to our initial supposition by showing that U (P ){2s }F and U (Q)F have a common Tate motive in their respective decompositions (this cannot happen for non-isomorphic direct summands of M (Q) – see §3.A above). For this, we use Vishik’s Theorem 3.1. More specifically, we will use Vishik’s result to show that Z{m} is isomorphic to a direct summand of both U (P ){2s }F and U (Q)F , where m := (dim(p) − i1 (p) + 2s )/2. In the former case, this follows immediately from Theorem 3.1. Indeed, the reader will quickly check that, for X = P , the l = t case of the latter result states precisely that Z{m − 2s } is isomorphic to a direct summand of U (P )F . To see that Z{m} is isomorphic to a direct summand of U (Q)F , however, we first need to analyse the alternating 2-expansion of the integer dim(q) − i1 (q). More specifically, we need the following observation: Lemma 4.4. Suppose we are in the above situation, and write dim(q) − i1 (q) = 2r1 − 2r2 + · · · + (−1)t−1 2rt for uniquely determined integers r1 > r2 > · · · > rt−1 > rt + 1 ≥ 1. Then there exists an even integer k ∈ [1, t − 1] such that 2m = 2r1 − 2r2 + · · · + 2rk−1 − 2rk . 12 STEPHEN SCULLY Given this assertion, we obtain that Z{m} is isomorphic to a direct summand of U (Q)F by applying Theorem 3.1 to the case where X = Q and l = k + 1. Before proving Lemma 4.4, we make an intermediate calculation: Sublemma 4.5. In the above situation, the integer  α := dim(q) − dim(p) + i1 (p) − 2s − i1 (q) is positive. Proof. Let F = F0 ⊂ F1 ⊂ · · · ⊂ Fh(q) be the Knebusch splitting tower of q, and let r ∈ [0, h(q) − 1] be such that jr+1 (q) = i (see §2.D). Since we are assuming that (4.1) does not hold, the proof of Lemma 4.2 shows that dim(p) − i1 (p) = dim(qr ) − i1 (qr ) = dim(q) − i − jr (q) = dim(q) − (2s + 1) − jr (q), (4.3) and so α = jr (q) − i1 (q) + 1. Since jr (q) ≥ i1 (q) if and only if r ≥ 1, the claim therefore amounts to the assertion that r 6= 0. Suppose, for the sake of contradiction, that this is not the case. Then we have i1 (q) = j1 (q) = i = 2s + 1. On the other hand, since j0 (q) = 0, (4.3) then becomes dim(q) − i1 (q) = dim(p) − i1 (p), and so i1 (q) ≤ 2s by Karpenko’s theorem (see Theorem 1.2) and the definition of s. We thus conclude that our supposition was incorrect, and so our claim is valid.  Proof of Lemma 4.4. We begin by observing that we can write  (4.4) dim(q) − i1 (q) = dim(p) − i1 (p) + 2s + α, where, as above,  α = dim(q) − dim(p) + i1 (p) − 2s − i1 (q). By Sublemma 4.5, α is positive. On the other hand, since (4.1) fails to hold, the integer  dim(q) − dim(p) + i1 (p) − 2s is strictly less than i = 2s + 1. Since i1 (q) ≥ 1, we conclude that 0 < α < 2s . Now, by the very definition of s, we have dim(p) − i1 (p) = 2b1 − 2b2 + · · · + (−1)u−2 2bu−1 + (−1)u−1 2s for unique integers b1 > b2 > · · · > bu−1 > s + 1 ≥ 1. Adding 2s , we see that ( 2b1 − 2b2 + · · · + 2bu−1 if u is even dim(p) − i1 (p) + 2s = b b b s+1 1 2 u−1 2 − 2 + ··· − 2 +2 if u is odd. Irrespective of whether u is odd or even, it follows that dim(p) − i1 (p) + 2s = 2r1 − 2r2 + · · · + 2rk−1 − 2rk for some even integer k and integers r1 > r2 > · · · > rk−1 > rk > s. At the same time, since 0 < α < 2s , we can write α = 2rk+1 − 2rk+2 + · · · + (−1)t−1 2rt for uniquely determined integers s ≥ rk+1 > rk+2 > · · · > rt−1 > rt + 1 ≥ 1. By (4.4), we then have   dim(q) − i1 (q) = 2r1 − 2r2 + · · · + 2rk−1 − 2rk + 2rk+1 − 2rk+2 + · · · + (−1)t−1 2rt , 13 and this is precisely the description of dim(q) − i1 (q) as an alternating sum of 2-powers which appears in the statement of the lemma. Since m = (dim(p) − i1 (p) + 2s )/2 by definition, we are done.  With the lemma proved, we have shown that the non-isomorphic indecomposable direct summands U (Q) and U (P ){2s } of M (Q) admit a common Tate motive in their respective decompositions after scalar extension to F , thus providing us with the needed contradiction. This completes the induction step and so the theorem is proved.  Remark 4.6. Theorem 4.1 is indeed a non-trivial refinement of Theorem 1.3 in the characteristic 6= 2 setting. For example, if p is odd-dimensional, then the integer i1 (p) − 2s is negative by Theorem 1.2, and so we get a slightly better result in this case. 5. Some preliminaries in characteristic 2 We now turn to the case of quasilinear quadratic forms in characteristic 2. We begin by collecting some preliminary results to be used later on. For detailed expositions of the basic theory of quasilinear quadratic forms, the reader is referred to [Hof04] and [Scu14]. For the remainder of this section, F will now denote an arbitrary field of characteristic 2. 5.A. The representation theorem. It is well known that an anisotropic quadratic form over an arbitrary field can be recovered (up to isometry) from the set of values that it represents over every extension of that field (see [EKM08, Thm. 17.12]) In the quasilinear setting, an anisotropic form can already be recovered from the set of values that it represents over the base field. Indeed, we have the following simple observation: Proposition 5.1 (cf. [HL04, Prop. 8.1]). Let p and q be quasilinear quadratic forms over F . Then pan ⊂ qan if and only if D(p) ⊆ D(q). In particular, pan ≃ qan if and only if D(p) = D(q). We will need the following easy consequence of Proposition 5.1: Corollary 5.2 (cf. [HL04, Prop. 8.1]). Let q be a quasilinear quadratic form over F and let L be a field extension of F . Then there exists a subform r ⊂ qan such that rL ≃ (qL )an . Proof. D(qL ) is obviously spanned as an L2 -vector space by elements of D(q). If a1 , . . . , an ∈ D(q) form a basis of D(qL ) over L2 , then Proposition 5.1 shows that r = ha1 , . . . , an i is a subform of qan having the required property.  5.B. Inseparable quadratic extensions. We will make use of some basic results concerning the behaviour of quasilinear quadratic forms under scalar extension to an inseparable quadratic extension of the ground field. We first note the following statement, which is a direct consequence of the additivity property of quasilinear quadratic forms. Lemma 5.3 √ (cf. [Scu16, Lem. 3.8]). Let q be a quasilinear quadratic form over F , and let K = F ( a) for some a ∈ F \ F 2 . Then D(qK ) = D(q) + aD(q) (as subsets of K). The following result elaborates upon Lemma 5.2 in the case where L is an inseparable quadratic extension of F , and is directly analogous to a standard result in the characteristic 6= 2 theory (see [EKM08, Cor. 22.12]): Lemma 5.4 (cf. [Hof04,√Prop. 5.10]). Let q be an anisotropic quasilinear quadratic form over F and let K = F ( a) for some a ∈ F \ F 2 . If i0 (qK ) = n, and r ⊂ q is such that rK ≃ (qK )an , then there exist elements b1 , . . . , bn ∈ D(r) such that q ≃ r ⊥ ahb1 , . . . , bn i. 14 STEPHEN SCULLY 5.C. Quasi-Pfister forms. Let π be a quasi-Pfister form over F (see §2.E above). Then π is round, i.e, D(q) = G(q). In particular, the set D(q) is not only an F 2 -linear subspace of F , it is an F 2 -linear subfield of F (recall that the similarity factors of any form over F constitute a subgroup of F ∗ ). Moreover, this property characterises anisotropic quasiPfister forms over F , since such forms are characterised by their roundness. 5.D. The norm form. (see [HL04, §8], [Hof04, §4]) Let q be a quasilinear quadratic form over F . The norm field of q, denoted N (q), is defined as the smallest subfield of F containing all ratios of non-zero elements of D(q). Evidently, we have N (aq) = N (q) for all a ∈ F ∗ . Note also that F 2 ⊆ N (q) by definition. Thus, by §5.C, there exists, up to isometry, a unique anisotropic quasi-Pfister form qnor over F with the property that D(qnor ) = N (q). This form is called the norm form of q. Note that if a is any non-zero element of F represented by q, then aqan ⊂ qnor . Indeed, this follows from Proposition 5.1 in light of the obvious inclusion D(aqan ) = aD(q) ⊆ N (q) = D(qnor ). The dimension of qnor is an important invariant known as the norm degree of q. In what follows, it will be more convenient to work with itsbase-2 logarithm which we denote by lndeg(q). In other words, lndeg(q) = log2 dim(qnor ) = log2 [N (q) : F 2 ]. We will need the following lemma: Lemma 5.5 (cf. [HL04, Thm. 8.11 (i)]). Let p be a quasilinear quadratic form over F . Then lndeg(pi ) = lndeg(p) − i for all 1 ≤ i ≤ h(p). 5.E. Similarity factors. (see [Hof04, §6]) Another direct consequence of Proposition 5.1 is the following statement concerning similarity factors: Lemma 5.6 (cf. [Hof04, Lem. 6.3]). Let q be a quasilinear quadratic form over F , and let a ∈ F ∗ . Then a ∈ G(q) if and only if aD(q) = D(q). Note that because q is quasilinear, the condition of the preceding lemma is closed under addition. Since G(q) \ {0} is a subgroup of F ∗ , it follows that G(q) is a subfield of F . 5.F. Divisibility by quasi-Pfister forms. Our main results on the isotropy behaviour of quasilinear quadratic forms over function fields of quadrics will be obtained by studying the extent to which certain forms are divisible by quasi-Pfister forms. With this in mind, it is useful to introduce some related terminology (see [Scu14, §2.11]): Given a quasilinear quadratic form q over F , we define its divisibility index, denoted d0 (q), to be the largest non-negative integer s such that qan is divisible by an s-fold quasiPfister form. The higher divisibility indices of q, d1 (q), d2 (q), . . . , dh(q) (q), are defined as the divisibility indices of the higher anisotropic kernel forms q1 , q2 , . . . , qh(q) , respectively. It will be worth recording the following easy calculation from [Scu14]: Lemma 5.7 (cf. [Scu14, Lem. 2.35]). Let q be a quasilinear quadratic form over F and let L be a purely transcendental field extension of F . Then d0 (qL ) = d0 (q). In particular, the higher divisibility indices of any quasilinear quadratic form are insensitive to purely transcendental field extensions. We will need some further observations regarding the above notion of divisibility. The first of these is analogous to a standard result ([Kah08, Cor. 2.1.11]) regarding divisibility of non-degenerate quadratic forms by Pfister forms over fields of characteristic 6= 2: Lemma 5.8 (cf. [Hof04, Prop. 4.19]). Let q be a quasilinear quadratic form and π an anisotropic quasi-Pfister form over F . If q is divisible by π, then qan is also divisible by π. Next, it is well known that if char(F ) 6= 2, then an anisotropic quadratic form q over F is divisible by an anisotropic Pfister form π if and only if D(πK ) ⊆ G(qK ) for every field 15 extension K/F (see [EKM08, Thm. 20.16 and Cor. 23.6]). In the quasilinear setting, this condition can already be checked over the base field (compare Proposition 5.1): Proposition 5.9 (cf. [Hof04, Prop. 6.4], [Scu14, Cor. 2.20]). Let q be an anisotropic quasilinear quadratic form and π an anisotropic quasi-Pfister form over F . Then q is divisible by π if and only if D(π) ⊆ G(q). This has the following consequence: Corollary 5.10. Let q and p be anisotropic quasilinear quadratic forms over F . Then q is divisible by pnor if and only if (q ⊗ p)an is similar to q. Proof. Let a0 , a1 , . . . , an ∈ F ∗ be such that p ≃ ha0 , a1 , . . . , an i. By Proposition 5.9 and thedefinition of pnor , q is divisible by pnor if and only if N (p) ⊆ G(q). But N (p) = F 2 aa01 , . . . , aan0 , and, since G(q) is a subfield of F containing F 2 (see §5.E), we see that q is divisible by pnor if and only if ai a−1 0 ∈ G(q) for all 1 ≤ i ≤ n. By Lemma 5.6, this is equivalent to the assertion that ai a−1 0 D(q) = D(q) for all 1 ≤ i ≤ n. Since D(q) is a finite-dimensional F 2 -linear subspace of F , these equalities hold if and only if n X ai a−1 0 D(q) ⊆ D(q). Pn −1 i=0 ai a0 D(q) i=0 −1 = D(a0 q⊗p), so by Proposition 5.1, the preceding inclusion amounts (q ⊗ p)an ⊂ a0 q. On the other hand, Proposition 5.1 also shows that But to the assertion that a0 q is a subform of (q ⊗ p)an . Thus, we see that q is divisible by pnor if and only if a0 q ≃ q ⊗ pan , which proves the desired assertion.  5.G. Isotropy of quasilinear quadratic forms under field extensions. We record here some basic observations regarding the isotropy behaviour of quasilinear quadratic forms under field extensions. The first concerns separable extensions (here, when we say that L is a separable extension of F , we mean that for any algebraic closure F of F , the ring L ⊗F F has no nilpotent elements): Lemma 5.11 (cf. [Hof04, Prop. 5.3]). Let q be an anisotropic quasilinear quadratic form over F . If L is a separable field extension of F , then qL is anisotropic. In particular, anisotropic forms remain anisotropic under purely transcendental field extensions. Secondly, we will need a slightly more subtle result regarding function fields of (affine) hypersurfaces. Let T = (T1 , . . . , Tm ) be a system of algebraically independent variables over F , let g ∈ F [T ] be an irreducible polynomial and let F [g] denote the fraction field of the integral domain F [T ]/(g) (i.e., the function field of the integral affine hypersurface {g = 0} ⊂ Am F ). Given an element f ∈ F [T ], let us write multg (f ) for the largest non-negative integer s such that f = gs h for some h ∈ F [T ] (with the added convention that multg (0) = +∞). Then we have the following: Lemma 5.12 (cf. [Scu14, Prop. 2.33]). In the above situation, let q be a quasilinear quadratic form and let f ∈ F [T ]. Suppose that f ∈ D(qF (T ) ) and that qF [g] is anisotropic. Then multg (f ) ≡ 0 (mod 2). For m = 1, the assertion of Lemma 5.12 holds for arbitrary quadratic forms in arbitrary characteristic. Indeed, this may be deduced as an easy consequence of the fundamental “representation theorem” of Cassels and Pfister ([EKM08, Thm. 17.3]). For m > 1, however, the statement is peculiar to the quasilinear case; as observed by Hoffmann ([Hof04, Cor. 3.4]), one may use here the additivity of quasilinear quadratic forms to generalize the Cassels-Pfister theorem to the following stronger multi-variable statement: 16 STEPHEN SCULLY Theorem 5.13 (Hoffmann, cf. [Hof04, Cor. 3.4]). Let q be a quasilinear quadratic form over F , let T = (T1 , . . . , Tn ) be a system of algebraically independent variables over F and let f ∈ F [T ]. If f ∈ D(qF (T ) ), then f ∈ D(qF [T ] ). 6. Main results: The quasilinear case In this final section we prove several new results concerning the isotropy behaviour of quasilinear quadratic forms over function fields of (totally singular) quadrics. The main result is Theorem 6.6, from which a number of interesting statements, including the quasilinear part of Theorem 1.3, follow formally. This theorem is essentially a generalization of [Scu14, Thm. 5.1], and its proof follows that of the latter closely. However, certain adjustments are needed along the way to facilitate the extra generality. Among them, we need to work with certain “generic subforms” of a given anisotropic form. We therefore begin with a brief discussion around this idea. As in the previous section, F will denote an arbitrary field of characteristic 2 throughout. 6.A. Generic subforms. The following lemma is well known, though we do not have a precise reference for it: Lemma 6.1. Let k be a field and let f : X → Y be a proper morphism of k-schemes with Y irreducible. If the generic fibre of f has a rational point, then every fibre of f over the regular locus of Y has a rational point. Remark 6.2. Here we are regarding the fibre over a point y ∈ Y as a scheme over the residue field k(y). In particular, a rational point of f −1 (y) means a k(y)-point of f −1 (y). Proof. Assume that the generic fibre of f has a rational point, and let y be a regular point of Y with reduced closure Z in Y . If Z has codimension 1 in Y , then OY,y is a discrete valuation ring, and the statement follows from [Gro61, (7.3.8)] Otherwise, the regularity of OY,y implies that y is a regular point of some codimension-1 integral closed subvariety of Y . The statement therefore follows by induction on the codimension of Z in Y .  Using this, we can prove the following existence statement which will be needed for the proof of Theorem 6.6 below: Lemma 6.3. Let p be an anisotropic quasilinear quadratic form of dimension ≥ 2 over F such that 1 ∈ D(p). Then there exist a purely transcendental field extension L of F and a codimension-1 subform p′ ⊂ pL such that (1) L[p′ ] is a purely transcendental extension of F (p). (2) pL ≃ h1i ⊥ p′ . Remark 6.4. We remind the reader that L[p′ ] denotes here the function field of the affine (as opposed to projective) hypersurface defined by the vanishing of p′ over L. Proof. We construct the generic such p′ (compare [Tot08, Lem. 4.2]) Let q = h1i ⊥ p with underlying vector space ℓ ⊕ Vp , and let P ⊂ P(Vp ) and Q ⊂ P(ℓ ⊕ Vp ) denote the projective F -quadrics defined by the vanishing of p and q, respectively. Let Y denote the Grassmannian of hyperplanes in Vp and consider the closed subschemes and I1 = {(x, H) ∈ P × Y | x ∈ P(H)} I2 = {(x, H) ∈ Q × Y | x ∈ P(ℓ ⊕ H)} of P × Y and Q × Y , respectively. Then the generic fibre P ′ of the canonical projection I1 → Y is the projective quadric defined by the vanishing of a codimension-1 subform 17 p′ ⊂ pL , where L = F (Y ). Since Y is a rational F -variety, L is a purely transcendental extension of F . We claim that p′ satisfies conditions (1) and (2). For (1), it suffices to show that L(p′ ) is a purely transcendental extension of F (p) (L[p′ ] is a purely transcendental extension of L(p′ ) – see 2.C). Note, however, that L(p′ ) is also canonically F -isomorphic to the function field of the generic fibre of the projection I1 → P . As the latter fibre is nothing else but the projective space of hyperplanes in P(Vp ⊗F F (p) containing the  canonical rational point of P ×F Spec F (p) , (1) follows. For (2), note that since p is a quasilinear quadratic form representing 1, we have D(h1i ⊥ p′ ) ⊂ D(pL ). As pL is anisotropic, Proposition 5.1 implies that (h1i ⊥ p′ )an ⊂ pL , so by dimension reasons it will be enough to check that h1i ⊥ p′ is anisotropic. But the vanishing locus of h1i ⊥ p′ is nothing else but the generic fibre of the canonical projection from the second incidence scheme I2 to Y . Since the latter projection is (i) proper (as Q is projective over F ) and (ii) has fibres over regular points which do not posses a rational point (because p is anisotropic, there exists a hyperplane of Vp where p does not represent 1), its generic fibre admits no rational point by Lemma 6.1. In other words, h1i ⊥ p′ is anisotropic, as claimed.  Remark 6.5. In the situation of Lemma 6.3, let pb ⊂ p be such that p ≃ h1i ⊥ pb. If i1 (p) > 1, then it has been shown by Totaro ([Tot08, Thm. 6.4]) that assertion (1) holds with L = F and p′ = pb, i.e., that F [b p] is F -isomorphic to F (p) (see also [Scu14, Cor. 3.9]). We will not use this fact in what follows. 6.B. A subform condition for isotropy of quasilinear quadratic forms over the function field of a quadric. The following theorem is the main result of this section; we remark that if i1 (p) > 1, then the “up to replacing F with a purely transcendental extension of itself” qualification may be removed – see Remark 6.10 below: Theorem 6.6. Let p and q be anisotropic quasilinear quadratic forms of dimension ≥ 2 over F . If qF (p) is isotropic, then, up to replacing F with a purely transcendental extension of itself, there exists an anisotropic quasilinear quadratic form τ over F (p) such that (1) dim(τ ) = i0 (qF (p) ), and (2) (p1 ⊗ τ )an ⊂ (qF (p) )an . Proof. After multiplying q and p by appropriate scalars if necessary, we may assume that both forms represent 1. By Lemma 6.3, we can then find a purely transcendental field extension L of F and a subform p′ ⊂ pL such that pL ≃ h1i ⊥ p′ and such that the affine function field L[p′ ] is a purely transcendental extension of F (p). We fix such a pair (L, p′ ) ∗ for the remainder of the proof. Now, Pn let us2 choose elements a1 , . . . , an ∈ L such that ′ ′ p ≃ ha1 , . . . , an i, and set p (T ) = i=1 ai Ti ∈ L[T ], where T = (T1 , . . . , Tn ) is a system ′ of algebraically independent variables over L. Then the  field L[p ] may be identified with ′ the fraction field of the integral domain L[T ]/ p (T ) (see §2.C above). Fixing this identification henceforth, we will write f for the image of a given polynomial f ∈ L[T ] under the canonical projection L[T ] → L[p′ ]. For such a polynomial f , we will also write m(f ) for the multiplicity of p′ (T ) in f , i.e., the largest integer k such that f = p′ (T )k h for some h ∈ L[T ]. Note that we have m(f ) = 0 if and only if f 6= 0 in L[p′ ]. To simplify the notation, we now let i = i0 (qF (p)). By hypothesis, we have i > 0. The proof of Theorem 6.6 begins with the following lemma: Lemma 6.7. Assume we are in the above situation. Then there exists a subform r ⊂ q and elements f1 , . . . , fi ∈ D(rL[T ] ) such that: (1) rF (p) ≃ (qF (p) )an . 18 STEPHEN SCULLY (2) rL[p′ ] is anisotropic. (3) qL(T ) ≃ rL(T ) ⊥ p′ (T )hf1 , . . . , fi i. (4) The form τ = hf1 , . . . , fi i (defined over L[p′ ]) is anisotropic. Proof. The existence of a subform r ⊂ q satisfying (1) is ensured by Corollary 5.2. Since L[p′ ] is a purely transcendental extension of F (p), any such r also satisfies (2) in view of Lemma 5.11. Now, as L is a purely transcendental extension of F , the field L[p] is a purely transcendental extension of F [p], and hence of F (p). Another application  of Lemma  5.11 p p′ (T ) (see therefore shows that rL[p] ≃ (qL[p] )an . Since L[p] is L-isomorphic to L(T ) §2.C above), Lemma 5.4 then implies that qL(T ) ≃ rL(T ) ⊥ p′ (T )hf1 , . . . , fi i for some f1 , . . . , fi ∈ D(rL(T ) ). Multiplying the fi by squares in L[T ] if necessary, we may arrange it so that fi ∈ D(rL[T ] ) for all i. Thus, there exists a sequence f1 , . . . , fi ∈ D(rL[T ] ) P for which (3) holds. Among all such sequences, let us choose one for which ii=1 degT1 fi is minimal where, for a non-zero polynomial f ∈ L[T ], degT1 (f ) denotes  the degree of f viewed as a polynomial in the variable T1 over the field L(T2 , . . . , Tn ) . We claim that for this choice of f1 , . . . , fi , (4) also holds. Suppose, for the sake of contradiction, that this is not the case, i.e., that the form hf1 , . . . , fi i is isotropic over L[p′ ]. Then there exist polynomials h1 , . . . , hi , h ∈ L[T ] such that Pn 2 ′ (i) i=1 hi fi = p (T )h in L[T ]. (ii) degT1 (hi ) < 2 for all i. (iii) hi 6= 0 for at least one i. Indeed, (i) andP (iii) amount to the stated isotropy of the form, while (ii) can be arranged because T12 = ni=2 aa1i Ti2 in the field L[p′ ]. Now, as D(rL(T ) ) is closed under addition, we have p′ (T )h ∈ D(rL(T ) ) by (i) and the choice of the fi . Since rL[p′ ] is anisotropic, Lemma 5.12 implies that h = p′ (T )h′ for some h′ ∈ L[T ]. Note here that h′ 6= 0. Indeed, if this were not the case, then (i) and (iii) would imply that hf1 , . . . , fi i is isotropic over L(T ); since the latter form is similar to a subform of the anisotropic form qL(T ) , this is not so. Furthermore, since p′ (T )2 h′ = p′ (T )h ∈ D(rL(T ) ), and since D(rL(T ) ) is closed under multiplication by squares in L(T ), we have h′ ∈ D(rL(T ) ). Taking the generalized Cassels-Pfister representation theorem for quasilinear quadratic forms into account (Theorem 5.13), we see that, in fact, h′ ∈ D(rL[T ] ). Now, by (iii), there exists an integer l ∈ {1, . . . , i} such that hl 6= 0. Among all such l, let us choose one so that  the integer degT1 (h2l fl ) is maximal. Since hl , h′ 6= 0, Proposition 5.1 together with (i) implies that hf1 , . . . , fi i ≃ hf1 , . . . , fl−1 , p′ (T )2 h′ , fl+1 , . . . , fi i ≃ hf1 , . . . , fl−1 , h′ , fl+1 , . . . , fi i as forms over L(T ). In other words, f1 , . . . , fl−1 , h′ , fl+1 , . . . , fi is a sequence of non-zero elements  ′ in D(rL[T ] ) satisfying condition (3). But, since degT1 p (T ) = 2, (i), (ii) and the choice of l imply that degT1 (h′ ) < degT1 (fl ), and this contradicts our original choice of the fi . We conclude that our supposition was incorrect, and so the lemma is proved.  Let us now fix a subform r ⊂ q and elements f1 , . . . , fi ∈ D(rL[T ] ) satisfying the four conditions of Lemma 6.7. Since L[p′ ] is a purely transcendental extension of F (p), Theorem 6.6 now follows from the following more precise lemma: Lemma 6.8. Let K = L[p′ ]. Then, in the above situation, we have  (p1 )K ⊗ hf1 , . . . , fi i an ⊂ (qK )an 19 Proof. By Proposition 5.1, the statement is equivalent to the assertion that  D (p1 )K ⊗ hf1 , . . . , fi i ⊂ D(qK ). As both sides are K 2 -vector spaces, it suffices to show that the right-hand side contains  a set of generators for the left-hand side. Since D (p1 )K is generated by D(pL ) over K 2 , it is therefore sufficient to show that bfi ∈ D(qK ) for all b ∈ D(pL ) and all 1 ≤ i ≤ i. In fact, it suffices to show this in the case where b ∈ D(pL ) \ D(p′ ). Indeed, if b ∈ D(p′ ), then 1 + b ∈ D(pL ) \ D(p′ ); since D(qK ) is a K 2 -vector space which (by construction) contains fi , we have bfi ∈ D(qK ) ⇔ (1 + b)fi ∈ D(qK ). Now, in order to check that the statement holds, we first need the following preliminary calculation: Sublemma 6.9. Assume we are in the above situation, and let b ∈ D(pL ) \ D(p′ ) and 1 ≤ i ≤ i. Then there exist si,j ∈ D(rL[T ] ) and ti,j ∈ L[T ] \ {0} (0 ≤ j ≤ 1) such that: (1) bfi = si,0 t2i,0 + si,1 p′ (T ) t2i,1 b in L(T ). (2) For each j ∈ {0, 1}, at least one of si,j and ti,j is a non-zero element of K = L[p′ ].  q p′ (T ) . By Proof. For simplicity of notation, let f = fi . Consider the field M = L(T ) b §2.C, M may be identified with the function field L[η] of the affine quadric over L defined by the vanishing of η = hbi ⊥ p′ . Since pL = h1i ⊥ p′ , and since b ∈ D(pL ) \ D(p′ ), we have D(η) = D(pL ). In view of Proposition 5.1, it follows that η ≃ pL . In particular, M is a degree-1 purely transcendental extension of L(p) (see §2.C), and is thus a purely transcendental extension of F (p). By Lemma 5.11 and the choice of r, it follows that rM ≃ (qM )an . Again, by Proposition 5.1, this means that D(qM ) = D(rM ). Now, since ′ ′ ) is a square in M , we have bf = p (Tu )f ∈ D(qM ), and so bf ∈ D(rM ). Since u = p (T b D(rM ) = D(rL(T ) ) + uD(rL(T ) ) = D(rL(T ) ) + p′ (T ) D(rL(T ) ) b ′ ) as a subset of L(T ) (see Lemma 5.3), it follows that we can write bf = q0 +q1 p (T for some b q0 , q1 ∈ D(rL(T ) ). Because every element of D(rL(T ) ) is evidently the ratio of an element of D(rL[T ] ) and a non-zero square in L[T ], we can therefore find elements sj ∈ D(rL[T ] ) and tj ∈ L[T ] \ {0} (0 ≤ j ≤ 1) so that (6.1) bf = s0 s1 p′ (T ) + 2 t20 t1 b  in L(T ). Now, for each j ∈ {0, 1}, let mj = min m(sj ), 2m(tj ) (with m(sj ), m(tj ) defined as in the beginning of the proof). Since rK is anisotropic, Lemma 5.12 shows that the m(sj ), and hence the mj , are even. In particular, if we let s′j = sj ′ p (T )mj and t′j = tj , ′ p (T )mj /2 then s′j ∈ D(rL[T ] ) and t′j ∈ L[T ] \ {0} for each j. Replacing the pair (s0 , t0 ) with (s′0 , t′0 ) and the pair (s1 , t1 ) with (s′1 , t′1 ) (this does not alter (6.1)), we arrive at the situation where  each of the pairs (s0 , t0 ) and (s1 , t1 ) has at least one non-zero entry, as we wanted. Returning to the proof of Lemma 6.8, let b ∈ D(pL ) \ D(p′ ) and let 1 ≤ i ≤ i. By Sublemma 6.9, we have si,0 si,1 p′ (T ) bfi = 2 + 2 ti,0 ti,1 b 20 STEPHEN SCULLY for some si,j ∈ D(rL[T ] ) and ti,j ∈ L[T ] \ {0} (0 ≤ j ≤ 1) such that each of the pairs (si,0 , ti,0 ) and (si,1 , ti,1 ) has at least one non-zero entry. We claim that both ti,0 and ti,1 are non-zero, or, equivalently, that m(ti,j ) = 0 for each j. To see this, let us first clear denominators in the preceding equation to obtain the equality (6.2) bfi t2i,0 t2i,1 = si,0 t2i,1 + si,1 t2i,0 p′ (T ) b  in the polynomial ring L[T ]. Now, let m = min m(ti,0 ), m(ti,1 ) . Our claim is then equivalent to the assertion that m = m(ti,0 ) + m(ti,1 ). Suppose that this is not the case, and let j ∈ {0, 1} be minimal so that m(ti,l ) = m, where l is the integer complementary to j in {0, 1}. Then, reducing both sides of (6.2) modulo p′ (T )2m+j+1 , we see that si,j ≡ 0 (mod p′ (T )), i.e., that si,j = 0. Since the pair (si,j , ti,j ) has at least one non-zero entry, it follows that ti,j 6= 0, or, equivalently, that m(ti,j ) = 0. But then m = m(ti,0 ) + m(ti,1 ), which contradicts our supposition. The claim is therefore valid, and so, reducing (6.2) modulo p′ (T ) and dividing through by (t1,0 ti,1 )2 , we obtain that bfi = si,0 /ti,0 2 in K. As si,0 ∈ D(rL[T ] ) ⊂ D(qL[T ] ), this shows that bfi ∈ D(qK ), as we needed. As per the above discussion, Theorem 6.6 is now proved.   Remark 6.10. As already mentioned, if i1 (p) > 1, then “up to replacing F with a purely transcendental extension of itself” may be removed from the statement of Theorem 6.6. Indeed, if p ≃ h1i ⊥ pb and i1 (p) > 1, then we can choose (F, pb) for the pair (L, p′ ) which was used throughout the proof – see Remark 6.5 above. It is unclear to the author whether the qualification is really needed when i1 (p) = 1. In any case, the statement which we have proved is sufficient for the basic applications. 6.C. Applications. We now provide some concrete applications of Theorem 6.6 to the problem of understanding the splitting behaviour of quasilinear quadratic forms under scalar extension to the function field of a quadric. In particular, we will prove the quasilinear case of Theorem 1.3. The reader will note that, in this case, the form p1 plays a similar role to that played by the upper motive of the quadric P in the proof of the characteristic 6= 2 case given in §4 above. It will be of particular importance to remember that p1 has dimension dim(p) − i1 (p) in the quasilinear setting, as opposed to the more familiar dim(p) − 2i1 (p); indeed, if φ is any non-zero quasilinear quadratic form over F , then dim(φan ) = dim(φ) − i0 (φ) (see §2.B above). The “divisibility indices” introduced in §5.F will also have a key role to play here; in effect, the study of these indices replaces the (implicit) use of mod-2 Steenrod operations on Chow groups in the characteristic 6= 2 setting. Before proceeding, we make a general remark: Remark 6.11. Let p and q be anisotropic quadratic forms of dimension ≥ 2 over F with q quasilinear. If p is not quasilinear, then its associated quadric is generically smooth, which amounts to the assertion that its function field F (p) is a separable extension of F (see [Gro67, (17.15.9)]). In view of Lemma 6.1, we therefore have i0 (qF (p) ) = 0 in this case. As a result, when studying the isotropy behaviour of the quasilinear form q under scalar extension to the field F (p), the only case of interest is that where p is also quasilinear. The first interesting application of Theorem 6.6 is Theorem 6.14 below, from which one obtains a short proof of the quasilinear part of Theorem 1.1. Before proving Theorem 6.14, we first make the following quick observation: 21 Lemma 6.12. Let ψ and φ be anisotropic quasilinear quadratic forms over F , and let L be a purely transcendental field extension of F . If ψL is similar to a subform of φL , then ψ is similar to a subform of φ. Proof. If F is finite, then F is perfect and so ψ and φ are necessarily split (i.e., 1dimensional). Since the statement is trivial in this case, we may assume that F is infinite. Furthermore, the problem can be easily reduced to the case where L has finite transcendence degree over F using Proposition 5.1. We can therefore also assume that L = F (T ), where T = (T1 , . . . , Tn ) is a system of algebraically independent variables over F . Now, if ψL is similar to a subform of φL , then we can evidently find a polynomial f (T ) ∈ F [T ] such that f (T )ψL ⊂ φL . Since F is infinite, there exist scalars a1 , . . . , an ∈ F such that f (a1 , . . . , an ) 6= 0. Letting a = f (a1 , . . . , an ), we now claim that aψ ⊂ φ. By Proposition 5.1, it suffices to show that ab ∈ D(φ) for all b ∈ D(ψ). Since f (T )ψL ⊂ φL , we certainly have f (T )b ∈ D(φL ). By the generalized Cassels-Pfister representation theorem for quasilinear forms (Theorem 5.13), it follows that f (T )b ∈ D(φF [T ] ). The claim then follows by performing the specialization (T1 , . . . , Tn ) 99K (a1 , . . . , an ), which is well defined on the polynomial ring F [T ].  Remark 6.13. In fact, the quasilinearity hypothesis is not necessary here; one may show that the statement holds for an arbitrary pair of anisotropic quadratic forms over a field of any characteristic using induction on the transcendence degree of L and the general representation theorems of Pfister ([EKM08, Thm. 17.12]) and Cassels-Pfister ([EKM08, Thm. 17.3]). We refrain from going into the details here. Theorem 6.14. Let p and q be anisotropic quasilinear quadratic forms of dimension ≥ 2 over F . If qF (p) is isotropic, then p1 is similar to a subform of (qF (p) )an . Proof. By Lemma 6.12, it is sufficient to show this after replacing F with a purely transcendental extension of itself. By Theorem 6.6, we may therefore assume that there exists an anisotropic form τ of dimension i0 (qF (p) ) ≥ 1 over F (p) such that (p1 ⊗ τ )an ⊂ (qF (p) )an . If a ∈ D(τ ), then D(ap1 ) ⊆ D(p1 ⊗ τ ) ⊂ D(qF (p) ). Since p1 is anisotropic, Proposition 5.1 then implies that ap1 ⊂ (qF (p) )an , which proves the theorem.  As a consequence of Theorem 6.14, we get an elegant explanation for the quasilinear part of Theorem 1.1. This result was originally proved by Totaro in [Tot08] using the basic machinery of Chow groups (see [loc. cit., Thm. 5.2]); a more elementary proof (rather different to the one presented here) was later given in [Scu13]: Corollary 6.15 (Totaro). Let p and q be anisotropic quasilinear quadratic forms of dimension ≥ 2 over F . If qF (p) is isotropic, then i0 (qF (p) ) ≤ dim(q) − dim(p) + i1 (p). Proof. By Theorem 6.14, p1 is similar to a subform of (qF (p) )an . In particular, we have dim(p) − i1 (p) = dim(p1 ) ≤ dim((qF (p) )an ) = dim(q) − i0 (qF (p ). Rearranging this inequality, we obtain the desired assertion.  The next applications make use of the fact that the form τ appearing in the statement of Theorem 6.6 has dimension at least i0 (qF (p) ). We begin by re-deriving the main result of [Scu14]. This result was used in [loc. cit., §6.1] to determine all possible values of the Knebusch splitting pattern for quasilinear forms. This includes the quasilinear part of Theorem 1.2, which is an immediate dimension-theoretic consequence: Corollary 6.16 ([Scu14, Thm. 5.1]). Let p be an anisotropic quasilinear quadratic form of dimension ≥ 2 over F . Then 2d1 (p) ≥ i1 (p). In other words, p1 is divisible by a quasi-Pfister form of dimension ≥ i1 (p). 22 STEPHEN SCULLY Proof. By Lemma 5.7, the statement is insensitive to replacing F with a purely transcendental extension of itself. Applying Theorem 6.6 to the case where p = q, we can therefore assume that we have an anisotropic form τ of dimension i1 (p) over F (p) such that (p1 ⊗ τ )an ⊂ p1 . As per the proof of Theorem 6.14, however, p1 is similar to a subform of (p1 ⊗ τ )an . For dimension reasons, we therefore conclude that p1 ≃ (p1 ⊗ τ )an . By Corollary 5.10, this implies that p1 is divisible by the quasi-Pfister form τnor . But, since τ is anisotropic, τ is similar to a subform of τnor (see §5.D). In particular, we have dim(τnor ) ≥ dim(τ ) = i1 (p), and this completes the proof.  Given Corollary 6.16, we can now generalize it as follows: Theorem 6.17. Let p and q be anisotropic quasilinear quadratic forms of dimension ≥ 2 over F such that qF (p) is isotropic. If i0 (qF (p) ) > dim(q) − dim(p), then 2d1 (p) ≥ i0 (qF (p) ). In other words, p1 is divisible by a quasi-Pfister form of dimension ≥ i0 (qF (p) ) under the given hypotheses. Proof. Again, by Lemma 5.7, the statement is insensitive to replacing F with a purely transcendental extension of itself. Thus, by Theorem 6.6, we may assume that there exists an anisotropic form τ of dimension i0 (qF (p) ) over F (p) such that (p1 ⊗ τ )an ⊂ (qF (p) )an . Let η = (p1 ⊗ τ )an . As in the proof of Corollary 6.16, p1 is similar to a subform of η, and the theorem will follow (by exactly the same arguments) if we can show that the two forms have the same dimension under the given hypotheses. Suppose, for the sake of contradiction, that this is not the case. Then dim(η) ≥ dim(p1 ) + 2d1 (p) . Indeed, since p1 is, by definition, divisible by an anisotropic quasi-Pfister form of dimension 2d1 (p) , Lemma 5.8 implies that the same is true of η. Thus, both dim(p1 ) and dim(η) are divisible by 2d1 (p) , and so our claim follows. In particular, since η ⊂ (qF (p) )an , we have dim(p) − i1 (p) + 2d1 (p) = dim(p1 ) + 2d1 (p) ≤ dim(η) ≤ dim((qF (p) )an ) = dim(q) − i0 (qF (p) ). Now Corollary 6.16 asserts that 2d1 (p) ≥ i1 (p). Together with the previous inequality, this gives i0 (qF (p) ) ≤ dim(q) − dim(p), which contradicts our original hypothesis and thus completes the proof of the theorem.  Taking dimensions, we obtain the quasilinear part of Theorem 1.3 (in light of Remark 6.11, it is enough to treat the case where both p and q are quasilinear): Corollary 6.18. Let p and q be anisotropic quasilinear  quadratic forms of dimension ≥ 2 over F . Then i0 (qF (p) ) ≤ max dim(q) − dim(p), 2d1 (p) . In particular, setting  s = v2 dim(p) − i1 (p) , we have  i0 (qF (p) ) ≤ max dim(q) − dim(p), 2s . Proof. The first statement follows immediately from Theorem 6.17. The second follows from the first, since 2d1 (p) is, by definition, a divisor of dim(p1 ) = dim(p) − i1 (p).  Remark 6.19. In the situation of Corollary 6.18, the inequality d1 (p) ≤ s need not be an equality. For example, if p is “generic” of dimension 2n + 1 for some positive integer n, then d1 (p) = 0 (see [Scu14, Lem. 2.46]), while s = n by Theorem 1.2. Interestingly, we do not know of an analogue of the integer d1 (p) in the characteristic 6= 2 theory. In fact, the proof of Theorem 6.17 shows that Corollary 6.18 may be refined as follows: 23 Corollary 6.20. Let p and q be anisotropic quasilinear quadratic forms of dimension ≥ 2 over F . Then 2d1 (p) ≥ i1 (p) and  i0 (qF (p) ) ≤ max dim(q) − dim(p) + i1 (p) − 2d1 (p) , 2d1 (p) . Remark 6.21. This refinement is non-trivial if 2d1 (p) > i1 (p), which happens, for example, if p is odd-dimensional and i1 (p) > 1. Indeed, in that case, i1 (p) is odd by Corollary 6.16. Corollary 6.18 above was deduced from the statement of Theorem 6.6 by identifying a certain situation in which the subform (p1 ⊗ τ )an of (qF (p) )an is similar to p1 . Another interesting problem is to find circumstances under which (p1 ⊗ τ )an is similar to τ . As the proof of the next proposition shows, one situation in which this happens is that where i0 (qF (p) ) is “close” to attaining its maximal possible value of dim(q)/2. Unfortunately, formulating what this means in general terms necessitates a certain degree of technicality; we hope, however, that the subsequent discussion will help to illuminate the more concrete meaning of our observation. Before stating the proposition, we recall (see §5.D) that if p is an anisotropic quasilinear form over F , then lndeg(p) denotes the integer log2 dim(pnor ) . Since p is similar to a subform of pnor , we have dim(p) ≤ 2lndeg(p) . Proposition 6.22. Let p and q be anisotropic quasilinear quadratic forms of dimension ≥ 2 over F and let ǫ be the unique integer in [1, 2d1 (p) ] such that i0 (qF (p) )+ǫ ≡ 0 (mod 2d1 (p) ). If dim(q) − 2i0 (qF (p) ) < ǫ, then, after possibly replacing F with a purely transcendental extension of itself, (qF (p) )an contains a subform r such that (1) dim(r) = i0 (qF (p) ). (2) d0 (r) ≥ lndeg(p) − 1, i.e., r is divisible by a quasi-Pfister form of dimension 2lndeg(p)−1 . Proof. By Theorem 6.6, we may assume that there exists an anisotropic form τ of dimension i0 (qF (p) ) over F (p) such that (p1 ⊗ τ )an ⊂ (qF (p) )an . We claim that, under the given hypotheses, τ is similar to η := (p1 ⊗ τ )an . Exactly as in the proof of Theorem 6.14, τ is certainly similar to a subform of η. It therefore suffices to show that dim(τ ) = dim(η). Suppose, for the sake of contradiction, that this is not the case. Then dim(η) ≥ i0 (qF (p) ) + ǫ. Indeed, p1 is, by definition, divisible by a quasi-Pfister form of dimension 2d1 (p) . By Lemma 5.8, the same is therefore true of η. Thus dim(η) is divisible by 2d1 (p) . Since dim(τ ) = i0 (qF (p) ), the inequality dim(η) ≥ i0 (qF (p) ) + ǫ then follows by the very definition of ǫ. But, since η is a subform of (qF (p) )an , this yields i0 (qF (p) ) + ǫ ≤ dim(η) ≤ dim((qF (p) )an ) = dim(q) − i0 (qF (p) ), which contradicts our hypothesis. We can therefore conclude that τ is similar to η = (p1 ⊗ τ )an . By Corollary 5.10, it follows that τ is divisible by the quasi-Pfister form (p1 )nor . But the latter form has dimension 2lndeg(p)−1 by Lemma 5.5. Thus, choosing any a ∈ D(p1 ), we see that r := aτ has the required properties.  Proposition 6.22 immediately gives the following result: Theorem 6.23. Let p and q be anisotropic quasilinear quadratic forms of dimension ≥ 2 over F and let ǫ be the unique integer in [1, 2d1 (p) ] such that i0 (qF (p) ) + ǫ ≡ 0 (mod 2d1 (p) ). Then either , or (1) i0 (qF (p) ) ≤ dim(q)−ǫ 2 (2) i0 (qF (p) ) is divisible by 2lndeg(p)−1 . 24 STEPHEN SCULLY Remark 6.24. By Corollary 6.16, we have 2d1 (p) ≥ i1 (p). Thus, the larger is i1 (p), the more interesting the restrictions of Theorem 6.23 become. Example 6.25. Let p and q be anisotropic quasilinear quadratic forms of dimension ≥ 2 over F such that i0 (qF (p)) = 12 dim(q) (this is the maximal possible value of i0 (qF (p) ), and the situation is analogous to that in characteristic 6= 2 where one form becomes hyperbolic over the function field of the other – see [Scu14, Cor. 2.32]). Then   v2 dim(q) ≥ lndeg(p) ≥ log2 dim(p) , i.e., dim(q) is divisible by a power of 2 which is at least as large as 2lndeg(p) , and hence dim(p) (see §5.D). Indeed, in this situation, we are necessarily in case (2) of Theorem 6.23. Since dim(q) = 2i0 (qF (p) ), the claim follows immediately (in fact, in this case, one can show that q is divisible by the quasi-Pfister form pnor of dimension 2lndeg(p) – see [Hof04, Thm. 7.7]). Theorem 6.23 may therefore be viewed as a generalization of this result, giving us necessary conditions in order for i0 (qF (p) ) to be “close” to its maximal value. Again, the index being “close” to its maximal value is analogous to the situation in characteristic 6= 2 where one form becomes “almost hyperbolic” over the function field of another quadric. In that setting, there are no known general results in the spirit of Theorem 6.23. Example 6.26. We can illuminate Theorem 6.23 further by working through a concrete example, namely, that in which p is an (n + 1)-fold quasi-Pfister neighbour, i.e., dim(p) > 2n and p is similar to a subform of an anisotropic (n + 1)-fold quasi-Pfister form (for example, p could itself be a quasi-Pfister form). In this case, we have d1 (p) = n and lndeg(p) = n + 1 (see [Scu14, Cor. 3.11] for details). Theorem 6.23 therefore implies that if q is an anisotropic quasilinear quadratic form of dimension ≥ 2 over F , then either , or (1) i0 (qF (p) ) ≤ dim(q)−ǫ 2 (2) i0 (qF (p) ) is divisible by 2n , where ǫ is the unique integer in [1, 2n ] such that i0 (qF (p) ) + ǫ ≡ 0 (mod 2n ). Over fields of characteristic 6= 2, the same statement is known to hold in the (very special) case where i0 (qF (p) ) = 12 dim(q); indeed, a classical result due to Arason and Pfister asserts that a quadratic form which becomes hyperbolic over the function field of a Pfister quadric is necessarily divisible by the corresponding Pfister form (see [EKM08, Cor. 23.6]). However, there seems to be no known generalization of this result similar to the one just given for quasilinear forms. Acknowledgements. The author gratefully acknowledges the support of a PIMS postdoctoral fellowship and NSERC discovery grant during the preparation of this article. References [EKM08] R. Elman, N. Karpenko, and A. Merkurjev. The algebraic and geometric theory of quadratic forms. AMS Colloquium Publications, 56, American Mathematical Society, 2008. [Gro61] A. Grothendieck. Éléments de géométrie algébrique (rédigés avec la collaboration de Jean Dieudonné): II. Étude globale élémentaire de quelques classes de morphismes. Publications Mathématiques de l’IHÉS, 8 (1961), 5–222. [Gro67] A. Grothendieck. Éléments de géométrie algébrique (rédigés avec la collaboration de Jean Dieudonné): IV. Étude locale des schémas et des morphismes des schémas, Quatrième partie. Publications Mathématiques de l’IHÉS, 32 (1967), 5–361. 25 [Fit81] R.W. Fitzgerald. Function fields of quadratic forms. Math. Z., 178 (1981), no. 1, 63–76. [Hau13] O. Haution. On the first Steenrod square for Chow groups. Amer. J. Math., 135 (2013), 53–63. [Hau15] O. Haution. Detection by regular schemes in degree two. Algebr. Geom. 2 (2015), no. 1, 44–61. [HL04] D.W. Hoffmann and A. Laghribi. Quadratic forms and Pfister neighbors in characteristic 2. Trans. Amer. Math. Soc., 356 (2004), no. 10, 4019–4053. [HL06] D.W. Hoffmann and A. Laghribi. Isotropy of quadratic forms over the function field of a quadric in characteristic 2. J. Algebra, 295 (2006), no. 2, 362–386. [Hof95] D.W. Hoffmann. Isotropy of quadratic forms over the function field of a quadric. Math. Z., 220 (1995), no.3, 461–476. [Hof04] D.W. Hoffmann. Diagonal forms of degree p in characteristic p. Algebraic and arithmetic theory of quadratic forms, 135–183, Contemp. Math., 344, Amer. Math. Soc., 2004. [Izh04] O. Izhboldin. Virtual Pfister neighbors and first Witt index. With an introduction by Nikita Karpenko. Geometric methods in the algebraic theory of quadratic forms, 131–142, Lecture Notes in Math., 1835, Springer, 2004. [Kah08] Bruno Kahn. Formes quadratiques sur un corps. Cours Spécialisés, 15. Société Mathématique de France, Paris, 2008. [Kar03] N.A. Karpenko. On the first Witt index of quadratic forms. Invent. Math., 153 (2003), no.2, 455–462. [Kar10] N.A. Karpenko. Canonical dimension. Proceedings of the International Congress of Mathematicians. Volume II, 146-161, Hindustan Book Agency, New Delhi, 2010. [Kar13] N.A. Karpenko. Upper motives of algebraic groups and incompressibility of Severi-Brauer varieties. J. Reine Angew. Math., 677 (2013), 179–198. [KM03] Nikita Karpenko and Alexander Merkurjev. Essential dimension of quadrics. Invent. Math., 153 (2003), no.2, 361–372. [Kne76] M. Knebusch. Generic splitting of quadratic forms. I. Proc. London Math. Soc. (3), 33 (1976), no. 1, 65–93. [Kne77] M. Knebusch. Generic splitting of quadratic forms. II. Proc. London Math. Soc. (3), 34 (1977), no. 1, 1–31. [Lag04a] A. Laghribi. Quasi-hyperbolicity of totally singular quadratic forms. Algebraic and arithmetic theory of quadratic forms, 237–248, Contemp. Math., 344, Amer. Math. Soc., 2004. [Ros90] M. Rost. Some new results on the Chow groups of quadrics. Preprint, 1990. [Scu13] S. Scully. Rational maps between quasilinear hypersurfaces. Compos. Math., 149 (2013), no.3, 333–355. [Scu14] S. Scully. Hoffmann’s conjecture for totally singular forms of prime degree. To appear, Algebra Number Theory, arXiv:1410.8785v1. (44 pages). [Scu16] S. Scully. On the splitting of quasilinear p-forms. J. Reine Angew. Math., 713 (2016), 49–83. [Tot08] B. Totaro. Birational geometry of quadrics in characteristic 2. J. Algebraic Geom., 17 (2008), no. 3, 577–597. [Vis98] A. Vishik. Integral motives of quadrics. MPIM Preprint, 1998-13. [Vis99] A. Vishik. Direct summands in the motives of quadrics. Preprint, 1999, https://www.maths.nottingham.ac.uk/personal/av/papers.html. 26 STEPHEN SCULLY [Vis04] A. Vishik. Motives of quadrics with applications to the theory of quadratic forms. Geometric methods in the algebraic theory of quadratic forms, 25–101, Lecture Notes in Math., 1835, Springer, 2004. [Vis11] A. Vishik. Excellent connections in the motives of quadrics. Ann. Sci. Éc. Norm. Supér. (4), 44 (2011), no. 1, 183–195. Department of Mathematical and Statistical Sciences, University of Alberta, Edmonton AB T6G 2G1, Canada E-mail address: [email protected]
0math.AC
A Comparison of Policies on the Participation of Storage in U.S. Frequency Regulation Markets Bolun Xu, Student Member, IEEE, Yury Dvorkin, Student Member, IEEE, Daniel S. Kirschen, Fellow, IEEE C. A. Silva-Monroy, Member, IEEE, Jean-Paul Watson, Member, IEEE arXiv:1602.04420v2 [math.OC] 16 Feb 2016 Emails: {xubolun, dvorkin, kirschen}@uw.edu, {casilv, jwatson}@sandia.gov Abstract—Because energy storage systems have better ramping characteristics than traditional generators, their participation in frequency regulation should facilitate the balancing of load and generation. However, they cannot sustain their output indefinitely. System operators have therefore implemented new frequency regulation policies to take advantage of the fast ramps that energy storage systems can deliver while alleviating the problems associated with their limited energy capacity. This paper contrasts several U.S. policies that directly affect the participation of energy storage systems in frequency regulation and compares the revenues that the owners of such systems might achieve under each policy. Index Terms—Energy storage, Power system economics, Power system frequency control I. I NTRODUCTION Frequency regulation service involves the injection or withdrawal of active power from the power grid to maintain the system frequency [1]. In the United States, frequency regulation is equivalent to secondary frequency control, while primary frequency control is more commonly known as frequency response. The most common mean for a unit to provide frequency regulation is following a system operator’s automatic generation control (AGC) signal, which computes the area control error (ACE) from frequency deviations and interchange power imbalances. An appropriate response to the AGC signal requires dispatching flexibility within the assigned regulation capacity. Traditionally, the majority of frequency regulation capability has been provided by specially equipped generators. As technologies evolve, new types of flexibility resources emerge, such as battery and flywheel energy storage. These energy storage systems have significantly faster ramping capabilities compared to conventional generators, and their participation in frequency regulation can reduce the need to procure regulation capacity [2]. To create an incentive for fast responding units to participate in frequency regulation, the Federal Energy Regulatory Commission (FERC) enacted FERC Order 755 [3], which requires system operators to add a performance payment with an accuracy adjustment to the capacity payment typically used in markets for ancillary services. This “pay-for-performance” scheme has been implemented by most U.S. independent system operators (ISO) and regional transmission organizations (RTO). Under this new market rule, fast ramping regulation resources receive higher regulation payments because their This paper will be presented in IEEE PES General Meeting 2016. performance is usually more accurate. A case study conducted by RES Americas has already shown that its 4 MW / 2.6 MWh battery storage achieved a very high performance in following the regulation signal provided by PJM [4]. To further utilize the fast responsive capability of energy storage systems (ESS) beyond the traditional AGC framework, some system operators, such as PJM, have introduced fast regulation. Units participating in fast regulation follow a regulation signal that changes much faster than the traditional AGC signal, and receive extra payments for doing so. The system operator also benefits from the improved regulation accuracy. A review by the California Energy Storage Alliance (CESA) shows that the combination of pay-for-performance and fast regulation has reduced the procurement requirement in the PJM regulation market by 30% [5]. However, the high investment cost of ESS has so far limited the installed energy storage capacity [6]. The energy lost during charging and discharging and the energy imbalance in the regulation signal make it difficult for ESS operators to provide regulation services seamlessly over a relatively long time period (e.g. several hours). Some system operators have elected to lower this barrier by co-optimizing energy storage when dispatching regulation, i.e. taking into account the state of charge (SoC) and the cycling efficiency of ESS. This paper compares market policies that affect energy storage in the frequency regulation market. It covers the ISOs and RTOs that have organized wholesale electricity markets, including the PJM Interconnection (PJM); the New York Independent System Operator (NYISO); the Midcontinent Independent System Operator (MISO); ISO New England (ISONE); California Independent System Operator (CAISO). Study results on pay-for-performance, fast regulation, and storage energy compensation are discussed in Section II, Section III, and Section IV, respectively. Section V analyzes the regulation payment in different markets. Section VI summarizes the findings. II. PAY- FOR -P ERFORMANCE All ISO / RTOs in our study have complied with FERC Order 755 and implemented pay-for-performance in their regulation markets, except for NYISO and MISO which pay for regulation capacity only in their day-ahead regulation markets (DAM). A typical pay-for-performance regulation market involves the following terms: TABLE I: Pay-for-performance market terms Price Regulation mileage Performance factor Capacity Mileage PJM [8], [9] capability price performance price mileage performance score NYISO [10] capacity price movement price movement performance index MISO [11], [12] capacity price mileage price mileage performance accuracy ISO-NE [13] capacity price service price movement performance score CAISO [14] capacity price mileage price mileage accuracy percentage • • Eq. 2 applies to CAISO and the real-time regulation market in NYISO. Eq. 2 also applies to MISO when a unit’s performance is below 70%, a unit receives full credit when above 70% during each 5-minute performance test interval. At ISO-NE, the performance factor is used to adjust the capacity payment, thus Eq. 2 becomes λ′R = ρC(λC + M λM ) Regulation capacity (C) is the maximum and minimum regulation power that a unit offers during a given period. The regulation capacity is usually symmetrical so that a unit provides the same positive and negative capacity (i.e. ±5 MW). With the exception that CAISO separates regulation into up and down components. The capacity price in $/MW · h, represents the option price to reserve 1 MW of capacity to provide regulation in the future. Not to be confused with the exercise price of the energy required to follow the regulation signal Regulation mileage (M ) is the sum of the absolute values of the regulation control signal movements. The mileage of a regulation resource output {P1 , . . . , Pn } over a time period with n signal steps and a regulation capacity Pmax is M= n X |Pi − Pi−1 |/Pmax (1) i=1 The unit for mileage is ∆MW/MW, representing the mileage of 1 MW of regulation capacity. The unit for mileage price is $/∆MW. • Performance factor (ρ) is a score from 0 to 1 that indicates a unit’s performance in following the regulation signal. Most ISO/RTOs model the performance factor as a unit’s accuracy in signal following (integration of absolute errors). PJM uses a more complex measure of performance that involves delay, correlation and accuracy [7]. Table I shows the names used for these quantities in each market. In a pay-for-performance market, participants offer a capacity price bid and a mileage price bid. The system operator credits providers of regulation using the market capacity clearing price (λC ), the mileage clearing price (λM ), and the performance factor of its unit during the procurement period. A unit must reach a minimum performance score to be qualified for receiving credits, and maintain this minimum performance over a certain period to be eligible to bid into the regulation market in the future. We generalize the method for awarding regulation credit (λR ) as follows: λR = C(λC + ρM λM ) (2) (3) PJM uses mileage ratio in its credit calculations. The mileage ratio is the ratio between the mileage of the assigned regulation signal and the mileage of the traditional regulation signal (MRegA , see Section III-A). The formula for calculating the credit becomes M λM ) (4) λ′′R = ρC(λC + MRegA III. FAST R EGULATION A fast regulation signal is generated by applying a highpass filter to the AGC signal. Such signals have a fast ramping rate but are designed to have a zero-mean. They are therefore ideal for ESS interested in providing frequency regulation. Fast regulations have been implemented by PJM and ISO-NE, while MISO provides an alternative approach for utilizing fast responsive units. A regulation signal’s energy capacity requirement refers to the minimum energy capacity needed to follow perfectly the regulation signal, neglecting the efficiency and SoC constraints of an ESS. The energy requirement of the signal in that hour is the difference between the maximum and minimum SoC during the operating hour. For a regulation signal Sh at hour h with a step size of Ts and N steps per hour, the hourly energy requirement Eh is therefore ! ! j j X X (5) T s Si Ts Si − min Eh = max j=1...N i=1 j=1...N i=1 The energy balance of a regulation signal is the initial SoC level that allows a storage with the minimum energy capacity (Eh ) to follow the signal perfectly, ignoring its efficiency and SoC constraints. A perfectly balanced signal (at 50%) allows the SoC level of the energy storage to return to its initial level at the end of the operating period. Since Eq. 5 assumes that the initial SoC is zero (i.e. it simulates an ESS with negative capacity), the energy balance σh for the signal Sh is ! j X 1 σh = − (6) T s Si min Eh j=1...N i=1 A. PJM RegD PJM provides two regulation signals in its day-ahead regulation market: RegA, is a low-pass filtered ACE designed for traditional regulation units, while RegD, is a high-pass filtered ACE designed for fast regulation units [7]. The RegD signal is controlled to have zero-mean within 15 minutes [15]. Units can choose freely which signal they follow, but can only follow one signal at a time. Our analysis of these regulation signals 1 C. MISO AGC-Enhancement MWh 0.8 0.6 0.4 0.2 0 PJM RegD ISONE ENC ISONE ENT PJM RegA ISONE Base (a) Regulation energy hourly requirement (1MW capacity). In the MISO reserve market, the deployment interval for ESS (which are called stored energy resources or SER) is optimized for each ESS based on its initial condition [18]. Taking things one step further, MISO is proposing a new regulation reserve deployment scheme called AGC-Enhancement [19]. The idea of this scheme is to deploy and un-deploy the fast ramping units first in the AGC dispatch, by creating a new fast ramping deployment group. MISO expects AGC-Enhancement to improve the utilization of fast ramping units. 100 IV. S TORAGE E NERGY O FFSET C OMPENSATION SoC [%] 80 60 40 20 0 PJM RegD ISONE ENC ISONE ENT PJM RegA ISONE Base (b) Regulation energy hourly balance. Fig. 1: Comparison of PJM and ISO-NE regulation signals. from June 2013 to May 2014 shows that the mileage of RegA is about 5 ∆MW/MW per hour, while the mileage of RegD is around 15 ∆MW/MW per hour, suggesting that RegD ramps much faster. In market settlements, the mileage ratio for RegA is therefore 1, and the mileage ratio for RegD is around 3. Section V provides a detailed comparison of regulation payments. The box plot in Fig. 1a summarizes the distribution of the hourly energy requirement and shows that in most cases PJM RegD has an energy requirement of less than 0.25 MWh or approximately 15 minutes of full charge/discharge. Fig. 1b shows that RegD has an average energy balance of 50%, but that the extreme cases can reach 0 and 100%. B. ISO-NE energy-neutral ISO-NE includes ESS in the Alternative Technology Regulating Resources (ATRR), and provides two fast regulation signals (energy-neutral continuous (ENC), energy-neutral trinary (ENT)), and a conventional regulation signal [16]. A resource can change once a month the signal that it follows. ENC is identical to PJM’s RegD signal, while ENT is specifically designed for ATRRs and the dispatch is either zero, full charge power, or full discharge power. Since each trinary dispatched resource is assumed to have a step response and hence equal participation factors, the ENT algorithm dispatches the entire set of Trinary Dispatched ATRRs together. Fig. 1 shows the energy requirement and the balance analysis using a one-day duration simulated signal from ISO-NE [17] and suggest that these signals behave in a similar fashion as PJM’s RegD and RegA . The mileage difference between the three simulated signals is not significant: the average mileages being 18, 16, and 14 ∆MW/MW for ENC, ENT, and the conventional signal, respectively. Due to their less than perfect efficiency and the fact that the AGC signal has a non-zero mean, the SoC of an ESS is not maintained in the traditional regulation framework. While the fast frequency regulation alleviates the effect of the signal energy imbalance, some ISOs have decided to directly compensate the energy offset of storage units in their regulation market through dispatching. Such mechanisms include the Regulation Energy Management (REM) of CAISO, and the Real-Time Dispatching (RTD) of NYSIO. A. CAISO REM [20] CAISO treats ESS as Non-Generating Resources (NGR), a set of resources that also includes responsive demands. NGR units have two options for participating in the regulation market: non-REM (traditional), and REM. Non-REM units are subjected to the same requirements as traditional regulation units, and must meet the 60-minute continuous energy requirement (i.e., to provide 1 MW regulation capacity, a nonREM NGR unit must be able to deliver at least 1 MWh). The continuous energy requirement for NGR-REM units is 15 minutes. NGR-REM units can only participate in the CAISO regulation market, and the subscription to REM can only be changed monthly. CAISO compensates the energy offset of NGR-REM units. By participating in REM, a NGR unit submits a preferred SoC set-point. CAISO will maintain this set-point by dispatching energy from the Real Time Market (RTM) for the next real time dispatch interval [21]. This balancing energy is dispatched to each NGR-REM units together with the AGC signal by the Energy Management System (EMS). The EMS also takes into account a unit’s efficiency in the dispatch. The REM energy compensation is guaranteed during normal operations, while in emergency cases the SoC is restored later. In the CAISO regulation market settlement, the regulation energy charged and discharged from the storage and the dispatched REM energy are settled at the RTM locational marginal price (LMP), in addition to the capacity settlement and mileage settlement. Since REM guarantees to maintain the SoC of NGRs, the consequence of the energy settlement is that NGR-REM units must pay for their energy losses at their LMP. This settlement method is currently unique to CAISO. PJM RegD PJM RegA ISONE ENT MISO NYISO CAISO 0 10 20 30 40 50 60 70 Payment ($/MWh) 80 90 100 110 Fig. 2: DAM regulation price comparison (outliers omitted). B. NYISO RTD [22], [23] NYISO calls ESS Limited Energy Storage Resources (LESR). LESR can bid into the regulation DAM and RTM, but only receive mileage payments in the RTM settlement. In the day-ahead regulation market, LESR units are evaluated and scheduled on an hourly basis without considering potential energy limitations. In the real-time regulation market, the RTD manages the energy level of LESR to maintain regulation capability to the extent possible by charging and discharging the LESR as necessary. The RTD assigns regulation base points to an LESR every 5 minutes based solely on its SoC level. For example, at each 5-minute interval, a 20 MW regulation capacity LESR will provide ±20 MW regulation reserve at 0 MW base point when its SoC is within a dead-band centered at 50% SoC. When its SoC is above this dead-band, it will provide regulation with reduced capacity and a positive (charging) base point; when its SoC is below this dead-band, it will provide regulation with reduced capacity and a negative (charging) base point. Thus the SoC of the LESR converges to 50%. As in CAISO, the RTD SoC management is suspended during emergencies, when it is called RTD-CAM (Corrective Action Mode). During RTD-CAM, all LESR providing regulation discharge to zero in order to make up for the loss of generation. The SoC level is restored after RTD-CAM terminates. V. R EGULATION M ARKET I NCOME A. Day-ahead Market Results This section compares regulation payments in different regulation markets using public regulation pricing data from each ISO/RTO. In pay-for-performance markets, we assume that the performance factor is an ideal 100%, and use Eqs. 24 to calculate these payments. The box plot in Fig. 2 shows the distribution of calculated regulation payments in the DAM for each ISO/RTO. 1) PJM: The payments for the two regulation products available in PJM are based on signals and market clearing prices from June 2013 to May 2014. The hourly regulation mileage for each signal is calculated using Eq. 1. 2) CAISO: CAISO publishes all its historical market data on the CAISO Open Access Same-Time Information System (OASIS). Besides pricing data, CAISO also publishes the hourly reg-up and reg-down mileage data (system mileage multipliers) of its AGC signal. To be consistent with the calculations for the other markets, we assume that each unit offers the same regulation up and regulation down capacity, we calculate the payments separately using day-ahead market prices from June 2014 to May 2015, and add the two results together. The average calculated reg-up price is $5.2/MWh, while the reg-down price is $4.1/MWh. 3) MISO: MISO publishes ancillary service pricing data on its market report website [24]. We use the day-ahead ancillary service market prices from June 2014 to May 2015. This market does not have a mileage price. 4) ISO-NE: ISO-NE publishes ancillary service pricing data on its market data and information website [25]. We use the final hourly clearing price data from June 2014 to May 2015. ISO-NE started mileage bidding on March 31st, 2015, so the clearing price for April and May contains a capacity price and a service (mileage) price. For these two months, we use mileage for the simulated ENT signal described in Section III-B, the payment for the other two signals are not calculated since the mileages are very close to those for ENT. 5) NYISO: NYISO publishes its ancillary service pricing data on its pricing data website [26]. We use the DAM regulation clearing prices from June 2014 to May 2015. This market does not have a mileage price. B. Real-time Market CAISO, MISO, and NYISO have both RTM and DAM for operating reserves. The RTM is to procure additional reserves according to real-time system co-optimizations with updated system conditions [27]. All three markets have mileage payments, however most mileage clearing prices are very close to zero and thus have little effect on the final price. 1) CAISO: CAISO determines its RTM regulation capacity in the hour-ahead scheduling process. The weighted average RTM price for reg-up and reg-down is $7.84/MWh and $4.28/MWh, while for the RTM the prices are $6.08/MWh and $3.98/MWh, respectively [28]. 2) MISO: In MISO the RTM is cleared every five minutes to produce price and dispatch levels for regulation. Its annual average hourly RTM regulation prices are in general 10% to 15% higher than the DAM prices [29]. 3) NYISO: NYISO calculates the RTM requirement over an RTD interval (1 hour) every 5 minutes. The average DAM regulation price is $10.1/MWh in 2013 and $12.9/MWh in 2014, while the average RTM regulation price is $9.8/MWh in 2013 and $13.8/MWh in 2014 [30]. VI. C ONCLUSIONS Table II summarizes the findings of our study. In the column ancillary service (AS) requirements, we list the minimum energy capacity required to provide 1 MW of regulation reserve. This requirement is specified for CAISO, while for PJM and ISO-NE, it is derived from the simulations described in Section. III. We were not able to find similar information for MISO and NYISO. The last three columns show the TABLE II: A Comparison of Regulation Market Policies on Energy Storage and Fast Responsive Units AS Requirements 1 MW Cap.(MWh) ES Offset Control Fast Reg. Schemes ES Abbr. Reg. Cap. (MW) Reg. Cost (M$) Gen. Avg. (GW) no NGR ∼ 325 32 ∼ 28 CAISO [20], [28], [31] 0.25 (REM) 1 (else) REM PJM [7], [8], [32] 0.25 (RegD) 1 (RegA) no RegD - 525 − 700 254 ∼ 171 ISO-NE [13], [33], [34] 0.25 (EN) 1 (else) no energy-neutral ATRR 30 − 130 29 ∼ 12 SER ∼ 400 20 ∼ 55 LESR 150 − 250 29 ∼ 18 MISO [18], [19], [35] - NYISO [22], [30] - AGC-Enhancement RTD average required regulation capacity, the regulation cost, and the average generation capacity in each operator zone. The comparison shows that PJM operates a very efficient regulation market in terms of the ratio between regulation capacity and generation, while the cost of regulation is similar to the other ISOs relative to the size of the interconnection. In particular, if we compare the ancillary market cost of PJM with CAISO, the historical cost of regulation in PJM per MWh load is ∼$0.2-0.3/MWh, while this cost is ∼$0.1-0.2/MWh for CAISO. On the other hand, the total per MWh ancillary service cost is much higher in PJM, at ∼$2/MWh, than in CAISO, where it is ∼$0.3/MWh [28], [32]. A possible explanation for this difference is that CAISO performs a co-optimization of energy and ancillary services, while PJM has a coupled co-optimization process with more complicated categories of ancillary services [27]. This latter approach is less efficient than CAISO’s and results in a higher ancillary service cost. For example, sometimes the PJM RegD capacity is over-saturated, meaning that the capacity ratio of RegD is too high. Since the RegD logic is to maintain a 5-minute zero-mean energy, a high RegD capacity ratio can make the controller go against ACE correlation for extreme cases [15]. Our comparison of different markets shows that the regulation markets are becoming more suitable and profitable for ESS because the new pay-for-performance policy makes energy storage more competitive. New zero-mean regulation policies have lowered the barrier for ESS to provide regulation for longer periods. From the perspective of a system operator, the participation of energy storage under appropriate market designs makes the regulation more efficient. However, providing a zero-mean regulation signal can be challenging, and must be well coordinated with other ancillary service products so that the energy balancing signal does not perturb the system. ACKNOWLEDGMENT The authors thank Dr. I. Gyuk and his colleagues at the US DOE Energy Storage Program for funding this research. Sandia National Laboratories is a multi-program laboratory managed and operated by Sandia Corporation, a wholly owned subsidiary of Lockheed Martin Corporation, for the U.S. Department of Energy’s National Nuclear Security Administration under Contract DE-AC04-94AL85000. R EFERENCES [1] Y. Dvorkin, D. Kirschen, and M. Ortega-Vazquez, “Assessing flexibility requirements in power systems,” IET on Generation, Transmission and Distribution,, vol. 8, no. 11, pp. 1820–1830, 2014. [2] Y.V. Makarov, J. Ma, S. Lu, T.B. Nguyen, “Assessing the value of regulation resources based on their time response characteristics,” Pacific Northwest National Laboratory, Tech. Rep., 2008. [Online]. Available: http://goo.gl/VVbdXt [3] FERC Order No. 755: Frequency Regulation Compensation in Organized Wholesale Power Markets, 2011. no [4] “Case study: Pjm frequency regulation.” [Online]. Available: http://goo.gl/IunT03 [5] C. Edgette, “Pay for performance regulation year 1 design changes,” Tech. Rep., 2014. [Online]. Available: http://goo.gl/91Ty6q [6] H. Pandzic, Y. Wang, T. Qiu, Y. Dvorkin, and D. Kirschen, “Nearoptimal method for siting and sizing of distributed storage in a transmission network,” IEEE Transactions on Power Systems, vol. 30, no. 5, pp. 2288–2300, Sept 2015. [7] PJM Manual 12: Balancing Operations, PJM, 2015. [Online]. Available: http://goo.gl/VocQoc [8] PJM Manual 11: Energy & Ancillary Services Market Operations, PJM, 2015. [Online]. Available: http://goo.gl/VocQoc [9] PJM Manual 28: Operating Agreement Accounting, PJM, 2015. [Online]. Available: http://goo.gl/VocQoc [10] NYISO Accounting and Billing Manual, 2014. [Online]. Available: http://goo.gl/RYYzOv [11] MISO Business Practices Manual: Market Settlements, 2015. [Online]. Available: https://goo.gl/sjc8PC [12] Y. Chen, R. Leonard, M. Keyser, and J. Gardner, “Development of performance-based two-part regulating reserve compensation on miso energy and ancillary service market,” Power Systems, IEEE Transactions on, vol. 30, no. 1, pp. 142–155, 2015. [13] ISO New England Inc. Market Rule 1, 2015. [Online]. Available: http://goo.gl/cVyYY2 [14] C. Hinman, “Pay for performance regulation,” 2015. [Online]. Available: http://goo.gl/4ObZcP [15] “A brief history of regulation signals at pjm,” 2015. [Online]. Available: http://goo.gl/9UUQts [16] “Description of the energy neutral agc dispatch algorithm.” [Online]. Available: http://goo.gl/3hvbsG [17] “Simulated automatic generator control (agc) setpoint data.” [Online]. Available: http://goo.gl/GahD5X [18] MISO Business Practices Manual: Energy and Operating Reserve Markets, 2015. [Online]. Available: https://goo.gl/sjc8PC [19] “Agc enhancement for fast ramping resources,” 2014. [Online]. Available: https://goo.gl/0uHcTC [20] California ISO, “Non-generator resource (ngr) and regulation energy management (rem),” 2012. [Online]. Available: http://goo.gl/aiz2ok [21] Business Requirements Specification: REM-NGR, CAISO, 2011. [Online]. Available: http://goo.gl/1jiEUq [22] NYISO Ancillary Services Manual, 2014. [Online]. Available: http://goo.gl/RYYzOv [23] J. Hickey, “Limited energy storage resource market integration update,” 2009. [Online]. Available: http://goo.gl/I3bv3N [24] “MISO Market Reports.” [Online]. Available: https://goo.gl/zUGHJo [25] “ISO-NE Pricing Reports.” [Online]. Available: http://goo.gl/GrJcJL [26] “NYISO Pricing Data.” [Online]. Available: http://goo.gl/5Pr8mT [27] J. F. Ellison, L. S. Tesfatsion, V. W. Loose, and R. H. Byrne, “Project report: A survey of operating reserve markets in u.s. iso/rto-managed electric energy regions,” Sandia National Laboratories, Tech. Rep., 2012. [28] CAISO Annual Report on Market Issues and Performance, 2015. [Online]. Available: http://goo.gl/drIXlf [29] MISO 2013 Annual Market Assessment Report, 2014. [Online]. Available: https://goo.gl/ZnrsQp [30] 2014 State of the Market Report for the New York ISO Electricity Markets, 2015. [Online]. Available: http://goo.gl/1CD113 [31] Business Practice Manual for Market Operations, CAISO, 2015. [Online]. Available: https://goo.gl/551hxI [32] PJM State of the Market - 2014, Monitoring Analytics, 2015. [Online]. Available: http://goo.gl/DE9PUv [33] ISO New England Operating Procedure No. 14, 2015. [Online]. Available: http://goo.gl/CDD32W [34] ISO New Englands Internal Market Monitor 2014 Annual Markets Report, 2015. [Online]. Available: http://goo.gl/o5OhB8 [35] 2014 State of the Market Report for the MISO Electricity Markets, 2015. [Online]. Available: https://goo.gl/OcDgm2
3cs.SY
Near-optimal planning using approximate dynamic programming to enhance post-hazard community resilience management Saeed Nozhatia,1,∗, Yugandhar Sarkaleb,1 , Bruce Ellingwooda , Edwin K.P. Chongb , Hussam Mahmouda a Dept. arXiv:1803.01451v1 [math.OC] 5 Mar 2018 b Dept. of Civil and Environmental Engineering, Colorado State University, Fort Collins, CO 80523-1372 of Electrical and Computer Engineering, Colorado State University, Fort Collins, CO 80523-1373 Abstract The lack of a comprehensive decision-making approach at the community-level is of significant importance that must be garnered immediate attention. Network-level decision-making algorithms need to solve largescale optimization problems that pose computational challenges. The complexity of the optimization problems increases when various sources of uncertainty are considered. This research introduces a sequential discrete optimization approach, as a decision-making framework at the community-level for recovery management. The proposed mathematical approach leverages approximate dynamic programming along with heuristics for the determination of recovery actions. Our methodology overcomes the curse of dimensionality and manages multi-state, large-scale infrastructure systems following disasters. We also provide computational results which suggest that our methodology not only incorporates recovery policies of responsible public and private entities within the community, but also substantially enhances the performance of their underlying strategies with limited resources. The methodology can be implemented efficiently to identify near-optimal recovery decisions following a severe earthquake based on multiple objectives for an modeled Electrical Power Network of a testbed community coarsely modeled after Gilroy, California, United States. The proposed optimization method supports risk-informed community decision-makers within chaotic posthazard circumstances. Keywords: Community Resilience, Electrical Power Network, Combinatorial Optimization, Rollout Algorithm, Approximate Dynamic Programming 1. Introduction In the modern era, the functionality of infrastructure systems is of significant importance in providing continuous services to communities and in supporting their public health and safety. Natural and anthropogenic hazards pose significant challenges to infrastructure systems and cause undesirable system malfunctions and consequences. Past experiences show that these malfunctions are not always inevitable despite design strategies like ∗ Corresponding author Email addresses: [email protected] (Saeed Nozhati ), [email protected] (Yugandhar Sarkale), [email protected] (Bruce Ellingwood), [email protected] (Edwin K.P. Chong), [email protected] (Hussam Mahmoud) 1 Contributed equally, listed alphabetically. Preprint submitted to Reliability Engineering & System Safety increasing system redundancy and reliability [1]. Therefore, a sequential rational decision-making framework should enable malfunctioned systems to be restored in a timely manner after the hazards. Further, post-event stressors and chaotic circumstances, time limitations, budget and resource constraints, and complexities in the community recovery process, which are twinned with catastrophe, highlight the necessity for a comprehensive riskinformed decision-making framework for recovery management at the community-level. A comprehensive decision-making framework must take into account indirect, delayed consequences of decisions (also called the post-effect property of decisions), and thus requires foresight or planning. Such a comprehensive decision-making system must also be able to handle large-scale scheduling problems that encompass large combinatorial decision spaces to make the most rational plans at the communityMarch 7, 2018 level. Developing efficient computational methodologies for sequential decision-making problems has always been a thought-provoking subject [2, 3]. In the context of civil engineering, several studies have utilized the framework of dynamic programming for management of bridges and pavement maintenance [4, 5, 6, 7, 8]. Typical methodological formulations employ principles dynamic programming that utilize state-action pairs. In this study, we show a powerful and relatively unexplored methodological framework of formulating large infrastructure problems as a string-actions, will be described in Section 5.1.2. Our formulation does not require an explicit state-space model, and is therefore shielded against the common problem of state explosion when such methodologies are employed. The sequential decision-making methodology presented here not only manages network-level infrastructure but also considers the interconnectedness and cascading effects in the entire recovery process that have not been addressed in past studies. Dynamic programming formulations frequently suffer from the curse of dimensionality. This problem is further aggravated when we have to deal with large combinatorial decision spaces characteristic of community recovery. Therefore, using approximation techniques in conjunction with the dynamic programming formalism is essential. There are several approximation techniques available in the literature [9, 10, 11, 12]. Here, we use a promising class of approximation techniques called as rollout algorithms. We show how rollout algorithms blend naturally with string-action formulation. Together, they form a robust tool to overcome some of the limitations faced in the application of dynamic programming techniques to massive real-world problems. The proposed approach is able to handle the curse of dimensionality in its analysis and management of multi-state, large-scale infrastructure systems and data sources. The proposed methodology is also able to consider and improve the current recovery policies of responsible public and private entities within the community. Among infrastructure systems, Electrical Power Networks (EPNs are particularly critical inasmuch as the functionality of most other networks, and critical facilities depend on EPN functionality and management. Hence, the method is illustrated in an application to recovery management of the modeled EPN in Gilroy, California following a severe earthquake. The illustrative example shows how the pro- posed approach can be implemented efficiently to identify near-optimal recovery decisions. The computed near-optimal decisions restored the EPN of Gilroy in a timely manner, for residential buildings as well as main food retailers, as an example of critical facilities that need electricity to support public health in the aftermath of hazards. The remainder of this study is structured as follows. In Section 2, we introduce the background of system resilience and the system modeling used in this study. In Section 3, we introduce the case study used in this paper. In Section 4, we describe the earthquake modeling, fragility and restoration assessments. In Section 5, we provide mathematical formulation of our optimization problem. In Section 6, we demonstrate the compatibility of the rollout algorithm with the string action formulation through multiple simulations. In Section 7, we present a brief conclusion of this research. 2. System resilience The term resilience is defined in a variety of ways. Generally speaking, resilience can be defined as “the ability to prepare for and adapt to changing conditions and withstand and recover rapidly from disruptions”[13]. Hence, resilience of a community (or a system) is usually delineated with the measure of community functionality, shown by the vertical axis of Fig.1 and four attributes of robustness, rapidity, redundancy, and resourcefulness [14]. Fig.1 illustrates the concept of functionality, which can be defined as the ability of a system to support its planned mission, for example by providing electricity to people and facilities. The understanding of interdependencies among the components of a system is essential to quantify system functionality and resilience. These interdependencies produce cascading failures where a large-scale cascade may be triggered by the malfunction of a single or few components [15]. Further, they contribute to the recovery rate and difficulty of the entire recovery process of a system. Different factors affect the recovery rate of a system, among which modification before disruptive events (ex-ante mitigations), different recovery policies (ex-post actions), and nature of the disruption are prominent [16]. Fig.1 also highlights different sources of uncertainty that are associated with community functionality assessment and have remarkable impacts in different stages from prior to the event to the end of the recovery process. Therefore, any employed model to assess the recovery pro2 Figure 2: The map of Gilroy’s population over the defined grids Figure 1: Schematic representation of resilience concept (adopted from [18, 14]) resolution that is sufficient to study the methodology at the community-level under hazard events. Gilroy contains 13 food retailers, but six main retailers, each of which has more than 100 employees, provide the main food requirements of Gilroy inhabitants [21], as shown in Fig.3 and summarized in Table 1. cess ought to be able to consider the impacts of the influencing parameters. In this study, the dependency of networks is modeled through adjacency matrix A = [xij ], where xij ∈ [0, 1] and indicates the magnitude of dependency between components i and j [17]. In this general form, the adjacency matrix A can be a timedependent stochastic matrix to capture the uncertainties in the dependencies and probable timedependent variations. According to the literature, the resilience index R for each system is defined by the following equation [14, 19]: Z te +TLC Q(t) R= dt (1) TLC te Table 1: The main food retailers of Gilroy Food Retailer Number of Employees Walmart 395 Costco 220 Target 130 Mi Pueblo Food 106 Nob Hill Foods 100 Safeway 130 In order to assign the probabilities of shopping activity to each urban grid, the gravity model [22] is used. The gravity model identifies the shopping location probabilistically, given the location of residences. These probabilities are assigned to be proportional to food retailers' capacities and inversely corresponding to retailers' distances from centers of urban grids. Consequently, distant small locations are less likely to be selected than close large locations. If the center of an urban grid is c, then food retailer r is chosen according to the following distribution [22]: P (r|c) ∝ wr ebTcr (2) where Q(t) is the shaded area underneath the functionality function of a system at time t, TLC is the control time of the system, and te is the time of occurrence of event e, as shown in Fig. 1. 3. Description of case study In the case study of this paper, the community in Gilroy, California USA is used as an example to illustrate the proposed approach. Gilroy is located approximately 50 kilometers (km) south of the city of San Jose with a population of 48,821 at the time of the 2010 census (see Fig.2) [20]. The study area is divided into 36 grids to define the properties of community and encompasses 41.9 km2 area of Gilroy. All characteristics of Gilroy are not covered in this study, but the adopted model has a in which wr is the capacity of food retailer r, determined by Table 1, b is a negative constant, and Tcr is the travel time from urban grid c to food retailer r. Googles Distance Matrix API was called from within R by using the ggmap package [23] to provide distances and travel time for the assumed transportation mode of driving. Fig.4 represents the Electrical Power Network 3 Figure 5: The map of shear velocity at Gilroy area the Loma Prieta earthquake [24]. The spatial estimation of ground-motion amplitudes from earthquakes is an essential element of risk assessment, typically characterized by ground-motion prediction equations (GMPEs). GMPEs require several parameters, such as earthquake magnitude Mw , fault properties (Fp ), soil conditions (i.e. the average shear-wave velocity in the top 30 m of soil, Vs30 ), epicentral distances (R) to compute the seismic intensity measure (IM) at any point. Modern GMPEs typically take the form: Figure 3: Gilroy’s main food retailers ln(IM) = f (Mw , R, Vs30 , Fp ) + ε1 σ + ε2 τ (3) ln(IM) = ln(IM) + ε1 σ + ε2 τ where σ and τ reflect the intra-event (within event) and inter-event (event-to-event) uncertainty respectively [25]. In this study, the GMPE proposed by Ambrahamson et al. [26] is used and a ground motion similar to the Loma Prieta earthquake, one of the most devastating hazards that Gilroy has experienced [24], with epicenter approximately 12 km of Gilroy downtown on the SAF projection is simulated. Figs.5 and 6 show the map of Vs30 and ground motion field for Peak Ground Acceleration (PGA), respectively. Figure 4: The modeled electrical power network of Gilroy (EPN) components, located within the defined boundary. Llagas power substation, the main source of power in the defined boundary, is supplied by an 115kv transmission line. Distribution line components are positioned at 100 m and modeled from the substation to the urban grids centers, food retailers, and water network facilities. In this study, the modelled EPN has 327 components. 4.2. Fragility Function and Restoration The relations between ground-motion intensities and earthquake damage relationships are pivotal elements in the quantification of structures and infrastructure systems functionality and loss estimation and the risk analysis of a community. So-called fragility curves describe the probability of experiencing or exceeding a particular level of damage as 4. Hazard and Damage assessment 4.1. Earthquake Simulation The seismicity of Gilroy region of California is mainly controlled by the San Andreas Fault (SAF) that caused numerous destructive earthquakes like 4 5. Optimization of EPN Recovery for Gilroy 5.1. Problem Description 5.1.1. Introduction After an earthquake event occurs, each EPN component experiences in one of the damage states as shown in Table 2. Let the total number of damaged components be M . Note that M ≤ 327. Both M and N ∈ Z≥ , and N ≤ M . Also, in this study, N  M . This assumption is justified by the availability of limited resources with the planner where large number of components are damaged in the aftermath of a severe hazard. A decision maker or planner has the task of assigning units of resources to these damaged components. A decision maker has a heuristic or expert policy on the basis of which he can make his decisions to maximize some objective. The precise nature of the objective of the planner can vary, will be described in details in Section 5.1.2. Particularly, at the 1st decision epoch, the decision maker or a resource planner deploys N unit of resources at N out of M damaged components. Each unit of resources is assigned to a distinct damaged component. In this study, we assume that the outcome of the decisions is fully predictable [35]. We consider a separate article to address the relaxation of this assumption, i.e., when outcome of decisions exhibits uncertainty. The modified methods to deal with the general problem will form a part of a separate paper [36]. The planner must have an option of reassigning some or all of the resources to new locations based on his heuristics and objectives. It is possible to not preempt assignment of the unit of resources to the damaged locations; however we choose to solve the more general problem of preemptive assignment, where non-preemption at few or all the locations is a special case of our problem. The preemptive assignment problem is a richer decision problem than the non-preemptive case in the sense that the process of optimizing the decision actions is a more complex task since the size of decision space is bigger. We improve upon the solutions offered by heuristics of the planner by formulating our optimization problem as a dynamic program and solving it using the rollout approach. Figure 6: The simulation of median of peak ground acceleration field a function of hazard intensity. It is customary to model component fragilities with lognormal distributions [27]. The conditional probability of being in or exceeding, a particular damage state (ds), conditioned on a particular level of intensity measure IM = im, is defined by:  P (DS ≥ ds|IM = im) = Φ ln(im) − λ ξ  (4) in which Φ is the standard normal distribution. λ and ξ are the mean and standard deviation of ln(im). The fragility curves can be obtained based on a) post-earthquake damage evaluation data (empirical curves) [28] b) structural modeling (analytical curves) [29] c) expert opinions (heuristics curves) [30]. In the present study, the seismic fragility curves included in HAZUS-MH [31] and the study of Xie et al. [32] are used for illustration. In order to restore a network, a number of available resource units, N , as a generic single number including equipment and replacement components, repair crews are considered for assignment to damaged components, and each damaged component is assumed to require only one unit of resources [33]. The restoration times based on the level of damage, used in this study, are presented in Table 2, based on [31] [34]. 5.1.2. Optimization Problem In this section, we provide a formal representation of our optimization problem. Lets say that the decision maker starts making decisions and assigning repair locations to different units of resources. The number of such non-trivial decisions to be Table 2: Restoration times based on the level of damage Component Electric sub-station Transmission line component Distribution line component Damage States Undamaged 0 0 0 Minor 1 0.5 0.5 Moderate 3 1 1 Extensive 7 1 1 Complete 30 2 1 5 made is ≤ M − N . When M becomes ≤ N (because of sequential application of repair actions to the damaged components), the assignment of units of resources becomes a trivial problem in our setting, because each unit of resources can be simply assigned one to one, in any order, to the damaged components. Consequently, a strict optimal assignment can be achieved in the trivial case. The size of this trivial assignment problem reduces by one for every new decision epoch until all the remaining damaged components are repaired. The additional units of resources retire because deploying more than one unit of resource to the same location does not decrease the repair time associated with that damaged component. Henceforth, we focus on the non-trivial assignment problem. Let the variable t denote the decision epoch and let Dt be the set of all damaged components before a repair action xt is performed. Let tend denote the decision epoch at which |Dtend | − N = 1. Note that t ∈ A := {1, 2, . . . , tend }. After all the components are repaired, let X = {x1 , x2 . . . , xtend } represent the set of string actions. We say that a repair action is completed when at least 1 out of the N damaged components is repaired. Let P(Dt ) be the powerset of Dt . Let, PN (Dt ) = {C ∈ P(Dt ) : |C| = N } Objective 1 is to compute the optimal solution X1∗ given by: X1∗ = arg min F1 (X1 ). X1 ∈Θ We explain the precise meaning of restoration of electricity to people in more detail in Sec.6.1. To sum up, in objective 1, our aim is to find a set of string actions that minimizes the number of days needed to restore electricity to certain fraction (γ) of the total population of Gilroy. • Objective 2: We define the mapping F2 in terms of number of people who have electricity per unit of time; our objective is to maximize this mapping over a string of repair actions. Let the variable kt denote the total time elapsed between completion of repair action xt−1 and xt , ∀t ∈ A\{1}, in which k1 is the time elapsed between the start and completion of repair action x1 . Let ht be the total number of people who have electricity after the repair action xt is complete. Let Ω = PN (D1 ) PN (D2 ) . . . PN (Dtend ). Then, × × × F2 (X) = (5) 1 tX end ktend t=1 ht × kt . (8) We are interested in the optimal solution X ∗ given by: then, xt ∈ PN (Dt ). Let Rt be the set of all repaired components after the repair action xt is completed. Note that Dt+1 = Dt \Rt , ∀t ∈ A, where |Dtend +1 | = 0 and the decision making problem moves into the trivial assignment problem previously discussed. We wish to calculate a string of repair actions X that optimizes our objective functions F (X). We deal with two objective functions in this study denoted by mapping F1 and F2 . X ∗ = arg max F2 (X). X∈Ω (9) Note that our objective function in the 2nd case F2 (X) mimics the resilience index, and can be interpreted in terms of Eqn.(1), in which integral is replaced by a sum because of discrete decision epochs, Q(t) is replaced by the product ht × kt , and TLC is analogous to ktend , and the integral limits are also changed to represent the discrete decision epochs. Also, note that the decision maker may apply the repair actions sequentially at different decision epochs to maximize or minimize a cumulative objective function. The string of actions as represented in X or X1 are an outcome of this sequential decision making process. This is particularly relevant in the context of dynamic programming. • Objective 1: Let the variable p represent the population of Gilroy and γ represent a constant threshold. Let X1 = {x1 , . . . , xi } be the string of repair actions which results in restoration of electricity to γ × p number of people. Here, xi ∈ PN (Di ), where Di is the number of damaged component at the ith decision epoch. Let n represent the time required to restore electricity to γ × p number of people, as a result of repair actions X1 . Let Θ = PN (D1 ) PN (D2 ) . . . PN (Di ). Formally, F1 (X1 ) = n. (6) × (7) × × 5.2. Approximate Dynamic Programming It is possible to use the dynamic programming formalism to represent our optimization problem, 6 but here we accomplish this by starting from first principles, as in Ref. 37. Let’s focus our attention on objective 1. The extension of this methodology to objective 2 is straightforward; we need to adapt notation used for objective 2 in the methodology presented below, and a maximization problem replaces a minimization problem. Recall that we are interested in the optimal solution X1∗ given by Eqn.(7). This can be calculated in the following manner: First calculate x∗1 as follows: x∗1 ∈ arg min J1 (x1 ) x1 this is called as the curse of dimensionality. If, we consider objective 2 and we wish to calculate Jα  α = M − N then, for 50 damaged components and 10 unit of resources the table size is ≈ 10500 . In practice, in Eqn.14 Jα is replaced by an approximation denoted by J˜α . This approximation is constructed with a aid of a heuristic. There are several ways to utilize a heuristic to approximate Jα . All such approximation techniques fall under the category of approximate dynamic programming. The technique of rollout is one such heuristic in the approximation process. Let’s say we have heuristic H available which is used to approximate the minimization of Eqn.15. Let Hα (x1 , . . . , xα ) denote the corresponding approximate optimal value; then rollout yields the suboptimal solution by replacing Jα with Hα in Eqn.(14): (10) where the function J1 is defined by J1 (x1 ) = min F1 (X1 ). x2 ,...,xi (11) Next, calculate x∗2 as: x̃α ∈ arg min Hα (x̃1 , . . . , x̃α−1 , xα ). xα x∗2 ∈ arg min J2 (x∗1 , x2 ) x2 (12) Rollout results a significant improvement over just applying base heuristic to solve the approximate dynamic programming problem [38]. where the function J2 is defined by J2 (x1 , x2 ) = min F1 (X1 ). x3 ,...,xi (13) 5.3. Rollout Algorithm When the problem is discrete and deterministic, as in our case, the base policy is a base heuristic (in dynamic programming sense, see [38]). Let’s call this as a base heuristic H, which can be defined in several ways: Similarly, we calculate the α solution as follows: x∗α ∈ arg min Jα (x∗1 , . . . , x∗α−1 , xα ) xα (14) where the function Jα is defined by Jα (x1 , . . . , xα ) = min xα+1 ,...,xi F1 (X1 ). (15) (i) The current recovery policy of regionally responsible public and private entities, The functions Jα are called the optimal cost-to-go functions and are defined by the following recursion: Jα (x1 , . . . , xα ) = min Jα+1 (x1 , . . . , xα+1 ), xα+1 (ii) The importance analyses that prioritize the importance of components based on the considered importance factors [39], (16) (iii) The greedy algorithm that computes the greedy heuristic [40, 41], where the boundary condition is given by: Ji (X1 ) = F1 (X1 ). (18) (17) (iv) A random policy without any pre-assumption, Note that J is a standard notation used to represent cost-to-go functions in the dynamic programming literature. The approach discussed above to calculate the optimal solutions is the dynamic programming formulation. However, except for very special problems, such a formulation cannot be solved exactly because calculating and storing the optimal cost-to-go functions Jα can be numerically intensive. Particularly, for our problem let |Θ| be denoted by β, then the storage of Jα requires a table of size β α . In dynamic programming literature (v) A pre-defined empirical policy; e.g., base heuristic based on the maximum node and link betweenness (shortest path), as for example used in the studies of [33, 42]. While there is no restriction to define a base heuristic to use the proposed formulation, a wiser base heuristic can potentially enhance further the computed rollout policy. Two different base heuristics are considered in this study. The first base heuristic is a random heuristic denoted by H. The 7 idea behind consideration of this heuristic is that in actuality there are cases where there is no thoughtout strategy or the computation of such Ĥ is computationally extensive. We will show that the rollout formulation can accept a random base at the community-level from a decision maker and improve it significantly. The second base heuristic is called a smart heuristic since it is computed based on the importance of components and expert judgment connoted by Ĥ. The more important components based on their contribution in the community are repaired first. This type of base heuristic determination can be similar in spirit to the items (ii) and (v) above. The proposed formulation should improve both bases. The rollout policy is obtained by the repeated use of this base heuristic. This approach was used by the authors of Ref. 38 where they repeatedly used the base heuristic to improve the solution. The term rollout was first coined by Tesauro in Ref.[43], in reference to creating computer programs that play backgammon. An approach similar to rollout was also shown in Ref.[44]. Let H generate the string actions (j̃1 , j̃2 , . . . , j̃i ), where j̃α = (x̃1 , . . . , x̃α ). Let Hα (j̃α ) denote the cost-to-go starting from the α-solution j̃α = (x̃1 , . . . , x̃α ), generated because of applying H (i.e., H is used to evaluate the cost-to-go). The cost-togo due to the algorithm H is equal to the terminal reward, i.e., H̃α (j̃α ) = F1 (X1 ). Therefore, we have: H̃1 (j̃1 ) = H̃2 (j̃2 ) = . . . = H̃i (j̃i ). We use this heuristic cost-to-go in (14) to find an approximate solution to our problem. This approximation algorithm is termed as “Rollout on H” (RH) due to its structure, which is similar to rollout algorithms. The RH algorithm generates the string actions (j1 , j2 , . . . , ji ) as follows: jα = arg min ¯ J(δ), α = 1, . . . , i repair action for the next two steps by minimizing the cost-to-go given the repair actions for the next two steps. This can be viewed as a two-step lookahead approach. Note the similarity of this approach with the dynamic programming approach described above, except for the difficulty of estimating the cost-to-go values J exactly. Also, note that a twostep lookahead approach is computationally more intensive than the one-step approach. In principle, it is possible to extend it to an arbitrarily large step size λ, where 1 ≤ λ ≤ i. However, as λ increases, the computational complexity of the algorithm increases exponentially. Particularly, when m = i, the RH algorithm finds the exact optimal solution by exhaustively searching through all possible repair actions/repair string combinations, with computational complexity O(β i ). Also, note that RH provides a tighter upper bound on the optimal objective value compared to the bound obtained from the original heuristic approach. At any decision epoch, the explanation is same for objective 2, except we maximize the cost-to-go at any step given the repair action. 6. Results 6.1. Discussion We show simulation results for 2 different cases. In Case 1, we assume that people have electricity when their household units have electricity. Household units of people will have electricity when all the components of the EPN network serving their household units are either undamaged or repaired post-hazard (functional). Recall, that the city is divided into different grids according to population heat maps (Fig.2), and different components of the EPN network serving these grids are depicted in Fig.4. In essence, the entire population living in a particular grid will not have electricity until all the EPN components serving that grid are functional. Therefore, the probability that a critical facility like a food retailer or an urban grid Gl has electricity is: ! n̂ \ P (Gl ) = P El (21) (19) δ∈N (jα−1 ) where, jα−1 = (x1 , . . . , xα−1 ), and N (jα−1 ) = {(x1 , . . . , xα−1 , x)|x ∈ Θ}, α = 1, . . . , i. (20) The algorithm RH is both sequentially improving with respect to H and outperforms H [45]. The RH algorithm described above is a one-step lookahead approach. For objective 1, at every decision epoch, the repair action at any step is optimized by minimizing the cost-to-go given the repair action for that step. It is possible to generalize this approach to incorporate multi-step lookahead. Particularly, let us say that we optimize the l=1 where n̂ is the number of EPN component from the source to the destination, and El is the lth EPN component within the defined boundary. In Case 2, along with household units, we incorporate food retailers into the analysis. We say that people 8 Figure 7: Electrical Power Network of Gilroy have benefit of electric utility only when the EPN components serving their grids are functional and they go to food retailer that is functional. A food retailer is functional (in the electric utility sense) when all EPN components serving the retailers are functional. The mapping of number of people who access a particular food retailer is done at the grid level and follows the gravity model explained in Sec.3. For all simulation results provided henceforth, the number of units of resources available with the planner is fixed at 10. We consider 2 base heuristics in our simulation study: base heuristic H which is random and a smart base heuristic Ĥ. Figure 8: Electrical Power Network Tree any other form of base heuristic. Also, note that in each stream or branch of the EPN network, each successive node is dependent upon the prior node for electricity. Furthermore, the root components of different branches are dependent on the leaf component of other branches, i.e one branch is dependent on another one. We exploit this serial nature of an EPN by representing the EPN network as a tree structure as shown in Fig.8. In the non trivial assignment problem (M > N ), if the number of damaged components in the root node of EPN tree are greater than N , then it would be unwise to assign a unit of resources at first decision epoch to the fringe nodes of our EPN tree, since we do not get any benefit until we repair damaged components in the root node. As soon as the number of damaged components in the root node of EPN tree less than N , only then we explore the assignment problem at the further locations. 1-step Heuristic: We increase the pool of possible candidate locations, where the assignment of units of resources must be considered, to all the damaged locations of the next level of EPN tree if and only if the number of damaged locations at the current level of the EPN tree less than N . Even after considering the next level of the EPN tree, if 6.1.1. Case 1: Repair Action Optimization of EPN for Household units Since we consider EPN for only household units in this section, it is possible to come up with heuristics to reduce the size of search space for our rollout algorithm. Note that these heuristics are not the same as the base heuristic H. They are formulated to reduce the size of |Θ| and |Ω|. We present two such heuristics. We will motivate them by giving an example. Let us say we have access to H of the decision maker. This heuristic has a preordained method of assigning units of resources to the damaged locations. Let us name each of the components of the EPN with serial numbers from 1 to 327 as shown partially in Fig.7, as per the base heuristic of the decision maker. So, if the component number 21 and 22 are both damaged, the decision maker will assign one unit of resources to component # 21 first and then schedule repair of component #22, contingent on availability of resources. Note that the base heuristic in Fig.7 is assumed only for illustration of our method; our method can incorporate 9 Figure 9: Electrical power network recovery due to base heuristic H Figure 10: Comparison of base heuristic (H) vs. rollout algorithm with 1-step heuristic vs. rollout algorithm with N-step heuristic for multiple scenarios for objective 2. the number of damaged components less than N , we take one more step and account for all damaged locations two levels below the current level. We repeat this until the pool of candidate locations greater than or equal toN , or the levels of EPN tree are exhausted. N-step Heuristic: Note that it might be possible to ignore a few nodes at each level altogether and assign units of resources to promising nodes below the current explored level of EPN tree. This is achieved in the N-step heuristic. Specifically, if the number of damaged components at the current level of EPN tree less than N , then the algorithm searches for a node at the next level that has the least number of damaged components, add these damage components to the pool of damaged components and check if the total number of damaged components at all explored levels less than N . This process is repeated until the pool of damaged components greater than or equal to N , or the levels of the EPN tree are exhausted. Essentially, we do not consider a set of all damaged components at each decision epoch (Dt ), but only a subset of Dt denoted by D̃t1 (1-step heuristic) and D̃tN (N-step heuristic). Therefore, 1\N Θ̃ = PN (D̃1 Ω̃ = 1\N PN (D̃1 ×P )×P ) plot of EPN recovery for multiple scenarios when H is used for decision making. Here the objective pursued by the decision maker is objective 2. The black line shows the mean of all the recovery trajectories and the red lines show the standard deviation. Henceforth, in various plots, instead of plotting the recovery trajectories for all scenarios we compare the mean of the different trajectories. Fig.10 shows Figure 11: Histogram of F2 (X) with Base (H), rollout with 1-step and rollout with N-step heuristic for multiple scenarios ×. . .×P )×. . .×P 1\N ) N (D̃2 1\N ), N (D̃i 1\N N (D̃2 1\N N (D̃tend ). the performance of RH algorithm with respect to H. Our simulation results demonstrate significant improvement over algorithm H when RH is used, for both the 1-step case and the N-step case. Another result is the performance shown by the 1-step heuristic with respect to the N-step heuristic. Even though, the N-step heuristic considers more candidate locations than the 1-step case, for the assignment problem at each decision epoch, the performance improvement shown is minimal. Sacri- Note that, |Ω̃| ≤ |Ω|, |Θ̃| ≤ |Θ| and D̃t1 ≤ D̃tN . We simulate multiple damage scenarios following an earthquake with the models discussed previously in Sec.4. On average, the total number of damaged components in any scenario is ≥ 60%. We show the performance of the base heuristic, used in our rollout algorithm, in Fig.9. This figure shows the 10 works are considered simultaneously in the analysis. This is due to the fact that any such heuristic would have to simultaneously balance the pruning of damaged locations in Fig.8 serving both food retailers and household units. There is no natural/simple way of achieving this as in the case of 1-step and N-step heuristic where only household units were considered. Whenever we consider complex objective functions and interaction between networks, it is difficult to prune the action space in a physically meaningful way just by applying heuristics. For our case, any such heuristic will have to incorporate the gravity model explained in Sec.3. The heuristic must also consider the network topology and actual physical position of important EPN components within the network. As previously seen, our methodology works well even if we select only a small subset of Dt (Dt1 and DtN ) to construct Θ and Ω to avoid huge computational cost. Moreover, the degradation in performance by choosing Dt1 over DtN is minimal, despite |D̃t1 | ≤ |D̃tN |. This is because our methodology leverages the use of one step lookahead property with consistent and sequential improvement over algorithm H or Ĥ, to overcome any degradation in performance as a result of choosing D̃t  Dt . This is further justified Figure 12: Comparison of base heuristic (Ĥ) vs. rollout algorithm with 1-step heuristic vs. rollout algorithm with N-step heuristic for multiple scenarios for objective 2. ficing numerous candidate locations in the 1-step case (limited EPN Tree search) has minimal impact on the performance of the rollout algorithm. This is because approximating Dt with a small subset of Dt , is only a small part of the entire rollout algorithm. Further explanation for such behavior is suitably explained in Sec.6.1.2. Fig.11 shows the histogram of values of F2 (X), for multiple scenarios, as a result of application of string actions due to H and RH (1-step and N-step heuristic). Clearly, the rollout algorithms show significant improvement over H, for our problem. Fig.12 shows simulation result for multiple scenarios when objective 2 is optimized, but when a smart base heuristic Ĥ is considered instead of H. This simulation study highlights extremely interesting behavior exhibited by the rollout algorithm. In the initial phase of decision-making, the algorithm Ĥ competes with the rollout algorithm, slightly outperforming the rollout algorithm in many instances. However, after a period of 10 days, rollout algorithm (both 1-step and N-step heuristic) comprehensively outperforms Ĥ. Since the rollout has the lookahead property, it offers conservative repair decisions initially (despite staying competitive with Ĥ), in anticipation of overcoming the loss suffered due to initial conservative decisions. Optimizing with foresight is an emergent behavior exhibited by our optimization methodology, which can offer significant advantages in critical decision-making scenarios. Figure 13: Cumulative moving average plot for objective 1 where γ = .8 with base heuristic (H) and rollout algorithm in the simulation results shown in Figs.13 to 16. In Figs.13 and 14, H is used as the base heuristic. This base heuristic is same as the one used in the simulations shown in Case 1, which is not particularly well tuned for Case 2. Despite this, our algorithm shows a stark improvement over H after repeated application of the rollout algorithm. Fig.13 shows that the rollout algorithm, with random selection of candidate damaged locations (D̃t ), significantly outperforms H for objective 1. For the rollout al- 6.1.2. Case 2: Repair Action Optimization of EPN for Household units & Retailers It is difficult to come up with meaningful heuristics to reduce the size of Θ and Ω when multiple net11 Figure 14: Comparison of base heuristic (H) vs rollout algorithm Figure 16: Comparison of base heuristic (Ĥ) vs. rollout algorithm for multiple scenarios for objective 2. the string actions provided by algorithm Ĥ. 6.2. Computational Efforts We provide a brief description of computational efforts undertaken to optimize our decision-making problem. The |Ω̃| and |Θ̃| is huge because of the combinatorial nature of the assignment problem. Furthermore, we have simulated multiple damage scenarios for each different simulation result provided in this work. The modeling of the optimization problem and the solution methodology were implemented in MATLAB. The rollout algorithm gives multiple calls to the base heuristic function and searches for string actions over the sets Ω̃ and Θ̃. This is akin to giving millions of calls to the simulator. Therefore, our implementation of the code had to achieve a run time on the order of few micro seconds(µs) so that millions of calls to the simulator are possible. A single call to the simulator will be defined as evaluating some repair action xt ∈ Ω̃ or Θ̃ and completing the rollout process until all the damaged components are repaired (complete rollout[46]). Despite the use of best software practices, to mitigate large action spaces by coding fast simulator, it is imperative to match it with good hardware capability for simulations of humongous size. It is possible to parallelize the simulation process to fully exploit modern day hardware capability. We ran our simulations on the Summit super computer 8. Specifically, (100/376) Poweredge C6320 Haswell nodes were utilised, where each node has 2x e5-2680v3 (2400/9024) cores. In Case 1, we never encountered the |Ω̃|, |Θ̃| > 106 for any damage scenario, whereas for case 2 we limited the |Ω̃|, |Θ̃| < 105 , for all damage scenarios. On this system, with a simulator call run time of 1µs, Figure 15: Comparison of base heuristic (Ĥ) vs. rollout algorithm for multiple scenarios for objective 1. gorithm, the mean number of days, over multiple damage scenarios, to provide electricity to γ times the total number of people is ≈ 8 days, whereas for the base heuristic it is ≈ 30. Similarly, Fig.14 shows that for objective 2 the benefit of EPN recovery per unit of time with rollout algorithm is significantly better than H. Figs.15 and 16 provide the synopsis of the results for both the objectives when the smart base heuristic Ĥ is considered. In Fig.15 the number of days to reach a threshold γ = 0.8 as a result of Ĥ algorithm is better than H. However, note that the number of days to achieve objective 1 is still lesser using the rollout algorithm. The key inference from this observation is that rollout might not always significantly outperform the smart heuristic, but will never perform worse than any heuristic. Fig.16 shows a behaviour similar to Fig.12 (Case 1) where Ĥ might outperform rollout in the shortterm (as a result of myopic decision-making), but in the long run rollout compressively improves upon 12 we managed to run 1011 simulator calls per node for different simulation plots. Our computational efforts emphasize that for massive combinatorial decision-making problems, it is possible to achieve near-optimal performance with our methodology by harnessing powerful present day computational systems and implementing sound software practices. 9. References References [1] J. A. Nachlas, Reliability engineering: probabilistic models and maintenance methods, Crc Press, 2017. [2] M. J. Kochenderfer, Decision making under uncertainty: theory and application, MIT press, 2015. [3] D. P. Bertsekas, D. P. Bertsekas, D. P. Bertsekas, D. P. Bertsekas, Dynamic programming and optimal control, Vol. 1, Athena scientific Belmont, MA, 1995. [4] H. Meidani, R. Ghanem, Random markov decision processes for sustainable infrastructure systems, Structure and Infrastructure Engineering 11 (5) (2015) 655–667. [5] D. M. Frangopol, M.-J. Kallen, J. M. Van Noortwijk, Probabilistic models for life-cycle performance of deteriorating structures: review and future directions, Progress in Structural Engineering and Materials 6 (4) (2004) 197–212. [6] H. Ellis, M. Jiang, R. B. Corotis, Inspection, maintenance, and repair with partial observability, Journal of Infrastructure Systems 1 (2) (1995) 92–99. [7] R. B. Corotis, J. Hugh Ellis, M. Jiang, Modeling of riskbased inspection, maintenance and life-cycle cost with partially observable markov decision processes, Structure and Infrastructure Engineering 1 (1) (2005) 75–84. [8] E. Fereshtehnejad, A. Shafieezadeh, A randomized point-based value iteration pomdp enhanced with a counting process technique for optimal management of multi-state multi-element systems, Structural Safety 65 (2017) 113–125. [9] D. P. Bertsekas, J. N. Tsitsiklis, Neuro-Dynamic Programming, 1st Edition, Athena Scientific, 1996. [10] K. D. Kuhn, Network-level infrastructure management using approximate dynamic programming, Journal of Infrastructure Systems 16 (2) (2009) 103–111. [11] A. Medury, S. Madanat, Incorporating network considerations into pavement management systems: A case for approximate dynamic programming, Transportation Research Part C: Emerging Technologies 33 (2013) 134– 150. [12] L. Busoniu, R. Babuska, B. De Schutter, D. Ernst, Reinforcement learning and dynamic programming using function approximators, Vol. 39, CRC press, 2010. [13] P. P. Directive, Critical infrastructure security and resilience. ppd-21, released february 12, 2013 (2013). [14] M. Bruneau, S. E. Chang, R. T. Eguchi, G. C. Lee, T. D. ORourke, A. M. Reinhorn, M. Shinozuka, K. Tierney, W. A. Wallace, D. Von Winterfeldt, A framework to quantitatively assess and enhance the seismic resilience of communities, Earthquake spectra 19 (4) (2003) 733–752. [15] S. V. Buldyrev, R. Parshani, G. Paul, H. E. Stanley, S. Havlin, Catastrophic cascade of failures in interdependent networks, Nature 464 (7291) (2010) 1025. [16] A. Barabadi, Y. Ayele, Post-disaster infrastructure recovery: Prediction of recovery rate using historical data, Reliability Engineering & System Safety 169 (2018) 209–223. [17] D. J. Watts, S. H. Strogatz, Collective dynamics of small-worldnetworks, nature 393 (6684) (1998) 440. [18] T. McAllister, Research needs for developing a riskinformed methodology for community resilience, Journal of Structural Engineering 142 (8) (2015) C4015008. 7. Concluding Remarks In this study, we proposed an optimization formulation based on the concept of rollout, for the identification of near-optimal community recovery actions, following a disaster. Our methodology utilizes approximate dynamic programming algorithms along with heuristics to overcome the curse of dimensionality in its analysis and management of large-scale infrastructure systems. It has been shown that the proposed approach can be implemented efficiently to identify near-optimal recovery decisions following a severe earthquake for the Electrical Power serving Gilroy. Different base heuristics, used at the community-level recovery, are defined to show the applicability of our approach. The intended methodology and the rollout policies significantly enhanced different base heuristics. Further, the efficient performance of the rollout formulation in optimizing different common objective functions in the community resilience is demonstrated. We believe that the methodology is adaptable to other infrastructure systems and hazards. 8. Acknowledgement The research herein has been funded by the National Science Foundation under Grant CMMI1638284. This support is gratefully acknowledged. Any opinions, findings, conclusions, or recommendations presented in this material are solely those of the authors, and do not necessarily reflect the views of the National Science Foundation. This work utilized the RMACC Summit supercomputer, which is supported by the National Science Foundation (awards ACI-1532235 and ACI1532236), the University of Colorado Boulder and Colorado State University. The RMACC Summit supercomputer is a joint effort of the University of Colorado Boulder and Colorado State University. 13 [19] G. P. Cimellaro, D. Solari, V. Arcidiacono, C. S. Renschler, A. Reinhorn, M. Bruneau, Community resilience assessment integrating network interdependencies. [20] The association of bay area governments (city of gilroy annex). (2011). URL http://resilience.abag.ca.gov/wp-content/ documents/2010LHMP/Gilroy-Annex-2011.pdf [21] M. Harnish, Housing element policy document and background report (2014). URL http://www.gilroy2040.com/documents/ [22] A. Adigaa, A. Agashea, S. Arifuzzamana, C. L. Barretta, R. Beckmana, K. Bisseta, J. Chena, Y. Chungbaeka, S. Eubanka, E. Guptaa, et al., Generating a synthetic population of the united states. [23] D. Kahle, H. Wickham, ggmap: Spatial visualization with ggplot2., R Journal 5 (1). [24] N. R. C. U. G. Board, E. E. R. Institute, Practical lessons from the Loma Prieta earthquake: report from a symposium sponsored by the Geotechnical Board and the Board on Natural Disasters of the National Research Council: symposium held in conjunction with the Earthquake Engineering Research Institute...[et al.]., National Academies Press, 1994. [25] N. Jayaram, J. W. Baker, Correlation model for spatially distributed ground-motion intensities, Earthquake Engineering & Structural Dynamics 38 (15) (2009) 1687–1708. [26] N. A. Abrahamson, W. J. Silva, R. Kamai, Update of the AS08 ground-motion prediction equations based on the NGA-West2 data set, Pacific Earthquake Engineering Research Center, 2013. [27] R. Kennedy, M. Ravindra, Seismic fragilities for nuclear power plant risk studies, Nuclear Engineering and Design 79 (1) (1984) 47–68. [28] M. Colombi, B. Borzi, H. Crowley, M. Onida, F. Meroni, R. Pinho, Deriving vulnerability curves using italian earthquake damage data, Bulletin of Earthquake Engineering 6 (3) (2008) 485–504. [29] A. Singhal, A. S. Kiremidjian, Method for probabilistic evaluation of seismic structural damage, Journal of Structural Engineering 122 (12) (1996) 1459–1467. [30] K. Jaiswal, W. Aspinall, D. Perkins, D. Wald, K. Porter, Use of expert judgment elicitation to estimate seismic vulnerability of selected building types, in: Proc. 15th World Conference on Earthquake Engineering, Lisbon, Portugal, 24-28 Sep 2012, 2012. [31] H. MRl, Multi-hazard loss estimation methodology: Earthquake model, Department of Homeland Security, FEMA, Washington, DC. [32] L. Xie, J. Tang, H. Tang, Q. Xie, S. Xue, Seismic fragility assessment of transmission towers via performance-based analysis, in: Proceedings of the 15th world conference on earthquake engineering, Lisbon, Portugal Google Scholar, 2012. [33] M. Ouyang, L. Dueñas-Osorio, X. Min, A three-stage resilience analysis framework for urban infrastructure systems, Structural safety 36 (2012) 23–31. [34] S. Nozhati, B. Ellingwood, H. Mahmoud, J. van de Lindt, Identifying and analyzing interdependent critical infrastructure in post-earthquake urban reconstruction, in: Proceedings of the eleventh National Conference in Earthquake Engineering, Earthquake Engineering Research Institute, Los Angeles, CA, June, 2018. [35] S. Nozhati, B. Ellingwood, H. Mahmoud, Y. Sarkale, E. K. P. Chong, N. Rosenheim, An approximate dy- [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] 14 namic programming approach to community recovery management, in: Engineering Mechanics Institute, 2018. Y. Sarkale, S. Nozhati, E. K. P. Chong, B. Ellingwood, H. Mahmoud, Solving markov decision processes for network-level post-hazard recovery via simulation optimization and rollout, in: submitted for publication (Invited Paper), 2018. D. P. Bertsekas, Rollout Algorithms for Discrete Optimization: A Survey, Springer New York, New York, NY, 2013, pp. 2989–3013. doi:10.1007/ 978-1-4419-7997-1_8. URL https://doi.org/10.1007/978-1-4419-7997-1_ 8 D. P. Bertsekas, J. N. Tsitsiklis, C. Wu, Rollout algorithms for combinatorial optimization, Journal of Heuristics 3 (3) (1997) 245–262. doi:10.1023/A: 1009635226865. URL https://doi.org/10.1023/A:1009635226865 N. Limnios, Fault trees, John Wiley & Sons, 2013. Y. Ouyang, S. Madanat, Optimal scheduling of rehabilitation activities for multiple pavement facilities: exact and approximate solutions, Transportation Research Part A: Policy and Practice 38 (5) (2004) 347–365. Y. Liu, E. K. Chong, A. Pezeshki, Bounding the greedy strategy in finite-horizon string optimization, in: Decision and Control (CDC), 2015 IEEE 54th Annual Conference on, IEEE, 2015, pp. 3900–3905. H. Masoomi, J. W. van de Lindt, Restoration and functionality assessment of a community subjected to tornado hazard, Structure and Infrastructure Engineering 14 (3) (2018) 275–291. G. Tesauro, G. R. Galperin, On-line policy improvement using monte-carlo search, in: M. C. Mozer, M. I. Jordan, T. Petsche (Eds.), Advances in Neural Information Processing Systems 9, MIT Press, 1997, pp. 1068–1074. URL http://papers.nips.cc/paper/ 1302-on-line-policy-improvement-using-monte-carlo-search. pdf B. Abramson, Expected-outcome: a general model of static evaluation, IEEE Transactions on Pattern Analysis and Machine Intelligence 12 (2) (1990) 182–193. doi:10.1109/34.44404. S. Ragi, H. D. Mittelmann, E. K. P. Chong, Directional sensor control: Heuristic approaches, IEEE Sensors Journal 15 (1) (2015) 374–381. doi:10.1109/JSEN. 2014.2343019. D. P. Bertsekas, Lids 2646 rollout algorithms for constrained dynamic programming, 2005.
5cs.CE
Unsupervised learning from videos using temporal coherency deep networks Carolina Redondo-Cabrera and Roberto J. López-Sastre∗ arXiv:1801.08100v1 [cs.CV] 24 Jan 2018 GRAM, University of Alcalá, Spain Abstract In this work we address the challenging problem of unsupervised learning from videos. Existing methods utilize the spatio-temporal continuity in contiguous video frames as regularization for the learning process. Typically, this temporal coherence of close frames is used as a free form of annotation, encouraging the learned representations to exhibit small differences between these frames. But this type of approach fails to capture the dissimilarity between videos with different content, hence learning less discriminative features. We here propose two Siamese architectures for Convolutional Neural Networks, and their corresponding novel loss functions, to learn from unlabeled videos, which jointly exploit the local temporal coherence between contiguous frames, and a global discriminative margin used to separate representations of different videos. An extensive experimental evaluation is presented, where we validate the proposed models on various tasks. First, we show how the learned features can be used to discover actions and scenes in video collections. Second, we show the benefits of such an unsupervised learning from just unlabeled videos, which can be directly used as a prior for the supervised recognition tasks of actions and objects in images, where our results further show that our features can even surpass a traditional and heavily supervised pre-training plus fine-tunning strategy. Keywords: unsupervised learning, deep learning, object recognition, object discovery 1. Introduction Numbers speak for themselves: more than 300 hours of video content are added to YouTube every minute1 . A need that certainly arises from such huge source of online videos is the ability to automatically learn from it, ideally without requiring any annotation or form of supervision. ∗ Corresponding author Email address: [email protected] (Carolina Redondo-Cabrera and Roberto J. López-Sastre) URL: http://agamenon.tsc.uah.es/Investigacion/gram/ (Carolina Redondo-Cabrera and Roberto J. López-Sastre) 1 https://www.youtube.com/yt/press/statistics.html Preprint submitted to ArXiv January 25, 2018 Vi Vj ... ... ... ... Quadruplet Network QUERY IMAGE Vi, t Ψ(V i, t ) Siamese Network QUERY IMAGE Vi, t NEIGHBORING W Vi, t+1 OR NEGATIVE Vj, t' NEIGHBORING Ψ(V i, t ) Ψ(V i, t+1 ) L 256 384 384 256 4096 4096 Ψ (V i, t+1 ) W NOT NEIGHBORING Vi, t+n OR 96 W Vi, t+1 Ψ(Vj, t' ) NEGATIVE L Ψ(V i, t+n ) W Vj, t' Ψ(Vj, t' ) 96 384 384 256 4096 1024 256 Figure 1: Siamese deep learning network configurations for unsupervised learning from videos. Our models simultaneously exploit the local slowness present in a video sequence, and a global discriminative margin between two different video sequences. State of the art approaches learning from videos are fully supervised, e.g. [1, 2, 3, 4]. This means they all rely on large-scale video datasets heavily annotated, an aspect that has not been a problem so far: every year a novel fully annotated video dataset appears (e.g. HMDB51 [5], UCF101 [6], THUMOS [7], ActivityNet [8]). So, the question is: why unsupervised learning? The first answer is obvious: the strong supervision model implies a tremendous effort annotating data, a timeconsuming task, with its associated costs, and that is irremediably prone to user-specific biases and errors. But there are more reasons that justify the need of a truly unsupervised learning approach, especially for videos. Fundamentally, videos are much higher dimensional entities compared to images. Therefore, to learn long range structures generally implies to do a lot of feature engineering, e.g. computing the right kind of flow and trajectories features [9, 10], or using elaborated feature pooling methods [11]. Furthermore, like we pointed above, every minute hundreds of videos are freely available without annotations, and none of these heavily supervised solutions can benefit from this invaluable source of information. Current unsupervised methods [12, 13, 14, 15] use the temporal coherence of contiguous video frames as regularization for the learning process. This way, the spatiotemporal continuity of close frames is used as a free form of annotation or supervision, which is used to learn representations that exhibit small differences between these frames. However, these approaches fail to capture the dissimilarity between videos with different content, hence learning less discriminative features. In this paper, we also choose to work in a fully unsupervised learning setting, where our models only have access to unlabeled videos. The key contributions of our work can be summarized as follows: • We introduce two novel fully unsupervised learning approaches, based on Siamese 2 Convolutional Neural Network (CNN) architectures, which exploit the local temporal coherence between contiguous frames, while learn a discriminative representation to separate videos with different content by a margin. Our models and their associated novel loss functions are detailed in Section 3. Figure 1 shows a graphical description of our approach. • In order to demonstrate the effectiveness of our features, we propose to address the problems of unsupervised discovery of actions and scenes in video collections (see Section 4). In other words, given a set of unlabeled videos, the goal is to separate the different classes of actions or scenes. To the best of our knowledge, we propose these two novel experiments, with their two rigorous frameworks, where the objective is to evaluate how the models discover the different actions and scenes, using clustering validation metrics, according to a set of categories. These experimental validations are presented in Sections 4.1.2 and 4.1.3, for actions and scenes, respectively. • Finally, we further evaluate our unsupervised learning approaches, using them as the initialization process for different deep learning architectures, which are then fine-tuned to address the supervised tasks of: a) human action recognition (Section 5.1.2); and b) object recognition (Section 5.1.3). Very interestingly, our results show that our initialization strategy can even surpass the standard and heavily supervised pre-training plus fine-tunning approach. 2. Related Work The first approaches for unsupervised feature learning from videos were based on dimensionality reduction techniques, e.g. [16, 17]. But, certainly, most of prior work leveraging video for unsupervised feature learning relies on the concept of slow feature analysis (SFA) [18]. Essentially, this idea proposes to exploit the temporal coherence in consecutive video frames as a form of free supervision to learn the visual representations. Although Long Short-Term Memory (LSTM) based approaches have been proposed, e.g. [15], most recent work combines CNNs with the SFA strategy [12, 13, 14]. [14] introduce a regularizer to encourage this coherence using a contrastive hinge loss. [13] propose to shuffle a set of consecutive frames and train a set of Siamese deep networks to detect whether a sequence of frames is in the correct temporal order. In [12], the feature analysis is generalized from slow to steady, proposing a model that requires not only that sequential features change slowly, but also that they change in a similar manner in adjacent time intervals of the video sequence. Furthermore, the objective function in [12] combines a supervised loss with an unsupervised regularization term, simultaneously. SFA-based learning has been also used for the problem of dimensionality reduction [19], or for action recognition [20]. Finally, other approaches learn a specific representation for tracked local patches [21, 22], and apply the features to the object recognition problem. Related to the above mentioned methods, our aim is also to learn features from unlabeled videos. However, whereas all the past work focuses on preserving only this 3 temporal coherence among near frames [12, 13, 14], our learning objective is the first to move beyond this slowness, requiring also that frames extracted from different randomly selected videos do not lie close in the feature space to be learned. Technically, we propose two deep learning models, a Siamese and a Quadruplet CNN architecture, which learn a feature space where the temporal coherence in a video sequence is kept. But, simultaneously, they enforce a representation where the frames extracted from the same video should be much closer than any other random pair of frames extracted from different videos. Note that our approach is purely unsupervised, so no combination with any form of supervision in the objective function is allowed, in contrast to [12]. Also, the additional steadiness enforced in [12] does not guarantee any margin between visual representations for different videos. The differences with respect to [21] are also notable. First, they propose to work with tracked image patches. Their model requires of an extra patch extraction step using a tracking process, based on matching SURF [23] features and Improved Trajectories [24]. We simply propose to use the video frames, learning the model completely end-to-end. Finally, our model extends the typical triplet Siamese network architecture [12, 21] to a quadruplet Siamese network. Our novel architecture allows to enrich the traditional SFA methodology, extending the learning based on temporal coherence from between frames in the same video to between frames in different videos. Technically, we introduce a novel layer of regularization which has not been previously explored. 3. Unsupervised Learning from Videos Technically, our problem consists in training a CNN for feature learning, given a set of N unlabeled videos S = {V1 , V2 , . . . , VN }. Being W the parameters of the network, our objective function can be expressed as, T X λ Lu (W, Ui ) , min ||W ||2 + W 2 i=1 (1) where λ is the weight decay constant, Ui encodes the set of T training tuples of video frames, and Lu represents the unsupervised regularization loss term. In the following, we introduce two novel Siamese deep learning architectures, and design two loss functions for Lu to train the networks in an unsupervised way. 3.1. The Siamese Architecture According to the SFA paradigm introduced by [18], it is possible to learn from slowly varying features from a vectorial input signal. Videos become then ideal candidates as input signals. We simply have to comprehend that the temporal coherence between contiguous video frames can work as a form of supervision, which is free and structural. SFA encourages the following property: in a learned feature space, temporally nearby video frames should lie close to each other, i.e. for a learned representation Ψ, and adjacent video frames Vi,t and Vi,t+1 , one would like Ψ(W, Vi,t ) ≈ Ψ(W, Vi,t+1 ). In the following, we will abbreviate Ψ(W, Vi,t ) to Ψ(Vi,t ), assuming the learned feature representation is a function of the learned parameters W for the network. 4 The key idea behind our first Siamese model is as follows. During learning, we want to encourage that a query frame and its adjacent video frame lie close in the learned feature space Ψ, while the distance between this query frame and any other randomly extracted frame coming from a different video is higher than a margin (δ). So, we first propose the Siamese architecture shown in Figure 1 (left). It consists of two base networks which share the same parameters. The input of the model is a pair of video frames, (Vi,t , Vi,t+1 ) or (Vi,t , Vj,t0 ), and an associated label Y (Y = 1 when the frames belong to the same video, Y = 0 otherwise). The final output of each base network is a 4096-dimensional feature space Ψ(·). Note that we do not initialize this base network with weights from a previous training in any other dataset, like, for instance, ImageNet. Technically, we start with a random initialization for the model parameters. So, our approach is fully unsupervised. We want our network to learn a feature representation Ψ(·), such that, for a query video Vi and a randomly chosen different video Vj , the distance between the feature representations of the neighboring frames Vi,t and Vi,t+1 is lower than the distance from our query frame Vi,t and any other frame randomly extracted from the video Vj , i.e. Vj,t0 . For doing so, we propose the following contrastive loss function, based on [19], which can also exploit negative (non-neighbor) pairs, Ls (Ψ(Vi,t ), Ψ(Vi,t+1 ), Ψ(Vj,t0 ) = Y · d(Ψ(Vi,t ), Ψ(Vi,t+1 ))+ (2) (1 − Y ) · max{0, δ − d(Ψ(Vi,t ), Ψ(Vj,t0 ))}. For the distance function d we follow the euclidean distance. As it is shown in Equation 2, our contrastive loss penalizes the distance between pair of neighbor frames (Y = 1), and encourages the distance between them when they do not belong to the same video (Y = 0). We do not use any video labels during training, therefore, it could happen that the randomly selected different video, i.e. Vj , might belong to the same category of Vi . If one plans to use the learned features for classifications tasks, as we do, might this be problematic? We assume that there is little likelihood that this situation actually happens, but in case it does, we consider that to impose the margin between frames of different videos, even if they belong to the same category, pushes the feature learning towards more fine-grained representations, able to capture higher-level semantic visual concepts. 3.2. The Quadruplet Siamese Architecture With our previous Siamese architecture, the model is not able to see how the learned feature representation evolves within the same video. Note that only contiguous frames are used. How can we further capture rich structure in how the visual content changes over time? [12] propose to generalize the SFA model in [18], introducing a feature learning model which is able to impose a second order temporal derivative during learning the video representation. Using triplets of temporally close frames (Vi,a , Vi,b , Vi,c ), their 5 neighbor pair non-neighbor pair negative pair Ψ Ψ Ψ Figure 2: Quadruplet Siamese network key idea: A query frame and its adjacent frame should lie close in the learned feature space, while this query frame share a more similar representation with a non-neighbor frame than with a frame extracted from a different video. The feature representation (Ψ) for the query frame is shown in green, and the representations for the neighbor, the non-neighbor and the negative frames appear in blue. Note that, when the frames belong to the same video the blue and green representations are closer than when the frames belong to different videos. Consequently, the proposed architecture is able to learn an embedding of video frames into a feature space, where some semantic is preserved, e.g. frames with similar/dissimilar “actions” or “scenes” are mapped to close/far points in the discovered space. model guarantees that feature changes in the immediate future remain similar to those in the recent past, i.e. d(Ψ(Vi,b ), Ψ(Vi,a )) ≈ d(Ψ(Vi,c ), Ψ(Vi,b )). The key idea of our approach is different. We want to guarantee that in the learned feature representation the temporal coherence of contiguous frames is kept, while the distance between frames in a wider temporal locality, defined by a temporal window of length n, is always lower than the distance between frames coming from different videos. In summary, we propose a model able to capture the local slowness of the video, keeping a global discriminative representation. Furthermore, while the objective function in [12] combines a supervised loss with an unsupervised regularization term, our model is completely unsupervised. For doing so, we propose the Quadruplet Siamese architecture illustrated in Figure 1 (right). It consists of four base networks which share the same parameters. The input of the model corresponds to the tuple of four video frames (Vi,t , Vi,t+1 , Vi,t+n , Vj,t0 ). The output of each base network is now a 1024-dimensional feature space. Why these four video frames? As it is shown in Figure 2, we want that a query frame Vi,t and its adjacent video frame Vi,t+1 lie close in the learned feature space (Ψ(Vi,t ) ≈ Ψ(Vi,t+1 )), while this query frame shares a more similar representation with a non-neighbor frame Vi,t+n of the same video, than with a a frame extracted from a different video Vj,t0 , i.e. d(Ψ(Vi,t ), Ψ(Vi,t+n )) < d(Ψ(Vi,t ), Ψ(Vj,t0 )). This is encoded in an improved loss function, designed to train the proposed Quadruplet architecture, as follows: Lq (Ψ(Vi,t ), Ψ(Vi,t+1 ), Ψ(Vi,t+n ), Ψ(Vj,t0 )) = d(Ψ(Vi,t ), Ψ(Vi,t+1 ))+ max{0, d(Ψ(Vi,t ), Ψ(Vi,t+n )) − d(Ψ(Vi,t ), Ψ(Vj,t0 )) + α}, where α represents our discriminative global margin. 6 (3) fd Discovering Categories .. .. .. ... f1 f2 f3 .. . ... .. . .. . .. . .. . .. . .. . .. . ... L . .. .. .. .. ... .. . . .. W .. .. .. ... ... ... .. . Clustering . .. Unsupervised Feature Learning Test Video Figure 3: Unsupervised action and scene discovery in videos. Our Siamese architectures learn, in a fully unsupervised way, the features to be used for the discovery task in videos. The different categories can be discovered running a clustering algorithm over the features. 3.3. Implementation details For all our unsupervised learning approaches, we apply mini-batch Stochastic gradient descent (SGD) during training. Our solutions have been built using the Caffe framework [25]. Input video frames are scaled to a fixed size of 227 × 227 pixels. The base network of all our architectures follows the AlexNet model of [26] for the convolutional layers. Then we stack two fully connected layers on the pool5 layer outputs, whose neuron numbers are: a) 4096 and 1024 for the Quadruplet network trained with Lq ; and b) 4096 and 4096 for the Siamese model trained with Ls . All our architectures share the parameters, therefore we can perform the forward propagation for the whole batch by a single base network, and calculate the loss based on the output features. To train our models, we set the batch size to 120 pairs and 40 tuples of frames, for the Siamese and Quadruplet networks, respectively. The learning rate starts with 0 = 0.001 for both deep architectures. For the Siamese network δ = 1, and for the Quadruplet network the global discriminative margin, α, is fixed to 0.5, and n = 20. 4. Discovering Actions and Scenes in Videos from A to Z Figure 3 illustrates the designed approach for discovering actions or scenes in videos. Given a set of N unlabeled videos S = {V1 , V2 , . . . , VN }, our goal is to separate the different actions or scenes they represent. Here we take inspiration from the object discovery approach in still images, introduced by [27]. Essentially, we generalize their evaluation procedure and problem description, from the discovery of objects in image collections, to the unsupervised discovery of actions and scenes in videos. We consider that this is an ideal fully unsupervised scenario, for an adequate experimental validation of the unsupervised feature learning approaches that we introduce in this paper. In particular, we design two experiments with two video datasets: one for discovering scenes, the 5-Contexts dataset [28]; and the UCF101 [6] for the discovery of actions. More details of the experimental setups are given in Section 4.1.1. 7 As it is shown in Figure 3, we consider that each video frame Vi,t can be characterized by a feature vector Ψ(Vi,t ) which is learned by one of our architectures in an unsupervised way. With all these feature vectors, for all the frames of all the videos, we can proceed to discover the different scenes or actions. Because the state of the art for discovering objects in image collections has been reached by clustering based methods [27], we propose to solve our described tasks with a clustering algorithm over the learned features. Note that this pipeline can be generalized to any other partition technique. Built the partitions, it is time to evaluate the performance of the discovery tasks. Technically, the video frames have been separated into a set of clusters. Therefore, as in [27], we propose to use standard metrics for scoring the discovery quality when clusters are used, in particular the conditional entropy. For the conditional entropy (CE), we follow the classical formulation proposed in Information Theory. Consider the ground truth category labels X and obtained cluster labels Y . So, given variables (x, y), sampled from the finite discrete joint space X ×Y , we define CE as follows,   X X 1 . (4) H(X|Y ) = p(y) p(x|y)log p(x|y) y∈Y x∈X In a nutshell, our experiments consists of the following steps. First, a set of training videos are used to learn the proposed architectures in an unsupervised way, see Section 3. Second, we proceed to compute, for the test frames of the test videos, their corresponding feature representation. Once these test features have been obtained, we run a clustering algorithm and evaluate its discovery performance. Note that as in [27], at this point we must fix the number of clusters to be build by the clustering algorithms. Ultimately, the machine should be able to decide on this too, without any human intervention, but here we want to define a clear experimental evaluation where the different models can be compared given a known number of classes. Note that we do not perform any parameter tuning. Each experiment is simply repeated 10 times, and its average performance and standard deviation are reported, according to the CE metric. 4.1. Experiments We have designed these experiments to accomplish the following targets: a) get a quantitative and qualitative understanding of how our unsupervised models discover scenes and actions in videos; and b) evaluate whether the learned representations are able to generalize well, when the problem changes. 4.1.1. Experimental Setup To discover actions in videos, we propose to use the UCF101 dataset [6]. It is an action recognition dataset of realistic action videos, collected from YouTube. It consists of over 12.000 videos categorized into 101 human action classes. The dataset is divided in three splits. For our experiments we use the split-1, which consists of 9537 videos for training and 3783 for testing. 8 Table 1: Comparison of the different unsupervised approaches using K-means and SC in the UCF101 dataset. CE (lower is better) metric is reported. K-means SC AlexNet with Ls fc6 AlexNet with Ls fc7 3.91 ± 0.02 3.95 ± 0.02 3.75 ± 0.01 3.78 ± 0.01 AlexNet with Lq fc6 AlexNet with Lq fc7 3.56 ± 0.01 3.61± 0.01 3.39 ± 0.01 3.41 ± 0.02 Methods For discovering scenes in videos, we have chosen the publicly available 5-Contexts dataset released by [28]. It consists of multiple egocentric videos acquired by a single user in different personal contexts (car, coffee vending machine, office, TV and home office). Four different wearable cameras are used for recording the scenes, assuming that the user can turn his head and move his body when interacting with the environment. We follow the training/test splits provided with the dataset. The training set consists of 5 × 4 videos of 10 seconds. For the test set, the dataset provides medium length videos (from 8 to 10 minutes) with a normal activity of the user in the corresponding personal context. Although all these datasets come with annotations for all the videos, note that we do not use the video annotations provided for learning our features. Instead, we train our unsupervised models with a subset of random video frames extracted from the videos. Technically, our models are learned collecting pairs and tuple of frames, randomly sampled from the training videos. 4.1.2. Discovering Actions Let us use the challenging UCF101 dataset to offer a detailed analysis of the proposed models. We start proposing a pipeline to perform the discovery of action categories, where the performance of our Siamese and Quadruplet architectures is evaluated using two different clustering algorithms over the learned features: K-means (K = 101) and Spectral clustering (SC).For the SC we follow the Normalized Cuts Spectral Clustering of [29], using a Gaussian kernel for the similarity matrix. We also investigate the impact of learned features obtained from different layers of our CNNs, i.e. fc6 and fc7 layers. Results are summarized in Table 1. From Table 1, the comparison between the Siamese architecture and the Quadruplet model reveals that the latter is always better. It is also interesting to observe that the features that best performance are offering come from layer fc6 instead of from fc7, for all the clustering methods and architectures. Finally, results show that the SC is able to discover slightly better categories. We now offer in Table 2 a comparison of our models with some competing methods. The first one consists in a random assignment of video frames to clusters (Baseline RANDOM in Table 2 – first row). Baseline RANDOM provides a sanity check in that other methods should always perform better, as it is the case. Note that randomly assigning video frames to clusters results in a CE of 6.31. This value is close to the maximum log2 (101) = 6.66, giving an idea of the difficulty of the action discovery 9 Table 2: Unsupervised discovery of actions in the the UCF101 dataset. Comparison with baselines. CE (lower is better) metric is reported. K-means SC Baseline RANDOM 6.31 ± 0.00 6.31 ± 0.00 AlexNet with LSF A fc6 [19] 3.75 ± 0.03 3.55 ± 0.03 AlexNet with Ls fc6 AlexNet with Lq fc6 3.91 ± 0.02 3.56 ± 0.01 3.75 ± 0.02 3.39 ± 0.01 Methods task proposed for this dataset. The other competing method we propose here follows the standard SFA implementation based on a contrastive loss [19]. Technically, the baseline implemented is identical to our Siamese architecture with AlexNet, but instead of using our Ls loss, a contrastive loss is used with contiguous and not-contiguous frames coming from the videos, following [14]. We consider this comparison important, because it is a form of ablation study, where we empirically validate the benefits of using our novel loss functions, which incorporate the concept of global margin between different videos. Only the Siamese model features are not able to outperform in this dataset the performance of the SFA approach, reporting a superior CE with respect to the SFA. However, the best performing method is our Quadruplet network, which clearly outperforms the SFA baseline. This justifies the necessity of incorporating into the learning model not only the global margin for features from different videos, but also the capability of our model to measure how the content changes over time within the same video. That is, the global margin is guaranteed, but letting the temporal locality of the features in the same video to play a role. Overall, by applying our unsupervised procedure with SC, the remaining uncertainty on the true action category has been reduced from 26.31 = 79.34 for the random assignment, down to 23.39 = 10.48 for our Quadruplet network. Are our unsupervised models able to compete with standard fully supervised approaches used for learning the features? We can now compare the performance of our fully unsupervised solutions, with the performance reported when the features are extracted using a fully supervised AlexNet model trained on ImageNet. The CE reported by K-means and SC with fc6 layer features obtained from this fully supervised model is of 2.68 ± 0.42 and 2.50 ± 0.04, respectively. Our best Quadruplet network, trained with roughly 9.500 videos in a fully unsupervised way, reports a CE of 3.39 ± 0.01. This means that our unsupervised solution, which does not need need any annotation, is able to recover 72% of the heavily supervised performance. This defines the new state of the art in fully unsupervised training for action discovery. Finally, we proceed to perform a qualitative analysis of the results. Figure 4 shows 6 random images for the top three clusters discovered by each of the models, including the fully supervised solution. First, one can observe how our Quadruplet network is able to obtain a distribution very similar to that obtained by the AlexNet trained on ImageNet. Moreover, this figure also shows that our solutions are able to build clusters 10 c1 CE = 0.08 c2 CE = 0.43 c3 CE = 1.13 (a) AlexNet trained with Ls c1 CE = 0.07 c2 CE = 0.17 c3 CE = 0.27 (b) AlexNet trained with Lq c1 CE = 0 c2 CE = 0 c3 CE = 0 (c) Fully supervised AlexNet trained on ImageNet Figure 4: Qualitative results in the UCF101 dataset. 6 random images for the top three clusters discovered are shown. with an almost 0 CE without any form of supervision during the feature learning stage. In Figure 5 we show a 2-dimensional embedding using Barnes-Hut t-SNE [30], for the 4096-dimensional fc6 features learned with our Quadruplet architecture. In other words, t-SNE arranges images that have a similar CNN (fc6) code nearby in the embedding. One can observe that our fully unsupervised solution is able to learn features that can actually discover groups of semantically similar images. 4.1.3. Discovering Scenes We now experimentally validate the detailed models in a different discovery task. Here we propose to use the 5-Contexts dataset for discovering scenes in personal context videos. Again, we proceed to train all our feature learning solutions, in a fully unsupervised way. K-means and SC based solutions are evaluated, using the features from layer fc6. According to our previous analysis in the UCF101 dataset, fc6 features perform better than fc7, being this the case for this dataset as well. Table 3 shows a detailed analysis of the performance of our approaches, as well as a comparison with a random assignment of labels, and with a standard SFA based on a contrastive loss [19]. Note that the RANDOM baseline achieves a CE of 2.31 for this dataset. This value is close to the maximum log2 (5) = 2.32, when 5 is the number of classes. First, our architectures significantly outperform the RANDOM baseline. Second, the performance 11 Figure 5: Barnes-Hut t-SNE 2-dimensional embedding for the 4096-dimensional fc6 features learned with our Quadruplet model. Best viewed with zoom. of our unsupervised models is better than the achieved by the SFA approach. In a detailed comparison, we observe that also the performance of our Siamese architecture is slightly better than the one reported by the SFA model. Remember that this was not the case for the experiments in the UCF101 dataset. Now, the unsupervised models learn from egocentric videos, where the scenes and activities are largely defined by the objects that the camera wearer interacts with. Therefore, the appearance variability of these personal videos is not so high, because the different users interact with the same environments/scenes or objects (e.g. the same coffee machine). These aspects clearly benefit our temporal coherency networks. If we now analyze the results of our two architectures, we observe that the Quadruplet model is again the clear winner of the competition, reporting the lowest CE for both clustering algorithms. By applying our Quadruplet architecture, the remaining uncertainty on the true context category has been reduced from 22.31 = 5.0, for a random assignment, to 21.94 = 3.8. One more time, results reveal the benefits of using the loss Lq , which takes advantage of jointly guaranteeing the slowness for the video 12 Table 3: Comparison of the different unsupervised approaches using K-means and SC in the 5-Contexts dataset. CE (lower is better) metric is reported. Methods Baseline RANDOM K-means 2.31 ± 0.00 SC 2.31 ± 0.00 AlexNet with LSF A fc6 [19] 2.03 ± 0.01 1.98 ± 0.03 Our AlexNet with Ls fc6 Our AlexNet with Lq fc6 2.03 ± 0.00 1.94 ± 0.01 1.98 ± 0.00 1.97 ± 0.00 frames features, and a discriminative representation. It is now worth to compare the performance of all these unsupervised solutions against the heavily supervised feature learning model Alexnet [26], using ImageNet dataset. Using a K-means clustering with these supervised features, the CE reported is of 0.71 ± 0.18. This excellent result can be explained by the fact we already pointed above: the scenes in these egocentric videos are defined by the objects the user interact with, therefore an AlexNet model trained for object classification should report a good performance. We end this experiment showing qualitative results in Figure 6. Figures 6(a) and 6(b) show that the main confusion for our models is for scenes home office and office. Overall, our approaches seem to be able to discover a finer granularity than expected, e.g. joining all the video frames containing any type of screen, an object category shared across three different scenes (office, home office and tv), or even including in the same cluster those images of the windshield which can be confused with a monitor too. 4.1.4. Do our unsupervised features generalize well? We present here an additional experiment, for which our aim is to evaluate whether our learned visual representations are able to generalize well. The idea is simple: we propose to specifically measure the performance of the deep architecture trained with UCF101 video frames, but for discovering scenes over the test videos in the 5-Contexts dataset. We evaluate our Quadruplet Siamese AlexNet network, and use a K-means clustering for the discovery task. Surprisingly, we are able to report a CE of 1.80 ± 0.09. This number clearly outperforms our previously best CE (1.94). This fact reveals that our models clearly benefit from using more and more videos for learning the feature encoding. Actually, the more the heterogeneity of the videos for training, the better the capability of the features of the models to discover categories. 5. Unlabeled video as a prior for supervised recognition In this section we explore the benefits of initializing deep networks for a supervised learning task with the weights provided by our fully unsupervised strategies. Typically, the standard recipe for obtaining a good performance on a novel recognition task using deep learning models, suggests to start initializing the weights of the networks with a pretrained model, which has been learned in a heavily supervised way 13 Table 4: Fine-tuning results on PASCAL VOC 2012 Action dataset. Comparison using AlexNet-based CNN architectures. Models Accuracy (%) Baseline (Random assignment) AlexNet Init Random 9.6 15.10 Our AlexNet init. with Ls (UCF101 → PASCAL VOC 2012) Our AlexNet init. with Lq (UCF101 → PASCAL VOC 2012) 16.15 18.15 AlexNet init. with LSF A [19] (UCF101 → PASCAL VOC 2012) 16.85 AlexNet init. with [13] (UCF101 → PASCAL VOC 2012) AlexNet init. with [21] (Trained on 8M data → PASCAL VOC 2012) 17.9 22.5 Fully supervised AlexNet pretrained on ImageNet 28.45 using a large scale dataset (e.g. ImageNet). Second step consists in a fine-tuning process to adapt the network to the new problem or task. On the contrary, we suggest to change the initialization strategy. Instead of using the weights of a fully supervised model, we simply propose to initialize the models following our unsupervised learning methodology. In this section we present a detailed experimental evaluation, where we compare these two initialization strategies for two different recognition tasks: action recognition and object classification. 5.1. Experiments 5.1.1. Experimental Setup Two datasets are used for the proposed tasks. Action recognition is evaluated with the PASCAL VOC 2012 dataset [31]. Here we strictly follow the fine-tuning procedure detailed in [12]. The PASCAL VOC 2012 dataset offers 10 action categories. The images are cropped using the action annotations provided. Only 50 images (10 classes × 5 images per class) are used during the fine-tuning stage. We test on 2000 images randomly extracted from the validation set. For the object recognition experiment, we use the CIFAR-10 dataset [32]. CIFAR-10 consists of 60.000 32 × 32 color images of 10 classes, with 6000 images per category. Here, we follow the experimental setup proposed by [32]: we use the 50.000 training images during the fine-tuning stage, and then we use the 10.000 testing images to test the models. The video datasets we use to perform our fully unsupervised learning are UCF101 [6] and HMDB51 [5]. For the former, random pairs or tuples of frames are extracted from the videos provided in the Split 1. For the HMDB51 dataset, 1000 videos clips have been randomly selected, and they have been used to extract the frames for our unsupervised feature learning. 5.1.2. Action Recognition We start the experimental evaluation training our unsupervised models with the videos in the UCF101 dataset. We use the learned model weights to initialize an AlexNet network, before the fine-tuning for action recognition is performed. 14 Table 4 summarizes the main results. We first report the performance of two baselines: 1) a random assignment of action categories (this is the sanity check); and 2) a random initialization of the weights of the network before the fine-tuning. Interestingly, this second baseline gets an action classification accuracy of 15%. We now report the performance of our two unsupervised feature learning models, i.e. the Siamese with loss Ls and the Quadruplet with loss Lq . Additionally, we report the performance of a Siamese model where we implement the SFA model with a contrastive loss function [19]. Clearly, our Quadruplet solution outperforms not only the baselines by a large margin, but also the Siamese models. Table 4 also shows a comparison with state-of-the-art models [13, 9]. They both are able to learn deep models from unlabeled videos. For these experiments, we have used their available pre-trained models. The model of [13] was trained using also the UCF101 dataset, and exactly the same videos that we use for our models. However, the model of [9] uses 8 million triplets of frames extracted from 100k YouTube videos using the URLs provided by [33]. We and [13] use only 9537 videos. Overall, our Quadruplet network is able to improve [13], but [21] achieve the best accuracy. Recall that [21] model needs to work with tracked patches. This requires an extra tracking process which needs the computation of local features (SURF [23]) and the costly Improved Trajectories [24]. Our models simply learn from video frames in a completely end-to-end fashion. Finally, Table 4 shows the accuracy obtained when a fully supervised AlexNet model, pretrained using the whole ImageNet, is used. Our best unsupervised solution is able to recover 64% of the accuracy of the fully supervised solution. We consider these results promising, indicating that our models are able to learn effective visual representations for the action recognition task. Moreover, when the same videos are used for learning, we improve the state-of-the-art defined by [13]. We also want to evaluate the performance of our models in the the experiment described in [12]. The experimental setup proposed by [12] consists in initializing a CIFAR CNN architecture [32] using unsupervised models for feature learning on 1000 videos clips randomly extracted from the HMDB51 dataset. Then, a fine-tuning for the task of action recognition in the PASCAL VOC 2012 has to be performed. We compare here the following model parameters initialization strategies: 1) a random assignment; 2) using the weights obtained by our unsupervised feature learning models; 3) a Siamese architecture trained for SFA with a contrastive loss [19]; 4) the approach of [12]; and 5) implementing a heavily supervised pipeline, initially training the model to recognize the classes in the CIFAR-100 dataset [32]. Table 5 summarizes the main results. First, our Siamese and Quadruplet solutions outperform not only the standard random initialization baseline, but also the initialization using the SFA model [19]. Like in all previous experiments, the Quadruplet model improves all the Siamese architectures. The excellent work of [12] reports the best performance here: it slightly improves the accuracy of the heavily supervised pipeline (20.95% vs. 20.22%). The accuracy of our Quadruplet model is of 18.75%, which means that we are able to recover 92.73% of the accuracy of a fully supervised model. In fact, the heavily supervised model needs at 15 Table 5: Fine-tuning results on PASCAL VOC 2012 Action dataset. Comparison using CIFAR-based CNN architectures. Models Accuracy (%) CIFAR Init Random 15.20 Our CIFAR init with Ls (HMDB51 → PASCAL VOC 2012) Our CIFAR init with Lq (HMDB51 → PASCAL VOC 2012) 18.40 18.75 CIFAR init with LSF A [19] (HMDB51 → PASCAL VOC 2012) 16.90 CIFAR init with [12] (HMDB51 → PASCAL VOC 2012) 20.95 CIFAR pretrained on 17.400 images from CIFAR-100 CIFAR pretrained on full CIFAR-100 17.35 20.22 Table 6: Object recognition experiment. Accuracy comparison on CIFAR-10 dataset. Models Accuracy (%) CIFAR Init Random 75.1 CIFAR init with Ld [21] (HMDB51 → CIFAR-10) Our CIFAR init with Lq (HMDB51 → CIFAR-10) 76.1 76.5 least 17.4002 training images to report an accuracy of 17.35%, which is closer to ours. We consider these numbers very promising results. Technically, our experiments show that our features, learned from unlabeled video can even surpass a standard heavily supervised approach. 5.1.3. Recognizing Object Categories We want to conclude the experimental validation presenting the same type of experiment but for the problem of object recognition. We use here the CIFAR-10 dataset for image classification. So, the fine-tuning is done with the training images of this dataset. In Table 6 we compare the classification accuracy of three different architecture initialization strategies: 1) a random initialization of weights; 2) the approach of [21]; and 3) our best unsupervised model, i.e. the Quadruplet architecture. We have implemented the ranking Euclidean loss described in [21], using a Triplet-Siamese architecture adapted from the CIFAR network provided by Caffe [25]. We name this approach as CIFAR init with Ld [21] in Table 6. Our model outperforms the random initialization, showing that it is also feasible to learn effective visual representations for the problem of object recognition from unlabeled videos. Remarkably, training under the same conditions, our Quadruplet Siamese model slightly outperforms the learning procedure of [21]. 2 This number has been provided by the authors of [12] 16 6. Conclusions In this paper we introduce two novel CNN architectures for unsupervised feature learning from unlabeled videos. As a form of self-supervision, they jointly exploit the local temporal coherence between contiguous frames, and a global discriminative margin used to separate representations between different videos. Using four diverse datasets, we show the impact of our methods on activity and scene discovery tasks, and on activity and object recognition problems. For the action classification problem, our experiments show that our unsupervised models can even surpass a heavily fully supervised pre-training approach. Overall, we consider promising the results reported, confirming that learning from unlabeled video can augment visual learning. We plan to publicly release all the code needed to reproduce the results in the paper. 7. Acknowledgments This work is supported by project PREPEATE, with reference TEC2016-80326R, of the Spanish Ministry of Economy, Industry and Competitiveness. We gratefully acknowledge the support of NVIDIA Corporation with the donation of the Titan X Pascal GPU used for this research. Cloud computing resources were kindly provided through a Microsoft Azure for Research Award. References References [1] S. Ji, W. Xu, M. Yang, , K. Yu, 3D convolutional neural networks for human action recognition, PAMI. [2] A. Karpathy, G. Toderici, S. Shetty, T. Leung, R. Sukthankar, L. Fei-Fei, Largescale video classification with convolutional neural networks, in: CVPR, 2014. [3] K. Simonyan, A. Zisserman, Two-stream convolutional networks for action recognition in videos, in: NIPS, 2014. [4] S. Herath, M. Harandi, F. Porikli, Going deeper into action recognition: A survey, Image and Vision Computing 60 (2017) 421. [5] H. Kuehne, H. Jhuang, E. Garrote, T. Poggio, T. Serre, HMDB: a large video database for human motion recognition, in: ICCV, 2011. [6] K. Soomro, A. R. Zamir, M. Shah, UCF101: A dataset of 101 human actions classes from videos in the wild, CRCV-TR-12-01. [7] H. Idrees, A. R. Zamir, Y.-G. Jiang, A. Gorban, I. Laptev, R. Sukthankar, M. Shah, The {THUMOS} challenge on action recognition for videos in the wild, CVIU 155 (2017) 1 – 23. 17 [8] F. Caba-Heilbron, V. Escorcia, B. Ghanem, J. C. Niebles, ActivityNet: A largescale video benchmark for human activity understanding, in: CVPR, 2015. [9] H. Wang, D. Oneata, J. Verbeek, C. Schmid, A robust and efficient video representation for action recognition, IJCV 119 (3) (2015) 219–238. [10] F. Turchini, L. Seidenari, A. Del Bimbo, Understanding and localizing activities from correspondences of clustered trajectories, CVIU 159 (2017) 128 – 142. [11] B. Fernando, E. Gavves, J. Oramas, A. Ghodrati, T. Tuytelaars, Rank pooling for action recognition, PAMI. [12] D. Jayaraman, K. Grauman, Slow and steady feature analysis: higher order temporal coherence in video, in: CVPR, 2016. [13] I. Misra, C. L. Zitnick, M. Hebert, Shuffle and learn: Unsupervised learning using temporal order verification, in: ECCV, 2016. [14] H. Mobahi, R. Collobert, J. Weston, Deep learning from temporal coherence in video., in: ICML, 2009. [15] N. Srivastava, E. Mansimov, R. Salakhutdinov, Unsupervised learning of video rrepresentation using lstms, in: ICML, 2015. [16] J. H. van Hateren, D. L. Ruderman, Independent component analysis of natural image sequences yields spatio-temporal filters similar to simple cells in primary visual cortex., in: Biological sciences / The Royal Society, 1998. [17] J. Hurri, A. Hyvarinen, Simple-cell-like receptive fields maximize temporal coherence in natural video., Neural Computation 15 (3) (2003) 663691. [18] L. Wiskott, T. Sejnowski, Slow feature analysis: Unsupervised learning of invariances., Neural Computation. [19] R. Hadsell, S. Chopra, Y. LeCun, Dimensionality reduction by learning an invariant mapping, in: CVPR, 2006. [20] L. Sun, K. Jia, T.-H. Chan, Y. Fang, G. Wang, S. Yan, DL-SFA: Deeply-learned slow feature analysis for action recognition, in: CVPR, 2014. [21] X. Wang, A. Gupta, Unsupervised learning of visual representations using videos, in: ICCV, 2015. [22] K. Zou, W. Y. Yu, A. Y. Ng, Unsupervised learning of visual invariance with temporal coherence, in: NIPS Workshop on Deep Learning and Unsupervised Feature Learning, 2011. [23] H. Bay, A. Ess, T. Tuytelaars, L. Van Gool, SURF: Speeded up robust features, CVIU 110 (2008) 346–359. [24] H. Wang, C. Schmid, Action recognition with improved trajectories, in: ICCV, 2013. 18 [25] Y. Jia, E. Shelhamer, J. Donahue, S. Karayev, J. Long, R. Girshick, S. Guadarrama, T. Darrell, Caffe: Convolutional architecture for fast feature embedding, arXiv preprint arXiv:1408.5093. [26] A. Krizhevsky, I. Sutskever, G. E. Hinton, ImageNet classification with deep convolutional neural networks, in: NIPS, 2012. [27] T. Tuytelaars, C. H. Lampert, M. B. Blaschko, W. Buntine, Unsupervised object discovery: A comparison, IJCV 88 (2) (2010) 284–302. [28] A. Furnari, G. M. Farinella, S. Battiato, Recognizing personal contexts from egocentric images, in: ICCV Workshop ACVR2015: Third International Workshop on Assistive Computer Vision and Robotics, 2015. [29] A. Y. Ng, M. I. Jordan, Y. Weiss, On spectral clustering: Analysis and an algorithm, in: NIPS, 2001. [30] L. van der Maaten, Accelerating t-sne using tree-based algorithms, Journal of Machine Learning Research 15 (2014) 32213245. [31] M. Everingham, L. Van Gool, C. K. I. Williams, J. Winn, A. Zisserman, The PASCAL Visual Object Classes Challenge 2012 (VOC2012) Results (2012). [32] A. Krizhevsky, Learning multiple layers of features from tiny images, Tech. rep., University of Toronto (2009). [33] X. Liang, S. Liu, Y. Wei, L. Liu, L. Lin, S. Yan, Towards computational baby learning: A weakly-supervised approach for object detection, in: ICCV, 2015. 19 c1 CE = 1.65 car homeoffice homeoffice office office office car car car car car car homeoffice homeoffice homeoffice homeoffice homeoffice office office office office tv homeoffice homeoffice homeoffice office office tv tv tv tv tv office office office tv tv tv tv tv office office office office office tv c2 CE = 1.73 coffeemachine coffeemachine coffeemachine tv c3 CE = 1.78 c4 CE = 1.97 c5 CE = 2.16 car car coffeemachine coffeemachine coffeemachine homeoffice (a) AlexNet trained with Ls c1 CE = 1.42 car homeoffice office car car car car car homeoffice tv tv tv c2 CE = 1.68 coffeemachine coffeemachine coffeemachine coffeemachine homeoffice c3 CE = 1.97 homeoffice homeoffice office office office tv tv c4 CE = 2.18 car car coffeemachine coffeemachine coffeemachine coffeemachine office office tv tv car car coffeemachine homeoffice office office office tv c5 CE = 2.27 homeoffice office (b) AlexNet trained with Lq c1 CE = 0 coffeemachine coffeemachine coffeemachine coffeemachine coffeemachine coffeemachine coffeemachine coffeemachine coffeemachine coffeemachine c2 CE = 0.13 tv tv tv tv tv tv tv tv tv tv car car car car car car car car car car homeoffice homeoffice homeoffice homeoffice homeoffice homeoffice office office office c3 CE = 0.17 c4 CE = 1.23 office c5 CE = 1.76 homeoffice homeoffice homeoffice homeoffice office office office office office office (c) Fully supervised AlexNet trained on ImageNet Figure 6: Qualitative results in the 5-Contexts dataset. 10 random images for each of the 5 categories discovered. 20
1cs.CV
JOURNAL OF COMMUNICATION AND INFORMATION SYSTEMS, VOL. 32, NO.1, 2017. 133 Low-Complexity Integer-Forcing Methods for Block Fading MIMO Multiple-Access Channels arXiv:1711.07977v1 [cs.IT] 21 Nov 2017 Ricardo Bohaczuk Venturelli and Danilo Silva Abstract—Integer forcing is an alternative approach to conventional linear receivers for multiple-antenna systems. In an integer-forcing receiver, integer linear combinations of messages are extracted from the received matrix before each individual message is recovered. Recently, the integer-forcing approach was generalized to a block fading scenario. Among the existing variations of the scheme, the ones with the highest achievable rates have the drawback that no efficient algorithm is known to find the best choice of integer linear combination coefficients. In this paper, we propose several sub-optimal methods to find these coefficients with low complexity, covering both parallel and successive interference cancellation versions of the receiver. Simulation results show that the proposed methods attain a performance close to optimal in terms of achievable rates for a given outage probability. Moreover, a low-complexity implementation using root LDPC codes is developed, showing that the benefits of the proposed methods also carry on to practice. Index Terms—Block fading, integer-forcing linear receivers, lattices, root LDPC codes, successive interference cancellation. I. I NTRODUCTION Integer-forcing (IF) receivers are an alternative to conventional methods of equalization, such as zero-forcing (ZF) and minimum-mean-squared-error (MMSE) equalization [2] for multiple-input and multiple-output (MIMO) channels. The IF approach follows from the compute-and-forward framework [3], [4] for relay networks, where the receivers attempt to extract integer linear combinations of the transmitted messages from the received signals, before recovering the messages themselves. Although joint maximum likelihood (ML) receivers achieve the best performance among all methods, by searching over all possible transmitted codewords [5], their complexity is prohibitively high, increasing exponentially with the number of users. In contrast, IF receivers have a much lower complexity and can approach the ML performance in many situations [2]. Moreover, the performance of an IF receiver can be further improved in some situations by successive computation, leading to the so-called successive IF (SIF) receiver, analogously to the successive interference cancellation (SIC) technique for conventional linear receivers. The Ad Hoc Associate Editor coordinating the review of this manuscript and approving it for publication was Prof. Cristiano Magalhães Panazio. Ricardo Bohaczuk Venturelli and Danilo Silva are with the Department of Electrical and Eletronic Engineering, Federal University of Santa Catarina, Florianopolis-SC, Brazil (e-mails: [email protected], [email protected]). This work was partially supported by CAPES under Grant 1345815 and by CNPq under Grants 153535/2016-4, 429097/2016-6 and 310343/2016-0. A preliminary version of this paper was presented at the XXXIV Simpósio Brasileiro de Telecomunicações e Processamento de Sinais (SBrT’16), Santarém, PA, Brazil, August 30-September 4, 2016 [1]. Digital Object Identifier: 10.14209/jcis.2017.14 Recent works on IF include the design of practical channel codes compatible with IF [6], [7], efficient methods to select the coefficients of the integer linear combinations [8], [9], as well as its application to relay networks [10]. Moreover, the IF principle has been used not only as receive method in the MIMO uplink scenario, but also for precoding in the MIMO downlink scenario [11], [12] and even for source coding [13]. The main results about IF receivers consider static fading, where all symbols of a codeword are subject to the same channel fading. However, in a practical situation where a powerful code with large blocklength is used, it may not be realistic to assume that all symbols of the codeword are subject to the same channel fading. Therefore, channels that allow block fading [14], where the channel fading can vary during the transmission of a codeword, seem to be a more realistic model. In a recent work, El Bakoury and Nazer [15] generalize the IF approach to a block fading scenario. They described two decoding methods for block fading, which are called AM (arithmetic mean) and GM (geometric mean) decoding. The AM decoding method approximates the effective noise seen on all blocks (after equalization) as having the same variance, as in the case of static fading. On the other hand, the GM decoding method optimally exploits the diversity inherent in the channel variation, allowing to achieve higher rates than with AM decoding. Both decoding methods are applicable to both (non-successive) IF and SIF receivers. The rates achievable by all these receivers depend on the choice of an integer matrix A specifying the coefficients of the linear combinations that should be decoded. However, finding the optimal choice of A for GM-IF, AM-SIF and GM-SIF appears to be a hard problem for which no efficient approximation algorithm is known, making these receivers currently infeasible to implement in practice. Nevertheless, results obtained in [15] by exhaustive search demonstrate that optimal GM-IF and AM-SIF significantly outperform AM-IF in terms of achievable rates, while GM-SIF outperforms all of them. Our main contribution in this paper is to develop lowcomplexity optimization methods for these receivers (GMIF, AM-SIF and GM-SIF) which can closely approach the performance obtained by an optimal search. Each proposed method is based on optimizing a more tractable lower bound on the achievable rate, which can be performed very efficiently. Simulation results show that the proposed method for GM-IF has a small gap compared to optimal performance, while the remaining two methods, at least for the scenarios tested, have performance almost indistinguishable from the optimal one. Another contribution of this paper is to develop a low- JOURNAL OF COMMUNICATION AND INFORMATION SYSTEMS, VOL. 32, NO.1, 2017. complexity implementation of these receivers using finitelength codes over a low-order constellation, in order to validate the information-theoretic results under practical constraints. Attaining the GM performance requires the use of fulldiversity codes, from which we have adopted root low-density parity-check (LDPC) codes. Simulation results are shown to be consistent with the theoretical ones, with an expected gap due to the finite codeword length. The remainder of the paper is organized as follows. The system model is described in Section II. Section III reviews integer forcing for static fading as well as block fading, while Section IV reviews successive integer forcing, again for both fading types. In Section V, we present our proposed methods for selecting A. Section VI describes our low-complexity implementation under practical constraints. Simulation results are shown in Section VII, covering the information-theoretic performance as well as the performance with practical codes. Lastly, our conclusions are presented in Section VIII. A. Notation For any x > 0, define log+ (x) , max(log(x), 0). We denote row vectors as lowercase bold letters (e.g., x) and matrices as uppercase bold letters (e.g., X). The `2 -norm of a vector x is denoted by kxk. The matrix XT denotes the transpose of X. We use I and 0, respectively, to denote an identity and an all-zero matrix of appropriate size, which should always be clear from the context. The set of all m × n matrices with entries from the set A is denoted Am×n . II. S YSTEM M ODEL Consider a discrete-time, real Gaussian MIMO multipleaccess channel (MAC) with NT single-antenna transmitters and one NR -antenna receiver, subject to block fading with F independent fading realizations per codeword. Specifically, let n be the codeword length and assume, for simplicity, that F divides n. For ` = 1, . . . , NT , let x` ∈ Rn denote the vector transmitted by the `th transmitter, which can be represented by the `th row of a matrix X ∈ RNT ×n . Similarly, let Y ∈ RNR ×n be a matrix whose jth row represents the vector received by the jth receive antenna. Assuming fading realizations of equal length, the received matrix can be expressed as   Y = Y(1) · · · Y(F ) (1) where, for i = 1, . . . , F , Y(i) = H(i) X(i) + Z(i) 134 We assume that the receiver has perfect knowledge of the channel realization H(1:F ) , while the transmitters do not have this knowledge and are only aware of the channel statistics. Each transmitted vector x` is assumed to be the encoding of a message w` ∈ W produced by the `th transmitter, where W is the message space. The encoder rate, which is the same for all transmitters, is defined as 1 (5) R = log2 |W|. n Moreover, the transmitted vectors must satisfy a (symmetric) power constraint 1 kx` k2 ≤ P. (6) n These assumptions on equal power and equal rate are reasonable since the transmitters do not have knowledge of the channel matrix. For convenience, we denote SNR = P/σ 2 . At the receiver, the decoder attempts to recover all messages, producing estimates ŵ1 , . . . , ŵNT . An error is said to occur if ŵ` 6= w` for any `. The error probability of the scheme (encoder/decoder pair) is Pe = E[Pe (H(1:F ) )], where Pe (H(1:F ) ) denotes the error probability for a fixed channel realization. For any fixed H(1:F ) , a rate R is said to be achievable if, for any , δ > 0 and sufficiently large n, there exists a scheme of rate at least R − δ such that Pe (H(1:F ) ) ≤ . For a given family of schemes (indexed by n), let Rscheme (H(1:F ) ) denote its maximum achievable rate under a fixed channel realization H(1:F ) . For a target rate R, the outage probability is defined as pout (R) , P[Rscheme (H(1:F ) ) < R], and for a fixed probability ρ ∈ (0, 1], the outage rate is defined as Rout (ρ) , sup{R : pout (R) ≤ ρ}. Remark: We have adopted a real-valued channel in order to facilitate comparison with optimal IF methods that require exhaustive search—whose complexity becomes prohibitively large over a complex-valued channel even for low dimension— as well as with the existing literature, which mostly considers real-valued channels. There is no loss of generality, since it is always possible to express a complex-valued channel Yc = Hc Xc + Zc as a real-valued channel        Re(Yc ) Re(Hc ) −Im(Hc ) Re(Xc ) Re(Zc ) = + . Im(Yc ) Im(Hc ) Re(Hc ) Im(Xc ) Im(Zc ) Alternatively, all expressions presented here can be straightforwardly generalized to the complex case by replacing transpose with conjugate transpose. (2) H(i) ∈ RNR ×NT is the matrix of channel fading coefficients for the ith block, X(i) ∈ RNT ×(n/F ) is such that   X = X(1) · · · X(F ) (3) and Z(i) ∈ RNR ×(n/F ) is a Gaussian noise matrix with i.i.d. entries of zero mean and variance σ 2 . Note that H(i) remains constant throughout the transmission of a block of n/F symbols, but can vary independently between realizations. For convenience, let  H(1:F ) = H(1) , . . . , H(F ) . (4) III. I NTEGER F ORCING To aid the understanding, we first review integer forcing for static fading (F = 1), before describing its extension to block fading (F ≥ 2). For simplicity, the superscript indicating the block index is omitted when F = 1. A. Static Fading An integer-forcing receiver [2] shares the same basic structure of a conventional linear receiver, as illustrated in Fig. 1: first, the received matrix is linearly transformed by an equal- JOURNAL OF COMMUNICATION AND INFORMATION SYSTEMS, VOL. 32, NO.1, 2017. y1 y2 .. . yNR ŵ1 SISO decoder B (over R) −1 SISO decoder .. . SISO decoder A (over Z) where 2 σeff,m = bm H − am ŵ2 ŵNT conventional linear receiver 135 2 P + bm 2 σ2 is the per-component variance of the vector zeff,m , and am , bm and zeff,m are the mth row of A, B and Zeff , respectively. The optimal equalization matrix B, for a given integer matrix A, can be found using MMSE estimation [2] as B = AHT (SNR−1 I + HHT )−1 Fig. 1. Integer-forcing receiver. ization matrix; then, each resulting stream is individually processed by a channel decoder. The difference, in the case of the integer-forcing receiver, is that the equalizer attempts to estimate not the transmitted signals directly but rather an integer linear transformation of the transmitted signals, which is then inverted after noise is removed. Crucial to this noise removal step at the channel decoders is the use of a lattice code common to all transmitters [2], [3]. A lattice Λ ∈ Rn is a discrete subgroup of Rn , i.e., it is closed under integer linear combinations [16]. In particular, a lattice can be expressed as Λ = {x ∈ Rn : x = uG, u ∈ Zn } where G ∈ Rn×n is the generator matrix of Λ. It follows that if every x` ∈ Λ, then aX ∈ Λ, for all a ∈ Z1×NT [16]. In other words, since aX is also a codeword from the same code Λ, then a decoder for Λ is able to decode it (i.e., “denoise” it), regardless of the value chosen for a [3]. In more detail, consider the received matrix in (2), Y = HX + Z. (7) NT ×NT be a full-rank integer matrix. The receiver Let A ∈ Z applies the equalization matrix B ∈ RNT ×NR to create an effective channel output Yeff = BY = BHX + BZ (8) (9) = AX + Zeff (10) = V + Zeff (11) Zeff = (BH − A)X + BZ (12) where is the so-called effective noise [2] and V = AX (13) is an integer linear transformation of X. Assuming that each x` is chosen from the same lattice Λ ⊆ Rn , we have that each row of V is also a lattice point from Λ [3]. Thus, if decoding is successful and V is recovered, then X can also be recovered, provided A is full-rank.1 As a consequence, it is shown in [2], [3] that the following rate is achievable ! 1 P + (14) RIF (H, A, B) , min log 2 m 2 σeff,m 1 One might think that a stricter condition is required, namely, that A is invertible. This would be true if any element of Λ could be chosen for transmission without a power constraint. However, when nested lattice shaping is used to satisfy the power constraint, it is possible to show that requiring rank A = NT is enough. See [2], [17] for details. (15) (16) In this case, we have [4] 2 σeff,m = σ 2 am MaT m (17) M = (SNR−1 I + HT H)−1 (18) where and the achievable rate becomes 1 RIF (H, A) , min log+ m 2  SNR am MaT m  . (19) Optimizing the choice of A, we have the achievable rate RIF (H) , max A:rank A=NT RIF (H, A). (20) As can be seen, the optimal matrix A solving (20) consists of a set of linearly independent integer vectors minimizing (17). Since M is symmetric and positive definite [4], it admits a Cholesky decomposition M = GGT , where G ∈ RNT ×NT , leading to 2 σeff,m = σ 2 kam Gk2 . (21) Thus, the optimal solution can be described as the integer coefficients (under the basis G) of a set of NT shortest linearly independent vectors in the lattice generated by G. This is known as the Shortest Independent Vector Problem (SIVP) [18], which is believed to be NP-Hard [19]. However, suboptimal algorithms for basis reduction2 exist that can find an approximation in polynomial time, such as the LenstraLenstra-Lovasz (LLL) algorithm [21]. Note that, if A = I is chosen, then the scheme reduces to MMSE equalization [2]. Thus, integer forcing generalizes linear equalization, providing potentially higher achievable rates. B. Block Fading In the case of block fading, a complication arises, since now each block of the transmitted matrix experiences a different channel realization [14]. While it is possible to independently equalize each block of the received matrix, the resulting integer linear transformation A must be the same for all blocks, in order for the rows V to remain lattice codewords [15]. 2 For the special case of N T = 2, an optimal basis can be found very efficiently using Lagrange’s algorithm [20]. JOURNAL OF COMMUNICATION AND INFORMATION SYSTEMS, VOL. 32, NO.1, 2017. More precisely, for each ith block, let A(i) ∈ ZNT ×NT and B(i) ∈ RNT ×NR be its corresponding integer and equalization matrices, respectively, and compute the effective channel output for the block as Yeff,(i) = B(i) Y(i) (22) = B(i) H(i) X(i) + B(i) Z(i) (23) = A(i) X(i) + Zeff,(i) (24) = V(i) + Zeff,(i) (25) where V(i) = A(i) X(i) and Zeff,(i) = (B(i) H(i) − A(i) )X(i) + B(i) Z(i) . (26) It follows that Yeff = V + Zeff (27) where Yeff , V and Zeff denote the horizontal concatenation of Yeff,(i) , V(i) and Zeff,(i) , respectively, for i = 1, . . . , F . However, we can see that, in general, the rows of   V = A(1) X(1) · · · A(F ) X(F ) (28) are not guaranteed to be lattice points, since we cannot generally express V as an integer linear transformation of X. For instance, the first half of a codeword concatenated to the second half of another codeword is not guaranteed to form a codeword in a general code.3 Thus, for integer forcing to work over a block fading channel, we should require all A(i) to be equal [15], A(i) = A, i = 1, . . . , F (29) so that V = AX. (30) For a given A, the optimal equalization matrix for each ith block can be obtained as  −1 −1 T B(i) = AHT SNR I + H H (31) (i) (i) (i) and the per-component variance of the vector zeff,m,(i) , the m-th row of the Zeff,(i) , is given as where 2 σeff,m,(i) = σ 2 am M(i) aT m (32)  −1 M(i) = SNR−1 I + HT (i) H(i) (33) and am is the mth  row of A.  Let zeff,m = zeff,m,(1) · · · zeff,m,(F ) denote the mth row of Zeff . Since the noise variance (32) may now be different for each block, an achievable rate expression is not immediate to obtain and may, in fact, depend on the type of decoder used [15]. Specifically, it depends on whether the decoder properly exploits the diversity inherent in the block fading channel. Two decoding methods are proposed and analyzed in [15]: the Arithmetic Mean (AM) and the Geometric Mean (GM) decoders discussed below. 136 1) AM decoder: This decoder does not attempt to exploit the channel variation and instead treats each component of the effective noise vector zeff,m as having the same variance [15], 2 denoted by σAM,m . This variance is given by the arithmetic mean (hence the decoder name) of the variance of the effective noise on each block, 2 σAM,m = F 1 X 2 . σ F i=1 eff,m,(i) (34) It is shown in [15] that the AM-IF receiver achieves the following rate ! 1 P + RAM-IF (H(1:F ) , A) = min log 2 m 2 σAM,m   1 SNR + = min log (35) m 2 am MAM aT m where MAM = 1 X M(i) . F i (36) Thus, the maximum rate achievable by this method is RAM-IF (H) , max A:rank A=NT RAM-IF (H(1:F ) , A). (37) Note that (35) is identical to (19) with M replaced by MAM . Thus, (37) can be solved in the same way as in the case of static fading [15]. In particular, the LLL algorithm (or similar) may be used to find an approximately optimal solution in polynomial time. A special case of AM-IF consists of choosing A = I, which corresponds to conventional MMSE equalization followed by an AM decoder [15]. This scheme is referred to as AM-MMSE and its achievable rate denoted as RAM-MMSE (H(1:F ) ) = RAM-IF (H(1:F ) , I). (38) 2) GM decoder: This decoder optimally exploits the fact that the effective noise variance is not constant across the blocks [15]. The rate achievable by this method can be understood as the average achievable rate among all the individual blocks, as if they could be treated as parallel channels (which is clearly an upper bound). More precisely, the rate achievable by GM-IF is proven in [15] to be ! P 1 X1 + log (39) RGM-IF (H(1:F ) , A) = min 2 m F 2 σeff,m,(i) i ! 1 P + = min log (40) 2 m 2 σGM,m where ! F1 2 σGM,m = Y 2 σeff,m,(i) (41) i ! F1 2 =σ · Y am M(i) aT m . (42) i 3 Unless the code can be expressed as the Cartesian product of shorterlength codes. But this effectively violates the assumption of block fading, corresponding to static fading with a shorter codeword length. Note that (41) is the geometric mean (hence the decoder name) of the variance of the effective noise in each block. JOURNAL OF COMMUNICATION AND INFORMATION SYSTEMS, VOL. 32, NO.1, 2017. Therefore, the maximum achievable rate with GM-IF is RGM-IF (H) , max A:rank A=NT RGM-IF (H(1:F ) , A). (43) It is useful pointing out that, for the same matrix A, the GM decoder always achieves a rate at least as high as that of the 2 2 AM decoder, since σGM ≤ σAM due to AM-GM inequality [22]. However, there is currently no known efficient method to find an optimal (or approximately optimal) solution for A in (43) [15], making optimal GM-IF currently infeasible to implement in practice, especially as NT grows. As before, a special case of GM-IF consists of choosing A = I, which corresponds to conventional MMSE equalization followed by a GM decoder [15]. This scheme is referred to as GM-MMSE and its achievable rate denoted as RGM-MMSE (H(1:F ) ) = RGM-IF (H(1:F ) , I). (44) 137 Note that the generalized covariance matrix of N is the identity matrix [24]. The effective channel output (11) can be rewritten as Yeff = V + LN (48) where V = AX. Since L is a lower triangular matrix, we have that m X yeff,m = vm + `m,j nj (49) j=1 where `m,j denotes the (m, j) entry of L. Note that yeff,m is not affected by nm0 for any m0 > m. The decoder acts in each row of Yeff in a successive way. Suppose that v1 is successfully recovered. Then we can compute 1 (yeff,1 − v1 ) (50) n1 = `1,1 and remove its influence on the second row of Yeff , IV. S UCCESSIVE I NTEGER -F ORCING One way to improve the performance of a conventional linear receiver is to apply successive interference cancellation (SIC) [23]: after a codeword is successfully decoded, the receiver can use it as side information in order to cancel part of the interference, reducing the variance of the effective noise. This principle can be applied to integer-forcing as well [24]. Specifically, in a successive integer-forcing (SIF) receiver, each integer linear combination of codewords that is successfully decoded is used to cancel its contribution to the effective noise affecting the remaining linear combinations, potentially enabling a higher achievable rate. Note that SIF decoding must be done sequentially, in contrast to conventional IF, which may be done in parallel. Thus, the decoding order is relevant. We assume that decoding follows the index of am , m = 1, . . . , NT . Thus, in contrast to conventional IF, the ordering of the rows of A may have an impact on the achievable rates for SIF. We start by reviewing SIF for static fading, followed by its extension to block fading. y20 , yeff,2 − `2,1 n1 = v2 + `2,2 n2 (51) so that v2 can be decoded in the presence of less noise. Generalizing, suppose that v1 , . . . , vm−1 have been successfully recovered, providing the estimates n1 , . . . , nm−1 . We can remove the influence of this noise to obtain 0 ym , yeff,m − m−1 X `m,j nj = vm + `m,m nm (52) j=1 so that vm can be decoded under noise of variance `2m,m . Then, the corresponding noise vector can be estimated as nm = 1 (y0 − vm ). `m,m m (53) Proceeding this way, it can be shown that the following rate is achievable [24]   P 1 + RSIF (H, A) = min log . (54) m 2 `2m,m By choosing the optimal A, the maximum achievable rate is A. Static Fading RSIF (H) = Recall the effective channel (11) described in Section III. The SIF receiver exploits the fact that the rows Zeff are correlated in general and starts by performing a whitening transformation. Consider the generalized covariance matrix of Zeff , defined as 1 KZeff , E[Zeff ZT (45) eff ]. n Assuming that the optimal equalization matrix B is used, it is possible to show that [2], [24] KZeff = σ 2 AMAT (46) where M is defined in (18). Since KZeff is a symmetric positive definite matrix [24], it admits a Cholesky decomposition KZeff = LLT , where L is a lower triangular matrix with strictly positive diagonal entries. Define N , L−1 Zeff . (47) max A:rank A=NT RSIF (H, A). (55) However, finding the optimal matrix for the SIF decoder is a different (and harder) problem than that for the IF decoder. In particular, each row permutation of A may give a different achievable rate. As shown in [24], it is possible to restrict the choice of A to the class of unimodular matrices and the optimal solution is obtained by finding a Korkin-Zolotarev (KZ) basis for the lattice generated by G ∈ RNT ×NT , obtained from the Cholesky decomposition of M = GGT . Finding a KZ basis for a lattice involves finding a shortest lattice vector and is therefore an NP-hard problem [20]. Suboptimal algorithms can be used, for example, applying the LLL algorithm NT successive times, where in each iteration the dimension of the underlying lattice decreases [20]. Note that it is possible to choose A = π(I), where π(I) denotes a row permutation of the identity matrix. In this case, the method reduces to conventional SIC decoding, which is referred to as MMSE-SIC. In principle, all possible permutations JOURNAL OF COMMUNICATION AND INFORMATION SYSTEMS, VOL. 32, NO.1, 2017. could be tested, however this quickly becomes unattractive as the number of users increases. Heuristic methods [23] can be applied to find a good decoding order, for instance, decoding 2 first the user with the highest SNR (i.e., lowest σeff,m ), at the expense of some performance degradation. B. Block Fading As in the case of parallel IF, for successive IF in the block fading scenario it is required that A remain the same for all blocks so that the rows of V in (48) are still lattice points and lattice decoding and subsequent inversion is possible. All the other steps are the same as for static fading applied separately to each ith block, namely: equalization by B(i) given in (31), Cholesky decomposition of 1 KZeff,(i) = E[Zeff,(i) ZT eff,(i) ] n/F = σ 2 AM(i) AT = L(i) LT (i) (56) where M(i) is defined in (33), and successive noise cancellation and estimation from m−1 X 0 ym,(i) , yeff,m,(i) − `m,j nj,(i) (57) j=1 = vm,(i) + `m,m,(i) nm,(i) . (58) Note that the effective channel after cancellation can be expressed more simply as 0 ym = vm + z0m (59) 0 0 and z0m are the horizontal concatenation of ym,(i) where ym 0 and zm,(i) = `m,m,(i) nm,(i) , respectively, for i = 1, . . . , F . In particular, each ith block of the reduced effective noise z0m has a possibly different variance `2m,m,(i) . For the lattice decoding step, either of the two decoding methods discussed before, namely AM and GM decoding, may be used [15]. Their generalization to the case of block fading is straightforward. 1) AM decoder: This decoder treats z0m as white noise of variance F 1 X 2 2 σAM-SIF,m = ` . (60) F i=1 m,m,(i) It follows that the achievable rate of AM-SIF is given by ! 1 P + RAM-SIF (H(1:F ) , A) , min log (61) 2 m 2 σAM-SIF,m max A:rank A=NT RAM-SIF (H(1:F ) , A). π where ! F1 2 σGM-SIF,m = Y `2m,m,(i) . (66) i Note that, due the AM-GM inequality, for the same matrix A, the GM decoder achieves a rate at least as high as that of the AM decoder. The maximum achievable rate for GM-SIF is then given by RGM-SIF (H(1:F ) ) = max A:rank A=NT RGM-SIF (H(1:F ) , A). (67) However, there is currently no known efficient method to find an optimal or approximately optimal solution for A, making optimal GM-SIF infeasible to implement in practice. Even an exhaustive search is more costly for GM-SIF than for GMIF, since now all row permutations of the same A must be considered. As a special case, it is always possible to choose A = π(I), which corresponds to conventional SIC with a GM decoder. This method is referred to as GM-SIC and its achievable rate is given by RGM-SIC (H(1:F ) ) = max RGM-SIF (H(1:F ) , π(I)). π (68) V. P ROPOSED M ETHODS Although AM-SIF, GM-IF and GM-SIF all have higher achievable rates than AM-IF, the fact that no efficient algorithm is known to find even an approximately optimal A can undermine the practical applicability of these methods. In this section, we propose four suboptimal, low-complexity methods for choosing the integer matrix A. The first two are applicable to GM-IF, the third is applicable to AM-SIF, while the fourth applies to GM-SIF. A. Proposed Method 1 (GM-IF) Let (69) A:rank A=NT (62) However, there is currently no known efficient method to find an optimal or approximately optimal choice of A, which should be chosen to minimize (60). Note that, if we choose A = π(I), then the method reduces to conventional SIC with an AM decoder. This method is referred to as AM-SIC and its achievable rate is given by RAM-SIC (H(1:F ) ) , max RAM-SIF (H(1:F ) , π(I)). 2) GM decoder: As before, this decoder attempts to optimally exploit the variation of the noise statistics across blocks. The achievable rate for GM-SIF can be computed as the average achievable rate all blocks, given by [15] ! SNR 1 X1 + log (64) RGM-SIF (H(1:F ) , A) = min m F 2 `2m,m,(i) i ! 1 SNR + = min log (65) 2 m 2 σGM-SIF,m AAM-IF , arg max RAM-IF (H(1:F ) , A) which, after optimizing over A, becomes RAM-SIF (H(1:F ) ) , 138 (63) be the optimal matrix A for AM-IF. We propose to use either this matrix or the identity matrix, depending on which one gives the highest rate under GM-IF decoding. Let A1 = {I, AAM-IF }. The rate achievable by this method is given by Rprop1 (H(1:F ) ) , max RGM-IF (H(1:F ) , A). A∈A1 (70) Note that, if matrix AAM is chosen, then a rate at least as high as that of AM-IF is achieved, since for the same JOURNAL OF COMMUNICATION AND INFORMATION SYSTEMS, VOL. 32, NO.1, 2017. choice of A, the GM decoder always outperforms the AM decoder. On the other hand, if the identity matrix is chosen, then the proposed method becomes the same as GM-MMSE and, therefore, achieves the same rate. Thus, the proposed method achieves rates as high as both GM-MMSE and AM-IF. The complexity of this method is dominated by that of finding an optimal matrix for AM-IF, which can be approximated in polynomial time with the LLL algorithm. Therefore, the complexity is the same as that of AM-IF. B. Proposed Method 2 (GM-IF) In addition to the choices discussed above, we propose to test also the optimal matrix A(i) for each ith block that would be obtained with IF under static fading, namely A(i) , arg max RIF (H(i) , A) (71) A:rank A=NT for i = 1, . . . , F . Let A2 = {I, AAM-IF , A(1) , . . . , A(F ) }. The rate achievable by this method is given by Rprop2 (H(1:F ) ) , max RGM-IF (H(1:F ) , A). A∈A2 (72) Note that Proposed Method 1 chooses a matrix which may be “reasonably good” for all blocks simultaneously but which is not necessarily optimal for any block. Proposed Method 2 expands this choice by including matrices which are optimal for at least one block, even if it they are worse for the others blocks. A reasoning behind this approach is that, in contrast to the AM decoder, the GM decoder is not limited by the performance of the worst block, since individual rates are added in (39). The complexity of Proposed Method 2 is higher than that of Proposed Method 1 since it is necessary run the LLL algorithm F +1 times. Since the LLL algorithm can be done in polynomial time, this proposed method still viable in practice, especially for small F . C. Proposed Method 3 (AM-SIF) Recall that the AM-SIF receiver correctly takes into account the fact that the effective noise matrix has a different generalized covariance matrix KZeff,(i) for each block, using each corresponding L(i) for noise cancellation; only the lattice decoding step treats the reduced effective noise z0m as having 2 equal variance σAM-SIF,m across blocks. An upper bound on this variance can be obtained by treating each block of the effective noise matrix Zeff as having the same generalized covariance matrix, given by  1  KZeff = E Zeff ZT eff n i 1X h = E Zeff,(i) ZT eff,(i) n i 1 X = KZeff,(i) (73) F i 1 X 2 = σ AM(i) AT (74) F i = σ 2 AMAT (75) 139 P where M = F1 i M(i) . From this point on, we can proceed similarly to the case of static fading (Section IV-A), obtaining a reduced effective noise z0m with variance `2m,m , where L is a lower triangular matrix with positive diagonal entries given by the Cholesky decomposition KZeff = LLT . It follows 2 that σAM-SIF,m ≤ `2m,m , since a suboptimal noise cancellation scheme is used.4 To be clear, the scheme described above uses block IF equalization, followed by static noise cancellation (SNC) and AM decoding, in contrast to AM-SIF, which uses block noise cancellation. To distinguish it from AM-SIF, we refer to this scheme as AM-SIF-SNC. Its achievable rate is then given by   P 1 (76) RAM-SIF-SNC (H(1:F ) , A) = min log+ 2 m 2 `m,m which is a lower bound on RAM-SIF (H(1:F ) , A). Let AAM-SIF-SNC , arg max RAM-SIF-SNC (H(1:F ) , A) (77) A:rank A=NT be the optimal matrix A for AM-SIF-SNC. We propose to use this matrix for AM-SIF. The rate achievable by this method is given by Rprop3 (H(1:F ) ) , RAM-SIF (H(1:F ) , AAM-SIF-SNC ). (78) Note that optimizing (76) is exactly the same problem as optimizing (54). Thus, as discussed in Section IV-A, AAM-SIF-SNC can be computed by KZ reduction of the lattice generated by G ∈ RNT ×NT , obtained from the Cholesky decomposition of M = GGT , and this procedure can be approximated by applying the LLL algorithm NT times. D. Proposed Method 4 (GM-SIF) We can extended the same ideas of Proposed Method 2 to the case of successive decoding, simply by redefining (71) and (72) with their SIF counterparts, while using AAM-SIF-SNC instead of AAM-SIF , as in Proposed Method 3. However, since the decoding order is important, in principle we would have to test all permutations of the identity matrix, but that number of permutations grows exponentially with the number of users. To avoid this complexity, we simply exclude the identity matrix (and all its permutations) from the set of possible choices for A. Let A4 = {AAM-SIF-SNC , ASIF,(1) , . . . , ASIF,(F ) }, where, for i = 1, . . . , F , ASIF,(i) , arg max RSIF (H(i) , A) (79) A:rank A=NT is the optimal matrix for the ith block that would be obtained with SIF under static fading. The rate achievable by this method is given by Rprop4 (H(1:F ) ) = max RGM-SIF (H(1:F ) , A). A∈A4 (80) Similarly to Proposed Method 2, the complexity of this method grows linearly with the number of blocks. However, finding AAM-SIF-SNC as well as each ASIF,(i) requires running the LLL algorithm NT times, for a total of NT (F + 1) runs. 4 This upper bound can also be derived directly by diagonalizing the positive P T definite matrix LLT = F1 i L(i) L(i) . JOURNAL OF COMMUNICATION AND INFORMATION SYSTEMS, VOL. 32, NO.1, 2017. TABLE I C OMPLEXITY OF I NTEGER -F ORCING M ETHODS Method Complexity AM/GM-MMSE AM-IF Proposed Method 1 Proposed Method 2 GM/AM-SIC Proposed Method 3 Proposed Method 4 Optimal GM/AM-SIF O(NT4 log(NT )) O(NT4 log(NT )) O((F + 1)NT4 log(NT )) O(NT !) O(NT4 log(NT )) O((F + 1)NT4 log(NT )) √ O(( 1 + SNR)NT ) E. Summary of Complexity Table I shows the complexity of finding A for each method discussed. For AM/GM-MMSE methods, since A = I is known a priori, the complexity is negligible. The AM-IF and Proposed Method 1 have the same complexity, corresponding to a single run of the LLL algorithm [9]. Note that, for fixed F , Proposed Method 2 approaches the complexity of AM-IF and Proposed Method 1. For the successive scenario, the optimal choice of A in AM/GM-SIC is found by testing all permutations of the identity matrix. Proposed Method 3 and Proposed Method 4 have similar complexity as Proposed Method 1 and 2, respectively. Finally, the complexity of optimal GM/AMSIF by exhaustive search follows from the bound in [2] (see also [2], [9]). Note that, besides finding A, the receiver operation includes also the tasks of equalization and channel decoding, whose complexity scales with the blocklength n and is identical for each method in the same category (parallel or successive). Thus, the task of finding A tends to take a smaller fraction of the overall decoding time as n grows. VI. I MPLEMENTATION WITH P RACTICAL C ODES All the achievable rate results discussed above assume the use of lattice codes of asymptotically high dimension over an asymptotically large constellation. However, in practice, a finite-length code and a finite-order modulation must be used. In this section, we discuss how practical lattice encoders and decoders for an IF receiver may be implemented with low complexity. We focus on the use of binary LDPC codes with 2-PAM modulation. A. Encoding and Decoding We start with conventional IF; the extension to successive IF is straightforward. To simplify the description, with a slight abuse of notation, we consider the finite field of size 2, denoted Z2 , as a subset of the integers, Z2 = {0, 1} ⊆ Z. Suppose the `th user encodes its message as a codeword c` ∈ C from a linear (n, k) block code C over Z2 . The codeword c` is then modulated into a vector x` ∈ {− 21 , 12 }n from a 2-PAM constellation, computed as x` = c` + d` mod 2 (81) 140 where d` ∈ {− 12 , 12 }n is a (discrete) dither vector independent from x` and known to the receiver, and the x mod 2 operation is applied element-wise and assumed to return a real-valued number in the interval (−1, 1]. Note that the dither vector must be used in order to reduce the transmit power from the {0, 1} constellation to the {− 21 , 12 } constellation, and it could be interpreted more simply as a modulation map. In this case, a simple choice would be d` = (− 21 , . . . , − 12 ). However, using a random dither uniformly distributed over {− 12 , 12 }n is more convenient for our purposes since, as we shall see, it makes the error probability independent from the transmitted codeword. As a consequence of the use of dithers, the transmitted vector x` is not a lattice point anymore, in contrast to the description is sections III and IV. However, dithers can be easily removed at the receiver with a simple modification, re-enabling the results of the those sections. More precisely, let C and D be matrices whose `th row is c` and d` , respectively. The receiver computes the effective channel output as   Yeff = B(1) Y(1) · · · B(F ) Y(F ) − AD mod 2 (82) = AC + Zeff mod 2 (83) = V + Zeff mod 2 (84) where Zeff is defined as in Section III and V = AC mod 2. Note that each row vm of V is a codeword from C. Thus, we recover the same effective channel (11), except for the mod-2 operation.5 For j = 1, . . . , n, let yeff,m [j], vm [j], zeff,m [j] denote the jth component of yeff,m , vm and zeff,m , respectively. In order to use a belief propagation decoder, it is necessary to compute the log-likelihood ratio (LLR) at the channel output, defined as   P[yeff,m [j] | vm [j] = 0] (85) LLR[j] = log P[yeff,m [j] | vm [j] = 1] for j = 1, . . . , n, where P(·|·) denotes conditional probability. To simplify the decoder, the (non-Gaussian) effective noise component zeff,m [j] is treated as a Gaussian random variable 2 with zero mean and variance σeff,m [j], where ( 2 σAM,m , for AM decoding 2 σeff,m [j] = (86) 2 σeff,m,(I[j]) , for GM decoding and I[j] denotes the index of the block to which the jth component belongs. However, since (84) is a mod-2 channel, there is an infinite number of noise realizations that lead to any given channel output, resulting in the expression ! X (yeff,m [j] − vm [j] − k)2 P[yeff,m [j]|vm [j]] = exp − . 2 2σeff,m [j] k∈2Z (87) In order to further simplify the LLR computation, we can approximate the above expression by keeping only the largest 5 Actually, a modulo-lattice channel is required for the results in [2], which is omitted in the IF overview given here and in [2]. Thus, some modulo operation must be used at the receiver if the transmitted vectors satisfy a power constraint. JOURNAL OF COMMUNICATION AND INFORMATION SYSTEMS, VOL. 32, NO.1, 2017. 8 It is well-known that an important parameter characterizing the performance of a code for a fading channel is its diversity order, defined as [25] Real LLR Approximated LLR 6 141 4 d,− LLR[j] (91) where Pe is the error probability of the decoder. For a block Rayleigh fading channel, the diversity order of a q-ary code is known to satisfy a Singleton-like bound [25]    R (92) d≤1+ F 1− log2 q 2 0 -2 -4 -6 -8 -1 log Pe SNR→∞ log SNR lim -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 yeff,m [j] Fig. 2. LLR in the mod-2 channel for SNR = 5 dB. term, corresponding to the element vm [j] + 2Z nearest to yeff,m [j] in Euclidean distance. It follows that  1 + 2yeff,m [j]   , −1 < yeff,m [j] ≤ 0  2 2σeff,m [j] LLR[j] ≈ 1 − 2y (88)  eff,m [j]  , 0 ≤ y [j] ≤ 1  eff,m 2 2σeff,m [j] 1 where b·c is the floor function and R is the code rate in bits per channel use. Thus, codes that achieve full diversity (d = F ) are limited by R ≤ (log2 q)/F , or R ≤ 1/F for binary codes. A family of rate-1/F binary LDPC codes that achieve full diversity under belief propagation and have performance close to theoretical limits are the so-called root LDPC codes [26]. These codes are systematic, with the information bits corresponding to the first n/F 2 positions of each block, and (F −1)n/F ×n have a parity-check matrix H ∈ Z2 satisfying the following structure     H11 · · · H1F Hij1   ..  , H =  .. .. H =  ...   (93) ij . .  . HF 1 ··· Hijk    0, h = I   0, 1 − 2|yeff,m [j]| 2σeff,m [j]2 (89) since yeff,m [j] ∈ (−1, 1]. Fig. 2 shows the exact LLR in comparison with its approximation for a channel with SNR = 5 dB. As we can see, for most of the input range the approximation is indistinguishable from the exact value. The approximation is slightly less accurate when the input is close to an integer, but since these correspond to the peak LLR values, i.e., when there is a high degree of certainty about the value of vm [j], this loss of accuracy should not degrade the performance of belief propagation. The above decoding procedure can be easily extended to 0 successive IF by replacing yeff,m with ym , zeff,m with z0m , 2 and σeff,m [j] with ( σ2 , for AM decoding 2 σSIF,m [j] = 2AM-SIF,m (90) `m,m,(I[j]) , for GM decoding. B. Code Construction In practice, approaching the GM performance (be it for MMSE, SIC, IF or SIF reception) requires not only a suitable decoder but also well-designed codes that allow the decoder to exploit diversity. This issue is not apparent in [15] since their achievable rate results (even for AM) are based on asymptotically good lattices that are already optimal for exploiting diversity. Designing such codes under finite-length and lowcomplexity constraints, however, is far from trivial. Hi,j,F −1 where or more simply LLR[j] ≈ HF,F j < i and k 6= j i 0 , j=i (94) j > i and k 6= j − 1 for all 1 ≤ i, j ≤ F and all 1 ≤ k ≤ F − 1. This structure implies that, for each information bit from each ith block, there is one parity-check equation relating it to the bits from the jth block (and no other blocks), for all j 6= i. It is worth mentioning that root LDPC codes under belief propagation guarantee full diversity only over the information bits. Thus, if one is interested in recovering the entire codeword, it must be regenerated by re-encoding the information bits after decoding. VII. S IMULATION R ESULTS In this section we present simulation results comparing the outage rate performance of our proposed methods with the optimal performance obtained by exhaustive search. For comparison, we include the performance of AM-IF (previously the only low-complexity IF receiver), as well as that of ML and conventional linear receivers. In our simulations, we specify an outage probability ρ = 0.01, estimated by 104 channel realizations. In each realization, the channel fading coefficients are drawn independently from a real-valued Gaussian distribution with zero mean and unit variance. For the optimal GM-IF, AM-SIF and GM-SIF, the matrix A was obtained by an exhaustive search over all matrices vectors whose `1 -norm of each row does not exceed 15. Fig. 3 shows the outage rate for all these receivers on a 2 × 2 channel with F = 2 blocks. As can be seen, Proposed Method 1 and JOURNAL OF COMMUNICATION AND INFORMATION SYSTEMS, VOL. 32, NO.1, 2017. 3 3 ML Optimal GM-IF Prop. 2 (GM-IF) Prop. 1 (GM-IF) GM-MMSE AM-IF AM-MMSE 2.5 ML Optimal GM-SIF Prop. 4 (GM-SIF) GM-SIC Optimal AM-SIF Prop. 3 (AM-SIF) AM-SIC 2.5 2 Rate (bits/dim) 2 Rate (bits/dim) 142 1.5 1.5 1 1 0.5 0.5 0 0 0 5 10 15 20 25 30 SNR (dB) (a) 0 5 10 15 20 25 30 SNR (dB) (b) Fig. 3. Outage rate on a 2 × 2 channel with F = 2 blocks. (a) Parallel decoding methods. (b) Successive decoding methods. 2 achieve performance close to optimal GM-IF and strictly higher than the maximum between AM-IF and GM-MMSE. In particular, for an outage rate of 1.5 bits/dim, the performance of Proposed Method 2 is within 1.8 dB of optimal GM-IF and outperforms Proposed Method 1 by 2.4 dB. On the other hand, Proposed Method 3 and 4 appear to have performance indistinguishable from optimal AM-SIF and optimal GM-SIF, respectively. Note that Proposed Method 4 outperforms GMSIC by approximately 3.2 dB for an outage rate of 2 bits/dim, while AM-SIF has a much lower performance in this case. Fig. 4 shows the outage rate for a scenario with F = 2 blocks and SNR = 25 dB, varying the number of users NT , while assuming the same number of receive antennas, NR = NT . Due to the complexity of exhaustive search, which grows exponentially with NT , the performance of optimal GM-IF is shown only for NT = 2 and NT = 3, while that of optimal AM-SIF and GM-SIF is shown only for NT = 2. As can be seen, as NT increases, the performance of both Proposed Methods 1 and 2 appears to converge and is approached by that of AM-IF. Similarly, the performance of Proposed Method 3 significantly improves as NT increases, outperforming GM-SIC for NT ≥ 4 and approaching that of Proposed Method 4. Nevertheless, Proposed Method 4 still outperforms all other methods by a visible margin. Fig. 5 considers the same scenario as Fig. 4, but with F = 4 blocks. Similar observations can be made, except that, comparatively to Proposed Methods 1 and 2, the performance of AM-IF has worsened and that of GM-MMSE has improved, while still being significantly outperformed by the proposed methods. For the successive methods, a behavior similar to the F = 2 case is observed, except that now GM-SIC outperforms Proposed Method 3 for all NT ≤ 6 and achieves a smaller gap to Proposed Method 4. While one might expect this gap to vanish for large F , it should be noted that, due to rate limitations, constructions of full-diversity codes are typically restricted to the small F case. Lastly, Figs. 6 and 7 show the frame-error rate (FER) on a 2 × 2 channel with F = 2 and F = 4, respectively, using 2-PAM modulation. A regular, rate-1/F root-LDPC code [26] of length n = 208, constructed using a PEG-based technique [27], is used in each simulation. As can be seen, the simulations are consistent with the theoretical results, with a performance gap due to the small constellation size and the non-optimality of the channel code. In particular, for a FER of 1%, both proposed methods are within 3.7 dB of their theoretical FER for F = 2 and within 3.4 dB for F = 4. The FER for successive decoding is not shown, since for R ≤ 1/2 all methods have performance similar to their non-IF counterpart. For the benefits of SIF to become salient, lattice codes with higher spectral efficiency are needed. The design of such codes, however, is outside the scope of this paper. VIII. C ONCLUSIONS In this paper, we propose four suboptimal methods for selecting an integer matrix A for IF reception in a block fading scenario, two of them applicable to GM-IF and the other two applicable to AM-SIF and GM-SIF, respectively. The main idea behind these methods is to use a matrix A optimized for a lower-performance scheme with a simpler objective function for which an approximately optimal solution can be found in polynomial time. For AM-SIF, the corresponding simpler scheme is the proposed AM-SIF-SNC scheme, while, for GMIF and GM-SIF, it is the best choice among their respective AM counterpart and certain static fading solutions, all of which can be found very efficiently. As shown by simulations, the proposed methods for GMIF achieve outage rates strictly higher than both GM-MMSE and AM-IF (until now the best low-complexity methods), regardless of the number of blocks and users, while being only slightly more complex than AM-IF. Exactly the same JOURNAL OF COMMUNICATION AND INFORMATION SYSTEMS, VOL. 32, NO.1, 2017. 4.5 4.5 ML Optimal GM-IF Prop. 2 (GM-IF) Prop. 1 (GM-IF) AM-IF GM-MMSE AM-MMSE 4 3.5 4 3.5 3 Rate (bits/dim) 3 Rate (bits/dim) 143 2.5 2 2.5 2 1.5 1.5 1 1 0.5 0.5 0 ML Optimal GM-SIF Prop. 4 (GM-SIF) Prop. 3 (AM-SIF) GM-SIC Optimal AM-SIF AM-SIC 0 2 3 4 5 6 2 3 Nt (and Nr) 4 5 6 Nt (and Nr) (a) (b) Fig. 4. Outage rate for a channel with F = 2 blocks and SNR = 25 dB. (a) Parallel decoding methods. (b) Successive decoding methods. 4.5 4.5 ML Optimal GM-IF Prop. 2 (GM-IF) Prop. 1 (GM-IF) AM-IF GM-MMSE AM-MMSE 4 3.5 3.5 3 Rate (bits/dim) Rate (bits/dim) 3 4 2.5 2 2.5 2 1.5 1.5 1 1 0.5 0.5 0 ML Optimal GM-SIF Prop. 4 (GM-SIF) GM-SIC Prop. 3 (AM-SIF) Optimal AM-SIF AM-SIC 0 2 3 4 5 6 Nt (and Nr) (a) 2 3 4 5 6 Nt (and Nr) (b) Fig. 5. Outage rate for channel with F = 4 blocks and SNR = 25 dB. (a) Parallel decoding methods. (b) Successive decoding methods. observations hold for GM-SIF in comparison with GM-SIC and AM-SIF-SNC. particular at outage rates for which these schemes are much superior to their AM or non-IF counterparts. We also show that AM-(S)IF and GM-(S)IF schemes can be realized in practice with low complexity, under finite codeword length and constellation constraints. Simulation results using full-diversity root LDPC codes are found to agree with theoretical ones, confirming the superiority of GM-IF in comparison with GM-MMSE and AM-IF. The authors would like to thank Islam El Bakoury and Bobak Nazer for valuable discussions. An interesting avenue for future work is the development of low-complexity, full-diversity lattice codes with higher spectral efficiency (for instance, full-diversity q-ary linear codes with q > 2 for use in Construction A [2]). Such codes would be directly applicable to the GM-IF and GM-SIF schemes, allowing a wider and more interesting operating range, in [1] R. Venturelli and D. Silva, “Low-complexity integer forcing for block fading MIMO multiple-access channels,” in XXXIV Simpósio Brasileiro de Telecomunicações e Processamento de Sinais (SBrT’16), Aug 30-Sep 4 2016, pp. 110–114. [2] J. Zhan, B. Nazer, U. Erez, and M. Gastpar, “Integer-Forcing Linear Receivers,” IEEE Trans. Inf. Theory, vol. 60, no. 12, pp. 7661–7685, Dec. 2014. doi: 10.1109/TIT.2014.2361782 ACKNOWLEDGMENTS R EFERENCES JOURNAL OF COMMUNICATION AND INFORMATION SYSTEMS, VOL. 32, NO.1, 2017. 10 0 144 10.1109/TWC.2015.2462844 [9] W. Liu and C. Ling, “Efficient Integer Coefficient Search for Computeand-Forward,” IEEE Trans. Wirel. Commun., vol. 15, no. 12, pp. 8039– 8050, Dec. 2016. doi: 10.1109/TWC.2016.2611580 [10] S. M. Azimi-Abarghouyi, M. Nasiri-Kenari, B. Maham, and M. Hejazi, “Integer Forcing-and-Forward Transceiver Design for MIMO Multipair Two-Way Relaying,” IEEE Trans. Veh. Technol., vol. 65, no. 11, pp. 8865–8877, Nov. 2016. doi: 10.1109/TVT.2016.2518667 [11] W. He, B. Nazer, and S. Shamai, “Uplink-downlink duality for integerforcing,” in 2014 IEEE International Symposium on Information Theory, 10 -1 Jun. 2014. doi: 10.1109/ISIT.2014.6875293 pp. 2544–2548. [12] D. Silva, G. Pivaro, G. Fraidenraich, and B. Aazhang, “On IntegerForcing Precoding for the Gaussian MIMO Broadcast Channel,” IEEE Trans. Wirel. Commun., vol. 16, no. 7, pp. 4476–4488, Jul. 2017. doi: 10.1109/TWC.2017.2699178 [13] O. Ordentlich and U. Erez, “Integer-Forcing Source Coding,” IEEE Trans. Inf. Theory, vol. 63, no. 2, pp. 1253–1269, Feb. 2017. doi: 10.1109/TIT.2016.2629491 [14] R. Knopp and P. A. Humblet, “On coding for block fading channels,” IEEE Trans. Inf. Theory, vol. 46, no. 1, pp. 189–205, Jan. 2000. doi: 10 -2 10.1109/18.817517 0 5 10 15 20 25 30 [15] I. E. Bakoury and B. Nazer, “The impact of channel variation on SNR (dB) integer-forcing receivers,” in 2015 IEEE International Symposium on Information Theory (ISIT), Jun. 2015. doi: 10.1109/ISIT.2015.7282520 Fig. 6. FER on a 2 × 2 channel using parallel decoding methods. R = pp. 576–580. 1/2 bits/dim and F = 2 blocks. [16] R. Zamir, Lattice Coding for Signals and Networks. Cambridge: Cambridge University Press, 2014. ISBN 978-0-521-76698-2 [17] B. Nazer, V. R. Cadambe, V. Ntranos, and G. Caire, “Expanding the 10 0 Compute-and-Forward Framework: Unequal Powers, Signal Levels, and AM-MMSE Multiple Linear Combinations,” IEEE Trans. Inf. Theory, vol. 62, no. 9, AM-IF pp. 4879–4909, Sep. 2016. doi: 10.1109/TIT.2016.2593633 GM-MMSE [18] J. Blömer, “Closest Vectors, Successive Minima, and Dual HKZ-Bases Prop. 1 (GM-IF) Prop. 2 (GM-IF) of Lattices,” in Automata, Languages and Programming. Springer, Optimal GM-IF Berlin, Heidelberg, Jul. 2000. doi: 10.1007/3-540-45022-X 22 pp. 248– Prop. 1 (GM-IF) (theo.) 259. Prop. 2 (GM-IF) (theo.) [19] O. Regev, “On Lattices, Learning with Errors, Random Linear Codes, Optimal GM-IF (theo.) and Cryptography,” in Proceedings of the Thirty-Seventh Annual ACM Symposium on Theory of Computing, ser. STOC ’05. New York, NY, -1 10 USA: ACM, 2005. doi: 10.1145/1060590.1060603. ISBN 978-1-58113960-0 pp. 84–93. [20] E. Agrell, T. Eriksson, A. Vardy, and K. Zeger, “Closest point search in lattices,” IEEE Trans. Inf. Theory, vol. 48, no. 8, pp. 2201–2214, Aug. 2002. doi: 10.1109/TIT.2002.800499 [21] A. K. Lenstra, H. W. Lenstra, and L. Lovasz, “Factoring polynomials with rational coefficients,” Math. Ann., vol. 261, pp. 515–534, 1982. doi: 10.1007/BF01457454 [22] J. M. Steele, The Cauchy-Schwarz Master Class: An Introduction to the Art of Mathematical Inequalities. Cambridge; New York: The 10 -2 Mathematical Association of America, Apr. 2004. ISBN 978-0-521-6 -4 -2 0 2 4 6 8 10 12 14 54677-5 SNR (dB) [23] P. W. Wolniansky, G. J. Foschini, G. D. Golden, and R. A. Valenzuela, “V-BLAST: An architecture for realizing very high data rates over the Fig. 7. FER on a 2 × 2 channel using parallel decoding methods. R = rich-scattering wireless channel,” in 1998 URSI International Symposium 1/4 bits/dim and F = 4 blocks. on Signals, Systems, and Electronics. Conference Proceedings (Cat. No.98EX167), Sep. 1998. doi: 10.1109/ISSSE.1998.738086 pp. 295– 300. [24] O. Ordentlich, U. Erez, and B. Nazer, “Successive integer-forcing and [3] B. Nazer and M. Gastpar, “Compute-and-Forward: Harnessing Interits sum-rate optimality,” in 2013 51st Annual Allerton Conference on ference Through Structured Codes,” IEEE Trans. Inf. Theory, vol. 57, Communication, Control, and Computing (Allerton), Oct. 2013. doi: no. 10, pp. 6463–6486, Oct. 2011. doi: 10.1109/TIT.2011.2165816 10.1109/Allerton.2013.6736536 pp. 282–292. [4] C. Feng, D. Silva, and F. R. Kschischang, “An Algebraic Approach [25] E. Biglieri, Coding for Wireless Channels, ser. Information technology– to Physical-Layer Network Coding,” IEEE Trans. Inf. Theory, vol. 59, transmission, processing, and storage. New York: Springer, 2005. ISBN no. 11, pp. 7576–7596, Nov. 2013. doi: 10.1109/TIT.2013.2274264 978-1-4020-8083-8 978-1-4020-8084-5 [5] D. Tse and P. Viswanath, Fundamentals of Wireless Communication, [26] J. J. Boutros, A. Guillen i Fabregas, E. Biglieri, and G. Zemor, “Low1st ed. Cambridge, UK ; New York: Cambridge University Press, Jul. Density Parity-Check Codes for Nonergodic Block-Fading Channels,” 2005. ISBN 978-0-521-84527-4 IEEE Trans. Inf. Theory, vol. 56, no. 9, pp. 4286–4300, Sep. 2010. doi: [6] O. Ordentlich and U. Erez, “Achieving the gains promised by Integer10.1109/TIT.2010.2053890 Forcing equalization with binary codes,” in 2010 IEEE 26-Th Convention [27] A. G. D. Uchoa, C. T. Healy, and R. C. de Lamare, “Structured rootof Electrical and Electronics Engineers in Israel, Nov. 2010. doi: LDPC codes and PEG-based techniques for block-fading channels,” 10.1109/EEEI.2010.5662120 pp. 000 703–000 707. J Wireless Com Network, vol. 2015, no. 1, p. 213, Dec. 2015. doi: [7] S. H. Chae, M. Jang, S. K. Ahn, J. Park, and C. Jeong, “Multilevel 10.1186/s13638-015-0439-6 Coding Scheme for Integer-Forcing MIMO Receivers With Binary Codes,” IEEE Trans. Wirel. Commun., vol. 16, no. 8, pp. 5428–5441, Aug. 2017. doi: 10.1109/TWC.2017.2711002 [8] L. Ding, K. Kansanen, Y. Wang, and J. Zhang, “Exact SMP Algorithms for Integer-Forcing Linear MIMO Receivers,” IEEE Trans. Wirel. Commun., vol. 14, no. 12, pp. 6955–6966, Dec. 2015. doi: FER FER AM-MMSE AM-IF GM-MMSE Prop. 1 (GM-IF) Prop. 2 (GM-IF) Optimal GM-IF Prop. 1 (GM-IF) (theo.) Prop. 2 (GM-IF) (theo.) Optimal GM-IF (theo.) JOURNAL OF COMMUNICATION AND INFORMATION SYSTEMS, VOL. 32, NO.1, 2017. Ricardo Bohaczuk Venturelli received the B.Sc. degree and M.Sc. degree from the Federal University of Santa Catarina (UFSC), Florianópolis, Brazil, in 2014 and 2016, respectively, all in electrical engineering. Currently, he is Ph.D. student in electrical engineering at the Federal University of Santa Catarina. His research interests include channel coding, network coding, information theory and wireless communications. He is a member of the Brazilian Telecommunications Society (SBrT) since 2014. 145 Danilo Silva (S’06–M’09) received the B.Sc. degree from the Federal University of Pernambuco (UFPE), Recife, Brazil, in 2002, the M.Sc. degree from the Pontifical Catholic University of Rio de Janeiro (PUC-Rio), Rio de Janeiro, Brazil, in 2005, and the Ph.D. degree from the University of Toronto, Toronto, Canada, in 2009, all in electrical engineering. From 2009 to 2010, he was a Postdoctoral Fellow at the University of Toronto, at the École Polytechnique Fédérale de Lausanne (EPFL), and at the State University of Campinas (UNICAMP). In 2010, he joined the Department of Electrical Engineering, Federal University of Santa Catarina (UFSC), Brazil, where he is currently an Assistant Professor. His research interests include wireless communications, channel coding, information theory, and machine learning. Dr. Silva is a member of the Brazilian Telecommunications Society (SBrT). He was a recipient of a CAPES Ph.D. Scholarship in 2005, the Shahid U. H. Qureshi Memorial Scholarship in 2009, and a FAPESP Postdoctoral Scholarship in 2010.
7cs.IT
arXiv:1611.02538v1 [q-bio.MN] 30 Oct 2016 Inferring disease causing genes and their pathways: A mathematical perspective Jeethu V. Devasia Priya Chandran Department of Computer Science and Engineering National Institute of Technology Calicut, India - 673 601 Email: jeethu p130021cs @ nitc.ac.in Department of Computer Science and Engineering, National Institute of Technology Calicut, India - 673 601 Email: priya @ nitc.ac.in Abstract—Background and Objective: A system level view of cellular processes for human and several organisms can be captured by analyzing molecular interaction networks. A molecular interaction network formed of differentially expressed genes and their interactions helps to understand key players behind disease development. So, if the functions of these genes are blocked by altering their interactions, it would have a great impact in controlling the disease. Due to this promising consequence, the problem of inferring disease causing genes and their pathways has attained a crucial position in computational biology research. However, considering the huge size of interaction networks, executing computations can be costly. Review of literatures shows that the methods proposed for finding the set of disease causing genes could be assessed in terms of their accuracy which a perfect algorithm would find. Along with accuracy, the time complexity of the method is also important, as high time complexities would limit the number of pathways that could be found within a pragmatic time interval. Methods and Results: Here, the problem has been tackled by integrating graph theoretical approaches with an approximation algorithm. The problem of inferring disease causing genes and their pathways has been transformed to a graph theoretical problem. Graph pruning techniques have been applied to get the results in practical time. Then, randomized rounding, an efficient approach to design an approximation algorithm, has been applied to fetch the most relevant causal genes and pathways. Experimentation on multiple benchmark datasets has been demonstrated more accurate and computationally time efficient results than existing algorithms. Also, biological relevance of these results has been analyzed. Conclusions: Based on computational approaches on biological data, the sets of disease causing genes and corresponding pathways are identified for multiple disease cases. The proposed approach would have a remarkable contribution in areas like drug development and gene therapy, if we could recognize these results biologically too. Index Terms—Molecular interaction Network; Causal genes; Dysregulated pathway; Graph pruning; Approximation algorithm; Randomized rounding I. I NTRODUCTION Cellular processes are mainly governed by the co-action of biomolecules. For example, a particular protein function can be understood by mapping protein-protein interactions. These biological communications can be represented using molecular interaction networks. At present, molecular interaction networks of various organisms are available [1]. We can exploit them for diverse aims such as discovering disease causing genes and related pathways. From the computational perspective, computing information flows in a complex model is expensive as the input sizes are large and the analyses typically have very high time complexities. Therefore, proposing algorithms for effective computation on the networks would have a remarkable impact on the knowledge to be gained from such networks. The problem of inferring disease causing genes and dysregulated pathways is of prime importance and huge academic and industrial interest, because, it is potentially very useful for comprehending the underlying system of complex diseases and suggesting prospective drug targets. An algorithm that augments graph theoretical approaches with approximation for inferring causal genes and dysregulated pathways is addressed in this paper. The proposed method incorporates gene expression value because of its potentiality in predicting diseases. High-risk genes are more correlated with each other than the genes with lower risk and vice versa [2]. An experimental analysis of the state of the art related works together with the proposed method is also given in this paper. Related works are based on Random walk based approach, Electric circuit model with Expression Quantitative Loci (eQTL) analysis, Electric circuit model with multiple sources and sinks, Fast iterative matrix inversion and Approximation algorithm based on Randomized rounding [3], [4], [5], [6], [1], [7], [8], [9]. Proposed by Tu et al., the random walk approach has shown a significant impact in the problem of identifying causal genes and and the underlying pathways [1], [3], [4], [6]. Based on the Pearson’s correlation coefficient of gene expression values of genes, transition probability is defined. Starting from a source node, random walker moves to a node that is qualified as an unvisited and highest transition probability bearing node among all the neighbors of the current node. This process is repeated until it visits the destination node or further movement is not possible. Candidate causal gene that has the largest number of visit times or that has the largest value of probability of being a causal gene is taken as the causal gene, gc . Identification of pathway is done by tracing a path from gc to the corresponding source node by selecting intermediate nodes as the most visited ones. According to Suthram et al., this approach results in relatively short walks with the requirement of multiple iterations for better results [6]. They proposed a new approach based on Electric circuit model which is analogous to Random walk based approach [6], [1], [5], [3]. Considering a network of protein-protein interactions and Transcription Factor (TF)-DNA interactions as an electric circuit, conductance of each edge (u, v) is set based on the correlation of expression values of u and v with the target gene. After solving the electric circuit using Kirchhoff’s and Ohm’s Laws to get the current through each node and edge, the causal gene is taken as the gene with highest value of current flow. Pathway is the shortest route between a target gene and causal gene with the highest total sum of currents across its interactions such that each edge corresponds to an interaction. All such paths together give the textitpathways for the entire network. Based on the above approaches, Y. A. Kim et al. suggested an electric circuit based approach with multiple sources and sinks [1], [7]. Conductance is defined as the average of the absolute value of the Pearson correlation coefficient between gene expression values of target gene and genes at the endpoints of each link. A system of linear equations based on Ohm’s law and Kirchhoff’s law is solved to find the voltages of links and thereby to calculate the current value. Causal genes are taken as the genes with significant amount of current flow. Pathway is the shortest paths in the collection of all maximum current paths for each pair of source and sink. Focusing on the faster computation of voltages of nodes suggested in the previous approach, a fourth order iterative method for fast iterative matrix inversion was proposed in [8]. Following the calculation of voltages of nodes, causal genes and dysregulated pathways are identified as in citeref:yoo, [7]. A new approximation algorithm was proposed in [9], based on electric circuit approach to fetch causal genes and corresponding pathways. Collection of all distinct paths in a reduced network obtained by thresholding the edge-weights is computed. Then, randomized rounding is applied to get the path with maximum current flow which is taken as the dysregulated pathway for the corresponding target and causal genes. The members of the pathways are taken as causal genes. Here, we infer that the reported works in literature for finding the set of disease causing genes could be evaluated in terms of their accuracy, i.e, the closeness of the set found to the actual set and execution time. During the assessment, it has been observed that in most of the cases, execution time rises with accuracy. II. M ATERIALS AND M ETHODS A. Selection of target genes and candidate causal genes Gene expression data of Breast cancer and Lung cancer of the species Homosapiens (GSE44024 and GSE43459) and Pancreatic cancer of the species Rattus norvegicus (GSE22537) have been utilized for experimentation. Data have been collected from the National Center for Biotechnology Information (NCBI) sponsored Gene Expression Omnibus data repository [9]. Platform details and sample information of the datasets are given in Table ??. Disease GEO Accession Sample count (case / control) Breast cancer GSE44024 4 (2 / 2) Lung cancer GSE43459 6 (3 / 3) Pancreatic cancer GSE22537 18 (9 / 9) Platform GPL571 (Affymetrix Human Genome U133A 2.0 Array) GPL6244 (Affymetrix Human Gene 1.0 ST Array) GPL1355 (Affymetrix Rat Genome 230 2.0 Array) TABLE I: Dataset details The following steps have been done for each dataset separately. The initial data have been normalized using Robust Multi-array Average method to remove any noise due to non-biological factors [10]. Then, the genes having statistical significance have been selected using t-test with equal variance and 2-tailed followed by the calculation of p-value. Then, significant q-values have been computed and genes with qvalue < 0.05 have been selected. This set of differentially expressed genes has been taken as the candidate causal genes for Breast cancer and Pancreatic cancer. Considering the data size, first 100 genes after sorting p-value in ascending order following the filtering based on q-value, have been selected as candidate causal genes for Lung cancer. Gene interaction network of molecular interactions has been downloaded from BioGRID database for each candidate causal gene. The fetched network data have been filtered to select only the genes that are differentially expressed. Genes that are linked with transcription factors in the network have been considered as target genes. The set of target genes has been considered as the set source nodes. The set of genes apart from the target genes has been considered as the set of sink nodes. B. Selection of benchmark data Data from NCBI sponsored Gene database, Aceview and Uniprot database and Cosmic database have been curated as benchmark data for Breast cancer and Lung cancer of the species, Homosapiens. For this, the set of associated genes corresponding to a particular disease case and species has been fetched from these databases. These fetched genes after removing duplicates have been taken as the benchmark data for each disease. Similarly, data from NCBI sponsored Gene database, Aceview, Uniprot database and literatures from NCBI, Nature, Nucleic Acid Research have been compiled as benchmark data for the species Rattus norvegicus [11], [12]. C. Formulation of the algorithm 1) Biological Background: Each gene g is expressed to a particular level during the process of producing the ultimate products called proteins and this level can be measured as a numerical quantity, known as expression value, e(g) [13], [14], [15], [16]. Also, each gene interacts with several genes resulting in certain phenotypes [17]. With the advances in the area of computational biology, molecular interactions can be represented as a network by designating genes/proteins as nodes and edges as associations between end nodes [18], [19]. These associations have different aspects like physical interactions, membership in the same pathway, co-expression and literature co-occurrence [20], [21]. It reveals the fact that two nodes may be linked together in different cases, resulting in a network with multiple edges [22], [23], [24]. Also, molecular interaction network consists of certain directional links such as protein-protein interactions (bidirectional), TFDNA interactions (directional) and Phosphorylation events (directional) [1], [7], [25], [9]. Expression levels or values of genes help to make distinction between healthy and disease cases in view of the fact that there is an increase or decrease in expression values of some genes in many diseases from that of healthy individuals [26], [27], [28]. When a particular gene’s expression value changes between two groups of healthy and affected individuals, then the gene is said to be differentially expressed [27], [16], [29]. Differentially expressed genes may lead to a disease state or to a beneficial state. 2) Definitions: The set of genes that gives rise to a particular disease state is termed as causal genes. The set of probable genes of a certain disease is termed as candidate causal genes. The set of candidate causal genes that are bound by Transcription Factors is referred to as target genes [1], [7], [3]. As described in Section II-C1, candidate causal genes are connected together in a gene/protein network due to different aspects. A disease state may be developed by the interference of a target gene and a candidate causal gene in the normal biological functions of a cell and this relationship between a target gene and a candidate causal gene is known as dependence [28]. The dependence between a target gene, t and a candidate causal gene, c is computed as δ(t, c) = P (e(t), e(c)) (1) where, P (e(t), e(c)) is the Pearson’s correlation coefficient of the expression values of genes t and c. Genes with low values of δ and high values of δ are crucial in molecular interactions [30]; so we consider the absolute value of δ [4]. Similarly, in [1] and [7], the edge weight for the edge in the molecular interaction network is taken as the average of the absolute value of the dependence of genes (end nodes of the edge) with the target gene. The edge weights can be used as a measure of inferring causal genes and corresponding pathways. D. Formal notations and definitions Let Gt be the set of target genes, Gcc be the set of candidate causal genes and Gc be the set of causal genes. The basic problem is to find Gc , the set of causal genes, where Gc ⊆ Gcc and Gcc and Gt are known. The fundamental decision problem here is Does gcc ∈ Gc ? where gcc ∈ Gcc [or, is a candidate causal gene, a causal gene]. Let us recall that gcc ∈ Gc if it has a role in disease, and would be determined by the interactions it has with the target genes, gt ∈ Gt , and other candidate genes which have a role in the disease. For each target gene gt , a weighted graph (network) is defined with gt as the source, members in Gcc as the other (non-source) nodes, and molecular interactions as the edges. Edge weights reflect the role of the genes represented by the end nodes in causing the disease. It may be realized at this point that there would be |Gt | such graphs, each containing |Gcc | + 1 nodes. Let (Gt , wt ) be such a network for target gene, gt . Gt .V = {gt } ∪ Gcc Gt .E is defined by molecular interactions, as described next. Let c(gcc , gt ) = δ(gt , gcc ). Nodes in Gt .V would have had multiple edges between them, as in Section II-C1. The molecular interaction network is simplified, to get ordinary graphs, using the following method. The weight function wt : Gt .V × Gt .V → [0, +1] is defined as, |c(gx , gt )| + |c(gy , gt )| (2) wt (gx , gy ) = 2 where, gx , gy are candidate causal genes and gx ∼ gy (i.e., they have an interaction in any of the three ways outlined in Section II-C1) [1], [7]. Thus, multiple edges defined in Section II-C1 get substituted with a single weighted edge in Gt . The genes at the endpoints of edges with higher edge weights [1], [7] are said to have a role in the disease, or are causal genes. P p The weight of a path p from gt to gcc = e∈g ;g wt (e). t cc The paths from gt to candidate causal genes having high weight values are called dysregulated pathways. There may be multiple dysregulated pathways in any (Gt , wt ). It may be recalled that there are |Gt | such (Gt , wt ), or interaction networks, and each typically contains multiple dysregulated pathways. Genes corresponding to nodes belonging to the dysregulated pathways are called the causal genes. i.e., gcc ∈ Gc , if there p exists gt and a path p such that gt ; v and gcc ∈ p where, v p is a candidate causal gene, gt is a target gene and gt ; v is a dysregulated pathway in (Gt , wt ). In the above description, the terms “high” edge weights and “high” weighted paths have been used. As these adjectives are abstract, they need to be quantified. E. Towards a new algorithm The problem defined in Section II-D is explained and stated below, without abstract adjectives. A protein network can be represented as an edge-weighted directed graph with each gt as the source vertex and wt (u, v) as the edge-weight between nodes u and v defined previously. Nodes represent genes or proteins and edges represent molecular interactions. (Gt , wt ) obtained for each gt ∈ Gt is further reduced, by eliminating “low” weighted edges. “High” and “low” are decided based on a threshold, which is defined as follows. In (Gt , wt ), the threshold τ is defined as P wt (e) τ = e∈Gt .E (3) |Gt .E| The set of edges to be removed, R, is computed as follows. R = {e|e ∈ Gt .E ∧ wt (e) < τ } (4) The edges in R are then removed from (Gt , wt ) [9]. The paths having high path weights (as defined earlier) from gt to all candidate causal genes, in graphs for all gt ∈ Gt are the dysregulated pathways and all vertices belonging to dysregulated pathways are causal genes. Given n graphs (Gi , wi ) with source vertex i ∈ Gt and Gi .V = i ∪ Gcc . Find Gc . Gc = ∪∀(Gi ,wi ) {gcc |wi (gcc , gi ) > τ p ∧ ∃p : gi ; gcc ∧ ∀e ∈ p wi (e) > τ } (5) where, τ is the threshold value defined in Equation 3. Find dysregulated pathways Dp as all the paths p satisfying the above condition. i.e., Dp = {p|∀e ∈ p wi (e) > τ } (6) It is inferred that every research work described in Section I attempts to find the complete set Gc and all dysregulated pathways. However, for realistic biological networks, the size of the sets and the number of paths is very large for practical computation [1], [7]. In order to get the results in reasonable computation time, the following heuristic is used in this work. “In a biological network, higher the degree of a node, more relevant it is” [31], [32], where degree of a node is the number of its neighboring edges. Degree of a node, v is denoted by deg(v). Hence, each time a path p ∈ Dp is explored in (Gi , wi ), a vertex gcc with deg(gcc ) = δ(Gi , wi ) is removed. δ(Gi , wi ) is the minimum degree of (Gi , wi ). Let vδ be the node with minimum degree in (Gi , wi ). Then, (Gi , wi ) is updated such that Gi .V = Gi .V \ vδ . Next, a path, p ∈ Dp is traversed in (Gi , wi ) and repeat this process till |V | = k, where k is an integer. The process of removing vδ can be made efficient in terms of execution time by mapping Gcc along with the degree of each node, deg(gcc ) to min-heap data structure. Min-heap is the underlying data structure of priority queues with the property of A[parent(u)] ≤ A[u], where u is a node other than root node and parent(u) is the parent node of u [33]. Here, priority is given in terms of the decreasing order of degree. Highest priority is assigned to the vertex vδ to ensure that the vertex with the least degree is removed. Considering each node and its degree in the molecular interaction network as the elements of the min-heap, vδ is deleted by removing the root node of the min-heap. Then, this data structure is reorganized to bring the highest priority node or vδ at the root [33] and the process specified earlier continues till the number of nodes = k. Each time vδ is removed, its adjacent edges are also removed, thereby reducing the complex nature of biological networks which in turn results in identification of relevant genes and corresponding pathways within practical time interval. Now, definitions of Gc and Dp are updated as follows: Gc = ∪∀(Gi ,wi ) {gcc |wi (gcc , gi ) > τ p ∧ ∃p : gi ; gcc ∧ ∀e ∈ p wi (e) > τ ∧ ∃gcc : deg(gcc ) > δ(Gi , wi )} (7) Here, an additional characteristic of causal genes is incorporated apart from the attributes described in Equation 5: causal genes tend to be higher degree nodes. Dysregulated pathways Dp as all the paths p satisfying the mentioned conditions. i.e., Dp = {p|∀e ∈ p wi (e) > τ ∧ ∃v ∈ p : deg(v) > deg(vδ )} (8) Finally, motivated by the approach in [9], randomized rounding, an efficient approach to design an approximation algorithm is done to fetch the most relevant paths in terms of weight, wi (e) and degree, deg(gcc ) in (Gi , wi ). The ranψ algorithm. domized rounding approach resulted in a factor ηκ Here, ψ is the total number of paths in Ψ, where, Ψ is the collection of all distinct paths in the reduced network. η is the total number of distinct edges in Ψ and κ is the number of occurrences of a randomly selected edge in Ψ. P Its underlying principle follows. ∀e∈p wi (e)Pis calculated for (Gi , wi ), where p ∈ Dp . Let µp be max( ∀e∈p wi (e)) in (Gi , wi ). Dysregulated pathway is taken as the path having value µp and the members of the pathway is taken as the causal genes for (Gi , wi ). Therefore, definitions of Gc and Dp are reformed by adding the following attribute: causal genes and thereby dysregulated pathways are constituted of maximum weighted paths after randomized rounding. Final definitions of Gc and Dp after joining all the mentioned attributes together are as given below. Gc = ∪∀(Gi ,wi ) {gcc |wi (gcc , gi ) > τ p ∧ ∃p : gi ; gcc ∧ ∀e ∈ p wi (e) > τ ∧ ∃gcc : deg(gcc ) > δ(Gi , wi ) ∧ ∃p : ∀e ∈ p Σwi (e) = µp } (9) Dysregulated pathways Dp as all the paths p satisfying the stated conditions. i.e., Dp = {p|∀e ∈ p wi (e) > τ ∧ ∃v ∈ p : deg(v) > deg(vδ ) ∧ ∀e ∈ p Σwi (e) = µp } (10) Algorithm 1 Infer causal genes and dysregulated pathways Input: n graphs (Gi , wi ) with source vertex i ∈ Gt and sink vertex gcc ∈ Gcc Output: Gc and Dp F. Implementation and Validation of the results Comparative study of the related works in literature and the proposed method has been performed based on the accuracy of results and the execution time. All these methods have been implemented in Intel ®Core i7-3770 CPU @ 3.40GHz X 8 machine with memory (RAM) capacity of 16 GB by using the programming languages R and C. Also, the effectiveness of the Algorithm 1 has been explored by using Reactome Pathway Database to provide its biological significance. 1) Analysis based on τ and k: As the threshold defined in 3, is quite critical for removing the low-weighted edges, its effect on identifying causal genes and dysregulated pathways has been simulated. For this, apart from implementing Algorithm 1, an algorithm without using steps 4, 5 and 6 in Algorithm 1 has been implemented. Also, Algorithm 1 has been implemented against different values of k which is defined in Section II-E for the datasets. III. D ISCUSSION AND R ESULTS A. Approximation algorithm with graph reduction Pseudo code for the algorithm to identify causal genes and dysregulated pathways is given in Algorithm 1. The algorithm considers a molecular interaction network with multiple sources and sinks. Source set is the set of target genes and sink set is the set of candidate causal genes other than target genes. Proof of the approximation factor is given in Appendix ??. B. Implementation and Validation of the results All the related works in literature and the proposed algorithm have been implemented as specified in Section II-A on multiple datasets. For Breast cancer dataset, Gt consists of 41 genes and Gcc consists of 309 genes, for Lung cancer dataset, Gt consists of 7 genes and Gcc consists of 70 genes and for Pancreatic cancer dataset, Gt consists of 46 genes and Gcc consists of 140 genes. (Gt , wt ) have 8403 edges and 350 nodes with a total of 41 such graphs for Breast cancer dataset, 466 edges and 77 nodes with a total of 7 such graphs for Lung cancer dataset and 729 edges and 186 nodes with a total of 46 such graphs for Pancreatic cancer dataset. Benchmark data as specified in Section II-B have been obtained for the cases Breast cancer, Lung cancer and Pancreatic cancer as 26 genes, 21 genes and 83 genes respectively. Let us denote Breast cancer dataset as dataset I, Lung cancer dataset as dataset II and Pancreatic cancer dataset as dataset III. 1) Simulation study based on τ : The effect of τ on identifying causal genes and dysregulated pathways has been simulated by considering multiple graphs with SLCO2A1 as source for a subset of sink nodes on dataset I, Cdk6 as source for a subset of sink nodes on dataset II and Acaca as source 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: for all i ∈ Gt do for all gcc ∈ Gcc do s ← gcc Calculate τ Find R Remove R from (Gi , wi ) repeat Ψ = Ψ ∪ F indpath((Gi , wi ), i) until (|V | = k) ψ ← |Ψ| if ψ = 0 then goto step 1 else if ψ = 1 then Dp = Ψ Find Gc goto step 1 else Find η, total number of distinct edges in Ψ Randomly pick an edge, e from a path in Ψ Calculate κ, number of occurrences of e in Ψ r ← ηκ ψ for i = 1 to r do RandomlyP select a path p in Ψ Calculate ∀e∈p wi (e) end for Dp ← Path with value µp Find Gc end if end for end for for a subset of sink nodes on dataset III, as specified in Section II-F1. The results are summarized and tabulated in Table II. Dataset I II III # Causal Genes [86][87] [24][35] [8][9] Execution Time [435.35 Sec.][737.33 Sec.] [1.503 Sec.][1.893 Sec.] [45.5 Sec.][800.119 Sec.] TABLE II: Effect of τ with the order [with τ ][without τ ] There is a slight increase in the number of causal genes identified in the method without using τ ; but, it compromises on execution time while considering all the genes. 2) Analysis based on k: Algorithm 1 has been implemented against different values of k as defined in Section II-E for the datasets. Considering the size of the datasets, for dataset I, a subgraph of (Gt , wt ) has been considered by selecting first 100 genes after sorting p-value, resulting in 8 graphs of 432 edges and 74 nodes with benchmark data consisting of procedure F indpath((Gi , wi ), v) if v = s then p=p∪v Ψ←p G1 .V = Gi .V \ {i, s} Calculate deg(gcc ) for all gcc ∈ G1 .V Assign priority based on decreasing order of degree Make a min − heap for (G1 ) Find vδ Delete vδ from min − heap Update Gi .V = Gi .V \ vδ else for all neighbours adj of v do if adj is unexplored then p=p∪v F indpath((Gi , wi ), adj) end if end for end if end procedure 10 genes. The receiver-operating characteristic (ROC) analysis has been used to compare the performance of the algorithm under various values of k. The values of k are selected as 10% of |V |, 20% of |V |, 30% of |V | and 40% of |V |. The ROC curve plots the true positive rate (TPR) / sensitivity versus the false positive rate (FPR) / (100-specificity) where, TPR is the percentage of causal genes which are correctly identified based on benchmark dataset and FPR is the percentage of causal genes which are not present in the benchmark dataset. To compare different curves obtained by ROC analysis, the area under curve (AUC) for each curve has been calculated, which is given in Table III. Higher the value of AUC, better the result is. Also, the execution time for each case is taken and it is summarized in Table IV. When the ROC curve and execution time are compared, k=10% of |V | has shown better performance and it has been selected as the cut-off value in Algorithm 1 provided overall accuracy is same in all cases. Values of k 10% of |V | 20% of |V | 30% of |V | 40% of |V | Dataset I 0.0294 0.0294 0.0294 0.0294 Dataset II 0.6932 0.5263 0.3982 0.4463 Dataset III 0.656 0.694 0.579 0.552 TABLE III: AUC for different values of k Values of k 10% of |V | 20% of |V | 30% of |V | 40% of |V | Dataset I 0.16 1.5 10.9 14.06 Dataset II 6.68 9.57 10.38 14.24 Dataset III 90.291 148.28 167.206 1637 TABLE IV: Execution time (Seconds) for different values of k Fig. 1: Comparison based on the accuracy of results C. Measuring the accuracy of results and Analysis based on the execution time Accuracy is defined as the measurement of closeness between the benchmark data and the actual results. It is calculated as the percentage of causal genes which are correctly identified based on benchmark dataset. Comparison based on the accuracy of results is given in Figure 1 and the execution time is given in Table V. Approaches Random walk approach eQED approach Current flow approach Matrix inversion approach Randomized rounding approach Rounding with min-heap Dataset I 65 (Min.) 33 (Min.) 37 (Min.) 34 (Min.) 4114 (Min.) 2155 (Min.) Dataset II 5 (Sec.) 4 (Sec.) 1801 (Hours) 1789 (Hours) 53 (Hours) 8.61 (Sec.) Dataset III 1 (Min.) 0.8 (Min.) 1226 (Min.) 1212 (Min.) 1.73 (Min.) 1.12 (Min.) TABLE V: Comparison based on the execution time Observations made based on these results are given next. In random walk approach, the Pearson’s correlation coefficient of the gene expression levels of genes at each node and the target gene is calculated and transition probability has obtained using this value. Random walk based on transition probabilities is done multiple times. Disease causing genes including their pathways are obtained as the result. Random walk approach takes less amount of execution time, but the number of genes identified and the accuracy of results are less. The molecular interaction is considered as an electric circuit according to other approaches in literature. The conductance of each link is calculated based on the Pearson’s correlation coefficient of the gene expression levels of genes at each node and target gene. The Kirchhoff’s current law and Ohm’s law are utilized to obtain voltages. The current is calculated using Ohm’s law for each edge in the network. Disease causing genes and dysregulated pathways are identified using each of these methods. eQED approach takes least amount of execution time, but gives lesser number of genes and low accuracy compared to methods other than random walk approach. Electric circuit approach with multiple sources and sinks and fast iterative matrix inversion return same number of disease causing genes with same accuracy. Here, genes receiving current of at least 70% of the maximum current among all genes are considered in each iteration and thereby its execution time is greater in most of the cases. Since, fast iterative matrix inversion uses fourth order iterative method, execution time is less compared to electric circuit approach with multiple sources and sinks. Approximation algorithm outperforms other methods in terms of the number of disease causing genes identified and the accuracy of results. But, it takes much more time compared to random walk approach and eQED approach. Here, before applying randomized rounding, all possible paths are identified which in turn results in increased execution time. The proposed algorithm, Approximation algorithm with graph reduction has been implemented on multiple datasets and the sets of causal genes and associated pathways for the disease cases have been identified. Initially, a set of lessweighted edges are removed. Then, a set of vertices are removed together with the exploration of a set of distinct simple paths by making sure that a vertex of least degree is deleted. Min-heap data structure is utilized for time efficient vertex removal. This process repeats k times with its value as 10% of |V |. Finally, most relevant paths are identified using randomized rounding. This newly proposed approximation algorithm with graph reduction defeats all other methods by identifying more number of genes within less time interval. The sets of all newly identified disease causing genes apart from the known genes in the benchmark datasets as well as the resultant sets of identified causal genes and dysregulated pathways for all the datasets are given in the Supplementary material. IV. C ONCLUSION AND F UTURE SCOPE Computationally intensive process of identifying causal genes and related pathways from the huge molecular interaction networks has been addressed in this paper. The huge size of the molecular interaction network is reduced by retaining more relevant nodes and edges in terms of edge-weights and connectivity. Then, most appropriate nodes, thereby paths in terms of these parameters are selected by using the concept of approximation. Experimentations proved that the newly proposed approximation algorithm with graph reduction outperforms all other methods by identifying more number of genes within lesser time. R EFERENCES [1] S. W. Yoo-Ah Kim, Jozef H Przytycki and T. M. Przytycka, “Modeling information flow in biological networks,” in Physical Biology . 8(2011) 035012(9pp). 2011 IOP Publishing Ltd, 13 May 2011, pp. 1–9. [2] S. Winslow, K. Leandersson, A. Edsjö, and C. Larsson, “Prognostic stromal gene signatures in breast cancer,” Breast Cancer Research, vol. 17, no. 1, pp. 1–13, 2015. [3] P. T. Cho D-Y, Kim Y-A, “Chapter 5: Network biology approach to complex diseases,” PLoS Computational Biology, vol. 8(12), 2012. [4] Z. Tu, L. Wang, M. N. Arbeitman, T. Chen, and F. Sun, “An integrative approach for causal gene identification and gene regulatory pathway inference,” Bioinformatics, vol. 22, no. 14, pp. e489–e496, 2006. [5] P. G. Doyle and J. L. Snell, Random Walks and Electric Networks. Washington DC: Mathematical Association of America, 2000. [6] S. Suthram, R. M. K. Andreas Beyer, and T. I. Yonina Eldar, “eqed: an efficient method for interpreting eqtl associations using protein networks,” Molecular Systems Biology, vol. 4:162, 2008. [7] P. T. Kim Y-A, Wuchty S, “Identifying causal genes and dysregulated pathways in complex diseases,” PLOS Computational Biology, vol. 7, 2011. [8] T. Jose and P. Chandran, “A fast iterative method for modeling information flow in biological networks,” Master’s thesis, National Institute of Technology Calicut, India, 2013. [9] J. V. Devasia and P. Chandran, “Towards an improved algorithm for modeling information flow in biological networks,” in Interanational Conference on Advances in Computing, Communications, and Information Science. Elsevier, 2014, pp. 88–95. [10] R. A. Irizarry, B. Hobbs, Collin et al., “Exploration, normalization, and summaries of high density oligonucleotide array probe level data,” Biostatistics, vol. 4, no. 2, pp. 249–264, 2003. [11] D. Maglott, J. Ostell, K. D. Pruitt, and T. Tatusova, “Entrez gene: genecentered information at ncbi,” Nucleic Acids Research, vol. 33, no. suppl 1, pp. D54–D58, 2005. [12] S. A. Forbes, D. Beare, P. Gunasekaran, K. Leung, N. Bindal, H. Boutselakis, M. Ding, S. Bamford, C. Cole, S. Ward, C. Y. Kok, M. Jia, T. De, J. W. Teague, M. R. Stratton, U. McDermott, and P. J. Campbell, “Cosmic: exploring the world’s knowledge of somatic mutations in human cancer,” Nucleic Acids Research, vol. 43, no. D1, pp. D805– D811, 2015. [13] M. J. C. Sandrine Dudoit, Yee Hwa Yang and T. P. Speed, “Statistical methods for identifying differentially expressed genes in replicated cdna microarray experiments,” Statistica Sinica, vol. 12, pp. 111–139, 2002. [14] E. S. Kawasaki, “The end of the microarray tower of babel: Will universal standards lead the way?” Journal of Biomolecular Techniques, vol. 17:200206, 2010. [15] F. Millenaar, J. Okyere, S. May, M. van Zanten, L. Voesenek, and A. Peeters, “How to decide? different methods of calculating gene expression from short oligonucleotide array data will give different results,” BMC Bioinformatics, vol. 7, no. 1, p. 137, 2006. [16] J. W. Ho, M. Stefani, C. G. dos Remedios, and M. A. Charleston, “Differential variability analysis of gene expression and its application to human diseases,” Bioinformatics, vol. 24, no. 13, pp. i390–i398, 2008. [17] M. I, “Epistasis: Gene interaction and phenotype effects,” Nature Education, vol. 1(1):197, 2008. [18] G. stlund, M. Lindskog, and E. L. L. Sonnhammer, “Network-based identification of novel cancer genes,” Molecular & Cellular Proteomics, vol. 9, no. 4, pp. 648–655, 2010. [19] R. Kelley and T. Ideker, “Systematic interpretation of genetic interactions using protein networks,” Nat Biotechnology, vol. 23(5), 2005. [20] C. von Mering, L. J. Jensen, M. Kuhn, S. Chaffron, T. Doerks, B. Krger, B. Snel, and P. Bork, “String 7recent developments in the integration and prediction of protein interactions,” Nucleic Acids Research, vol. 35, no. suppl 1, pp. D358–D362, 2007. [21] D. Szklarczyk, A. Franceschini, M. Kuhn, M. Simonovic, A. Roth, P. Minguez, T. Doerks, M. Stark, J. Muller, P. Bork, L. J. Jensen, and C. v. Mering, “The string database in 2011: functional interaction networks of proteins, globally integrated and scored,” Nucleic Acids Research, 2010. [22] A. Shojaie, “Link prediction in biological networks using multi-mode exponential random graph models,” in Eleventh Workshop on Mining and Learning with Graphs,ACM 978-1-4503-2322-2. ACM, 2013. [23] A. Ferro, R. Giugno, G. Pigola, A. Pulvirenti, D. Skripin, G. D. Bader, and D. Shasha, “Netmatch: a cytoscape plugin for searching biological networks,” Bioinformatics, vol. 23, no. 7, pp. 910–912, 2007. [24] G. Pavlopoulos, M. Secrier, C. Moschopoulos, T. Soldatos, S. Kossida, J. Aerts, R. Schneider, and P. Bagos, “Using graph theory to analyze biological networks,” BioData Mining, vol. 4, no. 1, p. 10, 2011. [25] Y.-A. Kim, S. Wuchty, and T. M. Przytycka, “Simultaneous identification of causal genes and dys-regulated pathways in complex diseases,” in Proceedings of the 14th Annual international conference on Research in Computational Molecular Biology, ser. RECOMB’10. Berlin, Heidelberg: Springer-Verlag, 2010, pp. 263–280. [26] O. Odibat and C. K. Reddy, “Ranking differential hubs in gene coexpression networks,” Journal of Bioinformatics and Computational Biology, vol. 10, p. 1240002 (15 pages), 2012. [27] A. Devonshire, R. Elaswarapu, and C. Foy, “Evaluation of external rna controls for the standardisation of gene expression biomarker measurements,” BMC Genomics, vol. 11, no. 1, p. 662, 2010. [28] C. Wu, J. Zhu, and X. Zhang, “Network-based differential gene expression analysis suggests cell cycle related genes regulated by e2f1 underlie the molecular difference between smoker and non-smoker lung adenocarcinoma,” BMC Bioinformatics, vol. 14, no. 1, p. 365, 2013. [29] A. C. A. Fredrik Barrenäs, Sreenivas Chavali et al., “Highly interconnected genes in disease-specific networks are enriched for diseaseassociated polymorphisms,” Genome Biology, 2012. [30] M. A. P. Sumeet Agarwal, Charlotte M. Deane and N. S. Jone, “Revisiting date and party hubs: Novel approaches to role assignment in protein interaction networks,” PLOS Computational Biology, vol. 6(6), p. e1000817, 2010. [31] P. F. Jonsson and P. A. Bates, “Global topological features of cancer proteins in the human interactome,” Bioinformatics, vol. 22, no. 18, pp. 2291–2297, 2006. [32] G. K-I, V. D. Cusick ME, V. M. Childs B, and B. A-L, “The human disease network,” Proceedings of the National Academy of Sciences of the United States of America, vol. 104, no. 21, pp. 8685–8690, 2007. [33] C. E. Leiserson, C. S. Thomas H. Cormen, and R. Rivest, Introduction to Algorithms. MIT Press, 2001.
8cs.DS
Journal of Machine Learning Research () Submitted 1/16; Published Operational Calculus on Programming Spaces Žiga Sajovic (corresponding author) arXiv:1610.07690v4 [cs.FL] 5 Feb 2017 [email protected] University of Ljubljana, Faculty of Computer and Information Science, Večna pot 113, SI-1000 Ljubljana, Slovenia XLAB d.o.o., Pot za Brdom 100, SI-1000 Ljubljana, Slovenia Martin Vuk [email protected] University of Ljubljana, Faculty of Computer and Information Science, Večna pot 113, SI-1000 Ljubljana, Slovenia Editor: Abstract In this paper we develop operational calculus on programming spaces that generalizes existing approaches to automatic differentiation of computer programs and provides a rigorous framework for program analysis through calculus. We present an abstract computing machine that models automatically differentiable computer programs. Computer programs are viewed as maps on a finite dimensional vector space called virtual memory space, which we extend by the tensor algebra of its dual to accommodate derivatives. The extended virtual memory is by itself an algebra of programs, a data structure one can calculate with, and its elements give the expansion of the original program as an infinite tensor series at program’s input values. We define the operator of differentiation on programming spaces and implement a generalized shift operator in terms of its powers. Our approach offers a powerful tool for program analysis and approximation, and provides deep learning with a formal calculus. Such a calculus connects general programs with deep learning, through operators that map both formulations to the same space. This equivalence enables a generalization of the existing methods for neural analysis to any computer program, and vice versa. Several applications are presented, most notably a meaningful way of neural network initialization that leads to a process of program boosting. Keywords: programming spaces, operational calculus, deep learning, neural networks, differentiable programs, tensor calculus, program analysis 1. Introduction Programming holds the power of algorithmic control flow and freedom of expression, whose abstinence severely limits descriptiveness of closed form methods of pen and paper mathematics, thus firmly cementing programming as the language of modern problem solving. Yet, a vibrant tradition of mathematics has existed since the dawn of mind, that remains, with the exception of combinatorics, largely untapped by computer science. Just as the discrete nature of physical reality is studied through analytic means, so can the nature of digital phenomena. Studying these procedures as objects undergoing change in some virtual space, has partially been attempted in some fields, such as Hamiltonian Monte © Žiga Sajovic and Martin Vuk. Sajovic and Vuk Carlo methods of Bayesian predictors, that Girolami and Calderhead (2011) studied as manifolds to great success, using unfortunately impractical methods of hard-coding derivatives of distributions. This of course stifles the freedom of algorithmic expression programming is embraced for. The way evaluation of algorithmic expressions differs from evaluation of symbolic expressions of standard analysis, lies at the very core of this dissonance. The disconnect was partially mitigated by methods of automatic differentiation utilized today in machine learning, engineering, simulations, etc. (see Baydin and et. al., 2015). Yet under the lack of a proper formalism the model collapses (see Pearlmutter and Siskind, 2008b) when one tries to generalize to such notions as a differentiable program p1 operating on (differentiable) derivatives of another program p2 (where only coding of p2 is required within p1 ), while retaining the famed expressive freedom. Models allowing for nested differentiation as in Pearlmutter and Siskind (2008a), still fail in providing algorithms with an algebra enabling study and formulation of programs with analytic equations. Existing models remain nothing more than efficient means to calculating derivatives, void of any meaningful algebraic insight, lacking the true power the vast field of analysis is endowed with. The aim of this paper is bridging the gap between programming and analysis left behind by previous models. By generalizing them, they are shown to be specific views of the same great elephant. Employing tensor algebra a virtual memory is constructed, whose data structures one can calculate with. In Section 5, an exact definition and construction of an analytic virtual machine is presented, capable of implementing infinitely-differentiable programming spaces and operators acting upon them, supporting actions on multiple memory locations at a time. These programming spaces are shown to be a subalgebra, giving rise to symbolic manipulations of programs, while attaining construction by algorithmic control flow. Operators expanding a program into an infinite tensor series are derived in Section 5.2. The operator of program composition is constructed in Section 5.3, generalizing both forward (e.g., Khan and Barton, 2015) and reverse (e.g., Hogan, 2014) mode of automatic differentiation to arbitrary order under a single invariant operator. The problem of nested differentiation is resolved in Section 5.5. Theory grants us the ability to choose programs’ complexity through approximations in the virtual space. The tensor algebra model of virtual memory consists of multi-linear maps which are tailor made for efficient implementation by GPU parallelism (Abdelfattah and et al., 2016). In Section 5.6 functional transformations of programs in an arbitrary function basis are derived. As different hardware is optimized for running with different sets of functions, this proves useful with adapting code to fit specific hardware. Branching and discontinuity are discussed in Section 5.8. where we show that analytic virtual machines fully integrate control structures, retaining algorithmic control flow. Theory grants a generalization from neural networks to general tensor networks in Section 6, revealing their connection with programs in Section 6.1. The historic Taylor series are modernized in Section 6.1.1 by deriving Neural tensor series, establishing an equivalence between general tensor networks and programming spaces. This has direct implications to the study and understanding of differentiable neural computers (Graves and et al., 2016) through operational calculus. By this equivalence, transformations of arbitrary programs to general tensor networks are derived. The transformation to a Neural Tensor series serves as a great initialization point of a general tensor network to be trained. This can be seen as 2 Operational Calculus on Programming Spaces a process of boosting (Freund and et al., 1999), converting a weaker learner to a strong one, which proves fruitful, as currently neural networks give best results to many problems. All such constructs are trainable (as is their training process itself) and adhere to the operational calculus. This is demonstrated in Section 6.2, enabling analytic study through the theory. Theory offers new insights into programs, as we demonstrate how to probe their inner structure in Section 7, revealing what actions properties of the domain most react to in Section 7.1. This enables us to alter data by imposing some property it lacks upon it. State of the art methods for analyzing neural networks (Mordvintsev et al., 2015) are generalized for the use on programming spaces in Section 7.1.1, providing a framework for analysis of machine learning architectures and other virtual constructs, as actions on the virtual space. 2. Computer Programs as Maps on a Vector Space We will model computer programs as maps on a vector space. If we only focus on the real valued variables (of type float or double), the state of the virtual memory can be seen as a high dimensional vector1 . A set of all the possible states of the program’s memory, can be modeled by a finite dimensional real vector space V ≡ Rn . We will call V the memory space of the program. The effect of a computer program on its memory space V, can be described by a map P : V → V. (1) A programming space is a space of maps V → V that can be implemented as a program in specific programming language. Definition 1 (Euclidean virtual machine) The tuple (V, F) is an Euclidean virtual machine, where • V is a finite dimensional vector space over a complete field K, serving as memory2 • F < V V is a subspace of the space of maps V → V, called programming space, serving as actions on the memory. 3. Differentiable Maps and Programs To define differentiable programs, let us first recall some definitions from multivariate calculus. Definition 2 (Derivative) Let V, U be Banach spaces. A map P : V → U is differentiable at a point x ∈ V , if there exists a linear bounded operator T Px : V → U such that lim h→0 kP (x + h) − P (x) − T Px (h)k = 0. khk (2) The map T Px is called the Fréchet derivative of the map P at the point x. 1. We assume the variables of interest to be of type float for simplicity. Theoretically any field can be used instead of R. 2. In most applications the field K will be R 3 Sajovic and Vuk For maps Rn → Rm Fréchet derivative can be expressed by multiplication of vector h by the Jacobi matrix JP,x of partial derivatives of the components of the map P Tx P (h) = JP,x · h. We assume for the remainder of this section that the map P : V → U is differentiable for all x ∈ V . The derivative defines a map from V to linear bounded maps from V to U . We further assume U and V are finite dimensional. Then the space of linear maps from V to U is isomorphic to tensor product U ⊗ V ∗ , where the isomorphism is given by the tensor contraction, sending a simple tensor u ⊗ f ∈ U ⊗ V ∗ to a linear map u ⊗ f : x 7→ f (x) · u. (3) ∂P : V →U ⊗V∗ (4) ∂P : x 7→ Tx P. (5) The derivative defines a map One can consider the differentiability of the derivative itself ∂P by looking at it as a map (4). This leads to the definition of the higher derivatives. Definition 3 (higher derivatives) Let P : V → U be a map from vector space V to vector space U . The derivative ∂ k P of order k of the map P is the map ∂k P k ∂ P : V → U ⊗ (V ∗ )⊗k   : x 7→ Tx ∂ k−1 P (6) (7) Remark 4 For the sake of clarity, we assumed in the definition above, that the map P as well as all its derivatives are differentiable at all points x. If this is not the case, definitions above can be done locally, which would introduce mostly technical difficulties. Let e1 , . . . , en be a basis of U and x1 , . . . xm the basis of V ∗ . Denote by Pi = xi ◦ P the i − th component of the map P according to the basis {ei } of U . Then ∂ k P can be defined in terms of directional(partial) derivatives by the formula ∂k P = X ∀i,α ∂ k Pi ei ⊗ dxα1 ⊗ . . . ⊗ dxαk . ∂xα1 . . . ∂xαk (8) 3.1 Differentiable Programs We want to be able to represent the derivatives of a computer program in an Euclidean virtual machine again as a program in the same euclidean virtual machine. We define three subspaces of the virtual memory space V, that describe how different parts of the memory influence the final result of the program. Denote by e1 , . . . en a standard basis of the memory space V and by x1 , . . . xn the dual basis of V ∗ . The functions xi are coordinate functions on V and correspond to individual locations(variables) in the program memory. 4 Operational Calculus on Programming Spaces Definition 5 For each program P in the programming space F < V V , we define the input or parameter space IP < V and the output space OP < V to be the minimal vector subspaces spanned by the standard basis vectors, such that the map Pe , defined by the following commutative diagram P V (9) prOP ~i 7→ ~i + f~ IP V Pe OP does not depend of the choice of the element f~ ∈ FP = (IP + OP )⊥ . The space FP = (IP + OP )⊥ is called free space of the program P . The variables xi corresponding to standard basis vectors spanning the parameter, output and free space are called paramters or input variables, output variables and free variables correspondingly. Free variables are those that are left intact by the program and have no influence on the final result other than their value itself. The output of the program depends only on the values of the input variables and consists of variables that have changed during the program. Input parameters and output values might overlap. The map Pe is called the effective map of the program P and describes the actual effect of the program P on the memory ignoring the free memory. The derivative of the effective map is of interest, when we speak about differentiability of computer programs. Definition 6 (Automatically differentiable programs) A program P : V → V is automatically differentiable if there exist an embedding of the space OP ⊗ IP∗ into the free space FP , and a program (1 + ∂P ) : V → V, such that its effective map is the map Pe ⊕ ∂Pe : IP → OP ⊕ (OP ⊗ I ∗ ). (10) A program P : V → V is automatically differentiable of order k if there exist a program τk P : V → V, such that its effective map is the map  k⊗  Pe ⊕ ∂Pe ⊕ . . . ∂ k Pe : IP → OP ⊕ (OP ⊗ I ∗ ) ⊕ . . . OP ⊗ Ip∗ . (11) If a program P : V → V is automatically differentiable then it is also differentiable as a map V → V. However only the derivative of program’s effective map can be implemented as a program, since the memory space is limited to V. To be able to differentiate a program to the k-th order, we have to calculate and save all the derivatives of the orders k and less. 4. Differentiable Programming Spaces Motivated by the Definition 6, we define virtual memory for differentiable programs as a sequence of vector spaces with the recursive formula (12) V0 = V ∗ Vk = Vk−1 + (Vk−1 ⊗ V ) . 5 (13) Sajovic and Vuk Note that the sum is not direct, since some of the subspaces of Vk−1 and Vk−1 ⊗ V ∗ are naturally isomorphic and will be identified3 . The space that satisfies the recursive formula (13) is   (14) Vk = V ⊗ K ⊕ V ∗ ⊕ (V ∗ ⊗ V ∗ ) ⊕ . . . (V ∗ )⊗k = V ⊗ Tk (V ∗ ), where Tk (V ∗ ) is a subspace of tensor algebra T (V ∗ ), consisting of linear combinations of tensors of rank less or equal k. This construction enables us to define all the derivatives as maps with the same domain and codomain V → V ⊗ T (V ∗ ). Putting memory considerations aside, we propose an universal model of the memory for differentiable programs. Definition 7 (Virtual memory) Let (V, F) be an Euclidean virtual machine and let V∞ = V ⊗ T (V ∗ ) = V ⊕ (V ⊗ V ∗ ) ⊕ . . . , (15) where T (V ∗ ) is the tensor algebra of the dual space V ∗ . We call V∞ the differentiable virtual memory of a virtual computing machine (V, F). The term virtual memory is used as it is only possible to embed certain subspaces of V∞ into memory space V, making it similar to virtual memory as a memory management technique. We can extend each program P : V → V to the map on universal memory space V∞ by setting the first component in the direct sum (15) to P , and all other components to zero. Similarly derivatives ∂ k P can be also seen as maps from V to V∞ by setting k-th component in the direct sum (15) to ∂ k P and all others to zero. 4.1 Differentiable Programming Spaces Let us define the following function spaces: Fn = {f : V → V ⊗ Tn (V ∗ )} (16) All of these function spaces can be seen as sub spaces of F∞ = {f : V → V ⊗ T (V ∗ )}, since V is naturally embedded into V ⊗ T (V ∗ ). The Fréchet derivative defines an operator on the space of smooth maps in F∞ 4 . We denote this operator ∂. The image of any map P : V → V by operator ∂ is its first derivative, while the higher order derivatives are just powers of operator ∂ applied to P . Thus ∂ k is a mapping between function spaces (16) ∂ k : F n → F n+k . (17) Definition 8 (Differentiable programming space) A differentiable programming space P0 is any subspace of F0 such that ∂P0 ⊂ P0 ⊗ T (V ∗ ) (18) The space Pn < Fn spanned by {∂ k P0 ; 0 ≤ k ≤ n} over K, is called a differentiable programming space of order n. When all elements of P0 are analytic, we call P0 an analytic programming space. 3. The spaces V ⊗ (V ∗ )⊗(j+1) and V ⊗ (V ∗ )⊗j ⊗ V ∗ are naturally isomorphic and will be identified in the sum. 4. The operator ∂ may be defined partially for other maps as well, but we will handle this case later. 6 Operational Calculus on Programming Spaces The definition of higher order differentiable programming spaces is justified by the following theorem. Theorem 9 (Infinite differentiability) Any differentiable programming space P0 is an infinitely differentiable programming space, meaning that ∂ k P0 ⊂ P0 ⊗ T (V ∗ ) (19) for any k ∈ N. Proof By induction on order k. For k = 1 the claim holds by definition. Assume ∀P ∈P0 , i the component of the k-th derivative for a multiindex ∂ n P0 ⊂ P0 ⊗ T (V ∗ ). Denote by Pα,k ∗ α denoting the component of T (V ) and an index i denoting the component of V. i ∂ n+1 Pα,k = ∂(∂ n Pαi )k ∧ (∂ n Pαi ) ∈ P0 =⇒ ∂(∂ n Pαi )k ∈ P0 ⊗ T (V ∗ ) (20) =⇒ ∂ n+1 P0 ⊂ P0 ⊗ T (V ∗ ) Thus by induction, the claim holds for all k ∈ N. Corollary 10 A differentiable programming space of order n, Pn : V → V ⊗ T (V ∗ ), can be embedded into the tensor product of the function space P0 and the space Tn (V ∗ ) of multitensors of order less than equal n: Pn < P0 ⊗ Tn (V ∗ ). (21) By taking the limit as n → ∞, we consider P∞ < P0 ⊗ T (V ∗ ), where T (V ∗ ) = tensor series.5 Q∞ k=0 (V ∗ )⊗k (22) is the tensor series algebra, the algebra of the infinite formal 5. Operational Calculus on Programming Spaces By Corollary 10 we may represent calculation of derivatives of the map P : V → V, with only one mapping τ . We define the operator τn as a direct sum of operators τn = 1 + ∂ + ∂ 2 + . . . + ∂ n (23) The image τk P (x) is a multi-tensor of order k, which is a direct sum of the map’s value and all derivatives of order n ≤ k, all evaluated at the point x: τk P (x) = P (x) + ∂x P (x) + ∂x2 P (x) + . . . + ∂xk P (x). (24) The operator τn satisfies the recursive relation: τk+1 = 1 + ∂τk , that can be used to recursively construct programming spaces of arbitrary order. 5. The tensor series algebra is a completion of the tensor algebra T (V ∗ ) in suitable topology. 7 (25) Sajovic and Vuk Proposition 11 Only explicit knowledge of τ1 : P0 → P1 is required for the construction of Pn from P1 . Proof The construction is achieved following the argument (20) of the proof of Theorem 9, allowing simple implementation, as dictated by (25). Remark 12 Maps V ⊗ T (V ∗ ) → V ⊗ T (V ∗ ) are constructible using tensor algebra operations and compositions of programs in Pn . Definition 13 (Algebra product) For any bilinear map · : V × V → V we can define a bilinear product · on V ⊗ T (V ∗ ) by the following rule on the simple tensors: (v ⊗ f1 ⊗ . . . fk ) · (u ⊗ g1 ⊗ . . . gl ) = (v · u) ⊗ f1 ⊗ . . . fk ⊗ g1 ⊗ . . . gl (26) extending linearly on the whole space V ⊗ T (V ∗ ) Theorem 14 (Programming algebra) For any bilinear map · : V × V → V an infinitelydifferentiable programming space P∞ is a function algebra, with the product defined by (26). 5.1 Analytic Virtual Machine We propose an abstract computational model, a virtual machine capable of constructing differentiable programming spaces. Such a machine provides a framework for analytic study of algorithmic procedures by algebraic means. Definition 15 (Analytic virtual machine) The tuple M = hV, P0 i is an analytic, infinitely differentiable virtual machine, where • V is a finite dimensional vector space • V ⊗ T (V ∗ ) is the virtual memory space • P0 is an analytic programming space over V When P0 is a differentiable programming space, this defines an infinitely differentiable virtual machine. Remark 16 The tuple (V, P0 ) and the structure of the tensor series algebra T (V ∗ ) are sufficient to construct infinitely differentiable programing spaces P∞ by linear combinations of elements of P0 ⊗ T (V ∗ ). An illustrative example of the implementation of an analytic virtual machine is available on GitHub (Žiga Sajovic, 2016a). Implementation closely follows theorems and derivations of this paper and is intended as an educational guide for those transitioning from automatic differentiation to this theory. A paper (Žiga Sajovic, 2016b) explaining the process of implementation accompanies the source-code. 8 Operational Calculus on Programming Spaces 5.2 Tensor Series Expansion There exists a space spanned by the set D n = {∂ k ; 0 ≤ k ≤ n} over a field K. Thus, the expression ∞ X (h∂)n h∂ e = n! n=0 is well defined. In coordinates, the operator eh∂ can be written as a series over all multiindices α ∞ X hn X ∂n eh∂ = ei ⊗ dxα1 ⊗ . . . ⊗ dxαn . (27) n! ∂xα1 . . . ∂xαn n=0 ∀i,α The operator eh∂ is a mapping between function spaces (16) eh∂ : P → P∞ . It also defines a map eh∂ : P × V → V ⊗ T (V ∗ ), (28) by taking the image of the map eh∂ (P ) at a certain point v ∈ V. We may construct a map from the space of programs, to the space of polynomials using (28). Note that the space of multivariate polynomials V → K is isomorphic to symmetric algebra S(V ∗ ), which is in turn a quotient of tensor algebra T (V ∗ ). To any element of V ⊗ T (V ∗ ) one can attach corresponding element of V ⊗ S(V ∗ ) namely a polynomial map V → V. Thus, similarly to (22), we consider the completion of the symmetric algebra S(V ∗ ) as the formal power series S(V ∗ ), which is in turn isomorphic to a quotient of tensor series algebra T (V ∗ ), arriving at eh∂ : P × V → V ⊗ S(V ∗ ) (29) For any element v0 ∈ V, the expression eh∂ (·, v0 ) is a map P → V ⊗ S(V ∗ ), mapping a program to a formal power series. We can express the correspondence between multi-tensors in V ⊗ T (V ∗ ) and polynomial maps V → V given by multiple contractions for all possible indices. For a simple tensor u ⊗ f1 ⊗ . . . ⊗ fn ∈ V ⊗ (V ∗ )⊗n the contraction by v ∈ V is given by applying co-vector fn to v 6 u ⊗ f1 ⊗ . . . ⊗ fn · v = fn (v)u ⊗ f1 ⊗ . . . fn−1 . (30) By taking contraction multiple times, we can attach a monomial map to a simple tensor by u ⊗ f1 ⊗ . . . ⊗ fn · (v)⊗n = fn (v)fn−1 (v) · · · f1 (v)u, (31) Both contractions (30) and (31) are extended by linearity to spaces V ⊗ (V ∗ )⊗n and further to V ⊗ T (V ∗ ).7 For a multi-tensor M = m0 + m1 + . . . + mn ∈ V ⊗ Tn (V ∗ ), where mk ∈ 6. For order two tensors from V ⊗ V ∗ the contraction correspons to matrix vector multiplication. 7. Note that the simple order one tensor u ∈ V can not be contracted by the vector v. To be consistent we define u · v = u and attach a constant map v 7→ u to order zero tensor u. The extension of (31) to V ⊗ T (V ∗ ) can be seen as a generalzation of the affine map, where the zero order tensors account for translation. 9 Sajovic and Vuk V ⊗ (V ∗ )⊗k , applying the contraction by a vector v ∈ V multiple times yields a polynomial map M(v) = m0 + m1 · v + . . . + mn · (v)⊗n . (32) Theorem 17 For a program P ∈ P the expansion into an infinite tensor series at the point v0 ∈ V is expressed by multiple contractions ∞   X hn n P (v0 + hv) = (eh∂ P )(v0 ) (v) = ∂ P (v0 ) · (v⊗n ) n! n=0 = ∞ X hn X n=0 n! ∂ n Pi ei · dxα1 (v) · . . . · dxαn (v). (33) ∂xα1 . . . ∂xαn ∀i,α n n d d Proof We will show that dh n (LHS)|h=0 = dhn (RHS)|h=0 . Then LHS and RHS as functions of h have coinciding Taylor series and are therefore equal. =⇒ dn P (v0 + hv) dhn ⇐=  dn  h∂ (e )(P )(v ) (v) 0 dhn ∂ n eh∂ h=0 = = ∂ n P (v0 )(v) h=0 h=0   = (∂ n eh∂ )(P )(v0 ) (v) h=0 ∧ ∞ X i=0 hi ∂ i+n i! = ∂n h=0 =⇒ (∂ n (P )(v0 )) · (v⊗n ) It follows trivially from the above theorem that the operator eh∂ is an automorphism of the programming algebra P∞ , eh∂ (p1 · p2 ) = eh∂ (p1 ) · eh∂ (p2 ) (34) where · stands for any bilinear map. Remark 18 (Generalized shift operator) The operator eh∂ : P × V → V ⊗ T (V ∗ ) evaluated at h = 1 is a broad generalization of the shift operator (Wiener, 1926). The theory presented in this section offers more than a mere shift, which will become apparent in the coming sections. For a specific v0 ∈ V, the generalized shift operator is denoted by e∂ |v0 : P → V ⊗ T (V ∗ ) When the choice of v0 ∈ V is arbitrary, we omit it from expressions for brevity. 10 Operational Calculus on Programming Spaces Remark 19 Independence of the operator (28) from a coordinate system, translates to independence in execution. Thus the expression (33) is invariant to the point in execution of a program, a fact we explore in Section 5.8. Remark 20 Corollary 10 through (22) implies eh∂ (P0 ) ⊂ P0 ⊗T (V ∗ ) which enables efficient implementation by operator τ . 5.3 Operator of Program Composition In this section both forward (e.g, Khan and Barton, 2015) and reverse (e.g., Hogan, 2014) mode of automatic differentiation are generalized to arbitrary order under a single invariant operator in the theory. We demonstrate how to perform calculations on operator level before they are applied to a particular programming space, condensing complex notions to simple expressions. Theorem 21 (Program composition) Composition of maps P is expressed as (35) eh∂ (f ◦ g) = exp(∂f eh∂g )(g, f ) where exp(∂f eh∂g ) : P × P → P∞ is an operator on pairs of maps (g, f ), where ∂g is differentiation operator applied to the first component g, and ∂f to the second component f . n n d d Proof We will show that dh n (LHS)|h=0 = dhn (RHS)|h=0 . Then LHS and RHS as functions of h have coinciding Taylor series and are therefore equal. =⇒ d lim ( )n e∂ (f ◦ g) = lim ∂ n eh∂ (f ◦ g) khk→0 khk→0 dh =⇒ (36) ∂ n (f ◦ g) ⇐= h∂g exp(∂f e ) = exp ∂f ∞ X (h∂g )i i! i=0 ! = ∞ Y i=1 e∂f (h∂g )i i!   e∂f =⇒ X X Y  ∂f ∂gl (g) k 1    exp(∂f eh∂g )(g, f ) = hn e∂f f l! k! ∀n λ(n) k·l∈λ where λ(n) stands for the partitions of n. Thus lim ( khk→0 X Y  ∂f ∂gl (g) k 1    d n e∂f f ) exp(∂f eh∂g ) = n! dh l! k! (37) k·l∈λ λ(n) taking into consideration the fact that e∂f (f ) evaluated at a point v ∈ V is the same as evaluating f at v, the expression (37) equals (36) by Faà di Bruno’s formula. lim ( khk→0  X Y  ∂f ∂gl (g(v)) k 1  d n f (g(v)) ) exp(∂f eh∂g ) = n! dh l! k! λ(n) k·l∈λ 11 (38) Sajovic and Vuk The Theorem 21 enables an invariant implementation of the operator of program composition in Pn , expressed as a tensor series through (35) and (37). By fixing the second map g in exp(∂f eh∂g ) : P × P → P∞ , (39)   exp(∂f eh∂g )(·, g) = g∗ eh∂ (40) the operator is the pullback through g of the generalized shift operator eh∂ . While by fixing the first map f in (39), the operator   (41) exp(∂f eh∂g )(f, ·) = f∗ eh∂ is the push-forward through f of the generalized shift operator eh∂ . Remark 22 (Unified AD) If a program is written as P = Pn ◦ . . . P1 , than applying the operators exp(∂f eh∂g )(·, Pi ) from i = 1 to i = n and projecting onto the space spanned by {1, ∂} is equivalent to forward mode automatic differentiation, while applying the operators exp(∂f eh∂g )(Pn−i+1 , ·) in reverse order (and projecting) is equivalent to reverse mode automatic differentiation. Both forward and reverse mode (generalized to arbitrary order) are obtainable using the same operator (39), by fixing the appropriate map f or g. This generalizes both concepts under a single operator. Remark 23 The operator (35) can be generalized for the notion of a pullback to arbitrary operators. Thus, through (35) and all its’ descendants (exponents), the operator (40) grants invariance to the point in execution of a program, which is important when proving algorithm’s correctness. This is analogous to the principle of general covariance (see section 7.1 in a book by O’Hanian et al., 1994) in general relativity, the invariance of the form of physical laws under arbitrary differentiable coordinate transformations. Corollary 24 The operator eh∂ commutes with composition over P eh∂ (p2 ◦ p1 ) = eh∂ (p2 ) ◦ eh∂ (p1 ) Proof Follows from (29) and Theorem 21. Remark 25 With explicit evaluations in Corollary 24 eh∂ |v0 (pn ◦ · · · ◦ p0 ) = eh∂ |vn (pn ) ◦ · · · ◦ eh∂ |v0 (p0 ) the wise choice of evaluation points is vi = pi−1 (vi−1 ) ∈ V. 12 Operational Calculus on Programming Spaces With this we turn towards easing such calculations, completing them on the level of d of (40) is operators. The derivative dh d exp(∂f eh∂g )(g) = ∂f (∂g g)eh∂g exp(∂f eh∂g )(g) dh (42) We note an important distinction to the operator eh∂g , the derivative of which is d h∂g e = ∂g eh∂g dh (43) We may now compute derivatives (of arbitrary order) of the pullback operator. 5.4 Example of an Operator Level Computation As an example we compute the second derivative.  d dh 2      d  ∂f (∂g g)eh∂g exp ∂f eh∂g (g) exp ∂f eh∂g (g) = dh which is by equations (42) and (43), using algebra and correct applications  ∂f (∂g2 g) eh∂g exp(∂f eh∂g )(g) + (∂f2 (∂g g)2 )e2h∂g exp(∂f eh∂g )(g) (44) The operator is always shifted to the evaluating point (28) v ∈ V, thus, only the behavior in the limit as h → 0 is of importance. Taking this limit in the expression (44) we obtain the operator  ∂f (∂g2 g) + ∂f2 (∂g g)2 exp(∂f ) : P → ∂ 2 P(g) Thus, without imposing any additional rules, we computed the operator of the second derivative of composition with g, directly on the level of operators. The result of course matches the equation (37) for n = 2. As it is evident from the example, calculations using operators are far simpler, than direct manipulations of functional series, similar to how it was done in the proof of Theorem 21. This enables a simpler implementation that functions over arbitrary programming (function) spaces. In the space that is spanned by {∂ n P0 } over K, derivatives of compositions may be expressed solely through the operators, using only the product rule (34), the derivative of the composition operator (42) and the derivative of the general shift operator (43). Thus, explicit knowledge of rules for differentiating compositions is unnecessary, as it is contained in the structure of the operator exp(∂f eh∂g ) itself, which is differentiated using standard rules, as shown by this example. Similarly higher derivatives of the composition can also be computed on the operator level:  n   d n exp ∂f eh∂g (g, f ) . (45) ∂ (f ◦ g) = dh h=0 13 Sajovic and Vuk 5.5 Order Reduction for Nested Applications It is useful to be able to use the k-th derivative of a program P ∈ P as part of a different differentiable program P1 . As such, we must be able to treat the derivative itself as a differentiable program P ′k ∈ P, while only coding the original program P . Theorem 26 (Order reduction) There exists a reduction of order map φ : Pn → Pn−1 , such that the following diagram commutes φ Pn Pn−1 ∂ (46) ∂ φ Pn+1 Pn satisfying  k ∀P1 ∈P0 ∃P2 ∈P0 φ ◦ e∂n (P1 ) =  e∂n−k (P2 ) for each n ≥ 1, where e∂n is the projection of the operator e∂ onto the set {∂ n }. Corollary 27 (Differentiable derivative) By Theorem 26, n-differentiable k-th derivatives of a program P ∈ P0 can be extracted by n P k′ = φk ◦ e∂n+k (P ) ∈ Pn We gained the ability of writing a differentiable program acting on derivatives of another program, stressed as crucial (but lacking in most models) by Pearlmutter and Siskind (2008a). Usage of the reduction of order map and other constructs of this Section are demonstrated in Section 7. 5.6 Functional Transformations of Programs Let’s suppose a hardware H is optimized for the set of functions F = {fi : V → V}. The set F is specified by the manufacturer. With technological advances, switching the hardware is common, which can lead to a decline in performance. Thus, we would like to employ transformations of a program P ∈ P in basis F . It is common to settle for a suboptimal algorithm, that is efficient on hardware H. Sub-optimality of the algorithm depends on the set F , whether it spans P or not. A classic example of a transformation of basis is the Fourier transform. Using the developed tools, the problem is solvable using linear algebra. Let e∂n denote the projection of the operator e∂ , onto the first n basis vectors {∂ i }. By Theorem 17 a map (29) from the space of programs, to the space of polynomials, with unknowns in V k , can be constructed using the operator e∂ . Let X = {pi } denote a basis of the space of polynomials V → V 8 . We can interpret e∂n (P ∈ P) as a vector of linear combinations of X . 8. One choice would be the monomial basis, consisting of elements ei ⊗ Q α,∀j V ∗ and α multi-index 14 xαj , where ei span V, xi span Operational Calculus on Programming Spaces We define the tensor TX F of basis transformation F → X by TX F = p1 ⊗ e∂n (f1 )∗ + p2 ⊗ e∂n (f2 )∗ + . . . + pn ⊗ e∂n (fn )∗ . (47) The tensor of basis transformation X → F is the inverse TF X = TX−1F . (48) For a specific set F (and consequentially a hardware H, upon which the set F is conditioned), the tensor (48) only has to be computed once, and can then be used for transforming arbitrary programs (while using the same operator e∂n ). The coordinates of program P ∈ P in basis F are PF = TF X · e∂ (P ) (49) The expression (49) represents coordinates of program P in basis F . Thus, the program is expressible as a linear combination of fi , with components PF as coefficients. P = n X PF i fi i=0 If F does not span P, or we used the projection of the operator e∂n<N , the expression PF still represents the best possible approximation of the original program, on components {∂ n }, in basis F . Remark 28 It makes sense to expand the set F , by mutual (nested) compositions, and gain mappings before computing the tensor (48) and increase the power of the above method. 5.7 Special Case of Functions V → K We describe a special case when P0 = V ⊗ P−1 and P−1 < K V is a subspace of the space of functions V → K. This is useful, if the set F only contains functions V → K. It is very common, that basic operations in a programming language change one single real valued variable at a time. In that case, the value of changed variable is described by the function f˜ : V → K, while the location, where the value is saved is given by a standard basis vector ei . The map f : V → V is then given as a tensor product f = ei ⊗ f˜. We can start the construction of the differentiable programming spaces by defining differentiable programming space of functions V → K instead of maps V → V as in definition 8. Analog to the the Theorem 9 and Corollary 10 it is easy to verify, that ∂ k P−1 < P−1 ⊗ Tk (V ∗ ). (50) Since tensoring with elements of V commutes with differentiation operator ∂ ∂ k P0 < V ⊗ ∂ k P−1 (51) and analytic virtual machine can be defined in terms of functions P−1 , enabling more efficient implementation of the operators ∂ and e∂ . The functional transformation becomes much more efficient, since the set of functions F can be generated by the functions of the form f = ei ⊗ f˜j , where F−1 = {f˜j : V → K}. 15 Sajovic and Vuk Theorem 29 Suppose that P0 = V ⊗ P−1 where P−1 is a subspace of functions V → K. Suppose that F = {ei ⊗ f˜j } and X = {el ⊗ p˜k } is the basis of the space of polynomial maps V → V while X−1 = {pk } is the basis of polynomial functions V → K. Then the matrix TX F is block diagonal with the same block along the diagonal X TX−1 F−1 = pk ⊗ e∂n (f˜j ). (52) k,j Corollary 30 When the tensor TX F (48) of basis transformation F → X is block diagonal as by Theorem 29, the tensor TF X = TX−1F (47) of basis transformation X → F is found by simply inverting each block (52). Note however, that this special case can not model basic operations that change several memory locations at once, while the general model presented in this paper can. Also note that the main goal of this work is to develop methods for analysis of computer programs, making the programming spaces of maps V → V much more appropriate than the programming spaces of functions. 5.8 Control Structures Until now, we restricted ourselves to operations, that change the memories’ content. Along side assignment statements, we know control statements (ex. statements if, for, while, ...). Control statements don’t directly influence values of variables, but change the execution tree of the program. This is why we interpret control structures as a piecewise-definition of a map (as a spline). Each control structure divides the space of parameters into different domains, in which the execution of the program is always the same. The entire program divides the space of all possible parameters to a finite set of domains {Ωi ; i = 1, . . . k}, where the programs’ execution is always the same. As such, a program may in general be piecewise-defined. For ~x ∈ V  Pn1 1 ◦ P(n1 −1)1 ◦ . . . P11 (~x); ~x ∈ Ω1     Pn 2 ◦ P(n −1)2 ◦ . . . P12 (~x); ~x ∈ Ω2 2 2 (53) P (~x) = . ..  .. .    Pnk k ◦ P(nk −1)k ◦ . . . P1k (~x); ~x ∈ Ωk The operator e∂ (at some point) of a program P , is of course dependent on initial parameters ~x, and can also be expressed piecewise inside domains Ωi  e∂ Pn1 1 ◦ e∂ P(n1 −1)1 ◦ . . . ◦ e∂ P11 (~x); ~x ∈ int(Ω1 )     e∂ Pn 2 ◦ e∂ P(n −1)2 ◦ . . . ◦ e∂ P12 (~x); ~x ∈ int(Ω2 ) 2 2 (54) e∂ P (~x) = . .. ..   .    ∂ e Pnk k ◦ e∂ P(nk −1)k ◦ . . . ◦ e∂ P1k (~x); ~x ∈ int(Ωk ) Theorem 31 Each S program P ∈ P containing control structures is infinitely-differentiable on the domain Ω = int(Ωi ). ∀i 16 Operational Calculus on Programming Spaces e∂ P1 TF X e∂ (P1 ) TF X · e∂ (P1 ) Branching e∂ P2 P3 e∂ e∂ (P2 ) e∂ (P3 ) TF X TF X · e∂ (P2 ) TF X TF X · e∂ (P3 ) Figure 1: Transformation diagram Proof Interior of each domain Ωi is open. As the entire domain Ω = S int(Ωi ) is a union of ∀i open sets, it is therefore open itself. Thus, all evaluations are computed on some open set, effectively removing boundaries, where problems might have otherwise occurred. Theorem follows directly from the proof of Theorem 9 through argument (20). Branching of programs into domains (53) is done through conditional statements. Each conditional causes a branching in programs’ execution tree. Proposition 32 Cardinality of the set of domains Ω = {Ωi } equals |{Ωi }| = 2k , where k is the number of branching point within the program. Remark 33 Iterators, that do not change exit conditions within its’ body, do not cause branching. This section concerns itself with employing the derived theorems to propose a linear treatment of branchings and avoid the exponential threat of Proposition 32 to applications of the theory. Theorem 34 A program P ∈ P can be equivalently represented with at most 2n + 1 applications of the operator e∂ , on 2n + 1 analytic programs, where n is the number of branching points within the program. Proof Source code of a program P ∈ P can be represented by a directed graph, as shown in Figure 1. Each branching causes a split in the execution tree, that after completion returns 17 Sajovic and Vuk to the splitting point. By Theorem 21, each of these branches can be viewed as a program pi , for which it holds e∂ (pn ◦ pn−1 ◦ · · · ◦ p1 ) = e∂ (pn ) ◦ e∂ (pn−1 ) ◦ · · · ◦ e∂ (p1 ) by Theorem 21. Thus, the source code contains 2n differentiable branches, from its’ first branching on, not counting the branch leading up to it, upon which the application of the operator e∂ is needed. Total of 2n + 1. By Theorem 9, each of these branches is analytic. Remark 35 Images of the operator e∂ and TF X are elements of the original space P, which may be composed. Thus for P = p3 ◦ p2 ◦ p1 , the following makes sense   P = p3 ◦ e∂ (p2 ) ◦ TF X e∂ (p1 ) ∈ P The same holds true for all permutations of applications of operators e∂ , TF X and id, as visible in Figure 1. Remark 36 In practice, we always use projections of the operator e∂ to some finite order n, resulting in e∂n . Therefore, we must take note that the following relation holds e∂m (P2 ) ◦ e∂n (P1 ) = e∂k (P2 ◦ P1 ) ⇐⇒ 0 ≤ k ≤ min(m, n) when composing two images of the applied operator, projected to different subspaces. The transformation tensor TF X is needed to be computed only once and can then on be applied to any program running on said hardware. The same holds true for each branch pi , which can, by Theorem 24, be freely composed amongst each other. Remark 37 Images of the operator e∂ (P ∈ P0 ) are elements of V⊗T (V ∗ ) by (28), consisting of multi-linear maps. As such, their evaluation and composition (e∂ (P1 ) ◦ e∂ (P2 )) is tailor made for efficient implementation by methods of parallelism (e.g., Abdelfattah and et al., 2016), with computable complexities. 6. Generalized Tensor Networks Let W = n P (wi ∈ V ⊗ V ∗⊗i ) be an element of the virtual memory V ⊗ Tn (V ∗ ) in an analytic i=0 machine of Definition 15. The element W can be seen as a map v 7→ W(v) as defined by (31): n X wi · v⊗i ∈ V. W(v) = i=0 Definition 38 A general tensor network N is a sequence of maps Li : V → V called layers, defined recursively by the equation L0 = id; Li+1 = Φi ◦ Wi ◦ Li 18 Operational Calculus on Programming Spaces where Wi ∈ function. n L V ⊗ V ∗k⊗ are the weights (and the bias) and Φi ∈ P0 is the activation k=0 We may look at a general tensor network with n layers as a map. In that case we mean N = Ln ∈ P0 . Remark 39 The common neural network is a tensor network with bi + Wi ∈ V ⊕ V ⊗ V ∗ as weight multi-tensors. Generalizations of recurrent (Socher et al., 2011), convolutional (Krizhevsky et al., 2012) and deep residual (He et al., 2015) neural networks, and mechanisms such as long short term memory (Hochreiter and Schmidhuber, 1997), are easily generated by this model, as they are all elements of a differential programming space P0 . A general tensor network N can be represented by a deeper common neural network. This equivalence means, that a general tensor network with fewer layers can provide the same results as a deeper common neural network, while mitigating the vanishing gradient problem described by Pascanu et al. (2013) that occurs in training due to the depth of the network coupled with machine precision. Remark 40 Existing architectures like Theano by Theano Development Team (2016), TensorFlow by Abadi and et al. (2015) and others could be easily adapted to handle general tensor networks. 6.1 Programs as General Tensor Networks Let P = Pn ◦ · · · ◦ P0 ∈ P0 be the procedure of interest, with Pi ∈ P0 being the source code between two branching points, like shown in Figure 1. By Theorem 17 we have P (v0 + v ∈ V) = e∂ |v0 P (v ∈ V) (55) P (v0 + v ∈ V) = e∂ |vn Pn ◦ · · · ◦ e∂ |v0 P0 (v ∈ V) (56) and through Corollary 24 which is the transformation hereon denoted by e∂ P . Proposition 41 The image of the application of the operator e∂ to a program P ∈ P0 as in (56), is a general tensor network, with the activation function Φi being the identity map, at each layer. 6.1.1 Transformations of Programs to General Tensor Networks The transformed program (55) equals the original program by Theorem 17 and Corollary 24. But in practice, we are always working with a finite virtual memory V ⊗ Tn (V ∗ ) and the equality becomes an approximation. Thus we treat the transformation of the original program, as the initialization of the weights (and the bias) of a general tensor network to be trained. This motivates modernizing the historic Taylor series and evolving the generalized shift operator (18). 19 Sajovic and Vuk Definition 42 (Neural tensor series) Assume the program P ∈ P0 can be written as a composition P = Pn ◦ · · · ◦ P0 ∈ P0 . A general tensor network NΦ |v0 P defined with a set of activation functions Φ = {Φk ∈ P0 : V → V; 0 ≤ k ≤ n} and weights Wk = e∂N |vk Pk ; vk = Pk ◦ · · · P0 (v0 ) is called neural tensor series of order N for a program P at a point v0 with activation functions Φ with final layer NΦ |v0 P = Φn ◦ e∂N |vn Pn ◦ · · · ◦ Φ0 ◦ e∂N |v0 P0 . (57) Remark 43 Neural tensor series transforms a common program to a trainable general tensor network, naturally extending Theorem 34 and the Transformation diagram of Figure 1. For example, by setting N = 1 in (57) a program can be transformed to a common neural network. Definition 42 has wide applications to different fields. In practice if a sub-optimal algorithm providing an approximate solution is available, the neural tensor series serves as a great initialization point for further training, leading to a process of boosting (Freund and et al., 1999) converting a weaker learner to a strong one. As currently neural networks give best results to many problems, the described method is likely to provide improvements to existing methods. As each general tensor network is a neural tensor series of some program, it provides an elegant way of expressing neural computations through operational calculus. This has direct implications to the study and understanding of concepts such as differentiable neural computers (Graves and et al., 2016) and neural programmer-interpreters (Reed and de Freitas, 2016). Interchanging neural processes and programming spaces reveals new directions to explore, as we might gain insight on one by identifying it with the other. By this equivalence, the relation between a computer program and a general tensor network is that of a function and its Taylor series enhanced by activations. Thus, they may be appropriately employed to the purpose of analysis in computer science, a path well walked by other fields. Remark 44 All coefficients Wi ∈ V ⊗ T (V ∗ ) are multi-linear maps allowing efficient implementation through GPU parallelism as by Claim 37. Thus, general tensor networks may employ it, just as the common neural networks they generalize do. 6.1.2 Compositions of Tensor Networks with General Programs Methods for control structures and branching presented in Section 5.8 apply to general tensor networks. Proposition 45 An arbitrary P ∈ P0 can be composed with general tensor networks Ni P̃ = N2 ◦ P ◦ N1 ∈ P∞ (58) and P̃ is an element of a differentiable programming space P∞ , and can thus be treated by the operational calculus. 20 Operational Calculus on Programming Spaces Remark 46 Any layer Li ∈ Pn can be composed with an arbitrary element of the differentiable programming space P0 . This allows algorithmic coding of trainable memory managers, generalizing concepts such as long short term memory (Hochreiter and Schmidhuber, 1997) and easing the implementation of networks capable of reading from and writing to an external memory (Graves and et al., 2016), by freeing semantics of their design process. 6.2 Training of General Tensor Networks All transformed programs NΦ |v0 P are elements of a differentiable programming space P∞ . As such, the operational calculus, and the operators it offers can freely be applied to them. By Corollary 24 we have e∂n (Li+1 ) = e∂n (Φi ) ◦ e∂n (Wi ◦ Li ) ∈ Pn (59) Thus by Corollary 27, the n-differentiable k-th derivatives can be extracted by n k′ Li+1 = φk ◦ e∂n+k (Li+1 ) ∈ Pn from (59), where φ is the reduction of order map of Theorem 26. Derivatives of specific order are extracted by projecting on components of Pn , and can be used in any of the well established training methods in the industry. Proposition 47 Using the operator exp(∂f eh∂g ) of Theorem 21, both forward and reverse mode automatic differentiation (generalized to arbitrary order) can be implemented on general tensor networks. Remark 48 The operational calculus can be applied to the training process T ∈ P0 of a general tensor network itself, as it is an element of a differentiable programming space P0 . Thus, hyper-parameters of the training process can be studied (e.g., Bengio, 2000), analyzed and trained (e.g., Thornton and et al., 2013), as to be adapted to the particulars of the problem being solved. By Proposition 45, any training methods enabled by the operational calculus presented in this paper apply to all compositions of general tensor networks Ni with arbitrary programs P ∈ P. This allows seamless trainable transitions between code formulations, naturally extending the Transformation diagram of Figure 1. 7. Analysis Operational calculus offers new approaches to program analysis that are the object of study in this section. We demonstrate how to intertwine algorithmic control flow, operational calculus and algebra. 7.1 Study of Properties We will denote the fact, that some object v has the property X, by v ∈ X. Suppose we have v∈ / X, and desire a procedure P ∈ P0 , that in some way modifies v to have the property X, changing the element v as little as possible: P ∈ P0 : v ∈ / X → P (v) ∈ X 21 (60) Sajovic and Vuk Usually such procedures are difficult to construct and may not even explicitly exist. An easier task is to construct a procedure T ∈ P0 , whose output allows deduction of whether v has the property X or not. We propose an algorithm A:T ∈P →P ∈P (61) transforming a procedure T testing for a property Xj , to a procedure P ∈ P0 : v ∈ / Xj → P (v) ∈ Xj imposing that property onto any object in the domain Ω ⊂ V. We employ operational calculus as we probe procedures’ inner structure and explore how it interacts with the elements of the domain. 7.1.1 Activity Profiles and Property Measures To be able to determine which conceptual steps are the most important for the result of the testing procedure T , we have to somehow measure the activity at that step. A simple example of the measure of activity A could simply be the norm of the appropriate derivative, as it measures the rate of change. Let’s assume T = Tn ◦ Tn−1 ◦ · · · ◦ T1 for simplicity9 . The part Ti is called a conceptual step in the procedure. Definition 49 (Activity profile) The function Ai : Ω → [0, 1] is called a measure of activity in the conceptual step Ti . The value Ai ◦ e∂Ti T (v) is the activity level of Ti for a given element of the domain v ∈ Ω taken as the input of T 10 . The vector A = (A1 , A2 , . . . , An ) : Ω → [0, 1]n represents the activity profile of the procedure T . Definition 50 (Property measure) A function MX ∈ P0 : [0, 1]n → [0, 1] is called the property measure, measuring the amount of property X in an object v ∈ Ω, if there exists c ∈ (0, 1) such that v ∈ X ⇐⇒ Mx ◦ A(v) ≥ c. 9. The procedure T could also be piecewise-differentiable as in (53), by specific Ti containing a control structure as is ilustrated in Figure 1 10. The operator e∂Ti considers only the variable parameters of the sub-procedure Ti as variables 22 Operational Calculus on Programming Spaces Algorithm 1 Construct property measure 1: procedure Construct property measure 2: for each vk ∈ Ω do 3: for each Ti do 4: extract aik = Ai ◦ e∂Ti T (vk ) 5: end for 6: end for 7: initialize set I 8: for each Xj do 9: generate property measure MXj from aik 10: add MXj to I 11: end for 12: return I 13: end procedure Once the activity profiles and property measures are generated, starting with an element, without the property Xj , we can use any established optimization technique, to optimize and increase the measure MXj . When the increase of the measure MXj is sufficient, this results in an new object possessing the property Xj . Theorem 51 With an appropriate choice of the activity profile A, the Algorithm 2 transforms a procedure T ∈ P, testing for a property Xj , to a procedure P , that increases the property measure of any object in the domain. Corollary 52 By Theorem 51, existence of a procedure testing an object for validity is sufficient for constructing a procedure transforming a non-valid object to a valid one P ∈ P0 : v ∈ / Xj → P (v) ∈ Xj under the assumption that the increase of the property measure is sufficient. When T serves as a simulation, with v modeling a real-life object of study, the procedure opens new doors in analyzing real-life phenomena. We may observe how v evolves through iterations and study stages of change, which serves as a useful insight when designing procedures causing change in real-life phenomena. 23 Sajovic and Vuk Algorithm 2 Appoint property Xj to v ∈ Ω 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: procedure Appoint property Xj to v ∈ Ω initialize path γ with v for each step do for each Ti ∈ TXj do extract Ti′ = φ ◦ e∂2v (Ti ◦ · · · ◦ T1 ) ∈ P1 compute the energy Ei = e∂1v (MXj ) ◦ Ti′ ∈ P1 extract the derivative ∂v Ei = pr{∂} (Ei ) add ∂v Ei to ∂v E end for update v by step(∂v E, v) insert v to γ end for return γ end procedure 7.1.2 Example The derived procedures P given by Algorithm 2 are generalizations of methods already present in practice. This example demonstrates how the method can be employed. We take the measure of activity to be the norm of the derivative with respect to the variable parameters in sub-procedure Ti .   ∂ T k∂Ti T k = pr{∂} e1 i (T ) Then for each property Xj we select the set of sub-procedures TXj = {Ti ∈ TXj ⇐⇒ k∂Ti T k ≥ c} that have the highest measure of activity at the elements of Xj . The property measure for the property Xj is then simply the sum of squares of norms of the derivatives of selected sub-procedures T1i = Ti ◦ · · · ◦ T1 . This completes Algorithm 1. By Corollary 27, n-differentiable k-th derivatives n Tik′ ∈ Pn with respect to the input v ∈ Ω are computed by n v (T1i ) ∈ Pn Tik′ = φk ◦ e∂n+k where φ is the reduction of order map of Theorem 26. Using k·k2 ∈ P1 as the norm map, the property measure is MXj = X Ti′ 2 ∈ P1 Ti ∈TXj assuming it only needs to be once differentiable. Optimization of the property measure completes Algorithm 2. When T ∈ P0 represents a neural network, Ti stands for a specific layer in the network, with neurons being its variable parameters, the Algorithm 2 gives a procedure, that acts 24 Operational Calculus on Programming Spaces similarly to Google’s Deep Dream Project (see Mordvintsev et al., 2015) and Neural Algorithm of Artistic Style by Gatys et al. (2015), as they are special cases of Algorithm 2. However Algorithm 2 may be applied to any program T ∈ P0 , not just neural networks. 8. Conclusions Existence of a program is embedded in a virtual reality, forming a system of objects undergoing change in a virtual space. Just as the reality inhabited by us is being studied by science, revealing principles and laws, so can the virtual reality inhabited by programs. Yet here lies a tougher task, as the laws of the system are simultaneously observed and constructed; the universe is bug-free, up to philosophic precision, while our programs are not. This reinforces the need for a language capable of not only capturing, but also constructing digital phenomena, a feat demonstrated by analytic virtual machines and operational calculus. Inspired by the endeavors of Feynman (1951) and Heaviside (see Carson, 1922) in physics before us, we applied operational calculus to programming spaces, allowing analytic conclusions through algebraic means, easing implementation. It yielded the operator of program composition, generalizing both forward and reverse mode of automatic differentiation to arbitrary order, under a single operator in the theory. Both the use of algebra and operational calculus were demonstrated, as calculations and manipulations were performed on the operator level, before the operator is applied to a particular program. The language presented in this work condenses complex notions into simple expressions, enabling formulation of meaningful algebraic equations to be solved. In doing so, functional transformations of programs in arbitrary function basis’ were derived, a useful tool when adapting code to the specifics of a given hardware, among other. All such formulations are invariant not only to the choice of a programming space, but also to the point in execution of a program, introducing the principle of general covariance to programming. Offerings of this principle were exploited in designing methods on how transformations are to be interchangeably applied in practice in Section 5.8. These methods allow seamless transitions between transformed forms and original code throughout the program. Operational calculus provides more than mere means to calculating derivatives. Its depth allows merging modern discoveries with known old truths in the form of Neural Tensor series. A construct most useful when coming to terms with the finite horizon beyond which theoretical truths become pragmatic approximations. It allows us to treat the idealistic case deprecated by the finite, as an initial prediction of a model to be trained. This has widespread applicability, as it can be seen as a process of boosting, which already enriched other fields of science. As each general tensor network is a Neural tensor series of some program, we might gain insight on one by identifying it with the other, hopefully further bridging the gap in understanding between continuous and discrete computation. Operational calculus provides a rigorous framework for such discussion, as was briefly explored in the final section, and will be the authors’ next subject of study. 25 Sajovic and Vuk Acknowledgments First author extends his gratitude to dr. Jure Kališnik for proofreading the proofs, and prof. Borut Robič for general guidance through the academia. References Martín Abadi and et al. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. Software available from tensorflow.org. A. Abdelfattah and et al. High-performance tensor contractions for {GPUs}. Procedia Computer Science, 80:108 – 118, 2016. ISSN 1877-0509. International Conference on Computational Science 2016, {ICCS} 2016, 6-8 June 2016, San Diego, California, {USA}. Atilim Gunes Baydin and et. al. Automatic differentiation in machine learning: a survey. 2015. Yoshua Bengio. Gradient-based optimization of hyperparameters. Neural computation, 12 (8):1889–1900, 2000. John R. Carson. The heaviside operational calculus. Bell System Technical Journal, 1(2): 43–55, 1922. ISSN 1538-7305. Richard P. Feynman. An operator calculus having applications in quantum electrodynamics. Phys. Rev., 84:108–128, Oct 1951. Yoav Freund and et al. A short introduction to boosting. Journal-Japanese Society For Artificial Intelligence, 14(771-780):1612, 1999. Leon A. Gatys, Alexander S. Ecker, and Matthias Bethge. A neural algorithm of artistic style. arXiv e-prints, arXiv:1508.06576, 2015. Mark Girolami and Ben Calderhead. Riemann manifold Langevin and Hamiltonian Monte Carlo methods. Journal of the Royal Statistical Society, 2011. Alex Graves and et al. Hybrid computing using a neural network with dynamic external memory. Nature, advance online publication, Oct 2016. ISSN 1476-4687. Article. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. arXiv e-prints, 2015. Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8):1735–1780, 1997. Robin J. Hogan. Fast reverse-mode automatic differentiation using expression templates in c++. ACM Trans. Math. Softw., 40(4):26:1–26:16, July 2014. ISSN 0098-3500. Kamil A. Khan and Paul I. Barton. A vector forward mode of automatic differentiation for generalized derivative evaluation. Optimization Methods and Software, 30(6):1185–1212, 2015. 26 Operational Calculus on Programming Spaces Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pages 1097–1105, 2012. Alexander Mordvintsev, Christopher Olah, and Mike Tyka. Inceptionism: Going deeper into neural networks, 2015. URL https://research.googleblog.com/2015/06/inceptionism-going-deeper-into-neural.html. O’Hanian, Hans C., Ruffini, and Remo. Gravitation and Spacetime (2nd ed.). W. W. Norton, 1994. ISBN 0-393-96501-5. Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio. On the difficulty of training recurrent neural networks. ICML (3), 28:1310–1318, 2013. Barak A. Pearlmutter and Jeffrey M Siskind. Putting the Automatic Back into AD: Part II, Dynamic, Automatic, Nestable, and Fast (CVS: 1.1). ECE Technical Reports., May 2008a. Barak A. Pearlmutter and Jeffrey M Siskind. Putting the Automatic Back into AD: Part I, What’s Wrong (CVS: 1.1). ECE Technical Reports., 2008b. Scott Reed and Nando de Freitas. ternational Conference on Learning http://arxiv.org/pdf/1511.06279v3. Neural programmer-interpreters. Representations (ICLR), 2016. In InURL Richard Socher, Cliff C Lin, Chris Manning, and Andrew Y Ng. Parsing natural scenes and natural language with recursive neural networks, 2011. Theano Development Team. Theano: A Python framework for fast computation of mathematical expressions. arXiv e-prints, arXiv:1605.02688, May 2016. Chris Thornton and et al. Auto-weka: Combined selection and hyperparameter optimization of classification algorithms. In Proceedings of the 19th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 847–855. ACM, 2013. Norbert Wiener. The operational calculus. Mathematische Annalen, 95:557–584, 1926. Žiga Sajovic. dcpp, 2016a. URL https://github.com/zigasajovic/dCpp. Žiga Sajovic. Implementing operational calculus on programming spaces for differentiable computing. arXiv e-prints, arXiv:1612.0273, 2016b. 27
9cs.NE
1 Packet Speed and Cost in Mobile Wireless Delay-Tolerant Networks Riccardo Cavallari† , Stavros Toumpis∗, Roberto Verdone† , and Ioannis Kontoyiannis∗‡ of Electrical, Electronic, and Information Engineering, University of Bologna, Italy ∗ Department of Informatics, Athens University of Economics and Business, Greece ‡ Department of Engineering, University of Cambridge, UK Email: [email protected], [email protected], [email protected], [email protected] arXiv:1801.02229v2 [cs.IT] 28 Feb 2018 † Department Abstract A mobile wireless delay-tolerant network (DTN) model is proposed and analyzed, in which infinitely many nodes are initially placed on R2 according to a uniform Poisson point process (PPP) and subsequently travel, independently of each other, along trajectories comprised of line segments, changing travel direction at time instances that form a Poisson process, each time selecting a new travel direction from an arbitrary distribution; all nodes maintain constant speed. A single information packet is traveling towards a given direction using both wireless transmissions and sojourns on node buffers, according to a member of a broad class of possible routing rules. For this model, we compute the long-term averages of the speed with which the packet travels towards its destination and the rate with which the wireless transmission cost accumulates. Because of the complexity of the problem, we employ two intuitive, simplifying approximations; simulations verify that the approximation error is typically small. Our results quantify the fundamental trade-off that exists in mobile wireless DTNs between the packet speed and the packet delivery cost. The framework developed here is both general and versatile, and can be used as a starting point for further investigation1. Index Terms Delay-tolerant network (DTN), geographic routing, information propagation speed, mobile wireless network. 1 Parts of this work appear, in preliminary form, in [1], [2], [3]. This work has been submitted to the IEEE Transactions on Information Theory. 2 I. I NTRODUCTION In delay-tolerant networks (DTNs), packet delivery delays are often comparable to the time it typically takes for the network topology to change substantially. This means that packets have the opportunity to take advantage of such topology changes. An important class of DTNs is that of mobile wireless DTNs, where communication is over a wireless channel and changes in the topology are due to node mobility. Such networks appear in disparate settings, and may be comprised of sensors, smartphones, vehicles, and even satellites [4]. We propose and analyze a mobile wireless DTN model consisting of an infinite number of nodes moving on an infinite plane. Each node moves with constant speed along a straight line, choosing a new travel direction (from a given distribution) at time instances forming a Poisson process. Nodes move independently of each other. It is assumed that a single information packet needs to travel to a destination located at an infinite distance in a given direction; two modes of travel are possible: wireless transmissions and physical transports on the buffers of nodes. Wireless transmissions are instantaneous, but come at a transmission cost that is a function of the vector specifying the change in the packet location due to the transmission (and not simply the distance covered, therefore the cost may be anisotropic). Physical transports, on the other hand, do not have an associated cost, but they introduce delays. The packet alternates between the two modes of travel using a routing rule selected from a broad class of such rules that are described in terms of two quantities: a forwarding region and a potential function. In this setting, we define two performance metrics that characterize the specific routing rule used. The first one is the packet speed, defined as the limit, as the packet travel time goes to infinity, of the ratio of the distance covered divided by the packet travel time. The second one is the normalized packet cost, defined as the limit, as the packet travel time goes to infinity, of the ratio of the cost incurred divided by the distance covered. Because of the generality and mathematical complexity of this model, in order to compute the values of these two metrics we introduce two simplifying approximations that allow us to use tools from the theory of Markov chains: the Second-Order Approximation of Section III-G, and the Time-Invariance Approximation of Section V-D. Both approximations judiciously introduce renewals in the node mobility process. Under these assumptions, we show that the packet’s travel direction can be described as a discrete-time, continuous-state Markov chain, where each time slot of the chain corresponds either to a packet transmission or to a time interval during which the packet travels along a straight line on the buffer of a node. Under general, natural assumptions on the class of routing rules considered (see Sections III-F, V-A, and VI), we show that the Markov chain is uniformly (geometrically) ergodic, its transition kernel can be precisely identified, and we can compute its unique invariant distribution. The actual values of the two performance metrics can then be computed explicitly in terms of this distribution. Simulations results (see Figs 5, 6 and 7 in Section VII-B) show that the errors introduced by the approximation are modest and typically small; namely, less that 10% on the average for the numerical results we present. Furthermore, the qualitative trends and trade-offs revealed by our analytical results are in all cases confirmed by the simulation experiments. In particular, it is demonstrated that, as expected, the packet can travel faster towards its destination, but only at a higher transmission cost due to the more frequent use of wireless transmissions, and vice-versa. The rest of this paper is organized as follows. In Section II we discuss related work in this field. In Section III we introduce the precise network model and the corresponding performance metrics. The analysis is carried out in Sections IV, V, and VI. In Section VII we present numerical results for a specific setting. Section VIII contains some concluding remarks. Finally, in the Appendix we present some of the more technical proofs and computations. 3 II. R ELATION TO P RIOR W ORK Since Gupta and Kumar’s celebrated work [5] on networks with immobile nodes, their asymptotic analysis has been adapted by various authors to the study of networks of mobile nodes employing both wireless transmissions and physical transports. Notably, in a line of work initiated in [6] and continued by, among others, [7], [8], and [9], trade-offs between throughput and delay were explored. In these works, routing protocols that make use of the direction in which each node is traveling were not considered. Such protocols were examined in [10] for a network of finite area, where mobile nodes move along straight lines and change travel direction at random times forming a Poisson process. There, it was assumed that each node creates packets for an immobile destination whose location is known to them, and nodes employ the Constrained Relative Bearing geographic routing protocol: each packet remains on the buffer of a node when that node is moving effectively enough (i.e., along a sufficiently good direction towards its destination), otherwise the packet is transmitted to a more suitable node whenever such a node is available nearby. This scheme was shown to achieve near-constant throughput per node with bounded delivery delay, asymptotically as the number of nodes in the network increases. Compared to these works that pursue network-wide analysis, we take a more ‘local’ view, focusing on the long-term cost and delay in the forwarding of a single packet, and avoiding the calculation of relevant metrics up to multiplicative constants. Recently, the topic of percolation in mobile wireless networks, i.e., the replication of a single packet across the network through a combination of wireless transmissions and physical transports, has attracted significant interest. In such settings, the packet percolates with finite speed, except in the trivial case when the node density is sufficiently high so that a giant network component exists at any time instant. The problem of computing this speed has been studied, e.g., in [11], where the authors consider two- or higher-dimensional networks with a wide range of mobility models, and in [12], where the replication of the packet is constrained. In the present work we study the travel of a single packet copy towards a specific destination, as opposed to its spread by replication over the whole network; this significantly differentiates both the application of our work and the flavor of our analysis. Numerous works have focused on one-dimensional mobile wireless DTN models, with nodes constrained to move along a common, fixed line. Such models are suitable for vehicular DTNs of cars moving on highways and are motivated in part by questions related to road safety issues. For example, the authors of [13] consider a highway comprising two lanes of vehicles moving in opposite (westbound and eastbound) directions; all vehicles travel with the same speed, and the distances between cars in each lane are exponentially distributed (with different means for the two lanes). There, in their study of the speed with which a single packet travels in the eastbound direction using both modes of transport, the authors identify two distinct regions in the propagation of the packet: depending on the specific values of the problem parameters, either the packet is essentially moving with the speed of the nodes, or its speed increases quasi-exponentially with the node densities. More general versions of such models are studied in [14] and [15]. Compared to these works, our two-dimensional model is significantly more challenging. Moreover, by properly selecting the distribution of the node travel directions, our results can be applied to urban settings where these directions are appropriately constrained. Although all the works mentioned so far are of a mainly theoretical nature, there have been a number of works with simulation studies of hybrid routing protocols that employ both modes of transport. Numerous different protocols have been considered; for example, the Moving Vector (MoVe) protocol [16] favors transmissions to nodes that are scheduled to pass the closest from the destination, whereas the AeroRP protocol [17] favors nodes that are traveling the fastest towards the destination; see [18] and references therein for other such examples. Compared to these works, our analysis gives theoretical results on the performance of a general class of routing protocols. Tools of stochastic geometry have also been employed in studying networks where node mobility is crucial to their performance but, in contrast to all prior work mentioned above, there is no physical transport of data. For example, the authors of [19] investigate a model in which a mobile node moves along a straight line on a plane where stationary base stations (BSs) are placed according to a Poisson point process; the node is in contact with a BS if the two are closer than a threshold distance. In this setting, the authors show that the node comes in contact with the BSs according to an alternating-renewal process; this observation can be used for studying the quality of service (QoS) experienced by the node if it streams video through the BSs and for computing the distribution of download times of files downloaded by the node through the BSs. In [20] the authors study a wireless sensor network comprising mobile sensors distributed on an infinite plane; each sensor moves along a straight line in a fixed random direction and at a random speed, sensing for ‘targets.’ For this model, the authors compute the values 4 of various performance metrics related to the quality of target coverage provided by the network; namely, they compute the percentage of the area covered at any given time instant as well as the time needed for a target located outside the coverage region to be sensed, for both mobile and immobile targets. Finally, in [21] the authors study a network of nodes moving according to independent Brownian motions in Rd ; two nodes are in contact whenever they are within some threshold distance from each other. Here the authors study three important random quantities: the time until a target (mobile or immobile) comes in contact with any of the nodes, the time until the nodes come in contact with all points in a given subset, and the time until a target comes in contact with a node belonging to a giant network component. Although all these works do not involve the physical transport of information, the tools we develop in this work may be applicable to many of the scenarios they consider. For example, the incidence rates derived in Section V can be used in a mobile sensor setting to compute the rate with which a mobile sensor with an arbitrary sensing region encounters targets. As already mentioned, the mathematical complexity of our two-dimensional network model and the generality of the routing protocols we consider have necessitated the use of approximations. An alternative approach is to avoid approximations altogether, arriving at exact results, but starting with a much simpler network model. This is the approach taken in [22], where a one-dimensional discrete-time network is studied. There, the network consists of n locations, arranged on a ring, on which two mobile nodes perform independent random walks. A single packet travels in the clockwise direction on the buffer of one of the nodes, and it only gets transmitted from one node to the other when these are collocated, the current packet carrier is moving in the counter-clockwise direction, and the other node is traveling in the clockwise direction. Using probabilistic tools from the theory of Markov chains, explicit expressions are derived for the long-term average packet speed and for the steady-state average number of wireless transmissions per time slot. Finally, we note that elements of the analysis at hand first appeared in [23], [24]. Compared to the work at hand, the work there notably differs as follows: (i) Regarding the network model used, nodes do not change their travel direction and a more restrictive class of routing rules is used. (ii) Regarding the developed analysis, packet trajectories are modeled using an i.i.d. process (as opposed to a Markov chain) and an approximation cruder than the Second-Order Approximation is used (we elaborate on the difference between the two approximations in Section III-G). 5 III. N ETWORK M ODEL A. Node mobility At time t = 0, infinitely many nodes are placed on the plane R2 according to a uniform Poisson point process (PPP) with (node) density λ > 0. Subsequently, each node travels on R2 , independently of the rest of the nodes, according to the following random waypoint mobility model (here and in the rest of this work, travel directions are specified in terms of the angle θ ∈ [−π, π) they form with the positive direction of the x-axis): the node selects a random travel direction D1 according to a (not necessarily uniform) direction density fD : [−π, π) → [0, ∞); the node moves in this direction along a straight line with constant node speed v0 > 0, for a random duration of time E1 that follows an exponential distribution with mean 1/r0 ; the parameter r0 > 0 is the (node) turning rate. The node then picks another random travel direction D2 from the same density fD (·), and travels in that direction for another exponentially distributed amount of time E2 (again with mean 1/r0 ), and so on, ad infinitum. The random variables (RVs) {Di } and {Ei } are all independent of each other. The density fD (·) can be used to describe situations where the nodes have preferred travel directions; for example, in a Manhattan-like city center, we expect most nodes to be traveling along two main axes. For our results to hold, we require that there is an ǫD > 0 such that fD (·) does not take values in (0, ǫD ), i.e., fD (·) can be 0 but in the set where it is not 0 it is bounded away from it. However, in order to keep the exposition simple, in the rest of this discussion we also assume that fD (·) is strictly positive everywhere. Indeed, if fD (·) is zero on some subset of [−π, π), then this set can be removed from consideration and all subsequent analysis applies without change. Note that the time instants when the travel direction of a given node changes form a Poisson process with rate r0 , and by the displacement theorem [25, Theorem 1.10], at any time instant t > 0, the locations of all nodes follow a PPP with density λ. Also note that, because the distribution of the duration of time a node keeps its travel direction is not a function of its current direction, the travel direction of a given node at any fixed time t > 0 has density fD (·). B. Transceiver model Nodes are equipped with transceivers with which they can exchange packets. Suppose node 1 wants to transmit a packet to node 2, whose relative location with respect to node 1 is described by the vector r = (r, φ); that is, node 2 is at a distance r = |r| ≥ 0 from node 1, in the direction φ ∈ [−π, π). We assume that such a transmission has (wireless transmission) cost C(r), for some fixed cost function C(·). We also assume that all packets have the same length, and that all transmissions are instantaneous. Some remarks on our transceiver model choice are in order. First, the cost C(r) can be used to model the energy dissipated by the transmitter in order for the packet to reach a relative location r [26], or the cost (in lost throughput) of having to silence other transmitters so that the transmission is received correctly by the receiver [5]. Second, allowing the cost to be a function of the vector r and not just its length r = |r| allows us to treat cases where there is anisotropy in the environment; for example, in a Manhattan-like environment we expect the energy dissipated for transmitting at a given distance in the directions of the street/avenues to be less than the energy in other directions, as the signals in the former case do not have to pass through as many buildings. Third, C(r) can be interpreted as the expected value of the transmission cost in case this is random, e.g., due to fading. All our results, appropriately interpreted, continue to hold in that case, provided the sources of randomness in the cost are independent from all other sources of randomness. We make no more reference to such interpretations in the rest of this work. Fourth, the assumption that the transmission is instantaneous is made for mathematical convenience, and it is very reasonable in our delay-tolerant context. Indeed, we are interested in measuring delays that are comparable to the time needed for the topology to change significantly, whereas the time needed for the transmission of a packet is typically such that the locations of the transmitter, the receiver and the other nodes in their vicinity do not change perceptibly. Finally, our model does not explicitly capture the interaction between packets, i.e., there is no contention for the channel; the need for all packets to share the available bandwidth is implicitly modeled through the use of the wireless transmission cost function C(r). 6 C. Traffic model We consider a single, tagged packet, created at time t = 0, that must travel to a destination placed at an infinite distance away from the packet source. With no loss of generality, we take the destination to be in the direction of the positive x-axis. The assumption that the packet destination is located at an infinite distance away is made for mathematical convenience; we plan to calculate performance metrics using the invariant distribution of a Markov chain, and for this reason it is necessary for the length of the packet travel to be infinite; we expect these metrics to be relevant in the design of real networks provided packets travel for finite but not small distances. Given that the destination of the packet is in the direction of the positive x-axis, in the following, we define a travel direction θ1 to be better than a travel direction θ2 if |θ1 | < |θ2 |; therefore, if the packet changes its travel direction to a better one, given that all nodes travel with the same speed, it starts approaching its destination faster. We will also use the terms equal, best, worse, and worst, for travel directions, in the same sense. The packet can travel to the destination using a hybrid geographic/delay-tolerant routing rule (RR) that uses combinations of wireless transmissions (the geographic part of the RR) and sojourns along the buffers of nodes (the delay-tolerant part of the RR). D. Stages Irrespective of the RR used, we can always break the travel of the tagged packet towards its destination into an infinite sequence of stages i = 1, 2, . . . , with each stage i corresponding to either a single wireless transmission (in which case we call it a (wireless) transmission stage between the transmitter and the receiver of that stage), or a single sojourn on the buffer of a node, the carrier, while its travel direction does not change (which we call a buffering stage). Observe that a new stage will occur even if the carrier changes its direction but the packet stays with it. Therefore, each stage is associated with exactly one of the linear segments comprising the packet trajectory. Since nodes change directions after exponential times and the packet destination is located at an infinite distance away from its source, there will be an infinite number of stages with probability 1. With each stage i = 1, 2, . . . , we associate a number of RVs. Firstly, let Θi ∈ [−π, π) denote the carrier travel direction in the case of buffering stages, and the travel direction of the receiver in the case of transmission stages. Let Ti−1 , Ti be the time instants when stage i starts and ends, respectively, and ∆i = Ti − Ti−1 be its duration. Observe that ∆i = 0 for transmission stages and ∆i > 0 for buffering stages. Let (XW,i , YW,i ) be the changes in the coordinates of the packet due to the wireless transmission at stage i, and let Ci = C((XW,i , YW,i )) be the associated transmission cost so that, if i is a buffering stage, then XW,i = YWi = CW,i = 0. Likewise, let XB,i be the change in the x-coordinate of the packet due to the buffering in stage i so that, if that stage is a transmission stage, then XB,i = 0. Observe that XB,i = v0 ∆i cos Θi . Finally, write Xi = XW,i + XB,i . We will refer to any change of the x-coordinate as progress. We collect all these RVs in Table I. TABLE I RV S ASSOCIATED WITH STAGE i Quantity Stage index Carrier (for buffering stage) or receiver (for transmission stage) travel direction during stage i Time instant stage i starts Time instant stage i ends Stage i duration Progress due to transmission in stage i y-coordinate change due to transmission in stage i Cost of transmission in stage i Progress due to buffering during stage i Progress during stage i Symbol i = 1, 2, . . . Θi ∈ [−π, π) Ti−1 Ti ∆i = Ti − Ti−1 XW,i YW,i Ci = C ((XW,i , YW,i )) XB,i = v0 ∆i cos Θi Xi = XB,i + XW,i 7 E. Performance metrics We describe the performance of the RR employed in terms of the (packet) speed Vp , defined as, Pn Pn i=1 Xi i=1 Xi P Vp , lim = lim , n n→∞ n→∞ Tn i=1 ∆i and the (normalized packet) cost Cp , Pn Ci Cp , lim Pni=1 . n→∞ i=1 Xi (1) (2) In the sequel we will show that, under appropriate conditions, these limits indeed exist and are constant, with probability 1. The packet speed Vp represents the limit of the average rate (in units of distance over time) with which the packet makes progress towards its destination, as the number of stages goes to infinity. Similarly, Cp represents the limit of the average rate (in units of cost over distance) with which cost is accumulated in the long run as the packet progresses towards its destination. Although it is straightforward to estimate the values of Vp and Cp through simulation, it is hard to determine them analytically. One reason is that the sequence {(XW,i , YW,i , XB,i , ∆i ) ; i ≥ 1} does not form a Markov chain. Therefore, one would have to consider the complete continuous-time chain on an infinite-dimensional state space describing the positions and travel directions of all nodes on the plane at any given time t; clearly this is a daunting task. For this reason, we introduce two approximation assumptions that create artificial regeneration epochs in the analysis. These assumptions are chosen in a judicious manner, allowing us both to apply tools from Markov chains, and to guarantee that the induced approximation errors in the computations of Vp and Cp are modest in size. This is indeed shown to be the case through numerous simulation examples, for a wide range of parameters. Finally, we expect a trade-off to exist between the cost and the speed: if an efficiently designed RR makes heavy use of wireless transmissions, we expect the packet to travel fast towards its destination, but at a significant cost; on the other hand, if an efficiently designed RR makes light use of transmissions, the cost will be low but the packet will also make slow progress towards its destination. Our simulation results also verify the existence of this trade-off for the class of RRs considered in this paper. F. Routing rule For the rest of this work we limit our attention to the following class of RRs, described in terms of a forwarding region and a potential function. First we need to introduce a simple notational convention. Notation. All node locations r in R2 are described in polar coordinates, r = (r, φ) and they are always understood to be relative locations of one node relative to another, or relative to the origin 0 ∈ R. With a slight abuse of notation, we perform operations between locations as if they were written in Euclidean coordinates. For example, if the locations of nodes A and B with respect to the origin are rA and rB , respectively, then the location of B relative to A is rB − rA . Let the Forwarding Region (FR) F be the (nonempty) closed, bounded and convex subset of R2 defined as F , {r , (r, φ) : −π ≤ φ < π, 0 ≤ r ≤ b(φ)}, in terms of an arbitrary bounded boundary function b : [−π, π) → [0, ∞); observe that (0, 0) = 0 ∈ F . We also assume throughout that the cost function C(·) is bounded on the bounded region F . The FR of an arbitrary node A located at rA is F(A) , F translated so that 0 is at rA = rA + F. Suppose the packet is with a node A at the origin. The suitability of a node within F(A) (either the current holder or another one) located at position r ∈ F(A) and traveling in direction θ ∈ [−π, π) is described by the potential function U (θ, r); the higher the potential, the more suitable the node is. Different choices of the two functions b and U (·, ·) give rise to different RRs within the class. We make the following assumptions: Assumption 1. U (·, ·) is a continuous, strictly monotonic function of θ , in the following sense: if |θ1 | > |θ2 |, then U (θ1 , r) < U (θ2 , r), for any r. 8 Assumption 2. If U (θ1 , r1 ) < U (θ2 , r2 ), then also U (θ1 , r1 − r3 ) < U (θ2 , r2 − r3 ), for any r3 such that both r1 − r3 and r1 − r3 belong to F . Assumption 1 says that, if a node changes its travel direction to a strictly better one, then it becomes strictly more appealing for buffering the packet. Clearly, for any reasonable choice of the potential we should have that, if |θ1 | > |θ2 |, then U (θ1 , r) ≤ U (θ2 , r). Excluding the case of equality, U (θ1 , r) = U (θ2 , r), simplifies the analysis because it allows us to conclude that, at any time instant, all nodes in the same FR have different potentials, with probability 1. Allowing equality would require a longer but not substantially different analysis. The performance of protocols using potential functions where equality may hold can be approximated well by slightly modifying the potential, e.g., by adding a small corrective term −ǫ|θ|, for some ǫ > 0; therefore, this assumption does not limit significantly the scope of our work. Assumption 2 means that, if a node A located at r1 and traveling in direction θ1 , is less appealing than a node B located at r2 and traveling with direction θ2 , according to a node C located at the origin, then node A should also be less appealing than B to any other node D that has both A and B in its forwarding region. In other words, nodes should agree among themselves, at all times, about which of two nodes is better for buffering the packet; otherwise, there may be routing loops. Clearly, in this geographic routing context, any reasonable choice for the potential function should naturally satisfy this assumption. Two more assumptions will be introduced later on in the analysis. Collectively, the four assumptions are satisfied for many, perhaps most, reasonable choices of the functions b(φ) and U (θ, r), adequately covering the spectrum of routing protocol design requirements. The assumptions are made partly for mathematical convenience, and they could be relaxed in various different directions without making the analysis substantially harder. We stress that our analysis does not require the specification of particular choices for the functions b and U (·, ·), that is, of a particular RR; we consider a specific example in Section VII where we present numerical results. Having defined the all the key concepts, we can now specify the routing rule: Routing rule. The packet travels on the buffer of a carrier node Ai until another node Ai+1 , which we refer to as the eligible node, is found; Ai+1 is eligible if it lies in F(Ai ) and its potential is greater than that of Ai and of all other nodes within F(Ai ). The packet is instantaneously transmitted to Ai+1 and the same rule is applied again. Then either another eligible node, Ai+2 , is immediately found, in which case the packet is transmitted to Ai+2 at the same time instant, or a sojourn on the buffer of node Ai+1 is initiated; and so on. In Table II we collect all the quantities used so far in modeling the network. TABLE II Q UANTITIES AND NOTATION USED IN THE NETWORK MODEL SPECIFIED IN S ECTION III Quantity Node density Direction density Node speed Node turning rate Transmission cost Forwarding Region Boundary function Potential Symbol λ fD (x), x ∈ [−π, π) v0 r0 C(r), r ∈ R2 F b(φ), φ ∈ [−π, π) U (θ, r), θ ∈ [−π, π), r ∈ F G. Second-Order Approximation and its consequences Here we introduce the first of our two approximations, which pertains to what happens between stages. Second-Order Approximation: 1) The moment a receiver A receives the packet from a transmitter B , the complete mobility process is reinitialized, except that the position and travel direction of node A are maintained and all nodes that appear (after the re-initialization) in F(A) ∩ F(B) and whose potential is greater than that of A are removed. 9 2) The moment a node A carrying the packet changes its travel direction θ to a θ ′ , the mobility process is re-initialized, except that A maintains its position and travel direction and all created nodes within F(A) whose potential is greater than max{U (θ, 0), U (θ ′ , 0)} are removed. Note that by ‘re-initialization’ we mean that all nodes are placed in all of R2 again as they were at time t = 0. Intuitively, the approximation introduces regeneration points in the mobility process, so that a Markov chain that is amenable to analysis may later on be defined. However, it does so without eligible nodes unexpectedly appearing out of nowhere in the FR due to the re-initialization; ineligible nodes do appear, however such nodes might have already been present in the FR before the re-initialization, so the re-initialization has the effect of reshuffling them, and the performance of the RR is not significantly affected. We call this approximation ‘second-order’ to differentiate it from: 1) the First-Order Approximation used in [24] and [1] (termed, there, Approximation 1), under which, whenever a node A receives the packet or changes its travel direction, the mobility process is regenerated, keeping node A’s position and travel direction, but without removing any nodes, and 2) the even coarser Basic Assumption of [23] under which, whenever a node A receives the packet, the mobility process is re-initialized keeping node A’s position but not its travel direction, and also without removing any nodes. We note that the derivations in [24], [1], [23], which are based on these alternative approximations, are notably simpler, as more information is lost at each re-initialization and, in each setting, the trajectory of the tagged packet can be modeled with a random process simpler than that we eventually develop in Section VI. 10 IV. T RANSMISSION S TAGE A NALYSIS As the first step of the analysis, in this section we compute explicit expressions for a number of quantities related to what follows a wireless transmission stage. The setting here, shown in Fig. 1, is as follows: a node A is traveling in direction θ ∈ [−π, π) and has just received the packet from some node B such that the position of A relative to B is r ∈ F(B). Our quantities of interest here are functions of θ and r. Write G(r) , F(A) ∩ F(B)c , for the locations in F(A) but not in F(B). $ " " !! ! " ! ! # ! Fig. 1. The setting of Section IV. Here, there is an eligible node C within G(r), however this is not always the case. Let E(N ; θ, r) be the expected number of nodes in G(r) whose potential is greater than that of A, so that Z π ZZ λfD (θ ′ )1[U (θ ′ , r′ ) > U (θ, 0)] dA′ dθ ′ E(N ; θ, r) = −π G(r) Z π ZZ λfD (θ ′ )1[U (θ ′ , r′ ) > U (θ, 0), r′ ∈ G(r)] dA′ dθ ′ , (3) = −π F dA′ where is the infinitesimal area element corresponding to r′ , and the indicator function 1[X ] is equal to 1 if the condition X holds and to 0 if it does not. Also, let PE (θ, r) denote the probability of the event E(θ, r) that G(r) does not contain an eligible node, i.e., that a new buffering stage will commence at the moment node A receives the packet. This event will occur if there are no nodes in G(r) whose potential is greater than the potential of A. The number N of such nodes has a Poisson distribution with mean E(N ; θ, r), therefore, PE (θ, r) = P (E(θ, r)) = exp [−E(N ; θ, r)] . (4) Finally, let g(θ ′ , r′ ; θ, r) be the joint density of the location r′ ∈ F(A) and the travel direction θ ′ ∈ [−π, π) of the eligible node C to which the packet is immediately transmitted from A (see Fig. 1), so that g(θ ′ , r′ ; θ, r) is equal to zero if no such node can exist for the given choice of θ ′ and r′ . In order to obtain a useful expression for g(θ ′ , r′ ; θ, r) for all r, r′ ∈ F(A), θ, θ ′ ∈ [−π, π), first observe that g(θ ′ , r′ ; θ, r) = 0 if U (θ, 0) ≥ U (θ ′ , r′ ), i.e., node A is at least as suitable as node C for keeping the packet. We also have g(θ ′ , r′ ; θ, r) = 0 if r′ 6∈ G(r), i.e., r′ is in the intersection of the FRs F(A) and F(B) and so no eligible node may be found there by the Second-Order Approximation. 11 When both U (θ, 0) < U (θ ′ , r′ ) and r′ ∈ G(r), the joint density of the location r′ and direction θ ′ of node C is λfD (θ ′ ), and C will receive the packet if there is no other node in G(r) that is better than C . The expected number of such nodes is (cf. with the derivation of (3)) Z π ZZ λfD (θ ′′ )1[U (θ ′′ , r′′ ) > U (θ ′ , r′ )] dA′′ dθ ′′ −π G(r) Z π ZZ λfD (θ ′′ )1[U (θ ′′ , r′′ ) > U (θ ′ , r′ ), r′′ ∈ G(r)] dA′′ dθ ′′ , = −π dA′′ where, as before, distributed, we have is the infinitesimal area element corresponding to r′′ , and as their number is Poisson  Z g(θ , r ; θ, r) = λfD (θ ) exp − ′ F ′ ′ π −π ZZ ′′ F ′′ ′′ ′ ′ ′′ ′′ λfD (θ )1[U (θ , r ) > U (θ , r ), r ∈ G(r)] dA dθ ′′  . Combining all cases, we have g(θ ′ , r′ ; θ, r) = λfD (θ ′ )1[U (θ, 0) < U (θ ′ , r′ ), r′ ∈ G(r)]   Z π ZZ fD (θ ′′ )1[U (θ ′′ , r′′ ) > U (θ ′ , r′ ), r′′ ∈ G(r)] dA′′ dθ ′′ . (5) × exp −λ −π F Observe that, for all θ ∈ [−π, π), r ∈ F , we must have Z π ZZ g(θ ′ , r′ ; θ, r) dA′ dθ ′ = 1. PE (θ, r) + −π (6) F This is due to the fact that, upon the reception of a packet, either a sojourn will start, or another transmission will take place, with probability 1. 12 V. B UFFERING S TAGE A NALYSIS As the second step of the analysis, in this section we compute explicit expressions for a number of quantities related to what follows a buffering stage. Specifically, suppose that at time t = Ti−1 a buffering stage i starts with the packet in the buffer of a node A, and traveling in direction Θi = θ ∈ [−π, π). The buffering ends at time Ti = Ti−1 + ∆i , for some ∆i > 0. We partition the event corresponding to the end of the buffering stage i into four families of disjoint events, each one describing a different manner in which the buffering will end. We then use our second approximation, introduced in Section V-D, to compute the probability of each of these events. A. Four families of events Given the value of Θi = θ , first we define the collection of events A(θ) = {A(θ, θ ′ ) ; θ ′ ∈ [−π, π)}, where A(θ, θ ′ ) is the event that the buffering ends because, at time Ti , node A changes its travel direction from θ to θ ′ , while no eligible node is found. Second, we let B(θ) = {B(θ, θ ′ , r′ ) ; θ ′ ∈ [−π, π), r′ ∈ F(A)}, where B(θ, θ ′ , r′ ) is the event that the buffering ends because, at time Ti , node A changes its travel direction from θ to some θ ′′ and an eligible node is immediately found in location r′ ∈ F(A) and traveling in direction θ ′ . The third collection of events we will consider is C(θ) = {C(θ, θ ′ , r′ ) ; θ ′ ∈ [−π, π), r′ ∈ F(A)}, where C(θ, θ ′ , r′ ) is the event that the buffering ends because, at time Ti , while A is still traveling in direction θ , a node B located at r′ ∈ F(A) changes direction from some previous θ ′′ to θ ′ , thus becoming eligible. To define the fourth family, we first need to introduce another mild assumption on the FR F and the potential U (·, ·), complementing the assumptions of Section III-C regarding the RR. For any θ, θ ′ , let K = K(θ, θ ′ ) denote the subset of the FR of a node A traveling in direction θ , where U (θ ′ , r) > U (θ, 0); cf. Fig. 2. Therefore, nodes that enter K from the outside immediately become eligible. Assumption 3. We assume that, for any θ, θ ′ ∈ [−π, π), the region K = K(θ, θ ′ ) is convex. Let the threshold curve, b(s; θ, θ ′ ), parametrized by s ∈ [0, 1], be the curve separating K and Kc . We assume that the curvature of b is uniformly bounded, in that b(s; θ, θ ′ ) is differentiable with respect to s, for almost every s ∈ [0, 1], and there exists a finite constant Mb , independent of θ, θ ′ , such that the magnitude of the derivative b′ (s; θ, θ ′ ) with respect to s is bounded by Mb : |b′ |(s; θ, θ ′ ) ≤ Mb , for almost all s ∈ [0, 1]. Note that Assumption 3 implies that the length of the curve b(s; θ, θ ′ ) is bounded, a property which is obviously satisfied for any reasonable choice of the potential U (θ, r), provided the parametrization b(s; θ, θ ′ ) is suitably chosen. [For concreteness, we also mention that the derivative b′ with respect to s above is taken on the x- and y coordinates of b.] Let t(s; θ, θ ′ ) denote the unit vector perpendicular to the curve b(s; θ, θ ′ ) at the location specified by s, and pointing in the direction of lower potential. Observe that changing s to s + ds traces an infinitesimal line segment of length ds|b′ |(s; θ, θ ′ ) that is perpendicular to t(s; θ, θ ′ ); see Fig. 2. Clearly, a node that “hits” the curve b from outside K immediately becomes eligible. We can now define the last collection of events of interest here: D(θ) = {D(θ, θ ′ , s) ; θ ′ ∈ [−π, π), s ∈ [0, 1]}, where D(θ, θ ′ , s) denotes the event that the buffering ends because, at time Ti , an eligible node appears at the position of the boundary of K corresponding to s, traveling with direction θ ′ . Finally, we write U (θ) = A(θ) ∪ B(θ) ∪ C(θ) ∪ D(θ),  and we note that P ∪E∈U (θ)E|Θi = θ = 1, i.e., these four cases cover every possible scenario, with probability 1. 13 & ! #! ! ! ! !! " # ! !" ! !! % " $% ! ! $"$ $"# # $% ! ! " $% ! ! Fig. 2. Setting used in defining the family D(θ). B. Transition rates Let θ, θ ′ ∈ [−π, π), r ∈ F and s ∈ [0, 1] arbitrary, let dA′ denote the infinitesimal area element in location r′ as before, and let t = 0. With a slight abuse of notation we define the transition rates rA (θ, θ ′ ), rB (θ, θ ′ , r′ ), rC (θ, θ ′ , r′ ), and rD (θ, θ ′ , s), as: rA (θ, θ ′ )dθ ′ dt = P (A(θ, θ ′ ), ∆i = t|Θi = θ), (7) ′ ′ ′ ′ ′ ′ (8) ′ ′ ′ ′ ′ ′ (9) rB (θ, θ , r )dθ dA dt = P (B(θ, θ , r ), ∆i = t|Θi = θ), rC (θ, θ , r )dθ dA dt = P (C(θ, θ , r ), ∆i = t|Θi = θ), ′ ′ ′ rD (θ, θ , s)dθ dsdt = P (D(θ, θ , s), ∆i = t|Θi = θ). (10) Intuitively, these rates describe the infinitesimal probability that a buffering stage will end exactly in each one of the four possible scenarios discussed above, after an infinitesimal duration of time ∆i ∈ [0, dt]. Formally, we could define rA (θ, θ ′ ), via the limit    P ∪θ′′ ∈(θ′ −δθ′ /2,θ′ +δθ′ /2) A(θ, θ ′′ ) ∩ {∆i ∈ [0, δt]} Θi = θ = rA (θ, θ ′ )δθ ′ δt + o(δθ ′ δt), as δθ ′ , δt ↓ 0, and similarly for the other three transition rates. We now proceed to derive expressions for each of them, in terms of the network model and the RR parameters specified earlier; cf. Table II. Again, with a slight abuse of terminology and notation, in the subsequent discussion we omit the adjective “infinitesimal” most of the time, e.g., referring to the quantities in the right-hand sides of (7)–(10) simply as “probabilities.” Regarding rA (θ, θ ′ ), the probability in the right-hand side of (7) is equal to the product of five different quantities: (a) the probability r0 dt that node A will change its direction during that interval; (b) the probability fD (θ ′ )dθ ′ that A will pick direction θ ′ ; (c) the probability that there are no eligible nodes in F(A) with potential at most U (θ, 0) but greater than U (θ ′ , 0), which is (recall the derivation of (4)),   Z π ZZ ′′ ′′ ′′ ′ ′′ ′′ λfD (θ )1[U (θ, 0) ≥ U (θ , r ) > U (θ , 0)] dA dθ ; exp − −π F (d) the probability, p1 , say, that no event in C(θ) will occur before A(θ, θ ′ ); and (e) the probability, p2 , say, that that no event in D(θ) will occur before A(θ, θ ′ ). Now observe that p1 is bounded below by the probability 1 − λ|F(A)|r0 dt that no node in a region of area |F(A)| will change travel direction in a time interval of duration dt. As for p2 , we claim that it is bounded below by 1 − 2v0 λMb dt, where Mb is the bound to the length of the curves b(s; θ, θ ′ ) specified by Assumption 3. Indeed, the expected number of nodes with a given travel direction θ ′ and density λf (θ ′ )dθ ′ that cross b(s; θ, θ ′ ), whose 14 length is less than Mb , in a time interval [0, dt], with a relative speed less than 2v0 , is less than λf (θ ′ )dθ ′ Mb 2v0 dt. Integrating over all θ ′ , it follows that the expected number of all such nodes is less than 2v0 λMb dt. As the distribution of their total number is Poisson, the probability that no node will cross some curve b(s; θ, θ ′ ) in a time interval [0, dt] is greater than 1 − 2v0 λMb dt, and so p2 ≥ 1 − 2v0 λMb dt. We note that similar arguments can be used in the calculation of the other three transition rates to show that the probability that an event of a different type occurs does not affect the rate; as these arguments are straightforward, they will be omitted. Combining the above estimates and ignoring terms of order (dt)2 , it follows that   Z π ZZ ′′ ′′ ′′ ′ ′′ ′′ ′ ′ λfD (θ )1[U (θ, 0) ≥ U (θ , r ) > U (θ , 0)] dA dθ . (11) rA (θ, θ ) = r0 fD (θ ) exp − −π (θ, θ ′ , r′ ), F U (θ ′ , r′ ) Regarding rB note that, if > U (θ, 0), then the probability in the right-hand side of (8) is zero because the condition implies that there was an eligible node before A changed direction. However, if U (θ, 0) ≥ U (θ ′ , r′ ), then this probability can again be expressed as the product of four different terms: (a) the probability r0 dt that node A will change its travel direction during the interval [0, dt]; (b) the probability Z π   fD (θ ′′ )1 U (θ ′ , r′ ) > U (θ ′′ , 0) dθ ′′ , −π θ ′′ that its new direction will lead to a lower potential than U (θ ′ , r′ ) (otherwise, the packet would have stayed with A); (c) the probability λfD (θ ′ )dA′ dθ ′ that there is a node at the specified location r′ with the specified travel direction θ ′ ; and (d) the probability that there is no node in F(A) that is better than that node, which is (cf. with the derivation of (4))  Z π ZZ  ′′′ ′′′ ′′′ ′ ′ ′′′ ′′′ λfD (θ )1[U (θ, 0) ≥ U (θ , r ) > U (θ , r )] dA dθ . exp − −π F Therefore, Z π   fD (θ ′′ )1 U (θ ′ , r′ ) > U (θ ′′ , 0) dθ ′′ rB (θ, θ ′ , r′ ) = r0 λfD (θ ′ )1[U (θ, 0) ≥ U (θ ′ , r′ )] ×   Z π Z Z −π ′′′ ′′′ ′′′ ′ ′ ′′′ ′′′ λfD (θ )1[U (θ, 0) ≥ U (θ , r ) > U (θ , r )] dA dθ . (12) × exp − −π F Regarding rC (θ, θ ′ , r′ ), the probability in the right-hand side of (9) is zero when U (θ ′ , r′ ) ≤ U (θ, 0). Otherwise, it is equal to the probability that there is a node within the specified area, Z π ′ λdA fD (θ ′′ )1[U (θ ′′ , r′ ) < U (θ, 0)] dθ ′′ , −π that that node will turn to direction θ ′ . Therefore,  Z π   ′′ ′′ ′ ′′ ′ ′ ′ ′ ′ fD (θ )1[U (θ , r ) < U (θ, 0)] dθ . rC (θ, θ , r ) = λr0 fD (θ )1 U (θ , r ) > U (θ, 0) multiplied with the probability r0 fD (θ ′ )dθ ′ dt (13) −π Regarding rate rD (θ, θ ′ , s), observe that nodes that move in direction θ ′ appear to node A to be moving with ′ relative speed v0 ejθ − v0 ejθ ; cf. Fig. 3. Also observe that, in order for the probability on the right-hand side of ′ (10) to be nonzero, the inner product (v0 ejθ − v0 ejθ ) · t(s; θ, θ ′ ) must be negative (as shown in the figure) so that nodes with travel direction θ ′ are hitting the boundary from the outside of K. Then, this probability is equal to the density of nodes λfD (θ ′ )dθ ′ traveling in direction θ ′ , multiplied with the area of the parallelogram (which appears ′ shaded in the figure) with sides of length |v0 ejθ − v0 ejθ |dt and |b′ (s; θ, θ ′ )|ds, at an angle χ. Therefore, ′ ′ rD (θ, θ ′ , s) = 1[(v0 ejθ − v0 ejθ ) · t(s; θ, θ ′ ) < 0]λfD (θ ′ )|v0 ejθ − v0 ejθ | |b′ (s; θ, θ ′ )| sin χ, and noting that the inner product, ′ ′ ′ (ejθ − ejθ ) · (−t(s; θ, θ ′ )) = |ejθ − ejθ | cos(π/2 − χ) = |ejθ − ejθ | sin χ, we obtain:  ′ rD (θ, θ ′ , s) = λv0 fD (θ ′ ) max 0, (ejθ − ejθ ) · t(s; θ, θ ′ ) |b′ (s; θ, θ ′ )|. (14) 15 !##$ % % !" # ! $# ! " ! " $& ! ##$ % %!$# ! " " ! # !" !" !##$ % % !" Fig. 3. The setting used in calculating the transition rates rD (s, θ′ ). Having computed expressions for rA , rB , rC , and rD , we finally define one last family of transition rates that will be used in subsequent derivations. First, given the value of Θi = θ as before, we define the family of events D̂(θ) = {D̂(θ, θ ′ , r′ ), θ ′ ∈ [−π, π), r′ ∈ F}, where D̂(θ, θ ′ , r′ ) is the event that the buffering ends because, at time Ti , an eligible node appears at position r′ on the curve b(s; θ, θ ′ ), traveling in direction θ ′ . Also we define the transition rates rD̂ (θ, θ ′ , r′ )dθ ′ dA′ dt = P (D̂(θ, θ ′ , r′ ), ∆i = t|Θi = θ), θ, θ ′ ∈ [−π, π), r′ ∈ F. Observe that rD̂ (θ, θ ′ , r′ ) is simply a different representation of rD (θ, θ ′ , s), and it can be easily recovered from knowing rD (θ, θ ′ , s) and b(s; θ, θ ′ ). Indeed, fixing θ and θ ′ , the rate rD (θ, θ ′ , s) only specifies the transition rates of eligible node arrivals but not their locations; these are provided by the function b(s; θ, θ ′ ); on the other hand, the rate rD̂ (θ, θ ′ , r′ ) already contains this information. In particular, we have Z Z ′ ′ ′ rD (θ, θ ′ , s) ds (15) rD̂ (θ, θ , r ) dA = F̂ F for any F̂ ⊆ F , with F = {s : b(θ, θ ′ , s) ∈ F̂ } ⊆ [0, 1]. In our numerical calculations later or, we calculate the rate rD̂ (θ, θ ′ , r′ ), for a specific pair θ, θ ′ and for all r′ , as follows. First, we discretize s, defining N values si , i = 1, 2, . . . , N to cover [0, 1], each associated with an interval of length δsi , i = 1, 2, . . . , N , the intervals partitioning [0, 1]. Then, we discretize r′ , defining M values r′j , j = 1, 2, . . . , M , each associated with an area δAj , the areas partitioning F . We map each si to the location r′j nearest to b(θ, θ ′ , si ), and we denote the resulting map by r′m (θ, θ ′ , ·). And setting X 1 rD̂ (θ, θ ′ , rj ) = rD (θ, θ ′ , si )δsi , δAj ′ ′ si :rj =rm (θ,θ ,si ) we have a discretized version of (15). 16 C. Aggregate rates We also define the aggregate rates rA (θ), rB (θ), rC (θ), rD (θ), and r(θ) as follows: Z π rA (θ, θ ′ ) dθ ′ , rA (θ) = Z−π π Z rB (θ, θ ′ , r′ ) dA′ dθ ′ , rB (θ) = F Z−π π Z rC (θ) = rC (θ, θ ′ , r′ ) dA′ dθ ′ , −π F Z πZ 1 rD (θ, θ ′ , s) dsdθ ′ , rD (θ) = −π (16) (17) 0 r(θ) = rA (θ) + rB (θ) + rC (θ) + rD (θ). (18) The interpretation of the first four rates above is that, each one of them, multiplied by dt, is the infinitesimal (conditional) probability that an event from the corresponding family will occur after a time ∆i ∈ [0, dt], given that the packet is traveling in direction Θi = θ . And the last one rate, r(θ), multiplied by dt, gives the probability that the buffering of stage i will end after a time ∆i ∈ [0, dt], given that Θi = θ . Observe that we must have r0 = rA (θ) + rB (θ), as the union of the events belonging to the families A and B is the event that node A changes direction, which happens with rate r0 . Therefore, r(θ) = r0 + rC (θ) + rD (θ). (19) D. Time-Invariance Approximation and consequences The transition rates of the events in the four families defined in Section V-A are not independent of the duration ∆i of the buffering stage. Intuitively, as time progresses, memory accumulates, and the probability of each of them occurring changes. As this fact significantly complicates the analysis required for computing the probability that a specific one of these events occurs, we adopt the following simplifying assumption: Time-Invariance Approximation: For each incremental event E ∈ U (θ) ∪ D̂(θ), and any time t ≥ 0, as δt ↓ 0 we have: 1 1 P (E, t ≤ ∆i ≤ t + δt|∆i ≥ t, Θi = θ) = P (E, 0 ≤ ∆i ≤ δt|Θi = θ) + o(1). δt δt Intuitively, under this approximation, the probability that the buffering will end in a specific manner does not change as the stage progresses, but it is equal to the probability that this will happen right at the moment when the buffering starts (and the mobility process has been restarted, due to the Second-Order Approximation). In particular, integrating the above expression over all E ∈ U (θ) ∪ D̂(θ) implies that ∆i is memoryless, in that P (t ≤ ∆i ≤ t + dt|∆i ≥ t, Θi = θ) = P (0 ≤ ∆i ≤ dt|Θi = θ) = r(θ)dt, therefore, under the Time-Invariance Approximation, each ∆i is exponentially distributed [27] with rate r(θ). Furthermore, the Time-Invariance Approximation makes it possible to obtain “time-averaged” versions of the expressions for the rates in (7)–(10). For example, adopting the same slight abuse of notation as before, for any event A(θ, θ ′ ) we have P (A(θ, θ ′ ), ∆i = t|Θi = θ) = P (A(θ, θ ′ ), ∆i = t, ∆i ≥ t|Θi = θ) = P (A(θ, θ ′ ), ∆i = t|∆i ≥ t, Θi = θ)P (∆i ≥ t|Θi = θ) = P (A(θ, θ ′ ), ∆i = 0|Θi = θ)P (∆i ≥ t|Θi = θ) = rA (θ, θ ′ )dθ ′ dt exp{−tr(θ)}, 17 where the third equality follows from the Time-Invariance Approximation, and the last equality from the definition of rA and the fact that, conditional of Θi = θ , ∆i is exponential with rate r(θ). Integrating over 0 ≤ t < ∞, we then obtain Z ∞ rA (θ, θ ′ )dθ ′ P (A(θ, θ ′ )|Θi = θ) = rA (θ, θ ′ )dθ ′ exp{−tr(θ)}dt = . r(θ) 0 Working in the same manner for the other families, we can arrive at similar results. Summarizing, P (A(θ, θ ′ )|Θi = θ) = P (B(θ, θ ′ , r′ )|Θi = θ) = P (C(θ, θ ′ , r′ )|Θi = θ) = P (D(θ, θ ′ , s)|Θi = θ) = P (D̂(θ, θ ′ , s)|Θi = θ) = rA (θ, θ ′ )dθ ′ , r(θ) rB (θ, θ ′ , r′ )dθ ′ dA′ , r(θ) rC (θ, θ ′ , r′ )dθ ′ dA′ , r(θ) rD (θ, θ ′ , s)dθ ′ ds , r(θ) rD̂ (θ, θ ′ , r′ )dθ ′ dA′ . r(θ) (20) (21) (22) (23) (24) 18 VI. P ERFORMANCE M ETRICS In this section we will derive expressions for the long-term average packet speed and cost induced by our RR on this network model. These will be expressed in terms of the invariant distribution of an appropriately defined Markov chain. The following is the last technical assumption we need to impose on the potential function: Assumption 4: The value of U (−π, r) is equal to a constant K for all r ∈ F . Coupled with the monotonicity of U (θ, r), this assumption simply states that the direction θ = −π is uniformly the worst, irrespective of the location r of a candidate neighbor. Note, however, that the behavior of U (θ, r) as a function of θ can strongly depend on r, so that ‘good’ locations can be favored, in terms of the potential assigned to them, as long as nodes at those locations are not traveling in direction −π . Therefore, this assumption is clearly not significantly restrictive. In technical terms, it will be used to establish the irreducibility of the chain {Si } defined below. As should become evident from the analysis, this assumption could be relaxed, but at the cost of significantly complicating some of the arguments involved, so we will not pursue this direction further. A. The Markov chain We define the state Si associated with each stage i ≥ 1, by Si , (Θi , (XW,i , YW,i )) if i is a wireless transmission stage, and by Si , (Θi , (0, 0)) if i is a buffering stage. The associated state space in which each Si takes values is S = SW ∪ SB , where the transmission state space SW , (−π, π) × (F − {0}) and the buffering state space SB , [−π, π) × {0}. By Assumptions 1 and 4, a node A traveling in direction −π will never receive a packet from a node B , irrespective of its location r and node B ’s traveling direction, therefore the pairs (−π, r) with r 6= 0 are not included in SW . Observe that, due to the Second-Order Approximation, the process {Si , i = 1, 2, . . . } forms a Markov chain: If Si = (θ, 0), i.e., i is a buffering stage, then at the start of that stage the complete mobility model was restarted, except that the carrier A kept its travel direction θ and its FR did not contain nodes with a potential higher than that of A, i.e., U (θ, 0). Likewise, if Si = (θi , r) with r 6= 0, i.e., in stage i the packet is transmitted from a node B to a node A located at r ∈ F(B), then, at the moment A received the packet, the whole mobility model was again restarted, except that A kept its travel direction θ and all nodes with potential higher than U (θ, r) were expunged from F(A) ∩ F(B). In both cases, the complete information remaining about the network is captured in the current state. The distribution of the chain {Si } may be described as follows. We assume that S1 = s ∈ S is an arbitrary initial state, and for each i, given Si = (θ, r), the chain moves to a state Si = (θ ′ , r′ ) according to the following family of conditional distributions, as derived in the previous section: If r = r′ = 0, the conditional density of Si+1 is KBB (θ; θ ′ ) = rA (θ, θ ′ ) ; r(θ) if r = 0 and r′ 6= 0, the conditional density of Si+1 is KBW (θ; θ ′ , r′ ) = rB (θ, θ ′ , r′ ) + rC (θ, θ ′ , r′ ) + rD̂ (θ, θ ′ , r′ ) ; r(θ) if both r and r′ are nonzero, then the conditional density of Si+1 is KW W (θ, r; θ ′ , r′ ) = g(θ ′ , r′ ; θ, r), where the function g is given in (5); and finally, if r 6= 0 and r′ = 0, then the conditional density of Si+1 is KW B (θ, r; θ ′ ) = δ(θ ′ − θ)PE (θ, r). In the sequel we refer to KBB (θ; θ ′ ), KBW (θ; θ ′ , r′ ), KW W (θ, r; θ ′ , r′ ), and KW B (θ, r; θ ′ ) as the kernel functions, since they can be used to fully specify the transition kernel of the chain {Si }. 19 B. Ergodicity In this section we establish that, under the Second-Order Approximation, the Time-Invariance Approximation, and Assumptions 1–4, the Markov chain is ergodic, with a unique invariant distribution π , to which it converges at a geometric rate. Let L1 denote the Lebesgue measure on [−π, π), L2 denote the Lebesgue measure on F , and δ0 be the point mass at point 0 = (0, 0) ∈ R2 . We write ψ for the measure ψ = L1 × δ0 + L1 × L2 , defined on the state space S , equipped with the usual Borel σ -field. Our first result describes the long-term behavior of the chain {Si }, and its consequences are stated in detail after that; see [28] for some relevant background on Markov chains. Theorem 1 is proved in the Appendix. Theorem 1: Under the Second-Order Approximation, the Time-Invariance Approximation, and Assumptions 1–4, the Markov chain is ψ -irreducible, aperiodic, and uniformly ergodic on the state space S , with a unique invariant measure π to which it converges uniformly geometrically fast. In particular: 1) There are constants B < ∞ and ρ ∈ (0, 1) such that, for any initial state s ∈ S , |P (Sn ∈ A|S1 = s) − π(A)| ≤ Bρn , for all n ≥ 1 and any (measurable) set A ⊂ S . 2) For any (measurable) function F : S → R with Eπ [|F (S)|] < ∞, as n → ∞ we have, with probability one, n 1X F (Si ) → Eπ [F (S)], n i=1 for any initial state s ∈ S , where S ∼ π . An important ingredient in the proof of Theorem 1 is the following domination condition, which will be verified in the Appendix. Intuitively, Lemma 1 says that, irrespective of the current state, with probability at least ǫ the chain will be in a uniformly distributed buffering state after two time steps. Lemma 1: (Doeblin condition) Let µ denote the measure L1 × δ0 on S . There is an ǫ > 0 such that for any (measurable) A ⊂ S and any s ∈ S , we have: P (Si+2 ∈ A|Si = s) ≥ ǫµ(A). Another ingredient of the proof of the ψ -irreducibility part of Theorem 1 is provided by the following one-step reachability bound. Lemma 2 is proved in the Appendix. Lemma 2: Let µ′ denote the measure L1 × L2 on SW . For any (measurable) A ⊂ SW with µ′ (A) > 0 there are −π ≤ θ1′ < θ2′ < π such that, P (Si+1 ∈ A|Si = (θ, 0)) > 0, for all θ ∈ (θ1′ , θ2′ ). (25) The main implications of Theorem 1 for our results are stated in the following corollary, which is proved in the Appendix. In order to state it we need some additional definitions. Given an arbitrary state S1 = s = (θ, (xW , yW )) in S , let ∆1 be exponentially distributed with rate r(θ) if (xW , yW ) = 0, and ∆1 = 0 otherwise. Similarly, for each i ≥ 2, given (S1 , . . . , Si−1 , Si = (θ, (xW , yW ))) and (∆1 , . . . , ∆i−1 ), let ∆i have the same distribution as ∆1 given (θ, (xW , yW )). Then {S̄i = (Θi , (XW,i , YW,i ), ∆i )} defines a new Markov chain, on the state space:   S̄ = [−π, π) × {0} × [0, ∞) ∪ (−π, π) × (F − {0}) × {0} . Now suppose S = (Θ, (XW , YW )) has distribution π and let ∆ be defined as before, conditional on S . Write π̄ for the induced joint distribution of S̄ = (Θ, (XW , YW ), ∆) on S̄ . 20 Corollary 1: For any initial state S1 = s, ∆1 = δ, the following ergodic theorems hold with probability one: n 1X XW,i = Eπ (XW ), lim n→∞ n i=1 n 1X lim Ci = Eπ (C) = Eπ (C(XW , YW )), n→∞ n i=1 n 1X ∆i = Eπ̄ (∆), lim n→∞ n i=1 n 1X XB,i = Eπ̄ (XB ) = v0 Eπ̄ (∆ cos Θ), lim n→∞ n i=1 where (Θ, (XW , YW ), ∆) ∼ π̄ so that, in particular, (Θ, (XW , YW )) ∼ π . As the final step of our analysis, we provide expressions for the performance metrics defined in Section III-E. The following results, stated without proof, are immediate consequences of Corollary 1. Corollary 2: For any initial state S1 = s, ∆1 = δ, the limits defining the performance metrics Vp and Cp in (1) and (2), respectively, exist with probability one, and are given by: Vp = Cp = Eπ̄ (XW + v0 ∆ cos Θ) , Eπ̄ (∆) Eπ̄ (C(XW , YW )) , Eπ̄ (XW + v0 ∆ cos Θ) (26) (27) where (Θ, (XW , YW ), ∆) ∼ π̄ . Some details regarding the numerical computation of expectations under π and π̄ are given in Section B of the Appendix. 21 VII. N UMERICAL R ESULTS In this section, we compare the approximate results for the performance metrics Vp and Cp obtained in previous sections, with corresponding simulation results for specific choices of the FR F and the potential function U (·, ·). A. Setting We consider the potential function U (θ, r) = −|θ|, θ ∈ [−π, π), so the packet constantly tries to find nodes with a good travel direction, regardless of their relative location, provided, of course, they are within the FR. The FR F we consider is specified by the boundary function b(φ) = a(1 − ǫ2 ) , 1 − ǫ cos φ for some a > 0, ǫ ∈ (0, 1), so that F is an ellipse whose major axis, of length 2a, is along the x-axis, its left focus is at the origin, and its eccentricity is ǫ. The boundary function is drawn in Fig. 4 for a few different choices of the parameters a and ǫ. Note that larger values of a make the routing protocol more aggressive in finding nodes to send the packet to, whereas larger values of ǫ make the routing protocol more selective regarding the relative locations of neighboring nodes. In the important special case ǫ = 0, F is a circle of radius a, so that the routing protocol gives the packet to any node with a direction better than that of the current holder, as long as the two nodes are within distance a of each other. This choice of boundary function may be the only possible if the nodes only know their travel directions but not their relative locations, and they can exchange packets whenever they are within a communication radius a of each other. ' !! ! # !! " ! # !" " !" ! # " # " !" !" " $ ( $ #) ( $ & ( ! " " & "# $!% " ! # # $! % ! " ! ! ! Fig. 4. Left: The boundary function b(φ) for two different values a1 < a2 of the parameter a, and three different values 0 < ǫ1 < ǫ2 of the parameter ǫ. Right: The density fD (·) for three different values of the parameter Θw . Finally, we assume that the transmission cost is quadratic, C(r) = |r|2 , and for the density of the travel direction fD (·) we take ( 1 , x − k π2 < Θ2w for some k ∈ Z, fD (x) = 4Θw 0, elsewhere, where Θw ∈ [0, π/2]. Therefore, fD (·) is positive and constant on four intervals centered in the directions of the positive and negative x- and y -axes, whereas outside of these ranges fD (·) is zero. For Θw = π/2, the density is 1 , for all directions x. At the other extreme, small values of Θw model situations in the uniform density fD (x) = 2π 22 which all nodes move along the direction of one of two perpendicular axes; this would happen, for example, with a vehicular network of nodes moving in a rectangular road grid. In Fig. 4 we also plot the density fD (·) for three different values of the parameter Θw . In Table III we collected all the quantities used in the calculations of this section, along with their default values; these values are used in all computations, unless explicitly stated otherwise. TABLE III Q UANTITIES AND THEIR DEFAULT VALUES USED IN S ECTION VII Quantity Node density Direction density Node speed Node turning rate Transmission cost Boundary function Potential Symbol λ ( 1 π < Θ2w for some k ∈ Z, , x − k 2 fD (x) = 4Θw 0, elsewhere v0 r0 C(r) = |r|2 a(1−ǫ2 ) b(φ) = 1−ǫ cos φ , φ ∈ [−π, π) U (θ, r) = −|θ|, r ∈ F(A), θ ∈ [−π, π) Default value 1 Θw = π 2 (uniform) 1 1 N/A a = 1, ǫ = 0.7 N/A B. Results Fig. 5 shows the effects of the shape of the FR (as the eccentricity ǫ and the half-axis length a vary) on the packet speed Vp and the packet cost Cp . Here, and in all subsequent figures, the results obtained from our earlier analysis are shown as solid black lines, and the corresponding simulation results are shown as dotted red lines. &!% &!$ " 5 #" " 5 ## " 5 #$ " 5 #% "5& & ! &!" 01(2)+ (34+/ 01(2)+ 34))5/ ! &!# &!" " 6 #" " 6 ## " 6 #$ " 6 #% "6& & !% !$ !% !$ !# !# !" !" !" !# !$ '(()*+,-(-+./ !% & !" !# !$ '(()*+,-(-+./ !% & Fig. 5. Vp and Cp versus a and ǫ. Solid black lines depict our analytical results, and dotted red lines depict simulation results. Observe that, as the half-axis length a increases, the packet speed increases but so does the packet cost; this exemplifies the fundamental trade-off between these two metrics. The increase in the speed as a gets larger is because it becomes more likely for a node with a good travel direction to be available when the carrier changes direction to a bad one, and also (when ǫ > 0) because that node is farther ahead on the average; for the same reason, and also because the transmission cost function is quadratic, Cp also increases as a increases. In fact, as the figure suggests, we expect that when ǫ > 0, the speed diverges to infinity as a increases, since the expected progress per wireless transmission increases with a. On the other hand, the cost diverges to infinity, as a increases, even when ǫ = 0. 23 Regarding the effects of the eccentricity ǫ, observe that, starting from ǫ = 0 and increasing it, initially leads to higher speed and lower cost. This is natural, as the value ǫ = 0 corresponds to a circular FR, therefore neighboring nodes whose relative position is towards the positive x-axis are not given preference; this inefficiency is rectified as ǫ initially increases. However, increasing ǫ past ǫ ≈ 0.6 actually leads to an increase in the cost. Indeed, if the FR is too elliptical, it often happens that the packet is transmitted to nodes that are too far away from the current carrier, albeit with an excellent relative position, although there were other nodes that were much closer to the carrier with a relative position almost as good; as the cost is quadratic, this inevitably increases the packet cost. Large values of the eccentricity√also hurt the speed because, when ǫ increases, the area of the FR is reduced (the exact formula is |F(A)| = πa2 1 − ǫ2 ), and the packet spends more time traveling towards relatively bad directions on the buffers of nodes. In Fig. 6 we plot the values of Vp and Cp versus the two node parameters, namely, the node density λ and the node turning rate r0 . 1 !0" 7 #! 7! 7" 7$ ! ! % 3456)- 5'+-/ 2345)- +6))(/ ! 0 " " " " $ # " 02 01 " " " " 0$ 7 #! 7! 7" 7$ 0" ! ! " # &'() ()*+,-./ $ % ! " # &'() ()*+,-./ $ % Fig. 6. Vp and Cp versus λ and r0 . Solid black lines depict our analytical results, and dotted red lines depict simulation results. Regarding the effects of r0 , we first observe that, when r0 is very small, as long as the node density is not very small, the packet speed is almost equal to the node speed. Indeed, the packet stays with a node with a near-perfect direction for a significant amount of time, and in the infrequent cases when that node changes its direction, another one will be found within a relatively short time. Consequently, the packet cost is also very small. On the other hand, when r0 is not very small, then, the larger r0 is, i.e., the more frequently a node changes direction, the more frequent are the transmissions to nodes with better directions, and hence both the packet cost and the speed get larger; this effect on the speed crucially depends on the fact that transmissions are, on average, towards the direction of the positive x-axis, since, in this figure, we use the default value ǫ = 0.7. Regarding the effects of λ, when r0 is fixed and non-negligible, a low density λ leads to low packet speed, as the packet spends extended periods of time traveling towards bad directions; on the other hand, a large node density means that the packet travels fast, due to frequent transmissions. However, this effect diminishes as, after a while, a node with near-perfect travel direction is guaranteed to exist within the FR whenever the current carrier changes its travel direction; therefore, increasing the density further has no effect. On the other hand, Cp is near-constant as λ changes. To understand this, compare the high-density regime with the low-density regime: In the first case, the travel of the packet consists of wireless transmissions and physical transports in the right direction. In the second case, it again consists of wireless transmissions and transports in the right direction, but also involves extended periods of transports in random directions (which, on the average, produce no progress). The two cases differ significantly in their performance in terms of progress per unit time (i.e., the speed) but not in terms of cost per unit distance (in the positive x-axis direction), as transports in random directions have an approximately zero net 24 effect. Finally, in Fig. 7 we plot Vp and Cp versus the angular width Θw and the size a of the half-length, when ǫ = 0, i.e., the FR F is a circular disk. '% '5 6-7892 7:;24 !" 7-89:2 ;<::14 !" 56" # < 5$5 # < 5$% #< # < $% #<' # < '$% #<# # < #$% #<$ # = 5$5 # = 5$% #= # = $% #=' # = '$% #=# # = #$% #=$ 56! 56$ 56' 5 # ! " % ! $ ! ()*+,-. /01234 # " % 5 % 5 & ! ' # ! " % ! $ ! # " & ! ' ()*+,-. /01234 Fig. 7. Vp and Cp versus Θw and a. Solid black lines depict our analytical results, and dotted red lines depict simulation results. Once again we observe that, as in Fig. 5, increasing a increases both the speed and the cost. Indeed, the more nodes there are in the FR, the higher is the probability that, once the packet changes its travel direction, another node with a good travel direction will be available. However, in contrast to Fig. 5, as a increases the effects on the speed tend to diminish; indeed, after some value of a, the probability that an eligible node with a good direction exists is invariably close to unity, and because now the eccentricity ǫ = 0, wireless transmissions have a zero net effect on the speed of the packet, which does not change with a. As for Θw , its effects are much less pronounced: Both Vp and Cp change little with Θw . This can be justified by observing that changing Θw does not make the directions with which the nodes travel overall better, only differently distributed; still, the effects of Θw on the performance metrics are remarkably small. Finally, we note that the discrepancy between the simulation results and our analytical results is generally small and almost always modest. One exception is the setting of Fig. 7 in the cases of both small values of Θw and large values of a, where the discrepancy is significant. However, this discrepancy is not due to the inaccuracy of our two simplifying approximations but, rather, due to accumulating numerical errors. Specifically, in this regime, the errors due to the discretizations used are large, because there is a non-negligible probability that there will be two or more nodes in the FR with the exact same (discretized) travel direction and, hence, potential once a packet arrives at a new node or its current holder changes direction; note that our analysis assumes that the probability of this event is zero. Excepting this case, the discrepancy between simulations and analysis remains modest, although it does increase with r0 (cf. Fig. 6). Indeed, as r0 increases, the Second-Order Approximation is invoked more frequently, and the estimated rates with which the FR encounters eligible nodes deviate more from the actual ones. 25 VIII. C ONCLUSIONS In this work, we first introduced a mobile wireless DTN model in which nodes move on the infinite plane, according to a random waypoint mobility model, and a packet must travel to a destination located at an infinite distance away according to a routing rule that is using both wireless transmissions and physical transports on the buffers of nodes. The routing rule is defined in terms of a forwarding region and a potential function; specifying these leads to different versions of the routing rule. This model is quite general, notably including cases where the transmission cost depends on the direction of the transmission, arbitrary distributions for the direction of node travel, and a large variety of routing rules. In this setting, we defined two performance metrics: the speed with which the packet travels to its destination, and the rate with which the transmission cost is accumulated. We computed these performance metrics by adopting two simplifying approximations. These approximations ensure that a simpler discrete-time Markov chain embedded in the system description can be analyzed using general tools from Markov chain theory. The assumptions are intuitive, and furthermore are shown to introduce modest errors, on the order of no more than 10%, in the examples considered in our numerical evaluations. The present results help quantify the important trade-off that exists in mobile wireless DTNs between the speed with which packets travel to their destinations and the rate with which the transmission cost is accumulated. Also, the methodology we have developed may be extended in a variety of directions, e.g., to include the case where the velocity magnitude is not constant and the duration of time a node spends with a given travel direction depends on its velocity vector. Alternatively, the present development may also be used as a starting point for more accurate analytical approaches, e.g., maintaining more memory in each stage of the Markov chain. Related work on much simpler settings [22] suggests that dispensing with approximations altogether might be a formidable task. An interesting potential application of our work is towards studying the performance of non-delay-tolerant geographic routing protocols. Consider, for example, a simple RR with a circular FR of radius R, and such that when R → ∞, with probability going to 1 there will be an eligible node whenever a packet arrives at a new node; therefore, as R increases physical transports become less and less frequent. Taking the limit as R → ∞ of the cost Cp readily gives the performance of a non-delay-tolerant geographic routing protocol. Regarding future work, the present setting naturally leads to the problem of finding the best routing rules, e.g., those that achieve Pareto optimal combinations of delays and costs. Tackling this problem with tools from genetic algorithms or multi-armed bandit theory jointly with tools from stochastic geometry might be a fruitful strategy. Also, the assumption that all nodes travel with the same speed is not crucial and could be relaxed; for example, we could use a more general model under which each node travels, independently of all others, with a speed that is constant between the times the node changes direction, but the speed changes when the direction changes, and speeds associated with consecutive trajectory segments are independent random variables following some given distribution. Likewise, we could assume that the distribution of the duration of time a node spends with a given travel direction does depend on that direction. On the other hand, two other aspects of our model, namely, the independence of node trajectories and the changes of each node’s directions according to a Poisson process, cannot be easily relaxed, as that would introduce new sources of memory, making it more difficult to develop an accurate and tractable Markov chain model for the packet trajectory. 26 A PPENDIX In the first section of the Appendix we give the proofs of the theoretical results in Section VI. In the other sections we provide details on the numerical evaluation of the performance metrics and intermediate results. A. Proofs Below we establish Theorem 1, Lemmas 1 and 2, and Corollary 1. In several parts of the proofs where we need to invoke technical but quite standard arguments, some of the details are omitted. Proof of Lemma 1: It is obvious that it suffices to establish the result of the lemma for events of the form A = A0 × {0}, for A0 ⊂ [−π, π). And by the uniqueness of Carathéodory extension, since the collection of all finite unions of intervals forms an algebra that generates the Borel σ -algebra of S , it further suffices for A0 to only consider closed intervals, A0 = [θ1 , θ2 ]; see, e.g., [29], [30] for details. So in the rest of the proof we restrict attention to events A of the form A = [θ1 , θ2 ] × {0}. Also note that, from the expressions derived in Section V-B, it is simple to obtain the following bounds on the transition rates rA , rB , rC , rD , and on r(θ): r0 ǫD exp {−λ|F|} ≤ rA (θ, θ ′ ) ≤ r0 fD (θ ′ ), ′ ′ (28) ′ rB (θ, θ , r ) ≤ r0 λfD (θ ), rC (θ, θ ′ , r′ ) ≤ r0 λfD (θ ′ ), rD (θ, θ ′ , s) ≤ 2Mb λv0 fD (θ ′ ), r(θ) ≤ r0 + r0 λ|F| + 2Mb λv0 . (29) We note that ǫD is a lower bound on fD defined in Section III-A. Now, if s is of the form s = (θ, 0) for some θ ∈ [−π, π), then for any −π ≤ θ1 < θ2 < π , Z θ2 rA (θ, θ ′ ) ′ P (Si+1 ∈ [θ1 , θ2 ] × {0}|Si = (θ, 0)) = dθ , r(θ) θ1 so that, using the lower bound in (28) and the upper bound in (29), we have that, for some fixed constant δ1 > 0: P (Si+1 ∈ [θ1 , θ2 ] × {0}|Si = (θ, 0)) ≥ δ1 (θ2 − θ1 ). (30) Then, using the Markov property and applying (30) twice, P (Si+2 ∈ [θ1 , θ2 ] × {0}|Si = (θ, 0)) ≥ P (Si+1 ∈ SB |Si = (θ, 0)) δ1 (θ2 − θ1 ) ≥ 2πδ12 (θ2 − θ1 ). (31) Similarly, if s is of the form s = (θ, r) for some θ ∈ [−π, π) and r ∈ F , then by the Markov property, P (Si+2 ∈ [θ1 , θ2 ] × {0}|Si = (θ, r)) ≥ P (Si+1 = (θ, 0), Si+2 ∈ [θ1 , θ2 ] × {0}|Si = (θ, r)) Z θ2 rA (θ, θ ′ ) ′ = PE (θ, r) dθ r(θ) θ1 ≥ δ1 PE (θ, r)(θ2 − θ1 ) = δ1 exp{−E(N ; θ, r)}(θ2 − θ1 ), and recalling the expression for E(N ; θ, r) in (3) we clearly have E(N ; θ, r) ≤ λ|F|, so that, P (Si+2 ∈ [θ1 , θ2 ] × {0}|Si = (θ, r)) ≥ δ1 exp{−λ|F|}(θ2 − θ1 ). Combining (31) and (32) yields the required result, with ǫ = min{2πδ12 , δ1 exp{−λ|F|}}. (32)  Proof of Lemma 2: Since A has positive Lebesgue measure, we can find a rectangle of the form I = [θ1 , θ2 ] × [x1 , x2 ] × [y1 , y2 ] ⊆ SW with a nonempty interior, such that µ′ (A ∩ I) > 0. The idea of the main argument here is to show that there is a range of angles (θ1′ , θ2′ ) such that, when the current packet holder travels with a direction in (θ1′ , θ2′ ), there is a strictly nonzero probability that there are ineligible nodes in [x1 , x2 ] × [y1 , y2 ] that can become eligible by changing their travel direction to a better one within the range [θ1 , θ2 ]. 27 Since U (·, ·) is continuous, the image U (I) of I is a closed interval [a, b]. And since I has a nonempty interior, we must have a < b by Assumption 1. Also, by Assumptions 1 and 4, and noting that θ1 > −π in order to have I ⊆ SW , we must have b > a > U (−π, 0). Next, pick c, d such that U (−π, 0) < c < d < min{U (0, 0), a}, and let θ1′ and θ2′ be such that U (θ1′ , 0) = c and U (θ2′ , 0) = d; such angles are guaranteed to exist by the intermediate value theorem. Also, observe that U (·, ·) is continuous on the compact set [−π, 0] × [x1 , x2 ] × [y1 , y2 ], so it is uniformly continuous there, which implies that there is a θB > −π with U (θ, r) < c for all θ ∈ [−π, θB ] and all r ∈ [x1 , x2 ] × [y1 , y2 ]. Now take (θ ′ , r′ ) ∈ I and θ ∈ (θ1′ , θ2′ ) arbitrary. We will bound rC (θ, θ ′ , r′ ), given by (13), from below. First note that U (θ ′ , r′ ) > d and U (θ, 0) < d, therefore U (θ ′ , r′ ) > U (θ, 0). Also, we have U (θ ′′ , r′ ) < c < U (θ, 0) for all θ ′′ ∈ [−π, θB ]. Therefore, Z θB ′ ′ ′ rC (θ, θ , r ) ≥ λr0 fD (θ ) (33) fD (θ ′′ ) dθ ′′ ≥ λr0 ǫ2D (θB + π), −π where the second inequality follows by the fact that fD (·) is assumed bounded below by ǫD (cf. Section III-A). Also recall that r(θ) is bounded above as in (29). We are now ready to prove the inequality (25). For any θ ∈ (θ1′ , θ2′ ), where the interval (θ1′ , θ2′ ) is chosen above, Z rC (θ, θ ′ , r′ ) ′ ′ ′ P (Si+1 ∈ A|Si = (θ, 0)) ≥ P (Si+1 ∈ A ∩ I|Si = (θ, 0)) ≥ dµ (θ , r ) > 0. (34) r(θ) A∩I The last integral is strictly positive because µ′ (A ∩ I) is nonzero, rC (θ, θ ′ , r′ ) is bounded away from zero by (33), and r(θ) is bounded above by (29).  Proof of Theorem 1: First we will establish the ψ -irreducibility and aperiodicity [28] of the chain {Si }. In fact, we will show that, for any n ≥ 3 and any state s ∈ S , the measure ψ(·) is absolutely continuous with respect to the measure P (Si+n ∈ ·|Si = s). To that end, choose and fix an arbitrary state s ∈ S and an arbitrary measurable subset A of S with ψ(A) > 0, so that either (L1 × δ0 )(A) = µ(A) > 0 or (L1 × L2 )(A) > 0 (or both). In the first case, Lemma 1 implies that P (Si+2 ∈ A|Si = s′ ) > 0 for any s′ , which, together with the Markov property, implies that P (Si+n ∈ A|Si = s) > 0 for all n ≥ 2. In the second case, combining Lemma 1 with Lemma 2 applied to A ∩ SW and with the Markov property, we obtain that there are θ1′ < θ2′ such that Z θ2′ ′ ′ P (Si+3 ∈ A|Si+2 = (θ, 0)) dθ, P (Si+3 ∈ A|Si = s) ≥ P (Si+3 ∈ A, Si+2 ∈ (θ1 , θ2 ) × {0}|Si = s) ≥ ǫ θ1′ where the positivity of the last integral follows again from Lemma 2. Finally, using the Markov property once again, we have that P (Si+n ∈ A|Si = s) > 0 for all n ≥ 3, as required. Now, ψ -irreducibility and aperiodicity, together with the Doeblin bound of Lemma 1, imply [28], [31], that the chain is uniformly ergodic. Specifically, Lemma 1 implies that the state space S is small, and that the drift condition (V4) of [28] holds with Lyapunov function V ≡ 1. Then [28, Theorem 15.0.1] implies that the chain {Si } has a unique invariant (probability) measure π to which the distribution of Si converges uniformly, as stated in part 1) of the theorem. In particular, the chain {Si } is Harris recurrent, and [28, Theorem 17.0.1] implies that the strong law of large numbers holds for functions F ∈ L1 (π), as stated in part 2) of the theorem.  Proof of Corollary 1: Since XW,i and Ci = C(XW,i , YW,i ) are bounded, and hence π -integrable, functions of Si = (Θi , (XW,i , YWi )), the first two results immediately follow from Theorem 1. For the next two, let ψ̄ denote the measure ψ̄ = L1 × δ0 × [0, ∞) + L1 × L2 × δ0 on S̄ . Arguing as in the proof of Theorem 1, it is easy to show that the new chain {S̄i } is ψ̄ -irreducible and aperiodic, and also uniformly ergodic. Once again, [28, Theorem 17.0.1] implies that the strong law of large numbers holds for {S̄i }, and recalling that XB,i = v0 ∆i cos Θi , the last two statements of the corollary will follow as soon as we establish that ∆ is π -integrable. Indeed, since, given Θ = θ , ∆ is exponential with rate r(θ) ≥ r0 > 0, we have h 1 i 1 Eπ̄ (∆) = Eπ [Eπ̄ (∆|Θ)] = Eπ ≤ < ∞, r(Θ) r0 completing the proof.  28 B. The invariant distribution and expectations under π , π̄ Let ψB (θ), θ ∈ [−π, π), be the density of Θi ∈ SB under π , so that we think of ψ(θ)dθ is the long-term infinitesimal proportion of time that Θi ∈ [θ, θ + dθ) ⊂ SB . Similarly, let ψW (θ, r), (θ, r) ∈ SW , denote the joint density of (Θi , (XWi , YWi )) ∈ SW under π , so that we think of ψW (θ)dθdA as the long-term infinitesimal proportion of time that (Θi , (XW,i , YW,i )) ∈ [θ, θ + dθ) × dA(r) ⊂ SW , where dA(r) is the infinitesimal area element dA centered at r. In order to compute the functions ψB (θ) and ψW (θ, r), we derive balance equations, as follows. First, note that the proportion of state transitions out of [θ, θ + dθ] is ψB (θ)dθ . This should be equal to the proportion of transitions into [θ, θ + dθ], for which we observe that the proportion of transitions out of [θ ′ , θ ′ + dθ ′ ] (θ ′ ,θ) is equal to ψB (θ ′ )dθ ′ , and of these a proportion rAr(θ ′ ) dθ transitions to states inside [θ, θ + dθ]. Likewise, the proportion of transitions out [θ, θ + dθ] × dA(r′ ), where dA(r′ ) is the infinitesimal area element centered at r′ of size dA′ , is ψW (θ, r′ )dθdA′ . Of these, a proportion PE (θ, r′ ) enters [θ, θ + dθ]. Therefore, integrating over all relevant state transitions we have Z π Z ′ ′ rA (θ , θ) ′ ψB (θ ) ψB (θ) = ψW (θ, r′ )PE (θ, r′ ) dA′ . (35) dθ + r(θ ′ ) −π F Second, observe that the proportion of transitions out of [θ, θ + dθ] × dA(r) is ψW (θ, r)dθdA. This should be equal to the proportion of transitions into that set. To compute that, we observe that the state is in [θ ′ , θ ′ + dθ ′ ] for a proportion of time equal to ψB (θ ′ )dθ ′ and, at these instances, a proportion of transitions equal to rB (θ ′ , θ, r) + rC (θ ′ , θ, r) + rD̂ (θ ′ , θ, r) dθdA, r(θ ′ ) is into [θ, θ+dθ]×dA(r). Likewise, the proportion of transitions out of [θ ′ , θ ′ +dθ ′ ]×dA(r′ ) is ψW (θ ′ , r′ )dθ ′ dA′ . Of these, a proportion g(θ, r; θ ′ , r′ )dθdA enters [θ, θ + dθ] × dA(r). Again, integrating over all relevant state transitions we obtain, Z πZ Z π ′ ′ ′ ′ ′ rB (θ , θ, r) + rC (θ , θ, r) + rD̂ (θ , θ, r) ψW (θ ′ , r′ )g(θ, r; θ ′ , r′ ) dA′ dθ ′ . (36) dθ + ψB (θ ) ψW (θ, r) = ′) r(θ −π F −π In order to compute ψB (θ) and ψW (θ, r), we discretize their arguments, which converts the balance equations (35) and (36) into a large linear system; we also use the fact that the sum of their integrals should be equal to unity; see Section G for details. Then, having ψB (θ) and ψW (θ, r), we can readily derive the following expectations with respect to the invariant distribution of the chain: Z πZ ψW (θ, r)x dAdθ, Eπ (XW ) = F Z−π Z π ψW (θ, r)C(r) dAdθ, Eπ (C) = −π F Z π 1 ψB (θ) Eπ̄ (∆) = dθ, r 0 (θ) −π Z π 1 dθ, ψB (θ)v0 cos θ Eπ̄ (XB ) = r0 (θ) −π where the inner variable of integration in the first integral is r = (x, y). C. Numerical computation of integrals In a number of instances in this work we need to compute the values of a multivariate function that is given as a multiple integral. A good example is (3), which is of the following form: Z π ZZ I(θ, r; θ ′ , r′ ) dA′ dθ ′ . (37) f (θ, r) = −π F We show how we calculate this integral; all other similar integrals in this work are calculated using the same method, mutatis mutandis. 29 First, we discretize the variable θ , considering only the N values, π θi = −π + (2i − 1), i = 1, 2, . . . , N, (38) N where N is a positive integer. Second, we discretize r, by placing M points uniformly inside F . This is achieved as follows: we create L2 points,   2k1 − 1 2k2 − 1 (xk1 , yk2 ) = B −1 + , −1+ , k1 , k2 = 1, 2, . . . , L, (39) L L where L is a positive integer, and the parameter B is such that the region F (which we have assumed bounded) lies entirely within the square [−B, B] × [−B, B]; then, we keep those M points that are within the region F , denoting them as, rj = (rj , φj ) = (xj , yj ), j = 1, 2, . . . M, (40) in polar and Cartesian coordinates respectively. Then, we restrict ourselves to calculating f (θi , rj ) for all 1 ≤ i ≤ N , 1 ≤ j ≤ M , and equation (37) becomes, Z π ZZ I(θi , rj ; θ ′ , r′ )dA′ dθ ′ . (41) f (θi , rj ) = −π F This integral is calculated approximately as follows: We associate with each point (θi′ , rj ′ ), 1 ≤ i′ ≤ N , 1 ≤ j ′ ≤ M , the rectangle,     h π B πi B B B θ i′ − , θ i′ + × xj ′ − , xj ′ + × yj ′ − , yj ′ + , (42) N N L L L L of volume, 2π 2B 2B 8πB 2 × × = , (43) N L L N L2 so that these rectangles approximately partition the set [−π, π] × F over which the integral (41) is taken. And finally we set: M N X X I(θi , rj ; θi′ , rj ′ ). f (θi , rj ) = Vd Vd = i′ =1 j ′ =1 Clearly, the larger N and M are, the closer this approximation to the true values of f (θ, r). D. Speeding up the computation of E(N ; θ, r) A time-consuming part of the computations required for our numerical results is the repeated calculation of E(N ; θ, r) using (3). Indeed, E(N ; θ, r) is a function of two variables, and finding each of its values requires the evaluation of a multiple integral. However, assuming that the potential function U (θ, r) is only a function of θ makes this computation simpler. Indeed, in this case we have, Z π ZZ fD (θ ′ )1[U (θ ′ , r′ ) > U (θ, 0), r′ ∈ G(r)] dA′ dθ ′ −π ZFπ Z Z fD (θ ′ )1[U (θ ′ ) > U (θ)]1[r′ ∈ G(r)] dA′ dθ ′ = −π F   Z Z Z π ′ ′ ′ ′ ′ 1[r ∈ G(r)] dA = I1 (θ)I2 (r), fD (θ )1[U (θ ) > U (θ)] dθ = F −π where, I1 (θ) = I2 (r) = Z π fD (θ ′ )1[U (θ ′ ) > U (θ)] dθ ′ , (44) 1[r′ ∈ G(r)] dA′ . (45) −π ZZ F Both of these integrals can be computed beforehand for all necessary values of θ and r, either numerically or analytically, and be readily available when the calculation of E(N ; θ, r) starts. 30 Furthermore, when U (θ, r) = −|θ| then we have an even simpler expression for I1 : Z |θ| Z π ′ ′ ′ fD (θ ′ ) dθ ′ . fD (θ )1[|θ | < |θ|] dθ = I1 (θ) = −|θ| −π E. Speeding up the computation of g(θ ′ , r′ ; θ, r) Another time-consuming part of our computations is the calculation of g(θ ′ , r′ ; θ, r), using (5). This is because g(θ ′ , r′ ; θ, r) is a function of four variables, and each of its values requires the evaluation of a multiple integral. The calculation can be significantly simplified if we take into account any special structure of the FR and the potential function. For example, if U (θ, r) is only a function of θ , then (5) simplifies to, Z π ZZ fD (θ ′′ )1[U (θ ′′ , r′′ ) > U (θ ′ , r′ ), r′′ ∈ G(r)] dA′′ dθ ′′ −π ZFπ Z Z = fD (θ ′′ )1[U (θ ′′ ) > U (θ ′ )]1[r′′ ∈ G(r)] dA′′ dθ ′′ −π F  Z π  Z Z 1[r′′ ∈ G(r)] dA′′ = I1 (θ ′ )I2 (r), fD (θ ′′ )1[U (θ ′′ ) > U (θ ′ )] dθ ′′ = F −π where I1 (θ ′ ) and I2 (r) are given by (44) and (45). F. Speeding up the computation of rB (θ, θ ′ , r′ ) One final computational bottleneck is the calculation of rB (θ, θ ′ , r′ ) using (12), because it is a function of three variables and calculating any of its values again involves the evaluation of a multiple integral. Considering, as before, the case where the potential U (θ, r) is a function of θ only, the first integral in (12) becomes, Z π Z π     ′′ ′′ ′ ′ ′′ fD (θ ′′ )1 |θ ′ | < |θ ′′ | dθ ′′ = I3 (θ ′ ), fD (θ )1 U (θ , r ) > U (θ , 0) dθ = −π −π where, Z I3 (θ) = π −π   fD (θ ′ )1 |θ| < |θ ′ | dθ ′ . Furthermore, the multiple integral in (12) becomes, Z π ZZ fD (θ ′′′ )1[U (θ, 0) ≥ U (θ ′′′ , r′′′ ) > U (θ ′ , r′ )] dA′′′ dθ ′′′ −π ZFπ Z Z fD (θ ′′′ )1[|θ| ≤ |θ ′′′ | < |θ ′ |] dA′′′ dθ ′′′ = |F|I4 (θ, θ ′ ), = −π F where |F| is the area of F , and, I4 (θ, θ ′ ) = Z π −π fD (θ ′′ )1[|θ| ≤ |θ ′′ | < |θ ′ |] dθ ′′ . In order to speed up the relevant calculations, |F|, I3 (θ ′ ), and I4 (θ, θ ′ ) can be computed once in the beginning, and made available when the calculation of rB (θ, θ ′ , r′ ) starts. G. Numerical solution of (35) and (36) Finally, here we describe the numerical solution of the system of balance equations (35) and (36) derived in Section B of the Appendix above. As discussed there, we restrict ourselves to computing ψB (θ) and ψW (θ, r) only for the discrete sets of values of θ and r given in (38) and (39), respectively, so that (35) and (36) become, Z π Z ′ ′ rA (θ , θi ) ′ ψB (θ ) ψB (θi ) = ψW (θi , r′ )PE (θi , r′ ) dA′ dθ + ′) r(θ −π F Z π Z πZ ′, θ , r ) (r + r + r )(θ B C i j ′ ′ D̂ ψB (θ ) ψW (θi , rj ) = ψW (θ ′ , r′ )g(θi , rj ; θ ′ , r′ ) dA′ dθ ′ , dθ + r(θ ′ ) −π −π F 31 for 1 ≤ i ≤ N and 1 ≤ j ≤ M . Then we perform a piecewise constant approximation of the integrands in the rectangular sets (42), with the constant values being the values of the integrands at their centers. And taking the integral over the union of these rectangles, we get, X X rA (θi′ , θi ) ψB (θi ) = ψB (θi′ ) δθ + ψW (θi , rj ′ )PE (θi , rj ′ )δA, r(θi′ ) ′ ′ i ψW (θi , rj ) = j X ψB (θi′ ) X (rB + rC + rD̂ )(θi′ , θi , rj ) δθ + ψW (θi′ , rj ′ )g(θi , rj ; θi′ , rj ′ )δAδθ, r(θi′ ) ′ ′ i ,j i′  2B 2 where δθ = 2π . Multiplying the first equation by δθ , the second equation by δθδA, and defining, N and δA = L with a slight abuse of notation, ψB (i) , ψB (θi )δθ, ψW (i, j) , ψ(θi , rj ), and likewise for all other functions appearing in the balance equations, we obtain the system, X X rA (i′ , i) ψB (i) = ψB (i′ ) δθ + ψW (i, j ′ )PE (i, j ′ ), ′) r(i ′ ′ i ψW (i, j) = X i′ j X (rB + rC + rD̂ )(i′ , i, j) δθδA + ψW (i′ , j ′ )g(i, j; i′ , j ′ )δAδθ, ψB (i′ ) ′ r(i ) ′ ′ i ,j for 1 ≤ i ≤ N and 1 ≤ j ≤ M . This is a linear system of N + M N = N (M + 1) equations, which may be interpreted as expressing the balance equations of a discrete Markov chain with N (M + 1) states (because (6) and (18) ensure that the probabilities of transitions out of each state indeed add up to unity in all cases). To solve this system, we write it in the form ψ = Kψ , where ψ is a vector of length N (M + 1) consisting of ψB followed by each of the columns of ψW . Since the resulting matrix K is stochastic, by construction, we find an eigenvector corresponding to its top eigenvalue, which, after normalization, provides the required solution. 32 R EFERENCES [1] R. Cavallari, R. Verdone, and S. Toumpis, “Cost/speed analysis of mobile wireless DTNs under random waypoint mobility,” in Proc. Wiopt, Tempe, AZ, May 2016. [2] R. Cavallari, S. Toumpis, and R. Verdone, “Analysis of hybrid geographic/ delay-tolerant routing protocols for wireless mobile networks,” in Proc. IEEE INFOCOM, Honolulu, HI, Apr. 2018. [3] I. Kontoyiannis, S. Toumpis, R. Cavallari, and R. Verdone, “On calculating packet speed ad cost in a mobile wireless network model,” 2018, submitted to IEEE ISIT 2018. [4] A. Vasilakos, Y. Zhang, and T. V. Spyropoulos, Eds., Delay Tolerant Networks: Protocols and Applications. CRC Press, 2011. [5] P. Gupta and P. R. Kumar, “The capacity of wireless networks,” IEEE Trans. Inf. Theory, vol. 46, no. 2, pp. 388–404, Mar. 2000. [6] M. Grossglauser and D. N. C. Tse, “Mobility increases the capacity of ad-hoc wireless networks,” in Proc. IEEE INFOCOM, vol. 3, Anchorage, AL, Apr. 2001, pp. 1360–1369. [7] S. Diggavi, M. Grossglauser, and D. N. C. Tse, “Even one-dimensional mobility increases the capacity of wireless networks,” IEEE Transactions on Information Theory, vol. 51, no. 11, pp. 3947–3954, 2005. [8] S. Toumpis and A. J. Goldsmith, “Large wireless networks under fading, mobility, and delay constraints,” in Proc. IEEE INFOCOM, Hong Kong, China, Mar. 2004. [9] G. Sharma, R. Mazumdar, and N. Shroff, “Delay and capacity trade-offs in mobile ad hoc networks: a global perspective,” IEEE/ACM Trans. Netw., vol. 15, no. 5, pp. 981–992, Oct. 2007. [10] P. Jacquet, S. Malik, B. Mans, and A. Silva, “On the throughput-delay tradeoff in georouting networks,” IEEE Trans. Inf. Theory, vol. 62, no. 6, pp. 3230–3242, June 2016. [11] P. Jacquet, B. Mans, and G. Rodolakis, “Information propagation speed in mobile and delay tolerant networks,” IEEE Trans. Inf. Theory, vol. 56, pp. 5001–5015, Oct. 2010. [12] Y. Li and W. Wang, “Message dissemination in intermittently connected D2D communication networks,” IEEE Trans. Wireless Commun., vol. 13, pp. 3978–3990, July 2014. [13] E. Baccelli, P. Jacquet, B. Mans, and G. Rodolakis, “Highway vehicular delay tolerant networks: Information propagation speed properties,” IEEE Trans. Inf. Theory, vol. 58, no. 3, pp. 1743–1756, March 2012. [14] M. Zarei, A. M. Rahmani, and H. Samini, “Connectivity analysis for dynamic movement of vehicular ad hoc networks,” Wireless Networks, 2016. [15] E. Baccelli, P. Jacquet, B. Mans, and G. Rodolakis, “Multi-lane vehicle-to-vehicle networks with time-varying radio ranges: Information propagation speed properties,” in Proc. IEEE ISIT, Istanbul, Turkey, July 2013. [16] J. LeBrun, C.-N. Chuah, D. Ghosal, and M. Zhang, “Knowledge-based opportunistic forwarding in vehicular wireless ad hoc networks,” in Proc. IEEE VTC Spring, vol. 4, Stockholm, Sweden, May-June 2005, pp. 2289–2293. [17] K. Peters, A. Jabbar, E. K. Çetinkaya, and J. P. G. Sterbenz, “A geographical routing protocol for highly-dynamic aeronautical networks,” in Proc. IEEE WCNC, Cancun, Mexico, Mar. 2011, pp. 492–497. [18] A. G. Tasiopoulos, C. Tsiaras, and S. Toumpis, “Optimal and achievabnle cost/delay tradeoffs in delay-tolerant networks,” Computer Networks, vol. 70, pp. 59–74, Sep. 2014. [19] P. Madadi, F. Bacelli, and G. de Veciana, “On temporal variations in mobile users SNR with applications to perceived QoS,” in Proc. Wiopt, Tempe, AZ, May 2016. [20] B. Liu, P. Brass, O. Dousse, P. Nain, and D. Towsley, “Mobility improves coverage of sensor networks,” in Proc. ACM MobiHOC, Urbana-Champaign, IL, May 2005, pp. 157–162. [21] Y. Peres, A. Sinclair, P. Sousi, and A. Stauffer, “Mobile geometric graphs: Detection, coverage, and percolation,” Probab. Theory Relat. Fields, vol. 156, no. 1, pp. 273–305, 2013. [22] D. Cheliotis, I. Kontoyiannis, M. Loulakis, and S. Toumpis, “Exact speed and transmission cost in a simple one-dimensional wireless delay-tolerant network,” in Proc. IEEE ISIT, Aachen, Germany, June 2017. [23] A. Sidera and S. Toumpis, “Delay tolerant firework routing: a geographical routing protocol for wireless delay tolerant networks,” Eurasip Journal on Wireless Communications and Networking, Feb. 2013. [24] ——, “On the delay/cost tradeoff in wireless mobile delay-tolerant networks,” in Proc. Wiopt, Tempe, AZ, May 2014. [25] F. Baccelli and B. Blaszczyszyn, Stochastic Geometry and Wireless Networks, Vols I-II. Foundations and Trends in Networking, 2009. [26] A. Ephremides, “Energy concerns in wireless networks,” IEEE Wireless Commun. Mag., vol. 9, no. 4, pp. 48–59, Aug. 2002. [27] S. Ross, Stochastic Processes. New York, NY: John Wiley and Sons, Jan. 1995. [28] S. Meyn and R. Tweedie, Markov Chains and Stochastic Stability, 2nd ed. London: Cambridge University Press, 2009, published in the Cambridge Mathematical Library. 1993 edition online: http://probability.ca/MT/. [29] H. Royden, Real Analysis. New York: Macmillan, 1988. [30] D. Williams, Probability with martingales. Cambridge university press, 1991. [31] I. Kontoyiannis and S. Meyn, “Spectral theory and limit theorems for geometrically ergodic Markov processes,” Ann. Appl. Probab., vol. 13, pp. 304–362, February 2003.
7cs.IT
Comparative Studies of 10 Programming Languages within 10 Diverse Criteria Revision 1.0 Rana Naim∗ Concordia University Montreal, Quebec, Canada [email protected] Mohammad Fahim Nizam† Concordia University Montreal, Quebec, Canada [email protected] Sheetal Hanamasagar‡ Concordia University Montreal, Quebec, Canada [email protected] Jalal Noureddine§ Concordia University Montreal, Quebec, Canada [email protected] Marinela Miladinova¶ Concordia University Montreal, Quebec, Canada [email protected] Abstract This is a survey on the programming languages: C++, JavaScript, AspectJ, C#, Haskell, Java, PHP, Scala, Scheme, and BPEL. Our survey work involves a comparative study of these ten programming languages with respect to the following criteria: secure programming practices, web application development, web service composition, OOP-based abstractions, reflection, aspect orientation, functional programming, declarative programming, batch scripting, and UI prototyping. We study these languages in the context of the above mentioned criteria and the level of support they provide for each one of them. Keywords: programming languages, programming paradigms, language features, language design and implementation 1 Introduction Choosing the best language that would satisfy all requirements for the given problem domain can be a difficult task. Some languages are better suited for specific applications than others. In order to select the proper one for the specific problem domain, one has to know what features it provides to support the requirements. Different languages support different paradigms, provide different abstractions, and have different levels of expressive power. Some are better suited to express algorithms and others are targeting the non-technical users. The question is then what is the best tool for a particular problem. Aspects, like security and language safety, UI prototyping capabilities, language support for building distributed systems, and support for automating existing processes, and portability are also important issues to consider when choosing the programming language. In our analysis we discussed the suitability of the selected languages for the specified criteria. ∗ Primarily focused Primarily focused ‡ Primarily focused § Primarily focused ¶ Primarily focused † on Programming Languages C ++ and JavaScript on Programming Languages A s p e c t J and C# on Programming Languages H a s k e l l and Java on Programming Languages P H P and Scala on Programming Languages S c h e m e and BPEL Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report 1.1 Related Work The work of [6], [7], [15], [32], [54], [55], [67], [69], [84], [87], [95], [96], [147], [148] was a major influence of how this paper is written and the approach taken to compare the programming languages. In [6] the author emphasises the difference between design and implementation of languages and how the decisions in one influences the other. In [7] the author performs comparative study of model transformation languages in the context of MDE. The author in [15] compares different Web service technologies, paradigms, and their evolution. The author in [32] discusses technologies and architectures in the context of distributed systems. In [54] the author studies fundamental concepts of programming languages. In [55] study of language concepts of varying degree of abstraction is performed in the context of C++. Several studies have been performed previously among several programming languages and several programming paradigms. But, from our observation, AspectJ has not yet compared with C#, such way in any previous research work. We have found some great research work like [69], [84], [87], [95], [96] which were really interesting and motivated us to do some extensive research. Finally, [67] provided all the guidance necessary to perform this study. 1.2 Overview The rest of this paper is organized as follows. First we provide an overview of all the languages we have studied, beginning from Section 1.3 to Section 1.12. In Section 2, we have performed a detailed analysis of the studied languages in the context of the specified criteria. In Section 3, we consolidated our results, into a table supported by brief description. In Section 4 we conclude our work and incorporated some statistics about programming languages. 1.3 C++ Language Overview Different platform such as windows, Linux and UNIX has different instruction set. Any executable file that produced from compiling C++ code under X platform can't run under Y platform, e.g. a windowsexecutable file that comes from C++ code can only run under windows compatible environment.[199] 1.4 JavaScript Language Overview Java compiler in the other side converts the source code into intermediate code, each platform has a specific java virtual machine that run any intermediate code was been produced under any platform [199]. JavaScript language is able to use java objects and call their public methods, this facility earn the JavaScript to use what is exist in java and not exist in JavaScript. JavaScript code is compiled through interpreters been implemented in java language, these interpreters have external interface used to communicate with other external component. Script code that runs in the user side used to control the behavior of the end user [250]. 1.5 AspectJ Language Overview AspectJ is a general purpose programming language, which is simple and a practical Aspect-oriented extension to Java. AspectJ extends the Java language with keywords for writing aspects, pointcuts, advice code, and intertype declarations. Gregor Kiczales and his team, who has created a new programming paradigm AOP at the Palo Alto Research Center (PARC) [68], has also developed AspectJ—which is 2 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report now the leading tool for Aspect-oriented Programming. Using this, it is possible to create clean modular implementations of crosscutting concerns such as tracing, login, user session management, synchronization, consistency checking, protocol management etc. By creating, just a few new constructs, AspectJ provides support for modular implementation of a range of crosscutting concerns. Here in dynamic join point model, join points are well-defined points of the program where the advice code will be executed; pointcuts are collections of join points; advice are special method-like constructs that can be attached to pointcuts; and aspects are modular units of crosscutting implementation, comprising pointcuts, advice, and ordinary Java member declarations [70]. 1.6 C# Language Overview C# is a general-purpose, multi-paradigm, object-oriented programming language. The goal of the language is the increased programmer productivity. The language is becoming very popular because of its perfect balances of simplicity, expressiveness, and performance. The language is developed by Microsoft Corporation within the .Net initiative. The chief architect of the language since its first version is Anders Hejlsberg [75] who is also the original author of Turbo Pascal and the chief architect of Delphi. C# is a rich implementation of the object-orientation paradigm, which includes Data abstraction, Encapsulation, Inheritance, and Polymorphism. It is typically used for writing code that runs on Windows platforms. Although Microsoft standardized the C# language and the CLR through ECMA, the total amount of resources to support C# on other platforms than Windows is relatively small. The purpose of the Common Language Runtime (CLR) is to provide a language-neutral platform for application development and execution, including functions for exception handling, garbage collection, security, and interoperability [81]. 1.7 Haskell Language Overview Haskell is a Functional Programming Language. Haskell is named after Haskell B Curry who was one of the pioneers of the lambda calculus, which is a mathematical theory of functions and has been an inspiration to designers of number of functional languages [99]. Haskell is a Higher-Order Functions, Lazy Evaluation, light Syntax for data type, Purity- Not having side effects makes it possible to safely abstract any part of a function and replace it by parameter. The paradigm treats computation of mathematical functions and avoids state and mutable data. It is strongly typed, eliminating a huge class of easy to make errors at compile time. No possibility core dumps [100]. For example, in Java one can write a function that accepts two arguments of any possible type. However, Haskell goes further by allowing a function to accept two arguments of any type so long as they are both the same type [101]. 1.8 Java Language Overview Java is a programming language originally developed by James Gosling at Sun Microsystems. It is strongly typed object oriented that provides an excellent means of modularizing and structuring programs. It also supports concurrent execution of multiple threads as well as some key synchronization mechanisms. Integrated exception handling mechanism- Rich set of integer and floating-point data types, and Java.math package supports for user documentation. General coding style guidelines supports abstraction and information hiding, code portability [102]. 3 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report 1.9 PHP Language Overview PHP is a powerful scripting language that can be run by itself in the command line of any computer with PHP installed [156]. PHP was originally created by Rasmus Lerdorf in 1995 and stood for "Personal Home Page" and was released as a free, open source project. In 1997, PHP was renamed to "PHP: Hypertext Preprocessor". PHP is especially well-suited for creating dynamic web pages with connectivity to various database systems (MySQL is the most widely used because PHP provides native support for it and the database is free and an open-source project). PHP runs on different platforms and is compatible with almost all servers used today. PHP is easy to learn and runs efficiently on the server side. 1.10 Scala Language Overview Scala stands for ―Scalable Language‖. Scala is a general purpose programming language designed to express common programming patterns in a concise, elegant, and type-safe way. It smoothly integrates features of object-oriented and functional languages, enabling Java and other programmers to be more productive. Code sizes are typically reduced by a factor of two to three when compared to an equivalent Java application [157]. Scala runs on the standard Java platform and interoperates seamlessly with all Java libraries [158]. 1.11 Scheme Language Overview General Characteristics Scheme is a multi-paradigm programming language supporting functional, procedural, object-oriented, meta, web applications, batch/CGI/Shell scripting application development. It has small language core and powerful tools to allow the language to be extended. The goal stated in the Scheme de facto standard is to provide a base from which compatible implementations can be built. A typical characteristic of all dialects of Lisp, including Scheme, is that they are homoiconic, i.e. self-representing. A list in Scheme can be interpreted as a data structure or a source listing to be compiled and executed. Type-safety is another characteristic targeted by the Scheme‘s de facto standard. Although, the language is dynamically type (type checking, the binding of variable names to object types is done at run time) and supports implicit polymorphism (variables don‘t have types and can be bound to any value that has a type), Scheme is type safe. The type system with its typing rules for type equivalence and type compatibility are strictly enforced by the implementation. Application of a function to objects with types that cannot support that function is not allowed. Scheme language is considered strict because its side-effect functions are always strict (the function is undefined when any if its arguments is undefined.) This is due to the applicative order of evaluation of arguments passed to functions [6]. Scheme is the first Lisp dialect to support lexical (static) scoping, i.e. the binding of the variable name usage to its declaration can be inferred from the program text, without the need to trace the execution history (dynamic scoping) to determine the name to declaration binding. This makes programs easier to write and understand, and prevents the introduction of many difficult to track programming errors [6]. Another characteristic of Scheme is that it is an expressive language in which algorithms can be represented concisely. Scheme‘s homoiconic feature allows it to express uniformly the design, implementation, and semantics of the language in addition to the data that is handled by the programs expressed in the language. The 4 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report architecture of the system, a Scheme program is implementing, can be expanded or created at runtime by compiling and interpreting a newly created source code. Scheme has a reach reflective system to support meta-programming. It also supports both applicative (a.k.a. eager) order of evaluation of arguments to functions and normal (a.k.a lazy) order of evaluation of special forms such as cond special form. Scheme uses Cambridge Polish (parenthesised) notation for expressions. The first element inside parenthesis is a function or a macro (special form) and the rest are its parameters. Anonymous functions are defined using lambda special form [6, 17]. Functions and Control Flow During a typical function call scenario, the implementation restores the referencing environment conforming to the lexical scoping rules. At this time, arguments in the referencing environment are bound to the formal parameters of the function. Each expression inside the function is sequentially evaluated and the value of the last expression is the return value from the function, which can be another function [6]. Scheme provides multi-way conditional expression and special forms for assignment, sequencing, iteration (imperative constructs), delay and force for lazy evaluation. Arguments of special forms are passed unevaluated. The expression types (functions and special forms) in Scheme can be primitive (built-into the language implementation) and derived (defined in terms of primitives.) Lambda special form can be used to build derived functions. To build derived special forms (macros), syntax-rules special form is used. These forms can be bound to names using define-syntax and let-syntax. This mechanism allows for language expansion and creation of libraries [6]. Scheme Implementations Implementations of Scheme languages include both commercial and free and run on different platforms. Some examples of graphical programming environment implementations follow: 3DScheme, 3DScheme Pro and EdScheme, Bee DrScheme, fluxus, a livecoding environment, SchemeWay, a Scheme environment built atop Eclipse, Pilo Visual Tools for Scheme [12, 13]. A rich list of Scheme implementations is given in [13]. 1.12 BPEL Language Overview General Characteristics The goal of BPEL language is to allow for the smooth integration of heterogeneous systems in different application domains such as business-to-consumer, business-to-business, and enterprise application integration, for example. Typical interaction scenarios involve sequences of peer-to-peer, long-running, stateful message exchanges between two or more participants. Web services described by WSDL support stateless, one-way, uncorrelated message exchanges. BPEL is built to bridge this gap in the requirements [16]. 5 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report The BPEL language automates business processes by a way of orchestrating existing functionality (services) that expose their interfaces as web services using WSDL as the standard language. BPEL processes are themselves web services described using WSDL. To achieve easy integration of heterogeneous web services, SOAP is used as the messaging protocol. It is an XML-based protocol which allows XML messages (data) to be transported in a platform neutral and programming model independent way [16]. The BPEL process consists of abstract and executable part. The abstract process is not executable and specifies the external message exchanges between partners and does not contain any internal details about the business process. The executable process defines both the external messages and the logic and it is executable [15]. Concepts relevant to BPEL processes are: (1) message flow to describe the order in which external web services are invoked; (2) control flow to specify the order in which activities within the process execute; (3) data flow of stateful interactions which include the content of the messages that are exchanged, the intermediate data used in internal computations, and the composed messages sent to partners [15]. Functions and Control Flow The BPEL process specifies how multiple service interactions between partners are coordinated to achieve a business goal, as well as the state and the logic necessary for this coordination. It introduces exception handling mechanism and compensation mechanism to roll-back a failed unit of work transaction [16]. The computational model is imperative in nature and structured-programming constructs are used to specify the internal logic. The data model used by BPEL is defined using WSDL messages and XML Schema type [16]. Scopes are used as the encapsulation mechanisms and they are lexical (static) in nature. Scopes can be nested. Each control flow construct has its own scope. Scopes can exist without a control flow construct. Variables comply with the static rules that can be inferred from the program text. There are no subroutine or function constructs. The BPEL module itself can be considered as one function (in the imperative programming-model sense) or subroutine. Internal concurrency is afforded by the use of the Flow construct. Iteration is achieved using While, RepeatUntil, and ForEach constructs. Events handling is achieved thought the onMessage and onEvent that are encapsulated inside a Pick construct. Pick is blocking in nature and waits for a specific event to occur or a message to arrive. After the event is handled within the Pick scope, control is released to the rest of the process. Conditional logic is expressed using If construct. Although previously existed, the Switch construct is not part of BPEL version 2.0 OASIS standard [16]. Updates to variables are achieved using the Assign construct. BPEL uses Invoke to request a service or delegate a computation to another Web service. Since BPEL is a web service which exposes its capabilities using a WSDL interface, it can be invoked. BPEL is capable of receiving external requests using its Receive construct and Reply is used to return a response to the client that invoked the process. BPEL Implementations BPEL implementations include ActiveVOS, Open Source, The Eclipse STP BPMN Diagram Editor, Eclipse BPEL project, Orchestra Fully Open source, extensible and flexible BPEL Solution, The Open Source BPMS (Eclipse and Apache-based), Apache ODE, Open source BPEL server, NetBeans Enterprise Pack, and BPEL for Windows Workflow Foundation [14]. 6 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report 2 Analysis 2.1 C++vs. JavaScript 2.1.1 Default more secure programming practices C++ The operating system is written in c language, therefore, C++ is close to the operating system, especially when it relates to pointers and memory access, this fact makes C/C++ unsafe [198]. In C++ it is easy to have illegal access to the memory object. There is no internal exception handling for out of memory boundary when dealing with arrays. Allocating and de-allocating memory space is error prone in C++ language, which easily may introduce privacy leak. Memory management with C++ in most cases needs to be done by the programmer, which complicates debugging task. C++ susceptible to buffer overflow if there is no checking to the input length of any function [198]. e.g the following code may lead to stack over flow see figure 2 and 3. int main() { char *name[2]; name[0] = "/bin/sh"; name[1] = NULL; execve(name[0], name, NULL); return 0; } Fig. (Stack after some function has been called) [198] 7 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report Fig 1. (Stack after buffer overflow) [198] It is recommended to follow guidelines when programming in C++ [198], I will mention the following some:       Enforce standard coding style guidelines Validate function's inputs Trace your code. Do not ignore warning prompts that is produced from code compilation. Use object oriented style that hides properties and encapsulates implementations. Prevent privacy leak. There are more guidelines exists on [198]. JavaScript Most of the JavaScript features are inherited from Java language, Java language has a lot of build in security features [198], one of the security challenges of JavaScript is to provide a secure environment to run mobile code [200]. The Java language originally built to mitigate many programming mistakes, it is known that Java is type-safe and have the feature of memory management that checks arrays' boundary. Java virtual machine applies strict mechanism to prevent stack overflow from happening. Java and JavaScript faces the following threats [200]:         A malicious subclass may clone or/and override random methods. If the code is operating with privileged access, then most probably there will be flaws. Privileged access need to be given to trusted entities. Running unprivileged code in a sandbox will solve the problem. Java library could be replaced with a malicious implementation. Exception handling may show sensitive knowledge. E.g, a java.io.FileNotFoundException shows the file path, since many attacks need to know the file path. Dynamic SQL creation along with untrusted input leads to injection flow. Code can be hidden in a script API, if that code is malicious, then a big threat may be introduced. Malicious code may use RMI and LDAP to inject himself to the system. JavaScript is dynamically typed [204]. 8 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report  JavaScript does not check arrays boundary, so strings and arrays has variable length [204]. There are more threats exists on [200]. Most of previous threat may be isolated is we use isolate unrelated code using package.access security property. private static final String PACKAGE_ACCESS_KEY = "package.access"; static { String packageAccess = java.security.Security.getProperty( PACKAGE_ACCESS_KEY ); java.security.Security.setProperty( PACKAGE_ACCESS_KEY, ( (packageAccess == null || packageAccess.trim().isEmpty()) ? "" : (packageAccess + ",") )+ "xx.example.product.implementation." ); } Guideline 1-1b Isolate unrelated code [200] 2.1.2 Web Application Development C++ C++ can be used for creating web applications using Wt C++ Toolkit [210], [211], Wt C++ is C++ library developed for web applications [211]. Wt encapsulates many web details, e.g. Wt does not show details of embedded with the web form [211]. The components of WT C++ are ordered in hierarchical widget tree, The library provides Web Widget which is called WWebWidget it deals with server-side HTML DOM. Theses components are piece of text (WText), a table (WTable), a line edit (WLineEdit), and so on. The following example print hello world with quit button [211]. 9 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report This code is taken from [211] JavaScript JavaScript is imperative scripting language that mainly used for internet applications, it helps to do computations associated with HTML and is interpreted by client browser, also it motivates the client to use websites, JavaScript brings the dynamic changing to the websites. JavaScript makes the computation done at client side, which increases the network bandwidth and improve computations performance [204], [227]. JavaScript in some cases used to check the validity of input data entered by user side, this will help to do the checking at client side, better than doing that computation at server side, otherwise the server has to send notification message and ask the user to redo data entry [227]. Moving the computation from server side into client side improves web computations and reduces the network bandwidth. Imagine some social web application like face book, a lot of updates happen in a second and needs to maintain the privacy of it's clients. If the server is responsible to control every client connected in any moments, then the face book servers is going to shutdown soon, due to the loads are considered huge. JavaScript script helps reducing this issue by doing this control at client side [242]. The following is an example of JavaScript code declares two integers, do some computations and print the result: <html><body><script type="text/javascript"> var x = 8; var y = 5; var z = x*y; 10 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report document.write(z); x++; y--; z=x*y; document.write("<br />"); document.write(x*y); </script> <p>The script above declares variables, assigns values to them, do some computations, displays the computation values, and displays the value again.</p> </body></html> 2.1.3 Web services design and composition C++ C++ web services use XML remote procedure protocol (XML-RPC) or Simple Object Access Protocol (SOAP) as a transport layer to send a request and receive a response [212]. The following figures shows how to deploy a services as well as how to transport the request and receive the response [212]. XML-RPC helps the messaging and establishes the communication across different platforms. This picture is taken from [212] 11 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report This picture is taken from [212] There is a good example that shows how to deploy C++ web services and invoke those services at [212]. The following steps used to deploy a web service using SCA Service Component Architecture, the examples bellow is taken from [213]: i. To declare services, we should declare an interface that abstracts super class, which only contains virtual functions [213]: This code fragment is taken from [213]. 12 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report ii. Then, the developer implements the interface already declared in the previous step. This code fragment is taken from [213] This code fragment is taken from [213] iii. Use WSDL generator to generate a WSDL portType [213]. This code fragment is taken from [213] 13 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report The following figure shows the complete image and connection for the previous steps [213]. This code fragment is taken from [213] iv. In the client side, we use a C++ code to call the method implemented in the server side. We need in this case to know the service name and the port address [213]. JavaScript We can call a web services from the client using script language such as JavaScript, JAX-WS is a Java API for XML-Based Web Services is a framework helps to do web service [243] The following example defines a Web service with just one operation called hello that accepts one parameter of type string, you will notice the tag @ WebService to declare that the attached class is a web service interface. Webservice tag declare the service name and host address and the port number as well. If the port numer is not mentioned, the default port no is called. @Webmethod tag used to define a web service operation and its parameters as well as it implementation [243]. import javax.jws.WebService; import javax.jws.WebMethod; import javax.jws.WebParam; @WebService(targetNamespace="http://test.omii.ac.uk") public class Hello { @WebMethod public String hello(@WebParam(name = "name") String name) { 14 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report return "Hello " + name + "!"; } } The following code example is taken from [243] Then we need to deploy it as a JAX-WS Web service, the following WSDL is generated by WSDL tool used to deploy previous declaration [243]. <definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://test.omii.ac.uk" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://test.omii.ac.uk" name="HelloService"> <types> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://test.omii.ac.uk"> <xs:element name="hello" type="tns:hello" /> <xs:element name="helloResponse" type="tns:helloResponse" /> <xs:complexType name="hello"> <xs:sequence> <xs:element name="name" type="xs:string" minOccurs="0" /> </xs:sequence> </xs:complexType> <xs:complexType name="helloResponse"> <xs:sequence> <xs:element name="return" type="xs:string" minOccurs="0" /> </xs:sequence> </xs:complexType> </xs:schema> </types> <message name="hello"> <part name="parameters" element="tns:hello" /> </message> <message name="helloResponse"> <part name="parameters" element="tns:helloResponse" /> </message> <portType name="Hello"> <operation name="hello"> <input message="tns:hello" /> <output message="tns:helloResponse" /> </operation> </portType> <binding name="HelloPortBinding" type="tns:Hello"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> <operation name="hello"> <soap:operation soapAction="" /> <input> <soap:body use="literal" /> </input> <output> <soap:body use="literal" /> </output> </operation> 15 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report </binding> <service name="HelloService"> <port name="HelloPort" binding="tns:HelloPortBinding"> <soap:address location="http://localhost:8080/context/HelloService" /> </port> </service> </definitions> The following code example is taken from [243] The following is SOAP invocation [243] HelloService service = new HelloService(); Hello port = service.getHelloPort(); String response = port.hello(name); The following code example is taken from [243] The following the invocation for hello service: import javax.xml.rpc.Call; import javax.xml.rpc.Service; import javax.xml.rpc.ServiceFactory; [...] String endPoint = "http://localhost:8080/context/HelloService"; Service service = ServiceFactory.newInstance().createService(); Call call = service.createCall(); call.setTargetEndpointAddress(endpoint); call.setOperationName(new QName(OPERATION_NAMESPACE, "hello")); String response = (String) call.invoke(new Object[] {name}); The following code example is taken from [243] We can call the web services using JavaScript code, this will facilitate the design of web services, we do not need to create complex client design, all we need to implement JavaScript code which will be embedded in a HTML file and run this scrip remotely in client side, the following figure and JavaScript code shows how to call "hello" web service [214]. 16 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report <script language="JavaScript"> init(){ service.useService("http:// http://test.omii.ac.uk/hello.asmx?WSDL",_ "hello"); } function tst(){ iCallID = service.Service1.callService("hello","Concordia"); } function onmyresult(){ service.innerHTML= "Resultado : " + event.result.value; } </script> <body onLoad="init();"> <button onclick="javascript:tst()" ID="Button1">Call Add Web Method</button> <div id="service" style="BEHAVIOR:url(webservice.htc)" onresult="onmyresult();"> </div> </body> The following code example is taken from [214] after doing some modifications Dealing with JavaScript in order to call web services leads to a simple and flexible solution, hence you don't need to be aware of all transportation mechanism details such as SOAP which is used as a transport layer for web service implementations [244]. 2.1.4 OO-based abstraction C++ C++ supports both imperative and object oriented based programming style, it provides stack and hap allocation, but it emphasizes the stack model. C++ provides multiple inheritance and exception handling as well as interface definition. C++ does not have garbage collection mechanism as Java did, therefore memory allocation that done by programmer, need to be returned by the programmer himself/herself. C++ support both static and dynamic binding [228]. CPP is built on C and enhance imperative properties and add new features to support object oriented programming. CPP support classes which consider the bases for object oriented programming, for example, to declare a String in CPP, the following class is useful: 17 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report class String{ private: char* str; public: String(char [] str1) { Str=new char[strlen(str1)]; for (int i = 0; i<strlen(str1);i++) str[i] = str1[i];} ~String(){ delete [] str; } } C++ support function overloading, also it supports namespaces, which is a methodology used to group multiple classes and namespaces as well as related properties. Also CPP supports Abstraction, encapsulation, inheritance, methods, virtual functions and polymorphism. The following example shows that [206]: This code is taken from [207] In the previous example we have three types of animals: Cat, Tiger and Ocelot, each of which has different kind of sound "meow", now, we can create a pointer of base class which may point to an object of one of Cat, Tiger and Ocelot. If we call the method "meow" at run time, the implementation of meow method only determined at run time "dynamic binding" this is called polymorphism [206], see the run and the result below: 18 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report This code and run is taken from [207] JavaScript Java Language fully support object oriented concepts and features such as inheritance or polymorphism, however, JavaScript doesn't support inheritance or virtual functions. JavaScript can run within any browser that support JavaScript interpreter [204]. JavaScript support simple object-based paradigm, it allows the programmer to build complex data structure [245], [246]. JavaScript support class construct and it allows defining methods and properties as well as event handler, thus it allow to abstract different kind of objects [247], [248]. All JavaScript data types has instance methods, all data types in JavaScript are Inherited from Object, all objects in JavaScript have prototype [251]. JavaScript support namespaces, which is a methodology used to group multiple classes and namespaces as well as related properties [248]. JavaScript support static and dynamic binding, Example of dynamic binding [250]. importPackage(java.util); var hashtable = new Hashtable(); $javadate = new Java(―java.util.Date‖) $socket = new Java(―java.net.Socket‖, ―java.sun.com‖, 80) 19 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report JavaScript support function overloading, e.g. [250]: void write(String s) void write(int i) JavaScript permits the developer to define classes and variable types as well as JavaScript has built-in JavaScript objects [205]. See the following example <script type="text/javascript"> var str="Hello world!"; document.write(str.toUpperCase()); </script> There is no class abstraction in JavaScript, but we can create a an abstract definition of an object in JavaScript. To start with, we need to declare a namespace, suppose that we want to declare a namespace Animal, the following line do that [248],[251]: Type.registerNamespace("Animal"); Then, to declare a class Cat, we need to include it into a namespace, the following lines declares Cat constructor [248]: Animal.Cat = function(catType, catName, catAge) { this._ catType = catType; this._ catName = catName; this._ catAge = catAge; } The following example shows how to define the class itself, prototyping the properties, methods [248]: Animal.Cat.prototype = { getCatType: function() { return(this._catType);}, getCatName: function() { return(this._catName);}, getCatAge: function() { return(this._catAge);}, getCatInformation: function() { var str = this._catName + " is a " + this._catType + " Cat that is age: " + this._catAge; return(strDetails); 20 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report }, dispose: function() {alert("destroying " + this.getCatName());}} The next step is to register the class [248]: Animal.Cat.registerClass('Animal.Cat'); JavaScript support inheritance and it is based on prototypes concepts which works as a template for new objects [251], this mechanism helps the programmer to avoid declaring common tasks. JavaScript support interface definition and declaration, interfaces help to group common methods that distributed among different class definitions. JavaScript support reflection [248]. JavaScript support some basic collection and other objects like Date, Math, and Arrays [246]. The following example depicts how to deal with array's object <html><body><script type="text/javascript"> var mycars = new Array(); mycars[0] = 1; mycars[1] = 2; mycars[2] = "Car"; for (i=0;i<mycars.length;i++) {document.write((mycars[i]+1) + "<br />");} </script></body></html> You will figure out that to declare a variable in JavaScript, you need to use var keyword. This var keyword will help you to declare any type. 2.1.5 Reflection C++ Reflection is a mechanism that helps the C++ program that is dealing with undefined object compile time, the program check itself and based on some conditions it going to create specific object and invoke its method. Reflection here in a programming context means to build a generic code that deals with undefined object. This mechanism facilitates remote method invocation and serialization. C++ doesn't support reflection [215]. Devadithya et al states that there are two types of reflections: compile-time reflection and run-time reflection, the decision for which code need to be bind at compile time, the decision depends on the 21 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report metadata availability at compile time [217]. The run-time reflection depends on the program knows the type information at run time, in this case the program able to take the decision at run time, so the reflection behavior happens dynamically at execution time. C++ doesn't support run-time reflection due to the unrecognizing detailed type information because of the C++ complier hides these information. Run-time reflection in C++ is limited to some features such as monitoring expression types and querying the type name [217]. The following fragment shows how to depicts reflection in C++ [217], classType = ClassType::getClass(‗‗Service1‘‘); obj = classType.createInstance(); obj.invoke(‗‗method1‘‘); Previous code shows how to call any configurable methods. Here is another example [218]: MemberFunction mf = ct->getMemberFunction("m1"); mf.invoke<int>(&myClassObj); This code to invoke member function m1 which returns int and does not accept any argument. Remote method invocation is kind of reflection ability, which allow a program to run a code remotely, that code could change depends on the remote host, the remote host could decide to change the implementation of remote method. Also the local host is able to change which method to call by changing the calling argument m1, in the previous example, into different method name [217]. Devadithya et al demonstrated that reflection can be added to C++ language, for more details, see [217],[218]. JavaScript Java supports reflection as part of their standard specifications. Reflection in JavaScript context means the ability of a program to dynamically examine program structure and get current object information such as which instance of which class, or which inherited class and or which interface that it implements, as well as class properties and methods [217],[219], and[248]. JavaScript is build on top of Java, ExtendScript is a construct facilitates a reflection behavior; this construct helps to provide information about objects such as its name, a description and properties, as well as input parameters and return type [219]. 22 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report JavaScript support reflection object, which is a construct that provides the program with reflected-objects' contents, short and long description, all method and defined interface, and all properties defined in the reflected-object's class, the following code is an example of this [219]: var f = new File ("myfile"); var props = f.reflect.properties; for (var i = 0; i < props.length; i++) { $.writeln(‘this property ‘ + props[i].name + ‘ is ‘ + f[props[i].name]); } The following example shows an example of object and retrieves it properties, methods information, and data type properties [219] obj = new String ("hi"); obj.reflect.name; // => String obj = new String ("hi"); obj.reflect.methods; //=> indexOf,slice,... obj.reflect.find ("indexOf"); // => the method info Math.reflect.properties; //=> PI,LOG10,... This code gets a list of properties: Math.reflect.find ("PI").type; // => number This code gets the data type of a property 2.1.6 Aspect-orientation C++ Aspects in AspectC++ implement crosscutting concerns in a modular way. Pointcut is considered the major element in AspectC++, pointcut composes single or multiple joint points that need to be used across multiple functions or namespace. Joint point may be evaluated at compile time or at run time [195]. In AspectC++, there are two types of pointcuts: code pointcuts and name pointcuts, for more information, see aspectc++ manual [195]. The following code describes code joint point [195]. 23 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report This figure is taken from [195] 24 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report The previous code example and figure is been taken from aspectC++ manual [195] to depicts the meaning of name joint point, code joint point. In aspectC++, each join point could be a function, an attribute, a type or a variable. Depending on the kind of pointcuts, they are evaluated at compile time or at runtime. Name pointcuts may compose types, attributes, functions, variables, or namespaces. Code point cut is an execution point of a function that is repeated in multiple places ia a program [195]. It is possible to mix name pointcuts and code pointcuts within pointcut expression. Pointcut expression is a way for search pattern that uses special character as a wildcard used to aggregate and simplify describing collection of classes, cunfcting or names that share some characters [195]. JavaScript XHTML has the advantage to separate web form from its content, this helps to improve the separation of concern for aspect oriented language (AOP). AOP centers around the separation of concern approach, this means to create the main program that invoke the sub programs, each subprogram is concern to perform specific task or concern, such as logging, authentication and synchronization, which are usually repeated and used at many places in many programs [220]. Login and synchronization concerns called cross cutting, AOP helps to improve the memory usage and synchronize cross cutting modification by encapsulation these cross cutting in modular form [220]. JavaScript and C++, have the feature to weave advice code into destination code, this helps to change the behavior of the program without refractor the original code. The advice code is written in a separate file, and woven into the original code at execution time. In java platform, this integration could be in the source code level or byte cide level [220]. JavaScript support AOP utility, as example of advise idiom that have three kinds of aspect directions are seen in the following example [196]. Aspects = new Object(); Aspects._addIntroduction = function(intro, obj) { for (var m in intro.prototype) { obj.prototype[m] = intro.prototype[m]; } } Aspects.addIntroduction = function(aspect, objs) { var oType = typeof(objs); if (typeof(aspect) != 'function') throw(InvalidAspect); if (oType == 'function') { this._addIntroduction(aspect, objs); } 25 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report else if (oType == 'object') { for (var n = 0; n < objs.length; n++) { this._addIntroduction(aspect, objs[n]); } } else { throw InvalidObject; } } Aspects.addBefore = function(aspect, obj, funcs) { var fType = typeof(funcs); if (typeof(aspect) != 'function') throw(InvalidAspect); if (fType != 'object') funcs = Array(funcs); for (var n = 0; n < funcs.length; n++) { var fName = funcs[n]; var old = obj.prototype[fName]; if (!old) throw InvalidMethod; obj.prototype[fName] = function() { aspect.apply(this, arguments); return old.apply(this, arguments); } } } Aspects.addAfter = function(aspect, obj, funcs) { if (typeof(aspect) != 'function') throw InvalidAspect; if (typeof(funcs) != 'object') funcs = Array(funcs); for (var n = 0; n < funcs.length; n++) { var fName = funcs[n]; var old = obj.prototype[fName]; if (!old) throw InvalidMethod; obj.prototype[fName] = function() { var args = old.apply(this, arguments); 26 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report return ret = aspect.apply(this, Array(args, null)); } } } Aspects._getLogic = function(func) { var oSrc = new String(func); var nSrc = ''; var n = 0; while (oSrc[n]) { if (oSrc[n] == '\n' || oSrc[n] == '\r') nSrc[n++] += ' '; else nSrc += oSrc[n++]; } n = 0; while (nSrc[n++] != '{'); nSrc = nSrc.substring(n, nSrc.length - 1); return nSrc; } Aspects.addAround = function(aspect, obj, funcs) { if (typeof(aspect) != 'function') throw InvalidAspect; if (typeof(funcs) != 'object') funcs = Array(funcs); var aSrc = this._getLogic(aspect); for (var n = 0; n < funcs.length; n++) { var fName = funcs[n]; if (!obj.prototype[fName]) throw InvalidMethod; var oSrc = 'var original = ' + obj.prototype[fName]; var fSrc = oSrc + aSrc.replace('proceed();', 'original.apply(this, arguments);'); obj.prototype[fName] = Function(fSrc); } return true; } 27 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report 2.1.7 Functional programming C++ FC++ is a rich library that supports functional programming in C++. FC++ library provides support to polymorphism using C++ type inference. Big part of c++ standards library is implemented in functional model. C++ language as a functional programming style has the advantage to direct mainplatation for the memory, and has primitive support for dealing with pointers [221]. C++ is object based programming language that support creating classes using the class or struct keyword, C++ support operator overloading. This overloading helps the developer to teach class of object how to deal with operator. The following example shows how to overload "()" operator [221] The figure above is taken from [255] To declare a function in C++, the function should have the following syntax: Return-type function-name(parameter-type parameter-list) {| statement1 statement2 } The following in an example of function add that accepts two parameters and return the addition of the two parameters: 28 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report int add (int a, int b){ return a+b; } JavaScript JavaScript support functional programming [222]. JavaScript support standard functions such as map reduce and select. See the following example [223]: map('x*x', [1,2,3,4]) The result is [1, 4, 9, 16] select('>2', [1,2,3,4]) The result is [3, 4] reduce('x*2+y', 0, [1,0,1,0]) The result is 10 map(guard('2*', not('%2')), [1,2,3,4]) The result is [1, 4, 3, 8] In JavaScript block does not have scope, only function have scope [224], To declare a function in JavaScript the key word "function" is used followed by function name and then parameters [225]: function fname(value1,value2, ...) { statement1 statement2 . } See the following example [225]: <HTML> <HEAD> <TITLE>A function definition</TITLE> <SCRIPT LANGUAGE="JavaScript"> <!-- Hiding JavaScript function listItems(itemList) 29 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report { document.write("<UL>\n") for (i = 0;i < itemList.length;i++) { document.write("<LI>" + itemList[i] + "\n") } document.write("</UL>\n") } // End hiding JavaScript --> </SCRIPT> </HEAD> <BODY> <SCRIPT LANGUAGE="JavaScript"> <!-days = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday") listItems(days) // --> </SCRIPT> </BODY> </HTML> Another example with function that have return value [225]: function average() { var items = average.arguments.length var sum = 0 for (i = 0; i < items;i++) { sum += average.arguments[i] } return (sum/items) } The following is the call of the function average: document.write(average(6,9,8,4,5,7,8,10)) 2.1.8 Declarative programming C++ C++ is an imperative, object based and functional programming paradigm. I didn't find enough references that depict C++ as supporting declarative language. Pro*C mainly used for dealing with databases, it allows the developer to connect into a database and extract or manipulate SQL statements. Pro*C has some declarative statements mainly used to execute SQL statements, the following figure depicts eight declarative statements [233]: 30 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report The figure above is taken from [233] Compiling Pro*C program is passé two phases, the first phase is to compile Pro*C pre-compiler and the second phase is to compile SQL statements and replaces them with suitable methods that perform the task [233]. JavaScript JavaFX is built on the top of Java platform and it supports web applications. JavaFX support desktops, browsers and mobile phones and TV set-top boxes. JavaFX Scrip language considered of declarative language [230]. Compiling JavaFX files will result in java byte code, this java byte code is protable and can execute in a plateform that has a suitable java virtual machine [230]. JavaFX software provide the ability to control playback videos, this ability comes from javafx.scene.media API package. The mentioned API allows the programmer to built new features in the elaborate video player. JavaFX technology allows the programmer to build customized graphical tool, to see more capabilities of JavaFX, see [229]. JavaFX script allows the programmer to declare web API application only by using predicates that describes desired GUI components as well as the relationship between them, and then JAVAFX script interprets these components [231],[232] the following example depects that and it is taken from [232]. import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.shape.Rectangle; import javafx.scene.paint.Color; import javafx.scene.shape.Circle; Stage { title: "Declaring Is Easy!" scene: Scene { width: 300 height: 250 content: [ Rectangle { x: 25, y: 80 width: 250, height: 80 arcWidth: 20 arcHeight: 20 31 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report fill: Color.web("#6699ff") stroke: Color.web("#003399") strokeWidth: 5.0 }, //Rectangle Circle { centerX: 150 centerY: 120 radius: 80 fill: Color.MAROON stroke: Color.INDIANRED strokeWidth: 10.0 } //Circle ] //Content } //Scene } //Stage The following picture shows the result of executing previous code [232]: 2.1.9 Batch scripting C++ I didn‘t find any resources talks about batch script with cpp, I found one cite [253] talks about C++ script. C++Script uses C++ library and C++ header files, it uses a dynamic programming and cen be compiled with C++ compiler. With C++ scripting the developer can use dynamic typing by declaring a variable with ―var‖ tag, and static typing by using C++ types. Dynamic typing may lead to runtime errors; the following code is in C++ script [253]: #include <cppscript> var script_main(var args) // a function called script_main { writeln("Hello world!"); return 0; } 32 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report Variable types in C++ script are : integers, doubles, strings, chars, Booleans containers (arrays, maps, lists etc), objects, methods, functions, iterators and null [253]. C++ Script support C++ operator, casting, comparison, scope, cloning, control flow, foreach statement, user defined functions, exception handling, throw exception, catch and finally statements [253]. JavaScript Javascript is able to detect, add, move, change, create, or delete, read and write remote files. The following is JScript Sample [236]: // Instantiate a File System ActiveX Object: var fso = new ActiveXObject("Scripting.FileSystemObject"); // Invoke the method: var a = fso.CreateTextFile("c:\\testfile.txt", true); // Do something with it: a.WriteLine("This is a test."); // Close the connection: a.Close(); 2.1.10 UI prototype design C++ Prototype means analyzing the problem, mapping to existing solutions and design, producing a simple design that simulate the solution and the improving the design until we reach to that final result, this will defiantly leads to save money and resources. Prototyping helps the developer to Proof of concept, exploring the design and choose the suitable language to implement the design [239]. C++ provides many compilers for GUI designs and prototypes, such as [238]:       ActiveX: allows the developer to use existing components, such as Internet ActiveX controls, which helps to use the Interent as virtual environment. ATL: Active Template Library. A collection of template-based C++ classes that works with MFC components. COM: Component Object Model. A technique used for interprocess communications like remote method invocation in Java. DCOM: Distributed COM. GLUT: OpenGL Utility Toolkit. An independent library used for OpenGL programs. GUI: graphical user interface. More information about these compilers and other can be extracted from [238]. MFC C++ provides the help for developers to develop windows applications and user interface applications this is considered fast technology to create UI prototypes in windows platform. The Web browser has the capabilities to reuse HTML UI with windows' components UI-prototype-windows-style [238], [239]. 33 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report JavaScript JavaScript support prototyping, which helps the developer to use this concept to simulate inheritance in JavaScript programs, all objects have their own prototypes, and all of them inherent the base object prototype. This fact makes adding a new method instance a simple task, the following example shows how to add method push to object of type array [251]: Array.prototype.double = function() { var newArray = []; // inside this function, "this" refers to the array for (var i = 0, length = this.length; i < length; i++) { newArray.push(this[i]); newArray.push(this[i]); } return newArray; }; var exampleArray = new Array(1, 2, 3); // inherits all the properties of Array.prototype exampleArray.double(); //-> [1, 1, 2, 2, 3, 3] Because exampleArray is a instance of Array object, then it inherent the new instance method push and works as depicted in the previous implementation [251]. There is a javascript library called Prototype, this library used with dynamic web applications. This library aims to reduce JavaScript coding [252]. Prototype Window Class (PWC) is a JavaScript class that provides the developer the ability to easily generate windows-style API within an HTML file [240],[241]. The following lines shows an example of windows-style API [241]: 34 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report The generated windows inherent all features from windows GUI components. Means, you can maximize, minimize, move generated windows. The following figure shows Prototype Window Class properties and methods [241]. 35 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report JavaScript uses The Scripting API javax.script package which includes the following interfaces: Bindings, Compilable, , Invocable, ScriptContext, ScriptEngine and ScriptEngineFactory. And classes: AbstractScriptEngine, CompiledScript, ScriptEngineManager and SimpleBindings, and one exception class: ScriptException. The detailed information about these classes, interfaces are found in the following cite [249]. 2.2 AspectJ vs. C# 2.2.1 Default more secure programming practices Secure programming or safe programming is primarily based on two important properties of programming languages: type safety and memory safety. The fundamental characteristic guaranteed by type safety (strong typing) is type soundness, because ensuring type-safety is one of the key issues to protect the system against various security threats. Also as a requirement to be type-safe, a language should have garbage collection or otherwise it has to restrict the allocation and de-allocation of memory [74]. C# is primarily a type-safe language, i.e., types can interact only according to the rules defined and not violated by program semantics, thereby ensuring each type’s internal consistency. More specifically C# supports static typing, which allows it to perform the type checking at compile time. Moreover, C# has one distinguishable feature to make the certain part of a program dynamic typed via the dynamic keyword. C#‘s CLR has a garbage collector that executes as part of the program, frees the memory for managed objects automatically that are no longer referenced. This technique relieves programmers from explicitly de-allocating the memory for an object. In Listing 1, when Test method executes, an array to hold 500 bytes is allocated on the memory heap. When the method exits, this local variable test_arr pops out of scope, meaning that nothing is left to reference the array on the memory heap. The array then becomes eligible to be reclaimed in garbage collection to free the memory. However, it is possible to force to work Garbage Collector by calling GC.Collect. public void Test() { byte[] test_arr = new byte[500]; .......... } Listing 1: Example C# memory allocation In addition to this C# supports the disposal pattern explicitly by implementing the IDisposal interface. The Dispose method released the unmanaged resources like database connections, handles, files etc. As shown in the Listing 2, MyClass has implemented the IDisposable interfaces to release the unmanaged resources like file object. class MyClass : IDisposable { FileStream myStream; //large object public MyClass (string filePath) { myStream = new FileStream (filePath, FileAccess.ReadWrite); } public void Dispose() { 36 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report myStream.Dispose(); //remove myStream from the GC finalize queue GC.SuppressFinalize(myStream); } } Listing 2: Example C# Dispose method for unmanaged resource [80] On the other hand, AspectJ is also a static-typing programming language and also considered as type-safe like its base class Java. However, researches [95] have revealed that, unlike Java, AspectJ does not have a safe type system, a binding between a pointcut and an advice can rise to type errors at runtime. Also, AspectJ‘s typing rules severely restrict the definition of certain generic advice behavior. In AspectJ, a cross-cutting concern i.e., memory monitoring and management can be applied at a pointcut of the program for better memory management. This approach can be used for both managed and unmanaged resources (files, handles, DB connections etc.). C# is a static typing and type-safe programming language, whereas AspectJ is not really a typesafe language in some sense. But a cross-cutting concern can applied for better memory management in AspectJ, which could be an important application of this. 2.2.2 Web Application Development A web application is a kind of application that is accessed over a network such as the internet or an intranet [75]. It is usually hosted in a web server and from the client side operated by thin client. Web applications are getting very popular due to the ubiquity of web browsers, and the convenience of using a web browser as a client. Nowadays, various platforms and frameworks have been implemented for web development. Primarily, web application development required coding and development in two specific areas, i.e. server sided scripting and client side scripting. For client side development, programming/scripting languages like JavaScript, Flash - Action Script, Ajax etc. are very popular. For server side development, C#, AspectJ can be used in their own framework or platform. C# language of .Net platform is used for web application development in ASP .Net technology, where every ASPX file can have a C# class. The C# file that contains this class used for ASP .Net programming implementation is called Code Behind File. This class may contain initializes, event handlers, supporting methods and codes etc. The developed web applications are needed to host in the Microsoft IIS server. The web development using C# is performed in the Visual Studio IDE, which provides extensive and rich support for development like web forms designer, various built in web server controls, framework libraries etc. Development using C# is flexible, faster and convenient for the programmers. In Web application development, AspectJ separates the cross-cutting concern from the core concern and perform several activities. In a research of IBM, Ron Bodkin has implemented several monitoring, checking and error handling technique using AspectJ [87]. These can be implemented in Web application development:      Monitor multiple applications Monitor & detect for common application failure Error handling & repair Database request monitoring Authentication, verification and user session management 37 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report AspectJ provides an improved technique to implement the cross-cutting concern in a better way without hampering the existing code. But, comparatively C# is better for rapid and convenient web development, whereas AspectJ is better for modular coding. 2.2.3 Web services design and composition A Web service is a software system designed to support interoperable machine-to-machine interaction over a network. It has an interface described in a machine-process able format (specifically WSDL). Other systems interact with the Web service by its description using SOAP messages, typically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards [76]. So, basically Web services are based on a core set of standards that describe the syntax and semantics of communication. Here, XML provides the common syntax for representing data; the SOAP (Simple Object Access Protocol) provides the semantics for data exchange; and the WSDL (Web Services Description Language) provides a mechanism to describe the capabilities of a Web service. Unlike traditional client-server systems, such as a web page, Web service do not provide the users with GUI rather share business logic and various processing through a interfaces across the network. The .NET Framework provides extensive support for interoperability through Web services. In C#, using the .NET Framework, Visual Studio, and ASP.NET, creating a Web service is as simple as just create a Web service project and add a public attribute WebMethod, which is to expose [81]. Creating a Web Service is simpler in C# using .NET Framework and the Visual Studio IDE. Compiling and deployment of the Web service is easy and faster. A simple Web service example is given here, which receives a message from the client and returns the same. //services.asmx – C# Web Service using System; using System.Web; using System.Web.Services; using System.Web.Services.Protocols; [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] public class Service : System.Web.Services.WebService { public Service () { } [WebMethod] public string echo(string message) { return message; } } Listing 3: A simple Web service developed in C# A simple aspect-oriented Apache Axis Web service (equivalent to the previous one created in ASP .Net) that has been created using AspectJ is mentioned here. Apache Axis is rapidly becoming popular web service implementations for Java developers. It also has a high scale of success in interoperability with 38 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report other web services and frameworks such as .NET. When Apache Axis running within Tomcat server in a machine, we can use the following code to compile and deploy as a simple aspect-oriented web service: //MyWebService.java package com.oreilly.aspectjcookbook; public class MyWebService { public String echo(String message) { return message; } } Listing 4: Web service Class – Web Method //AddMessageHeaderAspect.java package com.oreilly.aspectjcookbook; public aspect AddMessageHeaderAspect { public pointcut captureEcho(String message) : execution(public void MyWebService.echo(String)) && args(message); Object around(String message) : captureEcho(message) { return "Your original message was: " + message; } } Listing 5: Web service Aspect //deploy.wsdd <deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"> <service name="MyWebService" provider="java:RPC"> <parameter name="className" value="com.oreilly.aspectjcookbook.MyWebService"/> <parameter name="allowedMethods" value="*"/> </service> </deployment> Listing 6: deploy.wsdd for automatic deployment 39 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report This example is taken from the ―AspectJ Cookbook‖ by Russell Miles. Basically, AspectJ can perform various functionalities as a Web service [87]:  It can monitor multiple services hosted on a single server  It can monitor web service call  Monitor for service failure and repairmen in the service pipeline Creating a web service in AspectJ is comparatively more tedious and complicated than C#. It required to compile the source file to class file, than creating of deploy.wsdd is required for automatic deployment of the service and also some additional work to make the service live in the tomcat server. Whereas, in the case of C#, it is very fast and easy to deploy a service in the IIS server. But, in AspectJ the separation of cross-cutting concern can make the service more modular. AspectJ can separate the cross-cutting concern from the core concern and perform monitoring, verification, authentication or providing notification without tangling or scattering the code. 2.2.4 OO-based abstraction Object-oriented programming (OOP) is a programming paradigm that uses ―objects" data structures consisting of data fields and methods together with their interactions to design applications and computer programs [75]. In OOP, programming techniques may include features such as data abstraction, encapsulation, modularity, polymorphism, and inheritance. Object-Oriented Development Methodology has basically four principles. Its entities and the relationships between them must satisfy the following four principles [77]. Abstraction of data and functions principle: This means that the computation is separated specifically into entities, each consisted of data and functions. These are the only functions permitted to manipulate the data of the entity directly. The whole entity can be manipulated as a unit. This is one of the most important principles of Object-Oriented paradigm. Information encapsulation principle: This means that the implementation information and the mechanism of a computational entity are hidden from other computational entities. Each entity is only required to provide a well defined interface for the other entities to interact with each other. The purpose of this principle is to shield a service using entity like class from the implementation details of the service provider entity. Inheritance principle: This means that we can create a child entity based on a parent entity. So the child entity can obtain all the properties from its parent entity and the new entity can be changed in data and functionality to perform the specific new task. This capability provides different ways of utilizing and reusing previously developed entities. Polymorphism of methods: The polymorphism principle is the ability to create methods which have similar but some entity specific functionality. The principle is implemented in conjunction with the inheritance principle. 40 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report //Example Simple Object-oriented approach by C# class MyClass { private int x; // private access private int y; // private access public int z; // public access // Methods to access x and y. //a member of a class can access the private members of the same class. public void Setx(int a) { x = a; } public int Getx() { return x; } public void Sety(int a) { y = a; } public int Gety() { return y; } } //Using the class from main class Program { static void Main(string[] args) { MyClass ob = new MyClass(); // Access to x and y is allowed only through setx() and getx() methods. ob.Setx(-99); ob.Sety(19); ob.z = 5; Console.WriteLine("ob.x is " + ob.Getx()); Console.WriteLine("ob.y is " + ob.Gety()); // It cannot be accessed for x or y like this: // ob.x = 10; // Wrong! x is private! 41 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report // It is OK ob.z Console.WriteLine("ob.z is " + ob.z); Console.ReadKey(); } } Listing 7: Simple Object-oriented program by C# From the Listing 7, here we see a simple C# program that satisfies the basic principles and properties of OO paradigm like class, method, message passing, abstraction, message passing, encapsulation etc. On the other hand, in AspectJ an aspect can encapsulates the implementations of cross-cutting functionalities. Aspects are similar to classes in many ways. The similarities [82] are discussed below in detail… Aspects Can Include Data Members And Methods: The data members and methods in aspects have the same role as in classes. For instance, an aspect can manage its state using data members, whereas methods can implement behavior that supports the crosscutting concern‘s implementation or can be utility methods. Aspects may also have constructors included. Aspects Can Have Access Specifications: An aspect‘s access specifier provides its visibility like the same as classes and interfaces. Top-level aspects can have only public or package access. Moreover, nested aspects are also similar to nested classes, which can have a public, private, protected access specifier. Aspects Can Be Abstract: Like a class, an aspect that contains abstract pointcuts or methods must declare itself as an abstract aspect. An abstract aspect can mark any pointcut or method as abstract and refer to it from other constructs. Any subaspect of an abstract aspect that doesn‘t define every abstract pointcut and method in the base aspect, or that adds additional abstract pointcuts or methods, must also declare itself abstract. The following example shows an abstract aspect that contains an abstract pointcut and an abstract method: Aspects Can Extend Classes And Abstract Aspects, as well as Implement Interfaces: Aspect has the inheritance properties, which is one of the basic principles of OOP. In the example, below, the following concrete aspect extends the AbstractTracing aspect. So that, it is able to provide the definitions for its abstract pointcut and method by matching the requirements of tracing the banking system: public aspect BankingTracing extends AbstractTracing { public pointcut traced() : execution(* banking..*.*(..)); public Logger getLogger() { return Logger.getLogger("banking"); 42 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report } } Aspects Can Be Embedded In Classes And Interfaces As Nested Aspects: Aspects can be embedded into classes and interfaces when the aspect‘s implementation is closely tied to its enclosed class or interface. . Though C# and AspectJ are two languages from two different programming paradigms (object-oriented and aspect-oriented respectively), their key properties like classes & aspects have some significant similarities. An aspect supports the object-oriented properties like abstraction, encapsulation, inheritance etc (partially in some cases). Moreover, AspectJ is developed as extension of Java, which is often called a pure object-oriented language and undoubtedly it supports all the four major principles of OO programming [72]. Basically, an Aspect is required for separating the cross-cutting concerns, but the core concerns can be implemented using object-oriented methodology. And, eventually AspectJ comes up with the support of both the programming paradigm OOP & AOP. 2.2.5 Reflection Reflection-oriented programming, or reflective programming, is a functional extension to the objectoriented programming paradigm. Reflection-oriented programming includes self-examination, selfmodification, and self-replication. However, the emphasis of the reflection-oriented paradigm is dynamic program modification, which can be determined and executed at runtime. Reflection in a programming language can be used to observe and dynamically modify or change the program execution at runtime [75]. In C#, many of the classes that support reflection are part of the .NET Reflection API, which is in the System.Reflection namespace. Thus, any program that will use reflection will have to include the System.Reflection namespace. The reflection namespace has very rich and powerful support for reflective programming, which has extended C# for reflection-oriented programming paradigm. A static binding example below is represented dynamic use of reflection. // Without Reflection string s = "Programming"; int length = s.Length; // With Reflection object s = "Programming"; PropertyInfo prop = s.GetType().GetProperty("Length"); // GetValue can get the value of the PropertyInfo int length = (int)prop.GetValue(s, null); Listing 8: Reflection example of C# In AO languages such as AspectJ offer very powerful but, controlled mechanisms to modify the execution flow. AspectJ offers an alternative way to access the static and dynamic context associated with the join points through a reflection API. For example, through this API, we can access the name of the currently advised method as well as the argument objects to that method. The most common use of this reflective information is to implement tracing and similar aspects [82]. 43 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report Both C# and AspectJ supports reflection in their area with their powerful and controllable API/namespace. C#‘s Reflection namespace is based on its OO paradigm; whereas AspectJ‘s Reflection API is on AO paradigm. 2.2.6 Aspect-orientation Aspect-oriented programming (AOP) is a programming paradigm in which secondary or supporting functions are isolated from the main program's business logic [67]. It aims to increase modularity by allowing the separation of cross-cutting concerns and forming a basis for aspect-oriented software development. All AOP implementations have some crosscutting expressions that encapsulate each concern in one place. Till the release of C# 4.0, there are no extensions or implementation was carried out by Microsoft Corporation for Aspect-oriented programming paradigm. But, there are currently several AOP Frameworks available for the .NET space implemented by third party, each with their own approach and having their own positive and negative attributes. Among those, Spring.Net [83] is the most renowned one, which provides comprehensive infrastructural support for developing enterprise.NET applications, with AOP implementation. Spring.NET AOP is implemented in C# language. There is no need for a special compilation process - all weaving is done at runtime. Spring.NET AOP does not need to control or modify the way in which assemblies are loaded, and is thus suitable for use in any CLR environment. Since C# doesn‘t support the AOP yet, we‘ll see by example, an implementation of authentication procedure in C# and the response of AspectJ, on the other hand. class Program { static void Main(string[] args) { SendMessage sm = new SendMessage(); Authenticator auth = new Authenticator(); try { auth.authenticate(); //check and authenticate sm.sendNow("This is an important message."); } catch(Exception ex) { //catch the exception generated for verification failure Console.WriteLine("User/password didn't match"); }; Console.ReadKey(); } } //Sending the message public class SendMessage { public void sendNow(String message) { Console.WriteLine(message); } } 44 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report // Authanticator.java public class Authenticator { public void authenticate() { string user = ""; string pass = ""; try { //user input for user and password Console.Write("Username: "); user = Console.ReadLine().Trim(); Console.Write("Password: "); pass = Console.ReadLine().Trim(); } catch(Exception ex) { Console.WriteLine(ex); } //if user name and password is not same then throw exception if(user!=pass) throw new Exception(); } } Listing 9: Implementation of Authenticated Message Sending in C# Before delivering a message, an authentication method required to invoke to check whether the user is authenticated or not. Each method that requires to be authenticated has to call authenticate method, which leads to code tangling. Similar code needed to be included in all the classes that require authentication. // main.java public class Main { public static void main(String[] args) { SendMessage sm = new SendMessage(); sm.sendNow("This is an important message."); } } // SendMessage.java public class SendMessage { public void sendNow(String message) { System.out.println(message); } } // SecurityAspect.aj public aspect SecurityAspect { 45 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report private Authenticator authenticator = new Authenticator(); pointcut secureAccess() : execution(* SendMessage.sendNow(..)); before() : secureAccess() { System.out.println("Checking and authenticating user"); authenticator.authenticate(); } } // Authanticator.java public class Authenticator { public void authenticate() { String user = new String(); String pass = new String(); BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); try { System.out.print("Username: "); user = in.readLine().trim(); System.out.print("Password: "); pass = in.readLine().trim(); System.out.print(user + " " + pass); } catch(IOException ex) {} if(!user.equalsIgnoreCase(pass)) throw new AuthenticationException("User/password didn't match"); } } // AuthenticationException.java public class AuthenticationException extends RuntimeException { public AuthenticationException(String message) { super(message); } } Listing 10: Implementation of Authenticated Message Sending in AspectJ Without changing a single line of code in the SendMessage class from listing 9, we can enhance its functionality by adding an aspect to the system, which is mentioned here as SecurityAspect. The Authenticator class asks for credentials (username and password) when the authenticate() method is called. The AspectJ example here is written by with help from the book AspectJ in Action by Ramnivas Laddad [82]. 46 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report So, from two above examples, it is easily understandable that for cross-cutting concern like logging, authentication can make the OO code tangling or scattered, whereas AOP programming makes it more modular and readable. 2.2.7 Functional programming Functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions and avoids state changes and mutable data. It emphasizes the application of functions, in contrast to the imperative programming style, which emphasizes changes in state. Programming in a functional style can also be accomplished in languages that aren't specifically designed for functional programming. For example, in C# 3.0 or higher, lambda functions can be employed to write programs in a functional style [67]. The code example of functional implementation is taken from c-sharpconner.com [84]. With the release of the 3.5 framework, we have a completely different coding style available (functional programming). We could actually do functional programming in the 2.0 framework, but the resulting code was ugly and hard to understand at a glance and hard to maintain as well. Now, with lambda method syntax and extension methods, we can produce code written in a functional style as in the Listing below. Here, the convert method is used to trim the empty space from the ends of the strings by passing method defined using lambda syntax: // Functional prgramming example with Lanbda expression File.OpenText(str1[0]).Use(stream => { stream .ReadToEnd() .Split(' ') .Convert(str => str.Trim()) .GetCounts((x, y) => x == y) .ForEach(kvp => String.Format("{0} count: {1}", kvp.Key, kvp.Value.ToString())); }); Listing 11: Implementation Functional Style Specifically in AspectJ, no functional programming implementation is observed. Rather in some research works, aspect-oriented functional language implementation or prototype implementations are found, such as Aspectual Caml [88], AspectFun [89] and AspectML [90]. In these papers, authors made an approach to build aspect-orient extension over a functional language to create a multi-paradigm or hybrid programming language, which is reverse in this occasion. Basically, Aspect-oriented programming paradigm is developed on top of Object-oriented programming paradigm. And AOP core concerns are primarily developed in object-oriented approach. Since AspectJ is developed as a superset of Java, it holds all the functionalities and properties of Java. Superficially, Java is not a functional language; however, using interfaces and inner classes it is fairly easy to mimic some of the important features of functional programming [92]. Using an interface for real functions, it is possible to write functions that take functions as parameters and construct and return new function. In addition to that, some open source implementations are available for functional programming in Java like FunctionalJ, Functional Java, JFun etc. In the next release of Java, which is JDK7, Lambda expression will be introduced with more functional programming concepts like closure, higher order function etc. [93]. 47 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report So in comparison with AspecJ and its subset Java, C# provides more functional programming ability with its built in namespace and library. 2.2.8 Declarative programming Declarative programming is a programming paradigm that expresses the logic of a computation without describing its control flow. Many languages applying this style attempt to minimize or eliminate side effects by describing what the program should accomplish, rather than describing how to go about accomplishing it. Declarative programming is often defined as any style of programming that is not imperative. A number of other common definitions exist that attempt to give the term a definition other than simply contrasting it with imperative programming[72]. For example:    A program that describes what computation should be performed and not how to compute it Any programming language that lacks side effects (or more specifically, is referentially transparent) A language with a clear correspondence to mathematical logic. C#‘s ability to programming in declarative style can be observed through its two new implementation, those are LinQ and regular expression. LINQ, or Language Integrated Query, is a set of language and framework features for writing structured type-safe queries over local object collections and remote data sources. LINQ was introduced in C# 3.0 and Framework 3.5. It enables to query any collection implementing IEnumerable<T>, whether an array, list, or XML DOM, as well as remote data sources or database tables. Additionally, the regular expressions a notable implementation of C# language is able to identify complicated character patterns. [85]. //Example LINQ implementaion var linqdata = row_line.AsQueryable(); //getting values from rowline collection // Linq expression for getting the counts for each key/combination groups var Found = from ad in linqdata group ad by ad into g select new { Names = g.Key, Counts = g.Count() }; //Example Regular Expression [85] Regex bp = new Regex(@"\d{2,3}/\d{2,3}"); // exp. to find the blood pressure reading Console.WriteLine(bp.Match("It used to be 160/110")); // 160/110 Console.WriteLine(bp.Match("Now it's only 115/75")); // 115/75 Listing 12: Declarative Programming in C# Specifically in AspectJ, no declarative programming implementation is observed. But, for its base class Java, declarative programming can be implemented through annotations [97]. So in comparison with AspecJ and its subset Java, C# provides more declarative programming ability with it‘s built in library LinQ and Regex. 48 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report 2.2.9 Batch scripting Operating system‘s command line and its batch/shell scripting capabilities is a core support for systems administrators and power users but is relatively unknown to many PC users. The purpose of this is to make a comparative study of this powerful utility of the command line between C# and AspectJ. Here a comprehensive analysis has been performed to identify the capabilities of various batch scripting techniques in C# from MSDN [81].  C# has a rich and powerful implementation of System.Diagnostic namespaces, which can used for executing the external commands. // Example implementation of external command Process proc = new Process(); proc.StartInfo.WorkingDirectory = @"G:\My Documents\COMP 6411\"; proc.StartInfo.FileName = "notepad.exe"; proc.StartInfo.Arguments = "test.txt"; proc.StartInfo.UseShellExecute = false; proc.StartInfo.RedirectStandardOutput = false; proc.StartInfo.RedirectStandardError = true; proc.Start(); proc.WaitForExit(); proc.Close(); Listing 13: Example Batch Script in C#  t has extensive library support to work with Microsoft Office packages, like reading, writing, creating files, macros etc.  Using the method and properties of diagnostics namespaces it can monitor the system performance and can send and receive external message/mail with the help of its internal library support. Aspect-oriented programming (AOP) is a natural fit for solving the problems of system monitoring. AOP lets us define pointcuts that match the many join points where we want to monitor performance. We can then write advice that updates performance statistics/logs, which can be invoked automatically whenever the process enter or exit one of the join points. In a research of IBM named AOP@Work: Performance monitoring with AspectJ [87], a basic aspect-oriented performance monitoring system was developed by Ron Bodkin using AspectJ. This system captures the time and counts for different Servlets‘ processing incoming Web requests. Same approach can be applied to implement a batch script to monitor the system or any activities with the support of Java‘s API for external /internal command execution. Unlike C#, a batch script in AspectJ, can be written for both Windows and Linux platforms. Moreover, its Java API support for external/internal command, automation, scheduling etc are more or less same like C#. Additionally, its AOP implementation can provide better modularity by separating the cross-cutting concern like security, authentication, statistics collection etc. 2.2.10 UI prototype design In Visual C#, the most rapid and convenient way to create user interface (UI) is to do so visually, using the Windows Forms Designer and Toolbox. There are three basic steps in creating all user interfaces: 49 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report      Adding controls to the design surface and also dynamically when required. Setting initial properties for the controls. Writing handlers for specified events. It is possible implement thread in Windows Form program with the BackgroundWorker class. An intensive task needed, can be done on another thread so that it can be avoided for the UI from freezing or stop responding in this implementation. It has a portability problem, which makes it failed to acquire an important feature Platform Independence. UI designing is possible only in Microsoft Operating System, since it C# is a Microsoft proprietary language. But with the help of some other framework/tool it can be deployed on other platform. Although it is possible to create UI by writing in the code, designers enable to do this work much more rapidly than is possible by manual coding [81]. Since, AspectJ is extended from Java, it came up with all the User Interface API provided by the Java. But, from the software development perspective, some distinguished properties & supports can be availed from aspect-oriented features of AspectJ:     Some kind of policy, rules or regulation update can be provided by a notification or message without hampering the core concerns of the system, just by writing new aspect for a particular work [86]. Memory management for GUI application (by calling the Garbage Collector on demand at certain pointcuts, as example) and performance can be monitored through the aspect implementation. Synchronizations of UI thread can be monitored and at the respective pointcut whenever the thread enters or exits the method [98]. Java‘s extensive API can be used for implementing the user interface. The IDE of C# is more convenient for designing user interface. Its extensive support of tools and controls provide more flexibility and faster development techniques for the programmers. Though, designing UI in AspectJ with Java API is little more tedious and less convenient than C#, but, it can provide some additional flexibility for the cross-cutting concerns by separating them from the core concern and making the code more modular than C#. 2.3 2.3.1 Haskell vs. Java Default more secure programming practices Security is a primary concern in language design & implementation. Well define & reliable program execution prevents attackers from circumventing security policies by exploiting weaknesses in language models. Unified modeling languages provide a way to express higher level of system abstraction. Language safety is a generalization of common notions such as type safety & memory safety. Advanced programming abstractions such as Threads & distributed message passing have become common in modern languages. Associated language features give programmers powerful, flexible control over various resources. Recent languages based security research & development seeks to add security behaviors to language execution models & features for programming security policies to language syntax [103]. 50 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report Security in Java Java is a language mostly used for internet purpose hence security is important because networks provide an avenue of attack to any computer hooked to them.    Robust- For controlling memory, I/O devices or other hardware. Type-safe-It is a strongly typed language helps reduce errors in programs at compile time enhances the integrity and security of software [102]. Automatic memory managementGarbage collector- The correctness of the Garbage collector implementation is essential to the reliability and security. Java RMI collector is the most widely used distributed garbage collector [104]. Drawback-It is still difficult to implement system with rigorous safety and real time requirements, most of the overheads incurred by garbage collection. There has been much research on scheduling the garbage collector and improving the efficiency of code transformation, even though it has not proven particularly effective so far [102]. Security in Haskell    Due to pure-function concept no memory or I/O side effects, if the result of any pure expression is not used, it can be removed without affecting other expressions. Thread safe [104]. It is strongly typed. Types may be polymorphic i.e. they may contain type variables which are universally quantified over all types. Haskell does not require explicit type declaration, the type interface system provides static type checking[153] Automatic memory managementGarbage Collector- Haskell has an internal Garbage collector [105]. 2.3.2 Web Application Development A web application is any application that uses a web browser as a client. Most web applications are based on the client-server architecture where the client enters information while the server stores and retrieves information. The Applications are broken into different layers are known as tires. 1. Presentation layer -Client side program-This Layer creates a visual gateway for the consumer to interact with the application. This can range from basic HTML and DHTML to complex COM components and Java applets. 2. Application Logic/Business Logic- This tier can range from Web scripting in ASP/PHP/JSP/HSP to server side programming such as TCL, CORBA and PERL, that allows the user to perform complex actions through a Web interface. 3. Database Layer- Databases allow developers to store, retrieve, add to, and update categorical information in a systematic and organized fashion. 51 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report For more complex application a 3-tier solution may fall short so n tiered approach is benefited to break the business logic, which resides on the application tier into a more fine grained model [106]. Web Application in Java Java builds high quality web application. Java has APIs to create these applications.  The servlet component is used as a controller, the Java bean component is a model and JSP is used as a view template. The Enterprise Java Beans can be used as a model which can be located in distributed environment.  Java EE platform provides support for security, authentication, authorization, transaction.  The Database Connection management with JNDI API provides flexibility [107].  Java API for XML Processing (JAXP), part of the Java SE platform, supports the processing of XML documents using the Document Object Model (DOM). JAXP enables applications to parse and transform XML documents independent of a particular XML-processing implementation.  Java Persistence API is a Java technology standards-based solution for persistence. Persistence uses an object-relational mapping approach to bridge the gap between an object-oriented model and a relational database[108] Web Application in Haskell Haskell does not have inbuilt components like Servlets in JAVA to create web application it relies on certain libraries –   2.3.3 CGI & XHtml libraries the monad transformers in Haskell are used to add application specific functionality [109]. Database connectivity system HDBC. This library allows to write a code & access data stored in almost any SQL database. [104] Web services design and composition Web services can be considered as one kind of service, which is useful as it offers syntactical interoperability with remote services in a platform independent way [110]. Using Web service technologies like SOAP (Simple Object Access Protocol), WSDL (Web Service Description language)-to provide a web service document, UDDI (Universal Description Discovery & Integration)-web service registry [111]. A web service can interact with any other Web service, no matter which platform the Web service is developed and run on. A Web service client can be of many types, such as another Web service, a client written in a scripting language, a C# Client, a java client etc [112]. Web Service composition in Java The development of java technology standards occurs through Java Specification Requests being submitted to Java Community Process. 52 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report Java Remote Method Invocation enables the programmer to create distributed java technology, which invoke objects from other Java Virtual machines [145]. Two popular java web services architecture 1.Java API for XML based RPC (JAX-RPC) – This is a standard way for J2SE clients & are invoked with a simple java commands, using JAX-RPC Service Factory for creation of instances of services access points 2. Implementing Enterprise web services – This specifies the web services for Java 2 Enterprise Edition (J2EE) builds on SOAP & WEDL to cover the use of JAX-RPC. It uses Java Naming & Directory interface (JNDI) to obtain service interface with two steps- * Instantiate a local JNDI Context. *Do a JNDI lookup for the Web Service name in this context. [114] Web Service composition in Haskell 1. Web services can be performed by integrating with XML Serializer for producing and consuming message representations & HTTP- based client-side executor for services [115]. 2. The HaskellXML toolbox is a validating XML-parser. It introduces a more general approach for processing XML with Haskell. This toolbox uses generic data model for representing XML documents, including the DTD subset & the document subset, in Haskell. This data model makes it possible to use filter functions as a uniform design of XML processing applications [104]. 3. Hayoo! provides a JSON-based web service API, which can be used to retrieve search result in a structured format [144]. 2.3.4 OO-based abstraction Abstraction is the mechanism and practice which reduces and factors out details so that one can focus on a few concepts at a time. Abstraction can apply to control or to data: Control abstraction is the abstraction of actions while data abstraction is that of data structures.   Control abstraction involves the use of subprograms and related concepts control flows Data abstraction allows handling data bits in meaningful ways. For example, it is the basic motivation behind data types[116] Abstraction in Java    Java programs are organized as object that normally consists of visible and non visible data fields and methods. Java offers abstraction by means of the abstract class type and interface, where no implementation details are allowed. Information hiding is naturally supported. Abstract classes can be used to abstract data structure as well as functions, and behavior, to make cohesion of data structure with related behavior. Disadvantage- The hierarchy of classes built on these bases one can‘t choose to reuse just behavior code or just data structure because they are bound to each other, and the behavior is built for its associated data structure and not for properties in it. [117] 53 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report Program which contains an abstract method named check in an abstract class compare.- Self written Code import java.lang.*; compare // Class Has to be declared abstract { check(int x, int y); // abstract method //close abstract class class child extends compare //Abstarct class should have a subclass { check(int x,int y) //Defined abstract method { System.out.println("True"); //output on output console abstract class abstract void } void if(x==y) else System.out.println("false"); }// close check method }//class child demoabstract //Main program in which the abstract function is call { void main(String[] args) int a,b; a=Integer.parseInt(args[0]); child ob=new child(); // creating an object for child class ob.check(a,b); //calling abstract method } class public static { b=Integer.parseInt(args[1]); } The program has to be executed at command prompt as Java abs Command line inputs 5 6 The output of this program- false Abstraction in Haskell  The MonadLab DsL embedded in Template Haskell-Monads have become a central programming abstraction in Haskell with benefits including modularity and maintainability, 54 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report effective programming and mathematical precision. Monads can be used to support imperative features within a purely functional language. What they really provide is modularity. That is, by defining an operation monadically, we can hide underlying machinery in a way that allows new features to be incorporated into the monad in a transparent manner [118]. Abstraction can be performed with the help of Type Classes. Which provide a very clear separation between data abstraction and function abstraction 1. Type Classes allow a default implementation which enables implementation generalization. 2. Type Classes instance declaration can be done outside the type declaration site, or even outside the whole module that contains the type. 3. Type class substitute for class and type for object [152]. 4. One powerful abstraction mechanism available is higher order function. In Haskell a function is a first-class citizen, it can freely be passed to other functions, retuned as the result of a function, stored in a data structure [146]. The Program illustrates the Typeclass in Haskell. --The Decleration of function isEqual in a class class BasicEq a where isEqual :: a -> a -> Bool --Defination of function in an instance of above class instance BasicEq Bool where isEqual True True = True isEqual False False = True INPUT of program ghci:>. is Equal False False Output of program True 55 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report Comparison: Java and Haskell In Java- An abstract function is declared in abstract class which has to be defined in a subclass which extends abstract class which is mandatory. It is 24 line of code. Then the program has to be compiled using command prompt where class path & path has to be set as per the complete syntax. The command line arguments have to be converted to primitive data type as the prototype of the function which takes integer nos. In Haskell – which may look like the objects of Object Oriented programming [104].As Haskell does not have subtypes [109]. We will refer to instance types with the letter a. An instance type of this typeclass is any type that implements the functions defined in the typeclass. This typeclass defines one function. That function takes two parameters- both corresponding to instance types- and returns a Boolean. 2.3.5 Reflection In computer science, reflection is the process by which a computer program can observe and modify its own structure and behavior. Normally, instructions are executed and data is processed; however, in some languages, programs can also treat instructions as data and therefore make reflective modifications. Reflection is most commonly used in high-level virtual machine programming languages like and scripting languages, and less commonly used in manifestly typed and/or statically typed programming languages. Reflection can be used for observing and/or modifying program execution at runtime. A reflectionoriented program component can monitor the execution of an enclosure of code and can modify itself according to a desired goal related to that enclosure. Reflection can also be used to adapt a given program to different situations dynamically [116]. Reflection in Java Reflection is commonly used by programs which require the ability to examine or modify the runtime behaviour of applications running in the Java virtual machine.     The two main aspects of self-manipulation are introspection and intercession, which are the abilities of a program to observe and modify (respectively) its own state and behavior. Java reflection API- Distinguishes between Static & Dynamic objects. Meta-objects cannot be modified. They can only be created, read & used. A mechanism provides Partial Evaluation. Ability to examine itself and its environment [122]. Java.lang.reflection package provide access to the representation of Java Classes [121]. One tangible use of reflection is in JavaBeans, where software components can be manipulated visually via a builder tool. The tool uses reflection to obtain the properties of Java components (classes) as they are dynamically loaded [122]. 56 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report Reflection in Haskell Type-safe reflection in Haskell     2.3.6 The Type-safe reflection is the ability for a program to generate new code and incorporate this into its own execution. The main use of this would be to allow further abstraction over types than provided by parametric polymorphism & type classes. The structure of types can be observed, including names of constructors, fields and types. This is similar to the reflection API of JAVA where attributes and method signatures can be observed, and objects can be constructed from class name. This approach handles regular data types, nested data types, mutually-recursive data types constructor parameterised in additional types & it handles single and multi-parameter term traversal. It supports higher order Generic programming, reusable definitions of traversal strategies & overriding of generic functions at specified types. Generic functions are directly defined on Haskell data types[123] One way to provide this would be to extend the language with new constructs but this would require changes to existing compilers and interpreters and would cause compatibility problems for existing code & the other way to use separate tool. To provide linguistic reflection Haskell uses separate tool Derive is pre-processor written entirely in Haskell. Derive can only perform compile time Reflection. [123] Aspect-orientation In computing, aspect-oriented programming (AOP) is a programming paradigm which isolates secondary or supporting functions from the main program's business logic. It aims to increase modularity by allowing the separation of cross-cutting concerns, forming a basis for aspect-oriented software development. AOP includes programming techniques and tools that support the modularization of concerns at the level of the source code, while "aspect-oriented software development" refers to a whole engineering discipline [124]. Aspect Orientation in Java AOP is a concept and as such it is not bound to a certain programming language or programming paradigm. It can help with the shortcomings of all languages that use single, hierarchical decomposition. This may be procedural, object oriented, or functional. The Java implementation of AOP is called AspectJ (TM) and has been created at Xerox PARC. Like any other aspect-oriented compiler, the AspectJ compiler includes a weaving phase that unambiguously resolves the cross-cutting between classes and aspects. AspectJ implements this additional phase by first weaving aspects with regular code and then calling the standard Java compiler. [125] 57 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report Aspect Oriented Programming in Haskell      GHC can model an AOP style of programming via a simple syntax-directed transformation scheme where AOP programming idioms are mapped to type classes. But we cannot easily advise functions in programs which carry type annotations [126]. Embedding of an aspect-oriented programming style in Haskell provides a structuring syntax directed compilers implemented as attribute grammars which is a convenient notation for specifying the functions that deal with each of the production rules in the abstract syntax. Attribute grammar systems offer decomposition by aspect, but only at a syntactic level, not at the semantic level [128]. Trex extension of Haskell,provides a rich set of records TRex stands for ―typed records with extensibility‖. These extensible records are a key component of modularity approach to define attribute grammar. The standard strategy for writing an attribute grammar consists of three steps, namely the definition of semantic domains, semantic functions, and translators. 2.3.7 Functional programming The fundamental approach in functional languages is the definition and application of functions. They allow functions to be treated as values and support higher order functions i.e. functions which can take functions as parameters and which can combine functions to create new functions [129]. Functional Programming in JAVA    Java is a ―true‖ object-oriented language, in the sense that it cannot be executed without having a class. Superficially, Java has no functions; however, using interfaces and inner classes it is fairly easy to mimic some of the important features of functional programming. By using interfaces and inner classes it is possible to do much more than just pass functions as parameters. It is fairly easy to mimic many more of the features of a functional programming language. [130] Program example which reads & transfers the data from one text file to another text file which uses input output buffer stream import java.lang.*; import java.io.*; public class demofilejava { 58 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report public static void main(String[] args) throws IOException { String str; File fi; fi= new File("c:/program/input.txt"); if(fi.length()<0) System.out.println("data does not exist"); else { FileInputStream fin=new FileInputStream(fi); byte b; do { b=(byte)fin.read(); char c[]=Character.toUpperCase((char)b)) str=new String System.out.print((char)b); } while(b!=-1); fin.close(); }//else File fo=new file("c:/program/output.txt"); FileOutputStream fop=new FileOutputStream(fo); if(fo.exists()) 59 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report { fop.write(str.getBytes()); fop.flush(); fop.close(); System.out.println("The data has been written"); }//if else System.out.println("This file is not exist"); } } Output of this file: The data has been written- It will copy the data from input.txt to output.txt Check the file input.txt & output.txt The program can be compiled in same manner as mentioned in section 1.5A Functional Programming in Haskell     It is a pure functional language, which is side-effect free. We can replace any expression in a program with its resulting value without changing the program‘s meaning (referential transparency). This makes it possible to reason about programs and their correctness, similar to the way we would reason about mathematical formulas. Every variable is defined exactly once and can‘t be modified later[131] The program which read & writes data from & to the file without side effects. This is an Example which illustrates the combination of monad (System IO), lazy evaluation, & function purity[104], As I have mentioned in section 1.4B the abstraction like Java can be implemented in Haskell in this way [118]. 60 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report -- file: ch07/toupper-lazy1.hs import System.IO import Data.Char(toUpper) main = do inh <- openFile "input.txt" ReadMode outh <- openFile "output.txt" WriteMode inpStr <- hGetContents inh --using hGetContents methods you are not required to ever consume all the data from the input ----file. hPutStr outh (map toUpper inpStr) hClose inh hClose outh --hClose close the instance of the file The above program map is a function defined by Haskell‘s prelude in order to apply it to all elements of the list. Comparison Java- The program code consists of 23 lines. We call a function within a function but contains impure function as the functions have to be enclosed within the class so contains some side effects. Java has sequential evaluation. Haskell- The code is small. Function does not contain side-effects which returns the same result when it is called. Haskell supports Lazy Evaluation. You are not required to ever consume all the data from the input file when using hGetContents. Whenever the Haskell system determines that the entire string hGetContents returned can be garbage collected. 2.3.8 Declarative programming Declarative programming is a way of specifying what a program should do, rather that specifying how to do it. It‘s not needed to prescribe the computer which steps to take and in what order, it can rearrange your program much more freely, maybe even execute some tasks in parallel. A declarative programming is often defined as 1. A program that describes what computation should be performed & not how to compute it 61 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report 2. Any programming language that lacks side effects 3. A language with a clear correspondence to mathematical logic [132]. Declarative Programming in Java Java is an Object Oriented language but it can be integrated with facilities for supporting declarative programming, by providing them as a library called JSetL. A programmers cant not restrict themselves to constraints, but they can try to provide a more comprehensive collection of facilities to support a real declarative style of programming [133]. Declarative Programming in Haskell    2.3.9 Haskell is based on models of computation that are fundamentally different from the statemachine model underlying imperative programming languages. Haskell is a functional programming language based on the Lambda Calculus and it makes extensive use of pattern matching, which encourages a new, and extremely useful way of programming. The Haskell compiler automatically infers the type of each expression, thereby enabling it to catch type errors without the programmer having to explicitly specify types for each datum. [135] Batch scripting Batch script allow several commands that would be entered manually at a command line interface to be executed automatically and without having to wait for a user to trigger each stage of the sequence[137]. Batch Script in Java   Java has a java.lang.ProcessBuilder class used to create operating system process. Each PeocessBuilder instance manages a collection of process attributes [136]. Java can either load a DLL (Direct linking library) that contain any external program implementation of the required native methods or some other DLL that can dynamically register the native methods using the JRegister Natives JNI entry [138]. Batch Script in Haskell GHC package contains GHC API which can be used in module to access an external commands [139]. It is possible to invoke external commands from Haskell. The raw System from the System.cmd[104]. This will invoke a specified program with the specified arguments, and return the exit code from that program. The important process is termination of an external program or exit an external command after invoking. Haskell automatically indicates a non-successful exit whenever a program is aborted by an exception [104]. Haskell Foreign Function Interface is the means by which Haskell code can use & be used by, code written in other language. In order to call a foreign function from Haskell, we import externally defined functions into Haskell, either by static linking or by dynamic linking. 62 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report 2.3.10 UI prototype design Prototyping means exploring ideas before you invest them. Most often they are created early in the project, during the planning and specification phase, before developers write any production code. That's when the need for exploration is greatest, and when the time investment needed is most viable Software & web designers create mock-ups of how users will interact with their design. The real product prototypes are easy and inexpensive to create. The conventional purpose of prototype is to allow users of the software to evaluate developers proposals for the design of the eventual product by actually trying them out, rather than having to interpret & evaluate the design based on descriptions. The prototyping can also be used by end users to describe & prove requirements that developers have not considered. Commonly used UI prototypes are Windows based GUI [140]. GUI development in Java User interface libraries which are used in Java are:    The (heavyweight, or native) Abstract Window Toolkit (AWT), which provides GUI components, the means for laying out those components and the means for handling events from those components. The (lightweight) Swing libraries, which are built on AWT but provide (non-native) implementations of the AWT widgetry APIs for audio capture, processing, and playback [141]. GUI development in Haskell There are several toolkits are available for Haskell but 2 are most popular & commonly used Gtk2hs is a GUI library for Haskell based on Gtk+. Gtk is an extensive multiplatform toolkit for creating GUI interfaces. The fundamental thing of Gtk+ is widget. A widget represents any part of the GUI & may contain other widgets. Some examples of widgets include a window, dialog box, button, and text within the button [104].  wxHaskell is a portable and native GUI library for Haskell.  wxHaskell is built on top of wxWidgets – a comprehensive C++ library that is portable across all major GUI platforms; including GTK, Windows, X11, and MacOS X.  It is a mature library (in development since 1992) that supports a wide range of widgets with the native look-and-feel [142]  wxHaskell consists of two libraries - WXCore and WX. The WXCore library provides the core interface to wxWidgets functionality. Using this library is just like programming wxWidgets in C++ and provides the raw functionality of wxWidgets [143]. 2.4 PHP vs. Scala 2.4.1 Default more secure programming practices Evert program is insecure. Security has been an important factor in the way programming languages are designed and maintained. Every programmer should know how to avoid critical security mistakes by 63 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report performing reviews, testing for security bugs, and so on. ―Security is a measurement, not a characteristic. Security must be balanced with expense and usability and it must be part of the design‖ [159]. PHP One of the most striking things about the PHP programming language is that beginner programmers can achieve simple goals rather quickly. The problem, on the other hand, is that many programmers are not aware about what is happening on the backend. It‘s known that security is sacrificed for the sake of convenience. PHP has flexible file handling functions (inclue(), require() and fopen()) [160]. These functions accept local paths and remote files. A lot of vulnerabilities are due to incorrect handling and path names. Another problem is that PHP writes most of the variables into the global scope. This has indeed some advantages, however you can get lost in big scripts. EGPCS (Environment, GET, POST, Cookie and Server) variables are put into the global scope. One concept you must always remember is that user input is unreliable and you shouldn‘t trust it quickly; examples for input validation are [161]:      Partially lost in transmission between server and client Corrupted by some in-between process Modified by the user in an unexpected manner Intentional attempt to gain unauthorized access Crash the application That is why it is extremely important to validate user input before processing. Programming plain PHP is rather boring without an SQL connection. One problem is that SQL queries with unchecked variables are dangerous. Of course, JavaScript validation and other client-side validations are entirely useless, since they can be easily bypassed. Register Globals (a directive in php.ini to automatically make variables out of environment, GET, POST, cookies, and server data (true/false)) has been criticized a lot, however this is ―not security vulnerability; it is a risk and a bad practice [162]‖. As a result, it has been disabled by default since version 4.1.0. $_GET and $_POST have been used instead. The PHP manual contains a great section especially for security precautions when coding PHP scripts. The manual notes when possible security risks exist and how to prevent them or minimize their side effects. Not validating input to SQL queries ultimately creates vulnerabilities to SQL injection and not validation user input and cookies creates XSS (cross site scripting) vulnerabilities; these are some of the biggest problems in PHP. Also, scattering SQL queries with other PHP codes can create a mess. Scala Scala can be thought of as less secure than Java in a few superficial ways mostly related to visibility of members from outside classes, but in terms of helping you write code that‘s free of security holes, it should be better if you follow the best practices of immutability, concurrency, etc. While JSP is kind of a domain specific language with a (bad) mixture of HTML, XML and Java, Scala is a general-purpose programming language. JSP is a template language compiles to Java servlets, and allows arbitrary Java code in the snippets. Scala is a general-purpose programming language with which you can do 99.99% of what Java can do, usually in 1/3 to 1/5th the code size. Scala is basically the same as Java in the respect of the common programming practices. The Scala programming language is used by many companies [163] to develop commercial software and production system, such as EDFT, Twitter, Xebia, Xerox, FourSquare, Sony, Siemens, GridGain, AppJet, Reaktor and many others. 64 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report 2.4.2 Web Application Development PHP PHP is great for web applications. PHP scripts are executed on the server. PHP supports many databases (MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBC, etc.) [164]. One of the main reasons why PHP is so popular is because it is open source software and is free to download and use. PHP is released under the PHP License [165]. PHP combined with MySQL are cross-platform (you can develop in Windows and serve on a UNIX platform). PHP runs on different platforms (Windows, Linux, UNIX, etc.). PHP is compatible with almost all web servers used today (Apache, IIS, etc.). PHP is easy to learn and runs efficiently on the server side; that explains why many of the new programmers tend to program in PHP and stick to it and further their knowledge in this language. However, with the rise of Web 2.0, programming for Web 2.0 uses mostly Ajax which is more about JavaScript, XML and CSS. And there is also the rise of HTML 5; all those make PHP in a difficult position, as only a server side language, where Ajax (and later HTML 5) will be the key for web applications. Scala Lift is just one, albeit the most popular, Scala web framework. Play is another one that people seem to like. Lift is a free web application framework. Lift aims to deliver similar benefits to Ruby on Rails except that Lift applications are written in Scala instead of Ruby. The use of Scala means any existing Java library and Web container can be used in running Lift applications. Lift app-dev is pretty much the same as Java development. Lift programmers use standard Java environments like Eclipse and IDEA. Lift is written in the Scala programming language [166], which is a modern language for the Java virtual machine. Java 5 or higher version is needed for developing and running Lift projects as well as suitable versions of the Scala libraries and compiler are needed. Lift depends on the Servlet API 2.5, hence you need a suitable Servlet container to run a Lift-based web application, e.g. Jetty 6 or 7 or Tomcat 6. Scala and Lift code can be as brief and expressive as Ruby code. Lift offers developers amazing productivity gains versus traditional Java web frameworks, just as Rails does. On the other hand, Lift code scales much better than Rails code. Lift code is type-safe and the compiler becomes your friend. The Lift Web Framework is an awesome Ajax and Comet support [167]; it‘s more powerful and concise than Rails. It‘s scalable and secure and it‘s in production from Web 2.0 to SAP. 2.4.3 Web services design and composition Web services are [168] typically application programming interfaces (API) or web APIs that are accessed via Hypertext Transfer Protocol (HTTP) and executed on a remote system hosting the requested services. Web services can be classified in two categories: Big Web Services and RESTful Web Services. Web services allow you to exchange information over HTTP using XML. For example if you want to know the weather for another city, you can write a short script to gather that data in a format you can easily manipulate. From a developer‘s perspective, it‘s as if you‘re calling a local function that returns a value [169]. 65 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report PHP A web service consists of a server to serve requests to the web service and a client to invoke methods on the web service. The PHP class library provides the SOAP extension to develop SOAP servers and clients and the XML-RPC extension to create XML-RPC servers and clients. An important advantage of web services is ubiquity across platforms and languages. A PHP script running on Linux can talk to an IIS server on Windows using ASP without any communication problems. When the server switches over to Solaris, Apache, and JSP, everything transitions without a glitch. SOAP is the most popular web services format [170]. It‘s a W3C standard for passing messages across the network and calling functions on remote computers. PHP does not come with a bundled SOAP extension. Before you can begin, you need to download and install files that let you easily integrate SOAP into your applications. It‘s very simple to use SOAP and WSDL with PHP. These clients allow you to gather information from across the net to use in your scripts. Amazon.com is not the only major company to provide a SOAP front end to its data. Google lets you search their listings up to 1000 times a day. Additionally, XMethods has a large directory of SOAP servers that you can experiment with and use. Appendix A.5: Create a basic web service that provides an XML or JSON response using some PHP and MySQL. Scala Building Web Services in Lift is somehow easy because of the pattern matching, higher-order functions, Scala‘s XML support and Lift‘s built-in support for REST and other web services. Appendix A.6: Building Web Services in Lift. 2.4.4 OO-based abstraction PHP New features appear with each new version released while existing features are improved. PHP‘s object support is one feature that is being improved on each version. Object oriented support first appeared in PHP 3. PHP 4 made additional improvements, such as the way constructors are handled. With PHP‘s object support growing, many of the reasons developers might not take an object oriented approach are diminishing. Object-Oriented started to be really interesting with PHP 5. Appendix A.7: An example of creating a very simple abstract class called OOPHPAbstractClass, and OOPHPClassToExtendAnAbstract which extends it. Scala In Java you have abstract methods, but you can‘t pass a method as a parameter. You don‘t have abstract fields, but you can pass a value as a parameter. And similarly you don‘t have abstract type members, but you can specify a type as a parameter. 66 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report Scala team decided to have the same construction principles for all three sorts of members. So you can have abstract fields as well as value parameters. You can pass methods as parameters, or you can abstract over them. You can specify types as parameters, or you can abstract over them. You can model one in terms of the other. You can express every sort of parameterization as a form of objectoriented abstraction. In a sense, Scala is a more orthogonal and complete language. 2.4.5 Reflection PHP 5 [171] comes with a complete reflection API that adds the ability to reverse-engineer classes, interfaces, functions, methods and extensions. Additionally, the reflection API offers ways to retrieve doc comments for functions, classes and methods. Some parts of the internal API are missing the necessary code to work with the Reflection extension. For example, an internal PHP class might be missing reflection data for properties. These are considered bugs and should be discovered and fixed. No external libraries are needed to build this extension and there is no installation needed to use these functions; they are part of the PHP core. This extension has no configuration directives defined in php.ini. This API takes the language‘s introspective abilities to a far more mature stage. What‘s more, it includes some convenient methods that permit developers to dissect both classes and interfaces down to their bare bones, which can be very useful. Appendix A.8 Reflection Example from Shell (a Terminal). Scala Scala‘s support for reflection is the same in Java, but Scala has richer types which are not fully reflected in bytecode. There‘s a Scala reflection library in the works. Scala reflection is built on top of Java reflection. To reassemble a Scala-like view of the program from the damaged view returned by Java reflection, it implements an abstract API, which it shares with the Scala compiler, which can recreate the original Scala view of a program from class files. This API is the backend of the Scala reflection library. The frontend ties the backend and Java reflection into a userfriendly system to do Scala reflection. The Scala reflection library is in development. For the time being, no usable version is available. Object-oriented languages usually implement an API supporting meta-level operations such as reflection [172]. However, reflection APIs generally do not follow the three design principle for reflection and meta-programming (encapsulation, stratification and ontological correspondence). Scala does not have any specific API supporting meta-programming. However, since it is compiled into Java byte-code, it is compatible with the complete Java library. Consequently, one can use the Java reflection API in order to access meta-level information about a Scala program. Anyhow, this approach presents important limitations and raises some usability problems. call object methods with reflection 67 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report val c = Class.forName("scala.Console") val m = c.getMethod("println",classOf[Any]) m.invoke(null,"hi") get the reference of the singleton object val c = Class.forName("scala.Console$") val console = c.getField("MODULE$").get(null).asInstanceOf[Console.type] console.println("Hi") 2.4.6 Aspect-orientation The Aspect Oriented Programming (AOP) concept was created originally by Java developers. They developed a compiler that implements the AOP white box approach. AOP is a methodology meant to implement new aspects in software component using external components, but without altering the code that implements the core functionality. PHP There are some approaches to facilitate Aspect-Oriented Programming with PHP:  PHPAspect uses a compiler, written in PHP that performs static weaving using source code transformations. A downside of this approach is that advantages that stem from PHP‘s interpreted nature are lost.  Aspect-Oriented PHP uses a preprocessor for PHP written in Java that is responsible for the weaving of aspect- and base-code. Due to its Java implementation, this approach does not integrate seamlessly with the PHP platform.  aspectPHP is a reimplementation of Aspect-Oriented PHP in C, available as a patch against (not as an extension to) PHP 4.3.10.  The AOP Library for PHP requires manual changes to the base-code. AOP Library for PHP has been implemented to implement Aspect Oriented Programming by executing the code of classes that enable orthogonal aspects at run-time. AOP Library for PHP‘s package implements a framework that provides a PHP solution that does not rely on a pre-compilation stage. Therefore it can be used right away without the eventual complication of the compiler based AOP implementations.  BunnyAspects is another implementation of AOP inside of pure PHP5. You do not need any extensions and it uses the existing qualities and abilities of the language, which carries its own set of problems. The essence of BunnyAspects is to wrap a BunnyAspect object around our target object. This BunnyAspect object keeps track of what is being woven into it, and then with the magic __call method, intercedes between all of the method calls, and calls before or after advice as needed. 68 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report Scala There is usually less of a need for aspects in Scala since the language itself is more powerful and expressive i.e. like traits for composing behavior. There is no AspectJ-like implementation of AOP for Scala. Scala supports attributes and so we could say that Scala can support AOP via attribute-based meta-programming. Scala also supports mixins, which enable separation of code that crosscuts class hierarchies, but this is only related to the introduce member AspectJ advice. Scala knows closures and compiles those closures to inner classes on the bytecode level and creates multiple bytecode classes for one class. One would have to mentally transform Scala into bytecode then into Java in order to know how to write pointcuts and advices Scala code. 2.4.7 Functional programming The essential approach in functional languages is the definition and application of functions. They allow functions to be treated as values and support higher order functions i.e. functions which can take functions as parameters and which can combine functions to create new functions. PHP With the rise of JavaScript, and languages like Python and Ruby, functional programming is becoming more mainstream. Fn.php [173] is an attempt to define lots of useful higher-order functions to PHP, and fix some of the things that are inconsistent with the others. Fn.php already supports the things in PHP that already exist, but adds foldr, compose, zip, andf, orf, not, any, every, curry, I, K, S, flip and a new short hand way to define functions with strings. There‘s virtually no documentation, and very little in the way of examples or tests. Scala Scala programs execute on the Java Virtual Machine (JVM) and can interoperate with Java programs and application programmer interfaces (APIs). It is a multiparadigm programming language that natively supports the imperative, object-oriented, and functional styles of programming. Scala functions are [174]:       First-class values i.e. functions are objects Can be higher-order: take functions as arguments or return them as result Can be anonymous May be curried: take arguments one at a time, allowing partial application Are often passed in a closure, with references to free variables they manipulate Provide ability to build powerful libraries of higher-order functions As a hybrid object-functional language, Scala does not require functions to be pure, nor does it require variables to be immutable. It does, however, encourage you to write your code this way whenever possible. 69 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report Robert Fischer mentions [175] that ―Scala is not a functional programming language. It is a statically typed object oriented language with closures.‖ Rich Hickey‘s mentions [176] that Scala ―isn‘t really a functional language‖ The core of the argument made people against Scala as a functional language goes like this [177]:      2.4.8 Mutable variables as first-class citizens of the language Uncontrolled side-effects (ties in with the first point) Mutable collections and other imperative libraries exist on equal footing Object-oriented structures (class inheritance, overloading, etc) Verbosity Declarative programming PHP Most modern programming languages, PHP included, are imperative: the programmer describes how the computer is to perform a particular task. In contrast declarative programming languages‘ philosophy goes as this: the computer is told what the programmer wants and the how is left to the computer itself. While declarative programming languages are often considered somewhat exotic, there is a declarative language that is seen nearly every day by application developers: SQL. With SQL, the programmer formulates a query and it is left to the database engine‘s query analyzer to figure out what combination of disk reads, index lookups and other functions are necessary to satisfy the query. PHP is not a declarative programming language. However, this does not prevent programmers from adopting a declarative style of programming [178]. Consider the code fragment: require_login(); require_permission(‘LIST_TRNANSACTIONS’); This piece of code states that only logged-in users and only those users with a particular permission can access this page. This is far more readable than the equivalent imperative style which would involve an explicit if statement to test if the user has logged in and if they have the correct position. Or consider the code used to read the query parameters: // Get parameters $display = get_parameter(‗display‘, PARAM_TYPE_ENUM, array_keys($display_modes), ‗weekly‘); $from_date = get_parameter(‗from‘, PARAM_TYPE_DATE, timestamp_to_mysql_date(0)); $to_date = get_parameter(‗to‘, PARAM_TYPE_DATE, timestamp_to_mysql_date(time())); $sort_field = get_parameter(‗sort‘, PARAM_TYPE_ENUM, $fields, $fields[0]); $order = get_parameter(‗order‘, PARAM_TYPE_ENUM, $orders, $orders[0]); $currency = get_parameter(‗currency‘, PARAM_TYPE_ENUM, array_keys($currencies), $_SESSION[‗default_currency‘]); By writing the code in this way, we can see at a glance what type of data is expected in each parameter and the default value to use if any parameter is omitted. This style helps to make the code self70 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report documenting. The declarative style is common in many modern web development frameworks, notably Ruby on Rails. Scala Scala list comprehensions provide a declarative syntax for abstracting over data that hides less declarative function call and closure creation details. Using operator overloading in Scala, it is possible to also write decent Prolog code [179]. Declarative programming style in Scala makes software product development from proof-of-concept to deployment enjoyable. It is important to note that declarative reading is math definition. The definition of factorial n, an integer, is, n times factorial n-1 def fact(n: Int): Int = n*fact(n-1) The definition of isPrime n, an integer, is, given a range of integers thru n for all X, n modulo x is not zero def isPrime(n: Int) = List.range(2, n) forall (x => n % x !=0) 2.4.9 Batch scripting PHP cron is a module that allows you to run commands at predetermined times or intervals. cron is normally available on all Unix and Linux distributions. It is a daemon which allows you to schedule a program or script for a specific time of execution. Using cron, you can automate many tasks; for example, to update the content of a website, generate quota reports, remove expired articles, send out e-mails on a given date and a lot more. An important aspect in cron is that it sends any error output to a specified e-mail address so you can debug problems when they occur. cron is driven by a crontab, a configuration file that specifies shell commands to run periodically on a given schedule. The crontab files are stored where the lists of jobs and other instructions to the cron daemon are kept. Users can have their own individual crontab files and often there is a system wide crontab file (usually in /etc or a subdirectory of /etc) which only system administrators can edit. Each line of a crontab file represents a job and is composed of a cron expression, followed by a shell command to execute. A cron expression is a string comprising 6 or 7 fields separated by white space that represents a set of times, normally as a schedule to execute some routine. The following is a cron configuration to run a PHP script once a day at 11 p.m. [180]: 0 23 * * * username /usr/bin/php /users/home/username/myscript.php The first five fields define the times when the script should be executed. Then comes the name of the user who should be used to run the script. The rest of the line is the command line to execute (we need to 71 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report know where PHP and our scripts are). The time fields are minute, hour, day of the month, month, and the day of the week. The command: 15 * * * * username /usr/bin/php /users/home/username/myscript.php runs the script at the 15-minute mark of every hour. The command: 30 23 * * 6 username /usr/bin/php /users/home/username/myscript.php runs the script at 11:30 p.m. on Saturdays (the day of the week specified as 6). If your host has cPanel, you may have a cron job interface which will take the commands as an option and allow you to configure visually the times at which it will execute. Scala A Scala program may also be run as a shell script respectively as a batch command [181]. The bash shell script script.sh containing the following Scala ―Hello World‖ code (and shell preamble) #!/bin/sh exec scala "$0" "$@" !# object HelloWorld { def main(args: Array[String]) { println("Hello, world! " + args.toList) } } HelloWorld.main(args) can be run directly from the command shell: > ./script.sh It is important to note that the file script.sh has to have execute access and the search path for the Scala command is specified in the PATH environment variable. You can use Scala as a replacement for console scripting languages (Batch under windows, Bash/Perl under Linux/Cygwin). The Scala package contains – like Ruby and Python do – its own console to test code snippets and more. So unlike in Java, you can also do real scripting in Scala. The advantages [182]:    You can re-use Scala-scripts in larger programs later, even in Java projects You have access to the complete JDK and you can put other Java/Scala-Libraries into your Classpath to use in a script You can do all file operations on a high and object oriented level, much easier than writing Bashscripts or Batch-scripts. 72 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report   You can do functional-like programming; you get small and readable scripts If the script gets more advanced, you can use the Swing-Wrapper to create a GUI for you script One downside when using Scala as a scripting language is that every time you start a Scala-script, it lasts few seconds to start. The majority of the taken time is needed for loading the compiler and compiling and start the JVM. However when using the –savecompiled flag, then Scala will save a compiled version of your script as a .jar file and load that version instead. However, it is still not as fast as Perl, Python and co. 2.4.10 UI prototype design PHP PHP-GTK is a set of language bindings for PHP which allow GTK+ GUI applications to be written in PHP. PHP-GTK provides an object-oriented interface to GTK+ classes and functions. PHP-GTK, originally a proof-of-concept inspired by PyGTK to show that it could be done [183]. PHP isn‘t just for the Web anymore so if you need a GUI application, you can use your favorite language. PHP-GTK 2 fully utilizes PHP 5‘s powerful object model support [184], and brings the improved portability of GTK 2.6 as well as its new set of widgets. The project also has some new extensions such as GtkSourceView, which provides a rich source editor widget, alongside some of the old favorites. Documentation for PHP-GTK 2 is filling out rapidly. Several articles and tutorials have been written on the topic, and around half the classes have been fully documented. Scott Mattocks, an active member of the PHP-GTK documentation group, has also written a book (Pro PHP GTK, Apress) on the subject of PHP-GTK programming. GTK+ is platform independent. Scala GUI applications developed are based on a Scala library that provides access to Java‘s Swing framework of GUI classes [158]. Scala-swing is a "wrapping" library approach. The Scala library resembles the underlying Swing classes, but hides much of their complexity. The Scala wrapper is based on the original Java Swing framework. ―The Scala wrappers resemble the underlying Swing classes, but try to simplify concepts where possible and make them more uniform. The simplification makes extensive use of the properties of the Scala language. Its "everything is an object" philosophy makes it possible to inherit the main method of a GUI application. Scala‘s first-class functions and pattern matching make it possible to formulate event handling as the reactions component property‖. Below is a simple Swing application in Scala. import scala.swing._ object FirstSwingApp extends SimpleGUIApplication { def top = new MainFrame { title = "First Swing App" contents = new Button { text = "Click me"}}} 73 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report 2.5 2.5.1 Scheme vs. BPEL Default more secure programming practices The author in [57] describes language safety as a general concept that includes type safety and memorysafety and language implementations enforce the program's intended semantics. This can be achieved by static (e.g. compile-time type checking) and dynamic check (e.g. run-time type checking, array-bounds checking) to "trap nonsensical operations" [58]. Scheme is an example of a safe language [6, 57, 58]. Unchecked or unsafe operations (required in certain scenarios) are explicitly defined by language abstractions [60]. Dynamic type checking is supported by "run-time type tags" to differentiate structures allocated in the heap [58]. Types provide context for operations (the underlying system selects the correct operation) and they limit the semantically valid operations (catching inadvertent logic errors) [6]. It has been observed that nominative type systems (the names in distinct declarations determine the variable type) have a better safety than structural type system (allowing for coincidental structural matches among types) [6]. An example of a low-level memory safety feature is automatic garbage collection, which prevents the occurrence of dangling pointers, memory leaks and double deletes [6]. Racket, a Scheme dialect, implements two kinds of garbage collection: 3m (generational garbage collector, the standard used, less expensive allocation of short-lived objects) and CGC (conservative garbage collector, allows for interaction with C programs, is more expensive and slower) [60]. An example of high-level memory safety capability is stack-inspection access control [57]. Another language safety concern is portability, where the language is completely defined by its manual [58]. The abstractions the language provides are safe: knowledge about details of how the language is implemented, how it manages memory and the order of object construction/destruction is not necessary in order to write a safe program [58]. Scheme's language manual, as an example, specifies the exact behavior of all programs written in the language [58]. Although, Scheme dialects maintain their own language manuals; they are well documented and they comply with the standard Scheme core. They run on Unix, Max OS X, and Windows platform. However, they all implement their own non-standardized libraries in addition to the standard R6RS Libraries. Language security is important because as observed in [57] many security violations are due to vulnerabilities in the language design and implementation. Safe language features such as access-control lists modifications and access checks, capability-based security (distributing "unforgeable" references to sensitive objects), specification of temporal properties (to allow for communication protocols and resource usage specification and enforcement), control over execution environment (controlled access to local resources: CPU, files etc. to prevent denial-of-service attacks by sandboxing ―untrusted‖ processes) among others [57]. Sandboxing is provided by Racket by sandbox-security-guard (from racket/sandbox) [63]. Some weaknesses are mentioned in Scheme Security Project [64] related to the eval language construct. Security guards in Racket provide explicit filesystem-access and network-access checks [61]. PLT MzScheme also offers several fundamental security mechanisms such as custodians (to manage resource allocation), security guards, inspectors (controlled access to opaque structures), namespaces (control access to Scheme bindings), and thread groups (control the allocation of the CPU) all of which and more can be found in Racket as well [62]. Safe language technologies set the ground for building secure systems. For example, a Web server built in PLT Scheme [57] (currently known as Racket) does not allow buffer overflow attacks. High-level security policies' enforcement is supported by low- and intermediate-level secure language technology [57]. Type systems and type checking play a role at a high-level of abstraction, as well. In [58] the author observes that the interfaces of modules can be seen as types, "providing summary of the facilities" to be exposed to the client modules participating in the composition, or as a contract between "implementers 74 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report and users". In [59], the author discusses the type safety of XML documents enforced by schemas that define their structure. XML documents can be validated against its schema definition. In [16], the OASIS Standard of Web Services Business Process Execution Language Version 2.0, requires conformant implementations of WS-BPEL to enforce conservative static analysis of BPEL processes. The analysis, as described by the standard "is to detect any undefined semantics or invalid semantics within a process definition that was not detected during schema validation against the XSD...". Static analysis includes checks performed on the WSDL interface and also on the partners invoked by the process, among many others. BPEL standard provides schemas for all its language constructs. In addition, since every BPEL process to be invoked must be described by a WSDL interface, which it makes available to clients, BPEL processes are themselves typed according to the observation given in [58]. Moreover, BPEL defines WS-Security mechanisms for high-level security protection, such as checking for modified or forged messages while "in transit or while residing at destinations", detecting invalid or expired messages, support timestamps on signed messages, protection against denial-of-service attack. After searching for current BPEL implementations, it was found that they have been implemented using Java language. In [57] Java is described as a safe language and BPEL implementations possibly inherit some of the safe-language properties; however, this writing does not investigate how WS-Security mechanisms or other safety requirements are implemented. 2.5.2 Web Application Development Web applications are programs that can be accessed from a browser. Clients (human) access applications‘ functionality stored at the server‘s side via a browser. Businesses are building web applications to provide access to the software they are hosting and maintaining. This allows them to distribute their software products without the need to install the applications at the client‘s side. The business model of leasing software solutions to clients is known as software-as-service. The advantage of this is that the applications are maintained centrally by application service providers (ASP) and as the software evolves, clients are not directly affected. The disadvantage is the inflexibility of the software to be adjusted to satisfy the clients‘ needs better, i.e. the software product is accepted ―as is‖. In addition, access to the application is done by browsing or manually initiating different functionality. The human user is ―composing‖ the services provided by the ASP. The difficulties to integrate applications (or make them interoperable) and the incapacity to customize the software to better fit customers‘ needs led to the development of Web services which built on the software-as-service model to allow the development of complex applications by composing existing [15]. Some of the existing technology that allows us to build web applications are (1) for presentation layer in the browser: Java, JavaScript, DHTML, Flash, and Silverlight; (2) for application layer, server-side: ASP, ASP.NET, CGI, ColdFusion, JSP/Java, PHP, Perl, Python, Ruby on Rails, and Struts2. HTTP is the communication protocol used [18]. Web Applications: Scheme vs. BPEL There are Scheme implementations that allow the programmer to build web applications. An example of this is the Racket implementation of Scheme [65]. An example of a web application implemented using Scheme [65] and BPEL can be found in Appendix A. The application accepts a number from the user and returns that many ―Hello‖ strings. The input and output to the Scheme server come from a client‘s browser. The BPEL application requires schema to describe the input and output represented in a XML document. The web page was not created in this example; however it would require the use of JSP technology and a servlet, for example, to dispatch the request from the browser to the BPEL process. 75 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report Similar web client functionality as Scheme‘s can be achieved using other technologies such as JSP, Servlets, JavaScript are some of the possibilities. In addition, the Scheme application was modified to add the number obtained from the user and to return its double. The only changes required was a one line code that computes the response. For lack of space this functionality was not implemented in BPEL. The second functionality would have simplified the BPEL application, the while scope will not be needed. Compared to BPEL, Scheme web server application is programmed at a lower level. It explicitly manipulates TCP connections, threads, creation of HTTP pages to build the response, handling of security issues, are some examples. A lot of research effort is directed in building secure Web servers in Scheme. A collection of papers reporting on the accomplishments can be found in [66]. BPEL operates at a higher level of abstraction. BPEL processes require a Web server on which they can be deployed and run. Although, BPEL is verbose language built on top of XML technology, existing implementations provide graphical IDE which is capable of auto-generating source code from the models. The IDE provide wizards to generate WSDL interfaces from schemas (e.g. DTD, XSD). Schemas can be created using the graphical environment, as well. Low-level security, transport protocol handling are handled by the implementations as defined by the standard. To build a Web application in Scheme requires expertise, experience with the language, and more effort compared to building a BPEL process. 2.5.3 Web services design and composition Web services are applications developed primarily to enable automated interaction between programs. It uses Web services technology to permit the development of complex business processes and transactions as services, which allows the users to customize the business solutions to better fit their needs, something that is deficient in web applications. The programming model of web services is applications built as components are hiding their implementation details behind standardized web service interfaces (WSDL) that allow access to their functionality through standardized communication protocols (e.g. SOAP over HTTP) and exchange data via standardized wire protocols (XML) [15, 31]. Web services can be atomic or composite. Atomic web services provide a simple, cohesive--from the business prospective--functionality. They can be composed into complex business processes (composite web services or web service compositions) and expose their functionality using web service interfaces. Customized solutions can be built either by composing web services statically (static binding protocol) during the design of the services or dynamically (dynamic binding protocol or late binding) at run time depending on the business requirements [15, 32]. Web services can be stateless (do not keep state between distinct operation invocations.) This is inherent to the underlying transportation protocol (HTTP) which is also stateless. In order to process a request, the state needs to be retrieved from persistent data repository [31]. Web services can also be stateful. In long-running transactions where a session (conversation) spans multiple requests, a composite web service can preserve transient data for each conversation. The interaction pattern can be synchronous (request-reply) or asynchronous (one way.) The messaging style for fine-grained services can be RPC-style, where the message contains individual parameters of the operation. For course-grained services the messaging style is document style, where a whole document is sent (e.g. purchase order) to the receiving service [15]. Web services have roles in the interaction with other Web services. They can be web service providers or web service requestors. They can also fulfill both roles in a given conversation. Web service providers describe their functionality, non-functional properties, and how clients can invoke their services via WSDL interfaces. They advertise their capabilities by publishing the WSDL interface to a service registry, where clients search for services to satisfy their business needs. When a web service client finds the best web service provider in the registry, it can bind to it using the information in the web service interface [15, 32]. 76 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report Web Services: Scheme vs. BPEL WS-BPEL is the OASIS standard built to fulfill the role of a composite web service capable of holding state. A detailed tutorial on how to build a BPEL application is provided in [33]. It details on all the components required to build the process including creating XML Schema, WSDL, BPEL process, composite application (Service Assemblies) and how to test the composite application. Although, there are Scheme language implementations supporting the development of Web servers and applications [34], there is no literature found that discusses how Scheme language can support web service development. A possible reason is that web services are platform and language neutral [15] and any of the existing languages can implement Web service functionality by wrapping it in a WSDL interface. Clients can invoke the functionality without being aware how it was implemented. This independence is achieved using the Web service technology stack described in detail in [15]. 2.5.4 OO-based abstraction Evolution Programming models and the languages supporting them which are based on classes and objects are said to be object oriented. The three fundamental concepts of the object–oriented paradigm are encapsulation, inheritance, and dynamic method binding [6]. Object-orientation is an evolutionary paradigm building upon earlier ones. The earliest languages introduced features that abstracted from the underlying platform. It made programs easier to understand. The concepts important to high-level language design are names (used to replace low-level concepts such as machine instructions and addresses), scopes (supported by scoping rules to determine where in the program text the name is visible and can be used), bindings (association made between different language features) and binding time (when those associations are made, e.g. compile, load, or runtime), referencing environment ( the set of active bindings; provides the context of the program at a given point), aliases (referring to an object in a given scope by more than one name), overloading (referring to more than one object in a given scope by one name depending on the context when the reference is made), and polymorphism (an object can have more than one type depending on the execution history and context) [6, 54]. Classes are data abstractions that encapsulate the representation of the data and provide operations for their manipulation. The evolution of data abstractions began with global variables. They were visible in all parts of the program and therefore modified by any executable statement. Program bugs were difficult to find. Variables exist for the whole duration of the program increasing the program‘s footprint. Local variables were introduced to reduce their visibility only to a segment of the program. This mechanism provides fault containment by limiting the program text where the fault might occur. Variables are allocated memory only for the time when the segment is executing and deallocated after the segment completes. With static variables, the ―life‖ or ―extent‖ of the objects (the period during which they are allocated computer memory) and their visibility are separated. The extent of the static variables is the whole program execution. Their visibility is controlled by the scoping rules [6]. The next stage of the evolution of data abstractions were the introduction of modules. They encapsulate a set of subroutines that share a set of static variables. Modules can be one of two kinds: module as a ―manager‖ and module as a ―type.‖ The ―manager‖ kind exports an abstract type (variables or a record) and a set of subroutines. The type can be instantiated by the module‘s users and passed as a reference to the module‘s subroutines. The ―type‖ kind allows for creation of instances of the whole module, i.e. the module is the abstract type (including variables and subroutines) [6]. 77 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report Object-oriented paradigm extends the notion of ―module-as-type‖ by adding inheritance (a form of reusability mechanism distinct from composition) and dynamic method binding which allows the functionality of the actual object in memory to be executed in a context where the base type functionality is expected [6]. Encapsulation mechanism was refined by providing different levels of visibility (e.g. private, protected, and public) to allow for finer control of which names are exported and which are only local to the class [6]. Programming Languages Variations Some languages allow classes to be nested. Nesting is useful in creating object closers. It becomes a mechanism capable of capturing an explicit representation of the referencing environment (a context). At a later point in the program a context can be bound to a subroutine. It allows for the separation of a subroutine and its referencing environment which provides a greater flexibility. The subroutine can execute in a context created earlier [6]. Classes can hold variables or reference to variables that point to objects of classes (reuse by composition.) Programming languages vary in provision of reference model or value model for variables. Value model dictates the implicit creation of automatic variables from the program stack. With the reference model, objects are dynamically allocated on the heap by explicitly initiating their construction. Their destruction can be either explicit via language construct or via a language mechanism such as garbage collection [6]. Languages can very by the type(s) of polymorphism they support. Subtype polymorphism is achieved using inheritance as the underlying mechanism. Implicit parametric polymorphism is realized by allowing variables to bind to any type of object (value) at runtime [6]. Explicit parametric polymorphism (generics) is a language feature that allows types themselves to be variables and instantiation of those type variables (binding of a type variable to a concrete type) is usually done at compile time [55]. Scheme Language Scheme language consists of small set of base constructs such as variables, constants, conditionals, assignments, procedures and functions applications, constructs implementing variable definitions, and procedure parameter specifications and function or macro definitions. Specific Scheme language dialects such as PLT Scheme (currently Racket), DrScheme extend the base language with constructs: modules, generative structure definitions, expressive macro system, and class systems. Classes in PLT Scheme are first class values with lexical scoping rules and single namespace. Mixins and explicit inheritance are implemented in macros. Claims are made that objects, the instances created by the class system are space and time efficient when compared to those of Java object and Smalltalk. Method-invocation efficiency is compared to those of Smalltalk and the interface-based Java method invocations [20]. OO-based abstractions will be discussed in the context of Racket dialect of Scheme [56]. A class expression in Racket is a first-class value. The syntax of a class is: (class superclass-expr decl-or-expr ...). The built-in root class is object%. There is no method constructor, instead there are initialization expressions. In addition, the class hold the declaration of methods and fields. Classes are instantiated with the new form. Initializing arguments need to be given values at the instantiation time and cannot be referenced directly by methods. They are used to initialize fields. Class fields are available to methods. Class instances can be named or anonymous. Racket provides inheritance mechanism. The (super-new) expression is used to initialize the super class. The initializing arguments, field declaration and (supernew) can be placed in any order in the class. However their relative order determines the order in which they will be evaluated when the class is being instantiated. If there are dependencies between them, they need to be ordered. Methods‘ declaration order is not important, because they are fully defined when the class is instantiated [56]. 78 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report Interfaces in Racket are used to be able to check whether an object of a class implements a specific set of methods. To declare a class that implements an interface class* form is used. If a class does not implement the methods declared in the interface it extends, a runtime error will occur during its evaluation. An example of a class declaration is shown in Figure 1 . An object as an instance of this class was created and initialized. Its field is updated at runtime and its value displayed [56]. Figure 1: Class fish% and an instance charlie in Racket [56] BPEL Language In [21] the authors are comparing OOP paradigm to Services Oriented Computing paradigm and the similarity and differences in concepts and abstractions. For example, we think of objects as providing functionality (services) and hiding implementation details and so do web services. We describe objects and services in terms of the interfaces they provide to their clients other objects or services. OOP method invocation is contrasted with SOC find-bind-use. The shared execution context of OOP is compared to the multiple contexts of SOC, where web services run and interoperate in heterogeneous environment which is middleware and operating system platform and language transparent to the SOC model. Another difference is the interaction between components in OOP and their distributed counterparts in SOC. OOP is using synchronous method invocation as the communication mechanism by contrast the distributed nature of SOC necessitates asynchronous message passing to achieve flexibility. Composition is central to SOC. In OOP it is a design activity, i.e. the architecture of the system is static. Many patterns are created to assist the programmer to build better solutions for the business problem. By contrast, in SOC the composition of services is dynamic. Web services are built out of other services that are dynamically discovered and composed. Since the architecture is dynamic, its constituents (the web 79 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report services), can be selected and replaced based on other properties such QoS [15, 32]. From architectural viewpoint, this is a major shift from designing a static architecture in OOP to providing an infrastructure to enable and support the dynamic selection and composition of distributed components in SOC. BPEL is one of the languages to fulfill this objective. The authors in [21] propose thinking of inheritance as a special form of composition where the interface (behavior) of the composed object is preserved; as opposed to typical composition where the interface of the enclosed object is wrapped and filtered by the enclosing object. Then comparisons can be drawn with the composition of web services in SOC. Polymorphism in OOP is the ability of an operation to take different operands (objects of different classes) and provide different implementation or behavior depending on the operands‘ types. To be able to build a system that uses polymorphism, the minimum requirement is for a language to have a formal type system. According to [21] typing and inheritance is not formalized and the notion of polymorphism is non-existent. Other OOP abstractions such as encapsulation information hiding (i.e. hiding the implementation details with a stable interface to protect the system from changes) are relevant to SOC as well. 2.5.5 Reflection Reflection is the mechanism through which programs perform computations on themselves by means of inspecting their internal structure and types (introspection) or altering the structure and the behavior of the program (intercession.) This mechanism allows for programs to query the program‘s symbol table at run time or to inspect their execution stack [6, 7]. Reflection can be useful to provide performance statistics, in debugging tools, for self-optimization, self-modification, and self-activation among others [6, 8]. Languages that support reflective programming need to have the following characteristics: incorporate meta-object facilities that keep information about the program structure, API for observing and modifying the program execution at runtime. Criteria for assessing language‘s support for reflective programming include: (1) source code discovery and modification at runtime; (2) conversion of a string to a language construct; (3) evaluation of a string as an expression; (4) runtime interpreter creation to give new meaning to a programming construct [11]. Reflection: Scheme vs. BPEL Language Some characteristics of Scheme language is homogeneity of program and data, i.e. Scheme programs and data are manipulated using the same language mechanisms. In addition Scheme‘s operational semantics can be defined by Scheme interpreter written in Scheme language itself, this is Scheme is capable of selfdefining. [6]. Scheme is a dynamic language that can expand itself. Reflection mechanisms are incorporated into existing implementations of Scheme. Examples are provided in Racket implementation of Scheme [51]. Figure 2 demonstrates reflection in Scheme. The code snipped is adapted from [52]. The eval function takes a quoted expression as argument and evaluates it. Because of Scheme‘s lexical scoping rules and the capability of eval to dynamically evaluate an expression, eval cannot see the local bindings in the context where an evaluation is attempted. To make a set of bindings visible or available for dynamic evaluation, a namespace mechanism is used. Namespaces can be encapsulated within a module. To access the current module, a reflective hook is needed: define-namespace-anchor. Then a namespace can be defined within the current module using namespace-anchor->namespace, as the example in Figure 2 shows. 80 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report Figure 2: Scheme reflection example [52] The current programming model of BPEL is based on the assumption that information and service composition will remain static throughout its lifetime. As a consequence the language does not support reflective features. In [22] the authors propose a reflective framework as an extension to BPEL to allow dynamic changes to the composition based on changes in the environment reflected in the data being processed. The authors‘ goal is through the reflective framework to allow the creation of more adaptive service composition and reliable control flow and data flow correctness [53]. Their proposed framework uses computational reflection mechanism structured in two levels: base-level (or application-level computations) and meta-level keeps information about the base-level. The structures used in the framework are TD (data table) containing participants declarations and data declarations and PFG (Parallel Flow Graph) representing the control flow with explicit synchronization for parallel programs. The operations the framework provides are adding and deleting: nodes, synchronization edges (between two parallel branches), data variables, and participants; replacing nodes of the same type; reordering nodes [53]. 2.5.6 Aspect-orientation Experience with creating systems in different application domains showed that using only procedural, object-oriented, functional, or logic programming techniques is insufficient to clearly capture and implement certain design decisions. The problem domain or the operationalization of non-functional 81 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report requirements, forces some functionality to be scattered across different components. This results in a ―tangled‖ and ―scattered‖ code that is difficult to develop and maintain. Aspect-oriented programming allows this cross-cutting functionality to be identified, isolated, composed, and reused [9]. There are similarities between Aspect-oriented programming and computational reflection and metaobject protocols [9]. Specifically, it is possible to exploit the reflective and meta-object facilities of a language to develop AOP prototype systems, i.e. reflection can be used as a tool [9]. Model transformation is another approach to achieve the goal of AOP [9]. Different source models are ―weaved‖ or in MDE terminology transformed into a target model using model transformation definitions written in a model-transformation language [10]. From this discussion can be seen that non-aspect oriented languages and tools can achieve the goal of AOP. In this report, the criteria for a language to be aspect-oriented are dedicated support for specifying aspect, pointcuts, and advice, an aspect compiler to ―weave‖ aspects with the base language, provision of aspect-oriented programming environment. This implies that the conceptual model of declaring an aspect which specifies both the pointcuts (selection of join points) and advice (adding functionality to the base model) should be expressible in that language. Aspect Orientation: Scheme vs. BPEL Language In [23] the authors propose the semantics for lambda_AOP advice weaving by extending the HindleyMilner type inference system to be able to ―inject applicable advices into lambda expressions during typing.‖ In [24] PLT Scheme is extended with features for pointcuts and advice for higher-order functions using the powerful macro system of the language to extend it. Also [25] provides an extension to Scheme language and resolve issues of dynamic scope generally needed for AOP in higher-order languages. AO4BPEL is an aspect-oriented extension to BPEL which allows the specification of crosscutting concerns such as logging, persistence, auditing, and security and support for dynamic adaptation of composition at runtime [26]. The authors use the AO4BPEL extension to BPEL to build a transparent security mechanism around the processes [27]. In both Scheme and BPEL aspect orientation is implemented as an extension to the base language. 2.5.7 Functional programming The theoretical roots of functional programming can be traced back to Lambda calculus, in which computation is done by macro-style substitution of arguments in functions. As the author states in [6], any program (regardless of the computation paradigm used) can be seen as a ―constructive proof of the proposition that, given any appropriate inputs, there exist outputs that are related to the inputs in a particular, desired way.‖ The difference stems from the way the paradigms express the computation and the relationship among the abstractions. For example, in functional programming computation is expressed as a mathematical function over its inputs without side effects. Typical features of the functional languages are higher-order functions (capable of accepting other functions as parameters); first-class function values (allowing functions to be threaded as any other value in the program, e.g. to be assign to variables, store it in structures, to be passed and returned from a function); implicit parametric polymorphism (the types of all variable are universally quantified over all types [35], i.e. the values they hold determine their type), structured types such as Lists; constructors to build the structured types (also called aggregates); garbage collection (to automatically reclaim memory for all dynamically allocated data in the case where stack allocation is unsafe) [6]. Garbage collection is essential to functional languages since variables are generally allocated space from the heap and have unlimited extend. This is necessary in the case where the referencing environment needs to be saved as a closure to be retrieved later. It is used in the creation of co-routines or when passing functions as parameters to other functions. 82 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report The implementation needs to guarantee that memory allocated to variables that will not be accessed later in the program will be released to ensure that the program will not run out of memory [6]. Functional Programming: Scheme vs. BPEL Language Scheme possesses all characteristics of a functional language. In addition to those, it has characteristics that are typical of the Lisp-family languages [6]. These include homogeneity of programs and data both of which can be represented as lists and can be compiled/interpreted at run time. Because of this capability, languages in the Lisp family can express their operational semantics in terms of an interpreter expressed in the given language. Consequently, the given language is capable of self-definition [6]. The program snippet below demonstrates the functional characteristics of Scheme. It provides a Scheme implementation of computing the factorial of a number using tail recursion [36]. The function is evaluated in Racket environment using DrRacket (Figure 3). Figure 3: Factorial function implemented in Scheme using tail recursion and the output of a test run [36] An approach to assess whether BPEL can be considered a functional language is to compare the characteristics of functional languages to these of BPEL. The main characteristics such as higher-order functions and first-class function are not available as a language feature. In addition, BPEL is executed for its side-effects and keeps state. The control structures of the language are imperative in style. Some examples are while loop, sequential flow (support for parallel as well), and assignments. However, comparison performed by other authors of BPEL to another functional language(s) was not found in the existing literature. A while structure is used to implement the factorial function in BPEL. Initially, the input value is assigned to the output and if it is greater than one, the while scope is entered. The value of the input is decremented by one and multiplied by the output and another attempt is made to enter the while scope. The outline of the control structure is the same as the one used for building the web application example (details provided in Appendix A.) The difference comes from the assignments, computation, and predicate termination condition. Because of its size, the source code, sample input, and output are provided in Appendix A. Algorithms in Scheme can be expressed concisely, without a heavy, supporting infrastructure required by BPEL. The Scheme tail-recursive implementation of the factorial function is purely functional; there are 83 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report no side effects (i.e. updates of variables.) In this paper, the possibility of BPEL to be recursive is not investigated. The implementation of the factorial algorithm using recursion requires sequence of updates to both input and output variables. BPEL as a language is meant to be stateful. The web services which it composes can be stateless; although their implementation can have side effects by updating an underlying data repository [31]. 2.5.8 Declarative programming In literature, declarative programming is defined informally as description of what is to be computed and not how to be computed [1, 4, 5]. In his seminal article [2], Robert Kowalski separates the definition of an algorithm into two concerns: a logic component which he defines to be the knowledge used for solving the problem, and a control component which defines the problem-solving strategies for using the knowledge. The logic part of the algorithm determines its meaning and the control part its efficiency [2]. Declarative programming is then about defining the logic component and the underlying execution engine will implement the control component. Others view declarative programs as theories in some logic and computations as deduction from that theory [1]. Languages based on first-order logic such as pure Prolog, higher-order logic such as Gödel, λ-calculus such as Haskell and Scheme qualify according to this definition. This view is broad and includes logic (a.k.a. relational [3]) and functional programming among other applications such as formal methods, theorem proving, algebraic specification, and program synthesis. According to [1] declarative programming can be subdivided into weak where the programs are theories but complemented possibly with control information by the programmer to improve efficiency; and strong where programs are theories and the system supplies all control. In [4] Michael Hanus has similar view of declarative programming as a style of programming that describes the properties of the problem domain and its solution, rather than the steps of the computation needed to obtain the solution. In [4] he describes the similarity of classes (depending on the underlying formalism) of programming languages that support the declarative paradigm. In [5] description of languages that combine both logic and functional programming is provided. Declarative Programming: Scheme vs. BPEL Language According the description above of what constitutes a declarative language; Scheme qualifies as such since it is a functional language which is included in the definition of declarative languages [1, 4, 5]. BPEL allows for the specification of operational behavior descriptions; it uses programming language constructs to describe a process behavior. Different formalisms are used to specify system‘s behavioral model (based on automata theory) and the specification of the expected properties (based on logic, i.e. declarative in nature.) The dynamic interface view of a business process can be described via a protocol (the set of all legal conversations between the process and the outside world.) This is a description of the process‘s interface behavior. The purpose of providing a declarative specification of the interface protocol is to verify conformance of the concrete process implementation to the specification. BPEL abstract process specifies the business protocol. However, since BPEL is imperative process language, its abstract specification is non-declarative. The authors in [50] extend BPEL with declarative behavioral specification language based on a form of regular expressions. 2.5.9 Batch scripting Generally, programs can be seen as functions that produce a result by manipulating the input in a ―wellunderstood way‖ [6]. These programs are self-contained: built to fulfill a specific purpose or a goal. In practical systems there is a need to configure and coordinate discrete functionality implemented in programs in a prescribed way to fulfill a higher business goal. This can be achieved by using a generalpurpose programming language, since they have all the language features necessary -- such as control 84 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report flow (sequencing, selection, iteration, and recursion), variables, data types, subroutines, and control and data abstractions -- to automate the coordination between independent programs. However, their purpose is to provide features and security mechanisms (e.g. static type checking) built into the language to support the programmers in creating efficient, maintainable, portable programs [6]. The main requirements of scripting languages, by contrast, are flexibility, local customization, rapid development, dynamic type checking, and extensive use of structured types such as tables, lists, files, and operations such as pattern matching and string manipulation, easy access to system facilities, economy of expression [6]. These requirements change the emphasis on the feature set provided by the scripting languages. Batch scripting (as opposed to interactive commands processing) is the process of specifying commands to a command interpreter in a file (batch file) which are consequently executed (interpreted) usually line by line [28]. Their main purpose is to automate a process that needs to be performed on regular bases. Batch Scripting: Scheme vs. BPEL Language Searching the existing literature provided many examples of the Scheme language being used as a scripting language [37, 38, 39, 40, 41, 42]. There are online tutorials showing how to write scripts within a specific implementation of the language, which is not necessarily compatible with other implementations of Scheme. Some examples of command-line parsing using Racket implementation of Scheme are provided in [41]. A Scheme program can be converted into an executable script in Unix and Mac OS X by replacing the language declaration #lang racket at the top of the definition area with #! /usr/bin/env racket and the file permissions need to be changed using chmod+x <program_filename> on the command line to make the new program executable [38]. Similarly, batch files can be created in Windows [39]. For example Figure 4 and Figure 5 show the batch file and the output produced after it is run in the Command Prompt. The command to execute the script has to be written after <; > a semicolon. The operating system automatically attaches the path to the script as an argument to the command Racket.exe. Racket implementation provides command-line command to parse the arguments supplied to the script. The script Hello1.bat takes a string argument and a flag. If flag is ―-v‖ then a long message is produced, otherwise the input argument is echoed back to the user. Figure 4: Hello1.bat batch file execute Racket code from Windows .bat batch files [39] 85 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report Figure 5: Output after running Hello.bat file from Command Prompt In [43] the authors describe an implementation of a BPEL application that executes script commands in the current run time environment using embedded Java commands Process p = Runtime.getRuntime().exec(cmdString). In [44] describe a possible way to invoke a BPEL process from a sell script to be able to be monitored and controlled from a Control-M environment. Since BPEL engine requires a Java EE server and needs to be remotely invoked, the virtual machine that is launched by the sell script will be different using the current technology. A proposed solution is to have a WS client as an intermediary between the shell script and the BPEL process which will handle the remote invocation and possible exceptions thrown by the server. In [45] the authors illustrate the requirements for a job control language to describe the complex grid applications and their dependencies, error handling, failure recovery, monitoring, resource release among others. They compare existing languages that support job control or grid applications orchestration. BPEL is one of the languages that satisfy the requirements they set forward. For example, they explain that most of the job orchestration can be implemented using BPEL, specific to grid applications task handlers such as job submission, file transfer can be achieved using ―Java Partner Links.‖ Other requirements—capability for setting of a threshold for failed tasks tolerance or task execution monitoring—cannot be easily satisfied. Although powerful, expressing error handling and inter-task communication requirements would be complex when using BPEL. As demonstrated in [44], it is possible to execute external processes/commands in BPEL using Java API, it requires extensive knowledge of both BPEL and Java API implementing this capability. In addition the BPEL program footprint is larger than Scheme‘s batch script footprint. The reason is that Scheme language has explicit support for batch scripting and this is not the case with BPEL. 2.5.10 UI prototype design User interface development tools need to support the use and management of UI components, organizing and arranging layout capabilities, and functionality for testing the prototype interfaces at minimum. The programming language used to specify (e.g. by programming or scripting) user interactions affect the usability of these tools Different phases of software development require different tool support for user interface prototyping. In the early stages during requirements elicitation the end users need to be closely involved in the UI design. The tools support has to target non-programmers. In addition, the developers are specialists in graphical design and not necessarily expert programmers. During the implementation phase the tools need to support GUI or non-GUI components management and usage to allow for creation of UI prototypes [46]. The set of features or capabilities that UI prototyping tools need to provide is therefore different and depend on the stage of the software development and the application requirements. 86 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report UI Prototype Design: Scheme vs. BPEL Language In [47] the author introduces MysterX object-oriented Scheme toolkit which is capable of building interactive applications. This is achieved by using reflective mechanism to integrate and host COM components capable of creating visual interfaces (e.g. Microsoft‘s Visual Basic, or to create Dynamic HTML using JavaScript or VBScript.) The window components‘ properties can be set using Scheme language. Scheme is used to create event handlers to respond to user‘s actions. MysterX combines different technologies and languages to enable the creation of GUI applications. In [29] is given a description of an implementation of Scheme language that allows the programmers to build graphical interfaces. It provides support for Core Windowing Classes, Geometry Management (defining containers and so called containees, defining new types of containers), mouse and keyboard events, windowing class reference (window area, canvas, button, frames, check box and other window widgets) and many more capabilities. Similarly, Racket implementation of Scheme provides its own implementation for GUI design capabilities [48]. In addition it has capabilities to build dynamic Web pages as demonstrated in [65]. BPEL is designed to support composition of web services using machine-to-machine communication; however, it does not support human interactions. Support for human interactions was proposed as an extension to the BPEL language. BPEL4People enables the definition of client applications to support human interactions [30, 49]. Intra-process UI interaction in BPEL can also be achieved via XML-test cases; however those were not meant to be used in production [33]. BPEL is deployed on a server and invoked remotely through its WSDL interface. An external client has to exist [44]. It can be another BPEL process, a browser, or a Web service [15]. 87 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report 3 Consolidated Analysis and Synthesis of the Results Criteria / PL 1. Default more secure programming practices 2. Web applications development 3. Web services design and composition 4. OO-based abstraction 5. Reflection C++ C++ is close to the operating system, especially when it relates to pointers and memory access, and this fact makes C/C++ unsafe C++support creating web applications using Wt C++ Toolkit . C++ web services use XML remote procedure protocol (XMLRPC) or Simple Object Access Protocol (SOAP) as a transport layer to send a request and receive a response. C++ supports object oriented based programming, it provides multiple inheritance and exception handling as well as interface definition. Static dynamic binding C++ doesn't support runtime reflection, but does support compile-time reflection. JavaScript JavaScript is dynamically typed and considered unsafe. JavaScript is imperative scripting language that mainly used for client side internet applications. JavaScript can call a web services as being the client using, JAX-WS is a Java API for XML-Based Web Services is a framework helps to do web service. JavaScript doesn't support inheritance or virtual functions. JavaScript is build on top of Java, ExtendScript is a construct facilitates a reflection behavior. PHP Dynamically and weakly typed language, Garbage collection, Many functions defaulted to Extremely Popular, Efficient, Fast, Free, OpenSource, Many books, The PHP Manual, Provides the SOAP extension to develop SOAP servers and clients and the XML-RPC ObjectOriented, PDO for uniform access to any database, Criticized Supports, Complete reflection API, reverse engineer classes, interfaces, 88 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report true, Popular Easy to learn, Supports many web servers and DBMS, CrossPlatform, Portable extension to create XMLRPC servers and clients , Simple to use functions, methods and extensions. Scala Static and strongly typed which uses type inference to deduce the type, Garbage collection, Used by many companies, Less secure than Java in a few superficial ways Several web frameworks for web development, Code is brief and expressive, Type-safe, Ajax and Comet support, Scalable Frameworks (Lift, etc.), Supports. Pattern matching, Higher-order functions, XML support, Lift’s built-in support for REST and other web services ObjectOriented, more orthogonal and complete language Same as Java, Has richer types, which are not fully reflected in bytecode, Scala reflection library is in development AspectJ Not really typesafe, static typing, memory management by creating new Aspect Several crosscutting concern like monitor & detect app. Failure, error handling & repair, authentication, verification and sessions management Complicated development and deployment compare to C#, can be used to monitor multiple web service, service call, services failure and repair An aspect has very similarities like class, supports the basic principles like abstraction, encapsulation, inheritance (partial in some cases) Has very powerful, but controlled mechanism for reflection through Reflection API C# Type-safe, Static Typing, dynamic typing available by declaration, Garbage collection Flexible, convenient and faster development and deployment Simple and faster development, lots of enhancement for better web Primarily language from objectoriented paradigm Supports through Reflection namespace 89 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report application development Haskell Thread safe, static typing, type casting is done by explicit conversion function, Module system is used for access control, Sub-typing is not available, internal Garbage Collection The monad Transformers libraries are used to add application specific functionality. HXML toolbox using generic data model This style is achieved by class types Static Reflection using Derive tool Java Robust, statically typed, implicit type casting, Access control is available, subtyping is possible, Automatic garbage Collection Java API's ; such as Servlet, JNDI etc Java Specification Requests submitted to Java Community Process Object oriented Static & Dynamic Reflection Scheme Dynamically and strongly typed language, implicit type casting, Access control is available, subtyping is possible, Automatic garbage Collection The core language is extended with libraries to allow web app development The core language is extended with libraries to allow web services development The core language is extended with libraries to allow the development in OO style with classes, objects, inheritance, polymorphism etc. Powerful reflection mechanism, homoiconic language capable of self-defining, program and data treated uniformly, dynamic language and program expansion; 90 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report dynamic structure inspection BPEL Statically, strongly typed, security requirements part of the standard, Java implementations of the language Web app via web clients invoking BPEL web services BPEL was built with the goal to support web services composition BPEL is not OO language and currently does not support OO paradigm Currently does not support it; however, there is ongoing research to extend the language Criteria / PL 6. Aspectorientation 7. Functional programming 8. Declarative programming 9. Batch scripting 10. UI prototype design C++ Aspects in AspectC++ implement crosscutting concerns in a modular way. C++ have the feature to weave advice code into destination code FC++ is a rich library that supports functional programming in C++. Pro*C mainly used for dealing with databases, it allows the developer to connect into a database and extract or manipulate SQL statements. Pro*C has some declarative statements mainly used to execute SQL statements. Batch scripting can be done using C++ standard library to execute system commands [255]. UI prototyping can be achieved in C++ via libraries (e.g. Win32 API [256], gtk+ [257]) 91 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report JavaScript JavaScript have the feature to weave advice code into destination code JavaScript support standard functions such as map reduce and select. In JavaScript declarative programming can be achieved using Functional [258] library. JavaScript allows for execution of system command as shown in [259]. JavaScript can be used to create webbased GUI running on the client side [260]. PHP Supported via several extension (The AOP Libarary for PHP and others), Performance issues Fn.php is a basic attempt bring functional programming to PHP Not Supported, Programmers can adopt a declarative style of programming, Code selfdocumented Supports scripting and batch processing via plugins and cron Supports via GTK+, Utilizes PHP 5's object model support, Platform independent, Full documentations, A book Scala No AspectJ-like implementation of AOP for Scala, Supports mixins, which enable separation of code that crosscuts class hierarchies Multi-paradigm supports the functional style. Not considered so by some, Statically typed object oriented language with closures Supports, Functional paradigm, Declarative, Declarative reading is Math definition Supports, Real Scripting, Access to complete JDK, do file operations on a high and object oriented level Supports, based on a Scala library, provides access to Java’s Swing framework of GUI classes, Alternative frameworks AspectJ Specially designed for Aspect-oriented programming Doesn’t have any direct support or extension to achieve functional programming. Can be achieved from the base language Doesn’t have any direct support or extension to achieve declarative style. Can be achieved from the base language Possible to monitor, automate, schedule etc. through the API of the base language by creating aspect at certain jointpoints Policy, rules, regulation updates etc. can be notified by implementing AOP, where the basic UI designing can be performed through the base language (Java) 92 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report C# Supported through other implementation like Spring.Net, not by Microsoft Functional programming can be achieved through the implementation of lambda expression and own namespace Supported through its built in Library of LinQ and Regex. External commands can be executed through System.Diagnostic namespace, also support for internal command and automation Extensive supports of tools & control from the IDE, considered one of the best IDE for UI design Haskell Embedding this style provides TRex Pure functional It is declarative. Can be achieved but in complex way by System.cmd API. Can be done by portable and native library Java Implementation is AspectJ Mimics Functional style but not pure This facility can be integrated with JSetL library Process Builder Class Provides this facility Provides lightweight and heavyweight components Scheme Recent research and development to extend implementation of Scheme with macros to allow specifications of advice, poitcuts etc. supporting AOP Supported via first-class functions, lang. constructs to allow sideeffect free programming, based on Lambda calculus, nonpure functional Declarative, by virtue of being functional Concise expression of batch scripts, widely used for this purpose The core language is extended with libraries to support UI/GUI development BPEL Only via extension to the language: AO4BPEL, much ongoing research Not a functional language, all its language constructs are imperative (structured programming), there is no notion of It is primarily imperative, there no language constructs to support declarative programming, BPEL abstract process has Possible via Java language code inserted into BPEL script, done as a prove of concept No native support, only via the language BPEL4People to allow for human interaction with the workflow 93 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report function the potential to be expressed declaratively, ongoing research for declarative extensions 3.1 Secure Programming Practices As per our studies, Java, C++, C#, Haskell and BPEL are type-safe languages and more specifically support static typing. JavaSript is dynamically typed, means it checks data types ar execution time. Scheme, on the other hand, is dynamically, yet strongly typed language. According to our findings, Scala is static and strongly typed which uses type inference to deduce the type. AspectJ is observed as not a type-safe language in some researches. PHP is a dynamically and weakly typed language. Java, C#, Haskell, BPEL and Scheme are the most secure programming languages although they provide it in a different manner. In addition, automated garbage collection used for safe memory management is provided by Haskell, Java, Scheme, Scala, and PHP. BPEL‘s implementations that we found are built on top of Java and they use all the capabilities of the language. 3.2 Web Application Development Most of the languages provide capabilities to build web applications. PHP is the most popular according to our research. Java builds high quality web applications using embedded APIs and Scala has several web frameworks for web development. Scheme has programming constructs that allow building a secure web server and web applications by extending the core language with macros. Haskell relies on external libraries for building those applications and C# has extensive supports for web development through its Visual Studio IDE. While BPEL can expose WSDL interface and browsers can invoke the services provided by it, AspectJ provides a better way to implement the cross-cutting concern without hampering the existing code. We have found AspectJ functionality has been exposed as a web application. C++ supports web development by hiding many network communications along with web browsers. JavaScripts mainly used for web applications, by running a script at user side, which help to distribute computations and reduce network bandwidth. 3.3 Web Service Design and Composition All the languages can expose their functionality via WSDL interfaces. However, for composing web services, BPEL is the language that has been built for this purpose. C#, using the .NET framework provides a very good support for interoperability through Web services. C++ uses XML-RPC helps for web service messaging and to establishes the communication across different platforms. JavaScript uses JAX-WS API for XML-Based Web Services to do web service across different platforms. 94 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report 3.4 OO-based Abstraction C#, Java, Scala and PHP are object-orientated languages. Scheme is a multi-paradigm language and supports the object-oriented paradigm. AspectJ‘s program implementation also supports some properties of the object-oriented language. In Haskell, with the help of type classes, we can use this feature. C++ is object oriented based programming style support Class, Instance, Method, Message passing, Inheritance, Abstraction, Encapsulation, and (Subtype) polymorphism. JavaScript support simple object-based paradigm, it doesn't support inheritance or virtual functions (polymorphism). 3.5 Reflection In our analysis and research, we have found that Reflection is supported by most of the languages. For example, Java supports both static and dynamic reflection. But, in Haskell we need a separate tool (Derive) to avail the support of reflection. Scheme is homoiconic language, reflection is supported natively. The programs and the language itself can be expanded and compiled at run time. PHP comes with a complete reflection API; we can reverse engineered classes, interfaces, functions, methods, and extensions. In C#, reflection is supported through its namespace construct, whereas AspectJ offers an alternative way to access the static and dynamic context through its reflection API. BPEL doesn‘t currently support reflection; however, there is ongoing research to expand the language to support the reflection mechanism. Scala‘s support for reflection is same as Java, but has richer types, which are not fully reflected in bytecode. C++ support compile time reflection but it doesn't support run-time reflection due to the unrecognizing detailed type information which be hidden by C++ compiler, however, run-time reflection in C++ is limited to some features such as monitoring expression types and querying the type name. JavaScript supports reflection object, which is a construct that provides the program with reflectedobjects' contents. 3.6 Aspect-oriented programming In our comparative analysis, we observed that AspectJ is the only language designed for AOP. Most of the other languages require extensions or libraries for AOP support. For example, AspectJ is one of the extensions of Java to provide AOP, BPEL uses AO4BPEL to provide support for the Aspect-oriented paradigm. Haskell achieves AOP via GHC compiler. There are some approaches to facilitate AOP in PHP (e.g. PHPAspect, Aspect-Oriented PHP, and others); however, most of these extensions have performance issues. There is no AspectJ-like implementation of AOP for Scala; however, Scala supports mixins, which enable separation of code that crosscuts class hierarchies. For C#, there are also some supporting extensions for AOP; the most updated and developed one is Spring.Net. Scheme supports aspectorientation via a powerful macro system, which extends the core language. AspectC++ is one of the extension of C++ that implement crosscutting concerns in a modular way, it supports code pointcuts and name pointcuts. JavaScript and C++, have the feature to weave advice code into destination code, this helps to change the behavior of the program without refractor the original code. The advice code is written in a separate file, and woven into the original code at execution time. 3.7 Functional Programming Haskell is a pure functional language which has no side effects. This is in contrast with Scheme which is a multi-paradigm language including functional; however, it allows side effects. Java can have the features 95 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report of functional programming with side effects and BPEL does not support the functional paradigm according to our research. Fn.php is an attempt to define lots of useful higher-order functions to PHP; however, it‘s very basic. Scala is a multi-paradigm programming language that supports the functional style; yet some don‘t consider it a really functional language (it is a statically typed object oriented language with closures). C# is also a multi-paradigm programming language which supports functional programming. AspectJ (the extension of Java), on the other hand, does not support the functional programming paradigm, but its subset Java does, according to our studies. FC++ is an extension to C++ language, it is a rich library that supports functional programming in C++. JavaScript support some functional programming such as map reduce and select, in javascript block does not have scope, only function have scope, which helps to maintain some states, which is good for functional paradigm. 3.8 Declarative programming All languages that support the functional paradigm are considered declarative according to our references. These include Haskell, Scheme, Scala, and C#. However, among those languages, Haskell is the only pure functional language. PHP is not a declarative programming language; however, you can adopt a declarative style of programming. Our studies show that AspectJ and BPEL do not support the declarative paradigm. C# and Java have libraries that support declarative programming. CPP is an imperative, object based and functional programming paradigm according to our understanding, Pro*C is an extension to CPP language used for dealing with databases in declarative style. Functional library can be used in JavaScript to achieve declarative programming. 3.9 Batch Scripting Batch scripting is supported by most of our languages; however, Scheme, Scala, and Haskell allow expressing scripts concisely. We have found that PHP also supports scripting and batch processing via plugins and cron. On the other hand, Java and C# support it via their own libraries. BPEL and AspectJ allow writing scripts using Java. C++Script is C++ library, it uses a dynamic programming and can be compiled with C++ compiler, it is considered one of the script languages. JavaScript allows for execution of system commands. 3.10 UI prototype design C# has very extensive support for UI prototype design using its IDE, where as AspectJ can provide some support for monitoring user interface threading, synchronization, notification etc. But the basic designing for core concerns can be achieved through the base language. Java, PHP, and Scheme allow creating interfaces via a toolkit. In order to support human interaction, BPEL was extended with the BPEL4People language. For the development of GUI applications, Scala provides a library that has access to Java‘s Swing framework of GUI classes. Haskell also uses different libraries which provide toolkits for interface development. UI prototyping can be achieved in C++ via libraries (e.g. Win32 API, gtk+). JavaScript can be used to create web-based GUI running on the client side. 96 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report 4 Conclusion We have made a comprehensive research and survey of ten languages that support most of the popular paradigms based on specified criteria. We have found that, C++, JavaScript, PHP, and AspectJ are not considered safe languages. For example, C++ allows pointers to access memory, while in AspectJ, which is statically-typed, a binding between a pointcut and an advice can give rise to type errors at runtime. Furthermore, JavaScript and PHP are weakly, dynamically typed languages and also considered unsafe. On the other hand, C#, Scala, Haskell, Java, Scheme, and BPEL are safe languages. Among these, Scheme is the only one which is dynamically typed. Web application can be developed using most of the languages we have studied. JavaScript is the only language that specially designed for client-side application development. Among these which are used for server-side web application development, PHP, C#, and Java are well suited for it. BPEL is specifically designed and standardized language for web service composition. We have found that most of the languages are capable to implement web services, whereas JavaScript can invoke web services as a client. From the research we have done, we have found that BPEL and JavaScript do not support the Objectoriented paradigm. They don‘t have constructs for inheritance. AspectJ does support some basic principles of OO paradigm. All other languages have OO capabilities either natively or via libraries. Scheme, Java, C#, AspectJ, and PHP have powerful reflection mechanism. Haskell supports static reflection via a tool. C++ has only compile-time reflection, while Scala reflection library is in development phase. JavaScript also accomplishes reflection via tools like ExtendScript. AspectJ is the only language built specifically for Aspect-orientation. JavaScrpit can achieve partial AOP. It has the feature to weave advice code into destination code. All of the other languages can have the AOP properties via libraries or extensions. C++, JavaScript, PHP, and C# can obtain functional style via either libraries or extensions. On the other hand, Scheme, Haskell, and Scala are considered as functional languages, among them Haskell is the only one which is pure functional. No implementation of functional programming has been observed for AspecJ, but its base language Java can mimic some functional styles. BPEL doesn‘t support the functional paradigm, but some research is ongoing to achieve this. All functional languages are considered as declarative by definition. Although most of the languages we have researched support batch scripting, some cannot accomplish it in a concise way. AspectJ and BPEL can also support batch scripting using Java API from its base language. Support for web-based GUI is provided by JavaScript. C# uses ASP .Net web form with its server side controls to built web GUI with the support from its IDE. Additionally, Java applets are good example of applications running at the client-side browsers. BPEL allows for human interaction with the workflow via another language called BPEL4People. Scheme, PHP and Java Servlet technology create HTML web pages that are sent through HTTP to the client to be displayed in the browser. All studied languages support command prompt UI prototyping. Non web-based GUI is also supported via libraries or toolkits. In addition to our base research work, we have also studied the popularity of our programming languages. According to TIOBE Programming Community Index for August 2010 (http://www.tiobe.com/), we have 97 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report found that C# and Scheme increased in popularity compared to August 2009. On the other hand, C++, Java, and PHP remain in the same position as they were last year. In addition, according to the same source, the ranking of the most popular languages to the least are as follows: Java, C++, PHP, C#, Scheme, Haskell, and Scala. As per, TIOBE‘s Categories of Programming Languages, object-oriented statically typed languages have been the most popular for more than four years. In fact, statically-typed languages increased in popularity by 2.5% since last year. Functional and logical programming languages rank after object-oriented and procedural languages; however, they have increased in popularity by 0.2%. According to (http://www.langpop.com/), the following rankings: Powell's Books, Google Code, Ohloh, and Slashdot placed Java on top position. Moreover, some rankings like Yahoo! Search Results, Discussion Site Results, and Lambda The Ultimate show that C++ ranks first. References [1] J. W. Lloyd, ―Practical advantages of declarative programming,‖ in Joint Conference on Declarative Programming, 1994. [2] Robert Kowalski, ―Algorithm = logic + control,‖ Communications of the ACM, v.22 n.7, p. 424--436, June 1979, ISBN: 0001-0782 [3] John Alan Robinson, ―Merging Functional with Relational Programming in a Reduction Setting (Abstract of an Invited Lecture),‖ Proceedings of the Symposium on Logic in Computer Science (LICS '86), Cambridge, Massachusetts, June 16-18, 1986. IEEE Computer Society, ISBN 0-8186-0720-3 [4] Michael Hanus, ―Multi-paradigm declarative languages,‖ Proceedings of the 23rd international conference on Logic programming, p. 45-75, 2007, ISBN: 0302-9743 [5] Sergio Antoy, Michael Hanus, ―Functional Logic Programming: Combining the paradigm features of both logic and functional programming makes for some powerful implementations,‖ Communications of the ACM, v.53 n.4, p.74--85, April 2010 [6] Michael L. Scott, ―Programming Languages Pragmatics,‖ Third Edition, Elsevier and Morgan Kaufmann Publishers, 2009, ISBN 13: 978-0-12-374514-9 [7] Ivan Kurtev, ―Adaptability of Model Transformations,‖ PhD Thesis, University of Twente, 2005, ISBN: 90-365- 2184-X [8] P. Maes, ―Concepts and experiments in computational reflection,‖ In N.K. Metrowitz (Ed.), Proceedings of OOPSLA‘87, (pp.147-156), Orlando, Florida, USA, 1987 [9] Gregor Kiczales, John Lamping, Anurag Mendhekar, Chris Maeda, Cristina Videira Lopes, Jean-Marc Loingtier, John Irwin, ―Aspect-Oriented Programming,‖ Proceedings of the European Conference on Object-Oriented Programming (ECOOP), Finland. Springer-Verlag LNCS 1241. June 1997 [10] Laszlo Lengyel, Tihamer Levendovszky, Gergely Mezei, Bertalan Forstner, Charaf Hassan, ―Model Transformation with Aspect-Oriented Constraints,‖ Electronic Notes in Theoretical Computer Science (ENTCS) , v.152, p.111--123, March 2006 [11] Wikipedia. Reflection (computer science) | Wikipedia, the free encyclopedia. [Online; accessed 19-July-2010], 2010. http://en.wikipedia.org/wiki/ Reflection (computer science). [12] '(schemers.org). Implementations | '(schemers.org). [Online; accessed 2-August-2010], 2010. http://www.schemers.org/Implementations/. [13] scheme-faq-standards. What Scheme implementations are there? | scheme-faq-standards. [Online; accessed 2- August-2010], 2010. http://community.schemewiki.org/?scheme-faq-standards#implementations. [14] Wikipedia. Business Process Execution Language | Wikipedia, the free encyclopedia. [Online; accessed 1-August- 2010], 2010. http://en.wikipedia.org/wiki/Business_Process_Execution_Language. 98 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report [15] Michael P. Papazoglou, ―Web Services: Principles and Technology‖, Pearson Prentice Hall, 2008, ISBN: 978-0- 321-15555-9 [16] OASIS Standard. Web Services Business Process Execution Language Version 2.0. [Online; accessed 1-August- 2010], 11 April 2007. http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html. [17] Michael Sperber et al. Revised^6 Report on the Algorithmic Language Scheme. [Online; accessed 1-August-2010], 26 September 2007. http://www.r6rs.org/final/html/r6rs/r6rs.html. [18] Wikipedia. Web application | Wikipedia, the free encyclopedia. [Online; accessed 21-July-2010], 2010. http://en.wikipedia.org/wiki/Web_application. [19] W3C Working Group Note. Web Services Architecture. [Online; accessed 25-July-2010], 11 February 2004. http://www.w3.org/TR/ws-arch/. [20] Matthew Flatt, Robert Bruce Findler, Matthias Felleisen, ―Scheme with Classes, Mixins, and Traits,‖ In Asian Symposium on Programming Languages and Systems (APLAS) 2006: Sydney, Australia, Springer Berlin / Heidelberg, v. 4279/2006, p. 270--289, October 2006. [21] V. D. Andrea and M. Aiello. Services and objects: Open issues. In G. Piccinelli and S. Weerawarana, editors, European workshop on OO and Web Service, pages 23–29, 2003. IBM Research Report. IBM. Computer Science, (RA 220). [22] Yanlong Zhai; Hongyi Su; Shouyi Zhan, "A Reflective Framework to Improve the Adaptability of BPEL-based Web Service Composition," Services Computing, 2008. SCC '08. IEEE International Conference on , vol.1, no., pp.343-350, 7-11 July 2008. [23] Alhadidi, D.; Belblidia, N.; Debbabi, M.; Bhattacharya, P.; , "λ_AOP: An AOP Extended Lambda-Calculus," Software Engineering and Formal Methods, 2007. SEFM 2007. Fifth IEEE International Conference on , vol., no., pp.183-194, 10-14 Sept. 2007. [24] David B. Tucker, Shriram Krishnamurthi. A Semantics for Pointcuts and Advice in Higher-Order Languages. Mar. 2003. [25] Dutchyn, C., Tucker, D. B., Krishnamurthi, S. 2006. Semantics and scoping of aspects in higher-order languages. Sci. Comput. Program. 63, 3 (Dec. 2006), 207-239. [26] Charfi, A. and Mezini, M. 2007. AO4BPEL: An Aspect-oriented Extension to BPEL. World Wide Web 10, 3 (Sep. 2007), 309-344. [27] Charfi, A.; Mezini, M.; , "Using aspects for security engineering of Web service compositions," Web Services, 2005. ICWS 2005. Proceedings. 2005 IEEE International Conference, vol., no., pp. 59- 66 vol.1, 11-15 July 2005. [28] Wikipedia. Batch file | Wikipedia, the free encyclopedia. [Online; accessed 29-July-2010], 2010. http://en.wikipedia.org/wiki/Batch_file. [29] Matthew Flatt, Robert Bruce Findler, John Clements, 2006, PLT MrEd: Graphical Toolbox Manual, Released July 2006. [30] OASIS Standard. BPEL Extension for People (BPEL4People) Specification Version 1.1 Committee Draft 09 / Public Review Draft 03. [Online; accessed 2-August-2010], 12 May 2010. http://docs.oasisopen.org/bpel4people/bpel4people-1.1-spec-cd-09.html. [31] Thomas Erl, ―SOA: Principles of Service Design‖, Pearson Prentice Hall, 2008, ISBN: 978-0-132-34482-1 [32] George Coulouris et al., ―Distributed Systems: Concepts and Design‖, Fourth Edition, Addison Wesley, 2005, ISBN: 0-321-26354-5 [33] NetBeans tutorials, Creating a Loan Processing Composite Application. [Online; accessed 6-August-2010], April 2008. http://netbeans.org/kb/61/soa/loanprocessing.html. [34] Jay McCarthy, Web: Racket Web Applications. [Online; accessed 6-August-2010], Version: 5.0.1. http://docs.racket-lang.org/web-server/index.html [35] Paul Hudak, John Peterson, Joseph Fasel, A Gentle Introduction to Haskell, Version 98. [Online; accessed 7- August-2010], http://www.haskell.org/tutorial/goodies.html [36] DZone Snippets, Factorial in Scheme. [Online; accessed 7-August-2010], http://snippets.dzone.com/posts/show/1734 99 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report [37] GIMP, GIMP Batch Mode. [Online; accessed 7-August-2010], http://www.gimp.org/tutorials/Basic_Batch/ [38] Guide: Racket, Welcome to Racket. [Online; accessed 7-August-2010], http://pre.plt- scheme.org/docs/html/guide/intro.html#%28tech._repl%29 [39] Guide: Racket, Scripts. [Online; accessed 7-August-2010], http://pre.plt-scheme.org/docs/html/guide/scripts.html [40] Guide: Racket, Reflection and Dynamic Evaluation. [Online; accessed 7-August-2010], http://pre.plt- scheme.org/docs/html/guide/reflection.html [41] Guide: Racket, Command-Line Parsing. [Online; accessed 7-August-2010], http://docs.racket- lang.org/reference/Command-Line_Parsing.html [42] Dorai Sitaram, Shell scripts. [Online; accessed 7-August-2010], http://www.ccs.neu.edu/home/dorai/t-y-scheme/t- y-scheme-Z-H-18.html#node_chap_16 [43] System Administrator, BPEL Call_Script. [Online; accessed 8-August-2010], 21-August-2008, http://www.javacrypt.com/tiki-read_article.php?articleId=7) [44] Suresh-JBI, Java Business Integration (JBI) - BPEL processes and shell scripts. [Online; accessed 8-August-2010], 24-June-2008, http://forums.sun.com/thread.jspa?threadID=5307536 [45] Sylvain Reynaud, Fabio Hernandez, "A XML-based Description Language and Execution Environment for Orchestrating Grid Jobs," Services Computing, IEEE International Conference on, pp. 192-199, 2005 IEEE International Conference on Services Computing (SCC'05) Vol-2, 2005 . [46] Seongjun Yun; Minseok Pang; Hongjin Cho; Jongho Chae; Yoonjung Choi; Eun-Seok Lee; , "User-friendly support environment for requirement analysis in user interface design," Parallel Processing, 1999. Proceedings. 1999 International Workshops on , vol., no., pp.414-417, 1999 [47] Paul A. Steckler, "MysterX: A Scheme Toolkit for Building Interactive Applications with COM," Technology of Object-Oriented Languages, International Conference on, p. 364, Technology of Object-Oriented Languages and Systems, 1999 . [48] Matthew Flatt, Robert Bruce Findler, and John Clements, Guide: Racket, GUI: Racket Graphics Toolkit. [Online; accessed 8-August-2010], Version: 5.0.1, http://docs.racket-lang.org/gui/index.html [49] Ta'id Holmes, Martin Vasko, Schahram Dustdar, "VieBOP: Extending BPEL Engines with BPEL4People," Parallel, Distributed, and Network-Based Processing, Euromicro Conference on, pp. 547-555, 16th Euromicro Conference on Parallel, Distributed and Network-Based Processing (PDP 2008), 2008 . [50] Aziz Salah, Guy Tremblay, Aida Chami, "Behavioral Interface Conformance Checking for WS-BPEL Processes," International MCETECH Conference on e-Technologies, pp. 253-257, 2008 International MCETECH Conference on e-Technologies (mcetech 2008), 2008. [51] Guide: Racket, Reflection and Dynamic Evaluation. [Online; accessed 8-August-2010], http://docs.racket- lang.org/guide/reflection.html [52] Guide: Racket, Reflection and Dynamic Evaluation. [Online; accessed 8-August-2010], http://docs.racket- lang.org/guide/eval.html [53] Yanlong Zhai; Hongyi Su; Shouyi Zhan; , "A Reflective Framework to Support Adaptive Service Composition under Correctness Constrains," Internet and Web Applications and Services, 2008. ICIW '08. Third International Conference on , vol., no., pp.180-185, 8-13 June 2008 [54] Leslie B. Wilson, Robert G. Clark, ―Comparative Programming Languages,‖ Third Edition, Pearson Education Limited, 2001, ISBN: 0-201-71012-9 [55] Paul J. Deitel, M. Deitel,‖ C++ for Programmers,‖ Publisher: Prentice Hall, 2009, ISBN: 13: 978-0-13-700130-9 [56] Guide: Racket, Classes and Objects. [Online; accessed 9-August-2010], http://docs.racket- lang.org/guide/classes.html, based on [20] [57] Christian Skalka, "Programming Languages and Systems Security," IEEE Security and Privacy, pp. 80-83, May/June, 2005. [58] Benjamin C. Pierce, ―Types and programming languages,‖ First Edition, The MIT Press, 2002, ISBN 13: 978- 0262162098 100 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report [59] Benjamin C. Pierce, "Types and Programming Languages: The Next Generation," Logic in Computer Science, Symposium on, p. 32, 18th Annual IEEE Symposium on Logic in Computer Science (LICS'03), 2003. [60] Guide: Racket, Performance. [Online; accessed 10-August-2010], http://docs.racket- lang.org/guide/performance.html?q=safe&q=safety#%28part._unchecked-unsafe%29 [61] Guide: Racket, Security Guards. [Online; accessed 10-August-2010], http://docs.racket- lang.org/inside/security.html [62] PLT MzScheme: Language Manual, Security. [Online; accessed 10-August-2010], http://download.plt- scheme.org/doc/301/html/mzscheme/mzscheme-Z-H-9.html#node_chap_9 [63] Guide: Racket, Sandboxed Evaluation. [Online; accessed 10-August-2010], http http://docs.racket- lang.org/reference/Sandboxed_Evaluation.html [64] Win Treese, Scheme Security Project. [Online; accessed 10-August-2010], http http://www.treese.org/scheme- boston/scheme-security.pdf [65] Guide: Racket, Web: Racket Web Applications. [Online; accessed 1-August-2010], http://docs.racket- lang.org/web-server/index.html [66] XML and Web Programming. [Online; accessed 9-August-2010], http://library.readscheme.org/pagexml.html [67] Serguei A. Mokhov, COMP 6411: Comparative Studies of Programming Languages. [Online: accessed July/August-2010], http://users.encs.concordia.ca/~c64111/ [68] Renaud Pawlak, Jean-Philippe Retaillé, Lionel Seinturier. 2006. AOP for J2EE Development. http://www.springerlink.com/content/k74h137r287851p5/?p=a9b625154a9f4ca5830c058304a4f3bb&pi=10. [69] Kiczales, G., Hilsdale, E., Hugunin, J., Kersten, M., Palm, J., and Griswold, W. 2001. Getting started with ASPECTJ. Commun. ACM 44, 10 (Oct. 2001), 59-65. DOI= http://doi.acm.org/10.1145/383845.383858. th [70] Kiczales, G., et al. An overview of AspectJ. In Proceedings of the 15 European Conference on Object-Oriented Programming (ECOOP). Springer, 2001. Contributors. AspectJ: Crosscutting Objects for Better Modularity. eclipse.org, 2007. http://www.eclipse.org/aspectj/. [72] Assaf, A. and Noyé, J. 2008. Dynamic AspectJ. In Proceedings of the 2008 Symposium on Dynamic Languages (Paphos, Cyprus, July 08 - 08, 2008). DLS '08. ACM, New York, NY, 1-12. DOI= http://doi.acm.org/10.1145/1408681.1408689. [73] Gasperoni, F. 2006. Safety, security, and object-oriented programming. SIGBED Rev. 3, 4 (Oct. 2006), 15-26. DOI= http://doi.acm.org/10.1145/1183088.1183092 [71] AspectJ [74] Niño, J. 2009. An overview of programming language based security. In Proceedings of the 47th Annual Southeast Regional Conference (Clemson, South Carolina, March 19 - 21, 2009). ACM-SE 47. ACM, New York, NY, 1-6. DOI= http://doi.acm.org/10.1145/1566445.1566537 [75] Jimmy Wales, Larry Sanger, and other authors from all over the world. Wikipedia: The free encyclopedia. [Online], Wikimedia Foundation, Inc., 2001-2010. http://wikipedia.org [76] Hilsdale, E. and Hugunin, J. 2004. Advice weaving in AspectJ. In Proceedings of the 3rd international Conference on Aspect-Oriented Software Development (Lancaster, UK, March 22 - 24, 2004). AOSD '04. ACM, New York, NY, 26-35. [77] Seban, R.R. "An overview of object-oriented design and C++," Aerospace Applications Conference, 1994. Proceedings., 1994 IEEE , vol., no., pp.65-86, 5-12 Feb 1994 [78] Rodriguez, L.; Tanter, E.; Noye, J. "Supporting dynamic crosscutting with partial behavioral reflection: a case study," Computer Science Society, 2004. SCCC 2004. 24th International Conference of the Chilean , vol., no., pp. 48- 58, 11-12 Nov. 2004 [79] Wang, M. and Oliveira, B. C. 2009. What does aspect-oriented programming mean for functional programmers?. In Proceedings of the 2009 ACM SIGPLAN Workshop on Generic Programming (Edinburgh, Scotland, August 30 30, 2009). WGP '09. ACM, New York, NY, 37-48. [80] C# Online .Net. http://en.csharp-online.net/IDisposable [Online] [81] Microsoft Corporation. Microsoft Developer Network. http://msdn.microsoft.com/ [82] Ramnivas Laddad. AspectJ in Action. Manning Publications Co., 2 nd Edition, 2010. ISBN 978-1-933988-05-4. 101 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report [83] Spring.Net Application Framework, Tutorial, 2010, http://www.springframework.net/ [84] Matthew Cochran. Introduction to Functional Programming in C#. January 13, 2008. http://www.c- sharpcorner.com/ [Online] [85] Joseph Albahari and Ben Albahari. C# 4.0, In a NUTSHELL. O‘Reilly Media, Inc., 4th edition, January 2010. ISBN: 978-0-596-80095-6 [86] Andy Clement, Adrian Colyer, George Harley and Matthew Webster. Using Eclipse AspectJ: Your First Steps. InformIT, Jan 2005. http://www.informit.com/articles/article.aspx?p=357692 [Online] [87] Ron Bodkin. AOP@Work: Performance monitoring with AspectJ, http://www.ibm.com/developerworks/java/library/j-aopwork10/ [Online] IBM, September 2005. [88] Masuhara, H., Tatsuzawa, H., and Yonezawa, A. 2005. Aspectual Caml: an aspect-oriented functional language. In Proceedings of the Tenth ACM SIGPLAN international Conference on Functional Programming (Tallinn, Estonia, September 26 - 28, 2005). ICFP '05. ACM, New York, NY, 320-330 [89] Wang, M. and Oliveira, B. C. 2009. What does aspect-oriented programming mean for functional programmers?. In Proceedings of the 2009 ACM SIGPLAN Workshop on Generic Programming (Edinburgh, Scotland, August 30 30, 2009). WGP '09. ACM, New York, NY, 37-48 [90] Dantas, D. S., Walker, D., Washburn, G., and Weirich, S. 2008. AspectML: A polymorphic aspect-oriented functional programming language. ACM Trans. Program. Lang. Syst. 30, 3 (May. 2008), 1-60. [91] Abhijit Belapurkar. Functional programming in the http://www.ibm.com/developerworks/java/library/j-fp.html [Online] Java language, IBM, July 2004. [92] Augler, D. R. 2003. Functional programming in Java. J. Comput. Small Coll. 18, 6 (Jun. 2003), 112-118. [93] Alex Collins. Functional Programming Concepts in JDK 7, JAVALOBBY, July 31, 2010. http://java.dzone.com/articles/lambdas-closures-jdk7?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+javalobby%2Ffrontpage+%28Javalobb y+%2F+Java+Zone%29 [Online] [94] Russell Miles. AspectJ Cookbook, O'Reilly, December 2004. ISBN: 0-596-00654-3 [95] De Fraine, B., Südholt, M., and Jonckers, V. 2008. StrongAspectJ: flexible and safe pointcut/advice bindings. In Proceedings of the 7th international Conference on Aspect-Oriented Software Development (Brussels, Belgium, March 31 - April 04, 2008). AOSD '08. ACM, New York, NY, 60-71 [96] Gregor Kiczales, Erik Hilsdale, Jim Hugunin, Mik Kersten, Jeffrey Palm and William G. Griswold. An Overview of AspectJ, ECOOP 2001 — Object-Oriented Programming, Lecture Notes in Computer Science, 2001, Volume 2072/2001, 327-354 [97] Narayanan Jayaratchagan, Declarative Programming in Java, O‘REILLY ONJAVA.COM, April 2004. http://onjava.com/pub/a/onjava/2004/04/21/declarative.html [Online] [98] Yang Zhang; Jingjun Zhang; Yuejuan Chen; Qiaoling Wang; , "Resolving Synchronization and Analyzing Based on Aspect-Oriented Programming," Computer Science and Computational Technology, 2008. ISCSCT '08. International Symposium on , vol.1, no., pp.34-37, 20-22 Dec. 2008 [99] Simon Thompson, The Craft of Functional Programming 2nd edition, ISBN-13: 978-0201342758. [100] Introduction – HaskellWiki http://haskell.org/haskellwiki/Introduction#What_is_functional_programming. [101] Parametric polymorphism – HaskellWiki http://haskell.org/haskellwiki/Parametric_polymorphism. [102] Kwon, J., Wellings, A., and King, S. 2003. Assessment of the Java programming language for use in high integrity systems. SIGPLAN Not. 38, 4 (Apr. 2003), 34-46. DOI= http://doi.acm.org/10.1145/844091.844099 [103] Christian Skalka, "Programming Languages and Systems Security," IEEE Security and Privacy, vol. 3, no. 3, pp. 80-83, May/June 2005, doi:10.1109/MSP.2005.77 [104] McCreight, A., Shao, Z., Lin, C., and Li, L. 2007. A general framework for certifying garbage collectors and their mutators. SIGPLAN Not. 42, 6 (Jun. 2007), 468-479. DOI= http://doi.acm.org/10.1145/1273442.1250788 Real World Haskell by Bryan O`Sullivan. [105] Andr´e T. H. Pang, Binding Haskell to Object-Oriented Component Systems via Reflection, http://www.algorithm.com.au/downloads/reflection/reflection.pdf 102 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report [106] Caesar Fernandes, Web Application Development - A Guide to Success, March 13th, 2003, http://articles.sitepoint.com/article/development-guide-success. [107] Prajapati, H.B.; Dabhi, V.K.; , "High Quality Web-Application Development on Java EE Platform," Advance Computing Conference, 2009. IACC 2009. IEEE International , vol., no., pp.1664-1669, 6-7 March 2009, doi: 10.1109/IADCC.2009.4809267, URL: http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=4809267&isnumber=4808969 [108] Java Technologies for Web Applications, Dana Nourie http://java.sun.com/developer/technicalArticles/tools/webapps_1 [109] Thiemann, P. 2005. An embedded domain-specific language for type-safe server-side web scripting. ACM Trans. Internet Technol. 5, 1 (Feb. 2005), 1-46. DOI= http://doi.acm.org/10.1145/1052934.1052935. [110] Pautasso, Cesare and Alonso, Gustavo, Web Service Composition to Megaprogramming Shan, Ming-Chien and Dayal, Umeshwar and Hsu, Meichun, Springer Berlin / Heidelberg, pages 39-53,http://dx.doi.org/10.1007/978-3540-31811-8_4,10.1007/978-3-540-31811-8_4,2005. [111] Bertrand Portier, Invoking Web services with Java clients, 04 Nov 2003, http://www.ibm.com/developerworks/webservices/library/ws-javaclient/index.html [112] Nirosh, Introduction to Object Oriented Programming Concepts (OOP) and More, 30 May 2010 http://www.codeproject.com/KB/architecture/OOP_Concepts_and_manymore.aspx#Generalization [113] Tutorials Point, Java – Abstraction http://www.tutorialspoint.com/java/java_abstraction.htm [114] Invoking Web services with Java clientsA look at Web services clients in the J2SE and J2EE environment, Bertrand Portier, 04 Nov 2003 http://www.ibm.com/developerworks/webservices/library/ws-javaclient/index.html [115] HAIFA : An XML Based Interoperability Solution for Haskell,Simon Foster, www.cs.ioc.ee/tfp-icfp-gpce05/tfp- proc/08num.pdf [116] Java programming dynamics, Part 2: Introducing reflection, Use run-time class information to limber up your programming, Dennis Sosnoski 03 Jun 2003 www.ibm.com/developerworks/library/j-dyn0603/ [117] Tutorials Point, Java Abstraction http://www.tutorialspoint.com/java/java_abstraction.htm [118] Kariotis, P. S., Procter, A. M., and Harrison, W. L. 2008. Making monads first-class with template haskell. In Proceedings of the First ACM SIGPLAN Symposium on Haskell (Victoria, BC, Canada, September 25 - 25, 2008). Haskell '08. ACM, New York, NY, 99-110. DOI= http://doi.acm.org/10.1145/1411286.1411300 [119] Lüth, C. and Ghani, N. 2002. Composing monads using coproducts. SIGPLAN Not. 37, 9 (Sep. 2002), 133-144. DOI= http://doi.acm.org/10.1145/583852.581492 [120] Braux, M. and Noyé, J. 1999. Towards partially evaluating reflection in Java. In Proceedings of the 2000 ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation (Boston, Massachusetts, United States, January 22 - 23, 2000). PEPM '00. ACM, New York, NY, 2-11. DOI= http://doi.acm.org/10.1145/328690.328693 [121] Dawson, D., Desmarais, R., Kienle, H. M., and Müller, H. A. 2008. Monitoring in adaptive systems using reflection. In Proceedings of the 2008 international Workshop on Software Engineering For Adaptive and SelfManaging Systems (Leipzig, Germany, May 12 - 13, 2008). SEAMS '08. ACM, New York, NY, 81-88. DOI= http://doi.acm.org/10.1145/1370018.1370033 [122] Braux, M. and Noyé, J. 1999. Towards partially evaluating reflection in Java. In Proceedings of the 2000 ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation (Boston, Massachusetts, United States, January 22 - 23, 2000). PEPM '00. ACM, New York, NY, 2-11. DOI= http://doi.acm.org/10.1145/328690.328693. [123] Lämmel, R. and Jones, S. P. 2004. Scrap more boilerplate: reflection, zips, and generalised casts. SIGPLAN Not. 39, 9 (Sep. 2004), 244-255. DOI= http://doi.acm.org/10.1145/1016848.1016883 http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.37.998 [124] Teruya, A., Iwata, E., Sugai, M., Kimura, M., Zakaria, N. A., Matsumoto, N., and Yoshida, N. 2008. Embedded system design based on aspect-oriented executable UML. In Proceedings of the 8th Conference on Applied Computer Scince (Venice, Italy, November 21 - 23, 2008). S. C. Misra, R. Revetria, L. M. Sztandera, M. Iliescu, A. Zaharim, and H. Parsiani, Eds. Recent Advances In Computer Engineering. World Scientific and Engineering Academy and Society (WSEAS), Stevens Point, Wisconsin, 247-252. 103 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report [125] Aspect-Oriented Programming in Java Markus Voelter, voelter at acm dot org, http://www.voelter.de/data/articles/aop/aop.html [126] Sulzmann, M. and Wang, M. 2007. Aspect-oriented programming with type classes. In Proceedings of the 6th Workshop on Foundations of Aspect-Oriented Languages (Vancouver, British Columbia, Canada, March 13 - 13, 2007). FOAL '07, vol. 268. ACM, New York, NY, 65-74. DOI= http://doi.acm.org/10.1145/1233833.1233842 [127] Chen, K., Weng, S., Wang, M., Khoo, S., and Chen, C. 2007. A Compilation Model for Aspect-Oriented Polymorphically Typed Functional Languages. In Proceedings of the 14th international Symposium on Static Analysis (Kongens Lyngby, Denmark, August 22 - 24, 2007). H. R. Nielson and G. Filé, Eds. Lecture Notes In Computer Science, vol. 4634. Springer-Verlag, Berlin, Heidelberg, 34-51. DOI= http://dx.doi.org/10.1007/978-3540-74061-2_3 [128] Moor, O. d., Peyton Jones, S. L., and Wyk, E. V. 2000. Aspect-Oriented Compilers. In Proceedings of the First international Symposium on Generative and Component-Based Software Engineering (September 28 - 30, 1999). K. Czarnecki and U. W. Eisenecker, Eds. Lecture Notes In Computer Science, vol. 1799. Springer-Verlag, London, 121-133. [129] Functional programming in the Java languageUse closures and higher order functions to write modular Java code, Abhijit Belapurkar 13 Jul 2004 http://www.ibm.com/developerworks/java/library/j-fp.html. [130] Naugler, D. R. 2003. Functional programming in Java. J. Comput. Small Coll. 18, 6 (Jun. 2003), 112-118. [131] Konrad Hinsen, "The Promises of Functional Programming," Computing in Science and Engineering, vol. 11, no. 4, pp. 86-90, July/Aug. 2009, doi:10.1109/MCSE.2009.129 [132] Chris Wenham,Stockoverflow.com http://stackoverflow.com/questions/129628/what-is-declarative-programming [133] Rossi, G. and Poleo, E. 2004. javaset: declarative programming in Java with sets. In Proceedings of the 1st Conference on Computing Frontiers (Ischia, Italy, April 14 - 16, 2004). CF '04. ACM, New York, NY, 2-11. DOI= http://doi.acm.org/10.1145/977091.977094 [134] Relational Declarative Programming with JBoss Drools,M Proctor, http://www.computer.org/portal/web/csdl/doi/10.1109/SYNASC.2007.87 [135] Luke Hunsberger, CMPU-245: Declarative Programming Models Spring 2010 http://www.cs.vassar.edu/~cs245/ [136] Documentation - JavaTM 2 Platform Standard Ed. 5.0, http://download.oracle.com/javase/1.5.0/docs/api/java/lang/ProcessBuilder.html [137] Shell script,From Wikipedia,the free encyclopedia, http://en.wikipedia.org/wiki/Shell_script [138] Erik Meijer,Sigbjorn Finne, Lamabda, Haskell as a better Java, (http://74.125.155.132/scholar?q=cache:61Ms2C7ovYYJ:scholar.google.com/+haskel+api+for+reflection&hl=en& as_sdt=2000) [139] GHC Commentary: The GHC API- Documentation http://hackage.haskell.org/trac/ghc/wiki/Commentary/Compiler/API [140] User Interface Prototypes http://www.agilemodeling.com/artifacts/uiPrototype.htm [141] Wikipedia: Java (Programming Language) http://en.wikipedia.org/wiki/Java_%28programming_language%29 [142] WxHaskell Documentation- http://www.haskell.org/haskellwiki/WxHaskell [143] The Java Tutorials-http://download.oracle.com/javase/tutorial/index.html [144] Hayoo! Haskell API http://holumbus.fh-wedel.de/hayoo/api.html [145] Java RMI Documentation-http://www.oracle.com/technetwork/java/javase/tech/index-jsp-136424.html [146] Chakravarty, M. M., Keller, G., Jones, S. P., and Marlow, S. 2005. Associated types with class. In Proceedings of the 32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (Long Beach, California, USA, January 12 - 14, 2005). POPL '05. ACM, New York, NY, 1-13. DOI= http://doi.acm.org/10.1145/1040305.1040306 [147] Antonio J. Fernández and Patricia M. Hill, A comparative study of eight constraint programming languages over the Boolean and finite domains,Constraints,Y1 - 2000-07-21,PB - Springer Netherlands,SN - 1383-7133,KW Computer Science,SP - 275,EP - 301,VL - 5,IS - 3,UR -http://dx.doi.org/10.1023/A:1009816801567,DO 10.1023/A:1009816801567 104 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report [148] A. T. H. Pang. Binding Haskell to object-oriented component systems via reflection. Master's thesis, The University of New South Wales, School of Computer Science and Engineering, June 2003. http://www.algorithm.com.au/files/reflection/reflection.pdf. [149] A. T. H. Pang. Binding Haskell to object-oriented component systems via reflection. Master's thesis, The University of New South Wales, School of Computer Science and Engineering, June 2003. http://www.algorithm.com.au/files/reflection/reflection.pdf. [150] Schrage, M. M., van IJzendoorn, A., and van der Gaag, L. C. 2005. Haskell ready to dazzle the real world. In Proceedings of the 2005 ACM SIGPLAN Workshop on Haskell (Tallinn, Estonia, September 30 - 30, 2005). Haskell '05. ACM, New York, NY, 17-26. DOI= http://doi.acm.org/10.1145/1088348.1088351. [151] Konrad Hinsen, "The Promises of Functional Programming," Computing in Science and Engineering, vol. 11, no. 4, pp. 86-90, July/Aug. 2009, doi:10.1109/MCSE.2009.129 [152] A Gentle Introduction to Haskell, Version 98 Type Classes and Overloading http://www.haskell.org/tutorial/classes.html [153] Haskell Tutorial http://www.cs.wallawalla.edu/KU/PR/Haskell.html [154] A Gentle Introduction to Haskell, Version 98 Functions Tutorial-http://www.haskell.org/tutorial/functions.html [155] d'Auriol, B.J.; Sungyoung Lee; Young-Koo Lee; , "A Scientific Rapid Prototyping Model for the Haskell Language," Convergence and Hybrid Information Technology, 2008. ICCIT '08. Third International Conference on, vol.1, no., pp.854-858, 11-13 Nov. 2008 doi: 10.1109/ICCIT.2008.187 [156] Lengstorf, J. 2009 PHP for Absolute Beginners. Apress. [157] The Scala Programming Language: Introducing Scala URL: http://www.scala-lang.org/node/25. [158] Odersky, M., Spoon, L., and Venners, B. 2008 Programming in Scala: a Comprehensive Step-By-Step Guide. 1st. Artima Incorporation. [159] PHP Security Consortium: PHP Security Guide 1.0. [160] Thomas Oertli ,Secure Programming in PHP. 30/01/2002 URL: http://www.cgisecurity.com/lib/php-secure- coding.html. [161] Ilia Alshanetsky, PHP Security presentation, Montreal, Canada [March 29-31, 2006] [162] Chris Shiflett, PHP Security OSCON 2004, 26/07/2004 [163] Scala in the Enterprise URL: http://www.scala-lang.org/node/1658. [164] Getting started with Lift URL: http://www.assembla.com/wiki/show/liftweb/Getting_Started. [165] Official PHP License Information http://www.php.net/license/. [166] W3Schools PHP Introduction http://www.w3schools.com/php/php_intro.asp [167] Lift web framework and Scala programming language talk. SDForum Emerging Technology Nov 2008: Developing the Next Generation of Web Apps on a shoestring by Dan O'Leary and David Pollak. [168] Web service‗s Wikipedia page. URL: http://en.wikipedia.org/wiki/Web_service. [169] Upgrading to PHP 5, Chapter 9, 9.1 SOAP. [170] Trachtenberg, A. 2004 Upgrading to PHP 5. O' Reilly & Associates, Inc. [171] PHP Manual: Reflection Introduction URL: http://php.net/manual/en/intro.reflection.php. [172] Yohann Coppel, Reflecting Scala January 12, 2008. École Polytechnique Fédérale de Lausanne. [173] Fn.php URL: http://hg.apgwoz.com/hgwebdir.cgi/fn-php/summary [174] H. Conrad Cunningham and James C. Church. Multiparadigm Programming in Scala Computer and Information Science, University of Mississippi. [175] Robert Fischer, Scala is Not a Functional Programming Language URL: http://enfranchisedmind.com/blog/posts/scala-not-functional/. 14/05/2009 [176] Rich Hickey‘s presentation introducing Clojure, URL: http://clojure.blip.tv/ [177] Is Scala Not ―Functional Enough‖? URL: http://www.codecommit.com/blog/scala/is-scala-not-functional-enough. 20/10/2008 105 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report [178] Ken Keenan, SCaB: A Simple Cash Book, URL: http://www.kaia.ie/scab.html 07/08/2007 [179] Sean McDirmid, URL: http://lambda-the-ultimate.org/node/2184, 09/04/2007 [180] Jack D. Herrington, Batch processing in PHP: How to create long-running jobs, 05/12/2006 [181] Getting Started with Scala URL: http://www.scala-lang.org/node/166 [182] Scala – an alternative console scripting language URL: http://mackaz.de/26 23/03/2010 [183] Ben Ramsey, PHP in a Whole New World Desktop Applications Built in PHP-GTK, International PHP 2005 Conference, Spring edition [184] PHP Manual: Runtime Configuration. URL: http://php.net/manual/en/filesystem.configuration.php [185] Lavin, P. 2006 Object-Oriented Php: Concepts, Techniques, and Code. No Starch Press. [186] PHP-GTK - Wikipedia, the free encyclopedia: URL: http://en.wikipedia.org/wiki/PHP-GTK [187] Create a Basic Web Service Using PHP, MySQL, XML, and JSON URL: http://davidwalsh.name/web-service- php-mysql-xml-json [188] URL: http://wiki.liftweb.net/index.php/HowTo_do_Web_Services [189] URL: http://www.fluffycat.com/PHP-Design-Patterns/PHP-OO-Abstract-Class-Basics/ [190] Design Patterns Design Patterns by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. [191] The official PHP web site Manual. http://php.net/manual/. [192] Core PHP Programming, 3rd Edition by Leon Atkinson and Zeev Suraski [193] URL: http://php.net/manual/en/reflection.examples.php [194] Wikipedia - Aspect-oriented programming, http://en.wikipedia.org/wiki/Aspect-oriented_programming [195] Matthias Urban and Olaf Spinczyk, AspectC++ Language Reference, Version 1.6, March 15, 2006, http://www.aspectc.org/fileadmin/documentation/ac-languageref.pdf [196] Danne Lundqvist - Aspect Oriented Programming and Javascript, http://www.dotvoid.com/2005/06/aspect- oriented-programming-and-javascript/ [197] Douglas Crockford's Javascript lectures, http://javascript.crockford.com/ [198] EUROSEC GmbH Chiffriertechnik & Sicherheit, ―Secure Programming in C/C++‖ White papers, http://www.secologic.org/downloads/c/051207_EUROSEC_Draft_Whitepaper_Secure_C_Programming.doc [199] Hubpages, Javascript vs C++, http://hubpages.com/hub/Javascript-vs-C. [200] Oracle SDN, Secure Coding Guidelines for the Java Programming Language, Version 3.0 http://java.sun.com/security/seccodeguide.html [201] Joshua Bloch, "Effective Java Programming Language Guide", chapter 9 Threats, Publisher: Addison Wesley First Edition June 01, 2001 ISBN: 0-201-31005-8, 272 pages, http://www.sixwhits.com/documentation/SuggsDocs/Java/Effective%20Java%20%20Programming%20Language%20Guide.pdf [202] CppCMS — C++ Web Development Framework, http://cppcms.sourceforge.net/wikipp/en/page/main [203] Micronovae, C++ Server Pages, http://www.micronovae.com/ref/Syntax.html [204] Robert W. Sebesta, "Concept of Programming Languages", 8ed, Pearson Addison Wesley publisher, 2007. [205] w3schools - JavaScript Objects Introduction http://www.w3schools.com/js/js_obj_intro.asp [206] Introduction to Polymorphism in C++ http://www.cs.bu.edu/teaching/cpp/polymorphism/intro/ [207] The Four Polymorphisms in C++ http://www.catonmat.net/blog/cpp-polymorphism [208] Wikipedia – Web application http://en.wikipedia.org/wiki/Web_application [209] Harvey M. Deitel and Paul J. Deitel, "C++ how to program", 4th edition. [210] Koen Deforche , " Wt: a Tool for Building the New Web ", White paper, August 2009 http://www.webtoolkit.eu/doc/Wt-WhitePaper.pdf 106 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report [211] Koen Deforche and Wim Dumon , "A gentle introduction to the Wt C++ Toolkit for Web Applications", January, 2006, http://www.webtoolkit.eu/wt/doc/tutorial/wt-sdj.pdf . [212] Karthik Subbian and Ramakrishnan Kannan, Enable C++ applications for Web service using XML-RPC, http://www.ibm.com/developerworks/webservices/library/ws-xml-rpc/ [213] Andrew Borley et al, " SCA Service Component Architecture Client and Implementation Model Specification for C++", SCA Version 1.00, March 21 2007, http://osoa.org/download/attachments/35/SCA_ClientAndImplementationModel_Cpp-V100.pdf [214] The Code Project - Remote scripting - Calling a WebService with JavaScript and C#, Remote scripting - Calling a WebService with JavaScript and C# http://www.codeproject.com/KB/XML/marcelo888RemoteScript01.aspx [215] Reflection in C++, http://www.garret.ru/cppreflection/docs/reflect.html [216] Reflection (computer science), http://en.wikipedia.org/wiki/Reflection_%28computer_science%29 [217] Devadithya. T. et al, C++ Reflection for High Performance Problem Solving Environments. In Proceedings of High Performance Computing Symposium (HPC 2007). Norfolk, Virginia, March 25-29, 2007, http://grid.cs.binghamton.edu/projects/publications/c++-HPC07/c++-HPC07.pdf [218] XCppRefl - C++ Reflection Library, http://www.extreme.indiana.edu/reflcpp/ [219] JAVASCRIPT TOOLS GUIDE, http://www.adobe.com/products/incopy/scripting/pdfs/JavaScript_Tools_Guide_CS4.pdf [220] Wikipedia - Functional programming, http://en.wikipedia.org/wiki/Functional_programming. [221] Stamey, J., Saunders, B., and Blanchard, S. 2005. The aspect-oriented web. In Proceedings of the 23rd Annual international Conference on Design of Communication: Documenting &Amp; Designing For Pervasive information (Coventry, United Kingdom, September 21 - 23, 2005). SIGDOC '05. ACM, New York, NY, 89-95. DOI= http://0doi.acm.org.mercury.concordia.ca/10.1145/1085313.1085336 [222] Kienle, H.M., It's About Time to Take JavaScript (More) Seriously Software, IEEE Volume: 27 , Issue: 3 Digital Object Identifier: 10.1109/MS.2010.76 Publication Year: 2010 , Page(s): 60 – 62. [223] Functional JavaScript, http://osteele.com/sources/javascript/functional/ [224] YUI Theater — Douglas Crockford: ―Crockford on JavaScript — Act III: Function the Ultimate (73 min.)‖, http://www.yuiblog.com/blog/2010/02/24/video-crockonjs-3/ [225] JavaScript Functions, http://www.comptechdoc.org/independent/web/cgi/javamanual/javafunctions.html [226] Declarative programming, http://en.wikipedia.org/wiki/Declarative_programming. [227] Hanus, M. 2007. Putting declarative programming into the web: translating curry to javascript. In Proceedings of the 9th ACM SIGPLAN international Conference on Principles and Practice of Declarative Programming (Wroclaw, Poland, July 14 - 16, 2007). PPDP '07. ACM, New York, NY, 155-166. DOI= http://doi.acm.org/10.1145/1273920.1273942. [228] Peter Grogono, Principles of Programming Languages Notes, http://users.encs.concordia.ca/~grogono/CourseNotes/COMP-348-Notes.pdf [229] JavaFX Example Code and Project Gallery | Try Java FX, http://javafx.com/samples/index.html [230] Wikipedia - JavaFX, http://en.wikipedia.org/wiki/JavaFX [231] JavaFX Script, http://java.about.com/od/d/g/declarativelang.htm [232] Dmitry Bondarenko and Alla Redko, Building GUI Applications With JavaFX, "Lesson 2: Using Declarative Syntax", http://download.oracle.com/javafx/1.3/tutorials/ui/syntax/index.html [233] Pro C, http://infolab.stanford.edu/~ullman/fcdb/oracle/or-proc.html [234] Batch scripting, http://www.allenware.com/icsw/icswidx.htm [235] Creating a batch script, http://www.computing.net/answers/dos/creating-a-batch-script/163.html. [236] Batch Scripts for Windows, http://www.wilsonmar.com/1wsh.htm [237] User Interface Prototypes, http://www.agilemodeling.com/artifacts/uiPrototype.htm 107 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report [238] C++ Computer Terms, http://xoax.net/comp/cpp/reference/terms.php [239] The art of UI prototyping, http://www.scottberkun.com/essays/12-the-art-of-ui-prototyping/ [240] Prototype UI, http://wiki.forum.nokia.com/index.php/Use_prototype_javascript_library_:_Prototype_UI_in_WRT_application [241] Prototype Windows, http://prototype-window.xilinus.com/. [242] EBJS, http://wiki.developers.facebook.com/index.php/FBJS. [243] JAX-WS, http://www.omii.ac.uk/wiki/JaxWsTutorial [244] Easily consume SOAP Web services with JavaScript, http://articles.techrepublic.com.com/5100-10878_11- 5887775.html [245] Introduction to Object-Oriented JavaScript, https://developer.mozilla.org/en/Introduction_to_Object- Oriented_JavaScript [246] JavaScript Guide, https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide [247] Resig, John, Modern JavaScript Programming, Pro JavaScript™ Techniques, 2007, SN - 978-1-4302-0283-7, Computer Science, http://dx.doi.org/10.1007/978-1-4302-0283-7_1. [248] Moroney, Laurence, JavaScript Programming with ASP.NET AJAX, Beginning Web Development, Silverlight, and ASP.NET AJAX, 2008, http://dx.doi.org/10.1007/978-1-4302-0582-1_14 [249] Friesen, Jeff, Scripting, Beginning Java™ SE 6 Platform, 2007, SN - 978-1-4302-0246-2, http://dx.doi.org/10.1007/978-1-4302-0246-2_9. [250] Sun Microsystems, Inc., JSR-223 Scripting for the Java™ Platform Final Draft Specification version 1.0, Release: July 31, 2006, http://cds-esd.sun.com/ESD29/JSCDL/java_scripting/1.0-fr/java_scripting-1_0-frspec.pdf?AuthParam=1281575312_cf28c14817eaee88fe4bc4e63341a751&TicketId=B%2Fw5kB2GSF9IQBFGOF 9YlQHh&GroupName=CDS&FilePath=/ESD29/JSCDL/java_scripting/1.0-fr/java_scripting-1_0-frspec.pdf&File=java_scripting-1_0-fr-spec.pdf [251] Dupont and Andrew, What You Should Know About Prototype, JavaScript, and the DOM, Practical Prototype and script.aculo.us, Apress, isbn = 978-1-4302-0502-9, pp 3-16, url = http://dx.doi.org/10.1007/978-1-4302-0502-9_1, 2008. [252] Vohra, Deepak, Less JavaScript with Prototype, booktitle ―Ajax in Oracle JDeveloper‖, Springer Berlin Heidelberg, isbn 978-3-540-77596-6, pp. 45-60, url = http://dx.doi.org/10.1007/978-3-540-77596-6_3, 2008. [253] C++ script, http://calumgrant.net/cppscript/docs/introduction.html. [254] McNamara, B. and Smaragdakis, Y. 2000. Functional programming in C++. In Proceedings of the Fifth ACM SIGPLAN international Conference on Functional Programming ICFP '00. ACM, New York, NY, 118-129. DOI= http://0-doi.acm.org.mercury.concordia.ca/10.1145/351240.351251 [255] C++ Reference. Execute system command. [Online; accessed 19-August-2010] http://www.cplusplus.com/reference/clibrary/cstdlib/system/. [256] The forger‘s win32 api programming tutorial. [Online; accessed 19-August-2010]. http://www.winprog.org/tutorial/. [257] Micah Carrick. GTK+ and Glade3 GUI Programming Tutorial - Part 1, December 24, 2007. [Online; accessed 19- August-2010]. http://www.micahcarrick.com/gtk-glade-tutorial-part-1.html. [258] Oliver Steele. Functional JavaScript, 2007. [Online; accessed 19-August-2010]. http://osteele.com/sources/javascript/functional/ [259] Using cmd.exe from JavaScript, January 18, 2007. [Online; accessed 19-August-2010]. http://www.mooienaam.nl/weblog/0C4A7D00-4DCA-4B7A-B874-D291DDAA329A.html. [260] Meg Hourihan. Using JavaScript to Create a Powerful GUI, December 21, 2001. [Online; accessed 19-August- 2010]. http://oreilly.com/pub/a/javascript/2001/12/21/js_toolbar.html. 108 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report Appendix A A.1 Installing Racket The Scheme dialect used in this paper for testing is Racket, formally known as PLT Scheme. It can be downloaded from (http://racket-lang.org/). Racket can be run from command line Racket or from the graphical environment DrRacket. The programs related to writing web applications need to be saved in the same directory where Racket is installed (http://docs.racket-lang.org/more/). To test the installation, create a small program in a text editor or DrRacket like the following: Save the program as ―first-one.rkt‖ and run from command prompt using commands: (enter! ―first-one.rkt‖) and after loading the files enter command (test-it). See output below: A.2 Web Server in Scheme The following is the implementation of a server in Scheme ran on Racket. It is taken in whole from [34] and commented. Also, it has been slightly modified to produce the sum of the number entered. 109 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report Figure 6: Startup server and accept port no from user A.2.1 Running the Scheme Server To start the server first open the Racket command prompt and then enter (enter! pgmName.rkt). On the new prompt enter (define stop(serve 8081)) after which the server will be running. Open a browser window and enter: http://localhost:8081/many. A web page ready to accept a number will be displayed. Enter a number and press the submit button. A response page will be displayed with as many ―Hello‖(s) as the number entered. Code fragment 1 on Figure 6: (define (serve port-no) function listens for client requests and invokes (accept-and-handle listener) function in its own thread to process the request. 110 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report Figure 7: (accept-and-handle listener) function definition The function invokes (handle (in out)…) function and passes the input and output streams (Figure 8). The function invokes the (define (dispatch str-path) function with the path as a string (Figure 9). Figure 8: (handle (in out)…) function definition 111 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report Figure 9: (dispatch str-path) function definition Dispatch table is declared as shown on Figure 9 to map the string path of the request/response to a function request/response handler. It is implemented with a hash data structure. If a handler is not found an error response is generated to the client otherwise the appropriate handler function is retrieved from dispatch table and invoked. 112 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report Figure 10: (define (many query)...); (define (reply query)...); (build-request-page label next-url hidden) function definitions The (define (many query)...) is invoked to handle the request by calling a helper function (build-requestpage label next-url hidden) (Figure 10) to build the request form and sends the form to another url-path: ―/reply‖. The user responds and the ―/reply‖ handler is retrieved from the dispatch table and invoked. It builds an html page with hello(s) corresponding to the number received. There is an alternative response that has been commented but (at the bottom of the code snippet) which adds the number to itself and displays the sum on the browser with an appropriate message. To run this code no other changes to the rest of the program need to be done. It was not part of the original code. 113 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report Figure 11: Building the dispatch-table The dispatch table is built using the Scheme‘s imperative hash-set! special form. The key is the url-path and the value is the function that handles the request/response. Figure 12: Request form displayed on browser window Figure 13: Response produced by the server The request form is displayed on Figure 12 and the response on Figure 13. A.3 Web Server in BPEL A similar behavior can be achieved using BPEL as the language. Sine, the primary goal of BPEL is to support automated interactions between web services communicating using SOAP or another transport protocol over HTTP, with XML as the wire protocol (or data exchange protocol) through well-defined standard interfaces, the basic structure of the basic invocation differs from the one of Scheme. For example, the input and output is represented using XML document which conforms to the XML grammar rules and the structure of the data is defined in XSD Schema which validates the data. In Scheme the data was passed to the server in the request sent from the browser. To invoke the correct functionality Scheme uses dispatch-table. BPEL requests are wired directly to the control statements that handle the request. BPEL can be seen as single function with possibly many nested scopes, event and message handlers, exception handlers, correlations grouped together. Part of the computation is performed within BPEL module and part of it is delegated to other web services by invoking their interfaces. The base structure of the functionality that implements this simple web application has been obtained from the existing SynchronousSample which comes with NetBeans 6.5. An online tutorial of how to obtain and use it can be found online(http://netbeans.org/kb/61/soa/synchsample.html). The 114 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report SynchronousSample.wsdl document that describes the interface of BPEL and SynchronousSample.xsd defining the structure of the input and output messages (the data) remain unmodified. The data consists of a single xsd.string type input and output fields, wrapped in messages described in WSDL. The SynchronousSample.bpel was entirely modified to implement the functionality. The application is implemented using primarily the Design view which automatically generates equivalent BPEL code from the visual model and the Design view Palette to obtain the programming constructs that BPEL supports. The application consists of nested sequence, while and another sequence scopes. The first assignment within the outer sequence scope is used to initialize the output. The predicate expression of the while scope compares the input to zero. If it is not zero, control enters the while scope. Within the true path of the while scope there is a nested sequence within which there are two assignments. One is used to decrement the input used later in the predicate of while. The other is concatenating a string ―Hello‖ to the output. The output is wrapped in an XML document. Test cases can be generated using the integrated JUnit included in the NetBeans IDE. The input and output for one test case and the generated source code can be seen in Figure 15, Figure 16, and Figure 17, respectively. Figure 14: Graphical representation of server application implemented using BPEL 115 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report Figure 15: Sample input represented in XML Figure 16: Sample output represented in XML 116 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report Figure 17: Code fragment implementing the functionality, generate by BPEL engine A.4 Factorial Function Implemented in BPEL The generated source code, test input and the corresponding output are shown on Figure 18, Figure 19, and Figure 20. 117 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report Figure 18: Generated source code of factorial function Figure 19: Input test of factorial function implemented in BPEL 118 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report Figure 20: Output from testing factorial function implemented in BPEL with input of 5 A.5 PHP – Creating web service Here is how to create a basic web service that provides an XML or JSON response using some PHP and MySQL. Author: David Walsh [187]. The PHP / MySQL /* require the user as the parameter */ if(isset($_GET['user']) && intval($_GET['user'])) { /* soak in the passed variable or set our own */ $number_of_posts = isset($_GET['num']) ? intval($_GET['num']) : 10; //10 is the default $format = strtolower($_GET['format']) == 'json' ? 'json' : 'xml'; //xml is the default $user_id = intval($_GET['user']); //no default /* connect to the db */ $link = mysql_connect('localhost','username','password') or die('Cannot connect to the DB'); mysql_select_db('db_name',$link) or die('Cannot select the DB'); /* grab the posts from the db */ $query = "SELECT post_title, guid FROM wp_posts WHERE post_author = $user_id AND post_status = 'publish' ORDER BY ID DESC LIMIT $number_of_posts"; $result = mysql_query($query,$link) or die('Errant query: '.$query); /* create one master array of the records */ $posts = array(); if(mysql_num_rows($result)) { while($post = mysql_fetch_assoc($result)) { $posts[] = array('post'=>$post);}} /* output in necessary format */ if($format == 'json') { header('Content-type: application/json'); echo json_encode(array('posts'=>$posts)); } else { 119 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report header('Content-type: text/xml'); echo '<posts>'; foreach($posts as $index => $post) { if(is_array($post)) { foreach($post as $key => $value) { echo '<',$key,'>'; if(is_array($value)) { foreach($value as $tag => $val) { echo '<',$tag,'>',htmlentities($val),'</',$tag,'>';}} echo '</',$key,'>';}}} echo '</posts>'; } @mysql_close($link); } /* disconnect from the db */ Take the following sample URL for example http://mydomain.com/web-service.php?user=2&num=10 The XML Output <posts><post> <post_title>SSLmatic SSL Certificate Giveaway Winners</post_title> <guid>http://davidwalsh.name/?p=2304</guid> </post> <post> <post_title>MooTools FileManager</post_title> <guid>http://davidwalsh.name/?p=2288</guid> </post> <post> <post_title>PHPTVDB: Using PHP to Retrieve TV Show Information</post_title> <guid>http://davidwalsh.name/?p=2266</guid> </post> <post> <post_title>David Walsh: The Lost MooTools Plugins</post_title> <guid>http://davidwalsh.name/?p=2258</guid> </post> <post> <post_title>Create Short URLs Using U.Nu</post_title> <guid>http://davidwalsh.name/?p=2218</guid> </post> <post> <post_title>Create Bit.ly Short URLs Using PHP</post_title> <guid>http://davidwalsh.name/?p=2194</guid> </post> <post> <post_title>Represent Your Repositories Using the GitHub Badge!</post_title> <guid>http://davidwalsh.name/?p=2178</guid> </post> <post> <post_title>ZebraTable</post_title> <guid>http://davidwalsh.name/?page_id=2172</guid> 120 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report </post> <post> <post_title>MooTools Zebra Table Plugin</post_title> <guid>http://davidwalsh.name/?p=2168</guid> </post> <post> <post_title>SSLmatic: Quality, Cheap SSL Certificates and Giveaway!</post_title> <guid>http://davidwalsh.name/?p=2158</guid> </post></posts> The JSON Output {"posts":[{"post":{"post_title":"SSLmatic SSL Certificate Giveaway Winners","guid":"http:\/\/davidwalsh.name\/?p=2304"}},{"post":{"post_title":"MooTools FileManager","guid":"http:\/\/davidwalsh.name\/?p=2288"}},{"post":{"post_title":"PHPTVDB: Using PHP to Retrieve TV Show Information","guid":"http:\/\/davidwalsh.name\/?p=2266"}},{"post":{"post_title":"David Walsh: The Lost MooTools Plugins","guid":"http:\/\/davidwalsh.name\/?p=2258"}},{"post":{"post_title":"Create Short URLs Using U.Nu","guid":"http:\/\/davidwalsh.name\/?p=2218"}},{"post":{"post_title":"Create Bit.ly Short URLs Using PHP","guid":"http:\/\/davidwalsh.name\/?p=2194"}},{"post":{"post_title":"Represent Your Repositories Using the GitHub Badge!","guid":"http:\/\/davidwalsh.name\/?p=2178"}},{"post":{"post_title":"ZebraTable","guid":"http:\ /\/davidwalsh.name\/?page_id=2172"}},{"post":{"post_title":"MooTools Zebra Table Plugin","guid":"http:\/\/davidwalsh.name\/?p=2168"}},{"post":{"post_title":"SSLmatic: Quality, Cheap SSL Certificates and Giveaway!","guid":"http:\/\/davidwalsh.name\/?p=2158"}}]} A.6 Scala - Building Web Services in Lift Here is how to build Web Services in Lift. Author: Steve Jenson [188]. Start with a simple class package com.hellolift.api import net.liftweb.http._ import com.hellolift.model._ import scala.xml._ class BlogAPI(val request: RequestState) extends SimpleController { def index: ResponseIt = { // To be filled in. } def get(id: String): ResponseIt = { // To be filled in. } 121 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report def create: ResponseIt = { // To be filled in. } def delete(id: String): ResponseIt = { // To be filled in. } } GET an existing Item: GET /api/$itemid/ Route a request to the proper method via pattern matching def index: ResponseIt { request match { case RequestState(ParsePath("api" :: itemid :: Nil, _, _), GetRequest, _, _) => get(itemid) }} def get(id: String): ResponseIt = { val it = Item.find(By(Item.id, Helpers.toLong(id)), By(Item.author, user) it match { case Full(item) => AtomResponse(item.toAtom()) case Empty => NotFoundResponse() }} Outputting XML: scala.xml makes it really easy to output valid XML. The following is in our Item model object. def toAtom = { val id = "http://example.com/api/" + this.id val formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'") val updated = formatter.format(this.lastedited.is) <entry xmlns="http://www.w3.org/2005/Atom"> <id>{id}</id> <updated>{updated}</updated> <author> <name>{name}</name> </author> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> {body} </div> </content> </entry> } 122 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report A.7 PHP Abstract Class Basics The following is an example of creating a simple abstract class ―OOPHPAbstractClass‖, and ―OOPHPClassToExtendAnAbstract‖ which extends it. To successfully extend OOPHPAbstractClass, OOPHPClassToExtendAnAbstract must have getName() and setName functions(). [189] [190] [191] [192] OOPHPClassToExtendAnAbstract.php //copyright Lawrence Truett and FluffyCat.com 2007, all rights reserved //this class "extends" OOPHPAbstractClass include_once('OOPHPAbstractClass.php'); class OOPHPClassToExtendAnAbstract extends OOPHPAbstractClass { private $instanceName; //OOPHPAbstractClass has the abstract function getName, // so we must implement it here. public function getName() { return $this->instanceName; } //OOPHPAbstractClass has the abstract function setName, // so we must implement it here. public function setName($nameIn) { $this->instanceName = $nameIn; } } OOPHPAbstractClass.php //copyright Lawrence Truett and FluffyCat.com 2007, all rights reserved //OOPHPAbstractClass - a simple OO PHP Abstract Class // this defines two functions, getName() and setName($nameIn) // which any class extending this must have abstract class OOPHPAbstractClass { abstract public function getName(); abstract public function setName($nameIn); } 123 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report testOOPHPAbstract.php //copyright Lawrence Truett and FluffyCat.com 2007, all rights reserved include_once('OOPHPClassToExtendAnAbstract.php'); define('BR', '<'.'BR'.'>'); echo 'BEGIN TESTING PHP ABSTRACT CLASSES'.BR; echo BR; echo 'test 1 - create a class which extends an abstract'.BR; $classOne = new OOPHPClassToExtendAnAbstract(); echo BR; $classOne->setName("Harold"); echo $classOne->getName(); echo BR.BR; echo 'END TESTING PHP ABSTRACT CLASSES'.BR; Output of testOOPHPAbstract.php BEGIN TESTING PHP ABSTRACT CLASSES test 1 - create a class which extends an abstract Harold END TESTING PHP ABSTRACT CLASSES A.8 PHP - Reflection Reflection Example from Shell (a Terminal) [193] $ php --rf strlen $ php --rc finfo $ php --re json $ php --ri dom The above example will output something similar to: Function [ <internal:Core> function strlen ] { - Parameters [1] { 124 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report Parameter #0 [ <required> $str ] } } Class [ <internal:fileinfo> class finfo ] { - Constants [0] { } - Static properties [0] { } - Static methods [0] { } - Properties [0] { } - Methods [4] { Method [ <internal:fileinfo, ctor> public method finfo ] { - Parameters [2] { Parameter #0 [ <optional> $options ] Parameter #1 [ <optional> $arg ] } } Method [ <internal:fileinfo> public method set_flags ] { - Parameters [1] { Parameter #0 [ <required> $options ] } } Method [ <internal:fileinfo> public method file ] { - Parameters [3] { Parameter #0 [ <required> $filename ] Parameter #1 [ <optional> $options ] Parameter #2 [ <optional> $context ] } } Method [ <internal:fileinfo> public method buffer ] { - Parameters [3] { Parameter #0 [ <required> $string ] Parameter #1 [ <optional> $options ] Parameter #2 [ <optional> $context ] } } }} Extension [ <persistent> extension #23 json version 1.2.1 ] { - Constants [10] { 125 Comparative Studies of 10 Programming Languages within 10 Diverse Criteria -- a Team 10 COMP6411-S10 Term Report Constant [ integer JSON_HEX_TAG ] { 1 } Constant [ integer JSON_HEX_AMP ] { 2 } Constant [ integer JSON_HEX_APOS ] { 4 } Constant [ integer JSON_HEX_QUOT ] { 8 } Constant [ integer JSON_FORCE_OBJECT ] { 16 } Constant [ integer JSON_ERROR_NONE ] { 0 } Constant [ integer JSON_ERROR_DEPTH ] { 1 } Constant [ integer JSON_ERROR_STATE_MISMATCH ] { 2 } Constant [ integer JSON_ERROR_CTRL_CHAR ] { 3 } Constant [ integer JSON_ERROR_SYNTAX ] { 4 } } - Functions { Function [ <internal:json> function json_encode ] { - Parameters [2] { Parameter #0 [ <required> $value ] Parameter #1 [ <optional> $options ] } } Function [ <internal:json> function json_decode ] { - Parameters [3] { Parameter #0 [ <required> $json ] Parameter #1 [ <optional> $assoc ] Parameter #2 [ <optional> $depth ] } } Function [ <internal:json> function json_last_error ] { - Parameters [0] { } } }} dom DOM/XML => enabled DOM/XML API Version => 20031129 libxml Version => 2.7.3 HTML Support => enabled XPath Support => enabled XPointer Support => enabled Schema Support => enabled RelaxNG Support => enabled 126
6cs.PL
arXiv:1208.4458v1 [math.AC] 22 Aug 2012 BASS NUMBERS OVER LOCAL RINGS VIA STABLE COHOMOLOGY LUCHEZAR L. AVRAMOV AND SRIKANTH B. IYENGAR Abstract. For any non-zero finite module M of finite projective dimension over a noetherian local ring R with maximal ideal m and residue field k, it is proved that the natural map ExtR (k, M ) → ExtR (k, M/mM ) is non-zero when R is regular and is zero otherwise. A noteworthy aspect of the proof is the use of stable cohomology. Applications include computations of Bass series over certain local rings. Introduction Let (R, m, k) denote a commutative noetherian local ring with maximal ideal m and residue field k; when R is not regular we say that it is singular. This article revolves around the following result: Theorem. If (R, m, k) is a singular local ring and M an R-module of finite projective dimension, then ExtR (k, π M ) = 0 for the canonical map π M : M → M/mM . Special cases, known for a long time, are surveyed at the end of Section 2. Even in those cases our proof is new. It utilizes a result of Martsinkovsky [11] through properties of Vogel’s stable cohomology functors [6, 3] recalled in Section 1. It also suggests extensions to DG modules over certain commutative DG algebras; see [2]. Applications of the theorem include new criteria for regularity of local rings (in Section 2) and explicit computations of Bass numbers of modules (in Section 3). 1. Stable cohomology In this section we recall the construction of stable cohomology and basic results required in the sequel. The approach we adopt is based on a construction by Vogel, and described in Goichot [6]; see also [3]. Let R be an associative ring and let Rc denote its center. Given left R-modules L and M , choose projective resolutions P and Q of L and M , respectively. Recall that a homomorphism P → Q of degree n is a family β = (βi )i∈Z of R-linear maps βi : Pi → Qi+n ; that is, an element of the Rc -module Y HomR (P, Q)n = HomR (Pi , Qi+n ) . i∈Z This module is the n-th component of a complex HomR (P, Q), with differential Q ∂n (β) = ∂i+n βi − (−1)n βi−1 ∂nP . Date: Version from 21st August 2012. 1991 Mathematics Subject Classification. 13D07 (primary); 13D02, 13D40 (secondary). Key words and phrases. Bass numbers, stable cohomology, fiber products. Research partly supported by NSF grants DMS-1103176 (LLA) and DMS-1201889 (SBI). 1 2 L. L. AVRAMOV AND S. B. IYENGAR The maps β : P → Q with βi = 0 for i ≫ 0 form a subcomplex with component a HomR (P, Q)n = HomR (Pi , Qi+n ) for n ∈ Z . i∈Z [ R (P, Q) for the quotient complex. It is independent of the choices We write Hom of P and Q up to R-linear homotopy, and so is the exact sequence of complexes θ [ R (P, Q) −→ 0 . 0 −→ HomR (P, Q) −→ HomR (P, Q) −−→ Hom (1.0.1) d (L, M ) with The stable cohomology of the pair (L, M ) is the graded Rc -module Ext R d n (L, M ) = Hn (Hom [ R (P, Q)) Ext R for each n ∈ Z . It comes equipped with functorial homomorphisms of graded Rc -modules η n (L,M) d n (L, M ) for all n ∈ Z . ExtnR (L, M ) −−−−−−→ Ext R (1.0.2) d nR (L, M ) = 0 for all n ∈ Z. 1.1. If pdR L or pdR M is finite, then Ext Indeed, in this case we may choose P or Q to be a bounded complex. The [ R (P, Q) = 0. definitions then yield HomR (P, Q) = HomR (P, Q), and hence Hom 1.2. For `a family {Mj }j∈J of R-modules and every integer n the canonical inclusions Mj → j∈J Mj induce, by functoriality, a commutative diagram of Rc -modules ExtnR (L, (1.2.1) ` Mj ) O j∈J ` n j∈J ExtR (L, Mj ) η n (L, ` ` η n (L,Mj ) j∈J j∈J / Ext d nR (L, ` Mj ) O j∈J Mj ) / ` j∈J d nR (L, Mj ) Ext Proposition 1.3. Suppose L admits a resolution by finite projective R-modules. For every `integer n the vertical maps in (1.2.1) are bijective. In particular, the map η n (L, j∈J Mj ) is injective or surjective for some n if and only if η n (L, Mj ) has the corresponding property for every j ∈ J. Proof. Let P be a resolution of L`by finite projective R-modules and Q`j a projective resolution of Mj . The complex j∈J Qj is a projective resolution of j∈J Mj , and we have a commutative diagram of morphisms of complexes of Rc -modules ` ` ` [ R (P, Qj ) / 0 0 / HomR (P, j∈J Qj ) / HomR (P, j∈J Qj ) / Hom O O j∈J O κ κ 0 /` j∈J HomR (P, Qj ) /` j∈J HomR (P, Qj ) κ b /` j∈J [ R (P, Qj ) Hom with natural vertical maps. The map Hn (κ) is bijective, as it represents a a ExtnR (L, Mj ) → ExtnR (L, Mj ) , j∈J /0 j∈J κ ) is which is bijective due to the hypothesis on L. As κ is evidently bijective, Hn (b an isomorphism. The right-hand square of the diagram above induces (1.2.1).  BASS NUMBER OVER LOCAL RINGS 3 2. Local rings The next theorem is the main result of the paper. It concerns the maps ExtnR (k, β) : ExtnR (k, M ) → ExtnR (k, V ) induced by some homomorphism β : M → V , and is derived from a result of Martsinkovsky [11] by using properties of stable cohomology, recalled above. Theorem 2.1. Let (R, m, k) be a local ring and V an R-module such that mV = 0. If R is singular and β : M → V is an R-linear map that factors through some module of finite projective dimension, then ExtnR (k, β) = 0 n ∈ Z. for all γ δ Proof. By hypothesis, β factors as M − → N − → V with N of finite projective dimension. The following diagram Extn R (k,β) η n (k,V ) / ExtnR (k, V ) ExtnR (k, M ) O PPP PPP PPP Extn R (k,δ) PPP Extn R (k,γ) P( η n (k,N ) ExtnR (k, N ) d nR (k, V ) / Ext O d n (k,δ) Ext R d nR (k, N ) / Ext 0 commutes due to the naturality of the maps involved; the equality comes from 1.1. The map η n (k, k) is injective by [11, Theorem 6]. Proposition 1.3 shows that n η (k, V ) is injective as well, so the diagram yields ExtnR (k, β) = 0.  Note that no finiteness condition on M is imposed in the theorem. This remark is used in the proof of the following corollary, which deals with the maps R R TorR n (k, α) : Torn (k, V ) → Torn (k, M ) induced by some homomorphism α : V → M . Corollary 2.2. If R is singular and α : V → M is an R-linear map that factors through some module of finite injective dimension, then TorR n (k, α) = 0 for all n ∈ Z. ∨ Proof. Set (−) = HomR (−, E), where E is an injective envelope of the R-module k. Let V → L → M be a factorization of α with L of finite injective dimension. By Ishikawa [7, 1.5] the module L∨ has finite flat dimension, so it has finite projective dimension by Jensen [9, 5.8]. As m(V ∨ ) = 0 and α∨ factors through L∨ , Theorem ∨ 2.1 gives ExtnR (k, α∨ ) = 0. The natural isomorphism ExtnR (k, −∨ ) ∼ = TorR n (k, −) R R ∨ now yields Torn (k, α) = 0, whence we get Torn (k, α) = 0, as desired.  Next we record an elementary observation, where (−)∗ = HomR (−, R). Lemma 2.3. Let (R, m, k) be a local ring and χ : X → Y an R-linear map. If Coker(χ) has a non-zero free direct summand, then Ker(χ∗ ) * mY ∗ holds. When Y is free of finite rank the converse assertion holds as well. Proof. The condition on Coker(χ) holds if and only if there is an epimorphism Coker(χ) → R; that is, an R-linear map υ : Y → R with υχ = 0 and υ(Y ) * m. When such a υ exists it is in Ker(χ∗ ), but not in mY ∗ , for otherwise υ(Y ) ⊆ m. When Y is finite free and Ker(χ∗ ) * mY ∗ holds, pick υ in Ker(χ∗ ) r mY ∗ . Since ∗ Y is finite free, υ can be extended to a basis of Y ∗ , hence υ(Y ) = R.  4 L. L. AVRAMOV AND S. B. IYENGAR The theorem in the introduction is the crucial implication in the next result: Theorem 2.4. Let (R, m, k) be a local ring. For each R-module M , let εnM = ExtnR (k, π M ) : ExtnR (k, M ) → ExtnR (k, M/mM ) be the map of R-modules induced by the natural map π M : M → M/mM . The following conditions are equivalent. (i) R is regular. (ii) εnR 6= 0 for some integer n. (iii) εnM 6= 0 for some R-module M with pdR M < ∞ and some integer n. (iv) εdM 6= 0 for every finite R-module M 6= 0 and for d = dim R. (v) Coker(∂nF ), where F is a minimal free resolution of k over R, has a non-zero free direct summand for some integer n. ∼ G ⊗R M and Proof. Set G = HomR (F, R) with F as in (v). From HomR (F, M ) = ∂(G ⊗ M ) ⊆ m(G ⊗ M ) (by the minimality of F ) we get a commutative diagram ExtnR (k, M ) O εn M / Extn (k, M/mM ) R O ∼ = H−n (G ⊗R M ) ∼ = H−n (G⊗R π M ) / H−n (G ⊗R (M/mM )) G−n ⊗ (M/mM ) (i) =⇒ (iv). As R is regular we can take F to be the Koszul complex on a minimal generating set of m. This gives Gd = R, an isomorphism H−d (G ⊗R π M ), and an inequality M/mM 6= 0 by Nakayama’s Lemma; now the diagram yields εdM 6= 0. (iv) =⇒ (ii) =⇒ (iii). These implications are tautologies. (iii) =⇒ (i). This implication is a special case of Theorem 2.1. (ii) ⇐⇒ (v). The preceding diagram shows that the condition εnR 6= 0 is equivaG lent to Ker(∂−n ) * mG−n . Thus, the desired assertion follow from Lemma 2.3.  Notes 2.5. The equivalence of conditions (i) and (ii) in Theorem 2.4 was proved by Ivanov [8, Theorem 2] when R is Gorenstein and by Lescot [10, 1.4] in general. The equivalence of (i) and (v) is due to Dutta [4, 1.3]. As shown above, it follows from Lescot’s theorem via the elementary Lemma 2.3. Martsinkovsky deduced Dutta’s theorem from [11, Theorem 6], and used the latter to prove regularity criteria different from (ii), (iii), and (iv) in Theorem 2.4; see [11, p. 11]. 3. Bass numbers of modules The nth Bass number of a module M over a local ring (R, m, k) is the integer µnR (M ) = rankk ExtnR (k, M ) . In what follows, given a homomorphism β : M → N and an R-submodule N ′ ⊆ N we let M ∩ N ′ denote the submodule β −1 (N ′ ) of M . Theorem 3.1. Let (R, m, k) be a local ring, M → N an R-linear map, and set r = rankk (M/M ∩ mN ) . If R is singular and pdR N is finite, then for each n ∈ Z there is an equality n−1 µnR (M ∩ mN ) = µnR (M ) + rµR (k) . BASS NUMBER OVER LOCAL RINGS 5 Proof. Set M = M/(M ∩mN ) and N = N/mN , and let π : M → M and ι : M → N be the induced maps. They appear in a commutative diagram with exact row /N M π  /M 0  /N ι Since ι is k-linear, it is split, so we get a commutative diagram with exact row ExtR (k, M ) / Ext (k, N ) R ExtR (k,π) 0 0  / ExtR (k, M ) ExtR (k,ι)  / ExtR (k, N ) and zero map due to Theorem 2.1. It implies ExtR (k, π) = 0. By definition, there exists an exact sequence of R-modules π 0 −→ (M ∩ mN ) −→ M −−→ M −→ 0 As ExtR (k, π) = 0, its cohomology sequence yields an exact sequence n−1 0 −→ ExtR (k, M ) −→ ExtnR (k, M ∩ mN ) −→ ExtnR (k, M ) −→ 0 of k-vector spaces for each integer n. Computing ranks over k and using the iso morphism ExtR (k, M ) ∼ = ExtR (k, k) ⊗k M , we obtain the desired equality. Recall that the nth Betti number of M is the integer βnR (M ) = rankk ExtnR (M, k). Corollary 3.2. Assume that R is singular and N ⊇ M ⊇ mN holds, and set s = rankk (N/M ) . If N is finite and pdR N = p < ∞ holds, then for each n ∈ Z there is an equality (3.2.1) µnR (M ) = p X R R µn+i R (R)βi (N ) + sβn−1 (k) . i=0 Proof. The hypotheses give M ∩ mN = mN and r = rankk (M/mN ). By applying Theorem 3.1 to the submodules M ⊆ N and mN ⊆ N we obtain R µnR (M ) = µnR (mN ) − rβn−1 (k) R R = µnR (N ) + rankk (N/mN )βn−1 (k) − rβn−1 (k) R = µnR (N ) + sβn−1 (k) . As pdR N is finite, Foxby [5, 4.3(2)] yields µnR (N ) = Pp i=0 R µn+i R (R)βi (N ).  Remark 3.3. The hypothesis pdR N < ∞ in the corollary is necessary, as otherwise the sum in (3.2.1) is not defined. On the other hand, when R is regular—and so pdR N is necessarily finite—the conclusion of the corollary may fail. For example, if M is a finite free R-module of rank r and d = dim R, then (  d r n−1 for n 6= d + 1 , n µR (mM ) = 0 for n = d + 1 . Indeed, this follows from the cohomology exact sequence induced by the exact sequence 0 → mM → M → M/mM → 0 because ExtnR (k, M ) = 0, for n 6= d, the  map εdM is bijective by the proof of (i) =⇒ (iv) in Theorem 2.4, and µiR (k) = di . 6 L. L. AVRAMOV AND S. B. IYENGAR 3.4. Bass numbers P are often described in terms of the Rgenerating P formal power M series IR (t) = n∈Z µnR (M )tn . We also use the series PM (t) = n∈Z βnR (M )tn . In these terms, the formulas (3.2.1) for all n ∈ Z can be restated as an equality (3.4.1) M R IR (t) = IR (t)PNR (t−1 ) + stPkR (t) . 3.5. Let (S, mS , k) and (T, mT , k) be local rings and let εS : S → k ← T : εT denote the canonical maps. The fiber product of S and T over k is defined by the formula S ×k T := {(s, t) ∈ S × T | εS (s) = εT (t)} . It is well known, and easy to see, that this is a subring of S × T , which is local with maximal ideal m = mS ⊕ mT and residue field k. Set R = S ×k T . Let N and P be finite modules over S and T , respectively. The canonical maps S ← R → T turn N and P into R-modules, and for them Lescot [10, 2.4] proved (3.5.1) N I N (t) IR (t) = SS R Pk (t) Pk (t) and P IR (t) I P (t) = TT . R Pk (t) Pk (t) When N/nS N = V = P/mT P holds for some k-module V the fiber product N ×V P := {(n, p) ∈ N × P | π N (n) = π P (p)} has a natural structure of finite R-module. Corollary 3.6. With notation as in 3.5, set v = rankk V and M = N ×V P . If S and T are singular and pdS N and pdT P are finite, then mR M (t) IR ISS (t)PNS (t−1 ) ITT (t)PPT (t−1 ) = + + 2vt . PkR (t) PkS (t) PkT (t) Proof. We have mM ∼ = mS N ⊕ mT P as R-modules, whence the first equality below: mS N mT P mM IR (t) IR (t) IR (t) = + R R R Pk (t) Pk (t) Pk (t) = I T (t)PPT (t−1 ) ISS (t)PNS (t−1 ) + vt + T + vt . S Pk (t) PkT (t) The second one comes by applying formulas (3.5.1) and (3.4.1), in this order.  Notes 3.7. For N = R and M = m Corollaries 3.2 and 3.6 specialize to Lescot’s results [10, 1.8(2)] and [10, 3.2(1)], respectively. The proof presented above for Corollary 3.6 faithfully transposes his derivation of [10, 3.2(1)] from [10, 1.8(2)]. When N is any finite R-module with mN 6= 0 and M is a submodule containing mN , it is proved in [1, Theorem 4] that the Bass numbers of M and mN asymptotically have the same size, measured on appropriate polynomial or exponential scales. The closed formula in Corollary 3.2 is a much more precise statement, but as noted in Remark 3.3 it does not hold when pdR N is infinite or when R is regular. References [1] L. L. Avramov, Modules with extremal resolutions, Math. Res. Letters 3 (1996), 319–328. [2] L. L. Avramov, S. B. Iyengar, Evaluation maps and stable cohomology for DG algebras, in preparation. [3] L. L. Avramov, O.Veliche, Stable cohomology over local rings, Adv. Math. 213 (2007),93–139. [4] S. P. Dutta, Syzygies and homological conjectures, Commutative algebra (Berkeley, 1987), Math. Sci. Res. Inst. Publ. 15, Springer, New York, 1989; 139–156. BASS NUMBER OVER LOCAL RINGS 7 [5] H.-B. Foxby Isomorphisms between complexes with applications to the homological theory of modules, Math. Scand. 40 (1977), 5–19. [6] F. Goichot, Homologie de Tate-Vogel équivariante, J. Pure Appl. Algebra 82 (1992), 39–64. [7] T. Ishikawa, On injective modules and flat modules, J. Math. Soc. Japan 17 (1965), 291–296. [8] A. F. Ivanov, On a homological characterization of a certain class of local rings, Math. USSR Sbornik 38 (1981), 421–425. [9] C. U. Jensen, Les foncteurs dérivés de lim et leurs applications en théorie des modules, ←− Lecture Notes Math. 254, Springer, Berlin, 1972. [10] J. Lescot, La série de Bass d’un produit fibré d’anneaux locaux, Séminaire d’Algèbre DubreilMalliavin (Paris, 1982), Lecture Notes Math. 1029, Springer, Berlin, 1983; 218–239. [11] A. Martsinkovsky, A remarkable property of the (co) syzygy modules of the residue field of a nonregular local ring, J. Pure Appl. Algebra 110 (1996), 9–13. Department of Mathematics, University of Nebraska, Lincoln, NE 68588, U.S.A. E-mail address: [email protected] Department of Mathematics, University of Nebraska, Lincoln, NE 68588, U.S.A. E-mail address: [email protected]
0math.AC
©2017. This manuscript version is made available under the CC-BY-NC-ND 4.0 license http://creativecommons.org/licenses/by-nc-nd/4.0/. This is a preprint version. The final version of this paper is available at http://www.sciencedirect.com/science/article/pii/S0952197617301537 (DOI:10.1016/j.engappai.2017.07.005). . Particle Swarm Optimization for Generating Interpretable Fuzzy Reinforcement Learning Policies Daniel Heina,b,∗, Alexander Hentschelc , Thomas Runklerb , Steffen Udluftb arXiv:1610.05984v5 [cs.NE] 15 Aug 2017 a Technische Universität Müchen, Department of Informatics, Boltzmannstr. 3, 85748 Garching, Germany AG, Corporate Technology, Otto-Hahn-Ring 6, 81739 Munich, Germany c AxiomZen, 980 Howe St #350, Vancouver, BC V6Z 1N9, Canada b Siemens Abstract Fuzzy controllers are efficient and interpretable system controllers for continuous state and action spaces. To date, such controllers have been constructed manually or trained automatically either using expert-generated problem-specific cost functions or incorporating detailed knowledge about the optimal control strategy. Both requirements for automatic training processes are not found in most real-world reinforcement learning (RL) problems. In such applications, online learning is often prohibited for safety reasons because it requires exploration of the problem’s dynamics during policy training. We introduce a fuzzy particle swarm reinforcement learning (FPSRL) approach that can construct fuzzy RL policies solely by training parameters on world models that simulate real system dynamics. These world models are created by employing an autonomous machine learning technique that uses previously generated transition samples of a real system. To the best of our knowledge, this approach is the first to relate self-organizing fuzzy controllers to model-based batch RL. FPSRL is intended to solve problems in domains where online learning is prohibited, system dynamics are relatively easy to model from previously generated default policy transition samples, and it is expected that a relatively easily interpretable control policy exists. The efficiency of the proposed approach with problems from such domains is demonstrated using three standard RL benchmarks, i.e., mountain car, cart-pole balancing, and cart-pole swing-up. Our experimental results demonstrate high-performing, interpretable fuzzy policies. Keywords: interpretable, reinforcement learning, fuzzy policy, fuzzy controller, particle swarm optimization 1. Introduction This work is motivated by typical industrial application scenarios. Complex industrial plants, like wind or gas turbines, have already been operated in the field for years. For these plants, low-level control is realized by dedicated expert-designed controllers, which guarantee safety and stability. Such low-level controllers are constructed with respect to the plant’s subsystem dependencies which can be modeled by expert knowledge and complex mathematical abstractions, such as first principle models and finite element methods. Examples for low-level controllers include self-organizing fuzzy controllers, which are considered to be efficient and interpretable (Casillas, Cordon, Herrera, ∗ Corresponding author Email address: [email protected] (Daniel Hein) Preprint submitted to Engineering Applications of Artificial Intelligence and Magdalena, 2003) system controllers in control theory for decades (Procyk and Mamdani, 1979; Scharf and Mandve, 1985; Shao, 1988). However, we observed that high-level control is usually implemented by default control strategies, provided by best practice approaches or domain experts who are maintaining the system based on personal experience and knowledge about the system’s dynamics. One reason for the lack of autonomously generated real-world controllers is that modeling system dependencies for high-level control by dedicated mathematical representations is a complicated and often infeasible approach. Further, modeling such representations by closed-form differentiable equations, as required by classical controller design, is even more complicated. Since in many real-world applications such equations cannot be found, training high-level controllers has to be performed on reward samples from the August 17, 2017 plant. Reinforcement learning (RL) (Sutton and Barto, 1998) is capable of yielding high-level controllers based solely on available system data. Generally, RL is concerned with optimization of a policy for a system that can be modeled as a Markov decision process. This policy maps from system states to actions in the system. Repeatedly applying an RL policy generates a trajectory in the state-action space (Section 2). Learning such RL controllers in a way that produces interpretable high-level controllers is the scope of this paper and the proposed approach. Especially for real-world industry problems this is of high interest, since interpretable RL policies are expected to yield higher acceptance from domain experts than black-box solutions (Maes, Fonteneau, Wehenkel, and Ernst, 2012). A fundamental difference between classical control theory and machine learning approaches, such as RL, lies in the way how these techniques address stability and reward function design. In classical control theory, stability is the central property of a closed-loop controller. For example, Lyapunov stability theory analyzes the stability of a solution near a point of equilibrium. It is widely used to design controllers for nonlinear systems (Lam and Zhou, 2007). Moreover, fault detection and robustness are of interest for fuzzy systems (Yang, Li, Liu, and Hua, 2013; Yang, Li, Liu, and Zhao, 2014a; Yang, Shi, Li, and Li, 2014b). The problems addressed by classical fuzzy control theory, i.e., stability, fault detection, and robustness, make them well suited for serving as low-level system controllers. For such controllers, reward functions specifically designed for the purpose of parameter training are essential. In contrast, the second view on defining reward functions, which is typically applied in high-level system control, is to sample from a system’s latent underlying reward dynamic and subsequently use this data to perform machine learning. Herein, we apply this second view on defining reward functions, because RL is capable of utilizing sampled reward data for controller training. Note that the goal of RL is to find a policy that maximizes the trajectory’s expected accumulated rewards, referred to as return value, without explicitly considering stability. Several approaches for autonomous training of fuzzy controllers have proven to produce remarkable results on a wide range of problems. Jang (1993) introduced ANFIS, a fuzzy inference system implemented using an adaptive network framework. This approach has been frequently applied to develop fuzzy controllers. For example, ANFIS has been successfully applied to the cart-pole (CP) balancing problem (Saifizul, Azlan, and Mohd Nasir, 2006; Hanafy, 2011; Kharola and Gupta, 2014). During the ANFIS training process, training data must represent the desired controller behavior, which makes this process a supervised machine learning approach. However, the optimal controller trajectories are unknown in many industry applications. Feng (2005a,b) applied particle swarm optimization (PSO) to generate fuzzy systems to balance the CP system and approximate a nonlinear function Debnath et al. optimized Gaussian membership function parameters for nonlinear problems and showed that parameter tuning is much easier with PSO than with conventional methods because knowledge about the derivative and complex mathematical equations are not required (Debnath, Shill, and Murase, 2013). Kothandaraman and Ponnusamy (2012) applied PSO to tune adaptive neuro fuzzy controllers for a vehicle suspension system. However, similar to ANFIS, the PSO fitness functions in all these contributions have been dedicated expert formulas or mean-square error functions that depend on correctly classified samples. To the best of our knowledge, self-organizing fuzzy rules have never been combined with a model-based batch RL approach. In the proposed fuzzy particle swarm reinforcement learning (FPSRL) approach, different fuzzy policy parameterizations are evaluated by testing the resulting policy on a world model using a Monte Carlo method (Sutton and Barto, 1998). The combined return value of a number of action sequences is the fitness value that is maximized iteratively by the optimizer. In batch RL, we consider applications where online learning approaches, such as classical temporal-difference learning (Sutton, 1988), are prohibited for safety reasons, since these approaches require exploration of system dynamics. In contrast, batch RL algorithms generate a policy based on existing data and deploy this policy to the system after training. In this setting, either the value function or the system dynamics is trained using historic operational data comprising a set of four-tuples of the form (observation, action, reward, next observation), which is referred to as a data batch. Research from the past two decades (Gordon, 1995; Ormoneit and Sen, 2002; Lagoudakis and Parr, 2003; Ernst, Geurts, and Wehenkel, 2005) suggests that such batch RL algorithms satisfy real-world system requirements, particularly when involving neural networks (NNs) modeling either the state-action value function (Riedmiller, 2005a,b; Schneegass, Udluft, and Martinetz, 2007b,a; Riedmiller, Gabel, Hafner, and Lange, 2009) or system dynamics (Bakker, 2004; Schäfer, 2008; Depeweg, Hernández-Lobato, DoshiVelez, and Udluft, 2016). Moreover, batch RL algorithms are data-efficient (Riedmiller, 2005a; Schäfer, Udluft, and Zimmermann, 2007) because batch data is utilized repeatedly during the training phase. FPSRL is a model-based approach, i.e., training is conducted on an environment approximation referred to as world model. Generating a world model from real system data in advance and training a fuzzy policy offline using this model has several advantages. (1) In many real-world scenarios, data describing system dynamics is available in advance or is easily collected. (2) Policies are not evaluated on the real system, thereby avoiding the detrimental effects of executing a bad policy. (3) Expert-driven reward function engineering yielding a closed-form differentiable equation utilized during policy training is not required, i.e., it 2 is sufficient to sample from the system’s reward function and model the underlying dependencies using supervised machine learning. The remainder of this paper is organized as follows. The methods employed in our framework are reviewed in Sections 2–4. Specifically, the problem of finding policies via RL is formalized as an optimization task. In addition, we review Gaussian-shaped membership functions and describe the proposed parameterization approach. Finally, PSO, an optimization heuristic we use for searching for optimal policy parameters, and its different extensions are presented. An overview of how the proposed FPSRL approach is derived from different methods is given in Section 5. Experiments using three benchmark problems, i.e., the mountain car (MC) problem, the CP balancing (CPB) task, and the more complex CP swing-up (CPSU) challenge, are described in Section 6. In this section, we also explain the setup process of the world models and introduce the applied fuzzy policies. Experimental results are discussed in Section 7. The results demonstrate that the proposed FPSRL approach can solve the benchmark problems and is human-readable and understandable. To benchmark FPSRL, we compare the obtained results to those of neural fitted Q iteration (NFQ) (Riedmiller, 2005a,b), an established RL technique. Note that this technique was chosen to describe the advantages and limitations of the proposed method compared to a well-known, widely available standard algorithm. action strategy, i.e., a policy, that maximizes the expected cumulative reward, i.e., return R. In our proposed setup, the goal is to find the best policy among a set of policies that is spanned by a parameter vector x ∈ X . Herein, a policy corresponding to a particular parameter value x is denoted by π[x]. For state st , the policy outputs action π[x](st ) = at . The policy’s performance when starting from st is measured by the return R, i.e., the accumulated future rewards obtained by executing the policy. To account for increasing uncertainties when accumulating future rewards, the reward rt+k for k future time steps is weighted by γ k , where γ ∈ [0, 1]. Furthermore, adopting a common approach, we include only a finite number of T > 1 future rewards in the return (Sutton and Barto, 1998), which is expressed as follows: R(st , π[x]) = T −1 X γ k r(st+k , π[x](st+k ), st+k+1 ), k=0 (1) with st+k+1 = g(st+k , at+k ). The discount factor γ is selected such that, at the end of the time horizon T , the last reward accounted for is weighted by q ∈ [0, 1], yielding γ = q 1/(T −1) . The overall state-independent policy performance F(x) is obtained by averaging over all starting states st ∈ S using their respective probabilities wst as weight factors. Thus, optimal solutions to the RL problem are π[x] with X wst R(st , π[x]). x̂ ∈ arg max F(x), with F(x) = x∈X st ∈S (2) In optimization terminology, the policy performance function F(x) is referred to as a fitness function. For many real-world problems, the cost of executing a potentially bad policy is prohibitive. This is why, e.g., pilots learn flying using a flight simulator instead of real aircraft. Similarly, in model-based RL (Busoniu, Babuska, De Shutter, and Ernst, 2010), the real-world state transition function g is approximated using a model g̃, which can be a first principle model or created from previously gathered data. By substituting g̃ in place of the real-world state transition function g in Eq. (1), we obtain a model-based approximation F̃(x) of the true fitness function Eq. (2). In this study, we employ models based on NNs. However, the proposed method can be extended to other models, such as Bayesian NNs (Depeweg et al., 2016) and Gaussian process models (Rasmussen and Williams, 2006). 2. Model-based Reinforcement Learning In biological learning, an animal interacts with its environment and attempts to find action strategies to maximize its perceived accumulated reward. This notion is formalized in RL, an area of machine learning where the acting agent is not explicitly told which actions to implement. Instead, the agent must learn the best action strategy from the observed environment’s responses to the agent’s actions. For the most common (and most challenging) RL problems, an action affects both the next reward and subsequent rewards (Sutton and Barto, 1998). Examples for such delayed effects are nonlinear change in position when a force is applied to a body with mass or delayed heating in a combustion engine. In the RL formalism, the agent interacts with the target system in discrete time steps, t = 0, 1, 2, . . .. At each time step, the agent observes the system’s state st ∈ S and applies an action at ∈ A, where S is the state space and A is the action space. Depending on st and at , the system transitions to a new state and the agent receives a real-value reward rt+1 ∈ R. Herein, we focus on deterministic systems where state transition g and reward r can be expressed as functions g : S × A → S with g(st , at ) = st+1 and r : S × A × S → R with r(st , at , st+1 ) = rt+1 , respectively. The desired solution to an RL problem is an 3. Fuzzy Rules Fuzzy set theory was introduced by Zadeh (1965). Based on this theory, Mamdani and Assilian (1975) introduced a so-called fuzzy controller specified by a set of linguistic if-then rules whose membership functions can be activated independently and produce a combined output computed by a suitable defuzzification function. 3 In a D-inputs-single-output system with C rules, a fuzzy rule R(i) can be expressed as follows: At each iteration p, particle i remembers the best local position yi (p) it has visited so far (including its current position). Furthermore, particle i knows the neighborhood’s best position R(i) : IF s is m(i) THEN o(i) , with i ∈ {1, . . . , C}, (3) where s ∈ RD denotes the input vector (the environment state in our setting), m(i) is the membership of a fuzzy set of the input vector in the premise part, and o(i) is a real number in the consequent part. In this paper, we apply Gaussian membership functions (Wang and Mendel, 1992). This very popular type of membership function yields smooth outputs, is local but never produces zero activation, and forms a multivariate Gaussian function by applying the product over all membership dimensions. We define the membership function of each rule as follows:   D  (c(i) − sj )2  Y j , m(i) (s) = m[c(i) , σ (i) ](s) = exp − (i) 2   2σj j=1 (4) where m(i) is the i-th parameterized Gaussian m(c, σ) with its center at c(i) and width σ (i) . The parameter vector x ∈ X , where X is the set of valid Gaussian fuzzy parameterizations, is of size d = (2D + 1) · C + 1 and contains (1) (1) (1) (1) (1) (1) (2) (2) (2) (2) (2) (2) ŷi (p) ∈ xi (p + 1) = xi (p) + vi (p + 1), (C) (C) (C) (7) (8) where xi (0) ∼ U (xmin , xmax ) is distributed uniformly. The velocity vector contains both a cognitive component and a social component that represent the attraction to the given particle’s best position and the neighborhood’s best position, respectively. The velocity vector is calculated as follows: vij (p + 1) =wvij (p) + c1 r1j (p)[yij (p) − xij (p)] {z } | c1 , c2 , . . . , cD , σ1 , σ2 , . . . , σD , o(2) , . . . , (C) F(z), found so far by any one particle in its neighborhood Ni (including itself). The neighborhood relations between particles are determined by the swarm’s population topology and are generally fixed, irrespective of the particles’ positions. Note that a ring topology (Eberhart, Simpson, and Dobbins, 1996) is used in the experiments described in Section 6. Let xi (p) denote the position of particle i at iteration p. Changing the position of a particle in each iteration is achieved by adding the velocity vector vi (p) to the particles position vector x = (c1 , c2 , . . . , cD , σ1 , σ2 , . . . , σD , o(1) , (C) arg max z∈{yj (p)|j∈Ni } (C) cognitive component c1 , c2 , . . . , cD , σ1 , σ2 , . . . , σD , o(C) , α). (5) + c2 r2j (p)[ŷij (p) − xij (p)], | {z } (9) social component The output is determined using the following formula: Ç PC å (i) (i) i=1 m (s) · o π[x](s) = tanh α · PC , (6) (i) i=1 m (s) where w is the inertia weight factor, vij (p) and xij (p) are the velocity and position of particle i in dimension j, and c1 and c2 are positive acceleration constants used to scale the contribution of the cognitive and social components yij (p) and ŷij (p), respectively. The factors r1j (p) and r2j (p) ∼ U (0, 1) are random values sampled from a uniform distribution to introduce a stochastic element to the algorithm. The best position of a particle for a maximization problem at iteration p is calculated as follows: ® xi (p), if F(xi (p)) > F(yi (p − 1)) yi (p) = (10) yi (p − 1), else, where the hyperbolic tangent limits the output to between -1 and 1, and parameter α can be used to change the slope of the function. 4. Particle Swarm Optimization The PSO algorithm is a population-based, non-convex, stochastic optimization heuristic. Generally, PSO can operate on any search space that is a bounded sub-space of a finite-dimensional vector space (Kennedy and Eberhart, 1995). The position of each particle in the swarm represents a potential solution of the given problem. The particles fly iteratively through the multidimensional search space, which is referred to as the fitness landscape. After each movement, each particle receives a fitness value for its new position. This fitness value is used to update a particle’s own velocity vector and the velocity vectors of all particles in a certain neighborhood. where in our framework F is the fitness function given in Eq. (2) and the particle positions represent the policy’s parameters x from Eq. (5). Pseudocode for the PSO algorithm applied in our experiments (Section 6) is provided in Appendix A. 5. Fuzzy Particle Swarm Reinforcement Learning The basis for the proposed FPSRL approach is a data set D that contains state transition samples gathered from 4 a real system. These samples are represented by tuples (s, a, s0 , r), where, in state s, action a was applied and resulted in state transition to s0 and yielded reward r. D can be generated using any (even a random) policy prior to policy training. Then, we generate world models g̃ with inputs (s, a) to predict s0 , using data set D. It is advantageous to learn the differences of the state variables and train a single model per state variable separately to yield better approximative quality: alternative modeling technique is the use of regression trees (Breiman, Friedman, Olshen, and Stone, 1984). While typically lacking data efficiency, regression tree predictions are less affected by nonlinearities perceived by system dynamics because they do not rely on a closed-form functional approximation. We employed PSO in our study because the population-based optimizer does not require any gradient information about its fitness landscape. PSO utilizes neighborhood information to systematically search for valuable regions in the search space. Note that gradientdescent based methods or evolutionary algorithms are alternative techniques. ∆s01 = g̃s1 (s1 , s2 , . . . , sm , a) ∆s02 = g̃s2 (s1 , s2 , . . . , sm , a) ... 6. Experiments ∆s0m = g̃sm (s1 , s2 , . . . , sm , a). 6.1. Mountain Car In the MC benchmark, an underpowered car must be driven to the top of a hill (Fig. 2). This is achieved by building sufficient potential energy by first driving in the direction opposite to the final direction. The system is fully described by the two-dimensional state space s = (ρ, ρ̇) representing the cars position ρ and velocity ρ̇. We conducted MC experiments using the freely available CLS 2 software (’clsquare’)1 , which is an RL benchmark system that applies the Runge-Kutta fourth-order method to approximate closed loop dynamics. The task for the RL agent is to find a sequence of force actions at , at+1 , at+2 , . . . ∈ [−1, 1] that drive the car up the hill, which is achieved when reaching position ρ ≥ 0.6. At the start of each episode, the car’s position is initialized in the interval [−1.2, 0.6]. The agent receives a reward of ® 0, if ρ0 ≥ 0.6, 0 r(s ) = (11) −1, otherwise, Then, the resulting state is calculated according to s0 = (s1 + ∆s01 , s2 + ∆s02 , . . . , sm + ∆s0m ). The reward is also given in D; thus, the reward function can be approximated using r = r̃(s, a, s0 ). For the next FPSRL step, an assumption about the number of rules per policy is required. In our experiments, we started with a minimal rule set for each benchmark and calculated the respective performances. Then, we increased the number of rules and compared the performance with those of the policies with fewer rules. This process was repeated until performance with respect to the dynamic models was satisfactory. An intuitive representation of the maximal achievable policy performance given a certain discount factor with respect to a particular model can be computed by adopting a trajectory optimization technique, such as PSO-P (Hein, Hentschel, Runkler, and Udluft, 2016), prior to FPSRL training. During optimization, each particle’s position x in the PSO represents a parameterization of the fuzzy policy π[x]. The fitness F̃ of a particle is calculated by generating trajectories using the world model g̃ starting from a fixed set of initial benchmark states (Section 2). A schematic representation of the proposed FPSRL framework is given in Fig. 1. Note that we present the results of FPSRL using NNs as world models and PSO as the optimization technique. In the considered problem domain, i.e., continuous, smooth, and deterministic system dynamics, NNs are known to serve as adequate world models. Given a batch of previously generated transition samples, the NN training process is data-efficient and training errors are excellent indicators of how well the model will perform in model-based RL training. Nevertheless, for different problem domains, alternative types of world models might be preferable. For example, Gaussian processes (Rasmussen and Williams, 2006) provide a good approximation of the mean of the target value, and this technique indicates the level of confidence about this prediction. This feature may be of value for stochastic system dynamics. A second subsequent to each state transition s0 = g(s, a). When the car reaches the goal position, i.e., ρ ≥ 0.6, its position becomes fixed, the velocity becomes zero, and the agent perceives the maximum reward in each following time step regardless of the applied actions. 6.2. Cart-pole Balancing The CP experiments described in the following two sections were also conducted using the CLS 2 software. The objective of the CPB benchmark is to apply forces to a cart moving on a one-dimensional track to keep a pole hinged to the cart in an upright position (Fig. 3). Here, the four Markov state variables are the pole angle θ, the pole angular velocity θ̇, the cart position ρ, and the cart velocity ρ̇. These variables describe the Markov state completely, i.e., no additional information about the system’s past behavior is required. The task for the RL agent is to find a sequence of force actions at , at+1 , at+2 , . . . that prevent the pole from falling over (Fantoni and Lozano, 2002). 1 http://ml.informatik.uni-freiburg.de/research/clsquare. 5 … … Gradient Descent Regression Trees Evolutionary Algorithms Gaussian Processes PSO Fuzzy Rules x (s, a) (s0 , r) F(x) 2 Neural Networks Figure 1: Schematic visualization of the proposed FPSRL approach. From left to right: PSO evaluates parameter vectors x of a predefined fuzzy rule representation π[x]. For each given set of parameters, a model-based RL evaluation is performed by first computing an action vector a = π[x](s) for state s (Eq. (6)). Then, the approximative performance of this tuple is computed by predicting both the resulting state s0 and the transition’s reward r using NNs. Repeating this procedure for state s0 and its successor states generates an approximative trajectory through the state space. Accumulating the rewards using Eq. (1), the return R is computed for each state, which is eventually used to compute the fitness value F̃ (x), which drives the swarm to high performance policy parameterizations (Eq. (2)). Alternative techniques that could replace PSO and NNs are presented in the background. 1.5 $ & 1 ✓& $ 0.5 % % ! 0 -0.5 -2 -1.5 -1 -0.5 0 0.5 1 " # # ' Figure 2: Mountain car benchmark. The task is to first build up momentum by driving to the left in order to subsequently reach the top of the hill on the right at ρ = 0.6. In the CPB task, the angle of the pole and the cart’s position are restricted to intervals of [−0.7, 0.7] and [−2.4, 2.4] respectively. Once the cart has left the restricted area, the episode is considered a failure, i.e., velocities become zero, the cart’s position and pole’s angle become fixed, and the system remains in the failure state for the rest of the episode. The RL policy can apply force actions on the cart from −10 N to +10 N in time intervals of 0.025 s. The reward function for the balancing problem is given as follows:   0.0, if |θ0 | < 0.25      and |ρ0 | < 0.5,  r(s0 ) = −1.0, if |θ0 | > 0.7 (12)   0  or |ρ | > 2.4,    −0.1, otherwise. Figure 3: Cart-pole benchmark. The task is to balance the pole around θ = 0 while moving the cart to position ρ = 0 by applying positive or negative force to the cart. r = 0 and keep it there for the rest of the episode. Since the CP problem is symmetric around s = (θ, θ̇, ρ, ρ̇) = (0, 0, 0, 0), an optimal action at for state (θ, θ̇, ρ, ρ̇) corresponds to an optimal action −at for state (−θ, −θ̇, −ρ, −ρ̇). Thus, the parameter search process can be simplified. It is only necessary to search for optimal parameters for one half of the fuzzy policy rules. The other half of the parameter sets can be constructed by negating the membership functions’ mean parameters (i) cj and the respective output values o(i) of the policy’s components. Note that the membership function span (i) width of the fuzzy rules (parameter σj in Eq. (4)) is not negated because the membership functions must preserve their shapes. Based on this reward function, the primary goal of the policy is to avoid reaching the failure state. The secondary goal is to drive the system to the goal state region where 6 An approximation of the next state is given by the following formula: 6.3. Cart-pole Swing-up The CPSU benchmark is based on the same system dynamics as the CPB benchmark. In contrast to the CPB benchmark, the position of the cart and the angle of the pole are not restricted. Consequently, the pole can swing through, which is an important property of CPSU. Since the pole’s angle is initialized in the full interval of [−π, π], it is often necessary for the policy to swing the pole several times from side to side to gain sufficient energy to erect the pole and receive the highest reward. In the CPSU setting, the policy can apply actions from −30 N to +30 N on the cart. The reward function for the problem is given as follows:   if |θ0 | < 0.5 0, 0 r(s ) = (13) and |ρ0 | < 0.5,   −1, otherwise. st+1 = (θt + ∆θt+1 , θ̇t + ∆θ̇t+1 , ρt + ∆ρt+1 , ρ̇t + ∆ρ̇t+1 ). (14) The result of this formula can subsequently be used to approximate the state transition’s reward by rt+1 = r̃(st , at , st+1 ). (15) For the training sets of both CP benchmarks, the samples originate from trajectories of 100 (CPB) and 500 (CPSU) state transitions generated by a random walk on the benchmark dynamics. The start states for these trajectories were sampled uniformly from [−0.7, 0.7] × {0} × [−2.4, 2.4] × {0} for CPB and from [−π, π] × {0} × {0} × {0} for CPSU. We conducted several experiments to investigate the effect of different data set sizes and different network complexities. The results give a detailed impression about the minimum amount of data required to successfully apply the proposed FPSRL approach on different benchmarks and the adequate NN complexity for each data batch size. The experiments were conducted with network complexities of one, two, and three hidden layers with 10 hidden neurons each and arctangent activation functions. For training, we used the Vario-Eta algorithm (Neuneier and Zimmermann, 2012). Training the networks can be executed in parallel and only requires a couple of minutes. A detailed overview of the approximation performance of the resulting models, the FPSRL rules created with these models, and a comparison of non-interpretable policies generated by NFQ with the same data sets is given in Tables 1, 2, and 3. The mean squared errors of the normalized output variables (mean=0, standard deviation=1) have been depicted with respect to the generalization data sets. This is similar to the reward function for the CPB benchmark but does not contain any penalty for failure states, which terminate the episode when reached. 6.4. Neural Network World Models We conducted policy training on NN world models, which yielded approximative fitness functions F̃(x) (Section 2). For these experiments, we created one NN for each state variable. Prior to training, the respective data sets were split into blocks of 80%, 10%, and 10% (training, validation and generalization sets, respectively). While the weight updates during training were computed by utilizing the training sets, the weights that performed best given the validation sets were used as training results. Finally, those weights were evaluated using the generalization sets to rate the overall approximation quality on unseen data. The MC NNs were trained with data set DMC containing tuples (s, a, g(s, a), r) from trajectories generated by applying random actions on the benchmark dynamics. The start states for these trajectories were uniformly sampled as s = (ρ, ρ̇) ∈ [−1.2, 0.6] × {0}, i.e., at a random position on the track with zero velocity. The following three NNs were trained to approximate the MC task: 6.5. Policy Representations With the proposed FPSRL approach, we search for the parameterization x of a fuzzy policy formed by a certain number of rules. The performance of an FPSRL policy is related to the number of rules because more rules generally allow a more sophisticated reaction to system states. On the other hand, a higher number of rules requires more parameters to be optimized, which makes the optimizer’s search problem more difficult. In addition, a complex set of rules tends to be difficult or even impossible to interpret. Thus, we determined that two rules are sufficient for the MC and CPB benchmarks, while adequate performance for the CPSU benchmark is only achievable with a minimum of four rules. The output of the FPSRL policies is continuous, although a semi-discrete output can be obtained by increasing parameter α in Eq. (6). We compared FPSRL policy training and its performance by applying NFQ to the same problems using the same data sets and approximative models. NFQ was chosen because it is a well-established, widely applied, and ∆ρt+1 = g̃ρ (ρt , ρ̇t , at ), ∆ρ̇t+1 = g̃ρ̇ (ρt , ρ̇t , at ), rt+1 = r̃(st , at , st+1 ), with st+1 = (ρt + ∆ρt+1 , ρ̇t + ∆ρ̇t+1 ). Similarly, for the CP dynamic model state st = (θt , θ̇t , ρt , ρ̇t ) we created the following four networks: ∆θt+1 = g̃θ (θt , θ̇t , ρt , ρ̇t , at ) ∆θ̇t+1 = g̃θ̇ (θt , θ̇t , ρt , ρ̇t , at ) ∆ρt+1 = g̃ρ (θt , θ̇t , ρt , ρ̇t , at ) ∆ρ̇t+1 = g̃ρ̇ (θt , θ̇t , ρt , ρ̇t , at ). 7 well-documented RL methodology. We used the NFQ implementation from the RL teachingbox 2 tool box. In this paper, we did not aim to claim the proposed FPSRL approach is superior to the best RL algorithms in terms of performance; thus, NFQ was selected to show both the degree of difficulty of our benchmarks and the advantages and limitations of the proposed method. Recent developments in deep RL have produced remarkable results with image-based online RL benchmarks (Silver, Lever, Heess, Degris, Wierstra, and Riedmiller, 2014; Van Hasselt, Guez, and Silver, 2016), and future studies may reveal that their performance with batch-based offline problems is superior to that of NFQ. Nevertheless, these methods do not attempt to produce interpretable policies. can drive the car up the hill from any initial state in less than 200 time steps. One way to visualize fuzzy policies is to plot the respective membership functions and analyze the produced output for the sample states. A graphical representation of a policy for the MC benchmark is given in Fig. 4. With some time for consideration, we were able to understand the policy’s outputs for each considered state. 7.2. Cart-pole Balancing The CPB benchmark has two different discontinuities in its dynamics, which make the modeling process more difficult compared to the MC benchmark case. The first discontinuity occurs when the cart leaves the restricted state space and ends up in the failure state, i.e., as soon as |θ| > 0.7 or |ρ| > 2.4, the cart becomes fixed at its current position (both velocities θ̇ and ρ̇ become zero). The second discontinuity appears when the cart enters the goal region. In this region, the reward switches from −0.1 to 0.0, which is a rather small change compared to the failure state reward of −1.0. In addition to the difficulty in modeling discrete changes with NNs, this task becomes even more complicated if samples for these transitions are rare. In contrast to the difficulties in modeling the benchmark dynamics, a rather simple policy can balance the pole without leaving the restricted state space. With the discount factor γ = 0.97 (q = 0.05), we consider policies that yield a performance of F ≈ −1.5 or greater as successful. The task for FPSRL was to find a parameterization for two fuzzy rules. Here, we used 100 particles and an out-of-the-box PSO setup (Appendix B). The training employed 1,000 start states that were uniformly sampled from [−0.5, 0.5] × {0} × [−0.5, 0.5] × {0} (Table 2). Note that a data batch size of 100,000 sample transitions was required to build models with adequate approximation quality for training a model-based RL policy. Models trained with 1,000 or 10,000 sample transitions could not correctly approximate the effects that occurred when entering the failure-state area. Further, they incorrectly predicted possibilities to escape the failure state and to balance the pole in subsequent time steps. The model-based FPSRL technique exploited these weaknesses and produced policies that perform well with the models but demonstrated poor performance with the real benchmark dynamics. A visual representation of one of the resulting fuzzy policies is given in Fig. 5. This example illustrates a situation where the potential problems of a policy can be observed via visual inspection, which is a significant advantage of interpretable policies. In contrast to FPSRL, NFQ could produce wellperforming non-interpretable policies even with small data batch sizes. Note that the same weak models used for FPSRL training were used to determine which NFQ iteration produced the best policy during NFQ training with 1,000 episodes. In our experiments, we observed that even models with bad approximative quality when 7. Results 7.1. Mountain Car We performed 10 NFQ training procedures for the MC benchmark using the setup described in Appendix B. After each NFQ iteration, the latest policy was tested on the world model g̃ to compute an approximation F̃ of the real performance. The policy yielding the best fitness value thus far was saved as an intermediate solution. To evaluate the true performance of the NFQ policies, we computed the true fitness value F by applying the policies to the mathematical MC dynamics g. The difficulties in the MC benchmark are discontinuity in the velocity dimension when reaching the goal and the rather long horizon required to observe the effects of the applied actions. With the first problem, it is difficult to model the goal area under the condition of limited samples reaching the goal using a random policy. Training errors lead to a situation where the models do not correctly represent the state transitions at ρ ≥ 0.6, where the velocity suddenly becomes ρ̇ = 0. Rather, the models learn that ρ ≈ 0.6 yields ρ̇ ≈ 0. Subsequently, during FPSRL training, the evaluation of policy candidates results in a situation where the car is driven to ρ ≈ 0.6 and is kept in this area by applying the correct forces, which leads to high reward transitions. This problem could be solved by incorporating external knowledge about the goal area, which would result in a more convenient NN training process. Here, we explicitly did not want to incorporate expert knowledge about the benchmarks. Instead, we wanted to demonstrate a purely data-driven autonomous learning example. The results given in Table 1 show that, despite these difficulties (even with small data batch sizes), well-performing policies can be learned using both FPSRL and NFQ. For the MC benchmark and a discount factor γ = 0.9851 (resulting from q = 0.05), we consider a policy with performance F ≈ −43 or greater a successful solution to the benchmark problem. A policy with such performance 2 Freely available at https://sourceforge.net/projects/teachingbox. 8 2 Rule 1: IF cart=right slope AND speed=high right THEN accelerate=positive. 1.5 accelerate velocity ρ̇ ρ 1 1 1 0.5 0.5 0.5 0 -0.5 -2 2 1.5 -1.5 -1.0 -0.5 -1.5 -1 -0.5 0.0 0 0 -2 0.5 0.5 -1 0 -5 0 0 5 1 m(1) (s) · o(1) = 3.34e−5 · 1.95 = 6.52e−5 Rule 2: IF cart=right slope AND speed=low right THEN accelerate=negative. 1 1 1 0.5 0.5 0.5 0.5 0 -0.5 -2 2 1.5 -1.5 -1.0 -0.5 -1.5 -1 -0.5 0.0 0 0 -2 0.5 0.5 (2) m 1 (s) · o -1 (2) 0 -5 0 0 5 = 1.80e−5 · −0.1632 = −2.94e−6 Example norm 1 1 0.5 0.5 0 -0.5 0 -0.5 -2 -1.5 -1.0 -0.5 -1.5 -1 -0.5 0.0 0 -1 0.5 0.5 -1 0 1 1 6.52e−5 − 2.94e−6 = 1.21 norm = 3.34e−5 + 1.80e−5 π(s) = tanh(65.04 · norm) = 1.0 Figure 4: Fuzzy rules for the MC benchmark (membership functions plotted in blue, example state position plotted in red with a gray area for the respective activation grade). Both rules’ activations are maximal at nearly the same position ρ, which implies that the ρ-dimension has minor influence on the policy’s output. This observation fits the fact that, for the MC benchmark, a simplistic but high-performing policy exists, i.e., accelerate the car in the direction of its current velocity. Although this trivial policy yields good performance for the MC problem, better solutions exist. For example, if you stop driving to the left earlier at a certain position, you reach the goal in fewer time steps, which yields a higher average return. The depicted policy implements this advantageous solution as shown in the example section for state s = (−1.5, −1.0) . Data Models Batch size Policies 1 layer 2 layers 3 layers FPSRL NFQ 1,000 ρ ρ̇ r 4.67e-5 6.97e-3 4.54e-1 3.55e-5 3.54e-3 1.46e-1 3.05e-6 7.26e-3 1.61e-1 selected mean std -41.98 -41.99 0.01 -43.23 -44.87 1.33 10,000 ρ ρ̇ r 1.18e-5 4.62e-3 1.72e-2 3.34e-7 3.48e-3 2.54e-4 2.01e-6 7.40e-5 6.04e-7 selected mean std -42.22 -42.69 0.46 -43.47 -45.73 2.90 100,000 ρ ρ̇ r 1.55e-5 1.10e-2 1.01e-3 1.55e-7 3.50e-4 2.09e-6 2.88e-7 5.15e-5 5.85e-8 selected mean std -41.99 -41.93 0.11 -43.12 -43.28 1.22 Table 1: MC results (left to right): (1) data: number of state transitions, obtained from random trajectories on the benchmark dynamics; (2) models: generalization errors of the best NN models we were able to produce given a certain amount of data and pre-defined network complexity; (3) policies: performance with the real benchmark dynamics of different policy types trained/selected according to the performance using the models from the left. For each policy setting, 10 training experiments were performed to obtain statistically meaningful results. The presented results for different data batch sizes show that the MC benchmark dynamics are rather easy to model using NNs. In addition, models having significantly greater errors with the generalization sets were still sufficient for training a fuzzy policy using FPSRL and selecting a well-performing policy from NFQ. 9 simulating the benchmark dynamics are useful for NFQ policy selection because NFQ training never observed the models during training and therefore was not prone to exploiting their weaknesses. can be expected to be compact and interpretable, the proposed FPSRL approach might be of interest to industry domain experts. The experimental results obtained with three standard RL benchmarks have demonstrated the advantages and limitations of the proposed model-based method compared with the well-known model-free NFQ approach. However, the results obtained with the CPB problem reveal an important limitation of FPSRL, i.e., training using weak approximation models. The proposed approach can exploit these weaknesses, which can potentially result in poor performance when evaluated using the real dynamics. Modeling techniques that can provide a measure of uncertainty in their predictions, such as Gaussian processes or Bayesian NNs, can possibly overcome these problems. Recent developments in modeling stochastic dynamic systems (Depeweg et al., 2016) may provide an approximation of the mean of the next system state but also compute uncertainty for transitions in the state-action space. In addition, continuous state and action spaces, as well as long time horizons, do not appear to introduce obstacles to the training of fuzzy policies. The resulting policies obtained with the CPSU benchmark performed significantly better than those generated by the standard NFQ. However, one of the most significant advantages of the proposed method over other RL methods is the fact that fuzzy rules can be easily and conveniently visualized and interpreted. We have suggested a compact and informative approach to present fuzzy rule policies that can serve as a basis for discussion with domain experts. The application of the proposed FPSRL approach in industry settings could prove to be of significant interest because, in many cases, data from systems are readily available and interpretable fuzzy policies are favored over black-box RL solutions, such as Q-function-based modelfree approaches. 7.3. Cart-pole Swing-up Compared to the MC and CPB benchmarks, the results for the CPSU benchmark show a completely different picture in terms of performance and the training process. Despite CPB and CPSU sharing the same underlying mathematical transition dynamics, they differ in the following two important aspects. First, discontinuities in the state transitions do not occur owing to the absence of a failure state area. Second, the planning horizon for a successful policy is significantly higher. While the latter makes it particularly difficult to find a solution by applying standard NFQ, the first property makes CPSU a good example of the strength of the proposed FPSRL approach. NFQ’s performance decreased dramatically for the CPSU problem (Table 3). For this benchmark with γ = 0.994 (q = 0.05), solutions with F ≈ 50 or greater with a set of 1,000 benchmark states uniformly sampled from [−π, π] × {0} × [−0.5, 0.5] × {0} were considered successful. The policies exhibiting such performance can swing-up more than 99% of the given test states. In our experiments, none of the NFQ trainings produced such a successful policy. In contrast, the proposed FPSRL could find a parameterization for successful policies using four fuzzy rules by assessing their performance on world models trained with data batch sizes of 10,000 or greater. For a data batch size of 1,000, the transition samples containing the goal area reward were far too few in the data set to model this area correctly. However, the extremely high errors obtained with the generalization set during model training are excellent indicators of this weakness. Figure 6 shows how even more complex fuzzy policies can be visualized and help make RL policies interpretable. Acknowledgment The project this report is based on was supported with funds from the German Federal Ministry of Education and Research under project number 01IB15001. The sole responsibility for the report’s contents lies with the authors. The authors would like to thank Dragan Obradovic and Clemens Otte for their insightful discussions and helpful suggestions. 8. Conclusion The traditional way to create self-organizing fuzzy controllers either requires an expert-designed fitness function according to which the optimizer finds the optimal controller parameters or relies on detailed knowledge regarding the optimal controller policy. Either requirement is difficult to satisfy when dealing with real-world industrial problems. However, data gathered from the system to be controlled using some default policy are available in many cases. The FPSRL approach proposed herein can use such data to produce high-performing and interpretable fuzzy policies for RL problems. Particularly for problems where system dynamics are rather easy to model from an adequate amount of data and where the resulting RL policy References Bakker, B., 2004. The state of mind: Reinforcement learning with recurrent neural networks. Ph.D. thesis, Leiden University, Netherlands. Breiman, L., Friedman, J., Olshen, R., Stone, C., 1984. Classification and Regression Trees. CRC Press, Boca Raton, FL. Busoniu, L., Babuska, R., De Shutter, B., Ernst, D., 2010. Reinforcement Learning and Dynamic Programming Using Function Approximation. CRC Press. 10 Rule 1: IF pole=right AND rotation=right AND cart=right AND speed=right THEN accelerate=positive. accelerate velocity -3 0 3 ρ̇ ρ θ̇ θ 1 1 1 1 0.5 0.5 0.5 0.5 0.5 0 -1 -1 0 0 1 0 -5 -5 1 (1) m 0 (s) · o 5 0 (1) 5 0 -2 0 0 -5 2 0 5 0 5 = 0.840 · 1.430 = 1.201 Rule 2: IF pole=left AND rotation=left AND cart=left AND speed=left THEN accelerate=negative. -3 0 3 1 1 1 1 0.5 0.5 0.5 0.5 0.5 0 -1 -1 0 0 1 1 m Example (2) 0 -5 -5 (s) · o 0 (2) 0 5 5 0 -2 0 0 -5 2 = 0.762 · −1.430 = −1.090 norm 10 norm = 5 0 π(s) = 10 · tanh (72.50 · norm) = 10.0 -5 -3 0 3 -10 -0.1 1.201 − 1.090 = 0.069 0.840 + 0.762 0 0.1 Figure 5: Fuzzy rules for the CPB benchmark. The visualization of a fuzzy policy can be useful for revealing the weaknesses of a given set of rules. For example, despite the presented policy being the result of successful FPSRL training and yielding high average returns for all test states, states at the boundary of the allowed cart position would result in failed episodes. The depicted example shows that state s = (0, 0, 2.3, 0) would activate rule 1; thus, it would accelerate the car even further positive and eventually end up in a failure state. Therefore, by examining only the rule set, the elementary weaknesses of the policy can be identified and the test state set can be adapted appropriately. Data Models Batch size Policies 1 layer 2 layers 3 layers FPSRL NFQ 1,000 θ θ̇ ρ ρ̇ r 1.57e-7 4.62e-2 4.32e-8 4.33e-2 2.09e-2 1.37e-7 6.03e-2 8.29e-8 1.33e-2 2.58e-2 1.07e-7 8.51e-3 1.29e-7 1.03e-1 1.11e-2 selected mean std -9.03 -14.59 5.34 -1.35 -1.82 0.54 10,000 θ θ̇ ρ ρ̇ r 5.95e-9 3.68e-2 9.98e-9 5.18e-2 1.22e-2 3.79e-8 1.07e-2 8.12e-7 4.16e-2 4.75e-4 2.84e-8 5.08e-3 4.82e-8 4.02e-2 6.17e-4 selected mean std -3.29 -3.30 0.02 -0.99 -1.18 0.23 100,000 θ θ̇ ρ ρ̇ r 5.73e-9 3.55e-2 2.91e-8 2.83e-2 5.86e-3 2.43e-8 1.25e-2 3.44e-8 2.43e-2 1.08e-4 2.69e-8 9.93e-3 1.41e-7 1.30e-2 9.03e-4 selected mean std -1.31 -1.31 8.97e-4 -1.81 -2.03 0.24 Table 2: Cart-pole balancing results. The experiments show that the modeling process of variables containing nonlinearities is difficult and requires an adequate amount of sample data. Since both the pendulum and the cart velocities suddenly become zero if the failure state is reached, the modeling process requires a certain number of these events in the training data to correctly model this effect. The results for a batch size of 1,000 show that a model that is not applicable to model-based RL can still be used for policy selection for a model-free RL technique such as NFQ. As the models’ errors reduce with increasing data batch sizes, FPSRL becomes increasingly capable of finding well-performing interpretable policies. Note that we encountered an effect that reduced NFQ performance can occur even if the data batch size increases. 11 Rule 1: IF pole=right AND rotation=right AND cart=left AND speed=left THEN accelerate=positive. accelerate velocity -4 0 ρ̇ ρ θ̇ θ 1 1 1 1 0.5 0.5 0.5 0.5 4 0 -2 0 0 -5 2 (1) m 1 0 (s) · o (1) 5 0 -5 0 5 = 0.101 1· 1.916 = 0.193 0 -5 0 5 1 Rule 2: IF pole=bottom AND rotation=zero AND cart=center right AND speed=right THEN accelerate=positive. -4 0 1 1 1 1 0.5 0.5 0.5 0.5 4 0 -2 0 0 -5 2 0 5 0 -5 0 5 1 m(2) (s) · o(2) = 0.847 1· 1.631 = 1.381 1 0 -5 0 5 1 Rule 3: IF pole=bottom AND rotation=zero AND cart=center left AND speed=left THEN accelerate=negative. -4 0 1 1 1 1 0.5 0.5 0.5 0.5 4 0 -2 0 m 1 0 -5 2 (3) (s)1 · o 0 (3) 5 0 -5 0 5 0 -5 0 5 0 5 1 = 0.728 · −1.631 = −1.1881 Rule 4: IF pole=left AND rotation=left AND cart=right AND speed=right THEN accelerate=negative. -4 0 1 1 1 1 0.5 0.5 0.5 0.5 4 0 -2 0 0 -5 2 m Example (4) (s) · o (4) 5 0 -5 0 5 0 -5 = 0.0 · −1.916 = 0.0 norm 20 norm = 0 -4 0 0 4 -20 -0.2 0 0.2 0.193 + 1.381 − 1.188 = 0.23 0.101 + 0.847 + 0.728 π(s) = 30 · tanh (14.16 · norm) = 29.91 Figure 6: Fuzzy rules for CPSU benchmark. Even with four rules, fuzzy policies can be visualized in an easily interpretable way. By inspecting the prototype cart-pole diagrams for each rule, two basic concepts can be identified for accelerating in each direction. First (Rule 1 (4)): the cart’s position is on the left (right) and moving further to the left (right), while the pole is simultaneously falling on the right (left). Then the cart is accelerated towards the right (left). Second (Rule 2 (3)): the cart is between the center and the right (left) and the pole is hanging down. Then the cart is accelerated towards the right (left). Both prototypes are utilized to realize the complex task of swinging the pole up. Balancing of the pole while the cart is centered around ρ = 0 is realized via fuzzy interaction of these prototype rules, as shown in the example in the last row. 12 Data Models Batch size Policies 1 layer 2 layers 3 layers FPSRL NFQ 1,000 θ θ̇ ρ ρ̇ r 2.02e-4 2.93e-3 2.27e-5 9.85e-4 5.00 2.61e-6 4.65e-4 1.44e-5 9.90e-5 5.07 3.07e-6 5.78e-4 1.85e-5 1.13e-3 5.06 selected mean std -157.49 -156.53 2.30 -153.59 -156.43 1.64 10,000 θ θ̇ ρ ρ̇ r 3.23e-6 9.86e-5 3.06e-6 1.13e-5 1.68e-1 2.17e-6 7.88e-5 1.48e-6 8.83e-6 5.05e-2 2.31e-6 3.65e-4 2.08e-6 3.39e-5 9.42e-2 selected mean std -34.03 -53.82 12.01 -134.82 -153.63 6.69 100,000 θ θ̇ ρ ρ̇ r 2.00e-6 2.63e-4 8.83e-6 2.47e-5 1.95e-1 3.07e-6 5.62e-4 1.23e-5 6.46e-5 4.76e-3 2.56e-6 3.38e-4 4.81e-5 2.28e-5 7.77e-3 selected mean std -32.42 -53.22 11.17 -150.93 -152.66 2.26 Table 3: Cart-pole swing-up results. High errors with the generalization set when training the reward function with a data batch size of less than 10,000 clearly indicate the absence of an adequate number of transition samples that describe the effects noted when reaching the goal area. Smooth and easy dynamics in the other dimensions make it rather easy to model the CPSU dynamics and subsequently use them to conduct model-based RL. Note that the long planning time horizon required in this benchmark made it impossible to learn successful policies with the standard NFQ. IEEE Transactions on Systems, Man & Cybernetics 23 (3), 665– 685. Kennedy, J., Eberhart, R., 1995. Particle swarm optimization. Proceedings of the IEEE International Joint Conference on Neural Networks, 1942–1948. Kharola, A., Gupta, P., 2014. Stabilization of inverted pendulum using hybrid adaptive neuro fuzzy (ANFIS) controller. Engineering Science Letters 4, 1–20. Kothandaraman, R., Ponnusamy, L., 2012. PSO tuned adaptive neuro-fuzzy controller for vehicle suspension systems. Journal of Advances in Information Technology 3 (1). Lagoudakis, M., Parr, R., 2003. Least-squares policy iteration. Journal of Machine Learning Research, 1107–1149. Lam, J., Zhou, S., 2007. Dynamic output feedback H∞ control of discrete-time fuzzy systems: a fuzzy-basis-dependent lyapunov function approach. International Journal of Systems Science 38 (1), 25–37. Maes, F., Fonteneau, R., Wehenkel, L., Ernst, D., 2012. Policy search in a space of simple closed-form formulas: towards interpretability of reinforcement learning. Discovery Science, 37–50. Mamdani, E., Assilian, S., 1975. An experiment in linguistic synthesis with a fuzzy logic controller. International Journal of ManMachine Studies 7 (1), 1–13. Neuneier, R., Zimmermann, H.-G., 2012. How to train neural networks. In: Montavon, G., Orr, G., Müller, K.-R. (Eds.), Neural Networks: Tricks of the Trade, Second Edition. Springer, pp. 369– 418. Ormoneit, D., Sen, S., 2002. Kernel-based reinforcement learning. Machine learning 49 (2), 161–178. Procyk, T., Mamdani, E., 1979. A linguistic self-organizing process controller. Automatica 15, 15–30. Rasmussen, C., Williams, C., 2006. Gaussian Processes for Machine Learning. Adaptative computation and machine learning series. University Press Group Limited. Riedmiller, M., 2005a. Neural fitted Q iteration — first experiences with a data efficient neural reinforcement learning method. In: Machine Learning: ECML 2005. Vol. 3720. Springer, pp. 317–328. Riedmiller, M., 2005b. Neural reinforcement learning to swing-up Casillas, J., Cordon, O., Herrera, F., Magdalena, L., 2003. Interpretability improvements to find the balance interpretabilityaccuracy in fuzzy modeling: an overview. In: Interpretability issues in fuzzy modeling. Springer, pp. 3–22. Debnath, S., Shill, P., Murase, K., 2013. Particle swarm optimization based adaptive strategy for tuning of fuzzy logic controller. International Journal of Artificial Intelligence & Applications 4 (1), 37–50. Depeweg, S., Hernández-Lobato, J. M., Doshi-Velez, F., Udluft, S., 2016. Learning and policy search in stochastic dynamical systems with bayesian neural networks. arXiv preprint arXiv:1605.07127. Eberhart, R., Simpson, P., Dobbins, R., 1996. Computational intelligence PC tools. Academic Press Professional, Inc., San Diego, CA, USA. Ernst, D., Geurts, P., Wehenkel, L., 2005. Tree-based batch mode reinforcement learning. Journal of Machine Learning Research 6, 503–556. Fantoni, I., Lozano, R., 2002. Non-linear control for underactuated mechanical systems. Springer. Feng, H.-M., 2005a. Particle swarm optimization learning fuzzy systems design. In: Third International Conference on Information Technology and Applications, 2005. ICITA 2005. Vol. 1. Piscataway, New Jersey: Institute of Electrical and Electronics Engineers, pp. 363–366. Feng, H.-M., 2005b. Self-generation fuzzy modeling systems through hierarchical recursive-based particle swarm optimization. Cybernetics and Systems 36 (6), 623–639. Gordon, G., 1995. Stable function approximation in dynamic programming. In: Proceedings of the Twelfth International Conference on Machine Learning. Morgan Kaufmann, pp. 261–268. Hanafy, T., 2011. Design and validation of real time neuro fuzzy controller for stabilization of pendulum-cart system. Life Science Journal 8 (1), 52–60. Hein, D., Hentschel, A., Runkler, T., Udluft, S., 2016. Reinforcement learning with particle swarm optimization policy (PSO-P) in continuous state and action spaces. International Journal of Swarm Intelligence Research (IJSIR) 7 (3), 23–42. Jang, J., 1993. Adaptive-network-based fuzzy inference system. 13 and balance a real pole. In: Systems, Man and Cybernetics, 2005 IEEE International Conference on. Vol. 4. pp. 3191–3196. Riedmiller, M., Gabel, T., Hafner, R., Lange, S., 2009. Reinforcement learning for robot soccer. Autonomous Robots 27 (1), 55–73. Saifizul, A., Azlan, C., Mohd Nasir, N., 2006. Takagi-Sugeno fuzzy controller design via ANFIS architecture for inverted pendulum system. In: Proceedings of International Conference on ManMachine Systems. Schäfer, A. M., 2008. Reinforcement learning with recurrent neural networks. Ph.D. thesis, University of Osnabrück, Germany. Schäfer, A. M., Udluft, S., Zimmermann, H.-G., 2007. A recurrent control neural network for data efficient reinforcement learning. In: Proceedings of IEEE Symposium on Adaptive Dynamic Programming and Reinforcement Learning. pp. 151–157. Scharf, E., Mandve, N., 1985. The application of a fuzzy controller to the control of a multi-degree-freedom robot arm. In: Sugeno, M. (Ed.), Industrial Application of Fuzzy Control. North-Holland, pp. 41–62. Schneegass, D., Udluft, S., Martinetz, T., 2007a. Improving optimality of neural rewards regression for data-efficient batch nearoptimal policy identification. In: Proceedings the International Conference on Artificial Neural Networks. pp. 109–118. Schneegass, D., Udluft, S., Martinetz, T., 2007b. Neural rewards regression for near-optimal policy identification in Markovian and partial observable environments. In: Proceedings the European Symposium on Artificial Neural Networks. pp. 301–306. Shao, S., 1988. Fuzzy self-organizing controller and its application for dynamic processes. Fuzzy Sets and Systems 26, 151–164. Silver, D., Lever, G., Heess, N., Degris, T., Wierstra, D., Riedmiller, M., 2014. Deterministic policy gradient algorithms. In: Proceedings of the 31st International Conference on International Conference on Machine Learning - Volume 32. ICML’14. JMLR.org, pp. I–387–I–395. Sutton, R., 1988. Learning to predict by the methods of temporal differences. Machine learning 3 (1), 9–44. Sutton, R., Barto, A., 1998. Reinforcement learning: an introduction. A Bradford book. Van Hasselt, H., Guez, A., Silver, D., 2016. Deep reinforcement learning with double Q-learning. In: 30th AAAI Conference on Artificial Intelligence, AAAI 2016. pp. 2094–2100. Wang, L.-X., Mendel, J., 1992. Fuzzy basis functions, universal approximation, and orthogonal least-squares learning. IEEE Transactions on Neural Networks 3 (5), 807–814. Yang, H., Li, X., Liu, Z., Hua, C., 2013. Fault detection for uncertain fuzzy systems based on the delta operator approach. Circuits, Systems, and Signal Processing 33 (3), 733–759. Yang, H., Li, X., Liu, Z., Zhao, L., 2014a. Robust fuzzy-scheduling control for nonlinear systems subject to actuator saturation via delta operator approach. Information Sciences 272, 158–172. Yang, H., Shi, P., Li, X., Li, Z., 2014b. Fault-tolerant control for a class of T-S fuzzy systems via delta operator approach. Signal Process. 98, 166–173. Zadeh, L., 1965. Fuzzy sets. Information and Control 8, 338–353. Data: • N randomly initialized d-dimensional particle positions with xi = yi and velocities vi of particle i, where i = 1, . . . , N • Fitness function F (Eq. (2)) • Inertia weight factor w and acceleration constants c1 and c2 • Random number generator rand() • Search space boundaries xmin and xmax • Velocity boundaries vmin = −0.1 · (xmax − xmin ) and vmax = 0.1 · (xmax − xmin ) • Swarm topology graph defining neighborhood Ni Result: • Global best position ŷ repeat foreach Particle i do Neighborhood best position of particle i (Eq. (7)); ŷi ← arg maxz∈{yj | j∈Ni } F(z); end Position updates; foreach Particle i do Determine new velocity of particle i (Eq. (9)); for j = 1, . . . , d do vij ← wvij + c1 · rand() · [yij − xij ] + c2 · rand() · [ŷij − xij ]; end Truncate particle i’s velocity; for j = 1, . . . , d do vij ← min(vmaxj , max(vminj , vij )) end Compute new position of particle i (Eq. (8)); xi ← xi + vi ; Truncate particle i’s position; for j = 1, . . . , d do xij ← min(xmaxj , max(xminj , xij )) end Personal best positions (Eq. (10)); if F(xi ) > F(yi ) then Set new personal best position of particle i; yi ← xi ; end end until Stopping criterion is met; Determine the global best position; ŷ ← arg maxz∈{y1 ,...,yN } F(z); return ŷ Appendix A. PSO Algorithm Algorithm 1 explains in pseudocode the PSO algorithm applied in our experiments. Appendix B. Experimental Setup Algorithm 1: PSO algorithm. Particle i is represented by position xi , personal best position yi , and neighborhood best position ŷi . Table B.4 gives a compact overview of the parameters used for the experiments presented herein. Note that extensive parameter studies for both FPSRL and NFQ are beyond the scope of this paper. Nevertheless, we evaluated various parameters known from the literature or our own 14 MC CPB CPSU Benchmark State dimensionality D Time horizon T Discount factor γ 2 200 0.9851 4 100 0.9700 4 500 0.9940 FPSRL Number of particles N PSO iterations PSO topology Number of rules C Rule parameters |x| Actions 100 1,000 ring 2 11 [−1, 1] 100 1,000 ring 2 10 [−10, 10] 1,000 1,000 ring 4 19 [−30, 30] 1,000 300 3-20-20-1 sigmoid {−1, 0, 1} 1,000 300 5-20-20-1 sigmoid {−10, 0, 10} 1,000 300 5-20-20-20-1 sigmoid {−30, 0, 30} NFQ Q iterations NN epochs NN layers NN activation Actions Table B.4: Experimental setup. experience, and we noted that the presented setup was the most successful of all the setups tested in our experiments. 15
3cs.SY
arXiv:1510.07790v1 [math.OC] 27 Oct 2015 Distributed Real-Time Non-Linear Receding Horizon Control Methodology for Multi-Agent Consensus Problems Fei Suna,∗, Kamran Turkoglua a Aerospace Engineering, San José State University, San Jose, CA 95192 Abstract This work investigates the consensus problem for multi-agent nonlinear systems through the distributed real-time nonlinear receding horizon control methodology. With this work, we develop a scheme to reach the consensus for nonlinear multi agent systems under fixed directed/undirected graph(s) without the need of any linearization techniques. For this purpose, the problem of consensus is converted into an optimization problem and is directly solved by the backwards sweep Riccati method to generate the control protocol which results in a non-iterative algorithm. Stability analysis is conducted to provide convergence guarantees of proposed scheme. In addition, an extension to the leader-following consensus of nonlinear multi-agent systems is presented. Several examples are provided to validate and demonstrate the effectiveness of the presented scheme and the corresponding theoretical results. Keywords: multi-agent consensus problems, leader-following consensus problems, nonlinear receding horizon control, real-time optimization 1. INTRODUCTION With their sophisticated structure, multi-agent related consensus problems have attracted significant interest in recent years. The complex nature and sophisticated framework of multi agent consensus problem serves as a fertile ∗ Email: [email protected] Preprint submitted to Elsevier March 22, 2018 ground for the application of advanced control algorithms, and found basis in many areas including cooperative control, formation control, flocking and rendezvous [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]. So far, the consensus methodologies have been widely explored for multiagent linear dynamical systems [14, 15, 16]. However, most physical systems are nonlinear in their nature or even exhibit the phenomenon of chaos. The combination of consensus and nonlinear dynamics remains as a major challenge in literature, although some preliminary results have been presented in recent years. For instance, in the work of [17], a new rule was introduced for nonlinear protocol design allowing consensus on a general set of values. In [18], the investigation was concentrated on nonlinear cooperative control for consensus of nonlinear and heterogeneous systems. [19] discussed the problem of consensus for multi-agent systems with inherent nonlinear dynamics under directed topologies, where a variable transformation method is used to convert the consensus problem to a partial stability problem. [20] studied the leader-following consensus of nonlinear multi-agent systems without the assumption that the topology is connected or fixed. On the other hand, Receding Horizon Control based methodologies gained significant momentum in the last two decades which are used to obtain an optimal feedback control law by minimizing the desired performance index for a given finite horizon. In that sense, receding horizon control is one of the powerful methodologies that is adapted to consensus problem of multi-agent dynamics. Based on this approach, there have been many results developed for consensus problems and its applications. The work of [21] presented a distributed receding horizon control law for dynamically coupled nonlinear systems based on its linearization representative. The robust distributed receding horizon control methods were studied in [22] for nonlinear systems with coupled constraints and communication delays. [23] proposed a robust distributed model predictive control methods for nonlinear systems subject to external disturbances. In a very recent study [24], brain-storm type of optimization was combined with receding horizon control strategies for UAV formation flight dynamics. 2 Most of the previously conducted studies on nonlinear consensus problem either employ some sort of adaptation mechanisms (through adaptive control methodologies) or simplistic linearization methods. In this paper, we propose a scheme for solving nonlinear consensus problem by utilizing the real-time nonlinear receding horizon control (NRHC) methodology, which avoids such pitfall and utilizes complete architecture of the nonlinear system. For a given fixed directed/undirected network, the nonlinear consensus problem is converted to an optimization framework and the control protocol is designed locally for each agent by real-time nonlinear receding horizon control algorithm which is an important extension to the existing literature and presents the novelty of proposed NRHC procedure. Here, a non-iterative optimization algorithm is applied to avoid high computational complexity and large data storage. During this process, each agent only needs to obtain its neighbor’s state once via the given network at each time instant, which is more efficient than the other distributed strategies that involve multiple information exchanges and predicted trajectories of states. This presents the second major novelty proposed with this approach. With this formulation, we also provide asymptotic stability guarantees to achieve consensus within the given topology. The proposed scheme is then extended to the leader-following consensus problem of nonlinear multi-agent systems. The effective nature of the proposed methodology is demonstrated through several examples with different topologies. With this approach, we demonstrate the applicability of the distributed real-time nonlinear receding horizon control as a consensus routine on the nonlinear multi-agent systems. The organization of the paper is as following: In Section-2, some preliminaries and problem statement of the distributed real-time nonlinear receding horizon control is presented for nonlinear consensus dynamics. The framework and the detailed control design are investigated in Section-3. Stability analysis is discussed in Section-4. In Section-6, theoretical aspects of the proposed methodology are applied on Lorenz oscillators and Lü oscillators examples. And with Section-7, the paper is concluded. 3 2. PRELIMINARIES AND PROBLEM STATEMENT In this section, we introduce the notation used throughout this paper and we provide a broad definition of the main problem studied. Later on, we present algorithms for solving this problem. In this work, R denotes the real space. For a real matrix A, its transpose and inverse are denoted as AT and A−1 , respectively. The symbol ⊗ represents the Kronecker product. For matrices X and P , the Euclidean norm of X is denoted √ P by kXk and the P -weighted norm of X is denoted by kXkP = X T P X. In stands for the identity matrix of dimension n. Given a matrix P , P > 0 (P < 0) represents that the matrix is positive definite (or negative definite). Here, we define the column operation col(x1 , x2 , · · · , xn ) as (xT1 , xT2 , · · · , xTn )T where x1 , x2 , · · · , xn are column vectors. Consider a multi-agent system of M nonlinear agents. For each agent i, the dynamic system is given by: ẋi = f (xi , x−i , t) = F(xi ) + ui , (1) where xi = (xi1 , xi2 , · · · , xin )T is the state vector of the ith oscillator, x−i are the collection of agent i’s neighbor’s states, the function F(·) is the corresponding nonlinear vector field, and ui is the control input of agent i. Here, function F(·) satisfies the global Lipschitz condition. Therefore there exists positive constant βi such that kF(xi ) − F(xj )k ≤ βi kxi − xj k. This condition is satisfied if the Jacobians ∂Fi ∂xi are uniformly bounded. There exists a communication network among these agents and the network can be described as an undirected or directed graph G = (V, E, C). Here V = {1, 2, · · · , M } denotes the node set and E ⊂ V × V denotes the edge set. A = [aij ] ∈ RM ×M is the adjacency matrix. In this framework, if there exists a connection between i and j nodes(agents), then aij > 0; otherwise, aij = 0. We assume there is no self-circle in the graph G, i.e., aii = 0. A path is a sequence of connected edges in a graph. If there is a path between any two nodes, the graph 4 is said to be connected. If A is a symmetric matrix, G is called an undirected graph. The set of neighbors of node i is denoted by Ni = {j|(i, j) ⊂ E}. The PM −1 in-degree of agent i is denoted as degi = j=1 aij and the degree matrix is denoted as D = diag(deg1 , · · · , degM ). The Laplacian matrix of G is described as L = D − A. Definition-1: The nonlinear multi-agent system in (1) with a given network topology G, and under a distributed control protocol ui = µ(xi , x−i ), is said to achieve consensus if, lim = kxi (t) − xj (t)k = 0, j = 1, · · · , M, t→∞ (2) where x−i are the collection of agent i’s neighbor’s states, i.e., x−i = {xj , j ∈ Ni }. With this in mind, in this specific work, we are interested in designing the distributed control strategy ui = µ(xi , x−i ) using the real-time nonlinear receding horizon control methodology for each agent i to achieve consensus, within the given network topology. 3. DISTRIBUTED NONLINEAR RECEDING HORIZON CONTROL PROTOCOL In this presented framework, for each agent i, the following optimization problem is utilized to generate the consensus protocol locally, within the network: Problem-1: u∗i (t) = argmin Ji (xi (t), ui (t), x−i (t)) ui (t) subject to ẋi (t) = F(xi (t)) + ui (t), 5 (3) The performance index is designed as follows: Ji = ϕi + = X 1 2 Z t+T Li (xi , x−i , ui ), t aij kxi (t + T ) − xj (t + T )k2QiN j∈Ni 1 + 2 Z t+T ( t X aij kxi (τ ) − xj (τ )k2Qi + kui k2Ri )dτ, j∈Ni (4) where QiN > 0, Qi > 0 and Ri > 0 are symmetric matrices, and T is the horizon. We denote ϕi to describe the terminal cost for each agent. Here, we utilize a control scheme to be able to deal with the nonlinear nature of the graph under scrutiny. With this, it is desired to solve the nonlinear optimization problem directly, in real-time. With the construction of the cost function, as given in (4), the consensus problem is converted into an optimization procedure. For this purpose, we utilize the powerful nature of real-time nonlinear receding horizon control algorithm to generate the distributed consensus protocol by minimizing the associated cost function. In this context, each agent only needs to obtain its neighbors’ information once via the given network which is more efficient than the centralized control strategy (and the other distributed strategies) that involve multiple information exchanges and predicted trajectories of states. The performance index evaluates the performance from the present time t to the finite future t + T , and then is minimized for each time segment t starting from xi (t). With this structure, it is possible to convert the present receding horizon control problem into a family of finite horizon optimal control problems on the artificial τ axis parameterized by time t. According to the first-order necessary conditions of optimality (i.e. for δJi = 0), a local two-point boundary-value problem (TPBVP) [25] is formed as follows: 6 Λi ∗τ (τ, t) = −HxTi , Λ∗i (T, t) = ϕTxi [x∗ (T, t)], (5) T xi ∗τ (τ, t) = HΛ , x∗i (0, t) = xi (t), i Hui = 0. where Λi denotes the costate of each agent i and Hi is the Hamiltonian which is defined as Hi = Li + Λ∗T i ẋi X 1 aij kxi (τ ) − xj (τ )k2Qi + kui k2Ri ) + Λ∗T = ( i (F(xi ) + ui ). 2 (6) j∈Ni Then we have Λi ∗τ (τ, t) = −[ X Qi aij (xi (τ ) − xj (τ )) + ΛTi Fxi (xi )], j∈Ni Λ∗i (T, t) = X (7) QiN aij (xi (τ ) − xj (τ )). j∈Ni In (5)-(7), ( )∗ denotes a variable in the optimal control problem so as to distinguish it from its correspondence in the original problem. In this notation, Hxi denotes the partial derivative of H with respect to xi , and so on. In this methodology, since the state and costate at τ = T are determined by the TPBVP in Eq.(5) from the state and costate at τ = 0, the TPBVP can be regarded as a nonlinear algebraic equation with respect to the costate at τ = 0 as Pi (Λi (t), xi (t), T, t) = Λ∗i (T, t) − ϕTxi [x∗i (T, t)] = 0, (8) where Λi (t) denotes the costate at τ = 0. The actual local control input for each agent is then given by ui (t) = arg{Hui [xi (t), Λi (t), ui (t)] = 0}. (9) In this formulation, the optimal control ui (t) can be calculated from Eq.(9) based on xi (t) and Λi (t) where the ordinary differential equation of λ(t) can be 7 solved numerically from Eq.(8), in real-time, without any need of an iterative optimization routine. Since the nonlinear equation Pi (Λi (t), xi (t), T, t) has to be satisfied at any time t, dPi dt = 0 holds along the trajectory of the closed-loop system of the receding horizon control. If T is a smooth function of time t, the solution of Pi (Λi (t), xi (t), T, t) can be tracked with respect to time. However, numerical errors associated with the solution may accumulate as the integration proceeds in practice, and therefore some correction techniques are required to correct such errors in the solution. To address this problem, a stabilized continuation method [26, 27, 28, 29] is used. According to this method, it is possible to rewrite the statement as dPi = As P i , dt (10) where As denotes a stable matrix to make the solution converge to zero exponentially. To evaluate the optimal control by computing derivative of Λi (t) = Λ∗i (0, t) in real time, we consider the partial differentation of (5) with respect to time t, δ ẋi = fxi δxi + fui δui , δ Λ̇i = −Hxi xi δxi − Hxi Λi δΛi − Hxi ui δui (11) 0 = Hui xi δxi + fuTi δΛi + Hui ui δui . Since δui = −Hu−1 (Hui xi δxi + fuTi δΛi ), we have i ui δ ẋi = (fxi − fui Hu−1 Hui ui )δxi − fui Hu−1 f T δΛi , i ui i ui ui δ Λ̇i = −(Hxi xi − Hxi ui Hu−1 Hui xi )δxi − (fxTi − Hxi ui Hu−1 f T )δΛi , i ui i ui ui which leads to the following form of a linear differential equation:      −Bi xi ∗t − xi ∗τ ∂  xi ∗t − xi ∗τ   Ai   = ∗ ∗ T ∂τ Λi ∗ − Λi ∗ −C −A Λ − Λ i i i t τ t τ i where Ai = fxi − fui Hu−1 Hui xi , i ui Bi = fui Hu−1 fT , i ui ui 8 (12) Ci = Hxi xi − Hxi ui Hu−1 Hui xi . i ui And the matrix Hui ui should be nonsingular. In order to reduce the computational cost without resorting to any approximation technique, the backward-sweep method [25, 28, 29] is implemented. The derivative of the function Pi with respect to time is given by dPi dT =Λi ∗t (T, t) − ϕxi xi xi ∗t (T, t) + [Λi ∗τ (T, t) − ϕxi xi xi ∗τ (T, t)] , dt dt (13) where x∗τ and Λi ∗τ are given by (5). The relationship between the costate and other variables is assumed as follows: Λi ∗t − Λi ∗τ = Si (τ, t)(xi ∗t − xi ∗τ ) + ci (τ, t). (14) So we have Si (T, t) = ϕxi xi |τ =T , ci (T, t) = (HxTi + ϕxi xi f ) |τ =T (1 + dT ) + As P i . dt (15) Then according to (14) and (12), we have the following differential equations: ∂Si = −ATi Si − Si Ai + Si Bi Si − Ci , ∂τ ∂ci = −(ATi − Si Bi )ci . ∂τ (16) Based on (14), the differential equation of the costate to be integrated in real time is obtained as: dΛi (t) = −HxTi + ci (0, t). dt (17) Here, at each time t, the TPBVP equations are integrated forward along the τ axis, and then (16) are integrated backward with terminal conditions provided in (15). Next, the differential equation of Λi (t) is integrated for one step along the t axis so as to update the local optimal controller for each agent. If the matrix Hui ui is nonsingular, the algorithm is executable regardless of controllability or stabilizability of the system. 9 Lemma-1: The cost function, defined in Eq. (4), is strictly convex and guarantees the global minimum. Proof : Since all weighting functions maintain positive definite nature in their structure, such as QiN > 0, Qi > 0, Ri > 0, from the Karush-KuhnTucker(KKT) conditions [30], the proposed method gurantees the global minima.  4. CONVERGENCE AND STABILITY ANALYSIS For the sake of clarity, and without loss of generality, here we define the consensus error as δ1 (t) = xi (t) − x1 (t) for all i and ∆(t) = col(δ1 (t), δ2 (t), · · · , δM (t)). The optimal control U is denoted as U = col(u1 , · · · , uM ) for all i. The cost function can be written as Z 1 t+T ∗T J =Φ+ [∆ Q∆∗ + U∗T RU∗ ]dτ, 2 t P where Φ = i∈M ϕi , Q = col(Q1 , · · · , QM ) and R = col(R1 , · · · , RM ). (18) In order to ensure the closed-loop stability of the proposed nonlinear receding horizon control scheme, we first consider the case that terminal cost Φ = 0 and introduce following definitions. In this regard, we assume the sublevel sets ∞ ∗ Γ∞ : J∞ < r2 } r = {∆ ∈ Γ ∗ are compact and path connected where J∞ = R∞ 0 [∆∗T Q∆∗ + U∗T RU∗ ]dτ and 2 moreover Γ∞ = ∪r≥0 Γ∞ r . We use r here to reflect the fact that the cost function is quadratically bounded. And therefore the sublevel set of ΓTr = {∆ ∈ R t+T Γ∞ : JT∗ < r2 } where JT∗ = t [∆∗T Q∆∗ + U∗T RU∗ ]dτ . Lemma-2: (Dini [31] ) Let {fn } be a sequence of upper semi-continuous, real-valued functions on a countably compact space X, and suppose that for 10 each x ∈ X, the sequence {fn (x)} decreases monotonically to zero. Then the convergence is uniform. Theorem-1: [31] Let r be given as r > 0 and suppose that the terminal cost is equal to zero. For each sampling time ts > 0, there exists a horizon window T ∗ < ∞ such that, for any T > T ∗ , the receding horizon scheme is asymptotically stabilizing. Proof. By the principle of optimality, we have Z t+ts ∗ ∗T ∗ ∗ ∗ (∆∗T JT∗ (∆) = T Q∆T + UT RUT )dτ + JT −ts (∆T ) t where ts ∈ [t, t + T ] is the sampling time and Jt∗s (∆) = R t+ts t ∗ (∆∗T T Q∆T + ∗ U∗T T RUT )dτ , so that JT∗ −ts (∆∗T ) − JT∗ −ts (∆) = JT∗ (∆) − JT∗ −ts (∆) − ≤ Jt∗s (∆) + JT∗ (∆) − Z t+ts ∗ ∗T ∗ (∆∗T T Q∆T + Θ̂T RΘ̂T )dτ t JT∗ −ts (∆) Since the terminal cost is equal to zero, it is clear that T1 < T2 . This implies that JT∗1 (∆) < JT∗2 (∆) holds for all ∆ so that ∗ JT∗ −ts (∆∗T ) − JT∗ −ts (∆) ≤ Jt∗s (∆) + J∞ (∆) − JT∗ −ts (∆). is satisfied. If we can show, for example, that there exists a T ∗ such that T > T ∗ yields into ∗ J∞ (∆) − JT∗ −ts (∆) ≤ 1 ∗ J (∆) 2 ts ∗ for all ∆ ∈ Γ∞ r , stability over any sublevel set of JT −ts (·) that is contained in ∞ Γ∞ r will be assured. To that end, define, for ∆ ∈ Γr ψT (∆) =  ∗ ∗  T −ts (∆)  J∞ (∆)−J , ∗ ∆ 6= 0  lim sup ∆=0 Jts (∆) x→0 ψT (∆), where ψT (·) is upper semicontinuous on Γ∞ r . It is clear that ψT (·) is a monotonically decreasing family of upper semicontinuous functions defined over the compact set Γ∞ r . Thus, by Dini’s theorem (as stated in [31]), there exists a 11 T ∗ < ∞ such that ψT (∆) < 1 2 ∗ for all ∆ ∈ Γ∞ r and all T ≥ T . Here, for each r1 > 0 we have ΓTr1−ts ⊂ Γ∞ r satisfied, leading to 1 JT∗ −ts (∆∗T ) − JT∗ −ts (∆) ≤ − Jt∗s (∆) 2 for all ∆ ∈ ΓrT1−ts .  Next, we present the closed-loop stability of the proposed nonlinear receding P horizon control scheme with locally quadratic terminal cost, i.e. Φ = i∈M ϕi . Theorem-2: [31] Let r be given as r > 0 and suppose that the terminal cost is nonnegative and locally quadratically bounded. For each sampling time ts > 0, there exists a horizon window T ∗ < ∞ such that, for any T > T ∗ , the receding horizon scheme is asymptotically stabilizing. ∗ (·) to denote the cost function with zero terminal cost and Proof. We use JT,0 ∗ JT,1 (·) to denote the cost function with locally quadratic terminal cost. It is clear to show that ∗ ∗ JT,0 (∆) ≤ JT∗ (∆) ≤ JT,1 (∆), and then ∗ ∗ ∗ ∗ ∗ |JT∗ (∆) − J∞ (∆)| ≤ max{J∞ (∆) − JT,0 (∆), JT,1 (∆) − J∞ (∆)}, ∗ ∗ for all ∆ ∈ Γ∞ r so that JT (·) also converge uniformly to J∞ (·) with respect to any locally quadratic positive definite terminal cost. The theorem uses the results of Theorem-1.  Corollary-1: Consider the nonlinear multi-agent system given in Eq.(1) and assume that the graph G, defining the topology of the multi agent system, is connected. For the given distributed control protocol in Problem-1, based on Theorem-2, there exists a large enough value of horizon T which guarantees the consensus error ∆ to remain asymptotically stable to achieve consensus in the multi-agent system. 12 Although the back-ward sweep algorithm is executable whenever the system is stable or not, with this result, when the optimization horizon is chosen to be sufficiently long, the non-increasing monotonicity of the cost function becomes a sufficient condition for the stability. Therefore, we can also ensure the stability of the multi-agent nonlinear system by distributed nonlinear receding horizon control method. 5. EXTENSION TO LEADER-FOLLOWING CASE In this section, we extend the proposed scheme to the leader-following consensus problem(s). Assume a multi-agent system consisted of M nonlinear agents and a leader. The dynamics of each agent is given in Eq. (1) and the leader, indexed as i = 0, has the following dynamical system structure: ẋ0 = f (x0 , t) = F(x0 (t)), (19) where x0 = (x01 , x02 , · · · , x0n )T is the state vector. To describe the connection between the leader and the followers in G, a leader adjacency matrix A0 = diag(a10 , · · · , aM 0 ), where ai0 > 0 if follower i is connected to the leader, otherwise ai0 = 0. Then a new augmented matrix H = A + A0 is defined. Definition-2: The nonlinear multi-agent system in (1) and (19) with a given network topology G, and under a distributed control protocol ui = µ(x0 , xi , x−i ), is said to achieve the leader-following consensus such that all M follower agents converge to the leader, if, lim = kxi (t) − x0 (t)k = 0, i = 1, · · · , M, t→∞ (20) where x−i are also the collection of agent i’s neighbor’s states, i.e., x−i = {xj , j ∈ Ni }. According to the presented framework, next, we are interested in designing the distributed control strategy ui = µ(x0 , xi , x−i ) using the abovementioned real-time nonlinear receding horizon control methodology for each agent i to achieve leader-following consensus, within the given network topology. 13 Similarly, for each following agent i, the following optimization problem is utilized to generate the consensus protocol locally, within the network: Problem-2: u∗i (t) = argminJi (x0 , xi , ui , x−i ) (21) subject to   ẋ0 (t) = F(x0 (t)),  ẋi (t) = F(xi (t)) + ui (t), The corresponding performance index is designed as follows: Z 1 t+T Ji =ϕi + Li (xi , x0 , x−i , ui ), 2 t X X = ci0 kxi (t + T ) − x0 (t + T )k2Qi0 + cij kxi (t + T ) − xj (t + T )k2QiN i∈M + 1 2 j∈Ni t+T Z ( t X cij kxi (τ ) − xj (τ )k2Qi + kui k2Ri )dτ, j∈Ni (22) where the terminal cost ϕi = T ) − xj (t + T )k2QiN , P i∈M ci0 kxi (t+T )−x0 (t+T )k2Qi0 + P j∈Ni cij kxi (t+ Qi0 > 0, QiN > 0, Qi > 0 and Ri > 0 are symmetric ma- trices, and T is also the horizon. We utilize the same framework and algorithm as in Section-3 to solve the nonlinear leader-following consensus problem directly. In addition, when the optimization horizon is chosen to be sufficiently long, the non-increasing monotonicity of the cost function becomes a sufficient condition for the stability. 6. NUMERICAL EXAMPLE AND SIMULATION RESULTS In this section, we demonstrate the validity and feasibility of proposed scheme on several multi-agent nonlinear chaotic systems. Example-1: First, consider a multi-agent system with 5 agents (as shown 14 in Fig. 1), where each agent is modeled as the Lorenz chaotic system [32]:    ẋi1 = 10(xi2 − xi1 ),    (23) ẋi2 = 28xi1 − xi1 xi3 − xi2 ,     ẋ = x x − 8 x , i3 i1 i2 3 i3 where xi = (xi1 , xi2 , xi3 )T are the state of the i-th agent. The adjacency matrix A of G is given as  0   1   0   1  1 0 1 0 0 1 0 1 0 1 0 0 0 0 0 0 Here, the initial states are given by    1 2 xi1 (0)       xi2 (0) = 10 −1    2 5 xi3 (0) 0    0   0   1  0 −10 20 8 (24) 9    −10 ,  −2 (25) It can be seen in Fig. 1 that the directed graph G of Lorenz network is connected. The weighting matrices in the cost function are designed as QiN = Qi = Ri = diag(1, 1, 1) for all agents. The stable matrix is designed as As = −50I. The horizon T in the performance index is given by T (t) = Tf (1 − e−αt ), (26) where Tf = 1 and α = 0.01. The simulation is implemented in MATLAB, where the time step on the t axis is 0.01s and the time step on the artificial τ axis is 0.005s. Fig. 2 depicts the trajectories of this multi-agent Lorenz systems with initial conditions defined in Eq. (25), where it is possible to observe that the proposed distributed realtime nonlinear receding horizon control strategy results in a consensus, clearly demonstrating the effectiveness of the algorithm. Here, the horizon length is kept sufficiently long to ensure the stability. 15 Example-2: Next, consider a multi-agent system with 4 agents (as shown in Fig. 3), where each agent is modeled as the Lü chaotic system [33]:   ẋi1 = 36(xi2 − xi1 ),    ẋi2 = −xi1 xi3 + 13xi2 ,     ẋ = x x − 3x , i3 i1 i2 i3 (27) Here, xi = (xi1 , xi2 , xi3 )T represents the state of the i-th agent. In this case, the adjacency matrix A of G is given as  0 1   1 0   0 1  1 0 0 1 0 1 1    0   1  0 (28) It can be seen in Fig. 3 that the undirected graph G of Lü network is connected. The weighting matrices in the cost function are designed as QiN = Qi = Ri = diag(1, 1, 1) for all agents.The stable matrix is designed as As = −50I. The horizon T in the performance index is given in (26) with Tf = 1 and α = 0.01. The simulation is implemented in MATLAB, where the time step on the t axis is 0.01s and the time step on the artificial τ axis is 0.005s. Fig. 4 depicts the trajectories of this multi-agent Lü systems in (27) with initial conditions defined in Eq. (25) and the corresponding control strategies, where the consensus is achieved through the suggested distributed real-time nonlinear receding horizon control method. Example-3: Consider a leader-following system with one leader and 4 following agents, where each agent and the leader are also modeled as the Lorenz chaotic system (as shown in Eq. (23)). The augmented adjacency matrix H of G is given as  1   1   0  0 1 0 0 1 1 1 0 1 16 0    0   1  0 (29) where the diagonal elements show the connection between the leader and the followers. The weighting matrices in the cost function are designed as Qi0 = diag(10, 10, 10) and QiN = Qi = Ri = diag(1, 1, 1) for all agents. The stable matrix is designed as As = −50I. The initial states are given by    0.1 xi1 (0)       xi2 (0) = 0.2    0.3 xi3 (0) −1 2 −10 10 −1 20 2 5 8 9    −10 ,  −2 (30) where i = 0, 1, · · · , 4. The horizon T in the performance index is given by T (t) = Tf (1 − e−αt ), (31) where T f = 1 and α = 0.01. The simulation is implemented in MATLAB, where the time step on the t axis is 0.01s and the time step on the artificial τ axis is 0.005s. Fig. 5 depicts the trajectories of this leader-following Lorenz system with initial condition in Eq. (30) and the corresponding control strategies where the leader-following consensus is reached by using the distributed real-time nonlinear receding horizon control method. Example-4: We consider the leader-following multi-agent system with one leader agent and 4 agents and each agent is modeled as the Chen chaotic system [34]:    ẋi1 = 35(xi2 − xi1 ),    ẋi2 = −7xi1 − xi1 xi3 + 28xi2 ,     ẋ = x x − 3x , i3 i1 i2 i3 (32) where xi = (xi1 , xi2 , xi3 )T are the state of the i-th agent. The adjacency matrix 17 H of G is given as  1   1   0  1 1 1 0 1 0 0 0 0 1    0   1  1 (33) The weighting matrices in the cost function are designed as Qi0 = diag(10, 10, 10) and QiN = Qi = Ri = diag(1, 1, 1) for all agents. The stable matrix is designed as As = −50I. The horizon T in the performance index is given in (31) with Tf = 0.5 and α = 0.01. Fig. 6 depicts the trajectories of this leader-following Chen system in (32) with initial condition in Eq. (30) and the corresponding control strategies where the consensus is reached by using the distributed real-time nonlinear receding horizon control method. As it can be seen easily from above example, proposed real-time nonlinear receding horizon control methodology is working remarkable within given network topology and graph. All the agents in the systems are able to reach consensus. Here, again, the horizon length is kept sufficiently long to ensure the stability. 7. CONCLUSIONS AND FUTURE WORKS In this paper, we investigated the multi-agent consensus problem of nonlinear systems by using distributed real-time nonlinear receding horizon control methodology. Different from the previous works, we solved the nonlinear optimal consensus problem directly, without any need or the utilization of linearization techniques and/or iterative procedures. Based on the stabilized continuation method, the backward sweep algorithm is implemented to minimize the consensus error among the agents and the local control strategy is integrated in real time. We provided stability guarantees of the systems if the horizon length is kept sufficiently long. Several benchmark examples with different topologies demonstrates the applicability and significant outcomes of proposed scheme on nonlinear chaotic systems. For future studies, it is the authors intention to 18 extend the proposed method to the systems with switching topologies and embedded communication time-delays. References [1] R. Olfati-Saber, R. M. Murray, Consensus problems in networks of agents with switching topology and time-delays, IEEE Trans. on Automat. Contr. 49 (2004) 1520-1533. [2] W. Dunbar, R. M. Murray, Distributed receding horizon control for multivehicle formation stabilization, Automatica 42 (2006) 549558. [3] W. Dunbar, Distributed receding horizon control of dynamically coupled nonlinear systems, IEEE Trans. on Automat. Contr. 52 (2007) 1249-1263. [4] Q. Hui, W. Haddad, Distributed nonlinear control algorithms for network consensus, Automatica 44 (2008) 2375-2381. [5] T. Keviczky, F. Borrelli, K. Fregene, D. Godbole, G. J. Balas, Decentralized receding horizon control and coordination of autonomous vehicle formations, IEEE Trans. on Control Systems Technology 16 (2008) 1933. [6] K. You, L. Xie, Network topology and communication data rate for consensusability of discrete-time multi-agent systems, IEEE Trans. on Automat. Contr. 56 (2011) 2262-2275. [7] W. Yu, G. Chen, M. Cao, Consensus in directed networks of agents with nonlinear dynamics, IEEE Trans. on Automat. Contr. 56 (2011) 1436-1441. [8] M. Andreasson, D. Dimarogonas, K. Johansson, Undamped nonlinear consensus using integral lyapunov function, in Proc. American Control Conference (ACC) (2012) 6644 - 6649. [9] D.M. Xie, Q.L. Liu, L.F. Lv, S.Y. Li, Necessary and sufficient condition for the group consensus of multi-agent systems, Appl. Math. Comput. 243 (2014), 870878. 19 [10] J. Wang, K. Chen and Q. Ma, Adaptive Leader-Following Consensus of Multi-Agent Systems with Unknown Nonlinear Dynamics, Entropy 16 (2014) 5020-5031. [11] Z. Wang, L. Wang, A. Szolnoki, M. Perc, Evolutionary games on multilayer networks: A colloquium, Phys. Condensed Matter 88 (2015) 60270-60277. [12] D.W. Zhao, L.H. Wang, L.J. Xu, Z. Wang, Finding another yourself in multiplex networks, Applied Math. Comp. 266 (2015) 599-604. [13] L. Zhao, Y.M. Jia, Finite-time consensus for second-order stochastic multiagent systems with nonlinear dynamics, Appl. Math. Comput. 270 (2015) 278290. [14] Z. Li, Z. Duan, G. Chen and L. Huang, Consensus of Multiagent Systems and Synchronization of Complex Networks: A Unified Viewpoint, IEEE Trans. Circuit and Sys. 57 (2010) 213-224. [15] J. Zhu and L. Yuan, Consensus of high-order multi-agent systems with switching topologies, Linear Algebra and its Applications 443 (2014) 105119. [16] K. H. Movric, F. L. Lewis, F. L., Cooperative Optimal Control for MultiAgent Systems on Directed Graph Topologies, IEEE Trans. on Automat. Contr. 59 (2014) 769-774 . [17] D. Bauso, L. Giarre, L. R. Pisanti, Non-linear protocols for optimal distributed consensus in networks of dynamic agents, Systems & Control Letters 55 (2006) 918-928. [18] Z. Qu, C. J, J. Wang, Nonlinear Cooperative Control for Consensus of Nonlinear and Heterogeneous Systems, in Proc. 46th IEEE Conf. Decision and Control (2007) 2301-2308. [19] K. Liu, G. Xie, W. Ren and L. Wang, Consensus for multi-agent systems with inherent nonlinear dynamics under directed topologies, Systems & Control Letters 62 (2013) 152-162. 20 [20] W. Xu, J. Cao, W. Yu and J. Lu, Leader-following consensus of non-linear multi-agent systems with jointly connected topology, IET Control Theory Appl. 8 (2014) 432-440. [21] W. Dunbar, A Distributed Receding Horizon Control Algorithm for Dynamically Coupled Nonlinear Systems, in Proc. 44th IEEE Conf. Decision and Control, and the European Control Conference (2005) 6673-6679. [22] H. Li, Y. Shi, Distributed model predictive control of constrained nonlinear systems with communication delays, Systems & Control Letters 62 (2013) 19-26. [23] H. Li, Y. Shi, Robust distributed model predictive control of constrained continuous-time nonlinear systems: a robustness constraint approach, IEEE Trans. on Automat. Contr. 59 (2014) 1673-1678. [24] H. Qiu, H. Duan, Receding horizon control for multiple UAV formation flight based on modified brain storm optimization, Nonlinear Dyn. 78 (2014) 1973-1988. [25] A. Bryson, Y. Ho, Applied optimal control, Hemisphere, New York, 1975 Secs. 2.3 and 6.3. [26] P. Kabamas, R. Longman, S. Jian-Guo, A homotopy approach to the feedback stablilization of linear systems, J. Guidance, Control, Dyn. 10 (1987) 422-432. [27] T. Ohtsuka, H. Fujii HA, Stabilized continuation method for solving optimal control problems, J. Guidance, Control, Dyn 17 (1994) 950-957. [28] T. Ohtsuka, H. Fujii, Real-Time Optimization Algorithm for Nonlinear Receding-Horizon Control, Automatica 33 (1997) 1147-1154. [29] T. Ohtsuka, Time-variant receding-horizon control of nonlinear systems, J. Guidance, Control, Dyn. 21 (1998) 174-176. 21 [30] A. Antoniou, W. Lu, Practical Optimization: Algorithm and Engineering Applications, Springer, 2007, sec. 10.8. [31] A. Jadbabaie, J. Hauser, On the stability of receding horizon control with a general terminal cost’, IEEE Trans. Autom. Contr. 50 (2005) 674-678. [32] E. Lorenz, Deterministic Nonperiodic Flow, J. Atmos. Sci. 20 (1963) 130141. [33] J. Lü and G. Chen, A New Chaotic Attractor Coined, Int. J. Bifurcation & Chaos 12 (2002) 659-661. [34] G. Chen, T. Ueta, Yet another chaotic attractor, Int. J. Bifurcation & Chaos 9 (1999) 1465-1466. 22 1 2 5 3 4 Figure 1: The communication topology of the multi-agent Lorenz chaotic systems with 5 agents. xi1 20 0 −20 0 5 10 15 10 15 10 15 10 15 t (sec) xi2 50 0 −50 0 5 t (sec) xi3 50 0 −50 0 5 t (sec) ui 100 0 −100 0 5 t (sec) Figure 2: The trajectories of all agents xi (t)(i = 1, · · · , 5) of Lorenz chaotic system and all control protocol ui generated by distributed NRHC. 23 1 2 4 3 Figure 3: The communication topology of the multi-agent Lü chaotic systems with 4 agents. xi1 50 0 −50 0 1 2 3 4 5 t (sec) 6 7 8 9 10 1 2 3 4 5 t (sec) 6 7 8 9 10 1 2 3 4 5 t (sec) 6 7 8 9 10 1 2 3 4 5 t (sec) 6 7 8 9 10 xi2 50 0 −50 0 xi3 50 0 −50 0 ui 100 0 −100 0 Figure 4: The trajectories of all agents xi (t)(i = 1, · · · , 4) of Lü chaotic system and all control protocol ui generated by distributed NRHC. 24 xi1 20 0 −20 0 1 2 3 4 5 t (sec) 6 7 8 9 10 1 2 3 4 5 t (sec) 6 7 8 9 10 1 2 3 4 5 t (sec) 6 7 8 9 10 1 2 3 4 5 t (sec) 6 7 8 9 10 xi2 50 0 −50 0 xi3 50 0 −50 0 ui 500 0 −500 0 Figure 5: The trajectories of leader and following agents xi (t)(i = 0, 1, · · · , 4) of Lorenz chaotic system and all control protocol ui generated by distributed NRHC. 25 xi1 50 0 −50 0 1 2 3 4 5 6 7 8 9 10 6 7 8 9 10 6 7 8 9 10 6 7 8 9 10 t (sec) xi2 100 0 −100 0 1 2 3 4 5 t (sec) xi3 100 0 −100 0 1 2 3 4 5 t (sec) ui 1000 0 −1000 0 1 2 3 4 5 t (sec) Figure 6: The trajectories of leader and following agents xi (t)(i = 0, 1, · · · , 4) of Chen chaotic system and all control protocol ui generated by distributed NRHC. 26
3cs.SY
An O(n log n)-Time Algorithm for the k-Center Problem in Trees⋆ arXiv:1705.02752v2 [cs.DS] 6 Mar 2018 Haitao Wang1 and Jingru Zhang2 1 Department of Computer Science Utah State University, Logan, UT 84322, USA [email protected] 2 Department of Computer Science Marshall University, Huntington, WV 25755, USA [email protected] Abstract. We consider a classical k-center problem in trees. Let T be a tree of n vertices and every vertex has a nonnegative weight. The problem is to find k centers on the edges of T such that the maximum weighted distance from all vertices to their closest centers is minimized. Megiddo and Tamir (SIAM J. Comput., 1983) gave an algorithm that can solve the problem in O(n log2 n) time by using Cole’s parametric search. Since then it has been open for over three decades whether the problem can be solved in O(n log n) time. In this paper, we present an O(n log n) time algorithm for the problem and thus settle the open problem affirmatively. 1 Introduction In this paper, we study a classical k-center problem in trees. Let T be a tree of n vertices. Each edge e(u, v) connecting two vertices u and v has a positive length d(u, v), and we consider the edge as a line segment of length d(u, v) so that we can talk about “points” on the edge. For any two points p and q of T , there is a unique path in T from p to q, denoted by π(p, q), and by slightly abusing the notation, we use d(p, q) to denote the length of π(p, q). Each vertex v of T is associated with a weight w(v) ≥ 0. The k-center problem is to compute a set Q of k points on T , called centers, such that the maximum weighted distance from all vertices of T to their closest centers is minimized, or formally, the value maxv∈V (T ) minq∈Q {w(v) · d(v, q)} is minimized, where V (T ) is the vertex set of T . Note that each center can be in the interior of an edge of T . Kariv and Hakimi [20] first gave an O(n2 log n) time algorithm for the problem. Jeger and Kariv [19] proposed an O(kn log n) time algorithm. Megiddo and Tamir [25] solved the problem in O(n log2 n log log n) time, and the running time of their algorithm can be reduced to O(n log2 n) by applying Cole’s parametric search [12]. Some progress has been made very recently by Banik et al. [3] for small values of k, where an O(n log n + k log2 n log(n/k))-time algorithm and another O(n log n + k2 log2 (n/k))-time algorithm were given. Since Megiddo and Tamir’s work [25], it has been open whether the problem can be solved in O(n log n) time. In this paper, we settle this three-decade long open problem affirmatively by presenting an O(n log n)-time algorithm. Note that the previous O(n log2 n)-time algorithm [12,25] and the first algorithm in [3] both rely on Cole’s parametric search, which involves a large constant in the time complexity due to the AKS sorting network [2]. Our algorithm, however, avoids Cole’s parametric search. If each center is required to be located at a vertex of T , then we call it the discrete case. The previously best-known algorithm for this case runs in O(n log2 n) time [26]. Our techniques also solve the discrete case in O(n log n) time. ⋆ A preliminary version of this paper will appear in the Proceedings of the 34th International Symposium on Computational Geometry (SoCG 2018). 1.1 Related Work Many variations of the k-center problem have been studied. If k = 1, then the problem is solvable in O(n) time [23]. If T is a path, the k-center problem was already solved in O(n log n) time [9,12,25], and Bhattacharya and Shi [4] also gave an algorithm whose running time is linear in n but exponential in k. For the unweighted case where the vertices of T have the same weight, an O(n2 log n)-time algorithm was given in [8] for the k-center problem. Later, Megiddo et al. [26] solved the problem in O(n log2 n) time, and the algorithm was improved to O(n log n) time [17]. Finally, Frederickson [16] solved the problem in O(n) time. The above four papers also solve the discrete case and the following problem version in the same running times: All points of T are considered as demand points and the centers are required to be at vertices of T . Further, if all points of T are demand points and centers can be any points of T , Megiddo and Tamir solved the problem in O(n log3 n) time [25], and the running time can be reduced to O(n log2 n) by applying Cole’s parametric search [12]. As related problems, Frederickson [15] presented O(n)-time algorithms for the following tree partitioning problems: remove k edges from T such that the maximum (resp., minimum) total weight of all connected subtrees is minimized (resp., maximized). Finding k centers in a general graph is NP-hard [20]. The geometric version of the problem in the plane is also NP-hard [24], i.e., finding k centers for n demanding points in the plane. Some special cases, however, are solvable in polynomial time. For example, if k = 1, then the problem can be solved in O(n) time [23], and if k = 2, it can be solved in O(n log2 n log2 log n) time [7] (also refer to [1] for a faster randomized algorithm). If we require all centers to be on a given line, then the problem of finding k centers can be solved in polynomial time [5,21,28]. Recently, problems on uncertain data have been studied extensively and some k-center problem variations on uncertain data were also considered, e.g., [13,18,30,31,27,29]. 1.2 Our Approach We discuss our approach for the non-discrete problem, and that for the discrete case is similar (and even simpler). Let λ∗ be the optimal objective value, i.e., λ∗ = maxv∈V (T ) minq∈Q {w(v) · d(v, q)} for an optimal solution Q. A feasibility test is to determine whether λ ≥ λ∗ for a given value λ, and if yes, we call λ a feasible value. Given any λ, the feasibility test can be done in O(n) time [20]. Our algorithm follows an algorithmic scheme in [16] for the unweighted case, which is similar to that in [15] for the tree partition problems. However, a big difference is that three schemes were proposed in [15,16] to gradually solve the problems in O(n) time, while our approach only follows the first scheme and this significantly simplifies the algorithm. One reason the first scheme is sufficient to us is that our algorithm runs in O(n log n) time, which has a logarithmic factor more than the feasibility test algorithm. In contrast, most efforts of the last two schemes of [15,16] are to reduce the running time of the algorithms to O(n), which is the same as their corresponding feasibility test algorithms. More specifically, our algorithm consists of two phases. The first phase will gather information so that each feasibility test can be done faster in sub-linear time. By using the faster feasibility test algorithm, the second phase computes the optimal objective value λ∗ . As in [16], we also use a stem-partition of the tree T . In addition to a matrix searching algorithm [14], we utilize some other techniques, such as the 2D sublist LP queries [10] and line arrangements searching [11], etc. 2 Remark. It might be tempting to see whether the techniques of [15,16] can be adapted to solving the problem in O(n) time. Unfortunately, we found several obstacles that prevent us from doing so. For example, a key ingredient of the techniques in [15,16] is to build sorted matrices implicitly in O(n) time so that each matrix element can be obtained in O(1) time. In our problem, however, since the vertices of the tree T have weights, it is elusive how to achieve the same goal. Indeed, this is also one main difficulty to solve the problem even in O(n log n) time (and thus makes the problem open for such a long time). As will be seen later, our O(n log n) time algorithm circumvents the difficulty by combining several techniques. Based on our study, although we do not have a proof, we suspect that Ω(n log n) is a lower bound of the problem. The rest of the paper is organized as follows. In Section 2, we review some previous techniques that will be used later. In Section 3, we describe our techniques for dealing with a so-called “stem”. We finally solve the k-center problem on T in Section 4. By slightly modifying the techniques, we solve the discrete case in Section 5. 2 Preliminaries In this section we review some techniques that will be used later in our algorithm. 2.1 The Feasibility Test FTEST0 Given any value λ, the feasibility test is to determine whether λ is feasible, i.e., whether λ ≥ λ∗ . We say that a vertex v of T is covered (under λ) by a center q if w(v) · d(v, q) ≤ λ. Note that λ is feasible if and only if we can place k centers in T such that all vertices are covered. In the following we describe a linear-time feasibility test algorithm, which is essentially the same as the one in [20] although our description is much simpler. We pick a vertex of T as the root, denoted by γ. For each vertex v, we use T (v) to denote the subtree of T rooted at v. Following a post-order traversal on T , we place centers in a bottom-up and greedy manner. For each vertex v, we maintain two values sup(v) and dem(v), where sup(v) is the distance from v to the closest center that has been placed in T (v), and dem(v) is the maximum distance from v such that if we place a center q within such a distance from v then all uncovered vertices of T (v) can be covered by q. We also maintain a variable count to record the number of centers that have been placed so far. Refer to Algorithm 1 for the pseudocode. λ . Following a postInitially, count = 0, and for each vertex v, sup(v) = ∞ and dem(v) = w(v) order traversal on T , suppose vertex v is being visited. For each child u of v, we update sup(v) and dem(v) as follows. If sup(u) ≤ dem(u), then we can use the center of T (u) closest to u to cover the uncovered vertices of T (u), and thus we reset sup(v) = min{sup(v), sup(u) + d(u, v)}. Note that since u connects v by an edge, d(v, u) is the length of the edge. Otherwise, if dem(u) < d(u, v), then we place a center on the edge e(u, v) at distance dem(u) from u, so we update count = count+1 and sup(v) = min{sup(v), d(u, v) − dem(u)}. Otherwise (i.e., dem(u) ≥ d(u, v)), we update dem(v) = min{dem(v), dem(u) − d(u, v)}. After the root γ is visited, if sup(γ) > dem(γ), then we place a center at γ and update count = count + 1. Finally, λ is feasible if and only if count ≤ k. The algorithm runs in O(n) time. We use FTEST0 to refer to the algorithm. 3 Remark. The algorithm FTEST0 actually partitions T into at most k disjoint connected subtrees such that the vertices in each subtree is covered by the same center that is located in the subtree. We will make use of this observation later. To solve the k-center problem, the key is to compute λ∗ , after which we can find k centers by applying FTEST0 with λ = λ∗ . Algorithm 1: The feasibility test algorithm FTEST0 Input: The tree T with root γ and a value λ Output: Determine whether λ is feasible 1 2 3 4 5 6 7 8 9 10 11 12 13 count ← 0; for each vertex v do sup(v) ← ∞, dem(v) ← λ ; w(v) for each vertex v in the post-order traversal of T do for each child u of v do if sup(u) ≤ dem(u) then sup(v) = min{sup(v), sup(u) + d(u, v)}; else if dem(u) < d(u, v) then count + +; /* place a center on the edge e(u, v) at distance dem(u) from u */ sup(v) = min{sup(v), d(u, v) − dem(u)}; else dem(v) = min{dem(v), dem(u) − d(u, v)}; 15 if sup(γ) > dem(γ) then count + +; 16 Return true if and only if count ≤ k; 14 2.2 /* place a center at the root γ */ A Matrix Searching Algorithm We review an algorithm MSEARCH, which was proposed in [14] and was widely used, e.g., [15,16,17]. A matrix is sorted if elements in every row and every column are in nonincreasing order. Given a set of sorted matrices, a searching range (λ1 , λ2 ) such that λ2 is feasible and λ1 is not, and a stopping count c, MSEARCH will produce a sequence of values one at a time for feasibility tests, and after each test, some elements in the matrices will be discarded. Suppose a value λ is produced. If λ 6∈ (λ1 , λ2 ), we do not need to test λ. If λ is feasible, then λ2 is updated to λ; otherwise, λ1 is updated to λ. MSEARCH will stop once the number of remaining elements in all matrices is at most c. Lemma 1 is proved in [14] and we slightly change the statement to accommodate our need. Lemma 1. [14,15,16,17] Let M be a set of N sorted matrices {M1 , M2 , . . . , MN } such that Mj is P of dimension mj × nj with mj ≤ nj , and N j=1 mj = m. Let c ≥ 0. The number of feasibility tests m )}), needed by MSEARCH to discard all but at most c of the elements is O(max{log maxj {nj }, log( c+1 PN 2nj and the total time of MSEARCH exclusive of feasibility tests is O(κ· j=1 mj log( mj )), where O(κ) is the time for evaluating each matrix element (i.e., the number of matrix elements that need to be P 2nj evaluated is O( N j=1 mj log( mj ))). 4 2.3 The 2D Sublist LP Queries Let H = {h1 , h2 , . . . , hm } be a set of m upper half-planes in the plane. Given two indices i and j with 1 ≤ i ≤ j ≤ m, a 2D sublist LP query asks for the lowest point in the common intersection of hi , hi+1 , . . . , hj . The line-constrained version of the query is: Given a vertical line l and two indices i and j with 1 ≤ i ≤ j ≤ m, the query asks for the lowest point on l in the common intersection of hi , hi+1 , . . . , hj . Lemma 2 was proved in [10] (i.e., Lemma 8 and the discussion after it; the query algorithm for the line-constrained version is used as a procedure in the proof of Lemma 8). Lemma 2. [10] We can build a data structure for H in O(m log m) time such that each 2D sublist LP query can be answered in O(log2 m) time, and each line-constrained query can be answered in O(log m) time. Remark. With O(m log m) preprocessing time, any poly(log m)-time algorithms for both query problems would be sufficient for our purpose, where poly(·) is any polynomial function. 2.4 Line Arrangement Searching Let L be a set of m lines in the plane. Denote by A(L) the arrangement of the lines of L, and let y(v) denote the y-coordinate of each vertex v of A(L). Let v1 (L) be the lowest vertex of A(L) whose y-coordinate is a feasible value, and let v2 (L) be the highest vertex of A(L) whose y-coordinate is smaller than that of v1 (L). By their definitions, y(v2 (L)) < λ∗ ≤ y(v1 (L)), and A(L) does not have a vertex v with y(v2 (L)) < y(v) < y(v1 (L)). Lemma 3 was proved in [11]. Lemma 3. [11] Both vertices v1 (L) and v2 (L) can be computed in O((m + τ ) log m) time, where τ is the time for a feasibility test. Remark. Alternatively, we can use Cole’s parametric search [12] to compute the two vertices. First, we sort the lines of L by their intersections with the horizontal line y = λ∗ , and this can be done in O((m + τ ) log m) time by Cole’s parametric search [12]. Then, v1 (L) and v2 (L) can be found in additional O(m) time because each of them is an intersection of two adjacent lines in the above sorted order. The line arrangement searching technique, which modified the slope selection algorithms [6,22], avoids Cole’s parametric search [12]. In the following, we often talk about some problems in the plane R2 , and if the context is clear, for any point p ∈ R2 , we use x(p) and y(p) to denote its x- and y-coordinates, respectively. 3 The Algorithms for Stems In this section, we first define stems, which are similar in spirit to those proposed in [16] for the unweighted case. Then, we will present two algorithms for solving the k-center problem on a stem, and both techniques will be used later for solving the problem in the tree T . Let Pb be a path of m vertices, denoted by v1 , v2 , . . . , vm , sorted from left to right. For each vertex vi , other than its incident edges in Pb, vi has at most two additional edges connecting two vertices ui and wi that are not in Pb. Either vertex may not exist. Let P denote the union of Pb and the above additional edges (e.g., see Fig. 1). For any two points p and q on P , we still use π(p, q) to denote the unique path between p and q in P , and use d(p, q) to denote the length of the path. 5 w5 w3 v1 v4 v2 v5 v3 u2 v6 u5 Fig. 1. Illustrating a stem. With respect to a range (λ1 , λ2 ), we call P a stem if the following holds: For each i ∈ [1, m], if ui exists, then w(ui ) · d(ui , vi ) ≤ λ1 ; if wi exists, then w(wi ) · d(wi , vi ) ≥ λ2 . Following the terminology in [16], we call e(vi , ui ) a thorn and e(vi , wi ) a twig. Each ui is called a thorn vertex and each wi is called a twig vertex. Pb is called the backbone of P , and each vertex of Pb is called a backbone vertex. We define m as the length of P . The total number of vertices of P is at most 3m. Remark. Our algorithm in Section 4 will produce stems P as defined above, where Pb is a path in T and all vertices of P are also vertices of T . However, each thorn e(ui , vi ) may not be an original edge of T , but it corresponds to the path between ui and vi in T in the sense that the length of e(ui , vi ) is equal to the distance between ui and vi in T . This is also the case for each twig e(wi , vi ). Our algorithm in Section 4 will maintain a range (λ1 , λ2 ) such that λ1 is not feasible and λ2 is feasible, i.e., λ∗ ∈ (λ1 , λ2 ]. Since any feasibility test will be made to a value λ ∈ (λ1 , λ2 ), the above definitions on thorns and twigs imply the following: For each thorn vertex ui , we can place a center on the backbone to cover it (under λ), and for each twig vertex wi , we need to place a center on the edge e(wi , vi ) \ {vi } to cover it. In the sequel we give two different techniques for solving the k-center problem on the stem P . In fact, in our algorithm for the k-center problem on T in Section 4, we use these techniques to process a stem P , rather than directly solve the k-center problem on P . Let λ∗ temporarily refer to the optimal objective value of the k-center problem on P in the rest of this section, and we assume λ∗ ∈ (λ1 , λ2 ]. 3.1 The First Algorithm This algorithm is motivated by the following easy observation: there exist two vertices v and v ′ in P such that a center q is located in the path π(v, v ′ ) and w(v) · d(q, v) = w(v ′ ) · d(q, v ′ ) = λ∗ (since otherwise we could move q on P to achieve such a situation). We assume that all backbone vertices of P are in the x-axis of an xy-coordinate system R2 where v1 is at the origin and each vi has x-coordinate d(v1 , vi ). Each vi defines two lines l+ (vi ) and l− (vi ) both containing vi and with slopes w(vi ) and −w(vi ), respectively (e.g., see Fig. 2). Each thorn ui also defines two lines l+ (ui ) and l− (ui ) as follows. Define uli (resp., uri ) to be the point in R2 on the x-axis with x-coordinate d(v1 , vi ) − d(ui , vi ) (resp., d(v1 , vi ) + d(ui , vi )). Hence, uli (resp., uri ) is to the left (resp., right) of vi with distance d(ui , vi ) from vi . Define l+ (ui ) to be the line through uli with slope w(ui ) and l− (ui ) to be the line through uri with slope −w(ui ). Note that l+ (ui ) and l− (ui ) intersect at the point whose x-coordinate is the same as that of vi and whose y-coordinate is equal to w(ui ) · d(ui , vi ). For each twig vertex wi , we define points wil and wir , and lines l+ (wi ) and l− (wi ), in the same way as those for ui . 6 y l− (ui ) l+ (ui ) l (vi ) − uli vi v1 uri l+ (vi ) x ui Fig. 2. Illustrating the definitions of the lines defined by a backbone vertex vi and its thorn vertex ui . Consider a point q on the backbone of P to the right side of vi . It can be verified that the weighted distance w(vi ) · d(vi , q) from vi to q is exactly equal to the y-coordinate of the intersection between l+ (vi ) and the vertical line through q. If q is on the left side of vi , we have a similar observation for l− (vi ). This is also true for ui and wi . Let L denote the set of the lines in R2 defined by all vertices of P . Note that |L| ≤ 6m. Based on the above observation, λ∗ is equal to the y-coordinate of a vertex of the line arrangement A(L) of L. More precisely, λ∗ is equal to the y-coordinate of the vertex v1 (L), as defined in Section 2. By Lemma 3, we can compute λ∗ in O((m + τ ) log m) time. 3.2 The Second Algorithm This algorithm relies on the algorithm MSEARCH. We first form a set of sorted matrices. For each i ∈ [1, m], we define the two lines li+ (vi ) and li− (vi ) in R2 as above in Section 3.1. If ui exists, then we also define li+ (ui ) and li− (ui ) as before; otherwise, both li+ (ui ) and li− (ui ) refer to the x-axis. Let h4(i−1)+j , 1 ≤ j ≤ 4, denote respectively the four upper half-planes bounded by the above four lines (their index order is arbitrary). In this way, we have a set H = {h1 , h2 . . . , h4m } of 4m upper half-planes. For any i and j with 1 ≤ i ≤ j ≤ m, we define α(i, j) as the y-coordinate of the lowest point in the common intersection of the upper half-planes of H from h4(i−1)+1 to h4j , i.e., all upper halfplanes defined by ut and vt for t ∈ [i, j]. Observe that if we use one center to cover all backbone and thorn vertices ut and vt for t ∈ [i, j], then α(i, j) is equal to the optimal objective value of this one-center problem. We define a matrix M of dimension m × m: For any i and j in [1, m], if i + j ≤ m + 1, then M [i, j] = α[i, m + 1 − j]; otherwise, M [i, j] = 0. For each twig wi , we define two arrays Ari and Ali of at most m elements each as follows. Let h+ (wi ) and h− (wi ) denote respectively the upper half-planes bounded by the lines l+ (wi ) and l− (wi ) defined in Section 3.1. The array Ari is defined on the vertices of P on the right side of vi , as follows. For each j ∈ [1, m − i + 1], if we use a single center to cover wi and all vertices ut and vt for t ∈ [i, m + 1 − j], then Ari [j] is defined to be the optimal objective value of this one-center problem, which is equal to the y-coordinate of the lowest point in the common intersection of h+ (wi ) and the upper half-planes of H from h4(i−1)+1 to h4(m+1−j) . Symmetrically, array Ali is defined on the left side of vi . Specifically, for each j ∈ [1, i], if we use one center to cover wi and all vertices ut and vt for t ∈ [j, i], then Al [j] is defined to be the optimal objective value, which is equal to the y-coordinate of the lowest point in the common intersection of h− (wi ) and the upper half-planes of H from h4(j−1)+1 to h4i . 7 Let M be the set of the matrices M and Ari and Ali for all 1 ≤ i ≤ m. The following lemma implies that we can apply MSEARCH on M to compute λ∗ . Lemma 4. Each matrix of M is sorted, and λ∗ is an element of a matrix in M. Proof. We first show that all matrices of M are sorted. Consider the matrix M . Consider two elements M [i, j1 ] and M [i, j2 ] in the same row with j1 < j2 . Our goal is to show that M [i, j1 ] ≥ M [i, j2 ]. 1. If j1 > m + 1 − i, then both M [i, j1 ] and M [i, j2 ] are zero. Thus, M [i, j1 ] ≥ M [i, j2 ] trivially holds. 2. If j1 ≤ m + 1 − i < j2 , then M [i, j2 ] = 0 and M [i, j1 ] = α(i, m + 1 − j1 ). By our way of defining upper half-planes of H, one can verify that α(i, m + 1 − j1 ) ≥ 0. Therefore, M [i, j1 ] ≥ M [i, j2 ]. 3. If j2 ≤ m + 1 − i, then M [i, j1 ] = α(i, m + 1 − j1 ) and M [i, j2 ] = α(i, m + 1 − j2 ). Let H1 (resp., H2 ) be the set of the upper half-planes of H from h4(i−1)+1 to h4(m+1−j1 ) (resp., h4(m+1−j2 ) ). Since j1 < j2 , H2 is a subset of H1 , and thus the lowest point in the common intersection of the upper half-planes of H2 is not higher than that of H1 . Hence, α(i, m + 1 − j1 ) ≥ α(i, m + 1 − j2 ) and thus M [i, j1 ] ≥ M [i, j2 ]. The above proves M [i, j1 ] ≥ M [i, j2 ]. Therefore, all elements in each row are sorted in nonincreasing order. By the similar approach we can show that all elements in each column are also sorted in nonincreasing order. We omit the details. Hence, M is a sorted matrix. Now consider an array Ali . Consider any two elements Ali [j1 ] and Ali [j2 ] with j1 < j2 . Our goal is to show that Ali [j1 ] ≥ Ali [j2 ]. The argument is similar as the above third case. Let H1 (resp., H2 ) be the set of h− (wi ) and the upper half-planes of H from h4(j1 −1)+1 (resp., h4(j2 −1)+1 ) to h4i . Since j1 < j2 , H2 is a subset of H1 and the lowest point in the common intersection of the upper half-planes of H2 is not higher than that of H1 . Hence, Ali [j1 ] ≥ Ali [j2 ]. We can show that Ari is also sorted in a similar way. We omit the details. The above proves that every matrix of M is sorted. In the following, we show that λ∗ must be an element of one of these matrices. Imagine that we apply our feasibility test algorithm FTEST0 on λ = λ∗ and the stem P by considering P as a tree with root vm . Then, the algorithm will compute at most k centers in P . The algorithm actually partitions P into at most k disjoint connected subtrees such that the vertices in each subtree is covered by the same center that is located in the subtree. Further, there must be a subtree P1 that has a center q and two vertices v ′ and v such that w(v)·d(v, q) = w(v ′ )·d(v ′ , q) = λ∗ , since otherwise we could adjust the positions of the centers so that the maximum weighted distance from all vertices of P to their closest centers would be strictly smaller than λ∗ . Since P1 is connected and both v and v ′ are in P1 , the path π(v, v ′ ) is also in P1 . Depending on whether one of v and v ′ is a twig vertex, there are two cases. If neither vertex is a twig vertex, then we claim that all thorn vertices connecting to the backbone vertices of π(v, v ′ ) are covered by the center q. Indeed, suppose vi is a backbone vertex in π(v, v ′ ) and vi connects to a thorn vertex ui . Assume to the contrary that ui is not covered by q. Recall that by the definition of thorns, w(ui ) · d(ui , vi ) ≤ λ1 , and since λ1 < λ∗ , we have w(ui ) · d(ui , vi ) < λ∗ . According to FTEST0, ui is covered by a center q ′ that is not on e(ui , vi ). Hence, ui and q ′ is in a connected subtree, denoted by P2 , in the partition of P induced by FTEST0. Clearly, vi is in π(ui , q ′ ). Since P2 is connected and both q ′ and ui are in P2 , every vertex of π(ui , q ′ ) is in P2 . 8 Because q ′ is not on e(ui , vi ), vi must be in π(ui , q ′ ) and thus is in P2 . However, since vi is in π(v, v ′ ), vi is also in P1 . This incurs contradiction since P1 ∩ P2 = ∅. This proves the claim. If v is a backbone vertex, then let i be its index, i.e., v = vi ; otherwise, v is a thorn vertex and let i be the index such that v connects the backbone vertex vi . Similarly, define j for v ′ . Without loss of generality, assume i ≤ j. The above claim implies that λ∗ is equal to the y-coordinate of the lowest point in the common intersection of all upper half-planes defined by the backbone vertices vt and thorn vertices ut for all t ∈ [i, j], and thus, λ∗ = α(i, j), which is equal to M [i, m + 1 − j]. Therefore, λ∗ is in the matrix M . Next, we consider the case where at least one of v and v ′ is a twig vertex. For each twig vertex wi of P , by definition, w(wi ) · d(wi , vi ) ≥ λ2 , and since λ∗ ≤ λ2 , the twig e(wi , vi ) must contain a center. Because both v and v ′ are covered by q, only one of them is a twig vertex (since otherwise we would need two centers to cover them since each twig must contain a center). Without loss of generality, we assume that v is a twig vertex, say, wi . If v ′ is a backbone vertex, then let j be its index; otherwise, v ′ is a thorn vertex and let j be the index such that v ′ connects the backbone vertex vj . Without loss of generality, we assume that i ≤ j. By the same argument as the above, all thorn vertices ut with t ∈ [i, j] are covered by q. This implies that λ∗ is the y-coordinate of the lowest point in the common intersection of h+ (wi ) and all upper half-planes defined by the backbone vertices vt and thorn vertices ut for all t ∈ [i, j]. Thus, λ∗ = Ari [m + 1 − j]. Therefore, λ∗ is in the array Ari . This proves that λ∗ must be in a matrix of M. The lemma thus follows. ⊔ ⊓ Note that M consists of a matrix M of dimension m × m and 2m arrays of lengths at most m. With the help of the 2D sublist LP query data structure in Lemma 2, the following lemma shows that the matrices of M can be implicitly formed in O(m log m) time. Lemma 5. With O(m log m) time preprocessing, each matrix element of M can be evaluated in O(log2 m) time. Proof. We build a 2D sublist LP query data structure of Lemma 2 on the upper half-planes of H in O(m log m) time. Then, each element of M can be computed in O(log2 m) time by a 2D sublist LP query. Now consider an array Ali . Given any index j, to compute Ali [j], recall that Ali [j] is equal to the y-coordinate of the lowest point p∗ of the common intersection of the upper half-plane h+ (wi ) and those in H ′ , where H ′ is the set of the upper half-planes of H from h4(j−1)+1 to h4i . The lowest point p′ of the common intersection of the upper half-planes of H ′ can be computed in O(log2 m) time by a 2D sublist LP query with query indices 4(j −1)+1 and 4i. Computing p∗ can also be done in O(log2 m) time by slightly modifying the query algorithm for computing p′ . We briefly discuss it below and the interested reader should refer to [10] for details (the proof of Lemma 8 and the discussion after the lemma). The query algorithm for computing p′ is similar in spirit to the linear-time algorithm for the 2D linear programming problem in [23]. It is a binary search algorithm. In each iteration, the algorithm computes the highest intersection p′′ between a vertical line l and the bounding lines of the halfplanes of H ′ , and based on the local information at the intersection, the algorithm will determine which side to proceed for the search. For computing p∗ , we need to incorporate the additional half-plane h+ (wi ). To this end, in each iteration of the binary search, after we compute the highest intersection p′′ , we compare it with the intersection of l and the bounding line of h+ (wi ) and update 9 9 9 3 3 4 4 5 7 6 6 5 2 2 8 7 1 5 3 2 1 2 5 8 4 3 4 Fig. 3. Left: the tree T where the numbers are the weights of the vertices. Right: the path partition of T . the highest intersection if needed. This costs only constant extra time for each iteration. Therefore, the total running time for computing p∗ is still O(log2 m). ⊔ ⊓ Computing the elements of arrays Ari can be done similarly. The lemma thus follows. By applying algorithm MSEARCH on M with stopping count c = 0 and κ = O(log2 m), according to Lemma 1, MSEARCH produces O(log m) values for feasibility tests, and the total time exclusive of feasibility tests is O(m log3 m) because we need to evaluate O(m log m) matrix elements of M. Hence, the total time for computing λ∗ is O(m log3 m + τ · log m). Remark. Clearly, the first algorithm is better than the second one. However, later when we use the techniques of the second algorithm, m is often bounded by O(log2 n) and thus log3 m = O(log n). In fact, we use the techniques of the second algorithm mainly because we need to set the stopping count c to some non-zero value. 4 Solving the k-Center Problem on T In this section, we present our algorithm for solving the k-center problem on T . We will focus on computing the optimal objective value λ∗ . Frederickson [15] proposed a path-partition of T , which is a partition of the edges of T into paths where a vertex v is an endpoint of a path if and only if the degree of v in T is not equal to 2 (e.g., see Fig. 3). A path in a partition-partition of T is called a leaf-path if it contains a leaf of T . As in [16], we generalize the path-partition to stem-partition as follows. During the course of our algorithm, a range (λ1 , λ2 ] that contains λ∗ will be maintained and T will be modified by removing some edges and adding some thorns and twigs. At any point in our algorithm, let T ′ be T with all thorns and twigs removed. A stem of T is a path in the path-partition of T ′ , along with all thorns and twigs that connect to vertices in the path. A stem-partition of T is to partition T into stems according to a path-partition of T ′ . A stem in a stem-partition of T is called a leaf-stem if it contains a leaf of T that is a backbone vertex of the stem. Our algorithm follows the first algorithmic scheme in [16]. There are two main phases: Phase 1 and Phase 2. Let r = log2 n. Phase 1 gathers information so that the feasibility test can be made in sublinear O( nr log3 r) time. Phase 2 computes λ∗ by using the faster feasibility test. If T has more than 2n/r leaves, then there is an additional phase, called Phase 0, which reduces the problem to a tree with at most 2n/r leaves. (Phase 0 is part of Phase 1 in [16], and we separates it from Phase 1 to make it clearer.) In the following, we consider the general case where T has more than 2n/r leaves. Algorithm 3 gives the pseudocode of the overall algorithm. 10 4.1 The Preprocessing and Computing the Vertex Ranks We first perform some preprocessing. Recall that γ is the root of T . We compute the distances d(v, γ) for all vertices v in O(n) time. Then, if u is an ancestor of v, d(u, v) = d(γ, v) − d(γ, u), which can be computed in O(1) time. In the following, whenever we need to compute a distance d(u, v), it is always the case that one of u and v is an ancestor of the other, and thus d(u, v) can be obtained in O(1) time. Next, we compute a “rank” rank(v) for each vertex v of T . These ranks will facilitate our algorithm later. For each vertex v, we define a point p(v) on the x-axis with x-coordinate equal to d(γ, v) in an xy-coordinate system R2 , and define l(v) as the line through p(v) with slope equal to −w(v). Let L be the set of these n lines. Consider the line arrangement A(L) of L. Let v1 (L) and v2 (L) be the vertices as defined in Section 2. By Lemma 3, both vertices can be computed in O(n log n) time. Let l be a horizontal line strictly between v1 (L) and v2 (L). We sort all lines of L by their intersections with l from left to right, and for each vertex v, we define rank(v) = i if there are i − 1 lines before l(v) in the above order. By the definitions of v1 (L) and v2 (L), the above order of L is also an order of L sorted by their intersections with the horizontal line y = λ∗ . 4.2 Phase 0 Recall that T has more than 2n/r leaves. In this section, we reduce the problem to the problem of placing centers in a tree with at most 2n/r leaves. Our algorithm will maintain a range (λ1 , λ2 ] that contains λ∗ . Initially, λ1 = y(v2 (L)), the y-coordinate of v2 (L), which is already computed in the preprocessing, and λ2 = y(v1 (L)). We form a stem-partition of T , which is actually a path-partition since there are no thorns and twigs initially, and this can be done in O(n) time. Recall that r = log2 n. While there are more than 2n/r leaves in T , we do the following. Recall that the length of a stem is defined as the number of backbone vertices. Let S be the set of all leaf-stems of T whose lengths are at most r. Let n′ be the number of all backbone vertices on the leaf-stems of S. For each leaf-stem of S, we form matrices by Lemma 5. Let M denote the collection of matrices for all leaf-stems of S. We call MSEARCH on M, with stopping count c = n′ /(2r), by using the feasibility test algorithm FTEST0. After MSEARCH stops, we have an updated range (λ1 , λ2 ) and matrix elements of M in (λ1 , λ2 ) are called active values. Since c = n′ /(2r), at most n′ /(2r) active values of M remain, and thus at most n′ /(2r) leaf-stems of S have active values. For each leaf-stem P ∈ S without active values, we perform the following post-processing procedure. The backbone vertex of P closest to the root is called the top vertex. We place centers on P , subtract their number from k, and replace P by either a thorn or a twig connected to the top vertex (P is thus removed from T except the top vertex), such that solving the k-center problem on the modified T also solves the problem on the original T . The post-processing procedure can be implemented in O(m) time, where m is the length of P . The details are given below. The post-processing procedure on P . Let z be the top vertex of P . We run the feasibility test algorithm FTEST0 on P with z as the root and λ = λ′ that is an arbitrary value in (λ1 , λ2 ). After z is finally processed, depending on whether sup(z) ≤ dem(z), we do the following. If sup(z) ≤ dem(z), then let q be the last center that has been placed. In this case, all vertices of P are covered and z is covered by q. According to algorithm FTEST0 and as discussed in the proof of Lemma 4, q covers a connected subtree of vertices, and let V (q) denote the set of these vertices excluding z. Note that V (q) can be easily identified during FTEST0. Let k′ be the number 11 of centers excluding q that have been placed on P . Since λ′ ∈ (λ1 , λ2 ) and the matrices formed based on P do not have any active values, we have the following key observation: if we run FTEST0 with any λ ∈ (λ1 , λ2 ), the algorithm will also cover all vertices of P \ (V (q) ∪ {z}) with k′ centers and cover vertices of V (q) ∪ {z} with one center. Indeed, this is true because the way we form matrices for P is consistent with FTEST0, as discussed in the proof of Lemma 4. In this case, we replace P by attaching a twig e(u, z) to z with length equal to d(u, z), where u is a vertex of V (q) with the following property: For any λ ∈ (λ1 , λ2 ), if we place a center q ′ on the path π(u, z) at distance λ/w(u) from u, then q ′ will cover all vertices of V (q) under λ, i.e., u “dominates” all other vertices of V (q) and thus it is sufficient to keep u (since λ2 is feasible, any subsequent feasibility test in the algorithm will use λ ∈ (λ1 , λ2 )). The following lemma shows that u is the vertex of V (q) with the largest rank. Lemma 6. Let u be the vertex of V (q) with the largest rank. For any λ ∈ (λ1 , λ2 ), the following holds. 1. 2. λ w(u) If q ′ ≤ d(u, z). λ from u, then q ′ covers all vertices of is the point on the path π(u, z) with distance w(u) V (q) under λ, i.e., w(v) · d(v, q ′ ) ≤ λ for all v ∈ V (q). Proof. Before we prove λ w(u) λ w(u) ≤ d(u, z), let q ′ be the point on π(u, γ) with distance > d(u, γ), then we add a dummy edge e∗ λ w(u) from u (if extended from the root γ long enough so that q ′ is λ ≤ d(u, z), which also proves that q ′ is on π(u, z). on e∗ ). Later we will show that w(u) We first show that q ′ covers all vertices of V (q). Consider any vertex v ∈ V (q). Our goal is to prove w(v) · d(v, q ′ ) ≤ λ. If v = u, this trivially holds. In the following, we assume v 6= u. Note that q ′ may be on a twig of P . If q ′ is on a twig e(u, v) of P , then this means that q ′ is on λ P and w(u) ≤ d(u, z) holds. In this case, if we run FTEST0 with λ, then q ′ will be a center placed by FTEST0 to cover u. On the other hand, according to the above key observation, FTEST0 with λ will use one center to cover all vertices of V (q). Hence, q ′ covers all vertices of V (q) and thus covers v. In the following, we assume that q ′ is not on a twig of P . Note that by the definition of thorns, q ′ cannot be in any thorn. Thus q ′ must be either on the backbone of P or outside P in π(z, γ) ∪ e∗ . We define V1 (q) to be the set of vertices of V (q) in the subtree rooted at q ′ and let V2 (q) = V (q) \ V1 (q). Depending on whether v is in V1 (q) or V2 (q), there are two cases. The case v ∈ V1 (q). Recall that in Section 4.1 each vertex v ′ defines a line l(v ′ ) in R2 . We consider the two lines l(v) and l(u). Let pv and pu denote the intersections of the horizontal line y = λ with l(v) and l(u), respectively (e.g., see Fig. 4). Note that the point q ′ corresponding to the point (x(pu ), 0) in the x-axis in the sense that d(γ, q ′ ) = x(pu ). Since rank(v) < rank(u) and λ ∈ (λ1 , λ2 ), by the definition of ranks, it holds that x(pv ) < x(pu ). Because the slope of l(v) is not positive, y(p′v ) ≤ λ, where p′v is the intersection of l(v) with the vertical line through pu . On the other hand, since v is in V1 (q), y(p′v ) is exactly equal to w(v) · d(v, q ′ ). Therefore, we obtain w(v) · d(v, q ′ ) ≤ λ. The case v ∈ V2 (q). In this case, V2 (q) 6= ∅. By the definition of V2 (q), q ′ must be in π(u, v). According to the above key observation, we can use one center to cover all vertices of V (q) (under λ), and in particular, we can use one center to cover both u and v. By the definition of q ′ , q ′ is the closest point to v on π(u, v) that can cover u. Hence, q ′ must be able to cover v. Therefore, we obtain w(v) · d(v, q ′ ) ≤ λ. 12 y pu λ pv p′v p(v) x p(u) l(v) l(u) Fig. 4. Illustrating the proof of the case v ∈ V1 (q). Note that p(v) and p(u) are the points defined respectively by v and u in Section 4.1. The above proves w(v) · d(v, q ′ ) ≤ λ. λ Finally, we argue that w(u) ≤ d(u, z). Assume to the contrary that this is not true. Then, q ′ is outside P . This means that we can place a center outside P to cover all vertices of V (q) under λ. But this contradicts the above key observation that FTEST0 for λ′ will place a center in P to cover the vertices of V (q). The lemma thus follows. ⊔ ⊓ Due to the preprocessing in Section 4.1, we can find u from V (q) in O(m) time. This finishes our λ ≤ d(u, z) for any λ ∈ (λ1 , λ2 ), post-processing procedure for the case sup(z) ≤ dem(z). Since w(u) we have w(u) · d(u, z) ≥ λ2 , and thus, e(u, z) is indeed a twig. Next, we consider the other case sup(z) > dem(z). In this case, P has some vertices other than z that are not covered yet, and we would need to place a center at z to cover them. Let V be the set of all uncovered vertices other than z, and V can be identified during FTEST0. In this case, we replace P by attaching a thorn e(u, z) to z with length equal to d(u, z), where u is a vertex of V with the following property: For any λ ∈ (λ1 , λ2 ), if there is a center q outside P covering u through z (by “through”, we mean that π(q, u) contains z) under distance λ, then q also covers all other vertices of V (intuitively u “dominates” all other vertices of V ). Since later we will place centers outside P to cover the vertices of V through z under some λ ∈ (λ1 , λ2 ), it is sufficient to maintain u. The following lemma shows that u is the vertex of V with the largest rank. Lemma 7. Let u be the vertex of V with the largest rank. Then, for any center q outside P that covers u through z under any distance λ ∈ (λ1 , λ2 ), q also covers all other vertices of V . Proof. Let v be any vertex of V other than u. Our goal is to prove that d(q, v) · w(v) ≤ λ. The proof is similar to that for the case v ∈ V1 (q) of Lemma 6 and we omit the details. ⊔ ⊓ Since a center at z would cover u, it holds that w(u) · d(u, z) ≤ λ for any λ ∈ (λ1 , λ2 ), which implies that w(u) · d(u, z) ≤ λ1 . Thus, e(u, z) is indeed a thorn. The above replaces P by attaching to z either a thorn or a twig. We perform the following additional processing. Suppose z is attached by a thorn e(z, u). If z already has another thorn e(z, u′ ), then we discard one of u′ and u whose rank is smaller, because any center that covers the remaining vertex will cover the discarded one as well (the proof is similar to those in Lemma 6 and 7 and we omit it). This makes sure that z has at most one thorn. Suppose z is attached by a twig e(z, u). If z already has another twig e(z, u′ ), then we can discard one of u and u′ whose rank is larger (and subtract 1 from k). The reason is the following. Without loss of generality, assume rank(u) < rank(u′ ). Since both e(z, u) and e(z, u′ ) are twigs, 13 y λ pu ′ pu x p(u′ ) p(u) l(u) l(u′ ) Fig. 5. Illustrating the proof of Lemma 8. Note that p(u) and p(u′ ) are the points defined respectively by u and u′ in Section 4.1. if we apply FTEST0 on any λ ∈ (λ1 , λ2 ), then the algorithm will place a center q on e(z, u) with distance λ/w(u) from u and place a center q ′ on e(z, u′ ) with distance λ/w(u′ ) from u′ . As rank(u) < rank(u′ ), we have the following lemma. Lemma 8. d(q, z) ≤ d(q ′ , z). Proof. The analysis is similar to those in Lemma 6 and 7. Consider the lines l(u) and l(u′ ) in R2 defined by u and u′ , respectively, as discussed in Section 4.1. Let pu and pu′ be the intersections of the horizontal line y = λ with l(u) and l(u′ ), respectively (e.g., see Fig. 5). Since rank(u) < rank(u′ ) and λ ∈ (λ1 , λ2 ), x(pu ) ≤ x(pu′ ). Note that x(pu ) = d(γ, q) and x(pu′ ) = d(γ, q ′ ). Since x(pu ) ≤ x(pu′ ), we have d(γ, q) ≤ d(γ, q ′ ). On the other hand, due to that q ∈ e(z, u) and q ′ ∈ e(z, u′ ), d(γ, z) ≤ d(γ, q) and d(γ, z) ≤ d(γ, q ′ ). Thus, d(q, z) = d(γ, q) − d(γ, z) and d(q ′ , z) = d(γ, q ′ ) − d(γ, z). Because d(γ, q) ≤ d(γ, q ′ ), we obtain d(q, z) ≤ d(q ′ , z). The lemma thus follows. ⊔ ⊓ Lemma 8 tells that any vertex that is covered by q ′ in the subsequent algorithm will also be covered by q. Thus, it is sufficient to maintain the twig e(z, u). Since we need to place a center at e(z, u′ ), we subtract 1 from k after removing e(z, u′ ). Hence, z has at most one twig. This finishes the post-processing procedure for P . Due to the preprocessing in Section 4.1, the running time of the procedure is O(m). Let T be the modified tree after the post-processing on each stem P without active values. If T still has more than 2n/r leaves, then we repeat the above. The algorithm stops once T has at most 2n/r leaves. This finishes Phase 0. The following lemma gives the time analysis, excluding the preprocessing in Section 4.1. Lemma 9. Phase 0 runs in O(n(log log n)3 ) time. Proof. We first argue that the number of iterations of the while loop is O(log r). The analysis is very similar to those in [15,16], and we include it here for completeness. We consider an iteration of the while loop. Suppose the number of leaf-stems in T , denoted by m, is at least 2n/r. Then, at most n/r leaf-stems are of length larger than r. Hence, at least half of the leaf-stems are of length at most r. Thus, |S| ≥ m/2. Recall that n′ is the total number of backbone vertices in all leaf-stems of S. Because at most n′ /(2r) leaf-stems have active values after MSEARCH, at least |S| − n′ /(2r) ≥ m/2 − n′ /(2r) ≥ m/2 − n/(2r) ≥ m/2 − m/4 = m/4 leaf-stems will be removed. Note that removing two such leaf-stems may make an interior vertex become a new leaf in the modified tree. Hence, the tree resulting at the end of each iteration will have at 14 most 7/8 of the leaf-stems of the tree at the beginning of the iteration. Therefore, the number of iterations of the while loop needed to reduce the number of leaf-stems to at most 2n/r is O(log r). We proceed to analyze the running time of Phase 0. In each iteration of the while loop, we call MSEARCH on the matrices for all leaf-stems of S. Since the length of each stem P of S is at most r, there are O(r) matrices formed for P . We perform the preprocessing of Lemma 5 on the matrices, so that each matrix element can be evaluated in O(log2 r) time. The total time of the preprocessing on stems of S is O(n′ log r). Since M has O(n′ ) matrices and the stopping account c is n′ /(2r), each call to MSEARCH produces O(log r) values for feasibility tests in O(n′ log3 r) time (i.e., O(n′ log r) matrix elements will be evaluated). For each leaf-stem without active values, the post-processing time for it is O(r). Hence, the total post-processing time in each iteration is O(n′ ). Since there are O(log r) iterations, the total number of feasibility tests is O(log2 r), and thus the overall time for all feasibility tests in Phase 0 is O(n log2 r). On the other hand, after each iteration, at most n′ /(2r) leaf-stems of S have active values and other leaf-stems of S will be deleted. Since the length of each leaf-stem of S is at most r, the leaf-stems with active values have at most n′ /2 backbone vertices, and thus at least n′ /2 backbone vertices will be deleted in each iteration. Therefore, the total sum of such n′ in all iterations is O(n). Hence, the total time for the preprocessing of Lemma 5 is O(n log r), the total time for MSEARCH is O(n log3 r), and the total post-processing time for leaf-stems without active values is O(n). In summary, the overall time of Phase 0 (excluding the preprocessing in Section 4.1) is O(n log3 r), which is O(n(log log n)3 ) since r = log2 n. ⊔ ⊓ 4.3 Phase 1 We assume that the tree T now has at most 2n/r leaves and we want to place k centers in T to cover all vertices. Note that T may have some thorns and twigs. The main purpose of this phase is to gather information so that each feasibility test can be done in sublinear time, and specifically, O(n/r log3 r) time. Recall that we have a range (λ1 , λ2 ] that contains λ∗ . We first form a stem-partition for T . Then, we further partition the stems into substems, each of length at most r, such that the lowest backbone vertex v in a substem is the highest backbone vertex in the next lower substem (if v has a thorn or/and a twig, then they are included in the upper substem). So this results in a partition of edges. Let S be the set of all substems. Let Tc be the tree in which each node represents a substem of S and node µ in Tc is the parent of node ν if the highest backbone vertex of the substem for ν is the lowest backbone vertex of the substem for µ, and we call Tc the stem tree. As in [15,16], since T has at most 2n/r leaves, |S| = O(n/r) and the number of nodes of Tc is O(n/r). For each substem P ∈ S, we compute the set LP of lines as in Section 3.1. Let L be the set of all the lines for all substems of S. We define the lines of L in the same xy-coordinate system R2 . Clearly, |L| = O(n). Consider the line arrangement A(L). Define vertices v1 (L) and v2 (L) of A(L) as in Section 2. With Lemma 3 and FTEST0, both vertices can be computed in O(n log n) time. We update λ1 = max{λ1 , y(v2 (L))} and λ2 = min{λ2 , y(v1 (L))}. Hence, we still have λ∗ ∈ (λ1 , λ2 ]. We again call the values in (λ1 , λ2 ) active values. For each substem P ∈ S, observe that each element of the matrices formed based on P in Section 3.2 is equal to the y-coordinate of the intersection of two lines of LP , and thus is equal to the y-coordinate of a vertex of A(L). By the definitions of v1 (L) and v2 (L), no matrix element of P is active. 15 y pj pi λ p′j l+ (wi ) x vj wil l− (vj ) Fig. 6. Illustrating the proof of Lemma 11. Note that wil is the point defined by wi , as discussed in Section 3.1. In the future algorithm, we will only need to test feasibilities for values λ ∈ (λ1 , λ2 ). In what follows, we compute a data structure on each substem P of S, so that it will help make the feasibility test faster. We will prove the following lemma and use FTEST1 to denote the feasibility test algorithm in the lemma. Lemma 10. After O(n log n) time preprocessing, each feasibility test can be done in O(n/r · log 3 r) time. We first discuss the preprocessing and then present the algorithm FTEST1. 4.3.1 The Preprocessing for FTEST1 Consider a substem P of S. Let v1 , v2 , . . . , vm be the backbone vertices of P sorted from left to right, with vm as the top vertex. Each vertex vi may have a twig e(wi , vi ) and a thorn e(ui , vi ). Let λ be an arbitrary value in (λ1 , λ2 ). In the following, all statements made to λ is applicable to any λ ∈ (λ1 , λ2 ), and this is due to that none of the elements in the matrices produced by P is active. By the definition of twigs, if we run FTEST0 with λ, the algorithm will place a center, denoted by qi , on each twig e(wi , vi ) at distance λ/w(wi ) from wi We first run the following cleanup procedure to remove all vertices of P that can be covered by the centers on the twigs under λ. The cleanup procedure. We first compute a rank rank ′ (l) for each line l of L, as follows. Let L′ be the sequence of the lines of L sorted by their intersections with the horizontal line y = λ from left to right. By the definitions of λ1 and λ2 , L′ is also the sequence of the lines of L sorted by their intersections with the horizontal line y = λ∗ . In fact, the sequence L′ is unique for any λ ∈ (λ1 , λ2 ). For any line l ∈ L, if there are i − 1 lines before l in L′ , then we define rank′ (l) to be i. Clearly, rank ′ (l) for all lines l ∈ L can be computed in O(n) time. Consider a twig e(wi , vi ) and a backbone vertex vj with j ≥ i. Recall that wi defines a line l+ (wi ) of slope w(wi ) and vj defines a line l− (vj ) of slope −w(vj ) in LP (and thus are in L). We have the following lemma. Lemma 11. For any λ ∈ (λ1 , λ2 ), the center qi on e(wi , vi ) covers vj if and only if rank ′ (l+ (wi )) > rank′ (l− (vj )). Proof. Let pi and pj be the intersections of the horizontal line y = λ with l+ (wi ) and l− (vj ), respectively. Refer to Fig. 6. Let p′j denote the intersection of l− (vj ) with the vertical line through pi . Since qi is located on e(wi , vi ), according to the definitions of l+ (wi ) and l− (vj ), y(p′j ) is exactly equal to w(vj ) · d(qi , vj ). Hence, qi covers vj if and only if p′j is below the line y = λ. On the other hand, p′j is below the line y = λ if and only if pi is to the right of pj , i.e., rank ′ (l+ (wi )) > rank′ (l− (vj )). The lemma thus follows. ⊔ ⊓ 16 Consider a thorn vertex uj with j ≥ i. Recall that uj defines a line l− (uj ) in LP with slope −w(uj ). Similarly as above, qi covers uj if and only if rank′ (l+ (wi )) > rank ′ (l− (uj )). Based on the above observations, we use the following algorithm to find all backbone and thorn vertices of P that can be covered by the centers on the twigs to their left sides. Let i′ be the smallest index such that vi′ has a twig wi′ . The algorithm maintains an index t. Initially, t = i′ . For each i incrementally from i′ to m, we do the following. If vi has a twig-vertex wi , then we reset t to i if rank′ (l+ (wi )) > rank ′ (l+ (wt )). The reason we do so is that if rank ′ (l+ (wi )) > rank ′ (l+ (wt )), then for any j ≥ i such that vj (resp., uj ) is covered by the center qt on the twig e(wt , vt ), vj (resp., uj ) is also covered by the center qi on the twig e(wi , vi ), and thus it is sufficient to maintain the twig e(wi , vi ). Next, if rank′ (l+ (wt )) > rank ′ (l− (vi )), then we mark vi as “covered”. If ui exits and rank′ (l+ (wt )) > rank′ (l− (ui )), then we mark ui as “covered”. The above algorithm runs in O(m) time and marks all vertices vj (reps., uj ) such that there exists a twig e(wi , vi ) with i ≤ j whose center qi covers vj (reps., uj ). In a symmetric way by scanning the vertices from vm to v1 , we can mark in O(m) time all vertices vj (reps., uj ) such that there exits a twig e(wi , vi ) with i ≥ j whose center qi covers vj (reps., uj ). We omit the details. This marks all vertices that are covered by centers on twigs. Let V be the set of backbone and thorn vertices of P that are not marked, which are vertices of P that need to be covered by placing centers on the backbone of P or outside P . If a thorn vertex ui is in V but its connected backbone vertex vi is not in V , this means that vi is covered by a center on a twig while ui is not covered by any such center. Observe that any center on the backbone of P or outside P that covers ui will cover vi as well. For convenience of discussion, we include such vi into V as well. Let v1′ , v2′ , . . . , vt′ be the backbone vertices of V sorted from left to right (i.e., vt′ is closer to the root of T ). Note that v1′ may not be v1 and vt′ may not be vm . If vi′ has a thorn vertex in V , then we use u′i to denote it. This finishes the cleanup procedure. Next, we compute a data structure for P to maintain some information for faster feasibility tests. First of all, we maintain the index a of the twig vertex wa such that rank ′ (l− (wa )) < rank ′ (l− (wi )) for any other twig vertex wi of P . The reason we keep a is the following. Observe that for any vertex v that is a descent vertex of v1 in T (so v is in another substem that is a descent substem of P in the stem tree Tc ), if v can be covered by the center qi on a twig e(vi , wi ) under any λ ∈ (λ1 , λ2 ), then v can also be covered by the center qa on the twig e(va , wa ) under λ. Symmetrically, we maintain the index b of the twig vertex wb such that rank′ (l+ (wb )) > rank′ (l+ (wi )) for any other twig vertex wi . Similarly, this is because for any vertex v that is not in any substem of the subtree rooted at P in Tc , if v can be covered by the center on the twig e(vi , wi ) under λ, then v can also be covered by the center on the twig e(vb , wb ) under λ. Both a and b can be computed in O(m) time. For any two indices i and j with 1 ≤ i ≤ j ≤ t, we use V [i, j] to denote the set of all backbone vertices vl′ and thorn vertices u′l with l ∈ [i, j]. For each index i ∈ [1, t], we maintain an integer ncen(i) and a vertex v(i) of V , which we define below. Roughly speaking, ncen(i) is the minimum number of centers that are needed to cover all vertices of V [i, t], minus one, and if we use ncen(i) centers to cover as many vertices of V [i, t] as possible from left to right, v(i) is the vertex that is not covered but “dominates” all other uncovered vertices under λ. Their detailed definitions are given below. Let ji be the smallest index in [i, t] such that it is not possible to cover all vertices in V [i, ji ] by one center under λ. If such a index ji does not exist, we let ji = t + 1. 17 If ji = t + 1, then we define ncen(i) = 0. We define v(i) as the vertex v in V [i, t] such that rank′ (l+ (v)) < rank ′ (l+ (v ′ )) for any other vertex v ′ ∈ V [i, t]. The reason we maintain such v(i) is as follows. Suppose during a feasibility test with λ, all vertices of V [1, i − 1] have been covered and we need to place a new center to cover those in V [i, t]. According to the greedy strategy of FTEST0, we want to place a center as close to the root γ as possible. There are two cases. In the first case, w(v(i)) · d(v(i), vm ) < λ, and one can verify that if we place a center at the top vertex vm , it can cover all vertices of V [i, t] under λ. In this case, we do not place a center on the backbone of P but will use a center outside P to cover them (more precisely, this center is outside the subtree of Tc rooted at substem P ). We maintain v(i) because any center outside P covering v(i) will cover all other vertices of V [i, t] as well. In the second case, w(v(i)) · d(v(i), vm ) ≥ λ, and we need to place a center on the backbone of P . Again, according to the greedy strategy of FTEST0, we want to place this center close to vm as much as possible, and we use q ∗ to denote such a center. The following lemma shows that q ∗ is determined by v(i). Lemma 12. q ∗ is on the path π(v(i), vm ) of distance λ w(v(i)) from v(i). Proof. The proof is somewhat similar to that of Lemma 6. λ from v(i). Note that since w(v(i)) · Let p be the point on π(v(i), vm ) of distance w(v(i)) d(v(i), vm ) ≥ λ, such a point p must exist on π(v(i), vm ). By definition, p is the point on π(v(i), vm ) closest to vm that can cover v(i). If v(i) is a backbone vertex, then p is on the backbone of P . Otherwise, v(i) is a thorn vertex and w(v(i)) · d(v(i), v) ≤ λ1 , where v is the backbone vertex that connects v(i). Since λ1 < λ, we obtain w(v(i)) · d(v(i), v) < λ, and thus p must be on the backbone of P . Hence, in either case, p is on the backbone of P . Consider any vertex v ′ ∈ V [i, t] with v ′ 6= v(i). In the following, we show that v ′ is covered by p. If v ′ is in the subtree rooted at p (i.e., π(v ′ , vm ) contains p), then since rank′ (l+ (v(i))) < rank′ (l+ (v ′ )), one can verify that v ′ is covered by p. Otherwise, assume to the contrary that p does not cover v ′ . Then, we would need to move p towards v ′ in order to cover v ′ . However, since p is the point on π(v(i), vm ) closest to vm that can cover v(i), p is also the point on π(v(i), v ′ ) closest to v ′ that can cover v(i). Hence, moving p towards v ′ will make p not cover v(i) any more, which implies that no point on the backbone of P can cover both v ′ and v(i). This contradicts with the fact that it is possible to place a center on the backbone of P to cover all vertices in V [i, t]. Therefore, p covers v ′ . The above shows that p is the point on the backbone of P closest to vm that can cover all vertices of V [i, t]. Thus, p is q ∗ , and the lemma follows. ⊔ ⊓ The above defines ncen(i) and v(i) for the case where ji = t + 1. If ji ≤ t, we define ncen(i) and v(i) recursively as ncen(i) = ncen(ji ) + 1 and v(i) = v(ji ). Note that i < ji , and thus this recursive definition is valid. In the following, we present an algorithm to compute ncen(i) and v(i) for all i ∈ [1, t]. In fact, the above recursive definition implies a dynamic programming approach to scan the vertices vi′ backward from t to 1. The details are given in the following lemma. Lemma 13. ncen(i) and v(i) for all i ∈ [1, t] can be computed in O(m log2 m) time. Proof. For any i and j with 1 ≤ i ≤ j ≤ t, consider the following one-center problem: find a center to cover all backbone and thorn vertices of V [i, j]. As discussed in Section 2, each backbone 18 or thorn vertex defines two upper half-planes such that the optimal objective value for the above one-center problem is equal to the y-coordinate of the lowest point in the common intersection of the at most 4(j − i + 1) half-planes defined by the backbone and thorn vertices of V [i, j]. As in Section 2, as preprocessing, we first compute the upper half-planes defined by all vertices of V and order them by the indices of their corresponding vertices in V , and then compute the 2D sublist LP query data structure of Lemma 2 in O(t log t) time. As in Section 2, the lowest point of the common intersection of the upper half-planes defined by vertices of V [i, j] can be computed by a 2D sublist LP query in O(log2 t) time. We use α(i, j) to denote the optimal objective value of the above one-center problem for V [i, j]. With the above preprocessing, given i and j, α(i, j) can be computed in O(log2 t) time. We proceed to compute ncen(i) and v(i) for all i ∈ [1, t]. For each i from t downto 1, we do the following. We maintain the index ji . Initially when i = t, we set ji = t + 1, ncen(i) = 0, and v(i) = vt′ . We process index i as follows. We first compute α(i, ji − 1) in O(log2 t) time. Depending on whether α(i, ji − 1) ≤ λ, there are two cases. If α(i, ji − 1) ≤ λ, then depending on whether ji 6= t + 1, there are two subcases. If ji 6= t + 1, then ncen(i) = ncen(ji ) + 1 and v(i) = v(ji ). Otherwise, we first set ncen(i) = 0 and v(i) = v(i + 1). If rank ′ (l+ (vi′ )) < rank ′ (l+ (v(i))), then we reset v(i) to vi′ . Further, if vi′ has a thorn u′i and rank′ (l+ (u′i )) < rank′ (l+ (v(i))), then we reset v(i) to u′i . If α(i, ji − 1) > λ, we keep decrementing ji by one until α(i, ji − 1) ≤ λ. Then, we reset ncen(i) = ncen(ji ) + 1 and v(i) to v(ji ). It is not difficult to see that the above algorithm runs in O(t log2 t) time, which is O(m log2 m) time since t ≤ m. ⊔ ⊓ Since m ≤ r and r = log2 n, we can compute the data structure for the substem P in O(r(log log n)2 ) time. The total time for computing the data structure for all substems of S is O(n(log log n)2 ). With these data structures, we show that a feasibility test can be done in O(n/r log3 r) time. 4.3.2 The Faster Feasibility Test FTEST1 Given any λ ∈ (λ1 , λ2 ), the goal is to determine whether λ is feasible. We will work on the stem tree Tc , where each node represents a stem of S. Initially, we set sup(P ) = ∞ and dem(P ) = sup(P ) − 1 (so that dem(P ) is an infinitely large value but still smaller than sup(P )) for every stem P of Tc . We perform a post-order traversal on Tc and maintain a variable count, which is the number of centers that have been placed so far. Suppose we are processing a stem P . For each child stem P ′ of P , we reset sup(P ) = min{sup(P ), sup(P ′ )} and dem(P ) = min{dem(P ), dem(P ′ )}. After handling all children of P as above, we process P as follows. First of all, we increase count by the number of twigs in P . Let V be the uncovered vertices of P as defined before, and v1′ , v2′ , . . . , vt′ are backbone vertices of V . Note that t ≤ r. Recall that we have maintained two twig indices a and b for P . Depending on whether sup(P ) ≤ dem(P ), there are two main cases. The case sup(P ) ≤ dem(P ). If sup(P ) ≤ dem(P ), then the uncovered vertices in the children of P can be covered by the center q that determines the value sup(P ) (i.e., q is in a child stem of P and d(q, v1 ) = sup(P ), where v1 is the lowest backbone vertex of P ). Note that we do not need to 19 compute q and we use it only for the discussion. We do binary search on the list of V to find the largest index i ∈ [1, t] such that q can cover the vertices V [1, i]. If no such i exists in [1, t], then let i = 0. Such an index i can be found in O(log2 r) time using the line-constrained 2D sublist LP queries of Lemma 2, as shown in the following lemma. Lemma 14. Such an index i (i.e., the largest index i ∈ [1, t] such that q can cover the vertices V [1, i]) can be found in O(log2 r) time. Proof. Given an index i ∈ [1, t], we show below that we can determine whether q can cover all vertices of V [1, i] in O(log r) time. Recall that in our preprocessing, each vertex of V defines two upper half-planes in R2 , and we have built a 2D sublist LP query data structure on all upper half-planes defined by the vertices of V . Let q ′ be the point on the x-axis of R2 with x-coordinate equal to −sup(P ). Let l be the vertical line through q ′ and let p be the lowest point on l that is in the common intersection of all upper half-planes defined by the vertices of V [1, i]. An observation is that q can cover all vertices of V [1, i] if and only if the y-coordinate of p is at most λ, which can be determined in O(log r) time by a line-constrained 2D sublist LP query. If q can cover all vertices of V [1, i], then we continue the search on the indices larger than i; otherwise, we continue the search on the indices smaller than i. If q cannot cover the vertices of V [1, i] for i = 1, then we return i = 0. The total time is O(log2 r). ⊔ ⊓ If i = t, then all vertices of V can be covered by q. In this case, we reset sup(P ) = min{sup(P )+ d(v1 , vm ), d(wb , vm ) − λ/w(wb )}, where the latter value is the distance from vm to the center at the twig e(vb , wg ). If i < t (this includes the case i = 0), then we increase i by one and reset count = count+ncen(i). If w(v(i))·d(v(i), vm ) < λ, then we reset dem(P ) = λ/w(v(i))−d(v(i), vm ) and sup(P ) = d(wb , vm )− λ/w(wb ). Otherwise, we need to place an additional center on P to cover the uncovered vertices of P including v(i), and thus we increase count by one and reset sup(P ) = min{d(v(i), vm ) − λ/w(v(i)), d(wb , vm ) − λ/w(wb )} and dem(P ) = ∞. The case sup(P ) > dem(P ). In this case, we need to first deal with dem(P ), i.e., covering the vertices in the children stems of P that are not covered. If dem(P ) ≥ d(v1 , wa ) − λ/w(wa ), then the center at the twig e(va , wa ) can cover the uncovered vertices in the children stems of P . In this case, we increase count by ncen(1). If w(v(1)) · d(v(1), vm ) < λ, then we postpone placing centers to the next stem and reset dem(P ) = λ/w(v(1))− d(v(1), vm ) and sup(P ) = d(wb , vm ) − λ/w(wb ). Otherwise, we increase count by one and reset sup(P ) = min{d(v(1), vm ) − λ/w(v(1)), d(wb , vm ) − λ/w(wb )} and dem(P ) = ∞. If dem(P ) < d(v1 , wa ) − λ/w(wa ), then we do binary search to find the largest index i ∈ [1, t] such that we can find a center q on the backbone of P to cover all vertices of V [1, i] with d(v1 , q) ≤ dem(P ). If such an index i does not exit, then we let i = 0. The following lemma shows that such an index i can be found in O(log3 r) time. Lemma 15. Such an index i can be found in O(log3 r) time. Proof. Given any index i, we first show that we can determine in O(log2 r) time the answer to the following question: whether there exists a center q on the backbone of P that can cover all vertices of V [1, i] with d(v1 , q) ≤ dem(P )? 20 By a 2D sublist LP query on the upper half-planes defined by the vertices of V [1, i], we compute the lowest point p in the common intersection of these half-planes. If y(p) > λ, then the answer to the question is no. Otherwise, if x(p) ≤ dem(P ), then the answer to the question is yes. If x(p) > dem(P ), then let l be the vertical line whose x-coordinate is dem(P ). By a line-constrained 2D sublist LP query, we can compute the lowest point p′ on l in the above common intersection of upper half-planes in O(log r) time. If y(p′ ) ≤ λ, then the answer to the above question is yes; otherwise the answer is no. The total time to determine the answer to the question is O(log2 r). If the answer is yes, then we continue the search on indices larger than i; otherwise we continue on indices smaller than i. If the answer to the question is no for i = 1, then we return i = 0. The total running time is O(log3 r). ⊔ ⊓ If i = t, then there are two subcases. If w(v(1))·d(v(1), vm ) < λ and dem(P ) > d(v1 , vm ), then we postpone placing centers to the next stem by resetting dem(P ) = min{dem(P )−d(v1 , vm ), λ/w(v(1))− d(v(1), vm )} and sup(P ) = d(wb , vm ) − λ/w(wb ). Otherwise, we place a center on the backbone of P of distance δ = max{d(v(1), vm ) − dem(P ), d(v(1), vm ) − λ/w(v(1))} from vm . Then, we increase count by one, and reset sup(P ) = min{δ, d(wb , vm ) − λ/w(wb )} and dem(P ) = ∞. If i 6= t (this includes the case i = 0), then we place a center (at a location determined by the algorithm for Lemma 15) to cover dem(P ) as well as the vertices of V [1, i] and increase count by one. Next, we increment i by one and increase count by ncen(i). If w(v(i)) · d(v(i), vm ) < λ, then we reset dem(P ) = λ/w(v(i)) − d(v(i), vm ) and sup(P ) = d(wb , vm ) − λ/w(wb ). Otherwise, we increase count by one and reset sup(P ) = min{d(v(i), vm ) − λ/w(v(i)), d(wb , vm ) − λ/w(wb )} and dem(P ) = ∞. This finishes the processing of the stem P . After the stem Pγ that contains the root γ is processed, if sup(Pγ ) > dem(Pγ ), then we place a center at the root γ to cover the uncovered vertices and increase count by one. The value λ is feasible if and only if count ≤ k. Since we spend O(log3 r) time on each stem of Tc and Tc has O(n/r) stems, FTEST1 runs in O(n/r · log3 r) time. Refer to Algorithm 2 for the pseudocode of FTEST1. 4.4 Phase 2 In this phase, we will finally compute the optimal objective value λ∗ , using the faster feasibility test FTEST1. Recall that we have computed a range (λ1 , λ2 ] that contains λ∗ after Phase 1. We first form a stem-partition of T . While there is more than one leaf-stem, we do the following. Let S be the set of all leaf-stems. For each stem P ∈ S, we compute the set of lines as in Section 3.1, and let L be the set of the lines for all stems of S. With Lemma 3 and FTEST1, we compute the two vertices v1 (L) and v2 (L) of the arrangement A(L) as defined in Section 2. We update λ1 = max{λ1 , y(v2 (L))} and λ2 = min{λ2 , y(v1 (L))}. As discussed in Phase 1, each stem P of S does not have any active values (in the matrices defined by P ). Next, for each stem P of S, we perform the post-processing procedure as in Section 4.2, i.e., place centers on P , subtract their number from k, and replace P by attaching a twig or a thorn to its top vertex. Let T be the modified tree. After the while loop, T is a single stem. Then, we apply above algorithm on the only stem T , and the obtained value λ2 is λ∗ . The running time of Phase 2 is bounded by O(n log n), which is analyzed in the following theorem. Theorem 1. The k-center problem on T can be solved in O(n log n) time. 21 Algorithm 2: The faster feasibility test algorithm FTEST1 Input: The stem-tree Tc , the original k from the input, and λ ∈ (λ1 , λ2 ) Output: Determine whether λ is feasible 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 count ← 0; for each stem P of the stem tree Tc do sup(P ) ← ∞, dem(P ) ← sup(P ) − 1; for each stem P in the post-order traversal of Tc do for each child P ′ of P do sup(P ) = min{sup(P ), sup(P ′ )}, dem(P ) = min{dem(P ), dem(P ′ )}; Increase count by the number of twigs of P ; Let V be the set of the uncovered vertices of P , and v1′ , v2′ , . . . , vt′ are the backbone vertices of V ; if sup(P ) ≤ dem(P ) then Let q be the center in a child stem of P that gives the value sup(P ) ; Do binary search to find the largest index i ∈ [1, t] such that q can cover all vertices of V [1, i]; if i = t then sup(P ) = min{sup(P ) + d(v1 , vm ), d(wb , vm ) − λ/w(wb )}; else i + +, count = count + ncen(i); if w(v(i)) · d(v(i), vm ) < λ then dem(P ) = λ/w(v(i)) − d(v(i), vm ), sup(P ) = d(wb , vm ) − λ/w(wb ); else count + +, sup(P ) = min{d(v(i), vm ) − λ/w(v(i)), d(wb , vm ) − λ/w(wb )}, dem(P ) = ∞; else if dem(P ) ≥ d(v1 , wa ) − λ/w(wa ) then count = count + ncen(1); if w(v(1)) · d(v(1), vm ) < λ then dem(P ) = λ/w(v(1)) − d(v(1), vm ), sup(P ) = d(wb , vm ) − λ/w(wb ); else count + +, sup(P ) = min{d(v(1), vm ) − λ/w(v(1)), d(wb , vm ) − λ/w(wb )}, dem(P ) = ∞; else Do binary search to find the largest i ∈ [1, t] such that there exists a center q on the backbone of P to cover all vertices of V [1, i] with d(v1 , q) ≤ dem(P ); if i = t then if w(v(1)) · d(v(1), vm ) < λ and dem(P ) > d(v1 , vm ) then dem(P ) = min{dem(P ) − d(v1 , vm ), λ/w(v(1)) − d(v(1), vm )}, sup(P ) = d(wb , vm ) − λ/w(wb ); else count + +, δ = max{d(v(1), vm ) − dem(P ), d(v(1), vm ) − λ/w(v(1))}, sup(P ) = min{δ, d(wb , vm ) − λ/w(wb )}, dem(P ) = ∞; else i + +, count = count + 1 + ncen(i); if w(v(i)) · d(v(i), vm ) < λ then dem(P ) = λ/w(v(i)) − d(v(i), vm ), sup(P ) = d(wb , vm ) − λ/w(wb ); else count + +, sup(P ) = min{d(v(i), vm ) − λ/w(v(i)), d(wb , vm ) − λ/w(wb )}, dem(P ) = ∞; 41 if sup(Pγ ) > dem(Pγ ) then count + +; 42 Return true if and only if count ≤ k; 40 22 Proof. As discussed before, Phases 0 and 1 run in O(n log n) time. Below we focus on Phase 2. First of all, as in [16], the number of iterations of the while loop is O(log n) because the number of leaf-stems is halved after each iteration. In each iteration, let n′ denote the total number of backbone vertices of all leaf-stems in S. Hence, |L| = O(n′ ). Thus, the call to Lemma 3 with FTEST1 takes O((n′ + n/r · log3 r) log n′ ) time. The total time of the post-processing procedure for all leaf-stems of S is O(n′ ). Since all leaf-stems of S will be removed in the iteration, the total sum of all such n′ is O(n) in Phase 2. Therefore, the total time of the algorithm in Lemma 3 in Phase 2 is O(n log n + n/r · log3 r log2 n), which is O(n log n) since r = log2 n. Also, the overall time for the post-processing procedure in Phase 2 is O(n). Therefore, the total time of Phase 2 is O(n log n). This proves the theorem. ⊔ ⊓ The pseudocode in Algorithm 3 summarizes the overall algorithm. Algorithm 3: The k-center algorithm Input: A tree T and an integer k Output: The optimal objective values λ∗ and k centers in T 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 Perform the preprocessing in Section 4.1 and compute the “ranks” for all vertices of T ; /* Phase 0 */ r ← log 2 n; Form a stem-partition of T ; while there are more than 2n/r leaves in T do Let S be the set of all leaf-stems of lengths at most r; Form the set M of matrices for all leaf-stems of S by Lemma 5; Let n′ be the total number of all backbone vertices of the leaf-stems of S; Call MSEARCH on M with stopping count c = n′ /(2r), using FTEST0; for each leaf-stem P of S with no active values do Perform the post-processing on P , i.e., place centers on P , subtract their number from k, replace P by a thorn or a twig, and modify the stem-partition of T ; /* Phase 1 For a stem-partition of T , and for each stem, partition it into substems of lengths at most r; Let S be the set of all substems, and form the stem-tree Tc ; Compute the set L of lines for all stems of S in the way discussed in Section 3.1; Compute the two vertices v1 (L) and v2 (L) of A(L) by Lemma 3 and FTEST0, and update λ1 and λ2 ; for each substem P of S do Compute the data structure for the faster feasibility test FTEST1; */ /* Phase 2 */ Form a stem-partition of T ; while there is more than one leaf-stem in T do Compute the set L of lines for all stems of S in the way discussed in Section 3.1; Compute the two vertices v1 (L) and v2 (L) of A(L) by Lemma 3 and FTEST1, and update λ1 and λ2 ; for each leaf-stem of S do Perform the post-processing on P , i.e., place centers on P , subtract their number from k, replace P by a thorn or a twig, and modify the stem-partition of T ; Compute the set L of the lines for the only leaf-stem T ; Compute the two vertices v1 (L) and v2 (L) of A(L) by Lemma 3 and FTEST1, and update λ1 and λ2 ; λ∗ = λ2 ; Apply FTEST0 on λ = λ∗ to find k centers in the original tree T ; 23 5 The Discrete k-Center Problem In this section, we extend our techniques to solve in O(n log n) time the discrete k-center problem on T where centers must be located at the vertices of T . In fact, the problem becomes easier due to the following observation. Observation 1 The optimal objective value λ∗ is equal to w(v) · d(v, u) for two vertices u and v of T (i.e., a center is placed at u to cover v). The previous O(n log2 n) time algorithm in [26] relies on this observation. Megiddo et al. [26] first computed in O(n log2 n) time a collection of O(n log n) sorted subsets that contain the intervertex distances d(u, v) for all pairs (u, v) of vertices of T . By multiplying the weight w(v) by the elements in the subsets corresponding to each vertex v, λ∗ is contained in these new sorted subsets. Then, λ∗ can be computed in O(n log2 n) time by searching these sorted subsets, e.g., using MSEARCH. Frederickson and Johnson [17] later proposed an O(n log n)-time algorithm that computes a succinct representation of all intervertex distances of T by using sorted Cartesian matrices. With MSEARCH, their algorithm solves the unweighted case of the problem in O(n log n) time. However, their techniques may not be generalized to solving the weighted case because once we multiply the vertex weights by the elements of those Cartesian matrices, the new matrices are not sorted any more (i.e., we cannot guarantee that both columns and rows are sorted because different rows or columns are multiplied by weights of different vertices). Our algorithm uses similar techniques as those for the previous non-direcrete k-center problem. In the following we briefly discuss it and mainly focus on pointing out the differences. First of all, we need to modify the feasibility test algorithm FTEST0. The only difference is that when sup(u) ≤ dem(u) and dem(u) < d(u, v), instead of placing a center in the interior of the edge e(u, v), we place a center at u and update sup(v) = min{sup(v), d(u, v)} (i.e., use this to replace Line 11 in the pseudocode of Algorithm 1). The running time is still O(n). We use DFTEST0 to denote the new algorithm. 5.1 The Algorithm for Stems The stem is defined slightly differently than before. Suppose we have a range (λ1 , λ2 ] that contains λ∗ . Each backbone vertex vi of a stem P still has at most one thorn and one twig. The thorn e(ui , vi ) is defined in the same way as before. However, a twig now consists of two edges e(vi , bi ) and e(bi , wi ) such that w(wi )·d(wi , vi ) ≥ λ2 and w(wi )·d(wi , bi ) ≤ λ1 , which means that we have to place a center at bi to cover wi under any λ ∈ (λ1 , λ2 ). We still call wi a twig vertex, and following the terminology in [16], we call bi a bud. Next we give an algorithm to solve the k-center problem on a stem P of m backbone vertices. The algorithm is similar to that in Section 3.2 and uses MSEARCH, but we use a different way to form matrices based on Observation 1. (Note that we will not need a similar algorithm as that in Section 3.1.) Let λ∗ temporarily refer to the optimal objective value for the k-center problem on P in this subsection, and we assume λ∗ ∈ (λ1 , λ2 ]. Let v1 , v2 , . . . , vm be the backbone vertices of P . We again assume that all backbone vertices are in the x-axis such that v1 is at the origin and vi has x-coordinate d(v1 , vi ). As in Section 3.1, for each thorn vertex ui , we define two points uli and uri on the x-axis (whose weights are equal to w(ui )), and we do the same for each bud and each twig vertex. Let P be the set of all vertices on the x-axis. Hence, |P| ≤ 7m. 24 We sort all vertices of P from left to right, and let the sorted list be z1 , z2 , . . . , zt for t ≤ 7m. For any zi , we use x(zi ) to denote its x-coordinate. For each vertex zi , we define two sorted arrays Ali and Ari of lengths at most t as follows. For each j ∈ [1, t − i+ 1], define Ari [j] = w(zi )·(x(zt+1−j )− x(zi )). For each j ∈ [1, i], define Ali [j] = w(zi ) · (x(zi ) − x(zj )). Both arrays are sorted. Let M denote the set of all O(m) sorted arrays defined above. By Observation 1, λ∗ must be an element of an array in M. With O(m log m) time preprocessing, each array element of M can be computed in O(1) time. By applying MSEARCH on M with stopping count c = 0 and using DFTEST0, we can compute λ∗ in O(m log m) time (i.e., MSEARCH produces O(log m) values for feasibility tests in O(m log m) time). 5.2 Solving the Problem in T In the sequel, we solve the discrete k-center problem in T . First, we do the same preprocessing as in Section 4.1. Then, we have three phases as before. Let r = log2 n. 5.2.1 Phase 0 We assume that T has more than 2n/r leaves since otherwise we could skip this phase. Phase 0 is the same as before except the following changes. First, we use DFTEST0 to replace FTEST0. Second, we form the matrix set M in the way discussed in Section 5.1. Third, for each leaf-stem P without active values, we modify the post-processing procedure as follows. Let z be the top vertex of P . We run DFTEST0 on P with z as the root and λ = λ′ as any value in (λ1 , λ2 ). As before, after z is processed, depending on whether sup(z) ≤ dem(z), there are two main cases. The case sup(z) ≤ dem(z). If sup(z) ≤ dem(z), we define q and V (q) in the same way as before but V (q) should not include bud vertices. A difference is that q now is a vertex of P . Note that q 6= z because in this case we do not need to place a center at z. Let w be the vertex that makes q as a center. Specifically, refer to the pseudocode in Algorithm 1, where we place a center q at vertex u at Line 10. Let w be the vertex that determines the value dem(u), i.e., dem(u) = λ′ /w(w) − d(w, u). Note that w must be a descendent of u (= q). In this case, we replace P by a twig consisting of two edges e(z, q) and e(q, w) with lengths equal to d(z, q) and d(q, w), respectively. To find the vertex w, one way is to modify DFTEST0 so that the vertex that determines the value dem(v) for each vertex v of T is also maintained. Another way is that w is in fact the vertex of V (q) with the largest rank, which is proved in the following lemma (whose proof is similar to that of Lemma 6). Note that this is actually consistent with our way for creating twigs in the previous non-discrete case. Lemma 16. w is the vertex of V (q) with the largest rank. Proof. Let v be any vertex of V (q) \ {w}. Our goal is to show that rank(w) > rank(v). Note that q is either a backbone vertex or a bud. We first discuss the case where q is a backbone vertex. We define V1 (q) to be the set of vertices of V (q) in the subtree rooted at q and let V2 (q) = V (q) \ V1 (q). Depending on whether v is in V1 (q) or V2 (q), there are two subcases. If v ∈ V1 (q), assume to the contrary that rank(w) < rank(v). Recall that v defines a line l(v) and w defines a line l(w) in R2 in the preprocessing (see Section 4.1). Refer to Fig. 7. Let pv and 25 y λ′ pv pw p(w) x p(v) l(w) l(v) Fig. 7. Illustrating the proof of Lemma 17. Note that p(v) and p(w) are the points defined respectively by v and w in the preprocessing of Section 4.1. pw denote the intersections of the horizontal line y = λ′ with l(v) and l(w), respectively. Since λ′ ∈ (λ1 , λ2 ), by the definition of ranks, x(pw ) < x(pv ). Note that x(pv ) corresponds to a point qv in π(v, γ) in the sense that x(pv ) = d(γ, qv ), and qv is actually the point on π(v, γ) closest to γ that can cover v. Similarly, x(pw ) corresponds to a point qw in π(w, γ). Since x(pw ) < x(pv ), d(γ, qw ) < d(γ, qv ). One can verify that this contradicts with that w is the vertex that makes q as a center (i.e., w determines the value dem(u)), because both v and w are descendants of q. If v ∈ V2 (q), first note that v cannot be a twig vertex since otherwise q would need to be a bud in order to cover v. Depending on whether v is a backbone vertex or a thorn vertex, there are two subcases. y λ′ y pw p(v) x p(w) l(v) pw pv λ′ pv p(v ′ ) l(v) l(w) Fig. 8. Illustrating the proof of Lemma 17. x p(v) p(w) l(w) Fig. 9. Illustrating the proof of Lemma 17. 1. If v is a backbone vertex, then v is an ancestor of q. Let pv and pw be the intersections of the horizontal line y = λ′ with l(v) and lw , respectively (e.g., see Fig. 8). Since w determines the center q and v is an ancestor of q, according to DFTEST0, it holds that w(w)·d(w, v) < λ′ . Since q is an ancestor of w, v is also an ancestor of w. Therefore, the point p(v) (i.e., the intersection of l(v) with the x-axis) must be to the left of the vertical line through pw . Since the slope of l(v) is not positive, x(pv ) < x(pw ). Because λ′ ∈ (λ1 , λ2 ), we obtain that rank(v) < rank(w). 2. If v is a thorn vertex, assume to the contrary that rank(w) < rank(v). Let v ′ be the backbone vertex that connects v. Since v ∈ V2 (q) and q is a backbone vertex, v ′ must be an ancestor of q. Because rank(w) < rank(v), in the following we will prove w(v) · d(v, q) > λ′ , which implies that q cannot cover v and thus incurs contradiction. By our preprocessing in Section 4.1, the vertex v ′ defines a point p(v ′ ) in the x-axis of R2 (e.g., see Fig. 9). With a little abuse of notation, we use x(v ′ ) to denote the x-coordinate of p(v ′ ). We define pv and pw in the same way as before. Since w determines q and v ′ is an ancestor of q, according to DFTEST0, it holds that w(w) · d(w, v ′ ) < λ′ . This implies that x(v ′ ) < x(pw ). Since rank(w) < rank(v) and λ′ ∈ (λ1 , λ2 ), 26 x(pw ) < x(pv ). Thus, x(v ′ ) < x(pv ) and the y-coordinate of the intersection of the vertical line through p(v ′ ) and l(v) is larger than λ′ . Note that the above y-coordinate is equal to w(v) · d(v, v ′ ). Therefore, we obtain w(v) · d(v, v ′ ) > λ′ . Since the path π(q, v) contains the thorn e(v, v ′ ), we have d(v, q) ≥ d(v, v ′ ). Thus, it holds that w(v) · d(v, q) > λ′ . The above proves that rank(w) > rank(v) for the case where q is a backbone vertex. Next we discuss the case where q is a bud. Since w is a descendent of q, w must be a twig vertex on the same twig as q. Let v ′ be the backbone vertex that connects q. We say that v is above v ′ if π(z, v ′ ) either contains v (when v is a backbone vertex) or contains the backbone vertex that connects v (when v is a thorn vertex); otherwise, v is below v ′ . If v is above v ′ , then the analysis is similar to the above subcase v ∈ V2 (q). We omit the details. In the following, we analyze the case where v is below v ′ . Although v may be either a backbone vertex or a thorn vertex, we prove rank(w) > rank(v) in a uniform way. Assume to the contrary that rank(w) < rank(v). Again, refer to Fig. 9. We define the points in the figure in the same way as before except that v ′ is now the backbone vertex that connects q. Our goal is to show that w(v) · d(v, q) > λ′ , which incurs contradiction since q covers v. To this end, since d(v, v ′ ) ≤ d(v, q), it is sufficient to show that w(v) · d(v, v ′ ) > λ′ . The proof is similar to the above subcase where v is a thorn vertex, and we briefly discuss it below. Since w determines q and v ′ is an ancestor of q, it holds that w(w) · d(w, v ′ ) < λ′ . This implies that x(v ′ ) < x(pw ). Since rank(w) < rank(v) and λ′ ∈ (λ1 , λ2 ), x(pw ) < x(pv ). Thus, x(v ′ ) < x(pv ) and the y-coordinate of the intersection of the vertical line through p(v ′ ) and l(v) is larger than λ′ . Again, the above y-coordinate is equal to w(v) · d(v, v ′ ). Therefore, w(v) · d(v, v ′ ) > λ′ . This proves the lemma. ⊔ ⊓ The above replaces P by attaching a twig e(z, q) ∪ e(q, w) to z. In addition, if z already has another twig with bud q ′ , then we discard the new twig if d(q, z) ≥ d(q ′ , z) and discard the old twig otherwise. This guarantees that z has at most one twig. The case sup(z) > dem(z). If sup(z) > dem(z), then we define V in the same way as before but excluding the buds. Let u be the vertex of V with the largest rank. As before in Lemma 7, u dominates all other vertices of V and thus we replace P by a thorn e(u, z) whose length is equal to d(u, z). In addition, if z already has another thorn e(z, u′ ), then as before (and for the same reason), we discard one of u and u′ whose rank is smaller. This finishes the post-processing procedure on P . The running time is still O(m). By similar analysis as in Lemma 9, Phase 0 still runs in O(n log n) time and we omit the details. 5.2.2 Phase 1 First of all, we still form a stem-tree Tc as before and each node represents a substem of length at most r. Instead of using the line arrangement searching technique, we now resort to MSEARCH. Let S be the set of all substems. Let M be the set of matrices of all these substems formed in the way described in Section 5.1. We apply MSEARCH on M with stopping count c = 0 and using DFTEST0. Since M has O(n) arrays of lengths O(r), MSEARCH will produce O(log n) values for feasibility tests in O(n log r) time. The total feasibility test time is O(n log n). Since c = 0, after MSEARCH stops, we have an updated range (λ1 , λ2 ) and no matrix element of M is active. Let λ be an arbitrary value in (λ1 , λ2 ). 27 We will compute a data structure for each stem P of S so that the feasibility test can be made in sublinear time. We will show that after O(n log n) time preprocessing, each feasibility test can be done in O(n/r log3 r) time. Let P be a substem with backbone vertices v1 , v2 , . . . , vm , with vm as the top vertex. The preprocessing algorithm works in a similar way as before. The cleanup procedure. Again, we first perform a cleanup procedure to remove all vertices of P that can be covered by the centers at the buds of the twigs. Note that all buds and twig vertices can be automatically covered by the centers at buds. So we only need to find those backbone and thorn vertices that can be covered by buds. This is easier than before because the locations of the centers are now fixed at buds. We use the following algorithm to find all backbone and thorn vertices that can be covered by buds to their left sides. Let i′ be the smallest index such that vi′ has a bud bi′ . The algorithm maintains an index t. Initially, t = i′ . For each i incrementally from i′ to m, we do the following. If vi has a bud bi , then we reset t to i if d(bi , vi ) ≤ d(bt , vi ), because for any j ≥ i such that vj (resp., uj ) is covered by bt , it is also covered by bi . Next, if w(vi ) · d(vi , bt ) ≤ λ, then we mark vi as “covered”. If ui exits and w(ui ) · d(ui , bt ) ≤ λ, then we mark ui as “covered”. Note that although ui is not an ancestor or a descendent of bt , we can still compute d(ui , bt ) in O(1) time because d(ui , bt ) = d(ui , vi ) + d(vi , bt ), and the latter two distances can be computed in O(1) time due to the preprocessing in Section 4.1. The above algorithm runs in O(m) time. In a symmetric way by scanning P from right to left, we can also mark all backbone and thorn vertices that are covered by buds to their right sides. This finishes the cleanup procedure. Again, we define V in the same way as before, and let v1′ , v2′ , . . . , vt′ be the backbone vertices in V . Also, define V [i, j] in the same way as before. Computing the data structure. In the sequel, we compute a data structure for P . As before, we maintain an index a of a twig such that d(v1 , ba ) ≤ d(v1 , bi ) for any other twig index i, and maintain an index b of a twig such that d(vm , bb ) ≤ d(vm , bi ) for any other twig index i. Both a and b can be found in O(m) time. For each i ∈ [1, t], we will also compute an integer ncen(i) and a vertex v(i) of V , whose definitions are similar as before. In addition, we maintain another vertex q(i). The details are given below. Define ji similarly as before, i.e., it is the smallest index in [i, t] such that it is not possible to cover all vertices in V [i, ji ] by a center located at a vertex of P under λ. Again, if such an index does not exist in [i, t], then let ji = t + 1. If ji = t + 1, then we define ncen(i) = 0, and define v(i) as the vertex in V [i, t] with the largest rank. We should point out our definition on v(i) is consistent with before, which was based on rank′ (l+ (v)) for v ∈ V , because for any two vertex v and v ′ in V , rank(v) > rank(v ′ ) if and only if rank ′ (l+ (v)) < rank ′ (l+ (v ′ )). With the same analysis as before, v(i) dominates all other vertices of V [i, t]. We define q(i) as follows. If w(v(i)) · d(v(i), vm ) < λ, then q(i) is undefined. Otherwise, q(i) is the largest index j ∈ [i, t] such that w(v(i)) · d(v(i), vj ) ≤ λ. Therefore, q(i) refers to the index of the backbone vertex closest to vm that can cover v(i), and by the definition of v(i), q(i) can also cover all other vertices of V [i, t] (the proof is similar to Lemma 12 and we omit it). If ji < t + 1, then define ncen(i) = ncen(ji ) + 1, v(i) = v(ji ), and q(i) = q(ji ). To compute ncen(i), v(i), and q(i) for all i ∈ [1, t], observe that once v(i) is known, q(i) can be computed in additional O(log m) time by binary search on the backbone vertices of P . Therefore, we will focus on computing ncen(i) and v(i). We use a similar algorithm as that in Lemma 13. To this end, we need to solve the following subproblem: Given any two indices i ≤ j in [1, t], we want 28 to compute the optimal objective value, denoted by α′ (i, j), of the discrete one-center problem on the vertices of V [i, j]. This can be done in O(log2 m) time by using the 2D sublist LP query data structure, as shown in the following lemma. Lemma 17. With O(m log m) time preprocessing, we can compute α′ (i, j) in O(log2 m) time for any two indices i ≤ j in [1, t]. Proof. As preprocessing, in O(t log t) time we build the 2D sublist LP query data structure on the upper half-planes defined by the vertices of V in the same way as before. Given any indices i ≤ j in [1, t], by a 2D sublist LP query, we compute in O(log2 t) time the lowest point p in the common intersection C of the upper half-planes defined by the vertices of V [i, j]. Let q be the point on the backbone of P corresponding to the x-coordinate of p (i.e., d(v1 , q) = x(p)). Note that q is essentially the optimal center for the non-discrete one-center problem on the vertices of V [i, j]. But since we are considering the discrete case, the optimal center q ′ for the discrete problem can be found as follows. If q is located at a vertex of P , then q ′ = q and α′ (i, j) is equal to the y-coordinate of p. Otherwise, let v and v ′ be the two backbone vertices of P immediately on the left and right sides of q, respectively. Then, q ′ is either v or v ′ , and this is because the boundary of C, which is the upper envelope of the bounding lines of the upper half-planes defined by the vertices of V [i, j], is convex. To compute α′ (i, j), we do the following. Let lv be the line in R2 whose x-coordinate is equal to d(v1 , v). Defined lv′ similarly. Let pv be the lowest point of lv in C. Define pv′ similarly. Then, α′ (i, j) is equal to the y-coordinate of the lower point of pv and pv′ , and the center q ′ can also be determined correspondingly. Both v and v ′ can be found by binary search on the backbone vertices of V in O(log m) time. The point pv (resp., pv′ ) can be found by a line-constrained 2D sublist LP query in O(log t) time. Since t ≤ m, we can compute α′ (i, j) in O(log2 m) time. ⊔ ⊓ With the preceding lemma, we can use a similar algorithm as in Lemma 13 to compute ncen(i) and v(i) for all i ∈ [1, t] in O(m log2 m) time. Again, q(i) for all i ∈ [1, t] can be computed in additional O(m log m) time by binary search. Recall that m ≤ r. Hence, the preprocessing time for P is O(r log2 r), which is O(r(log log n)2 ) time since r = log2 n. The total time for computing the data structure for all substems of S is O(n(log log n)2 ). With these data structures, we show that a feasibility test can be done in O(n/r log3 r) time. The faster feasibility test DFTEST1. The algorithm is similar as before, and we only explain the differences by referring to the pseudocode given in Algorithm 4 for DFTEST1. First of all, we can still implement Line 11 in O(log2 r) time by exactly the same algorithm in Lemma 14. For the binary search in Line 28, since now we have a constraint that q must be at a backbone vertex, we need to modify the algorithm in Lemma 15, as follows. We show that given any index i ∈ [1, t], we can determine in O(log2 r) time whether there is a center at a backbone vertex of P that can cover all vertices of V [1, i] with d(v1 , q) ≤ dem(P ). We first compute the center q and its optimal objective value α′ (1, i) for the discrete one-center problem on the vertices of V [1, i], which can be done in O(log2 r) time as shown the proof of Lemma 17. If α′ (1, i) > λ, then the answer is no. Otherwise, if d(v1 , q) ≤ dem(P ), then the answer is yes. If d(v1 , q) > dem(P ), then let j be the largest index of [1, m] such that dem(P ) ≥ d(v1 , vj ), and j can be found in O(log r) time by binary search on the backbone vertices of P . Let l be the vertical line of R2 whose x-coordinate is equal to d(v1 , vj ). By a line-constrained 2D sublist LP query, we 29 Algorithm 4: The faster feasibility test algorithm DFTEST1 Input: The stem-tree Tc , the original k from the input, and λ ∈ (λ1 , λ2 ) Output: Determine whether λ is feasible 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 count ← 0; for each stem P of the stem tree Tc do sup(P ) ← ∞, dem(P ) ← sup(P ) − 1; for each stem P in the post-order traversal of Tc do for each child P ′ of P do sup(P ) = min{sup(P ), sup(P ′ )}, dem(P ) = min{dem(P ), dem(P ′ )}; Increase count by the number of twigs of P ; Let V be the set of the uncovered vertices of P , and v1′ , v2′ , . . . , vt′ are the backbone vertices of V ; if sup(P ) ≤ dem(P ) then Let q be the center in a child stem of P that gives the value sup(P ) ; Do binary search to find the largest index i ∈ [1, t] such that q can cover all vertices of V [1, i]; if i = t then sup(P ) = min{sup(P ) + d(v1 , vm ), d(bb , vm )}; /* bb is the bud maintained for P */ else i + +, count = count + ncen(i); if w(v(i)) · d(v(i), vm ) < λ then dem(P ) = λ/w(v(i)) − d(v(i), vm ), sup(P ) = d(bb , vm ); else count + +, sup(P ) = min{d(q(i), vm ), d(bb , vm )}, dem(P ) = ∞; else if dem(P ) ≥ d(v1 , ba ) then /* ba is the bud maintained for P */ count = count + ncen(1); if w(v(1)) · d(v(1), vm ) < λ then dem(P ) = λ/w(v(1)) − d(v(1), vm ), sup(P ) = d(bb , vm ); else count + +, sup(P ) = min{d(q(1), vm ), d(bb , vm )}, dem(P ) = ∞; else Do binary search to find the largest i ∈ [1, t] such that there exists a center q at the backbone vertex of P to cover all vertices of V [1, i] with d(v1 , q) ≤ dem(P ); if i = t then if w(v(1)) · d(v(1), vm ) < λ and dem(P ) > d(v1 , vm ) then dem(P ) = min{dem(P ) − d(v1 , vm ), λ/w(v(1)) − d(v(1), vm )}, sup(P ) = d(bb , vm ); else Do binary search to find the largest j ∈ [1, m] such that dem(P ) ≥ d(v1 , vj ); count + +, δ = max{d(vj , vm ), d(q(1), vm )}, sup(P ) = min{δ, d(bb , vm )}, dem(P ) = ∞; else i + +, count = count + 1 + ncen(i); if w(v(i)) · d(v(i), vm ) < λ then dem(P ) = λ/w(v(i)) − d(v(i), vm ), sup(P ) = d(bb , vm ); else count + +, sup(P ) = min{d(q(i), vm ), d(bb , vm )}, dem(P ) = ∞; 42 if sup(Pγ ) > dem(Pγ ) then count + +; 43 Return true if and only if count ≤ k; 41 30 compute the lowest point p′ on l in the common intersection of the upper half-planes defined by the vertices of V [1, i]. The answer is yes if and only if the y-coordinate of p′ is at most λ. Hence, the time to determine the answer to the above question is O(log2 r). Therefore, the time for implementing Line 28 is O(log3 r). In addition, it is easy to see that the time of the binary search in Line 33 is O(log r). Therefore, processing P takes O(log3 r) time, and the total time of DFTEST1 is O(n/r log3 r), the same as before. 5.2.3 Phase 2 This phase is the similar as before with the following changes. First, we use DFTEST1 to replace FTEST1. Second, we use the new post-processing procedure. Third, instead of using the line arrangement searching technique, we use MSEARCH. Specifically, in the pseudocode of Algorithm 3, we replace Lines 19 and 20 (and also Lines 23 and 24 ) by the following. For each leaf-stem of S, we form the matrices for P in the way discussed in Section 5.1, and let M denote the set of matrices for all leaf-stems of S. Then, we call MSEARCH on M with stopping count c = 0 and DFTEST1. The running time of all three phases is still O(n log n), as shown in Theorem 2. Theorem 2. The discrete k-center problem for T can be solved in O(n log n) time. Proof. The analysis is similar to that in Theorem 1, we briefly discuss it below. Since Phase 0 and Phase 1 run in O(n log n) time, we only discuss Phase 2. Again, the number of iterations of the while loop is O(log n). Hence, there are O(log n) calls to MSEARCH. Each call to MSEARCH produces O(log n) values for feasibility tests. Therefore, the total number of feasibility tests is O(log2 n). With DFTEST1, the total time on feasibility tests is O(n/r · log3 r · log2 n) = O(n log n). In each iteration, let n′ denote the total number of backbone vertices of all leaf-stems. According to our discussion in Section 5.1, the call to MSEARCH takes O(n′ log n′ ) time (excluding the time for feasibility tests) since each matrix element of M can be obtained in O(1) time. As the total sum of all such n′ is O(n) in Phase 2, the overall time of MSEARCH in Phase 2 is O(n log n). Also, the overall time for the post-processing procedure in Phase 2 is O(n). Therefore, the total time of Phase 2 is O(n log n). This proves the theorem. ⊔ ⊓ References 1. P.K. Agarwal and J.M. Phillips. An efficient algorithm for 2D Euclidean 2-center with outliers. In Proceedings of the 16th Annual European Conference on Algorithms(ESA), pages 64–75, 2008. 2. M. Ajtai, J. Komlós, and E. Szemerédi. An O(n log n) sorting network. In Proc. of the 15th Annual ACM Symposium on Theory of Computing (STOC), pages 1–9, 1983. 3. A. Banik, B. Bhattacharya, S. Das, T. Kameda, and Z. Song. The p-center problem in tree networks revisited. In Proc. of the 15th Scandinavian Symposium and Workshops on Algorithm Theory (SWAT), pages 6:1–6:15, 2016. 4. B. Bhattacharya and Q. Shi. Optimal algorithms for the weighted p-center problems on the real line for small p. In Proc. of the 10th International Workshop on Algorithms and Data Structures, pages 529–540, 2007. 5. P. Brass, C. Knauer, H.-S. Na, C.-S. Shin, and A. Vigneron. The aligned k-center problem. International Journal of Computational Geometry and Applications, 21:157–178, 2011. 6. H Brönnimann and B. Chazelle. Optimal slope selection via cuttings. Computational Geometry: Theory and Applications, 10(1):23–29, 1998. 7. T.M. Chan. More planar two-center algorithms. Computational Geometry: Theory and Applications, 13:189–198, 1999. 8. R. Chandrasekaran and A. Tamir. Polynomially bounded algorithms for locating p-centers on a tree. Mathematical Programming, 22(1):304–315, 1982. 31 9. D.Z. Chen, J. Li, and H. Wang. Efficient algorithms for the one-dimensional k-center problem. Theoretical Computer Science, 592:135–142, 2015. 10. D.Z. Chen and H. Wang. Approximating points by a piecewise linear function. Algorithmica, 88:682–713, 2013. 11. D.Z. Chen and H. Wang. A note on searching line arrangements and applications. Information Processing Letters, 113:518–521, 2013. 12. R. Cole. Slowing down sorting networks to obtain faster sorting algorithms. Journal of the ACM, 34(1):200–208, 1987. 13. G. Cormode and A. McGregor. Approximation algorithms for clustering uncertain data. In Proc. of the 27t Symposium on Principles of Database Systems (PODS), pages 191–200, 2008. 14. G. Frederickson and D. Johnson. Generalized selection and ranking: Sorted matrices. SIAM Journal on Computing, 13(1):14–30, 1984. 15. G.N. Frederickson. Optimal algorithms for tree partitioning. In Proc. of the 2nd Annual ACM-SIAM Symposium of Discrete Algorithms (SODA), pages 168–177, 1991. 16. G.N. Frederickson. Parametric search and locating supply centers in trees. In Proc. of the 2nd International Workshop on Algorithms and Data Structures (WADS), pages 299–319, 1991. 17. G.N. Frederickson and D.B. Johnson. Finding kth paths and p-centers by generating and searching good data structures. Journal of Algorithms, 4(1):61–80, 1983. 18. L. Huang and J. Li. Stochastic k-center and j-flat-center problems. In Proceedings of the ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 110–129, 2017. 19. M. Jeger and O. Kariv. Algorithms for finding P -centers on a weighted tree (for relatively small P ). Networks, 15(3):381–389, 1985. 20. O. Kariv and S.L. Hakimi. An algorithmic approach to network location problems. I: The p-centers. SIAM Journal on Applied Mathematics, 37(3):513–538, 1979. 21. A. Karmakar, S. Das, S.C. Nandy, and B.K. Bhattacharya. Some variations on constrained minimum enclosing circle problem. Journal of Combinatorial Optimization, 25(2):176–190, 2013. 22. M. Katz and M. Sharir. Optimal slope selection via expanders. Information Processing Letters, 47(3):115–122, 1993. 23. N. Megiddo. Linear-time algorithms for linear programming in R3 and related problems. SIAM Journal on Computing, 12(4):759–776, 1983. 24. N. Megiddo and K.J. Supowit. On the complexity of some common geometric location problems. SIAM Journal on Comuting, 13:182–196, 1984. 25. N. Megiddo and A. Tamir. New results on the complexity of p-centre problems. SIAM J. on Computing, 12(4):751–758, 1983. 26. N. Megiddo, A. Tamir, E. Zemel, and R. Chandrasekaran. An O(n log 2 n) algorithm for the k-th longest path in a tree with applications to location problems. SIAM J. on Computing, 10:328–337, 1981. 27. H. Wang and J. Zhang. One-dimensional k-center on uncertain data. Theoretical Computer Science, 602:114–124, 2015. 28. H. Wang and J. Zhang. Line-constrained k-median, k-means, and k-center problems in the plane. International Journal of Computational Geometry and Applications, 26:185–210, 2016. 29. H. Wang and J. Zhang. A note on computing the center of uncertain data on the real line. Operations Research Letters, 44:370–373, 2016. 30. H. Wang and J. Zhang. Computing the center of uncertain points on tree networks. Algorithmica, 609:32–48, 2017. 31. H. Wang and J. Zhang. Covering uncertain points in a tree. In Proc. of the 15th Algorithms and Data Structures Symposium (WADS), pages 557–568, 2017. 32
8cs.DS
A Joint Speaker-Listener-Reinforcer Model for Referring Expressions Licheng Yu, Hao Tan, Mohit Bansal, Tamara L. Berg Department of Computer Science University of North Carolina at Chapel Hill arXiv:1612.09542v2 [cs.CV] 17 Apr 2017 {licheng, airsplay, mbansal, tlberg}@cs.unc.edu Abstract (expressions that apply to the target object but not to other objects in the image). This goal corresponds to the Gricean Maxim [8] of manner, where one tries to be as clear, brief, and orderly as possible while avoiding obscurity and ambiguity. Avoiding ambiguity is important because the generated expression should be easily and uniquely mapped to the target object. For example, if there were two pens on the table one “long and red” and the other “short and red”, asking for the “red pen” would be ambiguous while asking for the “long pen” would be better. The reinforcer module is incorporated using reinforcement learning, inspired by behavioral psychology that says that agents operating in an environment should take actions that maximize their expected cumulative reward. In our case, the reward takes the form of a discriminative classifier trained to reward the speaker for generating less ambiguous expressions. Referring expressions are natural language constructions used to identify particular objects within a scene. In this paper, we propose a unified framework for the tasks of referring expression comprehension and generation. Our model is composed of three modules: speaker, listener, and reinforcer. The speaker generates referring expressions, the listener comprehends referring expressions, and the reinforcer introduces a reward function to guide sampling of more discriminative expressions. The listenerspeaker modules are trained jointly in an end-to-end learning framework, allowing the modules to be aware of one another during learning while also benefiting from the discriminative reinforcer’s feedback. We demonstrate that this unified framework and training achieves state-of-theart results for both comprehension and generation on three referring expression datasets. Project and demo page: https://vision.cs.unc.edu/refer. Within the realm of referring expressions, there are two tasks that can be computationally modeled, mimicking the listener and speaker roles. Referring Expression Generation (speaker) requires an algorithm to generate a referring expression for a given target object in a visual scene, as shown in Fig. 1. Referring Expression Comprehension (listener) requires an algorithm to localize the object/region in an image described by a given referring expression, as shown in Fig. 2. 1. Introduction People often use referring expressions in their everyday discourse to unambiguously identify or indicate particular objects within their physical environment. For example, one might point out a person in the crowd by referring to them as “the man in the blue shirt” or you might ask someone to “pass me the red pen on the table.” In both of these examples, we have a pragmatic interaction between two people (or between a person and an intelligent agent such as a robot). First, we have a speaker who must generate an expression given a target object and its surrounding world context. Second, we have a listener who must interpret and comprehend the expression and map it to an object in the environment. Therefore, in this paper we propose an endto-end trained listener-speaker framework that models these behaviors jointly. In addition to the listener and speaker, we also introduce a new reinforcer module that learns a discriminative reward model to help generate less ambiguous expressions The Referring Expression Generation (REG) task has been studied since the 1970s [29]. Many of the early works in this space focused on relatively limited datasets, using synthesized images of objects in artificial scenes or limited sets of real-world objects in simplified environments [20, 7, 15]. Recently, the research focus has shifted to more complex natural image datasets and has expanded to include the Referring Expression Comprehension task [13, 19, 31] as well as to real-world interactions with robotics [4, 3]. One reason this has become feasible is that several large-scale REG datasets have been collected at a scale where deep learning models can be applied. Kazemzadeh et al [13] introduced the first large-scale REG dataset on 20k natural images from the ImageClef dataset [9] using an interactive game, later expanded to im1 Figure 1: Joint generation examples using our full model with “+rerank” on three datasets. Each sentence shows the generated expression for one of the depicted objects (color coded to indicate correspondence). Figure 2: Example comprehension results using our full model on three datasets. Green box shows the ground-truth region and blue box shows our correct comprehension based on the detected regions. ages from the MSCOCO dataset [17] in Yu et al [31]. In addition, Mao et al [19] collected Google’s REG dataset, also based on MSCOCO images, but in a non-interactive setting, resulting in more complex lengthy expressions. In this paper, we focus our evaluations on the three recent datasets collected on MSCOCO images [31, 19]. LSTM model as in [23, 26], but previously was only applied to the referring expression comprehension task. Recent work [1] has also used both an encoder-decoder model (speaker) and an embedding model (listener) for referring expression generation in abstract images, where the offline listener reranks the speaker’s output. In this paper, we propose a unified model that jointly learns both the CNN-LSTM speaker and embedding-based listener models, for both the generation and comprehension tasks. Additionally, we add a discriminative reward-based reinforcer to guide the sampling of more discriminative expressions and further improve our final system. Instead of working independently, we let the speaker, listener, and reinforcer interact with each other, resulting in improved performance on both generation and comprehension tasks. Results evaluated on three standard, large-scale datasets verify that our proposed listener-speaker-reinforcer model significantly outperforms the state-of-the-art on both the comprehension task (Tables 1 and 2) and the generation task (evaluated using human judgements in Table 4, and automatic metrics in Table 3). Recent neural approaches to the referring expression generation and comprehension tasks can be roughly split into two types. The first type uses a CNN-LSTM encoderdecoder generative model [25] to generate (decode) sentences given the encoded target object. With careful design of the visual representation of target object, this model can generate unambiguous expressions [19, 31]. Here, the CNN-LSTM models P (r|o), where r is the referring expression and o is the target object, which can be easily converted to P (o|r) via Bayes’ rule and used to address the comprehension task [10, 19, 31, 21] by selecting the o with the largest posterior probability. The second type of approach uses a joint-embedding model that projects both a visual representation of the target object and a semantic representation of the expression into a common space and learns a distance metric. Generation and comprehension can be performed by embedding a target object (or expression) into the embedding space and retrieving the closest expression (or object) in this space. This type of approach typically achieves better comprehension performance than the CNN- 2. Related work Recent years have witnessed a rise in multimodal research related to vision and language. Given the individual success in each area, and the need for models with more 2 advanced cognition capabilities, several tasks have emerged as evaluation applications, including image captioning, visual question answering, and referring expression generation/comprehension. Image Captioning: The aim of image captioning is to generate a sentence describing the general content of an image. Most recent approaches use deep learning to address this problem. Perhaps the most common architecture is a CNNLSTM model [25], which generates a sentence conditioned on visual information from the image. One paper related to our work is gLSTM [11] which uses CCA semantics to guide the caption generation. A further step beyond image captioning is to locate the regions being described in captions [27, 22, 26]. The Visual Genome [16] collected captions for dense regions in an image that have been used for dense-captioning tasks [12]. While there have been many approaches achieving quite good results on captioning, one challenge has been that the caption that a system should output for an image is very task dependent. Therefore, there has been a movement toward more focused tasks, such as visual question answering [2, 30], and referring expression generation and comprehension which involve specific regions/objects within an image (discussed below). Referring Expression Datasets: REG has been studied for many years [29, 15, 20] in linguistics and natural language processing, but mainly focused on small or artificial datasets. In 2014, Kazemzadeh et al [13] introduced the first large-scale dataset RefCLEF using 20,000 real-world natural images [9]. This dataset was collected in a two-player game, where the first player writes a referring expression given an indicated target object. The second player is shown only the image and expression and has to click on the correct object described by the expression. If the click lies within the target object region, both sides get points and their roles switch. Using the same game interace, the authors further collected RefCOCO and RefCOCO+ datasets on MSCOCO images [31]. The RefCOCO and RefCOCO+ datasets each contain 50,000 referred objects with 3 referring expressions on average. The main difference between RefCOCO and RefCOCO+ is that in RefCOCO+, players were forbidden from using absolute location words, e.g. left dog, therefore focusing the referring expression to purely appearance-based descriptions. In addition, Mao et al [19] also collected a referring expression dataset - RefCOCOg, using MSCOCO images, but in a non-interactive framework. These expressions are more similar to the MSCOCO captions in that they are longer and more complex as their was no time constraint in the non-interactive data collection setting. This dataset, RefCOCOg, has 96,654 objects with 1.3 expressions per object on average. Referring Expression Comprehension and Generation: Referring expressions are associated with two tasks, comprehension and generation. The comprehension task re- quires a system to select the region being described by a given referring expression. To address this problem, [19, 31, 21, 10] model P (r|o) and looks for the object o maximizing the probability. People also try modeling P (o, r) directly using embedding model [23, 26], which learns to minimize the distance between paired object and sentence in the embedding space. The generation task asks a system to compose an expression for a specified object within an image. While some previous work used rulebased approaches to generate expressions with fixed grammar pattern [20, 5, 13], recent work has followed the CNNLSTM structure to generate expressions [19, 31]. A Speaker and listener are typically considerred to formulate the two tasks, where speaker model is used for referring expression generation and listener is used for comprehension. Golland et al [7] proposed that an optimal speaker should act based on listener’s response. Mao et al [19] followed this idea by suppressing the ambiguity of listener in modeling P (r|o). Most related work to us is [1], which uses a speaker model to generate expressions for abstract images then uses an offline listener to rerank the speaker’s output. Compared with above, our model jointly trains the speaker and listener modules and has an additional reinforcer module to encourage unambiguous speaker expression generation. Moreover, we use our models for both generation and comprehension tasks on three natural image datasets. 3. Model Our model is composed of three modules: speaker (Sec 3.1), listener (Sec 3.2), and reinforcer (Sec 3.3). During training, the speaker and listener are trained jointly so that they can benefit from each other and from the reinforcer. Because the reward function for the reinforcer is not differentiable, it is incorporated during training using a reinforcement learning policy gradient algorithm. 3.1. Speaker For our speaker module, we follow the previous state-ofthe-art [19, 31], and use a CNN-LSTM framework. Here, a pre-trained CNN model is used to define a visual representation for the target object and other visual context. Then, a Long-short term memory (LSTM) is used to generate the most likely expression given the visual representation. Because of the improved quantitative performance over [19], we use the visual comparison model of [31] as our speaker (to encode the target object). Here, the visual representation includes the target object, context, location/size features, and two visual comparison features. Specifically, the target object representation oi is modeled as the fc7 features from a pre-trained VGG network [24]. Global context, gi , is modeled as features extracted from the VGG-fc7 layer for the entire image. The location/size representation, li , for the target object is modeled as a 5dimensional vector, encoding the x and y locations of the 3 Reinforcer Sampling Reward Loss LSTM Generation loss Speaker Concat Listener Man in the middle wearing yellow LSTM MLP L2-Normalization MLP L2-Normalization Embedding Loss Figure 3: Framework: The Speaker is a CNN-LSTM model, which generates a referring expression for the target object. The Listener is a joint-embedding model learned to minimize the distance between paired object and expression representations. In addition, a Reinforcer module helps improve the speaker by sampling more discriminative (less ambiguous) expressions for training. The model is jointly trained with 3 loss functions – generation loss, embedding loss, and reward loss, thereby improving performance on both the comprehension and generation tasks. top left and bottom right corners of the target object bounding box, as well as the bounding box size with respect to the w·h image, i.e., li = [ xWtl , yHtl , xWbr , yHbr , W ·H ]. As referring expressions often relate an object to other objects of the same type within the image (“the red ball” vs “the blue ball” or “the larger elephant”), comparisons tend to be quite important for differentiation. The comparison features are composed of two parts: a) appearance similarP o −o ity – δvi = n1 j6=i koii −ojj k , where n is the number of objects chosen for comparisons, b) location and size similarity – δli , concatenating the 5-d difference on each compared [4x ] [4y ] [4x ] [4y ] w h object δlij = [ wtli ij , htli ij , wbri ij , hbri ij , wji hji ]. The final visual representation for the target object is then a concatenation of the above features followed by a fully-connected layer fusing them together, ri = Wm [oi , gi , li , δvi , δli ] + bm . This joint feature is then fed into the LSTM for referring expression generation. During training we minimize the negative log-likelihood: Ls1 (θ) = − X XX i i +λs2 max(0, M + log P (rj |oi ) − log P (ri |oi ))] (2) The first term is from [19], while the second term encourages that the target object to be better described by the true expression compared to expressions describing other objects in the image (i.e., a ranking loss on expressions). 3.2. Listener We use a joint-embedding model to mimick the listener’s behaviour. The purpose of this embedding model is to encode the visual information from the target object and semantic information from the referring expression into a joint embedding space that embeds vectors that are visually or semantically related closer together in the space. Here for referring expression comprehension task, given a referring expression representation, the listener embeds it into the joint space, then selects the closest object in the embedding space for the predicted target object. As illustrated in Fig. 3, for our listener joint-embedding log P (ri |oi ; θ) i =− within the image (i.e., a ranking loss on objects). We generalize this idea to incorporate two triplet hinge losses composed of a positive match and two negative matches. Given a positive match (ri , oi ), we sample the contrastive pair (rj , oi ) where rj is the expression describing some other object and pair (ri , ok ) where ok is some other object in the same image, then we optimize the following max-margin loss: X Ls2 (θ) = [λs1 max(0, M + log P (ri |ok ) − log P (ri |oi )) log P (rit |rit−1 , . . . , ri1 , oi ; θ) (1) t Note that the speaker can be modeled using any form of CNN-LSTM structure. In [19], Mao proposed to add a Maximum Mutual Information (MMI) constraint encouraging the generated expression to describe the target object better than the other objects 4 model (outlined by a red dashline), we use an LSTM to encode the input referring expression and the same visual representation as the speaker to encode the target object (thus connecting the speaker to the listener). We then add two MLPs (multi-layer perceptions) and two L2 normalization layers following each view, the object and the expression. Each MLP is composed of two fully connected layers with ReLU nonlinearities between them, serving to transform the object view and the expression view into a common embedding space. The inner-product of the two normalized representations is computed as their similarity score S(r, o) in the space. As a listener, we force the similarity on target object and referring expression pairs by applying a hinge loss over triplets, which consist of a positive match and two negative matches: X Ll (θ) = [λl1 max(0, M + S(ri , ok ) − S(ri , oi )) i (3) l +λ2 max(0, M + S(rj , oi ) − S(ri , oi ))] The only thing left is to choose a reward function that encourages the speaker to sample less ambiguous expressions. As illustrated in Fig. 3 (outlined in dashed orange), the reinforcer module learns a reward function using paired objects and expressions. We again use the same visual representation for the target object and use another LSTM to encode the expression representation. Rather than using two MLPs to encode each view as in the listener, here we concatenate the two views and feed them together into a MLP to learn a 1-d Logistic Regression score between 0 and 1. Trained with cross-entropy loss, the reward function computes a match score between an input object and expression. We use this score as the reward signal in Eqn. 4 for sampled expression and target object pairs. After training, the reward function is fixed to assist our joint speaker-listener system. 3.4. Joint Model In this subsection, we describe some specifics of how our three modules (speaker, listener, reinforcer) are integrated into a joint framework (shown in Fig. 3). For the listener, we notice that the visual vector in the embedding space is learned to capture the neighbourhood vectors of referring expressions, thus making it aware of the listener’s knowledge. Therefore, we take this MLP embedded vector as an additional input for the speaker, which encodes the listener based information. In Fig. 3, we use concatenation to jointly encode the standard visual representation of target object and this listener-aware representation and then feed them into speaker. Besides concatenation, the elementwise product or compact bilinear pooling can also be applied [6]. During training, we sample the same triplets for both the speaker and listener, and make the word embedding of the speaker and listener shared to reduce the number of parameters. For the reinforcer module, we do sentence sampling using the speaker’s LSTM as shown in the top right of Fig. 3. Within each mini-batch, the sampled expressions for the target objects are fed into the reward function to obtain reward values. The overall loss function is formulated as a multi-task learning problem: where the negative matches are randomly chosen from the other objects and expressions in the same image. Note that the listener model is not limited to this particular triplet-based model. For example, [23] computes a similarity score between every object for given referring expression, and minimizes the cross entropy of the SoftMax knowing the target object, which could also be applied here. 3.3. Reinforcer Besides using the ground-truth pairs of target object and referring expression for training the speaker, we also use reinforcement learning to guide the speaker toward generating less ambiguous expressions (expressions that apply to the target object but not to other objects). This reinforcer module is composed of a discriminative reward function and performs a non-differentiable policy gradient update to the speaker. Specifically, given the softmax output of the speaker’s LSTM, we sample words according to the categorical distribution at each time step, resulting in a complete expression after sampling the <END> token. This sampling operation is non-differentiable as we do not know whether an expression is ambiguous or not until we feed it into a reward function. Therefore, we use policy gradient reinforcement learning to update the speaker’s parameters. Here, the goal is to maximize the reward expectation F (w1:T ) under the distribution of p(w1:T ; θ) parameterized by the speaker, i.e., J = Ep(w1:T ) [F ]. According to the policy gradient algorithm [28], we have ∇θ J = Ep(w1:T ) [F (w1:T )∇θ log p(w1:T ; θ)], θ = arg min Ls1 (θ) + Ls2 (θ) + Ll (θ) − λr J(θ), (5) where λr is the weight on reward loss. The weights on the loss of speaker and listener are already included in Eqn. 2 and Eqn. 3. We list all hyper-parameters settings in Sec. 4.1. 3.5. Comprehension and Generation For the comprehension task, at test time, we could use either the speaker or listener to select the target object given an input expression. Using the listener, we would embed the input expression into the learned embedding space and select the closest object as the predicted target. Using the speaker, we would generate expressions for each object within the image and then select the object whose generated (4) Where log p(wt ) is defined by the softmax output. We then use this gradient to update our speaker model during training. 5 For the constrastive pairs, we set λl1 = 1 and λl2 = 1 in the listener’s objective function (Eqn. 3), and set λs1 = 1 and λs2 = 0.1 in the speaker’s objective function (Eqn. 2). We emprically set the weight on reward loss λr = 1 . expression best matches the input expression. Therefore, we utilize both modules by ensembling the speaker and listener predictions together to pick the most probable object given a referring expression. ô = arg max P (r|o)S(o, r)λ o 4.2. Datasets (6) We perform experiments on three referring expression datasets: RefCOCO, RefCOCO+ and RefCOCOg (described in Sec 2). All three datasets are collected on MSCOCO images [17], but with several differences: 1) RefCOCO and RefCOCO+ were collected using an interactive game interface while RefCOCOg was collected in a noninteractive setting and contains longer expressions, 2) RefCOCOg contains on average 1.63 objects of the same type per images, while RefCOCO and RefCOCO have 3.9 on average, 3) RefCOCO+ disallowed absolute location words in referring expressions. Overall, RefCOCO has 142,210 expressions for 50,000 objects in 19,994 images, RefCOCO+ has 141,565 expressions for 49,856 objects in 19,992 images, and RefCOCOg has 104,560 expressions for 54,822 objects in 26,711 images. Additionally, each dataset is provided with dataset splits for evaluation. RefCOCO and RefCOCO+ provide person vs. object splits for evaluation. Images containing multiple people are in “TestA” while images containing multiple objects of other categories are in “TestB”. For RefCOCOg, the authors divide their dataset by randomly partitioning objects into training and testing splits. Thus same image may appear in the two splits. As only training and validation splits have been released for this dataset, we use the hyperparamters cross-validated on RefCOCO to train models on RefCOCOg. Surprisingly, using the speaker alone (setting λ to 0) already achieves state-of-art results due to the joint training. Adding the listener further improves performance to more than 4% over previous state-of-art results. For the generation task, we first let the speaker generate multiple expressions per object via beam search. We then use the listener to rerank these expressions and select the least ambiguous expression, which is similar to [1]. To fully utilize the listener’s power in generation, we propose to consider cross comprehension as well as the diversity of expressions by minimizing the potential: E(r) = X θi (ri ) + i X θi,j (ri , rj ) i,j θi (ri ) = − log P (ri |oi ) − λ1 log S(ri , oi ) (7) + λ2 max log S(ri , oj ) j6=i θi,j (ri , rj ) = λ3 I(ri = rj ) The first term and second term in unary potential measure how well the target object and generated expression match using the speaker and listener modules respectively, which was also used in [1]. The third term in unary potential measures the likelihood of the generated sentence for describing other objects in the same image. The pairwise potential penalize the same sentences being generated for different objects (encouraging diversity in generation). In this way, the expressions for every object in an image are jointly generated. Compared with the previous model that attempted to tie language generation of referring expressions together [31], the constraints in Eqn. 7 are more explicit and overall this works better to reduce ambiguity in the generated expressions. 4.3. Comprehension Task After training, we can either use the speaker or listener to perform the comprehension task. For the speaker that models P (r|o), we feed every ground-truth object region within the given image to the speaker and select the most probable region for the expression as the comprehension result, i.e., o∗ = argmaxoi p(r|oi ). For the listener, we directly compute the similarity score S(r, o) between the proposal/object and expression and pick the object with the highest probability. For evaluation, we compute the intersection-over-union (IoU) of the comprehended region with the ground-truth object. If the IoU score of the predicted region is greater than 0.5, we consider this a correct comprehension. To demonstrate the benefits of each module, we run ablation studies in Lines 3-12 of Table 1 (for speaker as comprehender) and in Lines 3-8 of Table 2 (for listener as comprehender) on all three datasets. Each row shows the results after adding a module during training. For some models that have both speaker and listener, we highlight the 4. Experiments 4.1. Optimization We optimize our model using Adam [14] with an initial learning rate of 0.0004, halved every 2,000 iterations, with a batch size of 32. The word embedding size and hidden state size of the LSTM are set to 512. We also set the output of each MLP and FC in Fig. 3 to be 512-dimensional. To avoid overfitting, we apply dropout with a ratio of 0.2 after each linear transformation in the MLP layers of the listener. We also regularize the word-embedding and output layers of the LSTM in the speaker using dropout with ratio of 0.5. 6 1 2 3 4 5 6 7 8 9 10 11 12 listener previous state-of-art[21][31] baseline[19] speaker[31] speaker+listener speaker+reinforcer speaker+listener+reinforcer baseline+MMI[19] speaker+MMI[31] speaker+listener+MMI speaker+reinforcer+MMI speaker+listener+reinforcer+MMI 1 2 3 4 5 6 7 8 9 10 11 12 listener previous state-of-art[31] baseline[19] speaker[31] speaker+listener speaker+reinforcer speaker+listener+reinforcer baseline+MMI[19] speaker+MMI[31] speaker+listener+MMI speaker+reinforcer+MMI speaker+listener+reinforcer+MMI RefCOCO val TestA TestB 77.48% 76.58% 78.94% 76.90% 75.60% 78.00%[21] 64.56% 63.20% 66.69% 69.95% 68.59% 72.84% 71.20% 69.98% 73.66% 71.88% 70.18% 73.01% 72.46% 71.10% 74.01% 72.28% 72.60% 73.39% 76.18% 74.39% 77.30% 79.22% 77.78% 79.90% 78.38% 77.13% 79.53% 79.56% 78.95% 80.22% RefCOCO (detected) val TestA TestB 71.63% 61.47% 72.03% 63.08% 64.42% 56.75% 67.69% 60.16% 68.27% 61.00% 69.12% 60.47% 69.15% 61.96% 68.73% 59.56% 72.03% 63.08% 72.95% 63.10% 72.34% 63.24% 72.88% 63.43% RefCOCO+ val TestA TestB 60.50% 61.39% 58.11% 58.94% 61.29% 56.24%[31] 47.78% 51.01% 44.24% 52.63% 54.51% 50.02% 54.23% 56.22% 52.46% 53.38% 56.50% 51.16% 55.54% 57.46% 53.71% 56.66% 60.01% 53.15% 58.94% 61.29% 56.24% 61.72% 64.41% 58.62% 61.32% 63.99% 58.25% 62.26% 64.60% 59.62% RefCOCO+ (detected) val TestA TestB 57.33% 47.21% 58.87% 47.70% 52.84% 42.68% 54.37% 45.00% 55.41% 45.65% 55.45% 44.96% 55.97% 46.45% 58.15% 46.63% 58.87% 47.70% 60.23% 48.11% 59.36% 48.72% 60.43% 48.74% RefCOCOg val 71.12% 65.32%[31] 56.81% 59.40% 61.83% 61.91% 64.07% 63.31% 65.32% 71.77% 67.06% 72.63% RefCOCOg (detected) val 56.18% 58.26% 53.13% 53.83% 54.96% 55.64% 57.03% 57.23% 58.26% 58.57% 58.70% 59.51% Table 1: Ablation study using the speaker module for the comprehension task (indicated in bold). Top half shows performance given ground truth bounding boxes for objects, bottom half performance using automatic object detectors to select potential objects. We find that adding listener and reinforcer modules to the speaker increases performance. 1 2 3 4 5 6 7 8 listener previous state-of-art [21][31] speaker+listener speaker+listener+reinforcer speaker+listener+reinforcer (ensemble) speaker+listener+MMI speaker+listener+reinforcer+MMI speaker+listener+reinforcer+MMI (ensemble) 1 2 3 4 5 6 7 8 listener previous state-of-art[31] speaker+listener speaker+listener+reinforcer speaker+listener+reinforcer (ensemble) speaker+listener+MMI speaker+listener+reinforcer+MMI speaker+listener+reinforcer+MMI (ensemble) RefCOCO val TestA TestB 77.48% 76.58% 78.94% 76.90% 75.60% 78.00% [21] 77.84% 77.50% 79.31% 78.14% 76.91% 80.10% 78.88% 78.01% 80.65% 78.42% 78.45% 79.94% 78.36% 77.97% 79.86% 80.36% 80.08% 81.73% RefCOCO (detected) val TestA TestB 71.63% 61.47% 72.03% 63.08% 72.23% 62.92% 72.65% 62.69% 72.78% 64.38% 72.95% 62.43% 72.94% 62.98% 73.78% 63.83% RefCOCO+ val TestA TestB 60.50% 61.39% 58.11% 58.94% 61.29% 56.24% [31] 60.97% 62.85% 58.58% 61.34% 63.34% 58.42% 61.90% 64.02% 59.19% 61.48% 62.14% 58.91% 61.33% 63.10% 58.19% 63.83% 65.40% 60.73% RefCOCO+ (detected) val TestA TestB 57.33% 47.21% 58.87% 47.70% 59.61% 48.31% 58.68% 48.23% 59.80% 49.34% 58.68% 48.44% 58.68% 47.68% 60.48% 49.36% RefCOCOg val 71.12% 65.32% [31] 72.25% 71.72% 72.43% 72.13% 72.02% 74.19% RefCOCOg (detected) val 56.18% 58.26% 57.38% 58.32% 60.46% 57.34% 57.72% 59.84% Table 2: Ablation study using listener or ensembled listener+speaker modules for the comprehension task (indicated in bold). Top half shows performance given ground truth bounding boxes for objects, bottom half performance using automatic object detectors to select potential objects. We find that jointly training with the speaker improves listener’s performance and that adding the reinforcer module in an ensembled speaker+listener prediction performs the best. module being used for comprehension in bold. For example, “speaker+listener” means we use the speaker module of the joint model to do the comprehension task, while “speaker+listener” means we use the listener module for this task. Note our speaker module is implemented using the “visdif” model in [31] as mentioned in Section 3.11 . 1 The “visdif” model trained in this paper performs slightly better on comprehension task than the original one reported in [31]. 7 Figure 4: Example comprehension results based on detection. Green box shows the ground-truth region, blue box shows correct comprehension using our “speaker+listener+reinforcer+MMI” model, and red box shows incorrect comprehension. We use top two rows to show some correct comprehensions and bottom two rows to show some incorrect ones. speaker+tie [31] baseline+MMI speaker+MMI speaker+listener+MMI speaker+reinforcer+MMI speaker+listener+reinforcer+MMI baseline+MMI+rerank speaker+MMI+rerank speaker+listener+MMI+rerank speaker+reinforcer+MMI+rerank speaker+listener+reinforcer+MMI+rerank RefCOCO Test A Test B Meteor CIDEr Meteor CIDEr 0.283 0.681 0.320 1.273 0.243 0.615 0.300 1.227 0.260 0.679 0.319 1.276 0.268 0.704 0.327 1.303 0.266 0.702 0.323 1.291 0.268 0.697 0.329 1.323 0.280 0.729 0.329 1.285 0.287 0.745 0.334 1.295 0.293 0.763 0.337 1.306 0.291 0.748 0.337 1.311 0.296 0.775 0.340 1.320 RefCOCO+ Test A Test B Meteor CIDEr Meteor CIDEr 0.204 0.499 0.196 0.683 0.199 0.462 0.189 0.679 0.202 0.475 0.196 0.683 0.208 0.496 0.201 0.697 0.204 0.482 0.197 0.692 0.204 0.494 0.202 0.709 0.204 0.484 0.205 0.730 0.208 0.490 0.213 0.712 0.211 0.500 0.221 0.734 0.207 0.499 0.215 0.729 0.213 0.520 0.215 0.735 RefCOCOg val Meteor CIDEr 0.149 0.585 0.147 0.573 0.150 0.589 0.151 0.602 0.154 0.592 0.160 0.654 0.156 0.653 0.159 0.650 0.158 0.653 0.159 0.662 Table 3: Ablation study for generation using automatic evaluation. Following previous work [19][31][21], we show the results trained with MMI and those trained w/o MMI on speakers. We compare our models with the “baseline” model [19] (Line 3, 8 in Table 1), the pure listener model (Line 1), and previous state-of-art results (Line 2) achieved in [21][31]. els trained with MMI outperform w/o MMI. We also find that the speaker can be improved by joint training with the listener module and by incorporating the reinforcer module. With MMI ranking, the speaker learned with joint training (Line 12) is able to outperform the pure listener by around 2% on all three datasets, which already achieves state-of-art performance on the comprehension task. First, we evaluate the performance of the speaker on the comprehension task (Table 1). We observe all speaker mod8 speaker+tie[31] speaker+MMI [31] speaker+listener+MMI speaker+reinforcer+MMI speaker+listener+reinforcer+MMI speaker+listener+reinforcer+MMI +rerank RefCOCO Test A Test B 71.40% 76.14% 68.82% 75.50% 73.23% 76.08% 71.08% 76.09% 74.08% 76.44% RefCOCO+ Test A Test B 57.17% 47.92% 53.57% 47.88% 53.83% 49.19% 55.16% 48.50% 56.92% 53.23% 76.95% 58.85% 78.10% bustly, we collect more expressions for objects in the test sets for RefCOCO and RefCOCO+, obtaining 10.1 and 9.4 expressions respectively on average per object. For RefCOCOg we use the original expressions released with the dataset which may be limited, but we still show its performance for completeness. We choose the “speaker+tie” model in [31] as reference, which learns to tie the expression generation together and achieves state-of-art performance. Generally we find that the speaker in jointly learned models achieves higher scores than the single speaker under both metrics across datasets. Such improvements are observed under both settings without “+rerank” or with “+rerank”. In addition, since previous work [31] has found that these metrics do not always agree well with human judgments for referring expressions, we also run a human evaluation on the same set of objects as [31] for RefCOCO and RefCOCO+. Here we ask Turkers to click on the referred object given a generated expression. These results are shown in Table. 4. Results indicate the ablated benefits brought by each module, and ultimately the “+rerank” of our joint model achieves the best performance. In Fig. 5, we compare the generated expressions using the speaker module of different models. We then show the joint expression generation using our full model with “+rerank” in Fig. 6. As observed, the expressions of every target object are considered together, where each of them is meant to be relevant to the target object and irrelevant to the other objects. 58.20% Table 4: Human Evaluations on generation. Second, we show evaluations using variations of the listener module or ensembled listener+speaker modules (indicated in bold) for the comprehension task in Table 2. We note that the listener generally works better than speaker for the comprehension task, indicating that the deterministic joint-embedding model is more suitable for this task than the speaker model – similar results were observed in [23]. While the reinforcer module seems not to be as effective as the speaker, we still find that the joint training always brings additional discriminative benefits to the listener module, resulting in improved performance (compare Line 3-8 with Line 1 in Table 2). Ensembling the speaker and listener together achieves the best results overall. Both of the above experiments analyze comprehension performance given ground truth bounding boxes for potential comprehension objects, where the algorithm must select which of these objects is being described. This provides an analysis of comprehension performance independent of any particular object detection method. Additionally, we also show results using an object detector to automatically select regions for consideration during comprehension in the bottom half of each table (Tables 1 and 2). As our detection algorithm, we use current state of the art detector in effectiveness and speed, SSD [18], trained on a subset of the MS COCO train+val dataset, removing images that are in the test splits of RefCOCO or RefCOCO+ or in the validation split of RefCOCOg. We empirically select 0.30 as the confidence threshold for detection output. While performance drops somewhat due to the strong dependence of “visdif” model on detection [31], the overall improvements brought by each module are consistent with using ground-truth objects, showin the robustness of our joint model. Fig. 4 shows some comprehension results using our full model. 5. Conclusion We demonstrated the effectiveness of a unified framework for referring expression generation and comprehension. Our model consists of speaker and listener modules trained jointly to improve performance and a reinforcer module to help produce less ambiguous expressions. Experiments indicate that our model outperforms state of the art for both comprehension and generation on multiple datasets and evaluation metrics. References [1] J. Andreas and D. Klein. Reasoning about pragmatics with neural listeners and speakers. EMNLP, 2016. 2, 3, 6 [2] S. Antol, A. Agrawal, J. Lu, M. Mitchell, D. Batra, C. Lawrence Zitnick, and D. Parikh. Vqa: Visual question answering. In ICCV, 2015. 3 [3] M. Eldon, D. Whitney, and S. Tellex. Interpreting multimodal referring expressions in real time. In ICRA, 2016. 1 [4] R. Fang, M. Doering, and J. Y. Chai. Embodied collaborative referring expression generation in situated human-robot interaction. In Proceedings of the Tenth Annual ACM/IEEE International Conference on Human-Robot Interaction, 2015. 1 4.4. Generation Task For the generation task, we evaluate variations on the speaker module. Evaluating the generation is not as simple as comprehension. In image captioning, BLEU, ROUGE, METEOR and CIDEr are common automatic metrics and have been widely used as standard evaluations. We show automatic evaluation using the METEOR and CIDEr metrics for generation in Table 3 where “+rerank” denotes models incorporating the reranking mechanism and global optimization over all objects (Eqn. 7). To computer CIDEr ro9 Figure 5: Example generation results from each dataset. From top to bottom showing: speaker+MMI, speaker+listener+MMI, speaker+reinforcer+MMI, speaker+listener+reinforcer+MMI, speaker+listener+reinforcer+MMI+rerank. Figure 6: Joint generation examples using “speaker+listener+reinforcer+MMI+rerank”. Each sentence shows the generated expression for one of the depicted objects (color coded to indicate correspondence) [5] N. FitzGerald, Y. Artzi, and L. S. Zettlemoyer. Learning distributions over logical forms for referring expression generation. In EMNLP, 2013. 3 [8] H. P. Grice. Logic and conversation. In P. Cole and J. L. Morgan, editors, Syntax and Semantics: Vol. 3: Speech Acts, pages 41–58. Academic Press, San Diego, CA, 1975. 1 [9] M. Grubinger, P. Clough, H. Müller, and T. Deselaers. The iapr tc-12 benchmark: A new evaluation resource for visual information systems. In International Workshop OntoImage, 2006. 1, 3 [10] R. Hu, H. Xu, M. Rohrbach, J. Feng, K. Saenko, and T. Darrell. Natural language object retrieval. CVPR, 2016. 2, 3 [11] X. Jia, E. Gavves, B. Fernando, and T. Tuytelaars. Guiding [6] A. Fukui, D. H. Park, D. Yang, A. Rohrbach, T. Darrell, and M. Rohrbach. Multimodal compact bilinear pooling for visual question answering and visual grounding. In EMNLP, 2016. 5 [7] D. Golland, P. Liang, and D. Klein. A game-theoretic approach to generating spatial descriptions. In EMNLP, 2010. 1, 3 10 [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] L. Yu, P. Poirson, S. Yang, A. C. Berg, and T. L. Berg. Modeling context in referring expressions. ECCV, 2016. 1, 2, 3, 6, 7, 8, 9 the long-short term memory model for image caption generation. In ICCV, 2015. 3 J. Johnson, A. Karpathy, and L. Fei-Fei. Densecap: Fully convolutional localization networks for dense captioning. arXiv preprint arXiv:1511.07571, 2015. 3 S. Kazemzadeh, V. Ordonez, M. Matten, and T. L. Berg. Referitgame: Referring to objects in photographs of natural scenes. In EMNLP, pages 787–798, 2014. 1, 3 D. Kingma and J. Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. 6 E. Krahmer and K. Van Deemter. Computational generation of referring expressions: A survey. Computational Linguistics, 38(1):173–218, 2012. 1, 3 R. Krishna, Y. Zhu, O. Groth, J. Johnson, K. Hata, J. Kravitz, S. Chen, Y. Kalantidis, L.-J. Li, D. A. Shamma, et al. Visual genome: Connecting language and vision using crowdsourced dense image annotations. arXiv preprint arXiv:1602.07332, 2016. 3 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, 6 W. Liu, D. Anguelov, D. Erhan, C. Szegedy, S. Reed, C.Y. Fu, and A. C. Berg. Ssd: Single shot multibox detector. ECCV, 2016. 9 J. Mao, J. Huang, A. Toshev, O. Camburu, A. Yuille, and K. Murphy. Generation and comprehension of unambiguous object descriptions. CVPR, 2016. 1, 2, 3, 4, 7, 8 M. Mitchell, K. Van Deemter, and E. Reiter. Generating expressions that refer to visible objects. In HLT-NAACL, 2013. 1, 3 V. K. Nagaraja, V. I. Morariu, and L. S. Davis. Modeling context between objects for referring expression understanding. In ECCV, 2016. 2, 3, 7, 8 B. A. Plummer, L. Wang, C. M. Cervantes, J. C. Caicedo, J. Hockenmaier, and S. Lazebnik. Flickr30k entities: Collecting region-to-phrase correspondences for richer imageto-sentence models. In ICCV, 2015. 3 A. Rohrbach, M. Rohrbach, R. Hu, T. Darrell, and B. Schiele. Grounding of textual phrases in images by reconstruction. ECCV, 2016. 2, 3, 5, 9 K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. 3 O. Vinyals, A. Toshev, S. Bengio, and D. Erhan. Show and tell: A neural image caption generator. In CVPR, 2015. 2, 3 L. Wang, Y. Li, and S. Lazebnik. Learning deep structurepreserving image-text embeddings. CVPR, 2016. 2, 3 M. Wang, M. Azab, N. Kojima, R. Mihalcea, and J. Deng. Structured matching for phrase localization. ECCV, 2016. 3 R. J. Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992. 5 T. Winograd. Understanding natural language. Cognitive psychology, 3(1):1–191, 1972. 1, 3 L. Yu, E. Park, A. C. Berg, and T. L. Berg. Visual madlibs: Fill in the blank description generation and question answering. In ICCV, 2015. 3 11
2cs.AI
Nonlinear Analysis of an Improved Swing Equation arXiv:1603.07440v1 [cs.SY] 24 Mar 2016 Pooya Monshizadeh1 , Claudio De Persis2 , Nima Monshizadeh2 , and Arjan van der Schaft1 Abstract— In this paper, we investigate the properties of an improved swing equation model for synchronous generators. This model is derived by omitting the main simplifying assumption of the conventional swing equation, and requires a novel analysis for the stability and frequency regulation. We consider two scenarios. First we study the case that a synchronous generator is connected to a constant load. Second, we inspect the case of the single machine connected to an infinite bus. Simulations verify the results. I. I NTRODUCTION Driven by environmental and technical motivations, restructuring the classical power networks has been under vast attention during the recent decades. Among the goals are decreasing energy losses by moving towards distributed generation and preventing fault propagation through building up smart microgrids. Microgrids are small power network areas which can be seen as single entities from the large power grids. In such small-scale network, the energy consumption and production uncertainty increases to a great extent according to the fewer number of consumers and unpredictable power injections of renewables such as wind turbines and solar panels. Designing controllers for the electrical sources under such perturbations and abrupt power variations, calls for rethinking about the accuracy of the models that were (mostly) valid for the classical electrical systems. The main power sources in electrical networks are synchronous generators. Despite the extensive advances in extracting energy from renewables, these machines are still the main supplier of the implemented microgrids (see e.g. [1]). Under unpredictable changes in loads and renewable generations, and to assure of the stability and frequency regulation of the (micro-) grid, it appears crucial to investigate the accuracy of the electrical and dynamical models of these machines. While a large number of articles have exploited the classical swing equation as the model for the synchronous generator, a few have recently brought up doubts about its accuracy and validity, and proposed models of higher accuracy [2]–[8]. Although some promising models are provided (see e.g. the exact 8-dimensional model in [3] and the integro-differential model in [6]), the use of such models in power networks is rather complicated. 1 Pooya Monshizadeh and Arjan van der Schaft are with the Johann Bernoulli Institute for Mathematics and Computer Science, University of Groningen, 9700 AK, the Netherlands, [email protected], In this paper, we provide a nonlinear analysis for an improved yet easy-to-use swing equation to fulfill higher accuracy in analysis and modeling of the synchronous generator that can also be exploited in small-scale networks. We first explicate the contradicting assumptions in obtaining the conventional swing equation and elaborate deriving the improved model. In Section III, as the first scenario, we look into the properties of the model when the generator is connected to a constant load and provide an estimate of the region of attraction through nonlinear analysis. Further in Section IV, the second scenario which is mainly referred to as Single Machine Infinite Bus (SMIB) is investigated. We provide analytical estimates of the region of attraction for both conventional and improved swing models in this case. Finally, simulations are provided as a verification of the results. II. C ONVENTIONAL AND I MPROVED S WING E QUATIONS The mechanical dynamics of the synchronous generator reads as J ω̇ + Dd (ω − ω ∗ ) = τm − τe , (1) where J ∈ R+ is the total moment of inertia of the turbine and generator rotor (kg m2 ), ω ∈ R+ is the rotor shaft velocity (mechanical rad/s), ω ∗ ∈ R+ is the angular velocity associated with the nominal frequency ((2π)60Hz), τm ∈ R+ is the net mechanical shaft torque (N m), τe ∈ R+ is the counteracting electromagnetic torque (N m), and Dd ∈ R+ is the damping-torque coefficient (N m s) 1 . The mechanical rotational loss due to friction is ignored. Bearing in mind that τm = Pωm and τe = Pωe we can model the synchronous generator as Jω ω̇ + Dd ω(ω − ω ∗ ) = Pm − Pe , (2) where Pm and Pe are the mechanical (input) and electrical (output) power respectively. In the conventional swing equation, Jω and Dd ω are approximated with constants M = Jω ∗ and A = Dd ω ∗ . M ω̇ + A(ω − ω ∗ ) = Pm − Pe , (3) where M ∈ R is the angular momentum and A ∈ R is the (new) damping coefficient. In other words, the swing equation is derived supposing that ω = ω ∗ . Such an assumption is in contradiction with the proof of stability and frequency regulation of the synchronous generator. Note that these machines posses high moment of inertia (J), and hence [email protected] 2 Claudio De Persis and Nima Monshizadeh are with the Engineering and Technology Institute, University of Groningen, The Netherlands, University of Groningen, 9747 AG, the Netherlands, [email protected], [email protected] 1 Despite the general misuse, D d accounts for the damping torque generated by the damper windings (amortisseur) only when the generator is connected to an infinite bus [9]. In the case of a single generator connected to a load, the damping term refers to a proportional torque governor. small deviations from the nominal frequency are magnified by the term Jω in the dynamics. Therefore we adhere to the equation (2) and endeavor to investigate the stability and frequency regulation through a nonlinear approach. This model has been first suggested by [2], where however, the stability of the synchronous generator (connected to an infinite bus) is analyzed with the small-signal (linearization) analysis. Consistently with [2], we refer to (2) as the improved swing equation. V 1J Δ 2 Pm > Pe _ ωu 0 V 1 J ω* 2 In this scenario, we assume that both the injected and extracted power (Pm and Pe ) are constant. _ ωs _ ωu ω _ _ 2ω- ωu J1/2ω* Pm = Pe _ ωs =ω* ω 2ω* V 1J Δ 2 III. S YNCHRONOUS G ENERATOR C ONNECTED TO A C ONSTANT L OAD ω* J1/2ω* ω _ _ _ ωs ω* 2ωs-ωu _ 0 ωu Fig. 1. Pm < Pe Region of attraction for system (2) is estimated by Ωs . A. Stability Let ω̄ ∈ R be an equilibrium of (2). Then, clearly ∗ Dd ω̄(ω̄ − ω ) = Pm − Pe . (4) The equation above admits a real solution only if 1 (5) Pm − Pe > − Dd ω ∗2 , 4 which will be a standing assumption in this section. Under this assumption, we obtain the following two equilibria for system (2): √ √ ω∗ + ∆ ω∗ − ∆ ω̄s = , ω̄u = , (6) 2 2 where P m − Pe ∆ := ω ∗2 + 4 . (7) Dd Note that ∆ > 0 by (5). Observe that ω̄s > ω̄u , ∗ ω̄u = ω − ω̄s . (8) (9) First, we show that ω̄s is locally stable and ω̄u is locally unstable. For the moment, we assume that the set R+ is positive invariant for the system (2), and ω(0) > 0. We will relax this assumption later, once a Lyapunov argument is provided. This means that ω −1 is well defined for the interval of the definition of the solutions. Now, let dynamics (2) be rewritten as ω̇ = f (ω) Pm − P e  1 − Dd (ω − ω ∗ ) + . J ω We have 1 J(ω − ω̄s )2 2 with ω̄s given by (6). Let ∆ be given by (7) and assume that (5) holds. Then the solutions of the system (2) starting from any initial condition in the set Ωs = {ω ∈ R+ : V (ω) ≤ 1 2 J∆} except for ω(0) = ω̄u converge asymptotically to the equilibrium ω = ω̄s . V (ω) = Proof: We have   V̇ = ω −1 (ω − ω̄s ) Pm − Pe − Dd ω(ω − ω ∗ ) . The fact that ω stays away from zero will be made clear later. According to (4) this leads to   V̇ = ω −1 (ω − ω̄s ) Dd ω̄s (ω̄s − ω ∗ ) − Dd ω(ω − ω ∗ )   = −ω −1 Dd (ω − ω̄s ) ω 2 − ωω ∗ + ω̄s ω ∗ − ω̄s2   = −Dd ω −1 (ω − ω̄s ) (ω − ω̄s )(ω + ω̄s − ω ∗ ) = −Dd (ω − ω̄s )2 (1 − ω̄u ), ω 1 1 Pm − Pe J(ω − ω̄s )2 ≤ J(ω ∗2 + 4 ) 2 2 Dd ∂f 1 Pm − Pe = (−Dd − ). ∂ω J ω2 By using (4) and (9), we find that ∂f 1 Dd ω̄s (ω̄s − ω ∗ ) = (−Dd − ) ∂ω J ω2 Dd ω̄s ω̄u = ( 2 − 1). J ω Theorem 1 Consider the candidate Lyapunov function where we have used ω̄u = ω ∗ − ω̄s . Hence V̇ is negative semi-definite on the set Ω0s = {ω ∈ R+ : ω ≥ ω̄u }. Below, we show that Ωs ⊆ Ω0s . For any ω ∈ Ωs we have where f (ω) = ∂f Bearing in mind inequality (8), it is easy to check that ∂ω > ∂f 0 around ω = ω̄u , and ∂ω < 0 around ω = ω̄s . Hence ω = ω̄u is repulsive. Now, the following theorem addresses the stability of the equilibrium ω̄ in (6). which yields (ω − ω̄s )2 ≤ (2ω̄s − ω ∗ )2 by using (6). By (5) we have 2ω̄s − ω ∗ ≥ 0. Therefore (10) ω ∗ − 2ω̄s ≤ ω − ω̄s ≤ 2ω̄s − ω ∗ and hence ω̄u ≤ ω ≤ 2ω̄s − ω̄u . (11) Let the triple (ū, ω̄, ȳ) be an input-state-output solution of (17) with Dd ω̄(ω̄ − ω ∗ ) = ū + Pm − Pe ω̄ − ω ∗ y= . ω̄ Ω0s . The left hand side of (11) gives Ωs ⊆ Now we show that ω remains in the positive half-line R+ . By (6) and (7), in the case Pm < Pe , we have ω̄u > 0 and together with (11) we obtain ω > 0. Therefore in this case, the point ω = 0 does not belong to the interval specified by (11). In cases Pm > Pe or Pm = Pe , the point ω = 0 lies within the boundaries (11). Figure 1 illustrates these situations. Since (ω − ω̄s )2 = 2JV (ω), and V (ω) is strictly decreasing in Ωs , (ω − ω̄s )2 is decreasing as well, showing that ω stays away from ω = 0 as time goes by. This proves that ω(t) > 0, ∀t > 0. Notice that Ωs is closed and bounded by (11). By invoking LaSalle’s invariance principle, the solutions of the system starting in Ωs asymptotically converge to the set of points where ω̄u )=0. (12) −Dd (ω − ω̄s )2 (1 − ω Equality (12) results in ω = ω̄s , which completes the proof. Remark 1 Note that the Lyapunov function V (ω) = 1 2 is a shifted version of the actual kinetic 2 J(ω − ω̄s ) energy of the physical system, whereas the commonly used Lyapunov function for the swing equation, 12 M (ω − ω̄s )2 equivalent to 12 Jω ∗ (ω − ω̄s )2 , does not have a physical interpretation. B. Considering Mechanical Losses We add the viscous damping coefficient Dm accounting for the mechanical losses (N m s), modifying the dynamics (1) as J ω̇ + Dm ω + Dd (ω − ω ∗ ) = τm − τe , (13) and similarly (2) is modified as Jω ω̇ + Dm ω 2 + Dd ω(ω − ω ∗ ) = Pm − Pe , (14) which can be rewritten as Jω ω̇ + (Dm + Dd )ω(ω − Dd ω ∗ ) = Pm − Pe . (15) Dm + Dd Defining D := Dm + Dd and ω̃ ∗ := Dd ∗ Dm +Dd ω we obtain Jω ω̇ + Dω(ω − ω̃ ∗ ) = Pm − Pe , (16) which is analogous to the improved swing equation (2). Therefore the stability results also extends to the case with mechanical losses. C. Incremental Passivity Property To facilitate the control design, in this section we investigate the incremental passivity of the system associated to (2) (see Remark 2 later on) Jω ω̇ + Dd ω(ω − ω ∗ ) = u + Pm − Pe ω − ω∗ y= . ω (17) (18) Assume that 1 ū + Pm − Pe > − Dd ω ∗2 . 4 Then the dynamics (17) possesses the equilibria √ √ ω∗ + ∆ ω∗ − ∆ ω̄s = , ω̄u = 2 2 where with a little abuse of the notation ū + Pm − Pe . ∆ := ω ∗2 + 4 Dd Now, we have the following proposition: (19) (20) (21) Proposition 1 Consider the candidate Lyapunov function 1 ω∗ W (ω) = J(ω − ω̄s )2 2 ω̄s and assume that (19) holds. Then, W (ω) computed along any solution to (17) satisfies Ẇ < (y − ȳ)(u − ū) , (22) as long as the solution stays within the set Ωk = {ω ∈ R+ : ∗ W (ω) ≤ 21 J∆ ωω̄s }. This amounts to an incremental passivity property with respect to (ū, ω̄, ȳ). Proof: We have  1 ω∗ Ẇ =( )( )(ω − ω̄s ) u + Pm − Pe − Dd ω(ω − ω ∗ ) ω ω̄s  − ū − Pm + Pe + Dd ω̄s (ω̄s − ω ∗ )  ω ∗ (ω − ω̄ )  s (u − ū) = ω ω̄s  ω ∗ (ω − ω̄ )   s − Dd ω(ω − ω ∗ ) − Dd ω̄s (ω̄s − ω ∗ ) ω ω̄s ω − ω∗ ω̄s − ω ∗ =( − )(u − ū) ω ω̄s  ω ∗ (ω − ω̄ )   s − Dd (ω − ω̄s )(ω + ω̄s − ω ∗ ) ω ω̄s =(y − ȳ)(u − ū) ω̄u ω ∗ − Dd (ω − ω̄s )2 (1 − )( ) . (23) ω ω̄s Hence the inequality (22) holds as long as the solutions evolve in the set Ω0k = {ω ∈ R+ : ω ≥ ω̄u }. The fact that Ωk ⊆ Ω0k follows analogously to the proof of Theorem 1. Remark 2 Defining y = ω −1 (ω − ω ∗ ) as in (17), results in a dimensionless output. This is consistent with the inequality of incremental passivity property (22), since yu has the dimension of physical power. This does not hold for the conventional swing equation where ω is taken as the output and thus yu does not have a meaningful physical dimension. ξ D. Frequency Regulation In this section we investigate the frequency regulation of the system by an integral controller. Motivated by Proposition 1, we propose the controller for system (17) Pm-Pe ω − ω∗ ξ˙ = y = ω u = −ξ . ω̄ = ω ∗ , ω̄u = 0, ȳ = 0, Fig. 2. Region of attraction for the system (17), (24) is estimated with the oval characterized by (28). (25) ∆ = ω ∗2 . asymptotically to the equilibrium (ξ, ω) = (Pm − Pe , ω ∗ ). Note that the solutions stay away from the point (ξ, ω) = (Pm − Pe , 0), since as (ξ, ω) → (Pm − Pe , 0+ ), we have ω̇ → + DJd ω ∗ . We can rewrite the set O as ξ − ξ¯ 2 ω − ω ∗ 2 + √ ≤ 1. ∗ ω Jω ∗ Therefore, the dissipation equality (23) in this case reduces to Ẇ =(y − ȳ)(u − ū) − Dd (ω − ω̄s )2 , (26) as long as the solutions stay within the set Ωk = {ω ∈ R+ : W (ω) ≤ 21 Jω ∗2 } which confines ω within the interval ω ∈ [0 2ω ∗ ]. Now, the following theorem establishes the convergence of the solutions to the desired equilibrium associated with the nominal frequency regulation. Theorem 2 Consider the candidate Lyapunov function U (ξ, ω) = Wc (ξ) + W (ω) ¯ 2 and W = 1 J(ω − ω ∗ )2 . Then the where Wc = 12 (ξ − ξ) 2 solutions of the closed loop system (17), (24), starting from any initial condition in the set O = {(ξ, ω) ∈ R2 : U ≤ 1 ∗2 2 Jω } and different from (ξ, ω) = (Pm − Pe , 0) converge asymptotically to the equilibrium (ξ, ω) = (Pm − Pe , ω ∗ ). Proof: First note that ¯ Ẇc = ω −1 (ω − ω ∗ )(ξ − ξ) IV. S YNCHRONOUS G ENERATOR C ONNECTED TO AN I NFINITE B US In this scenario we consider the case of SMIB, where the synchronous generator is connected to an infinite bus through an inductive link. The infinite bus is a node with fixed voltage and frequency (60Hz). A. Stability of the Improved Swing Model It can be shown that the power delivered from the synchronous generator to the bus is γ sin(δ) where δ is the V V voltage angle relative to the infinite bus, and γ := gX b . Here, the voltages (Vg , Vb ) and the reactance of the line (X) are assumed to be constant. The dynamics of an SMIB system modeled with the improved swing equation (2) is δ̇ = ω − ω ∗ U̇ = − Dd (ω − ω ∗ )2 . (28) Such a set guarantees ω to remain in the positive half-line R+ for ω (See figure 2). Hence, by (26) we find that Jω ω̇ + Dd ω(ω − ω ∗ ) = Pm − γ sin(δ) , (29) (27) as long as the solutions belong to the set O. As the right hand side of the above equality is nonpositive, we conclude that the set O is forward invariant along the solution (ξ, ω), and thus (27) is valid for all time. Now, observe that U is radially unbounded and has a strict minimum at (ξ, ω) = (Pm − Pe , ω ∗ ). Then by invoking LaSalle’s invariance principle, the solutions converge to the largest invariant subset of O in which ω=ω ω* J ω* which trivially satisfies the inequality (19). In addition, for the solution above, the quantities in (20) and (21) are computed as ω̄s = ω ∗ , ω (24) Note that for the purpose of frequency regulation, the solution (equilibrium) of interest for the system (17), (24), is given by ū = −ξ¯ = −(Pm − Pe ), ω* where the mechanical input Pm > 0 is considered constant. It is easy to check that (δ, ω) = (arcsin Pγm , ω ∗ ) is the equilibrium of the system (29). Theorem 3 Consider the candidate Lyapunov function V (δ, ω) = Vk (ω) + Vp (δ) , where ∗ ū = Pe − Pm . The latter shows that all the solutions on the invariant set O, and not starting from (ξ, ω) = (Pm − Pe , 0) converge Vk (ω) = 1 J(ω − ω̄s )2 2 and Vp (δ) = γ [− cos δ + cos δ̄ − (δ − δ̄) sin δ̄)] ω∗ are associated with the kinetic and potential energy and δ̄ = arcsin Pγm . Assume that r γ ω∗ > (30) Dd -π and Pm 2 < . γ π Proof: Observe that Vp (δ) has a minimum in δ̄ and is convex within the set Ωp = {δ ∈ [− π2 , π2 ]}. We here show that Ω ⊂ Ωp . Having Vk (ω) > 0, the inequality V (δ, ω) < c results in Vp (δ) < cp and reads as π (32) cos δ > ( − δ) sin δ̄ . 2 The inequality (32) contains a unique subset of Ωp . More precisely, under the criterion 0 < δ̄ < arcsin π2 as a result of (31), there exists a δ − s.t. (32) holds for all δ ∈ [δ − π2 ]. Figure 3 shows an example interval for δ that satisfies (32) and consequently the energy function VP remains convex. Now, it remains to prove that V̇ < 0. we have γ V̇ = − Dd (ω − ω ∗ )2 − [(ω − ω ∗ )(sin δ − sin δ̄)] ω γ + ∗ [(ω − ω ∗ )(sin δ − sin δ̄)] ω γ = − Dd (ω − ω ∗ )2 + (ω − ω ∗ )2 (sin δ − sin δ̄) ωω ∗  γ = − (ω − ω ∗ )2 Dd − (sin δ − sin δ̄) . ∗ ωω Bearing in mind that δ is confined s.t. δ − δ̄ < π2 , V̇ < 0 on the set Ωk = {ω ∈ R : ω > Ddγω∗ }. Here we show that Ω ⊂ Ωk . In the set Ω we have V (δ, ω) < c which leads to Vk (ω) < ck . Therefore γ (ω − ω ∗ )2 < (ω ∗ − )2 , Dd w∗ q and since ω ∗ > Dγd , γ γ − ω∗ < ω − ω∗ < ω∗ − , Dd w ∗ Dd w∗ thus γ γ < ω < 2ω ∗ − . (33) Dd w∗ Dd w∗ The left hand side of the inequality (33) shows that Ω ⊂ Ωk . Observe that U has a strict minimum at ω = ω ∗ and δ = δ̄, and the solutions are bounded to Ddγw∗ < ω < 2ω ∗ − Ddγw∗ and δ − < δ < π2 . By invoking LaSalle’s invariance principle, the solutions converge to the largest invariant subset of Ω for (29) s.t. ω = ω ∗ . On this set, the solution to (29) satisfy Pm . γ δ¯ _π 2 π (31) Let c := min(ck , cp ), where ck := 12 J(ω ∗ − Ddγw∗ )2 and cp := Vp ( π2 ). Then the solutions of the system (29) starting from any initial condition in the set Ω = {(δ, ω) ∈ [−π, π] × R : V (δ, ω) ≤ c} converge asymptotically to the equilibrium (δ, ω) = (arcsin Pγm , ω ∗ ). δ = arcsin | Fig. 3. The estimate of the system (29) region of attraction (Vp (δ) < cp ) for δ̄ = arcsin0.1 confines δ in [−0.78π + 0.5π] (green). On such an interval Vp (δ) remains positive and convex. This shows that all the solutions on the invariant set converge asymptotically to the equilibrium (arcsin Pγm , ω ∗ ). This completes the proof. Remark 3 The assumption Pγm < π2 results in δ̄ < arcsin π2 which means that at steady state the angle between the synchronous generator and the infinite bus should be less than about 40◦ . In practice, the steady state angle is much lower even for large machines (see e.g. [10]). Note that this assumption is made merely for characterizing the region of attraction, otherwise it is not necessary for the proof of local stability since V is convex around the equilibrium 2 ( ∂∂δV2 |δ=δ̄ = cos δ̄ > 0). B. Comparison with the Swing Equation Here we compare the results of the improved model with the swing equation. The dynamics of a synchronous generator modeled with the swing equation and connected to an infinite bus is δ̇ = ω − ω ∗ M ω̇ + A(ω − ω ∗ ) = Pm − γ sin(δ) , (34) where the mechanical input Pm > 0 is considered constant. It is straightforward to see that the equilibrium of the system (34) is (δ, ω) = (arcsin Pγm , ω ∗ ). Corollary 1 Consider the candidate Lyapunov function V (δ, ω) = Vk (ω) + Vp (δ) where Vk (ω) = 1 M (ω − ω̄s )2 2 and Vp (δ) = γ[− cos δ + cos δ̄ − (δ − δ̄) sin δ̄)] . Assume that Pγm < π2 and let c := Vp ( π2 ). Then the solutions of the SMIB system described by the swing equation (34) starting from any initial condition in the set Ω = {(δ, ω) ∈ [−π, π] × R : V (δ, ω) ≤ c} converge asymptotically to the equilibrium (δ, ω) = (arcsin Pγm , ω ∗ ). A. Constant Load: Example 1 As described in Section III, the steady state value of the frequency differs for the swing equation and the improved swing model under similar constant loads. Figure 4(a) illustrates this issue. In this example, we set Pm = 1pu and Pe = 2pu, and start from the initial condition f (0) = 60Hz. The steady state value of the frequency is 56.02Hz for the swing equation and 55.72Hz for the improved swing model. B. Constant Load: Example 2 An estimate of the region of attraction for the improved swing equation is provided in Section III (Ωs in Theorem 1). Figure 4(b) illustrates a solution that initiates just out of the domain and becomes unstable. However, the conventional swing equation is falsely depicting that the system remains stable. Here, we set Pm = 1pu and Pe = 4.65pu, and start from f (0) = 24Hz. According to (11), the estimate of region of attraction allows for f > 25Hz. C. Constant Load: Example 3 Frequency (Hz) 56 55 20 40 60 80 100 120 80 100 120 80 100 120 80 100 120 (b) Frequency (Hz) In this section we provide simulations verifying our results. Examples depict the mismatch between the behavior suggested by the swing equation and the improved version. In all simulations, the parameters are set as follows: M = 0.2, A = 0.04, ω ∗ = (2π)60, and γ = 2. Note that J = wM∗ and Dd = ωA∗ . Improved Swing Equation Swing Equation 57 0 50 40 30 20 0 20 40 60 (c) Frequency (Hz) V. S IMULATION (a) 60 40 20 0 20 40 60 (d) Frequency (Hz) Proof: The proof is similar to the proof of the Theorem 3 and therefore omitted. Note that here, V̇ = −A(ω − ω ∗ )2 and hence here the condition V < Vp ( π2 ) suffices for proving the stability. Corollary 1 and Theorem 3 characterize similar region of attraction estimates for both models (improved swing and the conventional one) if ck ≥ cp (and as a result c = cp ). 62 60 58 0 20 40 60 Time(s) Fig. 4. Simulation results for the case with constant load (a-c) and SMIB (d) show different behavior of the two models: (a) The models reach different steady-state frequency value while bearing the same load. (b) A solution of the improved swing equation starting from outside of the region of attraction estimate, diverges from the equilibrium. Nevertheless, the solution of the conventional swing equation converges. (c) The frequency in the improved swing equation is not stable when condition (5) does not hold. The stability of the swing equation does not necessitate such a condition. (d) While the conventional swing SMIB model (34) suggests divergence from the equilibrium, the frequency of the improved model converges to the desired value. Note that here, the initial condition is outside the region of attraction estimate for both models. D. SMIB: Different Behavior The behavior of both systems, conventional and improved, are similar when connected to an infinite bus. However still with some specific initial conditions, the systems act quite differently. Figure 4(d) illustrates an example of this different behavior. Angular Velocity (rad/s) :)/2305843009213693952 -...+ (611643854850417 (y - 120 :)2 )/23058430 According to the analysis in Section III,(1019406424750695 condition (5) should hold for the improved swing equation, so that there 382 exist a steady state frequency value. Figure 4(c) shows that the system becomes unstable if the inequality (5) is violated. 380 In this example we adjust Pm = 1pu and Pe = 4.90pu such that ∆ as defined in (7) possesses a negative value. V=c 378 376 374 372 E. SMIB: Region of Attraction Figure 5 illustrates the phase portrait of the system (29) and the Lyapunov function V (δ, ω) level sets. It is verified that our estimate of the domain of attraction is not very conservative. Note that there are solutions outside the estimate of region of attraction that still converge, however the solutions further away from the estimate of domain of attraction diverge from the equilibrium. -1 0 1 Angle(rad) 2 3 Fig. 5. The estimate of the domain of attraction for system (29) (SIMB) is verified. All solutions (dotted green) within the Lyapunov level set {V (δ, ω)  = c} (dark blue) converge to the equilibrium (δ, ω) = π , (2π)60 . Note that here cp < ck , and hence c = cp = Vp ( π2 ). 6 VI. C ONCLUSION AND F UTURE W ORK We have investigated the properties of an improved swing equation without relying on linearization. Modeling the synchronous generator by this equation, two scenarios are considered in this paper. First, the stability of a single generator connected to a constant load is proved and frequency regulation through a proposed controller is achieved. In the second scenario, the synchronous machine is connected to an infinite bus. As a contribution with respect to [2], where similar dynamics are investigated through linearization, here a nonlinear Lyapunov analysis is provided to prove stability and frequency regulation. Finally, simulations are carried out to show that the swing equation model gives rise to a behavior that does not match what is suggested by the improved swing equation. Future works include considering voltage dynamics and multi-machine systems. R EFERENCES [1] M. Shahidehpour and M. Khodayar, “Cutting campus energy costs with hierarchical control: The economical and reliable operation of a microgrid,” Electrification Magazine, IEEE, vol. 1, no. 1, pp. 40–56, Sept 2013. [2] J. Zhou and Y. Ohsawa, “Improved swing equation and its properties in synchronous generators,” Circuits and Systems I: Regular Papers, IEEE Transactions on, vol. 56, no. 1, pp. 200–209, Jan 2009. [3] S. Fiaz, D. Zonetti, R. Ortega, J. Scherpen, and A. van der Schaft, “A port-hamiltonian approach to power network modeling and analysis,” European Journal of Control, vol. 19, no. 6, pp. 477 – 485, 2013, lagrangian and Hamiltonian Methods for Modelling and Control. [4] S. Caliskan and P. Tabuada, “Compositional transient stability analysis of multimachine power networks,” Control of Network Systems, IEEE Transactions on, vol. 1, no. 1, pp. 4–14, March 2014. [5] S. Y. Caliskan and P. Tabuada, “Uses and abuses of the swing equation model,” in Decision and Control (CDC), 2015 IEEE 54th Annual Conference on, Dec 2015, pp. 6662–6667. [6] V. Natarajan and G. Weiss, “Almost global asymptotic stability of a constant field current synchronous machine connected to an infinite bus,” in Decision and Control (CDC), 2014 IEEE 53rd Annual Conference on, Dec 2014, pp. 3272–3279. [7] V. Natarajan and G. Weiss, “A method for proving the global stability of a synchronous generator connected to an infinite bus,” in Electrical Electronics Engineers in Israel (IEEEI), 2014 IEEE 28th Convention of, Dec 2014, pp. 1–5. [8] A. J. van der Schaft and T. Stegink, “Perspectives in modeling for control of power networks,” Annual Reviews in Control, Spring Issue 2016, to appear. [9] J. Machowski, J. Bialek, and J. Bumby, Power System Dynamics: Stability and Control, 2nd ed. Wiley, 2008. [10] Z. Zhao, F. Zheng, J. Gao, and L. Xu, “A dynamic on-line parameter identification and full-scale system experimental verification for large synchronous machines,” IEEE Transactions on Energy Conversion, vol. 10, no. 3, pp. 392–398, Sep 1995.
3cs.SY
Learn&Fuzz: Machine Learning for Input Fuzzing Patrice Godefroid1 , Hila Peleg2? , and Rishabh Singh1 arXiv:1701.07232v1 [cs.AI] 25 Jan 2017 1 Microsoft Research {pg,risin}@microsoft.com 2 The Technion [email protected] Abstract. Fuzzing consists of repeatedly testing an application with modified, or fuzzed, inputs with the goal of finding security vulnerabilities in input-parsing code. In this paper, we show how to automate the generation of an input grammar suitable for input fuzzing using sample inputs and neural-network-based statistical machine-learning techniques. We present a detailed case study with a complex input format, namely PDF, and a large complex security-critical parser for this format, namely, the PDF parser embedded in Microsoft’s new Edge browser. We discuss (and measure) the tension between conflicting learning and fuzzing goals: learning wants to capture the structure of well-formed inputs, while fuzzing wants to break that structure in order to cover unexpected code paths and find bugs. We also present a new algorithm for this learn&fuzz challenge which uses a learnt input probability distribution to intelligently guide where to fuzz inputs. 1 Introduction Fuzzing is the process of finding security vulnerabilities in input-parsing code by repeatedly testing the parser with modified, or fuzzed, inputs. There are three main types of fuzzing techniques in use today: (1) blackbox random fuzzing [27], (2) whitebox constraint-based fuzzing [12], and (3) grammar-based fuzzing [23, 27], which can be viewed as a variant of model-based testing [28]. Blackbox and whitebox fuzzing are fully automatic, and have historically proved to be very effective at finding security vulnerabilities in binary-format file parsers. In contrast, grammar-based fuzzing is not fully automatic: it requires an input grammar specifying the input format of the application under test. This grammar is typically written by hand, and this process is laborious, time consuming, and error-prone. Nevertheless, grammar-based fuzzing is the most effective fuzzing technique known today for fuzzing applications with complex structured input formats, like web-browsers which must take as (untrusted) inputs web-pages including complex HTML documents and JavaScript code. In this paper, we consider the problem of automatically generating input grammars for grammar-based fuzzing by using machine-learning techniques and ? The work of this author was done mostly while visiting Microsoft Research. 2 0 obj << /Type / Pages / Kids [ 3 0 R ] /Count 1 >> en dobj (a) xref 0 6 0000000000 0000000010 0000000059 0000000118 0000000296 0000000377 0000000395 (b) 65535 00000 00000 00000 00000 00000 00000 f n n n n n n trailer << / S i z e 18 / I n f o 17 0 R / Root 1 0 R >> startxref 3661 (c) Fig. 1. Excerpts of a well-formed PDF document. (a) is a sample object, (b) is a cross-reference table with one subsection, and (c) is a trailer. sample inputs. Previous attempts have used variants of traditional automata and context-free-grammar learning algorithms (see Section 5). In contrast with prior work, this paper presents the first attempt at using neural-network-based statistical learning techniques for this problem. Specifically, we use recurrent neural networks for learning a statistical input model that is also generative: it can be used to generate new inputs based on the probability distribution of the learnt model (see Section 3 for an introduction to these learning techniques). We use unsupervised learning, and our approach is fully automatic and does not require any format-specific customization. We present an in-depth case study for a very complex input format: PDF. This format is so complex (see Section 2) that it is described in a 1,300-pages (PDF) document [1]. We consider a large, complex and security-critical parser for this format: the PDF parser embedded in Microsoft’s new Edge browser. Through a series of detailed experiments (see Section 4), we discuss the learn&fuzz challenge: how to learn and then generate diverse well-formed inputs in order to maximize parser-code coverage, while still injecting enough ill-formed input parts in order to exercise unexpected code paths and error-handling code. We also present a novel learn&fuzz algorithm (in Section 3) which uses a learnt input probability distribution to intelligently guide where to fuzz (statistically well-formed) inputs. We show that this new algorithm can outperform the other learning-based and random fuzzing algorithms considered in this work. The paper is organized as follows. Section 2 presents an overview of the PDF format, and the specific scope of this work. Section 3 gives a brief introduction to neural-network-based learning, and discusses how to use and adapt such techniques for the learn&fuzz problem. Section 4 presents results of several learning and fuzzing experiments with the Edge PDF parser. Related work is discussed in Section 5. We conclude and discuss directions for future work in Section 6. 125 0 o b j [680.6 680.6] end obj (a) 88 0 o b j ( R e l a t e d Work) en dobj (b) 75 0 o b j 4171 en dobj (c) 47 1 o b j [ f a l s e 170 8 5 . 5 ( H e l l o ) /My#20Name ] end obj (d) Fig. 2. PDF data objects of different types. 2 The Structure of PDF Documents The full specification of the PDF format is over 1, 300 pages long [1]. Most of this specification – roughly 70% – deals with the description of data objects and their relationships between parts of a PDF document. PDF files are encoded in a textual format, which may contain binary information streams (e.g., images, encrypted data). A PDF document is a sequence of at least one PDF body. A PDF body is composed of three sections: objects, cross-reference table, and trailer. Objects. The data and metadata in a PDF document is organized in basic units called objects. Objects are all similarly formatted, as seen in Figure 1(a), and have a joint outer structure. The first line of the object is its identifier, for indirect references, its generation number, which is incremented if the object is overridden with a newer version, and “obj” which indicates the start of an object. The “endobj” indicator closes the object. The object in Figure 1(a) contains a dictionary structure, which is delimited by “<<” and “>>”, and contains keys that begin with / followed by their values. [ 3 0 R ] is a cross-object reference to an object in the same document with the identifier 3 and the generation number 0. Since a document can be very large, a referenced object is accessed using random-access via a cross-reference table. Other examples of objects are shown in Figure 2. The object in Figure 2(a) has the content [680.6 680.6], which is an array object. Its purpose is to hold coordinates referenced by another object. Figure 2(b) is a string literal that holds the bookmark text for a PDF document section. Figure 2(c) is a numeric object. Figure 2(d) is an object containing a multi-type array. These are all examples of object types that are both used on their own and as the basic blocks from which other objects are composed (e.g., the dictionary object in Figure 1(a) contains an array). The rules for defining and composing objects comprises the majority of the PDF-format specification. Cross reference table. The cross reference tables of a PDF body contain the address in bytes of referenced objects within the document. Figure 1(b) shows a cross-reference table with a subsection that contains the addresses for five objects with identifiers 1-5 and the placeholder for identifier 0 which never refers to an object. The object being pointed to is determined by the row of the table (the subsection will include 6 objects starting with identifier 0) where n is an indicator for an object in use, where the first column is the address of the object in the file, and f is an object not used, where the first column refers to the identifier of the previous free object, or in the case of object 0 to object 65535, the last available object ID, closing the circle. Trailer. The trailer of a PDF body contains a dictionary (again contained within “<<” and “>>”) of information about the body, and startxref which is the address of the cross-reference table. This allows the body to be parsed from the end, reading startxref, then skipping back to the cross-reference table and parsing it, and only parsing objects as they are needed. Updating a document. PDF documents can be updated incrementally. This means that if a PDF writer wishes to update the data in object 12, it will start a new PDF body, in it write the new object with identifier 12, and a generation number greater than the one that appeared before. It will then write a new cross-reference table pointing to the new object, and append this body to the previous document. Similarly, an object will be deleted by creating a new cross-reference table and marking it as free. We use this method in order to append new objects in a PDF file, as discussed later in Section 4. Scope of this work. In this paper, we investigate how to leverage and adapt neural-network-based learning techniques to learn a grammar for non-binary PDF data objects. Such data objects are formatted text, such as shown in Figure 1(a) and Figure 2. Rules for defining and composing such data objects makes the bulk of the 1,300-pages PDF-format specification. These rules are numerous and tedious, but repetitive and structured, and therefore well-suited for learning with neural networks (as we will show later). In contrast, learning automatically the structure (rules) for defining cross-reference tables and trailers, which involve constraints on lists, addresses, pointers and counters, look too complex and less promising for learning with neural networks. We also do not consider binary data objects, which are encoded in binary (e.g., image) sub-formats and for which fully-automatic blackbox and whitebox fuzzing are already effective. 3 Statistical Learning of Object Contents We now describe our statistical learning approach for learning a generative model of PDF objects. The main idea is to learn a generative language model over the set of PDF object characters given a large corpus of objects. We use a sequence-to-sequence (seq2seq) [5, 26] network model that has been shown to produce state-of-the-art results for many different learning tasks such as machine translation [26] and speech recognition [6]. The seq2seq model allows for learning arbitrary length contexts to predict next sequence of characters as compared to traditional n-gram based approaches that are limited by contexts of finite length. Given a corpus of PDF objects, the seq2seq model can be trained in an unsupervised manner to learn a generative model to generate new PDF objects using a set of input and output sequences. The input sequences correspond to sequences of characters in PDF objects and the corresponding output sequences are obtained by shifting the input sequences by one position. The learnt model can then be used to generate new sequences (PDF objects) by sampling the distribution given a starting prefix (such as “obj”). 3.1 Sequence-to-Sequence Neural Network Models A recurrent neural network (RNN) is a neural network that operates on a variable length input sequence hx1 , x2 , · · · , xT i and consists of a hidden state h and an output y. The RNN processes the input sequence in a series of time stamps (one for each element in the sequence). For a given time stamp t, the hidden state ht at that time stamp and the output yt is computed as: ht = f (ht−1 , xt ) yt = φ(ht ) where f is a non-linear activation function such as sigmoid, tanh etc. and φ is a function such as softmax that computes the output probability distribution over a given vocabulary conditioned on the current hidden state. RNNs can learn a probability distribution over a character sequence hx1 , · · · , xt−1 i by training to predict the next character xt in the sequence, i.e., it can learn the conditional distribution p(xt |hx1 , · · · , xt−1 i). Cho et al. [5] introduced a sequence-to-sequence (seq2seq) model that consists of two recurrent neural networks, an encoder RNN that processes a variable dimensional input sequence to a fixed dimensional representation, and a decoder RNN that takes the fixed dimensional input sequence representation and generates the variable dimensional output sequence. The decoder network generates output sequences by using the predicted output character generated at time step t as the input character for timestep t + 1. An illustration of the seq2seq architecture is shown in Figure. 3. This architecture allows us to learn a conditional distribution over a sequence of next outputs, i.e., p(hy1 , · · · , yT1 i|hx1 , · · · , xT2 i). We train the seq2seq model using a corpus of PDF objects treating each one of them as a sequence of characters. During training, we first concatenate all the object files si into a single file resulting in a large sequence of characters s̃ = s1 + · · · + sn . We then split the sequence into multiple training sequences of a fixed size d, such that the ith training instance ti = s̃[i ∗ d : (i + 1) ∗ d], where s[k : l] denotes the subsequence of s between indices k and l. The output sequence for each training sequence is the input sequence shifted by 1 position, i.e., ot = s̃[i ∗ d + 1 : (i + 1) ∗ d + 1]. The seq2seq model is then trained end-to-end to learn a generative model over the set of all training instances. o b j < / T y p < < / T y Encoder RNN … Decoder RNN Fig. 3. A sequence-to-sequence RNN model to generate PDF objects. 3.2 Generating new PDF objects We use the learnt seq2seq model to generate new PDF objects. There are many different strategies for object generation depending upon the sampling strategy used to sample the learnt distribution. We always start with a prefix of the sequence “obj ” (denoting the start of an object instance), and then query the model to generate a sequence of output characters until it produces “endobj” corresponding to the end of the object instance. We now describe three different sampling strategies we employ for generating new object instances. NoSample: In this generation strategy, we use the learnt distribution to greedily predict the best character given a prefix. This strategy results in generating PDF objects that are most likely to be well-formed and consistent, but it also limits the number of objects that can be generated. Given a prefix like “obj”, the best sequence of next characters is uniquely determined and therefore this strategy results in the same PDF object. This limitation precludes this strategy from being useful for fuzzing. Sample: In this generation strategy, we use the learnt distribution to sample next characters (instead of selecting the top predicted character) in the sequence given a prefix sequence. This sampling strategy is able to generate a diverse set of new PDF objects by combining various patterns the model has learnt from the diverse set of objects in the training corpus. Because of sampling, the generated PDF objects are not always guaranteed to be well-formed, which is useful from the fuzzing perspective. SampleSpace: This sampling strategy is a combination of Sample and NoSample strategies. It samples the distribution to generate the next character only when the current prefix sequence ends with a whitespace, whereas it uses the best character from the distribution in middle of tokens (i.e., prefixes ending with non-whitespace characters), similar to the NoSample strategy. This strategy is expected to generate more well-formed PDF objects compared to the Sample strategy as the sampling is restricted to only at the end of whitespace characters. Algorithm 1 SampleFuzz(D(x, θ), tfuzz , pt ) seq := “obj ” while ¬ seq.endswith(“endobj”) do c,p(c) := sample(D(seq,θ)) (* Sample c from the learnt distribution *) pfuzz := random(0, 1) (* random variable to decide whether to fuzz *) if pfuzz > tfuzz ∧ p(c) > pt then c := argminc0 {p(c0 ) ∼ D(seq, θ)} (* replace c by c’ (with lowest likelihood) *) end if seq := seq + c if len(seq) > MAXLEN then seq := “obj ” (* Reset the sequence *) end if end while return seq 3.3 SampleFuzz: Sampling with Fuzzing Our goal of learning a generative model of PDF objects is ultimately to perform fuzzing. A perfect learning technique would always generate well-formed objects that would not exercise any error-hanlding code, whereas a bad learning technique would result in ill-formed objects that woult be quickly rejected by the parser upfront. To explore this tradeoff, we present a new algorithm, dubbed SampleFuzz, to perform some fuzzing while sampling new objects. We use the learnt model to generate new PDF object instances, but at the same time introduce anomalies to exercise error-handling code. The SampleFuzz algorithm is shown in Algorithm 1. It takes as input the learnt distribution D(x, θ), the probability of fuzzing a character tfuzz , and a threshold probability pt that is used to decide whether to modify the predicted character. While generating the output sequence seq, the algorithm samples the learnt model to get some next character c and its probability p(c) at a particular timestamp t. If the probability p(c) is higher than a user-provided threshold pt , i.e., if the model is confident that c is likely the next character in the sequence, the algorithm chooses to instead sample another different character c0 in its place where c0 has the minimum probability p(c0 ) in the learnt distribution. This modification (fuzzing) takes place only if the result pfuzz of a random coin toss returns a probability higher than input parameter tfuzz , which lets the user further control the probability of fuzzing characters. The key intuition of the SampleFuzz algorithm is to introduce unexpected characters in objects only in places where the model is highly confident, in order to trick the PDF parser. The algorithm also ensures that the object length is bounded by MAXLEN. Note that the algorithm is not guaranteed to always terminate, but we observe that it always terminates in practice. 3.4 Training the Model Since we train the seq2seq model in an unsupervised learning setting, we do not have test labels to explicitly determine how well the learnt models are performing. We instead train multiple models parameterized by number of passes, called epochs, that the learning algorithm performs over the training dataset. An epoch is thus defined as an iteration of the learning algorithm to go over the complete training dataset. We evaluate the seq2seq models trained for five different numbers of epochs: 10, 20, 30, 40, and 50. In our setting, one epoch takes about 12 minutes to train the seq2seq model, and the model with 50 epochs takes about 10 hours to learn. We use an LSTM model [15] (a variant of RNN) with 2 hidden layers, where each layer consists of 128 hidden states. 4 4.1 Experimental Evaluation Experiment Setup In this section, we present results of various fuzzing experiments with the PDF viewer included in Microsoft’s new Edge browser. We used a self-contained singleprocess test-driver executable provided by the Windows team for testing/fuzzing purposes. This executable takes a PDF file as input argument, executes the PDF parser included in the Microsoft Edge browser, and then stops. If the executable detects any parsing error due to the PDF input file being malformed, it prints an error message in an execution log. In what follows, we simply refer to it as the Edge PDF parser. All experiments were performed on 4-core 64-bit Windows 10 VMs with 20Gb of RAM. We use three main standard metrics to measure fuzzing effectiveness: Coverage. For each test execution, we measure instruction coverage, that is, the set of all unique instructions executed during that test. Each instruction is uniquely identified by a pair of values dll-name and dll-offset. The coverage for a set of tests is simply the union of the coverage sets of each individual test. Pass rate. For each test execution, we programmatically check (grep) for the presence of parsing-error messages in the PDF-parser execution log. If there are no error messages, we call this test pass otherwise we call it fail. Pass tests corresponds to PDF files that are considered to be well-formed by the Edge PDF parser. This metric is less important for fuzzing purposes, but it will help us estimate the quality of the learning. Bugs. Each test execution is performed under the monitoring of the tool AppVerifier, a free runtime monitoring tool that can catch memory corruptions bugs (such as buffer overflows) with a low runtime overhead (typically a few percent runtime overhead) and that is widely used for fuzzing on Windows (for instance, this is how SAGE [12] detects bugs). 4.2 Training Data We extracted about 63,000 non-binary PDF objects out of a diverse set of 534 PDF files. These 534 files themselves were provided to us by the Windows fuzzing team and had been used for prior extended fuzzing of the Edge PDF parser. This set of 534 files was itself the result of seed minimization, that is, the process of computing a subset of a larger set of input files which provides the same instruction coverage as the larger set. Seed minimization is a standard first step applied before file fuzzing [27, 12]. The larger set of PDF files came from various sources, like past PDF files used for fuzzing but also other PDF files collected from the public web. These 63,000 non-binary objects are the training set for the RNNs we used in this work. Binary objects embedded in PDF files (typically representing images in various image formats) were not considered in this work. We learn, generate, and fuzz PDF objects, but the Edge PDF parser processes full PDF files, not single objects. Therefore we wrote a simple program to correctly append a new PDF object to an existing (well-formed) PDF file, which we call a host, following the procedure discussed in Section 2 for updating a PDF document. Specifically, this program first identifies the last trailer in the PDF host file. This provides information about the file, such as addresses of objects and the cross-reference table, and the last used object ID. Next, a new body section is added to the file. In it, the new object is included with an object ID that overrides the last object in the host file. A new cross reference table is appended, which increases the generation number of the overridden object. Finally, a new trailer is appended. 4.3 Baseline Coverage To allow for a meaningful interpretation of coverage results, we randomly selected 1,000 PDF objects out of our 63,000 training objects, and we measured their coverage of the Edge PDF parser, to be used as a baseline for later experiments. A first question is which host PDF file should we use in our experiments: since any PDF file will have some objects in it, will a new appended object interfere with other objects already present in the host, and hence influence the overall coverage and pass rate? To study this question, we selected the smallest three PDF files in our set of 534 files, and used those as hosts. These three hosts are of size 26Kb, 33Kb and 16Kb respectively. Figure 4 shows the instruction coverage obtained by running the Edge PDF parser on the three hosts, denoted host1, host2, and host3. It also show the coverage obtained by computing the union of these three sets, denoted host123. Coverage ranges from 353,327 (host1) to 457,464 (host2) unique instructions, while the union (host123) is 494,652 and larger than all three – each host covers some unique instructions not covered by the other two. Note that the smallest file host3 does not lead to the smallest coverage. Fig. 4. Coverage for PDF hosts and baselines. Next, we recombined each of our 1,000 baseline objects with each of our three hosts, to obtain three sets of 1,000 new PDF files, denoted baseline1, baseline2 and baseline3, respectively. Figure 4 shows the coverage of each set, as well as their union baseline123. We observe the following. – The baseline coverage varies depending on the host, but is larger than the host alone (as expected). The largest difference between a host and a baseline coverage is 59,221 instruction for host123 out of 553,873 instruction for baseline123. In other words, 90% of all instructions are included in the host coverage no matter what new objects are appended. – Each test typically covers on the order of half a million unique instructions; this confirms that the Edge PDF parser is a large and non-trivial application. – 1,000 PDF files take about 90 minutes to be processed (both to be tested and get the coverage data). We also measured the pass rate for each experiment. As expected, the pass rate is 100% for all 3 hosts. Main Takeaway: Even though coverage varies across hosts because objects may interact differently with each host, the re-combined PDF file is always perceived as well-formed by the Edge PDF parser. 4.4 Learning PDF Objects When training the RNN, an important parameter is the number of epochs being used (see Section 3). We report here results of experiments obtained after training the RNN for 10, 20, 30, 40, and 50 epochs, respectively. After training, we used each learnt RNN model to generate 1,000 unique PDF objects. We also compared the generated objects with the 63,000 objects used for training the model, and found no exact matches. As explained earlier in Section 3, we consider two main RNN generation modes: the Sample mode where we sample the distribution at every character Fig. 5. Pass rate for Sample and SampleSpace from 10 to 50 epochs. position, and the SampleSpace mode where we sample the distribution only after whitespaces and generate the top predicted character for other positions. The pass rate for Sample and SampleSpace when training with 10 to 50 epochs is reported in Figure 5. We observe the following: – The pass rate for SampleSpace is consistently better than the one for Sample. – For 10 epochs only, the pass rate for Sample is already above 70%. This means that the learning is of good quality. – As the number of epochs increases, the pass rate increases, as expected, since the learned models become more precise but they also take more time (see Section 3). – The best pass rate is 97% obtained with SampleSpace and 50 epochs. Interestingly, the pass rate is essentially the same regardless of the host PDF file being used: it varies by at most 0.1% across hosts (data not shown here). Main Takeaway: The pass rate ranges between 70% and 97% and shows the learning is of good quality. 4.5 Coverage with Learned PDF Objects Figure 6 shows the instruction coverage obtained with Sample and SampleSpace from 10 to 50 epochs and using host1 (top left), host2 (top right), host3 (bottom left), and the overall coverage for all hosts host123 (bottom right). The figure also shows the coverage obtained with the corresponding baseline. We observe the following: – Unlike for the pass rate, the host impacts coverage significantly, as already pointed out earlier. Moreover, the shapes of each line vary across hosts. – For host1 and host2, the coverage for Sample and SampleSpace are above the baseline coverage for most epoch results, while they are mostly below the baseline coverage for host3 and host123. host1 host2 host3 host123 Fig. 6. Coverage for Sample and SampleSpace from 10 to 50 epochs, for host 1, 2, 3, and 123. – The best overall coverage is obtained with Sample 40-epochs (see the host123 data at the bottom right). – The baseline123 coverage is overall second best behind Sample 40-epochs. – The best coverage obtained with SampleSpace is also with 40-epochs. Main Takeaway: The best overall coverage is obtained with Sample 40-epochs. 4.6 Comparing Coverage Sets So far, we simply counted the number of unique instructions being covered. We now drill down into the overall host123 coverage data of Figure 6, and compute the overlap between overall coverage sets obtained with our 40-epochs winner Sample-40e and SampleSpace-40e, as well as the baseline123 and host123 overall coverage. The results are presented in Figure 7. We observe the following: – All sets are almost supersets of host123 as expected (see the host123 row), except for a few hundred instructions each. – Sample-40e is almost a superset of all other sets, except for 1,680 instructions compared to SampleSpace-40e, and a few hundreds instructions compared to baseline123 and host123 (see the Sample-40e column). Row\Column Sample-40e SampleSpace-40e baseline123 host123 Sample-40e 0 10,799 6,658 65,442 SampleSpace-40e 1,680 0 3,393 56,323 baseline123 660 6,514 0 59,444 host123 188 781 223 0 Fig. 7. Comparing coverage: unique instructions in each row compared to each column. Algorithm SampleSpace+Random baseline+Random Sample-10K Sample+Random SampleFuzz Coverage 563,930 564,195 565,590 566,964 567,634 Pass Rate 36.97% 44.05% 78.92% 41.81% 68.24% Fig. 8. Results of fuzzing experiments with 30,000 PDF files each. – Sample-40e and SampleSpace-40e have way more instructions in common than they differ (10,799 and 1,680), with Sample-40e having better coverage than SampleSpace-40e. – SampleSpace-40e is incomparable with baseline123: it has 3,393 more instructions but also 6,514 missing instructions. Main Takeaway: Our coverage winner Sample-40e is almost a superset of all other coverage sets. 4.7 Combining Learning and Fuzzing In this section, we consider several ways to combine learning with fuzzing, and evaluate their effectiveness. We consider a widely-used simple blackbox random fuzzing algorithm, denoted Random, which randomly picks a position in a file and then replaces the byte value by a random value between 0 and 255. The algorithm uses a fuzzfactor of 100: the length of the file divided by 100 is the average number of bytes that are fuzzed in that file. We use random to generate 10 variants of every PDF object generated by 40epochs Sample-40e, SampleSpace-40e, and baseline. The resulting fuzzed objects are re-combined with our 3 host files, to obtain three sets of 30,000 new PDF files, denoted by Sample+Random, SampleSpace+Random and baseline+Random, respectively. For comparison purposes, we also include the results of running Sample-40e to generate 10,000 objects, denoted Sample-10K. Finally, we consider our new algorithm SampleFuzz described in Section 3, which decides where to fuzz values based on the learnt distribution. We applied this algorithm with the learnt distribution of the 40-epochs RNN model, tfuzz = 0.9, and a threshold pt = 0.9. Figure 8 reports the overall coverage and the pass-rate for each set. Each set of 30,000 PDF files takes about 45 hours to be processed. The rows are sorted by increasing coverage. We observe the following: – After applying Random on objects generated with Sample, SampleSpace and baseline, coverage goes up while the pass rate goes down: it is consistently below 50%. – After analyzing the overlap among coverage sets (data not shown here), all fuzzed sets are almost supersets of their original non-fuzzed sets (as expected). – Coverage for Sample-10K also increases by 6,173 instructions compared to Sample, while the pass rate remains around 80% (as expected). – Perhaps surprisingly, the best overall coverage is obtained with SampleFuzz. Its pass rate is 68.24%. – The difference in absolute coverage between SampleFuzz and the next best Sample+Random is only 670 instructions. Moreover, after analyzing the coverage set overlap, SampleFuzz covers 2,622 more instructions than Sample+Random, but also misses 1,952 instructions covered by Sample+Random. Therefore, none of these two top-coverage winners fully “simulate” the effects of the other. Main Takeaway: All the learning-based algorithms considered here are competitive compared to baseline+Random, and three of those beat that baseline coverage. 4.8 Main Takeaway: Tension between Coverage and Pass Rate The main takeaway from all our experiments is the tension we observe between the coverage and the pass rate. This tension is visible in Figure 8. But it is also visible in earlier results: if we correlate the coverage results of Figure 6 with the pass-rate results of Figure 5, we can clearly see that SampleSpace has a better pass rate than Sample, but Sample has a better overall coverage than SampleSpace (see host123 in the bottom right of Figure 6). Intuitively, this tension can be explained as follows. A pure learning algorithm with a nearly-perfect pass-rate (like SampleSpace) generates almost only well-formed objects and exercises little error-handling code. In contrast, a noisier learning algorithm (like Sample) with a lower pass-rate can not only generate many well-formed objects, but it also generates some ill-formed ones which exercise error-handling code. Applying a random fuzzing algorithm (like random) to previously-generated (nearly) well-formed objects has an even more dramatic effect on lowering the pass rate (see Figure 8) while increasing coverage, again probably due to increased coverage of error-handling code. The new SampleFuzz algorithm seems to hit a sweet spot between both pass rate and coverage. In our experiments, the sweet spot for the pass rate seems to be around 65% − 70%: this pass rate is high enough to generate diverse wellformed objects that cover a lot of code in the PDF parser, yet low enough to also exercise error-handling code in many parts of that parser. Note that instruction coverage is ultimately a better indicator of fuzzing effectiveness than the pass rate, which is instead a learning-quality metric. 4.9 Bugs In addition to coverage and pass rate, a third metric of interest is of course the number of bugs found. During the experiments previously reported in this section, no bugs were found. Note that the Edge PDF parser had been thoroughly fuzzed for months with other fuzzers (including SAGE [12]) before we performed this study, and that all the bugs found during this prior fuzzing had been fixed in the version of the PDF parser we used for this study. However, during a longer experiment with Sample+Random, 100,000 objects and 300,000 PDF files (which took nearly 5 days), a stack-overflow bug was found in the Edge PDF parser: a regular-size PDF file is generated (its size is 33Kb) but it triggers an unexpected recursion in the parser, which ultimately results in a stack overflow. This bug was later confirmed and fixed by the Microsoft Edge development team. We plan to conduct other longer experiments in the near future. 5 Related Work Grammar-based fuzzing. Most popular blackbox random fuzzers today support some form of grammar representation, e.g., Peach3 and SPIKE4 , among many others [27]. Work on grammar-based test input generation started in the 1970’s [14, 23] and is related to model-based testing [28]. Test generation from a grammar is usually either random [20, 25, 8] or exaustive [18]. Imperative generation [7, 10] is a related approach in which a custom-made program generates the inputs (in effect, the program encodes the grammar). Grammar-based fuzzing can also be combined with whitebox fuzzing [19, 11]. Learning grammars for grammar-based fuzzing. Bastani et al. [2] present an algorithm to synthesize a context-free grammar given a set of input examples, which is then used to generate new inputs for fuzzing. This algorithm uses a set of generalization steps by introducing repetition and alternation constructs for regular expressions, and merging non-terminals for context-free grammars, which in turn results in a monotonic generalization of the input language. This technique is able to capture hierarchical properties of input formats, but is not well suited for formats such as PDF objects, which are relatively flat but include a large diverse set of content types and key-value pairs. Instead, our approach uses sequence-to-sequence neural-network models to learn statistical generative 3 4 http://www.peachfuzzer.com/ http://resources.infosecinstitute.com/fuzzer-automation-with-spike/ models of such flat formats. Moreover, learning a statistical model also allows for guiding additional fuzzing of the generated inputs. AUTOGRAM [16] also learns (non-probabilistic) context-free grammars given a set of inputs but by dynamically observing how inputs are processed in a program. It instruments the program under test with dynamic taints that tags memory with input fragments they come from. The parts of the inputs that are processed by the program become syntactic entities in the grammar. Tupni [9] is another system that reverse engineers an input format from examples using a taint tracking mechanism that associate data structures with addresses in the application address space. Unlike our approach that treats the program under test as a black-box, AUTOGRAM and Tupni require access to the program for adding instrumentation, are more complex, and their applicability and precision for complex formats such as PDF objects is unclear. Neural-networks-based program analysis. There has been a lot of recent interest in using neural networks for program analysis and synthesis. Several neural architectures have been proposed to learn simple algorithms such as array sorting and copying [17, 24]. Neural FlashFill [21] uses novel neural architectures for encoding input-output examples and generating regular-expression-based programs in a domain specific language. Several seq2seq based models have been developed for learning to repair syntax errors in programs [3, 13, 22]. These techniques learn a seq2seq model over a set of correct programs, and then use the learnt model to predict syntax corrections for buggy programs. Other related work optimizes assembly programs using neural representations [4]. In this paper, we present a novel application of seq2seq models to learn grammars from sample inputs for fuzzing purposes. 6 Conclusion and Future Work Grammar-based fuzzing is effective for fuzzing applications with complex structured inputs provided a comprehensive input grammar is available. This paper describes the first attempt at using neural-network-based statistical learning techniques to automatically generate input grammars from sample inputs. We presented and evaluated algorithms that leverage recent advances in sequence learning by neural networks, namely seq2seq recurrent neural networks, to automatically learn a generative model of PDF objects. We devised several sampling techniques to generate new PDF objects from the learnt distribution. We show that the learnt models are not only able to generate a large set of new wellformed objects, but also results in increased coverage of the PDF parser used in our experiments, compared to various forms of random fuzzing. While the results presented in Section 4 may vary for other applications, our general observations about the tension between conflicting learning and fuzzing goals will remain valid: learning wants to capture the structure of well-formed inputs, while fuzzing wants to break that structure in order to cover unexpected code paths and find bugs. We believe that the inherent statistical nature of learning by neural networks is a powerful tool to address this learn&fuzz challenge. There are several interesting directions for future work. While the focus of our paper was on learning the structure of PDF objects, it would be worth exploring how to learn, as automatically as possible, the higher-level hierarchical structure of PDF documents involving cross-reference tables, object bodies, and trailer sections that maintain certain complex invariants amongst them. Perhaps some combination of logical inference techniques with neural networks could be powerful enough to achieve this. Also, our learning algorithm is currently agnostic to the application under test. We are considering using some form of reinforcement learning to guide the learning of seq2seq models with coverage feedback from the application, which could potentially guide the learning more explicitly towards increasing coverage. Acknowledgments. We thank Dustin Duran and Mark Wodrich from the Microsoft Windows security team for their Edge-PDF-parser test-driver and for helpful feedback. We also thank the team members of Project Springfield, which partly funded this work. References 1. Adobe Systems Incorporated. PDF Reference, 6th edition, Nov. 2006. Available at http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/ pdf_reference_1-7.pdf. 2. Osbert Bastani, Rahul Sharma, Alex Aiken, and Percy Liang. Synthesizing program input grammars. CoRR, abs/1608.01723, 2016. 3. Sahil Bhatia and Rishabh Singh. Automated correction for syntax errors in programming assignments using recurrent neural networks. CoRR, abs/1603.06129, 2016. 4. Rudy R. Bunel, Alban Desmaison, Pawan Kumar Mudigonda, Pushmeet Kohli, and Philip H. S. Torr. Adaptive neural compilation. In NIPS, pages 1444–1452, 2016. 5. Kyunghyun Cho, Bart van Merrienboer, Çaglar Gülçehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using RNN encoder-decoder for statistical machine translation. In EMNLP, pages 1724–1734, 2014. 6. Jan K Chorowski, Dzmitry Bahdanau, Dmitriy Serdyuk, Kyunghyun Cho, and Yoshua Bengio. Attention-based models for speech recognition. In Advances in Neural Information Processing Systems, pages 577–585, 2015. 7. K. Claessen and J. Hughes. QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs. In Proceedings of ICFP’2000, 2000. 8. D. Coppit and J. Lian. yagg: an easy-to-use generator for structured test inputs. In ASE, 2005. 9. Weidong Cui, Marcus Peinado, Karl Chen, Helen J Wang, and Luis Irun-Briz. Tupni: Automatic reverse engineering of input formats. In Proceedings of the 15th ACM conference on Computer and communications security, pages 391–402. ACM, 2008. 10. Brett Daniel, Danny Dig, Kely Garcia, and Darko Marinov. Automated testing of refactoring engines. In FSE, 2007. 11. P. Godefroid, A. Kiezun, and M. Y. Levin. Grammar-based Whitebox Fuzzing. In Proceedings of PLDI’2008 (ACM SIGPLAN 2008 Conference on Programming Language Design and Implementation), pages 206–215, Tucson, June 2008. 12. P. Godefroid, M.Y. Levin, and D. Molnar. Automated Whitebox Fuzz Testing. In Proceedings of NDSS’2008 (Network and Distributed Systems Security), pages 151–166, San Diego, February 2008. 13. Rahul Gupta, Soham Pal, Aditya Kanade, and Shirish Shevade. Deepfix: Fixing common c language errors by deep learning. In AAAI, 2017. 14. K.V. Hanford. Automatic Generation of Test Cases. IBM Systems Journal, 9(4), 1970. 15. Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8):1735–1780, 1997. 16. Matthias Höschele and Andreas Zeller. Mining input grammars from dynamic taints. In ASE, pages 720–725, 2016. 17. Karol Kurach, Marcin Andrychowicz, and Ilya Sutskever. Neural random-access machines. arXiv preprint arXiv:1511.06392, 2015. 18. R. Lämmel and W. Schulte. Controllable combinatorial coverage in grammar-based testing. In TestCom, 2006. 19. R. Majumdar and R. Xu. Directed Test Generation using Symbolic Grammars. In ASE, 2007. 20. P.M. Maurer. Generating test data with enhanced context-free grammars. IEEE Software, 7(4), 1990. 21. Emilio Parisotto, Abdel-rahman Mohamed, Rishabh Singh, Lihong Li, Dengyong Zhou, and Pushmeet Kohli. Neuro-symbolic program synthesis. CoRR, abs/1611.01855, 2016. 22. Yewen Pu, Karthik Narasimhan, Armando Solar-Lezama, and Regina Barzilay. sk p: a neural program corrector for moocs. CoRR, abs/1607.02902, 2016. 23. P. Purdom. A sentence generator for testing parsers. BIT Numerical Mathematics, 12(3), 1972. 24. Scott Reed and Nando de Freitas. Neural programmer-interpreters. arXiv preprint arXiv:1511.06279, 2015. 25. E.G. Sirer and B.N. Bershad. Using production grammars in software testing. In DSL, 1999. 26. 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. 27. M. Sutton, A. Greene, and P. Amini. Fuzzing: Brute Force Vulnerability Discovery. Addison-Wesley, 2007. 28. M. Utting, A. Pretschner, and B. Legeard. A Taxonomy of Model-Based Testing. Department of Computer Science, The University of Waikato, New Zealand, Tech. Rep, 4, 2006.
6cs.PL
RAIRO Operations Research arXiv:1706.02214v1 [cs.CC] 7 Jun 2017 Will be set by the publisher SOME COMPLEXITY AND APPROXIMATION RESULTS FOR COUPLED-TASKS SCHEDULING PROBLEM ACCORDING TO TOPOLOGY B. Darties 1 , R. Giroudeau 2 , J.-C. König 3 and G. Simonin 4 Abstract. We consider the makespan minimization coupled-tasks problem in presence of compatibility constraints with a specified topology. In particular, we focus on stretched coupled-tasks, i.e. coupled-tasks having the same sub-tasks execution time and idle time duration. We study several problems in framework of classic complexity and approximation for which the compatibility graph is bipartite (star, chain, . . .). In such a context, we design some efficient polynomial-time approximation algorithms for an intractable scheduling problem according to some parameters. 1. Introduction and model The detection of an object by a common radar system is based on the following principle: a transmitter emits a uni-directional pulse that propagates though the environmental medium. If the pulse encounters an object, it is reflected back to the transmitter. Using the transmit time and the direction of the pulse, the position of the object can be computed by the transmitter. Formally this acquisition process is divided into three parts: (i) pulse transmission, (ii) wave propagation and reflection, (iii) echo reception. Thus the detection system must perform two The date should precede \maketitle in AMS documentclasses; reported. 1 LE2I, UMR CNRS 6306, University of Burgundy, 8 Rue Alain Savary 21000 Dijon, France 2 LIRMM, UMR CNRS 5506, Université de Montpellier 161 rue Ada, 34392 Montpellier Cedex 5, France 3 LIRMM, UMR CNRS 5506, Université de Montpellier 161 rue Ada, 34392 Montpellier Cedex 5, France 4 Insight Centre for Data Analytics, University College Cork, Ireland c EDP Sciences 2001 2 TITLE WILL BE SET BY THE PUBLISHER tasks (parts (i) and (iii)) separated by an idle time (part (ii)). Such systems generally run in non-preemptive mode: once started, a task cannot be interrupted and resumed later. However, the idle time of an acquisition task can be reused to perform another task. On non-preemptive mono-processor systems, scheduling issues appear when in parallel several sensors using different frequencies are working: the idle time of an acquisition task can be reused to perform partially on entirely a second acquisition process using another sensor, but only if both sensors use different frequencies to avoid interferences. Otherwise these two acquisitions processes should be scheduled sequentially. Coupled-tasks, introduced first by Shapiro [15], seem to be a natural way to model, among others, data acquisition processes: a coupled-task ti is composed by two sub-tasks with processing time ai and bi and whose execution must be separated by an incompressible and not flexible time li (called the idle time of the task). For an acquisition process, a sensor emits a radio pulse as a first subtask, and listens for an echo reply as a second sub-task, while the radio pulse propagation operates during an idle time li . Coupled-tasks are also an efficient way to model acquisition systems designed to detect changes in an environment for a given period, by producing two measurements before and after the given period. Here each measurement can be modeled as a sub-task. We note T = {t1 , . . . , tn } the collection of coupled-tasks to be scheduled. In order to minimize the makespan (schedule length) of T , it is necessary to execute one or several different sub-tasks during the idle time of a coupled-task. In the original model, all coupled-tasks may be executed in each other according to processing time of sub-tasks and the duration of the idle time. Some papers investigated the problem of minimizing the makespan for various configurations depending on the values of ai , bi and li [1, 2, 14]. In [14], authors present a global visualization of scheduling problems complexity with coupledtasks, and give main complexity results. In a multi-sensors acquisition system, incompatibilities may arise between two tasks ti and tj if they operate with two different sensors working at the same channel. Thus any valid schedule would require ti and tj to be scheduled sequentially. Hereafter, we propose a generalization of an original coupled-tasks model by considering the notion of compatibility constraint among tasks: original coupled-task model, by introducing compatibility constraint among tasks: two tasks ti and tj are compatibles if any sub-task of ti may be executed during the idle time of tj or reciprocally. In [16], we introduced a compatibility graph G = (V, E) to model such this compatibility, where V = T is the entire collection of coupled-tasks, and each pair of compatible tasks are linked by an edge e ∈ E. We proposed in [16,18] new results focused on the impact of the addition of G on the complexity of the problem. Our work is motivated by the acquisition of data for automatic vehicle under water, as a TAIPAN torpedo. With the growth in robotic technologies, several applications and works are emerging and the theoretical needs are a priority. For example, the torpedo is used to execute several submarine topographic surveys, TITLE WILL BE SET BY THE PUBLISHER 3 including topological or temperature measurements. These acquisitions tasks can be partitioned into specific sub-problems, where their modelling is very precise. Since the engineers have a wide degree of freedom to create and transform the different tasks, they required a strong theoretical analysis of coupled tasks with compatibility constraint. Indeed, they needed to have a better knowledge of the difficulty of scheduling coupled-tasks on such systems, and to compare their scheduling heuristics to the optimal one. 1.1. Contribution In this work, we propose new results of complexity and approximation for particular problem instances composed by stretched coupled-tasks only : a stretched coupled-task is a coupled-task ti = (ai , li , bi ) for which the three parameters ai , bi and li are equal to the same value α(ti ), called the stretch factor of ti . We investigate here the problem of scheduling on a mono-processor a set of stretched coupled-tasks, subject to compatibility constraint in order to minimize the completion time of the latest task. For clarity, ai (resp bi ) refers either to the first (resp. second) sub-task, or to its processing time according to the context. A major research issue concerns the impact of the class of the compatibility graph G on the complexity of the problem: it is known that the problem is N Phard even when all the tasks are compatibles between each other, i.e. G is a complete graph (see [14]). On the other side, when G is an empty graph a trivial optimal solution would consist in scheduling tasks sequentially. Our aim is to determine the complexity of the problem when G describes some sub-classes of bipartite graphs, and to propose approximation algorithms with performance guarantee for N P-hard instances. Remark 1. If two compatibles stretched coupled-tasks ti and tj , with α(ti ) ≤ α(tj ), are scheduled in parallel in any solution of the scheduling problem, then one of the following conditions must hold: (1) either α(ti ) = α(tj ): then the idle time of one task is fully exploited to schedule a sub-task from the other (i.e. bi is scheduled during lj , and aj is scheduled during li ), and the execution of the two tasks is done without idle time. (2) or 3α(ti ) ≤ α(tj ): then ti is fully executed during the idle time lj of tj . For sake of simplify, we say we pack ti into tj . The others configuration α(ti ) < α(tj ) < 3α(ti ) is unavailable, otherwise some sub-tasks would overlap in the schedule. From Remark 1 one can propose an orientation to each edge e = (ti , tj ) ∈ E from the task with the lowest stretch factor to the task with the highest one, or set e as a bidirectional edge when α(ti ) = α(tj ). In the following, we consider only oriented compatibility graphs. Abusing notation, dealing with undirected topologies for G refers in fact to its underlying undirected graph. We use various standard notations from graph theory: NG (x) is the set of neighbors of x in G. ∆G is the maximum degree of G. We denote respectively by 4 TITLE WILL BE SET BY THE PUBLISHER + − + d− G (v) and dG (v) the indegree and outdegree of v, and dG (v) = dG (v) + dG (v). We denote by G[S] the graph induced from G by vertices from S. Reusing the Graham’s notation scheme [10], we define the main problem of this study as 1|α(ti ), G|Cmax . We study the variation of the complexity when the topology of G varies, and we propose approximation results for N P-hard instances. We study thee subclasses of bipartite graphs in particular: the chain, the star, and the k-stage bipartite graphs. A k-stage bipartite graph is a graph G = (V0 ∪ V1 ∪ · · · ∪ Vk , E1 ∪ E2 ∪ . . . ∪ Ek ), where each arc in Ei has its extremities in Vi and in Vi+1 , for i ∈ {1, . . . , k}. For a given k-stage bipartite graph G, we denote by Gk = G[Vk−1 ∪ Vk ] the kth stage of G. In this paper, we focus our study on 1-stage bipartite graphs (1-SBG) and 2-stage bipartite graphs (2-SBG). We also study the problem when the compatibility graph G is a 1-stage complete bipartite graph (1-SCBG), i.e. E1 contains all the edges (x, y), ∀x ∈ V0 , ∀y ∈ V1 . For 1-SBG (or 2-SBG) with G = (X ∪ Y, E), we denoted by X-tasks (resp. Y -tasks) the set of tasks represented by X (resp. Y ) in G. For any set of X-tasks, let seq(X) be the time required to schedule sequentially all the tasks from X. Formally, we have: X seq(X) = 3α(t). t∈X Remark 2. Given an instance of 1|α(ti ), G|Cmax . If X is an independent set for G, then all the tasks from X are pairwise non-compatibles. Thus seq(X) is a lower bound for the cost of any optimal solution. The results obtained in this article are summarized in Table 1. Topology G=Chain graph G=Star graph 1 G=Star graph 2 G= 1-SBG, dG (Y ) ≤ 2 Complexity O(n3 ) (Theo. 1) N P − C (Theo. 3) O(n) (Theo. 2) O(n3 ) (Theo. 4) Approximation F PT AS (Theo. 7) PT AS (Theo. 8) 13 12 -APX (Theo. 8) 13 G= 2-SBG N P − C (Theo. 5) 9 -APX (Theo. 9) Table 1. Complexity and approximation results discussed in this paper. G= 1-SCBG N P − C (see [17]) 1.2. Prerequisites 1.2.1. Performance ratio Recall that the performance ratio ρ for a minimization (resp. maximization) problem is given as the ratio between the value of the approximation solution reA(I) turned by the algorithm A on an instance I and the optimum i.e. ρ ≤ maxI OPT (I) 1Star graph with only incoming arcs for the central node arc. 2Star graph with at least one outcoming arc for the central node. TITLE WILL BE SET BY THE PUBLISHER 5 (I) (resp. ρ ≥ minI OPT A(I) ). Notice that for a minimization problem the ratio is greater than one (resp. lower than one). 1.2.2. Definition of problems To prove the different results announced in this paper, we use several well-known approximation results on four packing-related problems: (1) The subset sum (ss) problem is a well-known problem in which, given a set S of n positive values and v ∈ IN, one asks if there exists a subset S ∗ ⊆ P S such that i∈S ∗ i = v. This decision problem is well-known to be N Pcomplete (see [8]). The optimization version problem is sometimes viewed as a knapsack problem, where each item profits and weights coincide to a value in S, the knapsack capacity is v, and the aim is to find the set of packable items with maximum profit. (2) The multiple subset sum (mss) problem is a variant of well-known bin packing in which a number of identical bins is given and one would like to maximize the overall weight of the items packed in the bins such that the sum of the item weights in every bin does not exceed the bin capacity. The problem is also a special case of the Multiple knapsack problem in which all knapsacks have the same capacities and the item profits and weights coincide. Caprara et al. [4] proved that mss admits a PT AS, but does not admit a F PT AS even for only two knapsacks. They also proposed a 43 −approximation algorithm in [5]. (3) multiple subset sum with different knapsack capacities (mssdc) [3] is an extension of mss considering different bin capacities. mssdc also admits a PT AS [3]. (4) As a generalization of mssdc, multiple knapsack assignment restriction (mkar) problem consists to pack weighted items into nonidentical capacity-constrained bins, with the additional constraint that each item can be packed in some bins only. Each item as a profit, the objective here is to maximize the sum of profits of packed items. Considering that the profit of each item equals its weight, [6] proposed a 12 approximation. We also use a well-known result concerning a variant of the N P-complete problem 3SAT [8], denoted subsequently by one-in-(2,3)sat(2,1̄): An instance of one-in-(2,3)sat(2,1̄) is described by the following elements: we use V to denote the set of n variables. Let n be a multiple of 3 and let C be a set of clauses of cardinality 2 or 3. There are n clauses of cardinality 2 and n/3 clauses of cardinality 3 such that: • Each clause of cardinality 2 is equal to (x ∨ ȳ) for some x, y ∈ V with x 6= y. • Each of the n literals x (resp. of the n literals x̄) for x ∈ V belongs to one of the n clauses of cardinality 2, thus to only one of them. • Each of the n (positive) literals x belongs to one of the n/3 clauses of cardinality 3, thus to only one of them. 6 TITLE WILL BE SET BY THE PUBLISHER • Whenever (x ∨ ȳ) is a clause of cardinality 2 for some x, y ∈ V, then x and y belong to different clauses of cardinality 3. The aim of one-in-(2,3)sat(2,1̄) is to find if there exists a truth assignment I : V → {0, 1}, 0 for false and 1 for true, whereby each clause in C has exactly one true literal. one-in-(2,3)sat(2,1̄) has been proven N P-complete in [9]. As an example, the following logic formula is the smallest valid instance of onein-(2,3)sat(2,1̄): (x0 ∨ x1 ∨ x2 ) ∧ (x3 ∨ x4 ∨ x5 ) ∧ (x̄0 ∨ x3 ) ∧ (x̄3 ∨ x0 ) ∧ (x̄4 ∨ x2 ) ∧ (x̄1 ∨ x4 ) ∧ (x̄5 ∨ x1 ) ∧ (x̄2 ∨ x5 ). The answer to one-in-(2,3)sat(2,1̄) is yes. It is sufficient to choose x0 = 1, x3 = 1 and xi = 0 for i = {1, 2, 4, 5}. This yields a truth assignment that satisfies the formula, and there is exactly one true literal for each clause. 2. Computational complexity for some classes of compatibility graphs In this section, we present two preliminary results of complexity for the problem that consists in scheduling a set of stretched-coupled tasks with compatibility constraints. In such a context, we will consider the topologies of chain and star. First we show that the problem is solvable within a O(n3 ) time complexity algorithm when G is a chain (Theorem 1). Then we prove that it is N P-hard even when the compatibility graph is a star (Theorem 3), 2.1. Chain graph Despite of the simplicity of a chain topology, solving the scheduling problem on a chain is not as simple as it appears : a main issue arise when two adjacent vertices x and y have the same stretch factor. In this configuration, we cannot determine locally if x and y can be packed together in an optimal solution or not (this requires to examine the neighbourhood of x and y, and this problematic configuration can be repeated all along the chain). However, we show that the scheduling problem with a chain is polynomial using a similar method as developed in [18]. Theorem 1. The problem 1|α(ti ), G = chain|Cmax admits a polynomial-time algorithm. Proof This problem can be solved in polynomial-time by a reduction to the search for a minimum weighted perfect matching. This problem can be polynomially solved in O(n3 ) time complexity [7]. First, note that if for a task x with two neighbors y and z, we have 3(α(y) + α(z)) ≤ α(x), the idle duration of x is high enough to schedule both y and z. Thus one can schedule y and z into x without decreasing the cost of any optimal solution, and remove tasks x, y and z from the studied graph. Thus, in the rest of the proof, one P can restrict our study to chains G = (V, E) such that for any x ∈ V , we have 3 y∈NG (x) α(y) > α(x). TITLE WILL BE SET BY THE PUBLISHER 7 In order to obtain a graph with an even number of vertices and to find a perfect matching, we construct a graph H = (VH , EH , w) and we define a weighted function w : E → IN as follows: (1) Let I1 be an instance of our problem with a compatibility graph G = (V, E), and I2 an instance of the minimum weight perfect matching problem in graph constructed from I1 . We consider a graph H, consisting of two copies of G denoted by G′ = (V ′ , E ′ ) and G′′ = (V ′′ , E ′′ ). The vertex corresponding to x ∈ V is denoted by x′ in G′ and x′′ in G′′ . Moreover, ∀i = 1, . . . , n, an edge {x′ , x′′ } in EH is added and we state w({x′ , x′′ }) = 3 × α(x)′ . This weight represents the sequential time of the x′ -task. We have H = G′ ∪ G′′ = (V ′ ∪ V ′′ , E ′ ∪ E ′′ ), with |V ′ ∪ V ′′ | of even size. (2) For two compatible tasks x′ and y ′ with 3 × αx′ ≤ αy′ or 3 × αy′ ≤ αx′ , we add the edges {x′ , y ′ } and {x′′ , y ′′ } in EH and we state w({x′ , y ′ }) = 3×max{αx′ ,αy ′ } . w({x′′ , y ′′ }) = 2 (3) For two compatible tasks x′ and y ′ with αx′ = αy′ , we add the edges {x′ , y ′ } x′ and {x′′ , y ′′ } in EH , and we state w({x′ , y ′ }) = w({x′′ , y ′′ }) = 4×α . 2 Figure 1 shows an example of construction of H when G is a chain with 3 vertices. α1 = 2 3×8 2 A1 A2 α2 = 8 A3 α3 = 8 3×2 3×8 G′ x′2 4×8 2 x′3 3×8 2 x′′ 1 x′1 3×8 x′′ 2 x′′ 3 G′′ 4×8 2 G H Figure 1. Example of the transformation One can show that there is a (weighted) perfect matching on H, which cover all the vertices of H. In fact the construction implies that for any perfect matching W of cost C on H, one can provide a valid schedule of processing time C for the scheduling problem : an edge e ∈ W with e = x′ , x′′ , x′ ∈ G′ ∧ x′′ ∈ G′′ implies that task x is scheduled alone, while an edge e ∈ W with e = x′ , y ′ , x′ , y ′ ∈ G′ implies that tasks x and y are packed together in the resulting schedule - and the edge e = x′′ , y ′′ , x′′ , y ′′ ∈ G′′ belong also to the matching -. For a minimum weight perfect matching C, we can associate a schedule of minimum processing time equal to C and vice versa. The detailed proof of the relationship between a solution to our problem with G and a solution of a minimum weight perfect matching in H is presented in [18]. 8 TITLE WILL BE SET BY THE PUBLISHER In the review of the literature, the Edmonds algorithm determines a minimum weight perfect matching in O(n3 ) [7]. So the optimization problem with G is polynomial, and if one adds the execution of the blocks created by removed vertices, this leads to the polynomiality of the problem 1|α(ti ), G = chain|Cmax .  2.2. Star graph We focus on the case with a star graph, i.e. a graph with a central node β. In such a context, we show that the complexity depends on the number of outgoing arcs from β. The following results also imply that the studied problem can be N Phard even on acyclic low-diameter graphs, when the degree of G is unbounded. Theorem 2. The problem 1|α(ti ), G = star|Cmax is polynomial if the central node admits at least one outcoming arc. Proof Let S be the set of satellite nodes. According to the Remark 2, seq(S) is a lower bound for the cost of an optimal solution. This bound is achieved if we can execute the central node in a satellite node.  Theorem 3. The problem 1|α(ti ), G = star|Cmax is N P-hard if the central node admits only incoming arcs. Proof We propose a reduction from the subset sum (ss) problem (see Section 1.2). From an instance of ss composed by a set S of n positive values and v ∈ IN (with v ≥ x, ∀x ∈ S), we construct an instance of 1|α(ti ), G = star|Cmax = P α(t) + 2α(β) in the following way: t∈V (1) For each value i ∈ S we introduce a coupled-task t with α(t) = i. Let V be the set of these tasks. (2) We add a task β with α(β) = aβ = lβ = bβ = 3 × v. (3) We define a compatibility constraint between each task t ∈ V and β. Clearly the compatibility graph G is a star with β as the central node, and the transformation is computed in polynomial time. We will prove that there exists a positive solution for the subset sum (ss) problem P iff there exists a feasible solution for the scheduling problem with a length t∈V α(t) + 2α(β). P It is easy to see that 1|α(ti ), G = star|Cmax = t∈V α(t) + 2α(β) ∈ N P. Let W be the set of the nodes executed in the central node for a scheduling. The cost of this scheduling in clearly seq(T ) − seq(W ). Therefore, the problem of finding a scheduling of cost seq(T ) − α(β) is clearly equivalent to an instance of the subset sum with v = α(β) and S the set of the processing time of the satellite tasks. This concludes the Proof of Theorem 3.  TITLE WILL BE SET BY THE PUBLISHER 9 3. On the boundary between polynomial-time algorithm and N P-Completeness on 1-stage bipartite graphs Preliminary results of Section 2 show that the problem is N P−hard on acyclic low-diameter instances when the degree is unbounded. They suggest that the complexity of the problem may be linked to the maximum degree of the graph. This section is devoted to the N P−completeness of several scheduling problems in presence of a 1-stage bipartite compatibility graph, according to the maximum degree of vertices and some structural parameters like the number of different values of coupled-tasks. We will sharp the line of demarcation between the polynomially solvable cases and the N P-hardness ones according to several topologies. We focus our analysis when G is a 1-stage bipartite graph. We prove that the problem is solvable within a O(n3 ) polynomial algorithm if ∆G = 2 (Theorem 4), but becomes N P-hard when ∆G = 3 (Theorem 5). We start by designing a polynomial-time algorithm for the scheduling problem in which the maximum degree of incoming arcs on Y -tasks is at most two. Theorem 4. The problem of deciding whether an instance of 1|α(ti ), G = 1 − stagebipartite, dG(Y ) ≤ 2|Cmax is polynomial. In fact, the previous result may be extended to a graph G (not necessarily bipartite) such that ∀x, d− (X) ≤ 2 with 3(α(x1 ) + α(x2 )) > α(x), where x1 and x2 are the 2 neighbors of x. Proof Let G = (X ∪ Y, E) be a 1-stage bipartite compatibility graph (arcs oriented from X to Y only, implying that only X-tasks can be executed in the idle time of and Y -task). Y -tasks will always be scheduled sequentially as Y is an independent set of G (cf. Remark 2). The aim is to fill their idle time with a maximum of X-tasks, while the remained tasks will be executed after the Y -tasks. We just have to minimize the length of the remained tasks. It is easy to see that all Y -tasks with incoming degree equal to one are executed sequentially with their only X-task in their idle time. The following algorithm is focused on the case ∆G = 2. It is defined in two steps: (1) For each task y ∈ Y such that 3 × α(x1 ) + 3 × α(x2 ) ≤ α(y) where x1 and x2 are the only two neighbors of Y , we add y to the schedule and execute x1 and x2 sequentially during the idle time of y. Then we remove y, x1 and x2 from the instance. (2) Each remaining task y ∈ Y admits at most two incoming arcs (x1 , y) and/or (x2 , y). We add a weight α(x) to the arc (x, y) for each x ∈ NG (y), then we perform a maximum weight matching on G in order to minimize the length of the remained tasks of X. Thus, the matched coupled-tasks are executed, and these tasks are removed from G. (3) Then, remaining tasks are processed sequentially after the other tasks. The complexity of this algorithm is O(n3 ) using the Hungarian method [13]. For the extension, it is sufficient to use a maximum weight perfect matching [7].  10 TITLE WILL BE SET BY THE PUBLISHER Theorem 5. The problem of deciding whether an instance of 1|α(ti ), G = 1 − stage bipartite, dG (X) = 2, dG (Y ) ∈ {2, 3}|Cmax has a schedule of length at most 54n is N P-complete where n is the number of tasks. Proof It is easy to see that our problem is in N P. Our proof is based on a reduction from one-in-(2,3)sat(2,1̄): given a set V of n boolean variables with n mod 3 ≡ 0, a set of n clauses of cardinality two and n/3 clauses of cardinality three, we construct an instance π of the problem 1|α(ti ), G = 1−stage bipartite, dG (X) = 2, dG (Y ) ∈ {2, 3}|Cmax = 54n in following way: (1) For all x ∈ V, we introduce four variable-tasks: x, x′ , x̄ and x̄′ with (ai , li , bi ) = (1, 1, 1), ∀i ∈ {x, x′ , x̄, x̄′ }. This variable-tasks set is noted VT . (2) For all x ∈ V, we introduce three literal-tasks Lx , C x and C̄ x with Lx = (2, 2, 2); C x = C̄ x = (6, 6, 6). The set of literal-tasks is denoted LT . (3) For all clauses with a length of three, we introduce two clause-tasks C i and C̄ i with C i = (3, 3, 3) and C̄ i = (6, 6, 6). (4) For all clauses with a length of two, we introduce one clause-task C i with C i = (3, 3, 3). The set of clause-tasks is denoted CT . (5) The following arcs model the compatibility constraint: (a) For all boolean variables x ∈ V, we add the arcs (Lx , C x ) and (Lx , C̄ x ) (b) For all clauses with a length of three denoted Ci = (y ∨ z ∨ t), we add the arcs (y, C i ), (z, C i ), (t, C i ) and (ȳ ′ , C̄ i ), (z̄ ′ , C̄ i ), (t̄′ , C̄ i ). (c) For all clauses with a length of two denoted Ci = (x ∨ ȳ), we add the arcs (x′ , C i ) and (ȳ, C i ). (d) Finally, we add the arcs (x, C x ), (x′ , C x ) and (x̄, C̄ x ), (x̄′ , C̄ x ). This transformation can be clearly computed in polynomial time and an illustration is depicted in Figure 2. The proposed compatibility graph is a 1-stage bipartite and dG (x) ≤ 3, ∀x ∈ VT ∪ LT ∪ CT . In follows, we say that a task x is merged to a task y, if there exists a compatibility constraint from x to y; i.e. the coupled-task x may be executed during the idle time of coupled-task y. • Let us first assume that there is a schedule with length of 54n at most. We prove that there is a truth assignment I : V → {0, 1} such that each clause in C has exactly one true literal (i.e. one literal equal to 1). We make several essential remarks: (1) The length of the schedule is given by an execution time of the coupled-tasks admitting only incoming arcs, and the value is 54n = 3αCT |CT | + αLT (|LT | − |{Lx , x ∈ V}|) = 9|{C i ∈ CT of length 2 and n 3}| + 18|{C̄ i ∈ CT }| + 18|{C x and C̄ x ∈ LT }| = 9 × 4n 3 + 18 × 3 + 18 × 2n. Thus, all tasks from VT ∪ {Lx , x ∈ V} must be merged with tasks from CT ∪ (LT − {Lx , x ∈ V}). (2) By the construction, at most three tasks can be merged together. (3) Lx is merged with C x or C̄ x . TITLE WILL BE SET BY THE PUBLISHER 11 Lx = (2, 2, 2); C x = C̄ x = (6, 6, 6), x ∈ V Lx Case a) C̄ x Cx x′ x x̄′ x̄ (x, y, z) C (x,y,z) = (3, 3, 3) C (x,y,z) = (6, 6, 6) C y (x, y, z) z C′ x is true and x̄ is false ȳ ′ z̄ ′ ′ C C = C C = (3, 3, 3) C 6= C ′ two clause-tasks of length two Lx (ai , li , bi ), = (1, 1, 1), ∀i ∈ {x, x′ , x̄, x̄′ }, ∀x ∈ V Case b) Cx C̄ x x′ x (x, y, z) x̄ x̄′ C C′ (x, y, z) y z ȳ ′ z̄ ′ x is false and x̄ is true C 6= C ′ two clause-tasks of length two Figure 2. A partial compatibility graph for the N P-completeness of the scheduling problem 1|α(ti ), G =1−stage bipartite, dG (X) = 2, dG (Y ) ∈ 12 TITLE WILL BE SET BY THE PUBLISHER (4) The allocation of coupled-tasks from CT ∪ (LT − {Lx , x ∈ V}) leads to 18n idle time. The length of the variable-tasks VT and Lx equals 18n (in these coupled-tasks there are 6n idle times). (5) If the variable-tasks x and x′ are not merged simultaneously with C x , i.e. only one of these tasks is merged with C x , then by with the previous discussion, it is necessary to merge a literal-task Ly , with x 6= y one variable-task (ȳ or ȳ ′ ) with C y or C̄ y . It is impossible by size of coupled-tasks. In the same way, the variable-tasks x̄ et x̄′ are merged simultaneously with C̄ x if they have to be into it. (6) Hence, first x and x′ are merged with C x or with a clause-task where the variable x occurs. Second, x̄ and x̄′ are merged with C̄ x or a clause-task. So, we affect the value ”true” to the variable l iff the variable-task l is merged with clause-task(s) corresponding to the clause where the variable l occurs. It is obvious to see that in the clause of length three and two we have one and only one literal equal to ”true”. • Conversely, we suppose that there is a truth assignment I : V → {0, 1}, such that each clause in C has exactly one true literal. – If the variable x = true then we merged the vertices Lx with C x ; x with the clause-task C i corresponding to the clause of length three which x occurs; x′ with the clause-task C i corresponding to the clause of length two which x occurs; and x̄, x̄′ with C̄ x . – If the variable x = f alse then we merged the vertices Lx with C̄ x ; x̄ with the clause-task corresponding to the clause of length two which x̄ occurs; x̄′ with the clause-task C̄ i corresponding to the clause (C) of length three which x occurs; and x, x′ with C x . The merged-tasks are given in Figure 2. For a feasible schedule, it is sufficient to merge vertices which are in the same partition. Thus, the length of the schedule is at most 54n.  Theorem 6. The problem of deciding whether an instance of 1|α(ti ), G = 1 − stage bipartite, dG (X) ∈ {1, 2}, dG(Y ) ∈ {3, 4}|Cmax has a schedule of length at most 54n is N P-complete, where n is the number of tasks. Proof We use a similar proof as given for the Theorem 5. It is sufficient to add for each clause C with a length of two (resp. C ′ of length three) a dummy ′ ′ coupled-task DC (resp. DC ) with DC = (1, 1, 1) = DC , and the value of the ′ ′ clause-task C (resp. C ) is now C = C = (6, 6, 6). In other words, we add these two compatibility constraints: • DC → C, for each clause C of length two, ′ • DC → C ′ , for each clause C ′ of length three. There is a schedule with length of 54n at most iff there exists a truth assignment I : V → {0, 1} such that each clause in C has exactly one true literal (i.e. one literal equal to 1).  TITLE WILL BE SET BY THE PUBLISHER 13 Corollary 1. The problem of deciding whether an instance of 1|α(ti ) 6= α(tj ), ∀i 6= j, ∆G = 3, G = 1 − stage bipartite|Cmax has a schedule of length at most 54n is N P-complete, where n is the number of tasks. Proof The proof of Theorem 5 can be adapted by using the classical scaling arguments assigning α(x) + ǫ to each task.  4. Polynomial-time approximation algorithms This section is devoted to design some efficient polynomial-time approximation algorithms for several topologies and mainly for bipartite graphs. In [17], authors proposed a simple algorithm, which consists in scheduling all the tasks consecutively, with a performance ratio bounded by 3/2 for a general compatibility graph. The challenge for the remaining section, is to propose some efficient algorithms with a ratio strictly lower than 3/2. We propose a F PT AS for the star graph whereas some APX -algorithms are developed in the remaining section according to the characteristics of the 1-stage bipartite graph. At last, we extend the result is extended to the 2-stage bipartite graph. 4.1. Star graph Theorem 7. The problem 1|α(ti ), G = star|Cmax admits a F PT AS. Proof The central node admits only incoming arcs (the case of the central node admits at least one outcoming arc is given by Corollary 2). Therefore, we may use the solution given by the subset sum (ss) (see [11] and [12]). Indeed, based on the reduction used in the proof of Theorem 3 and the optimization version of ss: the aim is to find W ∗ (an optimal set of tasks executed during the idle time of the central node) which maximizes seq(W ∗ ) such that seq(W ∗ ) ≤ α(β). seq(W ) Let us suppose that seq(W ∗ ) ≥ 1 − ǫ, where W designates the value of the approximation solution for subset sum. Note that α(β) ≥ seq(W ∗ ) and seq(T ) ≥ 3α(β) lead to seq(T ) ≥ 3seq(W ∗ ). seq(T ) − seq(W ) seq(T ) − seq(W ∗ ) = ≤ ≤ seq(W ∗ ) − seq(W ) seq(T ) − seq(W ∗ ) seq(W ∗ ) − seq(W ) 1+ 2seq(W ∗ ) 1+ 1+ 1− seq(W ) seq(W ∗ ) 2 ≤1+ 1 − (1 − ǫ) = 1 + ǫ/2 2 Therefore the existence of a F PT AS for the subset sum involves a F PT AS for our scheduling problem.  14 TITLE WILL BE SET BY THE PUBLISHER 4.2. 1−stage bipartite graph Scheduling coupled-tasks during the idle time of others can be related to packing problems, especially when the compatibility graph G is a bipartite graph. In the following, we propose several approximations when G is a 1−stage bipartite graph. Lemma 1. Let Π be a problem with Π ∈ {mkar, mssdc, mss} such that Π admits a ρ-approximation, then the following problems (1) 1|α(ti ), G = 1 − stage bipartite|Cmax , (2) 1|α(ti ), G = complete 1 − stage bipartite|Cmax , (3) 1|α(ti ), G = complete 1 − stage bipartite|Cmax , where G = (X ∪ Y, E) and all the tasks from Y have the same stretch factor α(Y ), posses a ρ′ -approximables within a factor ρ′ = 1 + (1−ρ) using an approximability 3 reduction from mkar, mssdc and mss respectively. Proof (1) Consider now an instance of 1|α(ti ), G = 1 − stage bipartite|Cmax with a graph G = (X ∪ Y, E) (for any arc e = (x, y) ∈ E, we have x ∈ X and y ∈ Y ) and a stretch factor function α : X ∪ Y → IN. In such an instance, any valid schedule consists in finding for each task y ∈ Y a subset of compatible tasks Xy ⊆ X to pack into y ∈ Y , each task of x being packed at most once. Let Xp = ∪y∈Y Xy be the union of X-tasks packed into a task from Y . Let Xp̄ the set of remaining tasks, with Xp̄ = X \ Xp . Obviously, we have: seq(Xp ) + seq(Xp̄ ) = seq(X) (1) As Y is an independent set in G, Y -tasks have to be scheduled sequentially in any (optimal) solution. The length of any schedule S is then the time required to execute entirely the Y -tasks plus the one required to schedule sequentially the tasks from Xp̄ . Formally: Cmax (S) = seq(Y ) + seq(Xp̄ ) (2) From Equations (1) and (2) we have: Cmax (S) = seq(Y ) + seq(X) − seq(Xp ). (3) We use here a transformation into a mkar problem: each task x from X is an item having a weight 3α(x), each task y from Y is a bin with a capacity α(y), and each item x can be packed into y if and only if the edge (x, y) belongs to the bipartite graph. Using algorithms and results from the literature, one can obtain an assignment of some items into bins. We denote by Xp the set of these packed items. The cost of the solution for the mkar problem is seq(Xp ). TITLE WILL BE SET BY THE PUBLISHER 15 If mkar is approximable to a factor ρ, then we have: seq(Xp ) ≥ ρ × seq(Xp∗ ), (4) where Xp∗ is the set of packable items with the maximum profit. Combining Equations (3) and (4), we obtain a solution for 1|α(ti ), G = 1 − stage bipartite|Cmax with a length: Cmax (S) ≤ seq(Y ) + seq(X) − ρ × seq(Xp∗ ) (5) As X and Y are two fixed sets, an optimal solution S ∗ with minimal length Cmax (S ∗ ) is obtained when seq(Xp ) is maximum, i.e. when Xp = Xp∗ . The length of any optimal solution is equal to: Cmax (S ∗ ) = seq(Y ) + seq(X) − seq(Xp∗ ) (6) Using Equations (5) and (6), the ratio obtained between our solution S and the optimal one S ∗ is: seq(Y ) + seq(X) − ρ × seq(Xp∗ ) (1 − ρ) × seq(Xp∗ ) Cmax (S) ≤ ≤ 1 + Cmax (S ∗ ) seq(Y ) + seq(X) − seq(Xp∗ ) seq(Y ) + seq(X) − seq(Xp∗ ) (7) By definition, Xp∗ ⊆ X. Moreover, as the processing time of Xp∗ cannot excess the idle time of tasks from Y , we obtain: seq(Xp∗ ) ≤ 1 seq(Y ) 3 (8) Combined to Equation (7), we obtain the desired upper bound: ρ′ = Cmax (S) (1 − ρ) ≤1+ . Cmax (S ∗ ) 3 (9) (2) For the problem 1|α(ti ), G = complete 1−stage bipartite|Cmax , the proof is similar to the previous one. We remind that mssdc is a special case of mkar in which each item can be packed in any bin. (3) For the problem 1|α(ti ), G = complete 1 − stage bipartite|Cmax where G = (X ∪ Y, E) and all the Y -tasks have the same stretch factor α(Y ), the proof is similar to the previous one since mssdc is a generalization of mss.  Theorem 8. The following problems admit a polynomial-time approximation algorithm: 16 TITLE WILL BE SET BY THE PUBLISHER (1) The problem 1|α(ti ), G = 1 − stage bipartite|Cmax is approximable to a factor 76 . (2) The problem 1|α(ti ), G = complete 1 − stage bipartite|Cmax admits a PT AS. (3) The problem 1|α(ti ), G = complete 1 − stage bipartite|Cmax where G = (X ∪ Y, E) and all the Y -tasks have the same stretch factor α(Y ): (a) is approximable to a factor 13 12 . (b) admits a PT AS. Proof (1) Authors from [6] proposed a ρ = 12 −approximation algorithm for mkar. Reusing this result with Lemma 1, we obtain a 67 −approximation for 1|α(ti ), G = 1 − stage bipartite|Cmax . (2) We know that mssdc admits a PT AS [3], i.e. ρ = 1 − ǫ. Using this algorithm to compute such a PT AS, with Lemma 1 we obtain an approximation ratio of 1 + 3ǫ for this problem. (3) In this case we have two different results: (a) Authors from [5] proposed a ρ = 34 −approximation algorithm for mss. 13 Reusing this result with Lemma 1, we obtain a 12 −approximation for 1|α(ti ), G = complete bipartite|Cmax . (b) They also proved that mss admits a PT AS [4] , i.e. ρ = 1 − ǫ. Using the algorithm to compute such a PT AS, with Lemma 1 we obtain an approximation ratio of 1 + 3ǫ for 1|α(ti ), G = complete 1 − stage bipartite|Cmax when Y -tasks have the same stretch factor.  4.3. 2−stage bipartite graph In the following, we extend the previous result for 2-stage bipartite graphs. Theorem 9. The problem 1|α(ti ), G = 2 − stage bipartite|Cmax is approximable to a factor 13 9 . Proof The main idea of the algorithm is divided into three steps: (1) First we compute a part of the solution with a 76 -approximation on G0 thanks to Theorem 8, where G0 = G[V0 ∪ V1 ] is the 1st stage of G. (2) Then we compute a second part of the solution with a 67 -approximation on G1 thanks to Theorem 8, where G1 = G[V1 ∪V2 ] is the 2nd stage of G. (3) To finish we merge these two parts and we resolve potential conflicts between them, i.e. by giving a preference to tasks packed in G1 . Computing the cost of this solution gives us an approximation ratio of 13 9 . Reusing the notation introduced for k-stage bipartite graphs (see Section 1.1), we consider an instance of 1|α(ti ), G = 2 − stage bipartite|Cmax with G = (V0 ∪ V1 ∪ V2 , E1 ∪ E2 ), where each arc in Ei has its extremities in Vi−1 and Vi , for i ∈ {1, 2}. TITLE WILL BE SET BY THE PUBLISHER 17 ∀i = {0, 1} we denote1 by Vi p (resp. Vi a ) the set of tasks merged (resp. remaining) in any task from y ∈ Vi+1 in a solution S. Moreover, ∀i = {1, 2} let Vib be the set of tasks scheduled with some tasks from Vi−1 merged into it. This notation is extended to an optimal solution S ∗ by adding a star in the involved variables. Considering the specificities of the instance, in any (optimal) solution we propose some essential remarks: (1) Tasks from V0 are source nodes in G, and they can be either scheduled alone, or merged only into some tasks from V1 only. Given any solution S to the problem on G, {V0 p , V0 a } is a partition of V0 . (2) Tasks from V1 can be either scheduled alone, merged into some tasks from V2 , or scheduled with some tasks from V0 merged into it. Given any solution S to the problem on G, {V1 p , V1 a , V1 b } is a partition of V1 . (3) Tasks from V2 form an independent set in G, and have to be scheduled sequentially in any schedule (cf. Remark 2), either alone or with some tasks from V1 merged into it. Given any solution S to the problem on G, {V2a , V2b } is a partition of V2 . Any solution would consist first to schedule each task with at least one task merged into it, then to schedule the remaining tasks (alone) consecutively. Given an optimal solution S ∗ , the length of S ∗ is given by the following equation: S ∗ = seq(V1 ∗b ) + seq(V2b ) + seq(V0 ∗a ) + seq(V1 ∗a ) + seq(V2 ∗a ) (10) or, more simply S ∗ = seq(V2 ) + seq(V1 ∗b ) + seq(V0 ∗a ) + seq(V1 ∗a ) (11) Note that V0 ∗p and V1 ∗p are not part of the equation, as they are scheduled during the idle time of V1 ∗b and V2 ∗b . The main idea of the algorithm is divided into three steps: (1) First we compute a part of the solution with a 67 -approximation on G0 thanks to Theorem 8, where G0 = G[V0 ∪ V1 ] is the 1st stage of G. (2) Then we compute a second part of the solution with a 67 -approximation on G1 thanks to Theorem 8, where G1 = G[V1 ∪V2 ] is the 2nd stage of G. (3) To finish we merge these two parts and we solve potential conflicts between them. Let consider an instance restricted to the graph G0 . Note that G0 is a 1-stage bipartite graph. Let S ∗ [G0 ] be an optimal solution on G0 . Let us denote by V0 ∗p [G0 ] the set of tasks from V0 packed into tasks from V1 in S ∗ [G0 ], and by V0 ∗a [G0 ] the set of remaining tasks. Obviously, we have: S ∗ [G0 ] = seq(V1 ) + V0 ∗a [G0 ] 1Notations: p for packed, a for alone, and b for box (12) 18 TITLE WILL BE SET BY THE PUBLISHER Given any solution S[G0 ], let V1 b [G0 ] be the set of tasks from V1 with at least one task from V0 merged into them, and V1a [G0 ] be the remaining tasks. Let us denote by V0 p [G0 ] the set of tasks from V0 merged into V1 , and by V0 a [G0 ] the set of remaining tasks. Using Theorem 8, Lemma 1, and the demonstration presented in the proof from [6], we compute a solution S[G0 ] such that: seq(V0 p [G0 ]) ≥ 1 seq(V0 ∗p [G0 ]) 2 (13) Note that we have: seq(V0p [G0 ]) + seq(V0a [G0 ]) = seq(V0 ∗p [G0 ]) + seq(V0 ∗a [G0 ]) = seq(V0 ) (14) Combining Equations (13) and (14), we obtain: 1 1 seq(V0 a [G0 ]) ≤ seq(V0 ∗a [G0 ]) + seq(V0 ∗p [G0 ]) ≤ seq(V0 ∗a ) + seq(V0 ∗p [G0 ]) (15) 2 2 as we know by definition that seq(V0 ∗a [G1 ]) ≤ seq(V0 ∗a ). We use a similar reasoning on an instance restricted to the graph G1 . Let S ∗ [G1 ] be an optimal solution on G1 . Let us denote by V1 ∗p [G1 ] the set of tasks from V1 packed into tasks from V2 in S ∗ [G1 ], and by V1 ∗a [G1 ] the set of remaining tasks. Given any solution S[G1 ], let V2 b [G1 ] be the set of tasks from V2 with at least one task from V1 merged into them, and V1a [G1 ] be the remaining tasks. One can compute a solution S[G1 ] based on a set of tasks V1 p [G1 ] packed in V2 such that: 1 seq(V1p [G1 ]) ≥ seq(V1 ∗p [G1 ]) (16) 2 and seq(V1 a [G1 ]) ≤ seq(V1 ∗a [G1 ]) + 1/2seq(V1 ∗p [G1 ]) ≤ seq(V1 ∗a ) + 1/2seq(V1 ∗p [G1 ]) (17) as we know by definition that seq(V1 ∗a [G1 ]) ≤ seq(V1 ∗a ). We design the feasible solution S for G as follows: • First we compute a solution S[G1 ] on G1 , then we add to S each task from V2 and the tasks from V1 merged into them (i.e. V1p [G1 ]) in S[G1 ]. • Second we compute a solution S[G0 ] on G0 , then we add to S each task v from V1b [G0 ] \ V1p [G1 ] and the tasks from V0 merged into them. • Third the tasks V1a [G1 ]\V1b [G0 ] and V0a [G0 ] are added to S and scheduled sequentially. • At last we denote by Vconf lict the set of remaining tasks, i.e. the set of tasks from V0 which are merged into a task v ∈ V1 in S[G0 ], thus that v is merged into a task from V2 in S[G1 ]. Observe that: seq(V1 b [G0 ] \ V1 p [G1 ]) + seq(V1 a [G1 ] \ V1 b [G0 ]) = V1 a [G1 ]) (18) TITLE WILL BE SET BY THE PUBLISHER 19 Thus the cost of our solution S is: S = seq(V2 ) + seq(V1a [G1 ]) + seq(V0a [G0 ]) + seq(Vconf lict ) (19) It is also clear that: seq(Vconf lict ) ≤ 1 1 seq(V1 p [G1 ]) ≤ seq(V1 ∗p [G1 ]) 3 3 (20) Using Equations (15), (17) and (20) in Equation (19), we obtain: 1 5 S ≤ seq(V2 ) + seq(V1 ∗a ) + seq(V1 ∗p [G1 ]) + seq(V0 ∗a ) + seq(V0 ∗p [G0 ]) 6 2 (21) Using Equations (11) and (21), we obtain: 1 5 S ≤ S ∗ + seq(V1 ∗p [G1 ]) + seq(V0 ∗p [G0 ]) 6 2 (22) We know that S ∗ ≥ seq(V2 ), and that tasks from V1 ∗p [G1 ] must be merged into tasks from V2 and cannot exceed the idle time of V2 , implying that seq(V1 ∗p [G1 ])) ≤ 1 3 seq(V2 ). We can write the following: ∗ 5 6 seq(V1 p [G1 ]) S∗ ≤ 5 6 × 31 seq(V2 ) 5 ≤ seq(V2 ) 18 (23) We know that tasks from V0 ∗p [G0 ] must be merged into tasks from V1 and cannot exceed the idle time of V1 , implying that seq(V0 ∗p [G0 ]) ≤ 31 seq(V1 ). We also know that S ∗ ≥ seq(V1 ), as V1 is an independent set of G. One can write the following: ∗ 1 2 seq(V0 p [G0 ]) S∗ ≤ 1 2 × 31 seq(V1 ) 1 ≤ seq(V1 ) 6 (24) Finally, with Equations (22), (23) and (24) we conclude the proof: S 5 1 13 ≤1+ + = S∗ 18 6 9 (25)  5. Conclusion In this paper, we investigate a particular coupled-tasks scheduling problem 1|ai = li = bi , G|Cmax in presence of a compatibility graph with regard to the complexity and approximation. We also establish the N P-completeness for the specific case where there is a bipartite compatibility graph. In such context, we 20 TITLE WILL BE SET BY THE PUBLISHER propose a 67 -approximation algorithm and the bound is tight. We extend the result to the 2-stage bipartite by designing a 13/9-approximation. A further interesting question concerns the study of the complexity on tree graphs with bounded degree. As we known, no complexity result exists. Another perspective consists in extending the presented results to k-stage bipartite graphs. References [1] D. Ahr, J. Békési, G. Galambos, M. Oswald, and G. Reinelt. An exact algorithm for scheduling identical coupled-tasks. Mathematical Methods of Operations Research, 59:193–203(11), June 2004. [2] J. Blażewicz, K. Ecker, T. Kis, C.N. Potts, M. Tanas, and J. Whitehead. Scheduling of coupled tasks with unit processing times. Technical report, Poznan University of Technology, 2009. [3] A. Caprara, H. Kellerer, and U. Pferschy. A PTAS for the Multiple Subset Sum Problem with different knapsack capacities. Inf. Process. Lett, 2000. [4] A. Caprara, H. Kellerer, and U. Pferschy. The Multiple Subset Sum Problem. Siam Journal on Optimization, 11(2):308–319, 2000. [5] A. Caprara, H. Kellerer, and U. Pferschy. A 3/4-Approximation Algorithm for Multiple Subset Sum. J. Heuristics, 9(2):99–111, 2003. [6] M. Dawande, J. Kalagnanam, P. Keskinocak, F.S. Salman, and R. Ravi. Approximation Algorithms for the Multiple Knapsack Problem with Assignment Restrictions. Journal of Combinatorial Optimization, 4(2):171–186, 2000. [7] J. Edmonds. Maximum matching and a polyhedron with 0, 1 vertices. Journal of Research the National Bureau of Standards, 69 B:125–130, 1965. [8] M. R. Garey and D. S. Johnson. Computers and Intractability: A guide to the theory of NP-completeness. W. H. Freeman & Co., New York, NY, USA, 1979. [9] R. Giroudeau, J.-C. König, F.K. Moulaı̈, and J. Palaysi. Complexity and approximation for the precedence constrained scheduling problem with large communication delays. Theoretical Computer Science, 401(1–3):107—-119, 2008. [10] R. L. Graham, E. L. Lawler, J. K. Lenstra, and A. H. G. Rinnooy Kan. Optimization and Approximation in Deterministic Sequencing and Scheduling: a Survey. Annals of Discrete Mathematics, 5:287–326, 1979. [11] O.H. Ibarra and C.E. Kim. Fast approximation algorithms for the Knapsack and Sum of Subset problems. Journal of ACM, 22(4):463–468, 1975. [12] H. Kellerer, R. Mansini, U. Pferschy, and M.G. Speranza. An efficient fully polynomial approximation scheme for the subset-sum problem. Journal of Computer and System Sciences, 66(2):349–370, 2003. [13] H.W. Kuhn. The hungarian method for the assignment problem. Naval Research Logistics Quarterly, 2:83–97, 1955. [14] A.J. Orman and C.N. Potts. On the complexity of coupled-task scheduling. Discrete Applied Mathematics, 72:141–154, 1997. [15] R. D. Shapiro. Scheduling coupled tasks. Naval Research Logistics Quarterly, 27:477–481, 1980. [16] G. Simonin, B. Darties, R. Giroudeau, and J.-C. König. Isomorphic coupled-task scheduling problem with compatibility constraints on a single processor. Journal of Scheduling, 14(5):501–509, 2011. [17] G. Simonin, R. Giroudeau, and J.-C. König. Complexity and approximation for scheduling problem for coupled-tasks in presence of compatibility tasks. In Project Management and Scheduling. 2010. [18] G. Simonin, R. Giroudeau, J.-C. König, and B. Darties. Theoretical Aspects of Scheduling Coupled-Tasks in the Presence of Compatibility Graph. Algorithmic in Operations Research, 7(1):1—-12, 2012.
8cs.DS
Super-Golden-Gates for P U (2) arXiv:1704.02106v1 [math.NT] 7 Apr 2017 Ori Parzanchevski and Peter Sarnak To David Kazhdan with admiration. Abstract To each of the symmetry groups of the Platonic solids we adjoin a carefully designed involution yielding topological generators of PU (2) which have optimal covering properties as well as efficient navigation. These are a consequence of optimal strong approximation for integral quadratic forms associated with certain special quaternion algebras and their arithmetic groups. The generators give super efficient 1-qubit quantum gates and are natural building blocks for the design of universal quantum gates. 1 Introduction The n-qubit circuits used for quantum computation are unitaries in U  C2 ⊗n  = U (2n ) which are products of elementary unitaries, each of which operates on a fixed (typically at most 3) number of qubits. The standard universal gate set for quantum computing consists of all 1-qubit unitaries i.e. U (2) (which can be applied to any of the single qubits) and the 2-bit XOR gate, together these generate U (2n ) ([NC11]). In a classical computer the only operations on a single bit are to leave it or flip it. In the quantum setting we can rotate by these 2 × 2 unitaries. To further reduce to a finite universal gate set one has to settle for a topologically dense set, and since overall phases do not matter it suffices to find “good” topological generators of G = P U (2). The Solovay-Kitaev algorithm [NC11] ensures that any fixed topological generators of G have reasonably short words (i.e. circuits) to approximate any x ∈ G (with respect to the bi-invariant ∗ y)| metric d2 (x, y) = 1 − |trace(x ). From the point of view of general polynomial type complexity 2 classes this is sufficient, however there is much interest ([NC11, KMM13b, KMM13a]) both theoretical and practical, to optimize the choice of such generators. Golden-Gates ([Sar15d]) which correspond to special arithmetic subgroups of unit quaternions and which were introduced as optimal generating rotations in [LPS87], yield variants of optimal generators. A particular case is the “Clifford plus T” gates described below and which appear in most textbooks. The Clifford gates form a finite subgroup C24 of order 24 in G and to make the set universal one needs to add an extra element of G. The popular choice is the order 8 0 element T = 10 eiπ/4 . That these generate an S-arithmetic group was shown in [KMM13b], see also [Sar15d]. Considerations of fault-tolerance when applying these to make circuits in U (2n ), require among other things that the universal gate set consists of elements of finite order. Moreover for the Clifford plus T gates, the applications of the c gates with c ∈ C24 in a circuit are considered to 1 be of small cost compared to T ([BK05, BS12]). This leads to the “T-count” being the measure of complexity of a word and to the problem that we consider in this note: To find universal gate sets (i.e. ones that are topological generators of G) which are of the form a finite group C in G together with an extra element T , which we take to be an involution, so that C plus T is optimal with respect to covering G with a small T -count, and at the same time to be a able to navigate G efficiently with these gates. The key feature that was needed for a Golden-Gate construction was that the corresponding S-arithmetic unit quaternion group act transitively on the vertices of the corresponding (q + 1)regular tree (here q is a prime power). The extra “miracle” that is needed here is that the group act transitively on the edges. With this extra requirement there are only finitely many such “Super-Golden-Gates”, see Section 3. We list some of them; in each case the finite group C is naturally a subgroup of the symmetries of a platonic solid: (1) Pauli plus T (Cube)    i 0 0 C4 = , 0 −i −1   1 1−i T4 = . 1 + i −1  1 , the 4-group of Pauli matrices 0 (2) Minimal Clifford plus T (Octahedron)       1 0 1 1 1 −i C3 = , , , which is a subgroup of the Clifford group, 0 1 i −i 1 i   √ 2 0 . T3 = 1+i 0 (Note: These generate a finite index subgroup of the usual “Clifford plus T” group but the latter has redundancies in that the circuits for the exactly synthesizable elements are not unique. For our choices, it is.) (3) Hurwitz group plus T (Tetrahedron)     i 0 1 1 C12 = , , 0 −i i −i   3 1−i T12 = . 1 + i −3 (4) Clifford plus T (Octahedron)     1 0 1 1 C24 = , , the Clifford group 0 i −1 1 √ √   2+i −1 √ − 2 2− √ T24 = 2− 2−i 1+ 2 (5) Klein’s Icosahedral group plus T (Icosahedron)     1 1 1 ϕ − i/ϕ C60 = , , i −i ϕ + i/ϕ −1   2+ϕ 1−i T60 = . 1 + i −2 − ϕ 2 √ 1+ 5 ϕ= ; 2 These Super-Golden-Gate sets all enjoy the same relative optimal distribution and navigation properties that we describe next. The only difference between them is the number N (t) below, and from the point of view of this count, example (5) is the best and presumably it is the optimal absolute Super-Golden-Gate set. Let N (t) be the number of circuits in the elements of C and T , and of T -count t. That is words of the form c0 T c1 T . . . T ct where the cj ’s are not 1 except possibly at the ends. Clearly 2 N (t) = |C| (|C| − 1) t−1 , t≥1 (1.1) We want these N (t) circuits to represent distinct elements in G. In fact, for any k, we want the circuits of length at most k to realize distinct element in G (these elements are often referred to as the “exactly synthesized” gates). This requirement is equivalent to the subgroup of G generated by C and T being isomorphic to C ∗ (Z/2Z). This is the case for the super-gates. Next we want these N (t) elements to almost cover G optimally. That is almost all balls B 2 in G (with respect to the bi-invariant metric) of volume V , where V · N  (log N ) , should contain at least one of the N = N (t) points. In order to cover almost all balls, clearly V · N must be large, so that for an almost all covering the above is essentially best possible, that is almost all x ∈ G have a circuit of essentially the shortest possible T-count approximating x. The Super-Golden-Gates enjoy this optimal almost covering property (see Section 3). As with Golden-Gates (see [Sar15d]) these super-gates do not cover all balls of this smallest size. There are rare balls with volume V ≈ N −3/4 which are free of the N = N (t) exactly synthesized elements, while every ball B of volume at least N −1/2 does contain one of the N (t) points. Whether there exist gate sets which do not have this “big hole” feature is an interesting open problem ([Sar15d, RS17]). The final requirement for these super-gates is that we can find the short circuits (whose existence is ensured from the discussion above) efficiently. The task is given a ball B in G and a k, to find (if it exists) a circuit in the gates of length at most k and which lies in B. The problem is clearly in NP. The algorithm introduced in [R-S] can be executed for our super-gate sets, and it leads under the assumption that one can factor integers quickly, to a heuristic algorithm, which for B whose center is a diagonal matrix y ∈ G, resolves the above task in poly (log 1/V (B)) steps. In particular for such a y it finds for a given k, (one of) the circuit of length at most k, which best approximates y.(†) On the other hand, the Diophantine problem (see below) that is at the heart of the above algorithm for y diagonal, is NP-complete when y is replaced by a general x ∈ G. Thus finding the shortest circuit approximating a general x in G is apparently a genuinely hard complexity problem. This does not preclude there being an efficient algorithm which gives a good approximation to the shortest circuit. By factoring the general x in G into a product y1 y2 y3 where the yj ’s are in different diagonal subgroups (see Section 3) one can produce circuits with T-count which is three times longer than the optimally short circuit. Removing this factor of 3 remains a basic open problem concerning Golden Gates. The Diophantine problem that underlies the analysis of these Golden Gates is “strong approximation for sums of four squares”. For simplicity we restrict here to Z and n ∈ N odd (see Sections 2 and 3): x21 + x22 + x23 + x24 = n. (1.2) Let S (n) be the set of integer solutions x = (x1 , x2 , x3 , x4 ) to (1.2). To each x ∈ S (n) let x e = √xn ∈ S 3 , the unit sphere in R4 with its round metric and normalized volume µ. In Section (†) Without the efficient factorization assumption one can find efficiently a circuit in B whose length is (1 + o (1)) times longer then the optimal one, see (3.13). 3 3 we show that these |S (n)| points x e almost cover S 3 optimally. More precisely, if d (n) is the number of divisors of n then if V · |S (n)| → ∞ as n → ∞, d (n) then !! 3 µ S \ [ BV (e x) → 0. (1.3) x∈S(n) Here BV (ξ) is the ball in S 3 centered at ξ and of volume V . Among the ingredients in the proof of (1.3) are the Ramanujan Conjectures, which are theorems ([Del74]) for the cases at hand. The computational complexity problem associated with strong approximation for (1.2) is (see Section 2): Task I. Given n, ξ ∈ S 3 and V to find x ∈ S (n) such that x e ∈ BV (ξ). This task is clearly in NP and Theorem 2.5 shows that it is NP-complete, at least under a radomized reduction. On the other hand if ξ is of the special form, ξ = (ξ1 , ξ2 , 0, 0) then an adaption of [RS15] is given in Section 2 which resolves the above task efficiently (i.e. in poly (log n) steps). The algorithm assumes that one has an efficient algorithm to factor m’s in N, and for its running time it relies on some heuristics (see Section 2.2). We note that the analogous problem of an optimal topological generator for U (1) = R/Z has a golden solution. If Rα is the rotation x 7→ x + α (one could start with two reflections whose composition is such  j a rotation) then the covering volume V (n, α) if the words of length at most ; j = 1, . . . , n ) is n (i.e. Sα (n) = Rα V (n, α) = sup |I| . I∩Sα (n)=∅ I an interval In [GVL68] it is shown that 2 lim V (n, α) |Sα (n)| ≥ 1 + √ 5  a b with equality iff α = aϕ+b cϕ+d with ϕ the golden ratio and c d ∈ GL2 (Z). Moreover, the continued j fraction algorithm allows one to find efficiently the j ≤ n such that Rϕ best approximates a given ξ ∈ U (1). n→∞ We end the Introduction with a brief outline of the paper. In Section 2 the computational complexity results connected with (1.2) and Task I are established. In Section 3.1 the optimal covering properties of solutions to (1.2) and its generalizations to number rings are proven. Section 3.2 applies these results to unit groups of quaternions verifying the advertised properties of Golden and Super-Golden gate sets. Section 4 is devoted to the construction of such gate sets. Finally in Section 5 we examine some semigroups and asymmetric random walks associated with Super-Golden gates, and use the examples of Section 4 to construct Ramanujan Cayley digraphs. Acknowledgement. The authors thank O. Regev and J. Vrondák for for illuminating discussions on integer programming and NP-completeness. 4 2 2.1 Sums of squares and complexity Sums of two squares The algorithm for navigating G using Golden Gates is based on solving the simplest quadratic Diophantine inequalities. We begin with the setting of the integers Z. n = pe11 . . . pekk is a sum of two squares: n = x2 + y 2 , (2.1) iff each odd prime factor pj of n with ej odd is congruent to 1 (mod 4). Task II. To solve (2.1) efficiently. By efficiently we mean in polynomial time in the input. In this case the input is n in N and c specifying n requires log n bits, so the Task is to find x and y satisfying (2.1) in (log n) steps, for some fixed c. More generally denote by h (α) the height of a rational number α = ab , that is max {log |a| , log |b|}, so that h (α) measures the number of bits in α. As discussed in the introduction we assume throughout that factoring an n ∈ N can be done efficiently. The following is due to Schoof [Sch85]. Theorem 2.1. Task II has an efficient resolution. Proof. First factor n = 2t pe11 . . . pekk (note k and ej are O (log n)) and for each odd ej with p ≡ 1 (mod 4), solve x2j + yj2 = pj (2.2)   9 [Sch85] gives a O (log pj ) algorithm to solve (2.2). One could also proceed instead with various random (running time) algorithms for solving√ (2.2) which run even faster and work very well in practice [Coh93, §1.5.1]. With xj + iyj ∈ Z −1 at hand we can find a solution to (2.1) by taking Y Y e t (xj + iyj ) j pej /2 , x + iy := (1 + i) ej even ej odd as N (x + iy) := (x + iy) (x − iy) = n. If we modify Task II by adding an inequality, the complexity of the problem changes dramatically. Task III. Given n ∈ N; α, β ∈ Q find a solution to (2.1) with α ≤ y x ≤ β. Task III is plainly in NP, that is to say one can recognize a solution efficiently if one is presented with x and y. Theorem 2.2. Task III is NP-complete under a randomized reduction. What this says is that under a randomized reduction (see below) if Task III has an efficient solution then P=NP. So for us the upshot is that unlike factoring, Task III is genuinely hard. Proof. √ The  Diophantine approximation condition in Task III can be replaced by III’: find x+iy ∈ Z −1 , N (x + iy) = n and α0 ≤ arg (x + iy) ≤ β 0 . We show that if III’ can be resolved efficiently then so can the long known to by NP-complete subsum (or ’Knapsack’ as it is called in [Kar72]) problem: 5 Task IV. Given t1 , t2 , . . . , tn , t ∈ N, are there εj ∈ {0, 1}, j = 1, . . . , k such that k X εj tj = t. j=1 Pk log tj and so we seek a O (H c ) steps algorithm √  Pk (c-fixed). Let M = b100k maxj {tj , t}c and τ = j=1 tj . We seek primes Pj in the ring Z −1 with N (Pj ) = X and arg (Pj ) near tj /M , j = 1, . . . , k, and X to be chosen. According to 1 [Kub55] the number of primes P with N (P ) ≤ X and |arg (P ) − β| ≤ X − 10 is asymptotic to Note that the bit content in Task IV is H = j=1 1 X X − 10 as X → ∞, and log X π 10 uniformly for any β. Hence for each j = 1, . . . , k there is Pj with N (Pj ) ≤ (100kM ) which 1 tj ≤ , Arg (Pj ) − M 100kM  (where Arg (z) ∈ − π2 , π2 ). and for We discuss how to find Pj efficiently below, this leading to the randomized reduction part. For εj ∈ {0, 1} and ηj = 2εj − 1 ∈ {−1, 1} we have     k k k X X ε t t τ − 2t X tj j j   2 − = ηj Arg (Pj ) + + ηj − Arg (Pj ) M M M M j=1 j=1 j=1 = k X ηj Arg (Pj ) + j=1 where |(Θ)| ≤ τ − 2t + (Θ) M 1 . 100M Hence k X εj tj = 1 iff j=1 k X ηj Arg (Pj ) − j=1 2t − τ 1 ≤ . M 100M Let n = N (P1 ) N (P2 ) . . . N (Pk ) and Pj = xj + iyj with xj > 0. Then z = x + iy solves Task III’ with σ(η ) σ(η ) iff z = P1 1 . . . Pk k conjugation if ηj = −1. 2t − τ 1 2t − τ 1 − ≤ Argz ≤ + M 100M M 100M Pk and j=1 εj tj = t, where σ (ηj ) = id if ηj = 1 and σ (ηj ) is complex 6 Note that h (M ) = O (H) and h (n) ≤ k X 10 h (N (Pj )) ≤ k log (100kM )  H 2, j=1 so that the input for Task III’ is polynomial in terms of that of Task III. It remains to find P1 , . . . , Pk efficiently. That is to find a prime P in the sector N (P √ ) ≤ X and arg (P ) ∈ SX 1 where |SX | = X − 10 and h (X) = H. If we choose a random β ∈ Z −1 in this section the probability that it is prime is 1/log X . Thus sampling such β’s and checking if they are prime will produce the requisite P in polynomial H steps. In this way we produce the Pj ’s using a randomized polynomial time procedure. Once the Pj ’s are determined in polynomial H steps then so is n. Thus Task III is reduced to Task III’ albeit by a randomized reduction. Remark 2.3. A similar NP-complete problem is discussed in [Sud10]. It asserts that the task: Given n, α, β to find integers x, y such that xy = n and α ≤ x ≤ β; is NP-complete under a randomized reduction (see discussion [Cad11]). 2.2 Sums of four squares The Diophantine approximation problem that is directly connected to our navigation of G is that of four squares, x21 + x22 + x23 + x24 = n. (2.3) It is well known [Lag70] that for every n ≥ 0 (2.3) has integral solutions. The question of finding a solution efficiently is discussed in [RS86]. A randomized efficient algorithm  to do this is to choose x3 and x4 with x23 + x24 ≤ n at random and to check if n − x23 + x24 is a prime p ≡ 1 (mod 4). The last can be done efficiently ([AKS04]) and if yes, then Schoof gives x1 and  x2 and we have a solution to (2.3). If n − x23 + x24 is not such a prime we repeat with another choice of x3 , x4 . The probability of success is 1/log n in view of the density of primes, and this leads to a randomized algorithm. 3 For  the4 approximation problem we project the solutions x = (x1 , x2 , x3 , x4 ) of (2.3) onto S = ξ ∈ R |ξ| = 1 by sending x to x (2.4) x e= √ . n S 3 comes with its round metric, relative to which all measurements are made. So for example Br (ξ) is the ball centered at ξ of radius r. Task V. Given n, ξ, ε to find a solution of (2.3) with x e ∈ Bε (ξ). Remark 2.4. In terms of the bit content or height h we take ε and ξ to be rational and h (ξ) = max {h (ξj ) | j = 1, 2, 3, 4}. Task V is clearly in NP. We use Theorem 2.2 to show: Theorem 2.5. Task V is NP-complete under a randomized reduction. Proof. While our interest is four squares, our proof of this is inductive. We formulate Task V for a sum of k-squares. For k = 2 Theorem 2.2 asserts what is claimed here. If Theorem 2.5 is true for k it is true for k + 1. We explain the case from 2 to 3, the general case is similar. Let n, α0 , β 0 be the input for Task III’. We show how to resolve it efficiently assuming Task V 7 for x21 + x22 + x23 = m can be done efficiently. Choose n2 < y3 < n and let m = y32 + n, so 2 y32 < m < (y3 + 1) . Hence for any x = (x1 , x2 , x3 ) with x21 + x22 + x23 = m √ √ 2 ( m − x3 ) 2 ( m − y3 ) d2 (e x, (0, 0, 1)) = ≥ m m with equality iff x3 = y3 . In particular those x e’s which are all the closest solutions to (0, 0, 1), correspond exactly to solutions of x21 + x22 = n and x3 = y3 . x So if we seek the solution x = (x1, x2 ) ∈ S 1 to (2.1) with |x| closest to α = (α1 , α2 ) ∈ S 1 , we 2 2 can do so by determining the x = (x1 , x2 , x3 ) with x1 + x2 + x23 = m and for which x e is closest to η (α1 , α2 , 0) + (0, 0, 1), for η small enough and positive. One checks that this determination is efficient and hence it follows that an efficient solution of Task V for k = 3, yields one for k = 2. While Theorem 2.5 limits what one can do efficiently in general, the good news is that special cases of this task can be done. For ξ = (ξ1 , ξ2 , 0, 0), Ross and Selinger [RS15] give an algorithm (see also [Ros15, BBG15]). Theorem 2.6 (Ross-Selinger). There is a heuristic efficient algorithm to solve Task V for ξ = (ξ1 , ξ2 , 0, 0). Discussion. The precise meaning of heuristic will be clarified in what follows. An important extra feature is that the algorithm can and has, been implemented ([RS15]) and that it runs and terminates quickly. A similar algorithm has been devised and implemented in the p-adic setting, namely that of navigating related Ramanujan graphs in [PLQ08] and [Sar17]. The key property as far as these special ξ’s go is that for x solving (2.3)   ξ1 x1 + ξ2 x2 2 √ d (ξ, x e) = 2 1 − , n and this is a linear constraint depending on x1 and x2 only. Hence x e ∈ Bε2 (ξ) is equivalent to (A) ξ1 x1 + ξ2 x2 ε √ >1− ; 2 n x21 + x22 ≤ n and (B)  n − x21 + x22 = x23 + x24 . In this way tasks (A) and (B) are decoupled, and we proceed by first finding candidate solution to (A) and then solving for (B). Now (A) is a problem of finding integer lattice points (x1 , x2 ) in Z2 which lie in the convex ’miniscus’ region defined by the inequalities in (A). Listing the solutions one at a time (which is done with polynomial cost) is in P. The algorithm to do this is due to Lenstra [LJ83] and applies to such integer convex programming problems for Zk in any fixed dimension k (see [Lov86]). His key input being Minkowski reduction of bases of lattices. If the input complexity for Task V is H, then we examine O (H c )of the solutions to (A) (in some geometric ordering or randomly) and for each (x1 , x2 ) we check if (B) has a solution by running the efficient solution to Task (II). If we arrive at a solution (x1 , x2 , x3 , x4 ) then we have 8 resolved Task V. If our O (H c ) (here c is a fixed number such as 10) steps cover all the solutions to (A) and no (x3 , x4 ) is found, then we output that Task V has no solution, which is the case. The only stumbling block to the algorithm terminating efficiently is that there are more than a polynomial in H number of solutions to (A) and our O (H c ) inspections produce no solutions to (B), in particular this would happen if in fact there are no solutions to (B) among these very many solutions to (A). The heuristic aspect of the algorithm is that this last scenario will not √ happen. The density of numbers t in [X, 2X] which are sums of two squares is 1/ log X , so that √ one expects that (B) will have a solution with probability 1/ H . Thus the probability of hitting this stumbling block after O (H c ) tries is very small, and possibly never arises. This completes the analysis and meaning of Theorem 2.6. Remark 2.7. In Theorem 2.6 and elsewhere we have assumed that one can factor efficiently. Without appealing to such a factoring algorithm we can seek an approximation to ξ as above  but in (B) we require that n − x21 + x22 be a prime p ≡ 1 (4). The density of such special √ solutions is a bit smaller (1/log X rather than 1/ log X ) and we can find these solutions efficiently. 2.3 Sums of squares in number rings The coordinates of the Golden Gates Sets lie in the ring of S-integers of certain number fields. This leads us to the examination of the tasks discussed in Sections √  2.1 and 2.2 with √  Z replaced by the ring of integers OK , of number fields such as K = Q 2 and K = Q 5 . These are unique factorization domains and in fact even Euclidean domains. This allows us to extend the results of the previous sections to these rings. We explicate what we need for later. Task II is to solve (2.1) with x, y ∈ OK (K fixed) given n ∈ OK . By factoring N (n) (have N = NK/Q is the norm) into primes and applying [Sch85] to NK/Q (α) = p, we obtain an efficient factorization of n into primes in OK . Thus we are left with dealing with the case that n = P , is a totally positive prime. Using the Euclidean algorithm to compute gcd’s in OK we are in the same situation as over Z, needing to find ν ∈ O/P with ν 2 + 1 ≡ 0 (mod P ). Again we apply [Sch85] and this yields an efficient solution to Task II over OK . With this we can address Task V over OK in the form of Theorem 2.6. That is to solve x21 + x22 + x23 + x24 = n with x e ∈ Bε (ξ) , ξ = (ξ1 , ξ2 , 0, 0) . Here n is totally positive, i.e. n > 0 and n0 > 0 where x e = √xn ∈ S 3 . 0 is the Galois conjugate of (2.5) K/Q, and As before this decouples into (A0 ) x1 , x2 ∈ OK , ξ1 x1 + ξ2 x2 √ >1− n ε 2 ; x21 + x22 ≤ n 2 2 (x01 ) + (x02 ) ≤ n0 and (B 0 )  n − x21 + x22 = x23 + x24 with x3 , x4 ∈ OK . For (A0 ) the points (x1 , x01 , x2 , x02 ) with x1 , x2 ∈ OK form a rank 4 lattice L in R4 and the inequalities defining the set in which they lie is a convex (compact) set. Lenstra’s algorithm allows us to find these points efficiently. As in the setting with (A) , (B), each instance of (B 0 ) with a given x1 , x2 ∈ OK is Task II over OK , and so has an efficient solution. The rest of the analysis is as before. We have shown that Theorem 2.6 is valid for OK . 9 3 Strong approximation for integer points on spheres 3.1 Spectral gap and strong approximation We are interested in how well the points x e for x satisfying (2.3) or (2.5) cover S 3 . A powerful method to address this makes use of these points corresponding to orbits defining Hecke operators, and their eigenvalues may be estimated (optimally) using the Ramanujan Conjectures (see [LPS87]). We formulate a covering estimate in terms of a spectral gap, for a general compact topological group L as it clarifies the roles of the ingredients (we will apply it for G = L = P U (2)). Let µ be Haar measure on L normalized to be a probability measure. Let S S be a finite subset of L and |S| its cardinality. For B ⊆ L with µ (B) > 0, we are interested in s∈S (Bs). Ifthese right S S-translates of B cover all of L we say that the pair B, S covers. If µ L\ s∈S Bs = o (1) as |S| → ∞ (our interest is |S| → ∞ and we allow everything including L to change) we say that B, S is almost covering. It is clear that to be almost covering we must have |S| µ (B) ≥ 1 + o (1) . If S is chosen at random (that is i.i.d. w.r.t. µ) then |S| µ (B) → ∞ (3.1) is necessary and sufficient for almost covering(†) . P Let as ≥ 0 with s∈S as = 1 and let νs be the probability measure on L given by X νS,a := as δs s∈S (δx is a point mass at x). νs defines a right convolution operator TS,a on L2 (L) by X  TS,a f (x) = as f xs−1 . (3.2) s∈S Clearly TS,a 1 = 1; The orthogonal space to 1, L20 kTS,a k = 1. (L), is TS,a invariant. Let W = WS,a := TS,a L20 (L) . W ≤ 1 and we estimate the covering properties of S in terms of the spectral norm W .  S W2 W2 , in particular if µ(B) = o (1), Proposition 3.1. For B and S as above µ L\ s∈S Bs ≤ µ(B) then B, S is almost covering. Proof. indicator function of the set B. IB (x) − µ (B) is in L20 (L) R Let IB (x) be the R 2 2 and L (IB (x) − µ (B)) dµ (x) = µ (B) (1 − µ (B)). Hence L [TS,a [IB (x) − µ (B)]] dµ (x) ≤ 2 W µ (B) (1 − µ (B)), that is #2 Z "X  as IB xs−1 − µ (B) dµ (x) ≤ W 2 µ (B) (1 − µ (B)) . (3.3) L (†) This s∈S being a well known property of the Coupon Collector’s problem. 10 2 If x ∈ / Bs for any s ∈ S then xs−1 ∈ / B and the bracketed expression in (3.3) is [µ (B)] , and S 2 hence µ L\ s∈S Bs µ (B) ≤ W 2 µ (B), which gives the claimed inequality.  S 1 , so that µ L\ s∈S Bs ≥ If L is a continuous group then we can choose B to satisfy µ (B) = 2|S| 1 1 1 2 2 and hence from Proposition 3.1, W ≥ 4|S| or W ≥ 2|S|1/2 . In our applications W will be √ 2 of this size, namely 1/ |S|, and in this case W /µ(B) is o (1) iff µ (B) |S| → ∞, matching (3.1). Hence in such cases B, S is essentially optimal in its almost covering property. To conclude that B, S is actually covering we need to assume more about the shape of B. Specifically we take B to be a ball which is the case of interest to us. Let d (x, y) be a L-biinvariant metric on L (if L is finite then d is the discrete metric d (x, y) = 0 if x = y, d (x, y) = ∞ if x 6= y), and let B be a ball centered at e of volume µ (B) = v. Then B = B −1 and sB = Bs is the ball centered at s and of volume v. B, S is covering iff every ball in L of volume v contains an s ∈ S. Corollary 3.2. If B is a ball in L with center e, radius r ≥ 0 and volume v > W then B2r (e), S is covering (where Br (x) is the ball centered at x and of radius r). Proof. If there is x ∈ L such thatS no s ∈ S meets B2r (x), then for each y ∈ Br (x), Br (y) ∩ S = ∅. Hence each such y lies in L\ s∈S Bs , so that the measure of this set is at least v. On the 2 other hand by Proposition 3.1 we have v ≤ Wv or v ≤ W , which contradicts our assumption. √ Remarks. (1) In the continuous group case when W ≈ 1/ |S| is as small as it can possibly −1/2 be, Corollary 3.2 yields that every ball of volume |S| contains a point from S. While in some cases this covering volume bound might be far from the truth for S, there are very natural cases (see below) where this is sharp. (2) If L is finite then the only balls are singletons and L itself. In this caseSif B = {e}, 1 µ (B) = |L| and the upper bound in Proposition 3.1 gives a lower bound for s∈S Bs = S (almost covering asserts that |S|/|L| → 1). The covering Proposition 3.1 asserts that S = L 1 . if W < |L| (3) There are variants of Proposition 3.1 for symmetric spaces (see [BSR12]) and for Cayley graphs ([Sar15a, LP16]). We formulated the main variance inequality (3.3) in terms of the spectral norm W alone. In some important cases one can exploit a more explicit version. If TS,a is normal and hence diagonalizable with an o.n.b. φj , j = 1, 2, . . . of L20 (L), then the l.h.s. of (3.3) is equal to ∞ X 2 2 |hIB , φj i| |λj | (TS,a ) (3.4) j=1 where λj is the eigenvalue corresponding to φj . (3.3) then follows by invoking |λj | ≤ W . In the form (3.4) one can allow exceptions to this as long as there aren’t too many such j’s 2 and one can also remove very high frequency j’s (in the continuous setting) since |hIB , φj i| is very small for these. Such an analysis is carried out in [Sar15c] in a different setting. We first apply Proposition √ 3.1 to the question of the covering properties of the arguments of Gaussian primes P in Z −1 , as discussed in Section 2. Consider the set SX of such primes 11 P with N (P ) ≤ X (we consider P, −P, iP, −iP as distinct), so that by the Prime Number Theorem 4X |SX | ∼ . log X Their arguments θP are elements in the circle [0, 2π) which is the group L for which  we apply  Proposition 3.1 and its Corollary. For each P we give a weight aP = log N (P ) 1 − Hence X 1 ν= aP δθ(P ) Ψ1 (X) N (P )≤X   X N (P ) Ψ1 (X) = log N (P ) 1 − ∼ c1 X, c1 > 0. X N (P ) X . N (P )≤X The point about these weights is that assuming the generalized Riemann Hypothesis for the  4m α Hecke L-functions, L (s, λm ) where λm (α) = |α| we have (see [Sar85]) that X λm (θP ) aP  (log |m| + 1) X 1/2 . N (P )≤X Hence for the o.n.b. λm , m ∈ Z of L2 [0, 2π) m νS,a ∗ λm = νd S,a (m) · λ where −1/2 |νd (log |m| + 1) . S,a (m)|  X This is an example where the high frequencies can be estimated easily, and we find that (3.4) is X 2 2 2  X −1 (log |m| + 1) |hIB , λm i|  X −1 (log X) µ (B) . m6=0 2 Hence for (log X) Xµ(B) = o (1) or µ(B)|SX | log X → ∞; B, SX is almost covering. That is almost all intervals h|SX | log X of length h with → ∞, have a θP with P ∈ SX . So except for the extra log X factor this is sharp. This has direct bearing to the randomized reduction in Section 2. Namely to find the Pj ’s there in the requisite sector, we can choose a random angle θ therein and then according 2 to the above there will be a prime in a much smaller sector of area (log X) . We can check efficiently each of the few integer lattice points in this sector to see if they are prime. Of course this is still a randomized reduction. Since the almost covering length of the θP ’s is optimally small (under GRH) a natural question is how small is the covering length? Proposition 3.1 coupled with GRH which gives (essentially) p 1/2 that W ≤ |S 1|1/2 (log X) , shows that the covering length is at most log X/ |SX |. It turns X out that this upper bound is very  to optimal. Let α = x1 + iy1 , β = x2 + iy2 be two √ close distinct primitive elements of Z −1 with arguments θα , θβ in [0, π/4). Then |tan θα − tan θβ | = y1 y2 1 1 − ≥ ≥ . x1 x2 x1 x2 |α| |β| Hence if β is fixed of small norm and N (α) ≤ X, then 1 |tan θα − tan θβ |  √ X 12 √ so there is an interval of length 1/ X free of θα ’s for α primitive and hence certainly free of log X θP ’s with P a prime. Thus our upper bounds of g(X) with g → ∞, for the almost covering |SX | p length, and of log X/ |SX | for the covering length, are sharp up to the log factors. 3.2 Quaternions and Ramanujan Let H (R) denote the Hamilton quaternions α = x0 + x1 i + x2 j + x3 k, xj ∈ R. The projection α 7→ α e = α/|α| is a morphism of H × (R) onto H 1 (R), the quaternions of norm 1. Moreover s given by   x0 + ix1 x2 + ix3 α 7→ s (α) = (3.5) −x2 + ix3 x0 − ix1 is an isomorphism of H 1 (R) with SU (2), and both with their bi-invariant metrics are isometric to S 3 . In this way the solutions to (2.3) which we denote by S (n) give points in G = SU (2) ' S 3 and we can apply the results in Section 3.1 to study their covering properties w.r.t. balls. We assume that n is odd. Jacobi showed that (see [DSV03]) X |S (n)| = 8 d. d|n For the convolution operator on L2 (SU (2))we take as = T f (x) = 1 |S(n)| , s ∈ S (n) so that X  1 f xs−1 (α) . |S (n)| α∈S(n) The Ramanujan Conjectures (Deligne’s Theorem [Del74]) imply that (see [LPS87] and also the discussion below) P n1/2 d|n 1 W = WS(n) ≤ . (3.6) |S (n)| Hence and if P 1 W2 d|n 1 ≤ P 1 · , |S| µ (B) 8 d|n d |S| µ (B) |S (n)| µ (B) P → ∞, d|n 1 then S (n) , B is almost covering SU (2). Two special cases of interest are: n a prime; in which |S (n)| µ (B) → ∞ suffices and matches (3.1), while for the case n = pk for p > 2 a fixed prime, µ(B)|S(n)| logp |S(n)| → ∞ suffices to almost cover. The last is the case of interest for the covering properties of Golden Gates and up to the log factor it is optimal. As far as the covering properties of SU (2) by S (n), we apply (3.6) together with Corollary 3.2 to get that ! P d|n 1 −1/2 µ (B) > P |S (n)| (3.7) −1/2 d d|n suffices for S (n) to cover SU (2) with balls of volume µ (B). 13 A very interesting question is to determine the covering volume for S (n), or at least its exponent. An elementary argument using repulsion of the projections of H (Z) points onto S 3 (see [Sar15d]) −3/4 shows that there are balls B of volume |S (n)| which are  free of any points from S (n). Hence the exponent for the covering volume lies in the interval − 43 , − 21 and it is probably equal to −1/2+ε −3/4. One can establish (3.7) with exponent |S (n)| using the ’Kloosterman circle method’, see [Sar15b]. In this approach Kloosterman sums and estimates associated with them play a central role and assuming a natural conjecture about cancellations of sums involving these, one can establish that the volume covering exponent is −3/4 [BKS16]. That there are such points which are badly approximable by S (n) leads to a rich metric diophantine approximation theory in this and much more general contexts, see [GGN14]. We turn to these questions for integers in a number field. Let K be a totally real number field of degree k and denote by σ1 , . . . , σk its Galois embeddings into R with with σ1 = identity. For a definite quadratic form F (x1 , x2 , x3 , x4 ) such as the sum of four squares we can use Hilbert modular form theory as above to study the distribution of the S (m) solutions to F (x1 , x2 , x3 , x4 ) = x21 + x22 + x23 + x24 = m with xj ∈ OK and m ∈ OK . (3.8)  Let U denote the group of units of OK . Now x = (x1 , x2 , x3 , x4 ) ∈ S (m) iff εx ∈ S ε2 m for any ε ∈ U . Thus any properties of S (m) that are of interest to us are the same for S (m) and S ε2 m . Except for very special K’s (see [KV10]) the class number of the form F above is not one so that the exact number of solutions to (3.8) is not a simple divisor function of (m). However the asymptotic behavior of |S (m)| for (m) (the principal ideal generated by m) which does not have prime factors in the finitely many ramified primes of F is given by a divisor sum ([SP04]): X |S (m)| ∼ C N (a) , a|(m) here C is a positive constant related to the finite group AutO (F ) and N (a) is the norm of the ideal a. √ To each x ∈ S (m) and j = 1, . . . , k, σj (x)/ σj (m) (note σj (m) > 0 if S (m) 6= ∅) lies in S 3 , which we have identified with SU (2). Hence via the diagonal embedding each x ∈ S (m) gives a point k in L ∼ = S 3 . The analysis at the beginning of this Section and the Ramanujan Conjectures which are valid here as well ([HT01]) show that WS(m) ≤ N ((m)) 1/2 P a|(m) |S (m)| 1 . Applying Proposition 3.1 to L we deduce that if µ (B) |S (m)| P →∞ a|(m) 1 (3.9) then B, S (m) almost covers L. As before this is essentially an optimal covering. Two two extreme cases of interest are if B is a ball about e ∈ L of radius r so that µ (B) ∼ cr3k , then we require N (m) to be a little bigger than r−3k in order for almost all balls of this radius to contain a point from S (m). The other case which is of most interest to us is to fixate on the first factor σ1 . Take B to be B1 × S 3 × · · · × S 3 14 with B1 a ball of radius r about e1 in SU (2). So µ (B) = µ1 (B1 ) and as long as µ (B1 ) N (m) goes to infinity as required then σ1 (x) , x ∈ S (m) almost covers SU (2). So in this case we need N (m) to be a little larger than r1−3 . The above, when applied to special cases, suffices for the analysis of the optimal covering properties of Golden Gate circuits. For the purpose of navigation and exact circuit length we need to exploit special quadratic forms of class number one and which arise as norm forms of quaternion algebras. We give a different treatment of (3.9) from the point of view of the local and global arithmetic of special quaternion algebras over K. This also brings out the important special finite subgroups C of P U (2) which are used to define our Super-Golden Gates. Let K be as above and Kj the real completion of K at σj . For P a prime (ideal) in OK we let KP be the completion of K at P . Let D be a totally definite quaternion algebra over K, that is D ⊗ Kj ∼ = H (R) for all j, where H is the standard Hamilton quaternion algebra. The primes at which D is unramified are those for which D ⊗ KP ∼ = M at2 (KP ). The ramified primes for D are even in number (if one include the Kj ’s in the count). Choose an order O, which we usually take to be maximal, in D (for the basic properties and definitions see [Vig80]). Let D (A) denote the corresponding adele ring of D w.r.t. the order O. For P unramified and S = {P } we are interested in the S-arithmetic group ΓS = {γ ∈ D (K) | γ is O-integral outside S} . Now D (KP )/center ∼ = P GL2 (KP ), and via this identification, ΓS projects onto a lattice Γ × in P GL2 (KP ) (see [Vig80]). Also H (R)/center ∼ = P U (2), so using the embeddings σj , j = 1, 2, . . . , k we get a diagonal embedding of Γ = ΓS/center into L × P GL2 (KP ), where L = k (P U (2)) . × The quotient space XP = P GL2 (KP )/P GL2 (OP ) is a N (p)+1 regular tree ([Ser80]) on which Γ acts isometrically. Let L2 (Γ\ (L × XP )) be the space of L2 (w.r.t. dg × dgP ) Γ-periodic functions: f (γg, γx) = f (g, x) for γ ∈ Γ, g ∈ L, x ∈ XP . The Hecke operators Tt , t > 1 acting on the second variable are defined by X Tt f (g, x) = f (g, y) . d(y,x)=t Tk preserves L2 (Γ\ (L × XP )) and also L20 (Γ\ (L × XP )); the orthocomplement of the constant function. It is self adjoint and its eigenvalues λ on L20 (Γ\ (L × XP )) satisfy t/2 |λ| ≤ (t + 1) N (P ) . (3.10) One way to derive (3.10) is to use automorphic representations. The eigenfunctions in L20 (Γ\ (L × XP )) can, after a further diagonalization of Hecke operators at other primes, be embedded as a vector in an (non one-dimensional) irreducible representation π of D (A) occuring in its right regular representation on L2 (D (k) \D (A)). The Ramanujan Conjectures, which are theorems in this context - thanks to the Jacquet-Langlands correspondence and Deligne’s N theorem (see [JL72, Del74]), assert that such a π ∼ = v πv with v ranging over all places v of K, has each πv tempered ([Sat66]). In particular, this applies to the spherical representation πP of P GL2 (FP ) and this in turn implies that the eigenvalue λ satisfies (3.10). To connect this with circuit lengths of elements γ ∈ Γ we impose a strong condition, namely that the action of Γ on XP is transitive. For this to happen for P outside a finite set of primes, 15 the class number of the order O needs to be 1. In this definite quaternion algebra setting this happens only for finitely many D’s and K’s which have been enumerated in [KV10]. In this transitive case L2 (Γ\ (G × XP )) may be identified with functions h on G which are UΓ invariant where UΓ = {γ ∈ Γ | γe = e}, e the identity coset P GL2 (OP ) in XP . More explicitly for f ∈ L2 (Γ\ (G × XP )) h (g) = g (g, e) , and h (δg) = h (g) for δ ∈ UΓ . Such an h has a unique Γ extension to G × XP . The action of Tk on L2 (UΓ \G) becomes X Tk h (g) = h (gγ) γ∈Γ/UΓ d(γe,e)=k and according to (3.10) Tk is the kind of operator considered in (3.2), with a sharp spectral bound. Finally in this XP transitive setting we relate the distance moved by γ on the tree to circuit (word) length for generators of Γ. Let δ1 , . . . , δr ∈ Γ with r = N (P ) + 1, be elements that take v0 to its r immediate neighbors S1 = {ξ | d (ξ, v0 ) = 1} in XP . If y ∈ XP and y = βv0 with β ∈ Γ then βδj v0 for Hence if µ ∈ Γ and  j = 1, . . . , r are the r immediate neighbors of y.−1 d (µv0 , v0 ) = d µ−1 v0 , v0 = k ≥ 1, then there is a unique j1 such that d µ δj1 v0 , v0 = k − 1.  If k − 1 ≥ 1 we repeat this to find δj2 such that d µ−1 δj1 δj2 v0 , v0 = k − 2. Repeat this until we arrive at d µ−1 δj1 . . . δjk v0 , v0 = 0, and hence µ−1 δj1 . . . δjk = u ∈ U, or µ = δj1 . . . δjk u−1 . (3.11) Since at every step the choices are determined we have that any µ ∈ Γ with d (µv0 , v0 ) = k has a unique expression in the form (3.11). Thus the distance moved by γ on the tree corresponds to the word length in generators δ1 , . . . , δr and the “Hecke orbit” corresponds to a circuit of a given length. Moreover if we are given γ ∈ Γ and want to express γ in the form (3.11) then this can be done efficiently by navigating the tree, as described above. This is an important feature that will be exploited in the navigation algorithms below. In the case that UΓ = {1}, that is when Γ acts , the set S = {δ1 , . . . , δr }  simply transitively on XP−1 is invariant under s 7→ s−1 . Hence S = δ1 , . . . , δt , µ1 , µ−1 with δj = δj−1 , µj 6= 1 , . . . , µv , µv µ−1 and t + 2v = r. (3.11) then shows that XP is the Cayley graph of Γ with respect to the j generators S, the µj ’s being of infinite order and Γ ∼ = hµ1 i ∗ . . . ∗ hµv i ∗ hδ1 i ∗ . . . ∗ hδt i. The distance on the tree XP corresponding to the word (circuit) length w.r.t. the symmetric set of generators S. This is the case of Golden-Gate sets which as we have noted can arise from only a finite number of D’s and K’s; see Section 4 for some examples (by varying P there are infinitely many such Golden Gate sets). For our super Golden Gate sets we require further that Γ acts transitively on the edges of XP . In fact we assume that UΓ acts simply transitively on S1 and that among the δj ’s there is an involution T . In this case the set δ1 , . . . , δr can be taken as u−1 T u, u ∈ UΓ (note |UΓ | = r). (3.11) now asserts that Γ ∼ = UΓ ∗ hT i and d (γv0 , v0 ) is exactly the T -count in the representation of γ ∈ Γ as a product of T and u’s for u ∈ U . This gives rise to our super-golden gate sets C plus T , with C = UΓ . There are only finitely many of these since the set of D’s and K’s lie in a 16 finite list as does the set of orders O. Hence UΓ which is the unit group of the order is limited, and this limits the primes P for which this group can act transitively on S1 . We conclude that there are only finitely many possibilities for super Golden Gate sets. There are a number of very interesting examples where all of this happens, and these are described in the next section. We end this Section by describing the relation between word length of elements of Γ in terms of the generators µ1 , . . . , µv , δ1 , . . . , δt and strong approximation for (2.3). We explain this for the case that D = H = 1, i, j, k the Hamilton quaternions over Q, this being the case that was highlighted in [LPS86] and is the basic example of what we are calling Golden-Gates. Let H (Z) be the order Z + Zi + Zj + Zk in H. The group U of invertible elements in H (Z)  is ±1, ±i, ±j, ±k . The spheres S (m) = {α ∈ H (Z) : nr (α) := αα = m} correspond to the solutions to (2.3). These spheres are acted on by U × U by left and right multiplication α 7→ u1 αu2 . (3.12) For p and odd prime |S (p)| = 8 (p + 1) and after multiplying on the right by u ∈ U there are (p + 1) solutions. If p ≡ 1 (4) exactly one coordinate of an α ∈ S (p) is odd and we use U to make it the first coordinate and also ensure that it is positive. This gives us µ1 , µ1 , µ2 , µ2 , . . . , µv , µv with 2v = p + 1 as the solutions (see [LPS87, DSV03]). If p ≡ 3 (4) then exactly one of the coordinates of an α ∈ S (p) is even and we can use U to arrange that this coordinate is the first one, and again we can act by ±1 to choose the sign. In this way the (p + 1) solutions obtained become µ1 , µ1 , . . . , µv , µv , δ1 , . . . , δt with p + 1 = 2v + t and δj2 = −p for j = 1, . . . , t (see [DSV03]). Now H is unramified at each odd prime p so that the group Γ generated by these p + 1 elements can be realized as a subgroup of P GL2 (Qp ). These generators take the identity coset v0 = P GL2 (Zp ) ∈ Xp = P GL2 (Qp )/P GL2 (Zp ) to its (p + 1) neighbors, and Γ acts simply transitively ∼ Z and hδj i ∼ on Xp . Moreover Γ ∼ = hµ1 i ∗ . . . hµv i ∗ hδ1 i ∗ . . . ∗ hδt i with hµj i = = Z/2Z, and Xp is the Cayley graph of Γ w.r.t. µ1 , µ1 , . . . , µv , µv , δ1 , . . . , δt . Now a reduced word of length ` in these generators yields a unique (up to right multiplication by U ) α in S p` , which is primitive, namely, gcd (x1 , . . . , x4 ) = 1. Furthermore, every primitive α in S p` is achieved this way. This identifies the distance dXp (v0 , αv0 ) with the word length of α in our generators. The splitting of H(R)/R+ by the isomorphism (3.5) to G = P U (2), yields the subgroup, also denoted by Γ, generated by our p + 1 elements. The question of how  well the words of length `, ` ≤ L cover G is equivalent to the same question for the α ∈ S p` covering S 3 , ` ≤ L. That is the problem discussed at the beginning of this Section. It follows from these that the circuits of length ` ≤ L almost cover G optimally. Precisely, the number of circuits of length ` ≤ L in G is ≈ pL (here p is fixed and L → ∞) and as long as V pL → ∞, L then almost all balls BV (ξ) in G are covered. Finally as far as navigating G with these generators, again the problem reduces to one of strong approximation, namely Task V of Section 2, with n = p` . The task needs to be resolved in poly (L) steps. So to determine if there is a circuit of length ` ≤ L in BV (ξ), we can do so for each ` ≤ L separately. The question for a given such ` decouples into two steps, firstly  finding an α ∈ S p` which is in BV (ξ). According to Theorem 2.6 this can be done efficiently at least if ξ is special in S 3 , which amounts to ξ ∈ G being diagonal. Once we have found α (or determined that none exists) we can express α as a circuit of length ` in the generators by viewing α ∈ P GL2 (Qp )/P GL2 (Zp ). There is a unique generator which will move α one step closer to v0 . Repeating this ` times gives an efficient factorization of α. 17 To summarize, given ξ ∈ G diagonal and BV (ξ), then assuming that we can factor efficiently and the heuristic in the discussion in Theorem 2.6, we can find efficiently a circuit of least word length in our generators which lies in BV (ξ). Without an efficient factorization algorithm we settle for finding special solutions to the strong approximation problem as described in remark 2.7 and otherwise proceed as above. This secures a circuit which lies in whose word length is; (1 + o (1)) times longer than the optimally short circuit. (3.13) The above allows us to navigate to diagonal ξ’s in G optimally and efficiently. As far as an optimal navigation to a general ξ via strong approximation, the problem at least in the form of Task I is apparently hard. We can navigate efficiently to a ξ = (ξ1 , ξ2 , ξ3 , ξ4 ) ∈ S 3 which has at least two coordinate equal to 0. In particular to elements x ∈ G of the form µ1 ξµ2 with µ1 , µ2 ∈ C4 th Pauli group and ξ diagonal. Now any element of G can be expressed as a product of three such µ1 ξµ2 ’s and efficiently, hence we can navigate efficiently to x with a circuit whose lengthy is 3-times longer then the shortest circuit is for the generic x. The efficient navigation with Super Golden Gates and using T -counts is carried out similarly. This completes the theoretical diophantine and algorithmic analysis concerning Golden and Super-Golden gates that was announced in the Introduction. We end this Section with two explicit examples. (A) V-gates: We take p = 5. Then p + 1 = 6 and the generators are 1 ± 2i, 1 ± 2j, 1 ± 2k;   0 1 2 1 2i ∼ which yield S1 = 1+2i 0 1−2i , S2 = −2 1 , S3 = ( 2i 1 ) (Γ = hS1 , S2 , S3 i = Z ∗ Z ∗ Z) as ±1 ±1 ±1 a Golden Gate set S1 , S2 , S3 called V -gates. (B) p = 3, v = 0, t = 4; δ1 = i + j + k, δ2 = i − j + k, δ3 = i + j − k, δ4 = i − j − k. These yield    i −1+i i 1−i i 1+i the four involutions Sj in G given by S1 = −1+i , S2 = 1+i , S3 = −1−i , −i −i −i  i −1−i ∼ S4 = 1−i −i (Γ = hS1 i ∗ hS2 i ∗ hS3 i ∗ hS4 i) and are a Golden Gate set. The action of U × U on S (3) given by (3.12) is transitive and this leads to our first example of a super gate to which we now turn. 4 Super Golden Gates Each Super-Golden-Gate set is composed of a finite group C and an involution T , which lie in a {P }-arithmetic group for P a prime ideal of the integers OK of a totally definite quaternion algebra D, over a totally real number field K. We require that: (1) C acts simply transitively on the neighbors of the origin in XP . (2) T is an involution which takes the origin to one of the neighbors . Since T is an involution, it inverts some edge e0 whoseorigin is v0 . Denote by Γ the group generated by C and T , and by ∆ the group generated by cT c−1 c ∈ C . The next Proposition follows by Bass-Serre theory from the assumptions (1), (2) above. Proposition 4.1. (1) Γ acts simply transitively on the directed edges of XP . (2) The T -count of γ ∈ Γ is dXp (v0 , orig (γe0 )) = dXp (v0 , γv0 ), and in particular there are 2 t−1 |C| (|C| − 1) elements of T -count t. 18 (3) Γ is the free product of C and hT i ' Z/2Z. (4) ∆ is a Golden-Gate set; namely, it acts simply transitively on the vertices of XP , and thus is a free product of |C| copies of Z/2Z. (5) Γ = ∆ o C. One can navigate in Γ as follows: If the origin of γe0 is v0 , then γ ∈ C. In not, there is a unique c0 ∈ C for which γc−1 0 e0 is pointing towards v0 , since {γce0 | c ∈ C} are the rotations of γe0 around its origin. Then,   dXp v0 , orig γc−1 = dXp v0 , term γc−1 0 T e0 0 e0  = dXp v0 , orig γc−1 − 1 = dXp (v0 , orig (γe0 )) − 1. 0 e0  −1 Continuing in this manner one finds c0 , . . . , c`−1 ∈ C such that orig γc−1 0 T . . . c`−1 T e0 = v0 , −1 hence c` := γc−1 0 T . . . c`−1 T is in C, and γ = c` T c`−1 T . . . T c1 T c0 . 4.1 Examples In the examples of Super-Golden-Gate sets that follow we explicate the definite quaternion algebra D over the totally real field K and order O as well as the prime P at which we allow denominators. Both K and O have class number 1 and we refer to the corresponding entries in Table 8.2 of [KV10]. 4.1.1 Lipschitz quaternions and Pauli matrices The simplest example occurs for D being the Hamilton quaternions over Q, and O the Lipschitz order Z + Zi + Zj + Zk which was used to construct the golden gates in the previous Section. × If one takes P = (3), then an explicit isomorphism from (D ⊗ Q3 ) /Q× 3 to P GL2 (Q3 ) is given by   √  a + c + ρd b + ρc − d (4.1) a + bi + cj + dk 7−→ , ρ = −2 , −b + ρc − d a − c − ρd √ where −2 = . . . 200211 ∈ Q3 . The unit group O× /Z× is {1, i, j, k}, which corresponds in P U (2) to the Pauli matrices         1 0 i 0 0 1 0 i C4 := , , , , 0 1 0 −i −1 0 i 0 ...211 ...222 and it is mapped under (4.1) to {( 10 01 ) , ( ...2220 01 ), ( ...2111 ...211 ...222 ), ( ...222 ...12 )}. These indeed P GL (Q ) 2 3 act simply transitively on the neighbors of v0 ∈ X3 = /P GL2 (Z3 ), as one can verify by multiplying them on the right with ( 10 03 ) and computing the Iwasawa decomposition of the result. The element i + j + k ∈ O is an involution in D× /Q× , it inverts the edge e0 = [v0 → ( 3 11 ) v0 ] (again using (4.1)), and it corresponds in P U (2) to   1 1−i T4 := . 1 + i −1 19 4.1.2 Hurwitz quaternions and tetrahedral gates   , we consider the maximal order of Hurwitz quaternions Keeping D = −1,−1 Q h i O = Z i, 1+i+j+k = Z ⊕ Z · i ⊕ Z · j ⊕ Z · 1+i+j+k , 2 2 which corresponds to the entry 1 1 2 1 in [KV10, Tab. 8.2]. The unit group O× /Z× is the Platonic tetrahedral group, which is isomorphic to Alt4 . In P U (2) it corresponds to     i 0 1 1 C12 := , . 0 −i i −i √ For P = (11), the same splitting as in (4.1) can be used (with ρ = −2 ∈ Q11 ), and C12 acts simply transitively on the neighbors of the origin of XP . As an involution one can take 3i+j +k, which maps to   3 1−i T12 := 1 + i −3 in P U (2). Here and in the examples which follow we do not write down the explicit action of Ck and Tk on the tree XP (where k = N (P ) + 1). In all the examples the splitting of D ⊗ KP is chosen so that Ck fixes the vertex P GL2 (OKP ) ∈ XP , and Tk invert an edge which is incident to it. 4.1.3 Octahedral gates √  √  We now take nD to be the Hamilton o quaternions over K = Q 2 , which has OK = Z 2 and √ m × UK = OK = ± 1+ 2 m ∈ Z . A maximal order in D is given by 1+i 1+j 1+i+j+k O = OK ⊕ OK · √ ⊕ OK · √ ⊕ OK · , 2 2 2 which is entry 2 8 1 1 in [KV10, Tab. 8.2] (see also [Vig80, §5]). The unit group of O modulo scalars is the Platonic octahedral group   1+i 1+i+j+k ∼ U/UK =O ×/O × = √ , = Sym4 , F 2 2 which corresponds in P U (2) to the Clifford group     1 0 1 1 C24 := , . 0 i i −i √  √  For P = 5 − 2 , there is a (unique) continuous isomorphism KP = Q 2 5−√2 ∼ = Q23 , which √ is given by sending 2 to a square root of 2 in Q23 , chosen so that P maps to a uniformizer. ∼ × Then, a splitting (D ⊗ KP ) /KP× −→ P GL2 (Q23 ) is given by   √  a + 2c + ρd b + ρc − 2d a + bi + cj + dk 7−→ , ρ = −5 ∈ Q23 . −b + ρc − 2d a − 2c − ρd   √  Adding the involution 1 + √12 i + √j2 + 1 − 2 k, which corresponds to √ −1 √ − 2 2− 2−i  T24 := √  2− √ 2+i ∈ P U (2) , 1+ 2 20 gives the super-golden-gate set Γ = hC24 , T24 i, which is the full {P }-arithmetic group in O. Some subgroups of Sym4 give other super-gate-sets: √  ∼ × 2 , we have (D ⊗ KP ) /KP× −→ P GL2 (Q7 ) by ! c(1−ρ)−d(1+ρ) a + c(1+ρ)+d(1−ρ) b + 2 2 a + bi + cj + dk 7−→ , −b + c(1−ρ)−d(1+ρ) a − c(1+ρ)+d(1−ρ) 2 2 8-gates. For P = 3 + ρ= √  −3 , and we obtain the gates  0 C8 := 1   1 1 , 0 0  0 , i √ √  2√ − 1 1 − √2i 1 + 2i 1 − 2 T8 := which correspond to Dih4 ≤ Sym4 and the involution i + j + k−i √ . 2 √  √  3-gates (ramified P ). For the prime P = 2 , one has KP ∼ 2 , and a splitting = Q2 √  ∼ × (D ⊗ KP ) /KP× −→ P GL2 Q2 2 is given by  a + bi + cj + dk 7−→ where α = √ 2+ −14 3 and β = √ √ 2 2− −7 . 3  C3 := which correspond to D √  2 (b + cα + dβ) , a − b − c (α − β) − d (α + β) a + b +√c (α − β) + d (α + β) − 2 (b − cβ + dα) 1+i+j+k 2 E 1 i The gate set obtained is 1 −i   , T3 :=  ≤ Sym4 , and 1 − √1 2  0 1+i j+ √  2 , 0 √1 k. 2 D E i−j ∼ √ V-gates (hybrid example). Taking the subgroup 1+i+j+k , = Sym3 of the octahedral 2 2 group, one can scale its generators to 1+i+j +k and i−j, which lie in the Lipschitz quaternions.  × There they generate an infinite group, which projects onto a copy of Sym3 in −1,−1 /Q× . Q Together with the involution j + 2k this gives the gate set       1 1 0 i 0 2−i C6 := , , T6 := . i −i 1 0 2+i 0 4.1.4 Icosahedral gates √ √  × = We move to the golden field K = Q 5 , for which OK = Z [ϕ] (ϕ = 1+2 5 ), and UK = OK  −1,−1 m {±ϕ | m ∈ Z}. A maximal order in D := is given by the ring of icosians K O=  1 2 ! a + c + e + g ≡ b + d + f + h ≡ 0 (mod 2) √  √    a+b 5 + c+d 5 i √  √  (b, d, f ) (mod 2) , or , (c, e, a) ≡  + e+f 5 j+ g+h 5 k (b, d, f ) + (1, 1, 1) (mod 2) 21 which is 2 5 1 1 in [KV10, Tab. 8.2], and which forms, with respect to a non-standard quadratic form, a copy of the E8 lattice (c.f. [Tit80] or [CS99, §8]). The unit group of O modulo scalars is the Platonic icosahedral group   1 + i + j + k i + ϕ−1 j + ϕk ∼ U/UK =O ×/O × = , = Alt5 , F 2 2 which corresponds to  C60 := 1 i   1 1 , −i ϕ + i/ϕ ϕ − i/ϕ −1  . For P = (7 + 5ϕ) one has KP ∼ = Q59 , and the splitting (4.1) can be used again. As an involution one can take (2 + ϕ) i + j + k, which gives   2+ϕ 1−i T60 := , 1 + i −2 − ϕ and the generated group Γ = hC60 , T60 i is the full {7 + 5ϕ}-arithmetic group of O. ∼ × Icosahedral 12-gates. Taking P = (4 − ϕ), one has (D ⊗ KP ) /KP× −→ P GL2 (Q11 ) using (4.1). This gives another set of gates acting on a 12-regular tree: * !+    1 ϕ + ϕi 1 1 ϕ−1 1−i 0 0 C12 := , , T := , 12 i −i 1+i 1−ϕ ϕ − ϕi −1 corresponding to D 1+i+j+k i−ϕ−1 j+ϕk , 2 2 E ∼ = Alt4 ≤ Alt5 and the involution (ϕ − 1) i + j + k. 5-gates (inert P ). Taking P = (2), the completion KP has a residue field of size four, and a ∼ × splitting (D ⊗ KP ) /KP× −→ P GL2 (KP ) is given by ! √ √   a + cα + dβ b + cβ − dα α = √5−2√−7 . a + bi + cj + dk 7−→ , −b + cβ − dα a − cα − dβ β = 5+2 −7 D E The cyclic group ϕ+i/ϕ+j ≤ Alt5 and the involution j + k give the gate set 2 C5 :=  1+ϕ+i −ϕ  ϕ , 1+ϕ−i T5 :=  0 i  1 . 0 √  Nonexamples. For the ramified and inert primes P = 5 and P = (3) of Z [ϕ], the corresponding {P }-arithmetic groups act on a 6-regular and a 10-regular tree, respectively. While the involutions T6 = i + ϕj and T10 = i + j + k invert an edge at the origin, the groups Sym3 , Dih5 ≤ Alt5 do not act transitively on its neighbors. Remark 4.2. Our focus throughout has been on optimal covering exponent and navigation. If one relaxes the class number 1 assumption or that S consists of a single prime, then one loses these optimal features. However the gate sets that arise from such general S-arithmetic groups coming from definite quaternion algebras still have reasonably good covering exponents and navigation properties. These have been studied in [KBRY15]. 22 5 Iwahori-Hecke operators In this section we study asymmetric Hecke operators, both on P U (2) and on the tree XP , whose spectral properties coincides with that of the non-backtracking random walk (NBRW) on a Ramanujan graph, as explored in [LP16]. This corresponds to words (circuits) in free semigroups generated by Golden Gate sets. 5.1 Ramanujan semigroups in P U (2) For a Super-Golden-Gate set Γ = hC, T i, and an edge e0 flipped by T (as in Section 4), denote by T the “sector” descended from e0 , namely, all vertices v for which the shortest path from v0 to v begins with e0 . Let S = {T c | 1 6= c ∈ C} and S r = {s1 · . . . · sr | si ∈ S} , (5.1) S∞ r and observe Σ := r=0 S , the semigroup generated by S. Assuming that e0 is leading away from the origin, the map e0 7→ σe0 gives a correspondence between S r and the edges which lead from the r-th to the (r + 1)-th level in T. In particular, Σ is a free semigroup on S, and |S r | = k r , where k = |S| = |C| − 1. The spectrum of TS = TS,as (with as ≡ k1 , in the notation of Section 3.1) is particularly nice:       1 1 . (5.2) ∪ Spec TS L2 (P U (2)) ⊆ λ ∈ C |λ| = √ 0 k k This should be compared with [LPS86, Thm. 1.3], which asserts that for any symmetric set S 0 ⊆ P U (2) of size k   2√k − 1 . max Spec TS 0 L2 (P U (2)) ≥ 0 k While the latter bound corresponds to the spectral radius of the random walk on the Cayley graph of a free group, the bound √1k in (5.2) is the spectral radius of the random walk on a free semigroup. Furthermore, since TS r is precisely TSr , we obtain |λ| ≤ k −r/2 for every   λ ∈ Spec TS r L2 (P U (2)) . 0 One should note, however, that TS is not normal, so that (5.2) is not enough to determine the spectral norm WS . In fact, it turns out that WS = 1. However, s   q  r  1 2 (k − 1)2 + 4k + r 2 (k − 1)2 + 2k = O (k − 1) r r . (5.3) WS r = r+1 2k k r/2 This, as well as (5.2), is obtained by considering the action of TS on the tree Xp and applying strong approximation and the Ramanujan conjectures. We describe the case which corresponds to the standard Hamilton quaternions for simplicity. Since Γ acts simply transitively on the edges of Xp , we have L2 (P U (2)) ∼ (5.4) = Γ\ (GR × Gp ) /Bp , where G = D× /Z (D× ), and Bp is the Iwahori subgroup of Gp := GQp , namely, Bp = StabGp (e0 ). Via the isomorphism (5.4), L2 (P U (2)) is a representation space for the IwahoriHecke algebra of Gp . This is the algebra of compactly supported bi-Bp -invariant functions on ∼ Edges (Xp ) by convolution, and TS acts by an element in this Gp , which acts on L2 (Gp /Bp ) = algebra. 23 The Ramanujan conjectures imply that every irreducible, infinite-dimensional Iwahori-spherical representation which appears in L2 (P U (2)) is tempered, so that the matrix coefficients of its Iwahori-fixed vectors are in L2+ε (Edges (Xp )) for all ε > 0. The operator TS corresponds to NBRW on Xp , and thus its spectrum √ is contained in that of the NBRW on a (k + 1)regular tree, which is {λ ∈ C | |λ| = 1/ k} ∪ {±1/k}. Furthermore, every tempered, Iwahorispherical, unitary irreducible representation V of Gp ∼ = P GL2 (Qp ) is either (1) a twist of the Steinberg representation, in which case dim V Bp = 1, and TS V Bp = ± k1 ; or (2) a principal series representation induced from  ordp (a/d)     s ∗ ∗ a b × χ: →C , χ = √ 0 ∗ 0 d p for some s ∈ C of norm 1. In this case dim V Bp = 2, and in an appropriate orthonormal basis for V Bp ! √s 0 p TS V Bp = (p−1)s , 1 p √ s p from which (5.3) follows. We remark that this decomposition, in the graph setting, is the key ingredient in [LP16]. 5.2 Ramanujan digraphs The golden-gate sets of [LPS86, LPS87] were used in [LPS88] to construct explicit Ramanujan graphs, which are finite k-regular graphs whose nontrivial spectrum is contained within that of the k-regular tree. Namely, √ every eigenvalue λ of their adjacency operator is either trivial (λ = ±k) or satisfies |λ| ≤ 2 k − 1. In a similar manner, the set S defined in (5.1) can be used to construct Ramanujan digraphs;  we say that a k-regular digraph G is Ramanujan if every λ ∈ Spec AdjG satisfies λ = |k| or √ |λ| ≤ k. In other words, its nontrivial spectrum is contained within that of the Cayley digraph of the free semigroup on k generators. For more on Ramanujan digraphs, see [LLP17]. For K, O, P, Ck , Tk as in one of the examples in Section 4.1, let Sk = {Tk · c | 1 6= c ∈ Ck }. The Cayley graph of Γ = hCk , Tk i with respect to Sk is naturally identified with the directed line graph of the tree XP . Namely, its vertices correspond to directed edges in XP , and its edges to non-backtracking steps in XP , so that the adjacency operator on Cay (Γ,  Sk ) describes NBRW on a tree. For an ideal Q 6= P in OK , let ΓQ = ker Γ → GOK /Q , and let Y P,Q be  the Cayley graph of Γ/ΓQ with respect to the set of generators Sk . Again, L2 Verts Y P,Q is a representation of the Iwahori-Hecke algebra  of GP , and the Ramanujan conjectures imply that every nontrivial eigenvalue λ of Adj Y P,Q corresponds to a Iwahori-fixed vector in a tempered √ representation, giving λ = ±1 or |λ| = k, as in Section 5.1. In addition, we have the trivial eigenvalue k (which arises from the trivial representation), but unlike the continuous case here we also obtain the eigenvalue −k whenever P is a quadratic non-residue in OK/Q. Finally, we note that the groups Γ/ΓQ can be identified concretely: denoting Fq = OK /Q, we have by Wedderburn’s theorem × × × ∼ GFq = (D ⊗ Fq ) /F× q = Mat2 (Fq ) /Fq = P GL2 (Fq ) , and theimage  of Γ/ΓQ in GFq is either P GL2 (Fq ) or P SL2 (Fq ), according to the Legendre P symbol Q . For example, taking C4 = {i, j, k}, T4 = i + j + k (see Section 4.1.1) and Q = (23) 24 15 1 16 5 one obtains Γ/ΓQ ∼ = P SL2 (F23 ) by i 7→ ( 02 11 0 ), j 7→ ( 4 8 ). This gives T4 · i 7→ ( 20 5 ), and similarly for T4 · j, T4 · k. The spectrum of the Ramanujan digraph obtained is shown in Figure 5.1. 1.5 1 0.5 Figure 5.1: The adjacency spectrum of Y 3,23 , the Cayley graph of P SL2 (F23 ) -1 5 20 8 7 10 w.r.t. S = {( 16 20 5 ) , ( 5 1 ) , ( 21 14 )}. 1 2 3 -0.5 -1 -1.5 References [AKS04] [BBG15] [BK05] [BKS16] [BS12] [BSR12] [Cad11] [Coh93] [CS99] [Del74] [DSV03] [GGN14] [GVL68] [HT01] Manindra Agrawal, Neeraj Kayal, and Nitin Saxena. PRIMES is in P. Annals of mathematics, pages 781–793, 2004. Andreas Blass, Alex Bocharov, and Yuri Gurevich. Optimal ancilla-free Pauli+V circuits for axial rotations. Journal of Mathematical Physics, 56(12):122201, 2015. Sergey Bravyi and Alexei Kitaev. Universal quantum computation with ideal Clifford gates and noisy ancillas. Phys. Rev. A (3), 71(2):022316, 14, 2005. TD Browning, V Vinay Kumaraswamy, and RS Steiner. Twisted Linnik implies optimal covering exponent for S 3 . arXiv preprint arXiv:1609.06097, 2016. Alex Bocharov and Krysta M. Svore. Resource-optimal single-qubit quantum circuits. Phys. Rev. Lett., 109:190501, Nov 2012. Jean Bourgain, Peter Sarnak, and Zeév Rudnick. Local statistics of lattice points on the sphere. Modern Trends in Constructive Function Theory, Contemp. Math, 661:269–282, 2012. Michaël Cadilhac. An NP-complete variant of factoring, 2011. http://cstheory. stackexchange.com/questions/4769/an-np-complete-variant-of-factoring. Henri Cohen. A course in computational algebraic number theory, volume 138 of Graduate Texts in Mathematics. Springer-Verlag, Berlin, 1993. J. H. Conway and N. J. A. Sloane. Sphere packings, lattices and groups, volume 290 of Grund. Math. Wiss. Springer-Verlag, New York, 3rd edition, 1999. Pierre Deligne. La conjecture de Weil. I. Publications Mathématiques de l’Institut des Hautes Études Scientifiques, 43(1):273–307, 1974. Giuliana Davidoff, Peter Sarnak, and Alain Valette. Elementary number theory, group theory and Ramanujan graphs, volume 55 of London Mathematical Society Student Texts. Cambridge University Press, 2003. A. Ghosh, A. Gorodnik, and A. Nevo. Metric Diophantine approximation on homogeneous varieties. Compositio Mathematica, 150(08):1435–1456, 2014. R. L. Graham and J. H. Van Lint. On the distribution of nθ modulo 1. Canadian Journal of Mathematics, 20(4):1020, 1968. Michael Harris and Richard Taylor. The geometry and cohomology of some simple Shimura varieties, volume 151 of Annals of Mathematics Studies. Princeton University Press, Princeton, NJ, 2001. With an appendix by Vladimir G. Berkovich. 25 [JL72] Hervé Jacquet and Robert P Langlands. Automorphic forms on GL(2), volume 278. Citeseer, 1972. [Kar72] Richard M Karp. Reducibility among combinatorial problems. In Complexity of computer computations, pages 85–103. Springer, 1972. [KBRY15] Vadym Kliuchnikov, Alex Bocharov, Martin Roetteler, and Jon Yard. A framework for approximating qubit unitaries. arXiv preprint arXiv:1510.03888, 2015. [KMM13a] Vadym Kliuchnikov, Dmitri Maslov, and Michele Mosca. Asymptotically optimal approximation of single qubit unitaries by clifford and t circuits using a constant number of ancillary qubits. Physical review letters, 110(19):190502, 2013. [KMM13b] Vadym Kliuchnikov, Dmitri Maslov, and Michele Mosca. Fast and efficient exact synthesis of single-qubit unitaries generated by Clifford and T gates. Quantum Information & Computation, 13(7-8):607–630, 2013. [Kub55] JP Kubilius. On a problem in the n-dimensional analytic theory of numbers, viliniaus valst. Univ. Mokslo dardai Chem. Moksly, Ser, 4:5–43, 1955. [KV10] Markus Kirschmer and John Voight. Algorithmic enumeration of ideal classes for quaternion orders. SIAM Journal on Computing, 39(5):1714–1747, 2010. [Lag70] J. L. Lagrange. Démonstration d’un théorème d’arithmétique. Nouv. mém. Acad. Berlin, 1770. in Oeuvres, 3, 189-201. [LJ83] Hendrik W Lenstra Jr. Integer programming with a fixed number of variables. Mathematics of operations research, 8(4):538–548, 1983. [LLP17] Eyal Lubetzky, Alex Lubotzky, and Ori Parzanchevski. Random walks on Ramanujan complexes and digraphs. arXiv preprint arXiv:1702.05452, 2017. [Lov86] László Lovász. An algorithmic theory of numbers, graphs and convexity, volume 50 of CBMS-NSF Regional Conference Series in Applied Mathematics. SIAM, Philadelphia, PA, 1986. [LP16] Eyal Lubetzky and Yuval Peres. Cutoff on all Ramanujan graphs. Geometric and Functional Analysis, 26(4):1190–1216, 2016. [LPS86] A. Lubotzky, R. Phillips, and P. Sarnak. Hecke operators and distributing points on the sphere I. Comm. Pure. Appl. Math., 39(1):149–186, 1986. [LPS87] A. Lubotzky, R. Phillips, and P. Sarnak. Hecke operators and distributing points on S 2 . II. Comm. Pure. Appl. Math., 40(4):401–420, 1987. [LPS88] A. Lubotzky, R. Phillips, and P. Sarnak. Ramanujan graphs. Combinatorica, 8(3):261–277, 1988. [NC11] Michael A. Nielsen and Isaac L. Chuang. Quantum Computation and Quantum Information. Cambridge University Press, New York, NY, USA, 10th edition, 2011. [PLQ08] Christophe Petit, Kristin Lauter, and Jean-Jacques Quisquater. Full cryptanalysis of LPS and Morgenstern hash functions. In International Conference on Security and Cryptography for Networks, pages 263–277. Springer, 2008. [Ros15] Neil J Ross. Optimal ancilla-free Clifford+V approximation of z-rotations. Quantum Information & Computation, 15(11-12):932–950, 2015. [RS86] Michael O. Rabin and Jeffery O. Shallit. Randomized algorithms in number theory. Comm. Pure Appl. Math., 39(S, suppl.):S239–S256, 1986. Frontiers of the mathematical sciences: 1985 (New York, 1985). [RS15] Neil J Ross and Peter Selinger. Optimal ancilla-free Clifford+V approximation of zrotations. Quantum Information & Computation, 15(11-12):932–950, 2015. [RS17] Igor Rivin and Naser Talebizadeh Sardari. In preparation. 2017. [Sar85] Peter Sarnak. On the number of points on certain curves and an uncertainty principle. Number Theory, pages 239–253, 1985. [Sar15a] Naser Talebizadeh Sardari. Diameter of ramanujan graphs and random cayley graphs with numerics. arXiv preprint arXiv:1511.09340, 2015. [Sar15b] Naser Talebizadeh Sardari. Optimal strong approximation for quadratic forms. arXiv preprint arXiv:1510.00462, 2015. [Sar15c] P. Sarnak. Appendix to 2015 letter: Optimal lifting of integral points, 2015. http://publications.ias.edu/sites/default/files/Appendix%20-%20Optimal% 26 [Sar15d] [Sar17] [Sat66] [Sch85] [Ser80] [SP04] [Sud10] [Tit80] [Vig80] 20lifting%20of%20integral%20points.pdf. P. Sarnak. Letter to Aaronson and Pollington on the Solvay-Kitaev Theorem and Golden Gates, 2015. http://publications.ias.edu/sites/default/files/Letter%20-% 20golden%20gates%20march_0.pdf. Naser Talebizadeh Sardari. Complexity of strong approximation on the sphere. arXiv preprint arXiv:1703.02709, 2017. I. Satake. Spherical functions and Ramanujan conjecture. In Proc. Sympos. Pure Math, volume 9, pages 258–264, 1966. René Schoof. Elliptic curves over finite fields and the computation of square roots mod p. Math. Comp., 44(170):483–494, 1985. Jean-Pierre Serre. Trees. Springer-Verlag, Berlin-New York, 1980. Translated from the French by John Stillwell. Rainer Schulze-Pillot. Representation by integral quadratic forms - a survey. Contemporary Mathematics, 344:303–322, 2004. M. Sudan. The P vs. NP problem. 2010. http://madhu.seas.harvard.edu/papers/2010/ pnp.pdf. √ Jacques Tits. Quaternions over Q( 5), Leech’s lattice and the sporadic group of HallJanko. Journal of Algebra, 63(1):56–75, 1980. Marie-France Vignéras. Arithmétique des algèbres de quaternions, volume 800 of Lecture Notes in Mathematics. Springer, Berlin, 1980. 27
4math.GR
arXiv:1608.03644v4 [cs.LG] 18 Oct 2016 Deep Motif Dashboard: Visualizing and Understanding Genomic Sequences Using Deep Neural Networks Jack Lanchantin, Ritambhara Singh, Beilun Wang, and Yanjun Qi Department of Computer Science University of Virginia Charlottesville, VA 22903 {jjl5sw,rs3zz,bw4mw,yq2h}@virginia.edu Abstract Deep neural network (DNN) models have recently obtained state-of-the-art prediction accuracy for the transcription factor binding (TFBS) site classification task. However, it remains unclear how these approaches identify meaningful DNA sequence signals and give insights as to why TFs bind to certain locations. In this paper, we propose a toolkit called the Deep Motif Dashboard (DeMo Dashboard) which provides a suite of visualization strategies to extract motifs, or sequence patterns from deep neural network models for TFBS classification. We demonstrate how to visualize and understand three important DNN models: convolutional, recurrent, and convolutional-recurrent networks. Our first visualization method is finding a test sequence’s saliency map which uses first-order derivatives to describe the importance of each nucleotide in making the final prediction. Second, considering recurrent models make predictions in a temporal manner (from one end of a TFBS sequence to the other), we introduce temporal output scores, indicating the prediction score of a model over time for a sequential input. Lastly, a class-specific visualization strategy finds the optimal input sequence for a given TFBS positive class via stochastic gradient optimization. Our experimental results indicate that a convolutional-recurrent architecture performs the best among the three architectures. The visualization techniques indicate that CNN-RNN makes predictions by modeling both motifs as well as dependencies among them. 1 Introduction In recent years, there has been an explosion of deep learning models which have lead to groundbreaking results in many fields such as computer vision[13], natural language processing[25], and computational biology [2, 19, 27, 11, 14, 22]. However, although these models have proven to be very accurate, they have widely been viewed as “black boxes” due to their complexity, making them hard to understand. This is particularly unfavorable in the biomedical domain, where understanding a model’s predictions is extremely important for doctors and researchers trying to use the model. Aiming to open up the black box, we present the “Deep Motif Dashboard1 ” (DeMo Dashboard), to understand the inner workings of deep neural network models for a genomic sequence classification task. We do this by introducing a suite of different neural models and visualization strategies to see which ones perform the best and understand how they make their predictions.2 Understanding genetic sequences is one of the fundamental tasks of health advancements due to the high correlation of genes with diseases and drugs. An important problem within genetic sequence understanding is related to transcription factors (TFs), which are regulatory proteins that bind to DNA. Each different TF binds to specific transcription factor binding sites (TFBSs) on the genome to regulate cell machinery. Given an input DNA sequence, classifying whether or not there is a binding site for a particular TF is a core task of bioinformatics[24]. 1 Dashboard normally refers to a user interface that gives a current summary, usually in graphic, easy-to-read form, of key information relating to performance[1]. 2 We implemented our model in Torch, and it is made available at deepmotif.org For our task, we follow a two step approach. First, given a particular TF of interest and a dataset containing samples of positive and negative TFBS sequences, we construct three deep learning architectures to classify the sequences. Section 2 introduces the three different DNN structures that we use: a convolutional neural network (CNN), a recurrent neural network (RNN), and a convolutional-recurrent neural network (CNN-RNN). Once we have our trained models to predict binding sites, the second step of our approach is to understand why the models perform the way they do. As explained in section 3, we do this by introducing three different visualization strategies for interpreting the models: 1. Measuring nucleotide importance with Saliency Maps. 2. Measuring critical sequence positions for the classifier using Temporal Output Scores. 3. Generating class-specific motif patterns with Class Optimization. We test and evaluate our models and visualization strategies on a large scale benchmark TFBS dataset. Section 4 provides experimental results for understanding and visualizing the three DNN architectures. We find that the CNN-RNN outperforms the other models. From the visualizations, we observe that the CNN-RNN tends to focus its predictions on the traditional motifs, as well as modeling long range dependencies among motifs. 2 Deep Neural Models for TFBS Classification TFBS Classification. Chromatin immunoprecipitation (ChIP-seq) technologies and databases such as ENCODE [5] have made binding site locations available for hundreds of different TFs. Despite these advancements, there are two major drawbacks: (1) ChIP-seq experiments are slow and expensive, (2) although ChIP-seq experiments can find the binding site locations, they cannot find patterns that are common across all of the positive binding sites which can give insight as to why TFs bind to those locations. Thus, there is a need for large scale computational methods that can not only make accurate binding site classifications, but also identify and understand patterns that influence the binding site locations. In order to computationally predict TFBSs on a DNA sequence, researchers initially used consensus sequences and position weight matrices to match against a test sequence [24]. Simple neural network classifiers were then proposed to differentiate positive and negative binding sites, but did not show significant improvements over the weight matrix matching methods [9]. Later, SVM techniques outperformed the generative methods by using k-mer features [6, 20], but string kernel based SVM systems are limited by expensive computational cost proportional to the number of training and testing sequences. Most recently, convolutional neural network models have shown state-of-the-art results on the TFBS task and are scalable to a large number of genomic sequences [2, 14], but it remains unclear which neural architectures work best. Deep Neural Networks for TFBSs. To find which neural models work the best on the TFBS classification task, we examine several different types of models. Inspired by their success across different fields, we explore variations of two popular deep learning architectures: convolutional neural networks (CNNs), and recurrent neural networks (RNNs). CNNs have dominated the field of computer vision in recent years, obtaining state-of-the-art results in many tasks due to their ability to automatically extract translation-invariant features. On the other hand, RNNs have emerged as one of the most powerful models for sequential data tasks such as natural language processing due to their ability to learn long range dependencies. Specifically, on the TFBS prediction task, we explore three distinct architectures: (1) CNN, (2) RNN, and (3) a combination of the two, CNN-RNN. Figure 1 shows an overview of the models. End-to-end Deep Framework. While the body of the three architectures we use differ, each implemented model follows a similar end-to-end framework which we use to easily compare and contrast results. We use the raw nucleotide characters (A,C,G,T) as inputs, where each character is converted into a one-hot encoding (a binary vector with the matching character entry being a 1 and the rest as 0s). This encoding matrix is used as the input to a convolutional, recurrent, or convolutional-recurrent module that each outputs a vector of fixed dimension. The output vector of each model is linearly fed to a softmax function as the last layer which learns the mapping from the hidden space to the output class label space C ∈ [+1, −1]. The final output is a probability indicating whether an input is a positive or a negative binding site (binary classification task). The parameters of the network are trained end-to-end by minimizing the negative log-likelihood over the training set. The minimization of the loss function is obtained via the stochastic gradient algorithm Adam[12], with a mini-batch size of 256 sequences. We use dropout [23] as a regularization method for each model. 2 NON-TFBS TFBS TFBS NON-TFBS Linear & Softmax TFBS Convolution/ReLU/Maxpool NON-TFBS Linear & Softmax Average & Concatenate Linear & Softmax Maxpool Average & Concatenate Convolution/ReLU LSTM ACTTGCAG ACTTGCAG (a) CNN LSTM Convolution/ReLU ACTTGCAG (b) (c) RNN CNN-RNN Figure 1: Model Architectures. Each model has the same input (one-hot encoded matrix of the raw nucleotide inputs), and the same output (softmax classifier to make a binary prediction). The architectures differ by the middle “module”, which are (a) Convolutional, (b) Recurrent, and (c) Convolutional-Recurrent. 2.1 Convolutional Neural Network (CNN) In genomic sequences, it is believed that regulatory mechanisms such as transcription factor binding are influenced by local sequential patterns known as “motifs”. Motifs can be viewed as the temporal equivalent of spatial patterns in images such as eyes on a face, which is what CNNs are able to automatically learn and achieve state-of-the art results on computer vision tasks. As a result, a temporal convolutional neural network is a fitting model to automatically extract these motifs. A temporal convolution with filter (or kernel) size k takes an input data matrix X of size T × nin , with length T and input layer size nin , and outputs a matrix Z of size T × nout , where nout is the output layer size. Specifically, convolution(X) = Z, where nin X k X zt,i = σ(Bi + Wi,j,z xt+z−1,j ), (1) j=1 z=1 where W and B are the trainable parameters of the convolution filter, and σ is a function enforcing element-wise nonlinearity. We use rectified linear units (ReLU) as the nonlinearity: ReLU(x) = max(0, x). (2) After the convolution and nonlinearity, CNNs typically use maxpooling, which is a dimension reduction technique to provide translation invariance and to extract higher level features from a wider range of the input sequence. Temporal maxpooling on a matrix Z with a pooling size of m results in output matrix Y. Formally, maxpool(Z) = Y, where m yt,i = max zm(t−1)+j,i j=1 (3) Our CNN implementation involves a progression of convolution, nonlinearity, and maxpooling. This is represented as one convolutional layer in the network, and we test up to 4 layer deep CNNs. The final layer involves a maxpool across the entire temporal domain so that we have a fixed-size vector which can be fed into a softmax classifier. 3 Figure 1 (a) shows our CNN model with two convolutional layers. The input one-hot encoded matrix is convolved with several filters (not shown) and fed through a ReLU nonlinearity to produce a matrix of convolution activations. We then perform a maxpool on the activation matrix. The output of the first maxpool is fed through another convolution, ReLU, and maxpooled across the entire length resulting in a vector. This vector is then transposed and fed through a linear and softmax layer for classification. 2.2 Recurrent Neural Network (RNN) Designed to handle sequential data, Recurrent neural networks (RNNs) have become the main neural model for tasks such as natural language understanding. The key advantage of RNNs over CNNs is that they are able to find long range patterns in the data which are highly dependent on the ordering of the sequence for the prediction task. Given an input matrix X of size T × nin , an RNN produces matrix H of size T × d, where d is the RNN embedding size. At each timestep t, an RNN takes an input column vector xt ∈ Rnin and the previous hidden state vector ht−1 ∈ Rd and produces the next hidden state ht by applying the following recursive operation: ht = σ(Wxt + Uht−1 + b), (4) where W, U, b are the trainable parameters of the model, and σ is an element-wise nonlinearity. Due to their recursive nature, RNNs can model the full conditional distribution of any sequential data and find dependencies over time, where each position in a sequence is a timestep on an imaginary time coordinate running in a certain direction. To handle the “vanishing gradients” problem of training basic RNNs on long sequences, Hochreiter and Schmidhuber [8] proposed an RNN variant called the Long Short-term Memory (LSTM) network (for simplicity, we refer to LSTMs as RNNs in this paper), which can handle long term dependencies by using gating functions. These gates can control when information is written to, read from, and forgotten. Specifically, LSTM “cells” take inputs xt , ht−1 , and ct−1 , and produce ht , and ct : it = σ(Wi xt + Ui ht−1 + bi ) ft ot gt ct ht = σ(Wf xt + Uf ht−1 + bf ) = σ(Wo xt + Uo ht−1 + bo ) = tanh(Wg xt + Ug ht−1 + bg ) = ft ct−1 + it gt = ot tanh(ct ) where σ(·), tanh(·), and are element-wise sigmoid, hyperbolic tangent, and multiplication functions, respectively. it , ft , and ot are the input, forget, and output gates, respectively. RNNs produce an output vector ht at each timestep t of the input sequence. In order to use them on a classification task, we take the mean of all vectors ht , and use the mean vector hmean ∈ Rd as input to the softmax layer. Since there is no innate direction in genomic sequences, we use a bi-directional LSTM as our RNN model. In the bi-directional LSTM, the input sequence gets fed through two LSTM networks, one in each direction, and then the output vectors of each direction get concatenated together in the temporal direction and fed through a linear classifier. Figure 1 (b) shows our RNN model. The input one-hot encoded matrix is fed through an LSTM in both the forward and backward direction which each produce a matrix of column vectors representing the LSTM output embedding at each timestep. These vectors are then averaged to create one vector for each direction representing the LSTM output. The forward and backward output vectors are then concatenated and fed to the softmax for classification. 2.3 Convolutional-Recurrent Network (CNN-RNN) Considering convolutional networks are designed to extract motifs, and recurrent networks are designed to extract temporal features, we implement a combination of the two in order to find temporal patterns between the motifs. Given an input matrix X ∈ RT ×nin , the output of the CNN is Z ∈ RT ×nout . Each column vector of Z gets fed into the RNN one at a time in the same way that the one-hot encoded vectors get input to the regular RNN model. The resulting output of the RNN H ∈ RT ×d , where d is the LSTM embedding size, is then averaged across the temporal domain (in the same way as the regular RNN), and fed to a softmax classifier. Figure 1 (c) shows our CNN-RNN model. The input one-hot encoded matrix is fed through one layer of convolution to produce a convolution activation matrix. This matrix is then input to the LSTM, as done in the regular RNN model from the original one-hot matrix. The output of the LSTM is averaged, concatenated, and fed to the softmax, similar to the RNN. 4 3 Visualizing and Understanding Deep Models The previous section explained the deep models we use for the TFBS classification task, where we can evaluate which models perform the best. While making accurate predictions is important in biomedical tasks, it is equally important to understand why models make their predictions. Accurate, but uninterpretable models are often very slow to emerge in practice due to the inability to understand their predictions, making biomedical domain experts reluctant to use them. Consequently, we aim to obtain a better understanding of why certain models work better than others, and investigate how they make their predictions by introducing several visualization techniques. The proposed DeMo Dashboard allows us visualize and understand DNNs in three different ways: Saliency Maps, Temporal Output Scores, and Class Optimizations. 3.1 Saliency Maps For a certain DNA sequence and a model’s classification, a logical question may be: “which which parts of the sequence are most influential for the classification?” To do this, we seek to visualize the influence of each position (i.e. nucleotide) on the prediction. Our approach is similar to the methods used on images by Simonyan et al.[21] and Baehrens et al.[4]. Given a sequence X0 of length |X0 |, and class c ∈ C, a DNN model provides a score function Sc (X0 ). We rank the nucleotides of X0 based on their influence on the score Sc (X0 ). Since Sc (X) is a highly non-linear function of X with deep neural nets, it is hard to directly see the influence of each nucleotide of X on Sc . Mathematically, around the point X0 , Sc (X) can be approximated by a linear function by computing the first-order Taylor expansion: |X| X T Sc (X) ≈ w X + b = wi xi + b (5) i=1 where w is the derivative of Sc with respect to the sequence variable X at the point X0 : w= ∂Sc ∂X = saliency map (6) X0 This derivative is simply one step of backpropagation in the DNN model, and is therefore easy to compute. We do a pointwise multiplication of the saliency map with the one-hot encoded sequence to get the derivative values for the actual nucleotide characters of the sequence (A,T,C, or G) so we can see the influence of the character at each position on the output score. Finally, we take the element-wise magnitude of the resulting derivative vector to visualize how important each character is regardless of derivative direction. We call the resulting vector a “saliency map[21]” because it tells us which nucleotides need to be changed the least in order to affect the class score the most. As we can see from equation 5, the saliency map is simply a weighted sum of the input nucleotides, where the each weight, wi , indicates the influence of that nucleotide position on the output score. 3.2 Temporal Output Scores Since DNA is sequential (i.e. can be read in a certain direction), it can be insightful to visualize the output scores at each timestep (position) of a sequence, which we call the temporal output scores. Here we assume an imaginary time direction running from left to right on a given sequence, so each position in the sequence is a timestep in such an imagined time coordinate. In other words, we check the RNN’s prediction scores when we vary the input of the RNN. The input series is constructed by using subsequences of an input X running along the imaginary time coordinate, where the subsequences start from just the first nucleotide (position), and ends with the entire sequence X. This way we can see exactly where in the sequence the recurrent model changes its decision from negative to positive, or vice versa. Since our recurrent models are bi-directional, we also use the same technique on the reverse sequence. CNNs process the entire sequence at once, thus we can’t view its output as a temporal sequence, so we use this visualization on just the RNN and CNN-RNN. 3.3 Class Optimization The previous two visualization methods listed are representative of a specific testing sample (i.e. sequence-specific). Now we introduce an approach to extract a class-specific visualization for a DNN model, where we attempt to find the best sequence which maximizes the probability of a positive TFBS, which we call class optimization. Formally, we optimize the following equation where S+ (X) is the probability (or score) of an input sequence X (matrix in our case) being a positive TFBS computed by the softmax equation of our trained DNN model for a specific TF: arg max S+ (X) + λkXk22 X 5 (7) where λ is the regularization parameter. We find a locally optimal X through stochastic gradient descent, where the optimization is with respect to the input sequence. In this optimization, the model weights remain unchanged. This is similar to the methods used in Simonyan et al.[21] to optimize toward a specific image class. This visualization method depicts the notion of a positive TFBS class for a particular TF and is not specific to any test sequence. 3.4 End-to-end Automatic Motif Extraction from the Dashboard Our three proposed visualization techniques allow us to manually inspect how the models make their predictions. In order to automatically find patterns from the techniques, we also propose methods to extract motifs, or consensus subsequences that represent the positive binding sites. We extract motifs from each of our three visualization methods in the following ways: (1) From each positive test sequence (thus, 500 total for each TF dataset) we extract a motif from the saliency map by selecting the contiguous length-9 subsequence that achieves the highest sum of contiguous length-9 saliency map values. (2) For each positive test sequence, we extract a motif from the temporal output scores by selecting the length-9 subsequence that shows the strongest score change from negative to positive output score. (3) For each different TF, we can directly use the class-optimized sequence as a motif. 3.5 Connecting to Previous Studies Neural networks have produced state-of-the-art results on several important benchmark tasks related to genomic sequence classification [2, 27, 19], making them a good candidate to use. However, why these models work well has been poorly understood. Recent works have attempted to uncover the properties of these models, in which most of the work has been done on understanding image classifications using convolutional neural networks. Zeiler and Fergus [26] used a “deconvolution” approach to map hidden layer representations back to the input space for a specific example, showing the features of the image which were important for classification. Simonyan et al.[21] explored a similar approach by using a first-order Taylor expansion to linearly approximate the network and find the input features most relevant, and also tried optimizing image classes. Many similar techniques later followed to understand convolutional models [17, 3]. Most importantly, researchers have found that CNNs are able to extract layers of translational-invariant feature maps, which may indicate why CNNs have been successfully used in genomic sequence predictions which are believed to be triggered by motifs. On text-based tasks, there have been fewer visualization studies for DNNs. Karpathy et al.[10] explored the interpretability of RNNs for language modeling and found that there exist interpretable neurons which are able to focus on certain language structure such as quotes. Li et al.[15] visualized how RNNs achieve compositionality in natural language for sentiment analysis by visualizing RNN embedding vectors as well as measuring the influence of input words on classification. Both studies show examples that can be validated by our understanding of natural language linguistics. Contrarily, we are interested in understanding DNA “linguistics” given DNNs (the opposite direction of Karpathy et al.[10] and Li et al.[15]). The main difference between our work and previous works on images and natural language is that instead of trying to understand the DNNs given human understanding of such human perception tasks, we attempt to uncover critical signals in DNA sequences given our understanding of DNNs. For TFBS prediction, Alipanahi et al.[2] was the first to implement a visualization method on a DNN model. They visualize their CNN model by extracting motifs based on the input subsequence corresponding to the strongest activation location for each convolutional filter (which we call convolution activation). Since they only have one convolutional layer, it is trivial to map the activations back, but this method does not work as well with deeper models. We attempted this technique on our models and found that our approach using saliency maps outperforms it in finding motif patterns (details in section 4). Quang and Xie [19] use the same visualization method on their convolutional-recurrent model for noncoding variant prediction. 4 4.1 Experiments and Results Experimental Setup Dataset. In order to evaluate our DNN models and visualizations, we train and test on the 108 K562 cell ENCODE ChIP-Seq TF datasets used in Alipanahi et al.[2]. Each TF dataset has an average of 30,819 training sequences (with an even positive/negative split), and each sequence consists of 101 DNA-base characters (A,C,G,T). Every dataset has 1,000 testing sequences (with an even positive/negative split). Positive sequences are extracted from the hg19 genome centered at the reported ChIP-Seq peak. Negative sequences are generated by dinucleotide-preserving 6 Table 1: Variations of DNN Model Hyperparameters Conv. Conv. Conv. filter Conv. Pool Model Layers Size (nout ) Sizes (k) Size (m) Small RNN N/A N/A N/A N/A Medium RNN N/A N/A N/A N/A Large RNN N/A N/A N/A N/A Small CNN 2 64 9,5 2 Medium CNN 3 64 9,5,3 2 Large CNN 4 64 9,5,3,3 2 Small CNN-RNN 1 64 5 N/A Medium CNN-RNN 1 128 9 N/A Large CNN-RNN 2 128 9,5 2 LSTM Layers 1 1 2 N/A N/A N/A 2 1 1 LSTM Size (d) 16 32 32 N/A N/A N/A 32 32 32 Table 2: Mean AUC scores on the TFBS classification task Model MEME-ChIP [16] DeepBind [2] (CNN) Small RNN Med RNN Large RNN Small CNN Med CNN Large CNN Small CNN-RNN Med CNN-RNN Large CNN-RNN Mean AUC 0.834 0.903 0.860 0.876 0.808 0.896 0.902 0.880 0.917 0.925 0.918 Median AUC 0.868 0.931 0.881 0.905 0.860 0.918 0.922 0.890 0.943 0.947 0.944 STDEV 0.127 0.091 106 0.116 0.175 0.098 0.085 0.093 0.079 0.073 0.081 Table 3: AUC pairwise t-test Model Comparison3 RNN vs MEME CNN vs MEME CNN-RNN vs MEME CNN vs RNN CNN-RNN vs RNN CNN-RNN vs CNN p-value 5.15E-05 1.87E-19 4.84E-24 5.08E-04 7.99E-10 4.79E-22 shuffle of the positive sequences. Due to the separate train/test data for each TF, we train a separate model for each individual TF dataset. Variations of DNN Models. We implement several variations of each DNN architecture by varying hyperparameters. Table 1 shows the different hyperparameters in each architecture. We trained many different hyperparameters for each architecture, but we show the best performing model for each type, surrounded by a larger and smaller version to show that it isn’t underfitting or overfitting. Baselines. We use the “MEME-ChIP [16] sum” results from Alipanahi et al.[2] as one prediction performance baseline. These results are from applying MEME-ChIP to the top 500 positive training sequences, deriving five PWMs, and scoring test sequences using the sum of scores using all five PWMs. We also compare against the CNN model proposed in Alipanahi et al.[2]. To evaluate motif extraction, we compare against the “convolution activation” method used in Alipanahi et al.[2] and Quang and Xie [19], where we map the strongest first layer convolution filter activation back to the input sequence to find the most influential length-9 subsequence. 4.2 TFBS Prediction Performance of DNN Models Table 2 shows the mean area under the ROC curve (AUC) scores for each of the tested models (from Table 1). As expected, the CNN models outperform the standard RNN models. This validates our hypothesis that positive binding sites are mainly triggered by local patterns or “motifs” that CNNs can easily find. Interestingly, the CNN-RNN achieves the best performance among the three deep architectures. To check the statistical significance of such comparisons, we apply a pairwise t-test using the AUC scores for each TF and report the two tailed p-values in Table 3. We apply the t-test on each of the best performing (based on AUC) models for each model type. All deep models are significantly better than the MEME baseline. The CNN is significantly better than the RNN and the CNN-RNN is significantly better than the CNN. In order to understand why the CNN-RNN performs the best, we turn to the dashboard visualizations. 7 Figure 2: DeMo Dashboard. Dashboard examples for GATA1, MAFK, and NFYB positive TFBS Sequences. The top section of the dashboard contains the Class Optimization (which does not pertain to a specific test sequence, but rather the class in general). The middle section contains the Saliency Maps for a specific positive test sequence, and the bottom section contains the temporal Output Scores for the same positive test sequence used in the saliency map. The very top contains known JASPAR motifs, which are highlighted by pink boxes in the test sequences if they contain motifs. 8 Table 4: JASPAR motif matches against DeMo Dashboard and baseline motif finding methods using Tomtom Saliency Map Conv. Activations[2, 19] Temporal Output Class Optimization (out of 500) (out of 500) (out of 500) (out of 57) CNN 243.9 173.4 N/A 19 RNN 138.6 N/A 53.5 11 CNN-RNN 168.1 74.2 113.2 13 4.3 Understanding DNNs Using the DeMo Dashboard To evaluate the dashboard visualization methods, we first manually inspect the dashboard visualizations to look for interpretable signals. Figure 2 shows examples of the DeMo Dashboard for three different TFs and positive TFBS sequences. We apply the visualizations on the best performing models of each of the three DNN architectures. Each dashboard snapshot is for a specific TF and contains (1) JASPAR[18] motifs for that TF, which are the “gold standard” motifs generated by biomedical researchers, (2) the positive TFBS class-optimized sequence for each architecture (for the given TF of interest), (3) the positive TFBS test sequence of interest, where the JASPAR motifs in the test sequences are highlighted using a pink box, (4) the saliency map from each DNN model on the test sequence, and (5) forward and backward temporal output scores from the recurrent architectures on the test sequence. In the saliency maps, the more red a position is, the more influential it is for the prediction. In the temporal outputs, blue indicates a negative TFBS prediction while red indicates positive. The saliency map and temporal output visualizations are on the same positive test sequence (as shown twice). The numbers next to the model names in the saliency map section indicate the score outputs of that DNN model on the specified test sequence. Saliency Maps (middle section of dashboard). By visual inspection, we can see from the saliency maps that CNNs tend to focus on short contiguous subsequences when predicting positive bindings. In other words, CNNs clearly model “motifs” that are the most influential for prediction. The saliency maps of RNNs tend to be spread out more across the entire sequence, indicating that they focus on all nucleotides together, and infer relationships among them. The CNN-RNNs have strong saliency map values around motifs, but we can also see that there are other nucleotides further away from the motifs that are influential for the model’s prediction. For example, the CNN-RNN model is 99% confident in its GATA1 TFBS prediction, but the prediction is also influenced by nucleotides outside the motif. In the MAFK saliency maps, we can see that the CNN-RNN and RNN focus on a very wide range of nucleotides to make their predictions, and the RNN doesn’t even focus on the known JASPAR motif to make its high confidence prediction. Temporal Output Scores (bottom section of dashboard). For most of the sequences that we tested, the positions that trigger the model to switch from a negative TFBS prediction to positive are near the JASPAR motifs. We did not observe clear differences between the forward and backward temporal output patterns. In certain cases, it’s interesting to look at the temporal output scores and saliency maps together. An important case study from our examples is the NFYB example, where the CNN and RNN perform poorly, but the CNN-RNN makes the correct prediction. We observe that the CNN-RNN is able to switch its classification from negative to positive, while the RNN never does. To understand why this may have happened, we can see from the saliency maps that the CNN-RNN focuses on two distinct regions, one of which is where it flips its classification from negative to positive. However, the RNN doesn’t focus on either of the same areas, and may be the reason why it’s never able to classify it as a positive sequence. The fact that the CNN is not able to classify it as a positive sequence, but focuses on the same regions as the CNN-RNN (from the saliency map), may indicate that it is the temporal dependencies between these regions which influence the binding. In addition, the fact that there is no clear JASPAR motif in this sequence may show that the traditional motif approach is not always the best way to model TFBSs. Class Optimization (top section of dashboard). Class optimization on the CNN model generates concise representations which often resemble the known motifs for that particular TF. For the recurrent models, the TFBS positive optimizations are less clear, though some aspects stand out (like “AT” followed by “TC” in the GATA1 TF for the CNN-RNN). We notice that for certain DNN models, their class optimized sequences optimize the reverse complement motif (e.g. NFYB CNN optimization). The class optimizations can be useful for getting a general idea of what triggers a positive TFBS for a certain TF. Automatic Motif Extraction from Dashboard. In order to evaluate each DNN’s capability to automatically extract motifs, we compare the found motifs of each method (introduced in section 3.4) to the corresponding JASPAR motif, for the TF of interest. We do the comparison using the Tomtom[7] tool, which searches a query motif against a given motif database (and their reverse complements), and returns significant matches ranked by p-value indicating 9 motif-motif similarity. Table 4 summarizes the motif matching results comparing visualization-derived motifs against known motifs in the JASPAR database. We are limited to a comparison of 57 out of our 108 TF datasets by the TFs which JASPAR has motifs for. We compare four visualization approaches: Saliency Map, Convolution Activation[2, 19], Temporal Output Scores and Class Optimizations. The first three techniques are sequence specific, therefore we report the average number of motif matches out of 500 positive sequences (then averaged across 57 TF datasets). The last technique is for a particular TFBS positive class. We can see from Table 4 that across multiple visualization techniques, the CNN finds motifs the best, followed by the CNN-RNN and the RNN. However, since CNNs perform worse than CNN-RNNs by AUC scores, we hypothesize that this demonstrates that it is also important to model sequential interactions among motifs. In the CNN-RNN combination, CNN acts like a “motif finder” and the RNN finds dependencies among motifs. This analysis shows that visualizing the DNN classifications can lead to a better understanding of DNNs for TFBSs. 5 Conclusions and Future Work Deep neural networks (DNNs) have shown to be the most accurate models for TFBS classification. However, DNN models are hard to interpret, and thus their adaptation in practice is slow. In this work, we propose the Deep Motif (DeMo) Dashboard to explore three different DNN architectures on TFBS prediction, and introduce three visualization methods to shed light on how these models work. Although our visualization methods still require a human practitioner to examine the dashboard, it is a start to understand these models and we hope that this work will invoke further studies on visualizing and understanding DNN based genomic sequences analysis. Furthermore, DNN models have recently shown to provide excellent results for epigenomic analysis [22]. We plan to extend our DeMo Dashboard to related applications. References [1] Dashboard definiton. http://www.dictionary.com/browse/dashboard. Accessed: 2016-07-20. [2] Babak Alipanahi, Andrew Delong, Matthew T Weirauch, and Brendan J Frey. Predicting the sequence specificities of dna-and rna-binding proteins by deep learning. Nature Publishing Group, 2015. [3] Sebastian Bach, Alexander Binder, Grégoire Montavon, Frederick Klauschen, Klaus-Robert Müller, and Wojciech Samek. On pixel-wise explanations for non-linear classifier decisions by layer-wise relevance propagation. volume 10, page e0130140, 2015. [4] David Baehrens, Timon Schroeter, Stefan Harmeling, Motoaki Kawanabe, Katja Hansen, and Klaus-Robert MÞller. How to explain individual classification decisions. volume 11, pages 1803–1831, 2010. [5] ENCODE Project Consortium et al. An integrated encyclopedia of dna elements in the human genome. volume 489, pages 57–74. Nature Publishing Group, 2012. [6] Mahmoud Ghandi, Dongwon Lee, Morteza Mohammad-Noori, and Michael A Beer. Enhanced regulatory sequence prediction using gapped k-mer features. 2014. [7] Shobhit Gupta, John A Stamatoyannopoulos, Timothy L Bailey, and William S Noble. Quantifying similarity between motifs. volume 8, page R24. BioMed Central Ltd, 2007. [8] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. volume 9, pages 1735–1780. MIT Press, 1997. [9] Paul B Horton and Minoru Kanehisa. An assessment of neural network and statistical approaches for prediction of e. coli promoter sites. volume 20, pages 4331–4338. Oxford Univ Press, 1992. [10] Andrej Karpathy, Justin Johnson, and Fei-Fei Li. Visualizing and understanding recurrent networks. 2015. [11] David R Kelley, Jasper Snoek, and John L Rinn. Basset: Learning the regulatory code of the accessible genome with deep convolutional neural networks. Cold Spring Harbor Lab, 2016. [12] Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. 2014. [13] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pages 1097–1105, 2012. [14] Jack Lanchantin, Ritambhara Singh, Zeming Lin, and Yanjun Qi. Deep motif: Visualizing genomic sequence classifications. 2016. [15] Jiwei Li, Xinlei Chen, Eduard Hovy, and Dan Jurafsky. Visualizing and understanding neural models in nlp. 2015. 10 [16] Philip Machanick and Timothy L Bailey. Meme-chip: motif analysis of large dna datasets. volume 27, pages 1696–1697. Oxford Univ Press, 2011. [17] Aravindh Mahendran and Andrea Vedaldi. Visualizing deep convolutional neural networks using natural pre-images. pages 1–23. Springer. [18] Anthony Mathelier, Oriol Fornes, David J Arenillas, Chih-yu Chen, Grégoire Denay, Jessica Lee, Wenqiang Shi, Casper Shyr, Ge Tan, Rebecca Worsley-Hunt, et al. Jaspar 2016: a major expansion and update of the open-access database of transcription factor binding profiles. page gkv1176. Oxford Univ Press, 2015. [19] Daniel Quang and Xiaohui Xie. Danq: a hybrid convolutional and recurrent deep neural network for quantifying the function of dna sequences. page 032821. Cold Spring Harbor Labs Journals, 2015. [20] Manu Setty and Christina S Leslie. Seqgl identifies context-dependent binding signals in genome-wide regulatory element maps. 2015. [21] Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. Deep inside convolutional networks: Visualising image classification models and saliency maps. 2013. [22] Ritambhara Singh, Jack Lanchantin, Gabriel Robins, and Yanjun Qi. Deepchrome: deep-learning for predicting gene expression from histone modifications. volume 32, pages i639–i648, 2016. [23] Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. volume 15, pages 1929–1958, 2014. [24] Gary D Stormo. Dna binding sites: representation and discovery. volume 16, pages 16–23. Oxford Univ Press, 2000. [25] 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. [26] Matthew D Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In Computer Vision–ECCV 2014, pages 818–833. Springer, 2014. [27] Jian Zhou and Olga G Troyanskaya. Predicting effects of noncoding variants with deep learning-based sequence model. volume 12, pages 931–934. Nature Publishing Group, 2015. 11
9cs.NE
arXiv:1708.05950v1 [math.CO] 20 Aug 2017 New extremal singly even self-dual codes of lengths 64 and 66 Damyan Anev∗, Masaaki Harada†and Nikolay Yankov‡ August 22, 2017 Abstract For lengths 64 and 66, we construct extremal singly even self-dual codes with weight enumerators for which no extremal singly even selfdual codes were previously known to exist. We also construct new 40 inequivalent extremal doubly even self-dual [64, 32, 12] codes with covering radius 12 meeting the Delsarte bound. 1 Introduction A (binary) [n, k] code C is a k-dimensional vector subspace of Fn2 , where F2 denotes the finite field of order 2. All codes in this note are binary. The parameter n is called the length of C. The weight wt(x) of a vector x is the number of non-zero components of x. A vector of C is a codeword of C. The minimum non-zero weight of all codewords in C is called the minimum weight of C. An [n, k] code with minimum weight d is called an [n, k, d] code. The dual code C ⊥ of a code C of length n is defined as C ⊥ = {x ∈ Fn2 | x · y = 0 for all y ∈ C}, where x · y is the standard inner product. A code C is called self-dual if C = C ⊥ . A self-dual code C is doubly ∗ Faculty of Mathematics and Informatics, Konstantin Preslavski University of Shumen, Shumen, 9712, Bulgaria. † Research Center for Pure and Applied Mathematics, Graduate School of Information Sciences, Tohoku University, Sendai 980–8579, Japan. ‡ Faculty of Mathematics and Informatics, Konstantin Preslavski University of Shumen, Shumen, 9712, Bulgaria. 1 even if all codewords of C have weight divisible by four, and singly even if there is at least one codeword x with wt(x) ≡ 2 (mod 4). It is known that a self-dual code of length n exists if and only if n is even, and a doubly even self-dual code of length n exists if and only if n is divisible by 8. Let C be a singly even self-dual code. Let C0 denote the subcode of C consisting of codewords x with wt(x) ≡ 0 (mod 4). The shadow S of C is defined to be C0⊥ \ C. Shadows for self-dual codes were introduced by Conway and Sloane [6] in order to give the largest possible minimum weight among singly even self-dual codes, and to provide restrictions on the weight enumerators of singly even self-dual codes. The largest possible minimum weights among singly even self-dual codes of length n were given for n ≤ 72 in [6]. The possible weight enumerators of singly even self-dual codes with the largest possible minimum weights were given in [6] and [7] for n ≤ 72. It is a fundamental problem to find which weight enumerators actually occur for the possible weight enumerators (see [6]). By considering the shadows, Rains [13] showed that the minimum weight d of a self-dual code of length n n n is bounded by d ≤ 4⌊ 24 ⌋ + 6 if n ≡ 22 (mod 24), d ≤ 4⌊ 24 ⌋ + 4 otherwise. A self-dual code meeting the bound is called extremal. The aim of this note is to construct extremal singly even self-dual codes with weight enumerators for which no extremal singly even self-dual codes were previously known to exist. More precisely, we construct extremal singly even self-dual [64, 32, 12] codes with weight enumerators W64,1 for β = 35, and W64,2 for β ∈ {19, 34, 42, 45, 50} (see Section 2 for W64,1 and W64,2 ). These codes are constructed as self-dual neighbors of extremal four-circulant singly even self-dual codes. We construct extremal singly even self-dual [66, 33, 12] codes with weight enumerators W66,1 for β ∈ {7, 58, 70, 91, 93}, and W66,3 for β ∈ {22, 23} (see Section 2 for W66,1 and W66,3 ). These codes are constructed from extremal singly even self-dual [64, 32, 12] codes by the method given in [14]. We also demonstrate that there are at least 44 inequivalent extremal doubly even self-dual [64, 32, 12] codes with covering radius 12 meeting the Delsarte bound. All computer calculations in this note were done with the help of the algebra software Magma [1] and the computer system Q-extensions [2]. 2 2 Weight enumerators of extremal singly even self-dual codes of lengths 64 and 66 The possible weight enumerators W64,i and S64,i of extremal singly even selfdual [64, 32, 12] codes and their shadows are given in [6]: ( W64,1 = 1 + (1312 + 16β)y 12 + (22016 − 64β)y 14 + · · · , S64,1 = y 4 + (β − 14)y 8 + (3419 − 12β)y 12 + · · · , ( W64,2 = 1 + (1312 + 16β)y 12 + (23040 − 64β)y 14 + · · · , S64,2 = βy 8 + (3328 − 12β)y 12 + · · · , where β are integers with 14 ≤ β ≤ 104 for W64,1 and 0 ≤ β ≤ 277 for W64,2 . Extremal singly even self-dual codes with weight enumerator W64,1 are known for   14, 16, 18, 20, 22, 24, 25, 26, 28, 29, 30, 32, β∈ 34, 36, 38, 39, 44, 46, 53, 59, 60, 64, 74 (see [4], [10], [11] and [16]). Extremal singly even self-dual codes with weight enumerator W64,2 are known for   0, 1, . . . , 41, 44, 48, 51, 52, 56, 58, 64, 65, 72, β∈ \ {19, 31, 34, 39} 80, 88, 96, 104, 108, 112, 114, 118, 120, 184 (see [4], [10], [16] and [18]). The possible weight enumerators W66,i and S66,i of extremal singly even self-dual [66, 33, 12] codes and their shadows are given in [7]:  W66,1 = 1 + (858 + 8β)y 12 + (18678 − 24β)y 14 + · · · , S66,1 = βy 9 + (10032 − 12β)y 13 + · · · ,  W66,2 = 1 + 1690y 12 + 7990y 14 + · · · , S66,2 = y + 9680y 13 + · · · ,  W66,3 = 1 + (858 + 8β)y 12 + (18166 − 24β)y 14 + · · · , S66,3 = y 5 + (β − 14)y 9 + (10123 − 12β)y 13 + · · · , where β are integers with 0 ≤ β ≤ 778 for W66,1 and 14 ≤ β ≤ 756 for W66,3 . Extremal singly even self-dual codes with weight enumerator W66,1 are known for β ∈ {0, 1, . . . , 92, 94, 100, 101, 115} \ {4, 7, 58, 70, 91} 3 (see [5], [8], [10], [17] and [18]). Extremal singly even self-dual codes with weight enumerator W66,2 are known (see [8] and [15]). Extremal singly even self-dual codes with weight enumerator W66,3 are known for β ∈ {24, 25, . . . , 92} \ {65, 68, 69, 72, 89, 91} (see [9], [10], [11] and [12]). 3 Extremal four-circulant singly even self-dual [64, 32, 12] codes An n × n circulant matrix has  r0  rn−1   ..  . r1 the following form: r1 r2 · · · rn−1 r0 r1 · · · rn−2 .. .. .. . . . r2 r3 · · · r0    ,  so that each successive row is a cyclic shift of the previous one. Let A and B be n × n circulant matrices. Let C be a [4n, 2n] code with generator matrix of the following form:   A B , (1) I2n B T AT where In denotes the identity matrix of order n and AT denotes the transpose of A. It is easy to see that C is self-dual if AAT + BB T = In . The codes with generator matrices of the form (1) are called four-circulant. Two codes are equivalent if one can be obtained from the other by a permutation of coordinates. In this section, we give a classification of extremal four-circulant singly even self-dual [64, 32, 12] codes. Our exhaustive search found all distinct extremal four-circulant singly even self-dual [64, 32, 12] codes, which must be checked further for equivalence to complete the classification. This was done by considering all pairs of 16 × 16 circulant matrices A and B satisfying the condition that AAT + BB T = I16 , the sum of the weights of the first rows of A and B is congruent to 1 (mod 4) and the sum of the weights is greater than or equal to 13. Since a cyclic shift of the first rows gives an equivalent code, we may assume without loss of generality 4 that the last entry of the first row of B is 1. Then our computer search shows that the above distinct extremal four-circulant singly even self-dual [64, 32, 12] codes are divided into 67 inequivalent codes. Proposition 1. Up to equivalence, there are 67 extremal four-circulant singly even self-dual [64, 32, 12] codes. We denote the 67 codes by C64,i (i = 1, 2, . . . , 67). For the 67 codes C64,i , the first rows rA (resp. rB ) of the circulant matrices A (resp. B) in generator matrices (1) are listed in Table 1. We verified that the codes C64,i have weight enumerator W64,2 , where β are also listed in Table 1. 4 Extremal self-dual [64, 32, 12] neighbors of C64,i Two self-dual codes C and C ′ of length n are said to be neighbors if dim(C ∩ C ′ ) = n/2 − 1. Any self-dual code of length n can be reached from any other by taking successive neighbors (see [6]). Since every self-dual code C of length n contains the all-one vector 1, C has 2n/2−1 − 1 subcodes D of codimension 1 containing 1. Since dim(D ⊥ /D) = 2, there are two self-dual codes rather than C lying between D ⊥ and D. If C is a singly even self-dual code of length divisible by 8, then C has two doubly even self-dual neighbors (see [3]). In this section, we construct extremal self-dual [64, 32, 12] codes by considering self-dual neighbors. For i = 1, 2, . . . , 67, we found all distinct extremal singly even self-dual neighbors of C64,i , which are equivalent to none of the 67 codes. Then we verified that these codes are divided into 385 inequivalent codes D64,i (i = 1, 2, . . . , 385). These codes D64,i are constructed as h(C64,j ∩ hxi⊥ ), xi. To save space, the values j, the supports supp(x) of x, the values (k, β) in the weight enumerators W64,k are listed in “http://www.math.is.tohoku.ac.jp/~ mharada/Paper/64-SE-d12.txt” for the 385 codes. For extremal singly even self-dual [64, 32, 12] codes with weight enumerators for which no extremal singly even self-dual codes were previously known to exist, j, supp(x) and (k, β) are list in Table 2. Hence, we have the following: Proposition 2. There is an extremal singly even self-dual [64, 32, 12] code with weight enumerator W64,1 for β = 35, and W64,2 for β ∈ {19, 34, 42, 45, 50}. 5 Table 1: Extremal four-circulant singly even self-dual [64, 32, 12] codes Codes C64,1 C64,2 C64,3 C64,4 C64,5 C64,6 C64,7 C64,8 C64,9 C64,10 C64,11 C64,12 C64,13 C64,14 C64,15 C64,16 C64,17 C64,18 C64,19 C64,20 C64,21 C64,22 C64,23 C64,24 C64,25 C64,26 C64,27 C64,28 C64,29 C64,30 C64,31 C64,32 C64,33 C64,34 C64,35 C64,36 C64,37 C64,38 C64,39 C64,40 C64,41 C64,42 C64,43 C64,44 C64,45 C64,46 C64,47 C64,48 C64,49 C64,50 rA (0000001100111111) (0000010101111101) (0000011001101111) (0000000001011111) (0000000010101111) (0000000011010111) (0000000011010111) (0000000011010111) (0000000110111111) (0000001001011101) (0000001100011111) (0000001100011111) (0000001100111011) (0000001101111111) (0000010000111101) (0000010001011111) (0000010110111011) (0000000100011111) (0000000100111101) (0000000110010111) (0000000111001111) (0000000111001111) (0000001000101111) (0000001011100011) (0000001011100011) (0000010010011111) (0000011001101111) (0000011011011111) (0000011011100111) (0000011101111111) (0000101110111111) (0000000000100111) (0000000001011011) (0000000100111111) (0000000101001011) (0000000101001011) (0000000110111111) (0000001001111111) (0000001100011111) (0000001100011111) (0000010001011111) (0000010001101111) (0000010011101111) (0000010101010111) (0000010101010111) (0000010101110111) (0000010101110111) (0000011011110111) (0000000001001011) (0000000001100111) 6 rB (0001011010101111) (0010011010111011) (0010110101011011) (0001001100101011) (0011011011110111) (0000100110011011) (0000101100010111) (0011101110101111) (0101101111111111) (0001000101011011) (0010101011011111) (0010111011011011) (0001101011101111) (0011101111011111) (0010111011011111) (0001110101101111) (0001101110001111) (0010111111110011) (0000101011000111) (0001001111111111) (0010101110111101) (0010110110111011) (0011101011110111) (0010101111110111) (0011011011111011) (0010110011101111) (0001001011011111) (0010010101011101) (0001011111001011) (0101101110110111) (0011101011110111) (0001011101101011) (0010010101101011) (0001001000101011) (0010010110011011) (0010011001011011) (0000001000100111) (0010101111001011) (0001010011111111) (0001110011110111) (0010101111001111) (0011001110101111) (0001011101100111) (0001010111101111) (0010110011111011) (0000101111110011) (0001011101101011) (0101101110111111) (0000111010110111) (0001001111100011) β 0 0 0 8 8 8 8 8 8 8 8 8 8 8 8 8 8 16 16 16 16 16 16 16 16 16 16 16 16 16 16 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 32 32 Table 1: Extremal four-circulant singly even self-dual [64, 32, 12] codes (continued) Codes C64,51 C64,52 C64,53 C64,54 C64,55 C64,56 C64,57 C64,58 C64,59 C64,60 C64,61 C64,62 C64,63 C64,64 C64,65 C64,66 C64,67 rA (0000001010111011) (0000010101011111) (0000010101111101) (0000011010111111) (0000101011101011) (0000000000100111) (0000000010101101) (0000001000011101) (0000001110011111) (0000011000111111) (0000011011001111) (0000100111011111) (0000001001101011) (0000000001011011) (0000010111011111) (0000101110011101) (0000000001011111) rB (0001011111100111) (0001101111000111) (0010110010110111) (0000101110011101) (0001011111001011) (0001011010111011) (0001001011011011) (0000100101111011) (0001010111101101) (0001010111101101) (0000101010111111) (0001010101011011) (0001010011001101) (0001011000101111) (0010100101011011) (0001000101111111) (0001011111110111) β 32 32 32 32 32 40 40 40 40 40 40 40 48 56 56 64 72 Now we consider the extremal doubly even self-dual neighbors of C64,i (i = 1, 2, 3). Since the shadow has minimum weight 12, the two doubly 1 2 even self-dual neighbors C64,i and C64,i are extremal doubly even self-dual [64, 32, 12] codes with covering radius 12 (see [4]). Thus, six extremal doubly even self-dual [64, 32, 12] codes with covering radius 12 are constructed. In addition, among the 385 codes D64,i (i = 1, 2, . . . , 385), the 19 extremal singly even self-dual codes D64,j have shadow of minimum weight 12, where j ∈ {1, 2, 12, 19, 22, 33, 44, 58, 66, 68, 84, 95, 108, 115, 136, 143, 191, 240, 254}. The constructions of the 19 codes D64,j are listed in Table 2. Their two 1 2 doubly even self-dual neighbors D64,j and D64,j are extremal doubly even self-dual [64, 32, 12] codes with covering radius 12. We verified that there are 1 the following equivalent codes among the four codes in [4], the six codes C64,i , 2 1 2 C64,i and the 38 codes D64,j , D64,j , where 2 2 2 2 2 2 2 2 ∼ ∼ ∼ ∼ D64,22 , D64,33 , D64,44 , D64,136 , = D64,68 = D64,84 = D64,95 = D64,143 where C ∼ = D means that C and D are equivalent, and there is no other pair of equivalent codes. Therefore, we have the following proposition. Proposition 3. There are at least 44 inequivalent extremal doubly even selfdual [64, 32, 12] codes with covering radius 12 meeting the Delsarte bound. 7 Table 2: Extremal singly even self-dual [64, 32, 12] neighbors Codes D64,138 D64,270 D64,283 D64,293 D64,314 D64,329 D64,1 D64,2 D64,12 D64,19 D64,22 D64,33 D64,44 D64,58 D64,66 D64,68 D64,84 D64,95 D64,108 D64,115 D64,136 D64,143 D64,191 D64,240 D64,254 D64,14 D64,383 j 24 49 52 56 64 65 1 1 4 4 4 6 6 8 8 8 13 13 15 16 21 26 35 47 48 4 67 supp(x) {1, 2, 3, 38, 42, 43, 45, 46, 48, 54, 56, 57} {1, 2, 8, 32, 38, 41, 48, 49, 50, 53, 55, 61} {1, 2, 4, 33, 36, 37, 41, 43, 46, 51, 61, 64} {3, 7, 9, 10, 11, 37, 43, 53, 57, 58, 62, 64} {6, 8, 26, 37, 38, 40, 43, 46, 48, 59, 61, 63} {1, 6, 8, 9, 37, 47, 50, 52, 57, 60, 63, 64} {4, 7, 9, 34, 38, 40, 45, 46, 47, 50, 51, 53} {3, 37, 38, 47, 48, 50, 52, 53, 54, 59, 60, 63} {2, 4, 5, 16, 17, 38, 40, 46, 56, 57, 60, 62} {2, 3, 6, 7, 9, 35, 41, 49, 55, 56, 57, 61} {2, 33, 34, 35, 38, 39, 42, 45, 48, 52, 61, 62} {8, 9, 10, 16, 17, 33, 44, 45, 54, 55, 59, 61} {1, 3, 6, 33, 36, 38, 39, 45, 47, 55, 57, 59} {1, 3, 5, 16, 17, 35, 36, 38, 42, 44, 54, 59} {4, 6, 9, 34, 36, 39, 41, 42, 48, 51, 57, 63} {3, 6, 9, 33, 36, 37, 38, 49, 56, 57, 60, 62} {1, 4, 5, 35, 37, 38, 41, 44, 53, 60, 61, 62} {2, 4, 9, 34, 35, 40, 42, 47, 49, 52, 59, 64} {2, 16, 17, 37, 43, 48, 49, 52, 54, 57, 58, 64} {1, 3, 6, 7, 8, 41, 45, 46, 49, 50, 57, 60} {3, 16, 17, 33, 34, 37, 42, 44, 47, 51, 52, 56} {1, 2, 9, 34, 37, 38, 41, 48, 57, 58, 59, 64} {1, 2, 6, 8, 10, 33, 37, 46, 54, 59, 60, 63} {2, 4, 7, 9, 13, 16, 17, 44, 56, 59, 62, 64} {1, 2, 5, 7, 8, 35, 36, 37, 45, 47, 49, 63} {1, 7, 8, 35, 36, 37, 41, 43, 46, 49, 51, 53} {1, 33, 34, 36, 37, 38, 40, 41, 47, 49, 50, 53, 55, 59, 61, 63} 8 (k, β) (2, 19) (1, 35) (2, 42) (2, 34) (2, 50) (2, 45) (2, 0) (2, 0) (2, 0) (2, 0) (2, 0) (2, 0) (2, 0) (2, 0) (2, 0) (2, 0) (2, 0) (2, 0) (2, 0) (2, 0) (2, 0) (2, 0) (2, 0) (2, 0) (2, 0) (1, 14) (2, 40) 1 2 In order to distinguish two doubly even neighbors D64,i and D64,i (i = 68, 84, 95, 143), we list in Table 3 the supports supp(x) for the 8 codes, where 1 2 D64,i and D64,i are constructed as h(D64,i ∩ hxi⊥ ), xi. Table 3: Extremal doubly even self-dual [64, 32, 12] neighbors Codes 1 D64,68 2 D64,68 1 D64,84 2 D64,84 1 D64,95 2 D64,95 1 D64,143 2 D64,143 5 supp(x) {1, 4, 7, 34, 35, 36, 47, 54, 55, 58, 60, 63} {1, 4, 5, 6, 30, 42, 45, 47, 54, 56, 58, 64} {16, 17, 33, 39, 43, 46, 48, 49, 51, 54, 58, 64} {1, 2, 6, 33, 35, 38, 40, 42, 52, 57, 59, 60} {1, 2, 6, 33, 35, 38, 40, 42, 52, 57, 59, 60} {3, 33, 38, 41, 45, 47, 51, 53, 58, 60, 62, 64} {1, 4, 10, 40, 43, 46, 52, 54, 58, 61, 62, 63} {1, 31, 34, 42, 44, 45, 46, 50, 51, 52, 54, 62} Four-circulant singly even self-dual [64, 32, 10] codes and self-dual neighbors Using an approach similar to that given in Section 3, our exhaustive search found all distinct four-circulant singly even self-dual [64, 32, 10] codes. Then our computer search shows that the distinct four-circulant singly even selfdual [64, 32, 10] codes are divided into 224 inequivalent codes. Proposition 4. Up to equivalence, there are 224 four-circulant singly even self-dual [64, 32, 10] codes. We denote the 224 codes by E64,i (i = 1, 2, . . . , 224). For the codes, the first rows rA (resp. rB ) of the circulant matrices A (resp. B) in generator matrices (1) can be obtained from “http://www.math.is.tohoku.ac.jp/~ mharada/Paper/64-4cir-d10.txt”. The following method for constructing self-dual neighbors was given in [4]. For C = E64,i (i = 1, 2, . . . , 224), let M be a matrix whose rows are the codewords of weight 10 in C. Suppose that there is a vector x of even weight such that MxT = 1T . (2) 9 Then C 0 = hxi⊥ ∩ C is a subcode of index 2 in C. We have self-dual neighbors hC 0 , xi and hC 0 , x + yi of C for some vector y ∈ C \ C 0 , which have no codeword of weight 10 in C. When C has a self-dual neighbor C ′ with minimum weight 12, there is a vector x satisfying (2) and we can obtain C ′ in this way. For i = 1, 2, . . . , 224, we verified that there is a unique vector satisfying (2) and C has two self-dual neighbors, where C 0 is a doubly even [64, 31, 12] code. In this case, the two neighbors are automatically doubly even. Hence, we have the following: Proposition 5. There is no extremal singly even self-dual [64, 32, 12] neighbor of E64,i for i = 1, 2, . . . , 224. 6 Extremal singly even self-dual [66, 33, 12] codes The following method for constructing singly even self-dual codes was given in [14]. Let C be a self-dual code of length n. Let x be a vector of odd weight. Let C 0 denote the subcode of C consisting of all codewords which ⊥ are orthogonal to x. Then there are cosets C 1 , C 2 , C 3 of C 0 such that C 0 = C 0 ∪ C 1 ∪ C 2 ∪ C 3 , where C = C 0 ∪ C 2 and x + C = C 1 ∪ C 3 . It was shown in [14] that C(x) = (0, 0, C 0) ∪ (1, 1, C 2) ∪ (1, 0, C 1) ∪ (0, 1, C 3) (3) is a self-dual code of length n + 2. In this section, we construct new extremal singly even self-dual codes of length 66 using this construction from the extremal singly even self-dual [64, 32, 12] codes obtained in Sections 3 and 4. Our exhaustive search shows that there are 1166 inequivalent extremal singly even self-dual [66, 33, 12] codes constructed as the codes C(x) in (3) from the codes C64,i (i = 1, 2, . . . , 67). 1157 codes of the 1166 codes have weight enumerator W66,1 for β ∈ {7, 8, . . . , 92}\{9, 11}, 3 of them have weight enumerator W66,3 for β ∈ {30, 49, 54}, and 6 of them have weight enumerator W66,2 . Extremal singly even self-dual [66, 33, 12] codes with weight enumerator W66,1 for β ∈ {7, 58, 70, 91} are constructed for the first time. For the four weight enumerators W , as an example, codes C66,i with weight enumerators W are given (i = 1, 2, 3, 4). We list in Table 4 the values β in W , the codes C and the vectors x = (x1 , x2 , . . . , x32 ) of C(x) in (3), where xj = 1 (j = 33, . . . , 64). By applying the construction given in (3) to D64,i , we found more extremal singly even self-dual [66, 33, 12] codes D66,j with weight enumerators for which 10 Table 4: Extremal singly even self-dual [66, 33, 12] codes Codes C66,1 C66,2 C66,3 C66,4 D66,1 D66,2 D66,3 β 7 58 70 91 22 23 93 W W66,1 W66,1 W66,1 W66,1 W66,3 W66,3 W66,1 C C64,1 C64,56 C64,66 C64,67 D64,14 D64,14 D64,383 (x1 , . . . , x32 ) (01101101101010010111111010101100) (00001101100000011000110000011100) (00100110011011001001011100000010) (00001110110111110000011101000010) (10100011100100110111101010011111) (10111100111100000100101000100011) (10100101011110010011001101001101) no extremal singly even self-dual codes were previously known to exist. For the codes D66,j , we list in Table 4 the values β in the weight enumerators W , the codes C and the vectors x = (x1 , x2 , . . . , x32 ) of C(x) in (3), where xi = 1 (i = 33, . . . , 64). Hence, we have the following: Proposition 6. There is an extremal singly even self-dual [66, 33, 12] code with weight enumerator W66,1 for β ∈ {7, 58, 70, 91, 93}, and weight enumerator W66,3 for β ∈ {22, 23}. Remark 7. The code D66,1 has the smallest value β among known extremal singly even self-dual [66, 33, 12] codes with weight enumerator W66,3 . Acknowledgment. This work was supported by JSPS KAKENHI Grant Number 15H03633. References [1] W. Bosma, J. Cannon and C. Playoust, The Magma algebra system I: The user language, J. Symbolic Comput. 24 (1997), 235–265. [2] I. Bouyukliev, About the code equivalence, in Advances in Coding Theory and Cryptography, Ser. Coding Theory Cryptol., 3, World Sci. Publ., Hackensack, NJ, 2007, pp. 126–151. [3] R. Brualdi and V. Pless, Weight enumerators of self-dual codes, IEEE Trans. Inform. Theory 37 (1991), 1222–1225. 11 [4] N. Chigira, M. Harada and M. Kitazume, Extremal self-dual codes of length 64 through neighbors and covering radii, Des. Codes Cryptogr. 42 (2007), 93–101. [5] P. Çomak, J.L. Kim and F. Özbudak, New cubic self-dual codes of length 54, 60 and 66, (preprint), arXiv:1706.07631. [6] J.H. Conway and N.J.A. Sloane, A new upper bound on the minimal distance of self-dual codes, IEEE Trans. Inform. Theory 36 (1990), 1319– 1333. [7] S.T. Dougherty, T.A. Gulliver and M. Harada, Extremal binary self-dual codes, IEEE Trans. Inform. Theory 43 (1997), 2036–2047. [8] M. Harada, T. Nishimura and R. Yorgova, New extremal self-dual codes of length 66, Math. Balkanica (N.S.) 21 (2007), 113–121. [9] S. Karadeniz and B. Yildiz, New extremal binary self-dual codes of length 66 as extensions of self-dual codes over Rk , J. Franklin Inst. 350 (2013), 1963–1973. [10] A. Kaya, New extremal binary self-dual codes of lengths 64 and 66 from R2 -lifts, Finite Fields Appl. 46 (2017), 271–279. [11] A. Kaya, B. Yildiz and A. Pasa, New extremal binary self-dual codes from a modified four circulant construction, Discrete Math. 339 (2016), 1086–1094. [12] A. Kaya, B. Yildiz and I. Siap, New extremal binary self-dual codes from F4 + uF4 -lifts of quadratic circulant codes over F4 , Finite Fields Appl. 35 (2015), 318–329. [13] E.M. Rains, Shadow bounds for self-dual codes, IEEE Trans. Inform. Theory 44 (1998), 134–139. [14] H.-P. Tsai, Existence of certain extremal self-dual codes, IEEE Trans. Inform. Theory 38 (1992), 501–504. [15] H.-P. Tsai, Extremal self-dual codes of lengths 66 and 68, IEEE Trans. Inform. Theory 45 (1999), 2129–2133. 12 [16] N. Yankov, Self-dual [62, 31, 12] and [64, 32, 12] codes with an automorphism of order 7, Adv. Math. Commun. 8 (2014), 73–81. [17] N. Yankov, M.H. Lee, M. Gürel and M. Ivanova, Self-dual codes with an automorphism of order 11, IEEE Trans. Inform. Theory 61 (2015), 1188–1193. [18] N. Yankov, M.H. Lee and M. Ivanova, Self-dual codes with an automorphism of order 7 and s-extremal codes of length 68, Finite Fields Appl., (submitted). 13
7cs.IT
N O FAQ: Synthesizing Command Repairs from Examples arXiv:1608.08219v1 [cs.PL] 29 Aug 2016 Loris D’Antoni Rishabh Singh Michael Vaughn University of Wisconsin-Madison Microsoft Research University of Wisconsin-Madison [email protected] [email protected] [email protected] Abstract ing with a CLI. If after typing a command a user receives an error message, T HE F XXX uses a set of hard-coded rules to suggest possible fixes to the user’s command. Each rule pattern-matches against the input command and the error message, and uses these inputs to produce a possible fixed command. Typical fixes include adding missing flags, creating a missing directory, or changing file extensions. T HE F XXX has become extremely popular and, on GitHub, it has already been starred by more than 20,000 users and has been forked more than 1000 times. Despite its success, the tool also has a main limitation: to add a new rule a developer first needs to understand the syntax and precise semantics of T HE F XXX and then manually hard-code the rule into the tool. Due to this complexity, newly added rules have at times caused non-terminating or unexpected behaviors2 . Command-line tools are confusing and hard to use for novice programmers due to their cryptic error messages and lack of documentation. Novice users often resort to online help-forums for finding corrections to their buggy commands, but have a hard time in searching precisely for posts that are relevant to their problem and then applying the suggested solutions to their buggy command. We present a tool N O FAQ that uses a set of rules to suggest possible fixes when users write buggy commands that trigger commonly occurring errors. The rules are expressed in a language called F IXIT and each rule pattern-matches against the user’s buggy command and the corresponding error message, and uses these inputs to produce a possible fixed command. Our main contribution is an algorithm based on lazy VSA for synthesizing F IXIT rules from examples of buggy and repaired commands. The algorithm allows users to add new rules in N O FAQ without having to manually encode them. We present the evaluation of N O FAQ on 92 benchmark problems and show that N O FAQ is able to instantly synthesize rules for 81 benchmark problems in real time using just 2 to 5 input-output examples for each rule. 1. Synthesizing repairs from examples Inspired by the success and limitations of T HE F XXX, we built N O FAQ (No more Frequently Asked Questions), a tool for automatically addressing common errors in CLIs. N O FAQ also uses a set of rules for fixing common errors, but it differs from T HE F XXX in the following key aspects: 1. Rules are encoded in a declarative domain-specific language (DSL) called F IXIT. Introduction 2. To add new rules, users only provide examples of buggy and repaired commands and N O FAQ automatically synthesizes the desired F IXIT rules that are consistent with the given examples. Command-Line Interfaces (CLI) let users interact with a computing system by writing sequences of commands. CLIs are especially popular amongst advanced computer users, who use them to perform small routine tasks such as committing a file to a repository with version control, installing software packages, compiling source code, finding and searching for files etc. Even though this mode of interaction is getting replaced by more natural graphical user interfaces, CLIs are still routinely used for most scripting tasks in Unix and Mac OS. Even the Windows operating system now officially provides complex command-line interfaces with products such as Windows Powershell. Since command-line interactions often require complex parameters and flag settings for specifying the desired intent, non-expert users find CLIs challenging to use [3]. Moreover, after entering an incorrect input command, the user has to deal with cryptic errors that are hard to decipher by just looking at the verbose text-based documentation of the commands. For these reasons, users typically resort to online help-forums for finding corrections to their buggy commands. Unfortunately, this can also be problematic as users need to precisely search for posts that relate to the issues with their commands and then transform the suggested solutions to apply them in their context. Sometimes users also need to create a new post if no relevant post exists (or can be found), and then need to wait for hours or days to obtain a solution to their problem. We envision N O FAQ system being used by non-developers and end-users, who can easily extend the system by providing new examples of fixes. The long-term goal of the system is to learn from examples obtained from shell histories of thousands of users in an unsupervised manner. Although a developer can write similar rules in a system like T HE F XXX manually, there are two main challenges with doing so. First, it is not feasible to easily add thousands of rules as end-users generally do not have contributor access to T HE F XXX’s source code. Second, even for developers, writing correct rules is difficult and error-prone because of the complexity of the string manipulations needed to perform the command fixes. In fact, T HE F XXX only consists of less than 100 rules in a little over 1 year, since adding new ones is a fairly complex task. The F IXIT DSL for encoding fix rules is inspired by the types of rules appearing in T HE F XXX and by common command repairs requested by users on help-forums. A F IXIT rule first uses pattern matching and unification to match the command and error message, and then applies a fix transformation if the match succeeds. The transformations consist of substring and append functions on strings present in the command and error message. We present an algorithm that efficiently synthesizes F IXIT rules that are consistent with a given set of input-output examples using a Version-space Algebra (VSA). VSA-based synthesis techniques are used to succinctly represent the set of all expressions that are What about common errors? Recently, a tool T HE F XXX1 was developed for automatically addressing common errors when work1 We decided to censor the name of the tool. The tool can be found at http://bit.ly/CmdCorrection. 2 http://bit.ly/1j7zxOr 1 and http://bit.ly/1YgngXJ. 2016/8/31 consistent with a set of examples [8, 11]. Even though existing VSA data structures can represent an exponential number of F IXIT rules in polynomial space, this space can still be quite large. To address this problem we introduce lazy version-space algebra. Given a set of examples, our algorithm maintains a lazy representation of only a subset of the F IXIT rules that are consistent with the examples. The rules missing from the version-space are only enumerated when necessary—i.e., when a new input-output example can only be accounted by adding a F IXIT rule that is not already present in the version-space. Because of the careful design of F IXIT, our synthesis algorithm has a polynomial time complexity. In contrast, existing VSA-based synthesis techniques for string transformations require exponential time [8]. The polynomial time complexity is crucial for our synthesis algorithm to scale to a large number of fix examples. Since different examples may refer to different target rules, we propose a strategy to partition the input examples into groups of examples corresponding to individual rules. We then use the lazy VSA algorithm to learn the F IXIT rules for each partition. We evaluate the synthesis algorithm implemented in N O FAQ on 92 benchmark problems obtained from both T HE F XXX (76) and online help-forums (16). N O FAQ is able to learn the repair rules for 81 of the buggy commands in these benchmark problems from only 2 to 5 input-output examples each. who encounter similar errors. For example, let’s say that a skilled developer provides another triple of the following form. cmd2: javac Pair err2: Class names, ‘Pair’, are only accepted if annotation processing is explicitly requested fix2: javac Pair.java Using these two examples N O FAQ will synthesize the following fix rule. match [S TR(javac), VAR -M ATCH(1, ε, ε)] and [S TR(Class), S TR(names,), VAR -M ATCH(2, ‘, ’,) S TR(are), S TR(only), S TR(accepted), S TR(if), S TR(annotation), S TR(processing), S TR(is), S TR(explicitly), S TR(requested)] → [F STR(javac), S UB - LR(0, 0, ε, .java, VAR(1))] The first part of the rule (i.e., up to the symbol →) pattern-matches against the command and the error message and binds the input strings to the corresponding variables. The variables are then used by the second part of the rule to produce the output. In this case the S UB - LR(0, 0, ε, .java, VAR(1)) expression extracts the complete string associated with VAR(1) (a start index of 0 and an end index of 0 denotes the identity string extraction), and then prepends the string ε at the beginning of it, and appends the string .java at the end of it. Contributions summary: 1. F IXIT, a declarative domain-specific language for encoding rules that map a command and an error message to possible fixed commands (§ 3). 2. A sound and complete polynomial time synthesis algorithm based on lazy version-space algebra for synthesizing F IXIT rules from input-output examples (§ 4). 2.2 The following scenario is another common one for novice Java programmers. 3. An analysis of the formal properties of the F IXIT language and its synthesis algorithm (§ 5). cmd1: java Run.java err1: Could not find or load main class Run.java fix1: java Run 4. A qualitative and quantitative evaluation of the synthesis algorithm on 92 benchmarks obtained from both T HE F XXX and online help-forums (§ 6.2). 2. Motivating examples Given this example and another similar one, N O FAQ synthesizes the following rule. We first present the main ideas behind N O FAQ using some concrete examples. All the example rules presented in this section are actual rules appearing in T HE F XXX system. 2.1 Extracting substrings match [S TR(java), VAR -M ATCH(1, ε, .java)] and [S TR(Could), S TR(not), S TR(find), S TR(or), S TR(load), S TR(main), S TR(class), VAR -M ATCH(2, ε, .java)] → [F STR(javac), S UB - LR(0, −5, ε, ε, VAR(1))] Adding missing file extension Java programmers, in particular novice ones, are likely to encounter this error when they accidentally pass a class name instead of a source code file to the javac compiler. This rule extracts the substring of the input file name starting at index 0 and ending at the index −5 (5th index from the end of the string) in order to remove the .java extension. cmd1: javac Employee err1: Class names, ‘Employee’, are only accepted if annotation processing is explicitly requested 2.3 Often, this error is provided by the javac compiler when it is invoked on a file that does not have the proper .java extension. A seasoned programmer would immediately recognize the problem and add the extension .java at the end of the input file. Extracting complex substrings A user was trying to move a picture from one location to another but got the following error message. cmd1: mv photo.jpg Mary/summer12.jpg err1: can’t rename ’photo.jpg’: No such file or directory fix1: mkdir Mary && mv photo.jpg Mary/summer12.jpg fix1: javac Employee.java On the other hand, a novice programmer will search the web in the hope of finding a way to address the error and understand how to apply it to their setting. The goal of N O FAQ is to automatically synthesize simple fixes like this one from examples provided by experienced users and use the synthesized fixes to help novice users The error is cryptic for novice command-line users and does not guide them towards the actual problem of the missing directory. Given this example and another similar one, N O FAQ synthesizes the following rule. 2 2016/8/31 := := := := := | Fix expr f := | Pos expr p := | Variables and constants: s, sl , sr : string c : character match [S TR(mv), VAR -M ATCH(1, ε, ε), VAR -M ATCH(2, ε, ε)] and [S TR(can’t), S TR(rename), VAR -M ATCH(3, ‘, ’), S TR(No), S TR(such), S TR(file), S TR(or), S TR(directory)] → [F STR(mkdir), S UB - LR(0, C POS(/, 1, 0), ε, &&, VAR(2)) F STR(mv), S UB - LR(0, 0, ε, ε, VAR(1)), S UB - LR(0, 0, ε, ε, VAR(2))] Fix rule Input cmd Input error Output cmd Match expr The second expression in the output extracts the directory name—i.e., the substring that starts at index 0 and ends at the index of first occurrence of the character /. The rule also adds a string && at the end of the extracted string to pipe the two output commands. 3. r cmd err f ix m match cmd and err → f ix [m1 , · · · , ml ] [m1 , · · · , mm ] [f1 , · · · , fn ] S TR(s) VAR -M ATCH(i, l, r) F STR(s) S UB - LR(pL , pR , l, r, VAR(i)) I POS(k) C POS(c, k, δ) i, k, δ : integer Figure 1: Syntax of the rule description language F IXIT. The command repair language F IXIT We now describe F IXIT, a domain-specific language for expressing repair rules. The syntax and semantics of F IXIT is presented in Figure 1 and Figure 2 respectively. The language F IXIT is designed to be expressive enough to capture most of the rules we found in T HE F XXX and in online help-forums, but at the same time concise enough to enable efficient learning from examples. indices resulting from respectively evaluating the position expressions pL and pR on the string s. Here, given a string s = a0 . . . an , the expression substr(s, jL , jR ) denotes the string ajL . . . ajR −1 if jL , jR ≤ n + 1 and the undefined value ⊥ otherwise. Notice that, unlike previous VSA-based languages [8], F IXIT does not allow binary recursive concatenation; this is one of the key features that enables polynomial time synthesis. General structure Each F IXIT program is a rule of the form match cmd and err → f ix Positions expressions A position expression p can be one of the following types of expressions. that takes as input a command s̄cmd and an error s̄err and either produces a fixed command or the undefined value ⊥. The inputs s̄cmd and s̄err are lists of strings that are obtained by extracting all the space-separated strings appearing in the input command and error message respectively. The output fix produced by the rule is also a list of strings. From now on, we assume that the inputs and outputs are lists of strings that do not contain space characters. A rule has three components. • A constant position expression I POS(k), which denotes the in- dex k if k is positive and the index |s|−k if k is negative. If k = 0, this expression evaluates to 0 when evaluated for pL (i.e., the starting index of the substring) and to |s| when evaluated for pR , where |s| denotes the length of the string s. For example, in the function S UB - LR(I POS(0), I POS(0), ε, ε, VAR(1)), where σ(1) = File the first constant position evaluates to the index 0, while the second constant position evaluates to the index |File| = 4. 1. A list of match expressions cmd = [m1 , · · · , ml ] used to pattern match against the input command s̄cmd . 2. A list of match expressions err = [m1 , · · · , mk ] used to pattern match against the input error message s̄err . • A symbolic position expression C POS(c, k, δ), which denotes the result of applying an offset δ to the index of the k-th occurrence of the character c in s if k is positive, and the result of applying an offset δ to the index of the k-th to last occurrence of the character c in s if k is negative. For example, given the string www.google.com, the expression C POS(., 1, −2) denotes the index 2 (two positions before the first dot), while the expression C POS(., −1, 2) denotes the index 12 (two positions after the last dot). This operator is novel and can express operations that are not supported by previous VSA-based work. In particular, FlashFill [8] only allows the extraction of the exact position of a character and not positions in its proximity. Despite this additional capability, F IXIT programs can be synthesized in polynomial time. 3. A list of fix expressions f ix = [f1 , · · · , fm ] used to produce the new fixed command. Match expressions A match expression m is either of the form S TR(s) denoting a constant string s or of the form VAR -M ATCH(i, l, r). A VAR -M ATCH(i, l, r) expression denotes a variable index i and requires the matched string to start with the prefix l and end with the suffix r. We assume that no two variable expressions appearing in the match expression have the same index. When a list of match expressions [m1 , · · · , ml ] is applied to a list of strings s̄ = [s1 , . . . , sl ] with the same length l, it generates a partial function σ : N 7→ Σ∗ that assigns variables appearing in the match expressions to the corresponding strings in the input. For example, evaluating Comparison with FlashFill DSL At the top-level, F IXIT consists of match expressions over original command and error message, which perform pattern-matching and unification of variables with strings. This form of matching and unification is not expressible in FlashFill, so we cannot use it to learn the fix rules directly. However, we can use FlashFill as a subroutine to learn string transformations corresponding to expressions similar to S UB - LR expressions in N O FAQ. However, the FlashFill DSL has two major limitations: 1) No support for offsets from regular expression matches in computing position expressions (in contrast to F IXIT’s C POS(c, k, δ) operator), and 2) A finite hard-coded token set for regular expressions (e.g. no support for constant character tokens). Moreover, as described in subsection 4.3 and section 8, our S UB - LR operator yields a synthesis algorithm that operates in polynomial time in the [S TR(mv), VAR -M ATCH(1, , .jpg), VAR -M ATCH(2, , .jpg)] on the list of strings [mv, a.jpg, b.jpg] produces the function σ such that σ(1) = a.jpg and σ(2) = a.jpg. On the other hand, evaluating it on [mv, a.png, b.jpg] yields ⊥, as a.png does not match the required suffix in VAR -M ATCH(1, , .jpg). Fix expressions A fix expression f is either of the form F STR(s) denoting the constant output string s, or of the form S UB - LR(pL , pR , l, r, VAR(i)) denoting a function that is applied to the string si matched by the variable VAR(i). This function outputs the string l · m · r, where · denotes the string concatenation operator and m = substr(s, jL , jR ) where jL and jR are the 3 2016/8/31 ( Jf ixKσ σ = unify(cmd, s̄cmd ) ∪ unify(err, s̄err ) ∧ σ 6= ⊥ ⊥ otherwise S unify([m1 , · · · , ml ], [s1 , · · · , sl ]) = match-expr(mj , sj ), (1≤j≤l σ0 if s1 = s2 and σ0 is the always undefined function match-expr(S TR(s1 ), s2 ) = ⊥ otherwise ( σ if ∃ δ s.t. s = lδr and σ(i) = s and σ is undefined on every j = 6 i match-expr(VAR -M ATCH(i, l, r), s) = ⊥ otherwise Jmatch cmd and err → f ixK(s̄cmd , s̄err ) = J[f1 , · · · , fn ]Kσ = [Jf1 Kσ , · · · , Jfn Kσ ] JF STR(s)Kfun = s σ pos JS UB - LR(pL , pR , l, r, VAR(i))Kfun = l·m·r if (i, s) ∈ σ and m = substr(s, JpL Kpos σ s,L , JpR Ks,R )    I[k − 1] + δ k > 0 and I = indices(s, c)    k k>0     and |I| ≥ k |s| + k k < 0  JI POS(k)Kpos JC POS(c, k, δ)Kpos I[l − k] + δ k < 0 and I = indices(s, c) s,d = s,d =   0 k =0∧d=L     and |I| + k ≥ 0 ∧ l = |I| |s|   k =0∧d=R  ⊥ otherwise indices(s, c) = [i0 , . . . , ij ] where ∀ 0 ≤ l < j : il < il+1 , s[il ] = c and ∀j : s[j] = c → ∃ 0 ≤ l < j : il = j Figure 2: The semantics of the command repair DSL F IXIT. substring expressions {su1 , . . . , suk }, where each sui is of the form S UB - LR(pL , pR , l, r, VAR(j)). Intuitively, if we replace each set with one of the fix expressions it contains, we obtain a F IXIT rule. If each fi contains k elements, this symbolic representation models kn programs using an expression of size kn. number of examples, which enables the algorithm to scale to a large number of examples. Because of the recursive binary concatenate expressions in FlashFill, the DAG intersection based synthesis algorithm is exponential in the number of examples. 4. Synthesizing rules from examples 4.2 In this section we first describe our algorithm for synthesizing a single F IXIT rule from a set of examples of concrete command fixes. We then describe a multi-stage partitioning algorithm for learning multiple F IXIT programs from a large undifferentiated set of command repair examples. The algorithm for learning a single F IXIT rule is described in Figure 8; it takes as input a list of examples E = [e1 , . . . , en ] where each example ei is a triple of the form (s̄cmd , s̄err , s̄f ix ) and outputs a symbolically represented set of F IXIT rules R consistent with E—i.e., for every rule r ∈ R and example ei = (s̄cmd , s̄err , s̄f ix ), the rule r outputs s̄f ix on the input (s̄cmd , s̄err ). The algorithm processes one input example at a time, and after processing the first i examples Ei = [e1 , . . . , ei ] the algorithm has computed a set of rules Ri consistent with Ei . At the end, the algorithm outputs one of the rules in Rn . We use ⊥ to denote the undefined result. If at any point our algorithm returns ⊥ it means that there is no F IXIT rule that is consistent with the given set of examples. 4.1 Lazy rule representation The core element of our algorithm is a lazy representation of the rules that represents match and fix expressions as constants for as long as possible—i.e., until a new example shows that some parts of the rule cannot be constants. This helps reduce the number of variable expressions, which in turn reduces the number of substring expressions to be considered. We first illustrate the idea with a concrete example. Let’s say that we are given the two examples shown in Figure 3a and 4a. After processing the first example, our algorithm synthesizes the F IXIT rule in Figure 5a in which every match expression and every fix expression is a constant. However, since we have only seen one example, we do not yet know whether some expression appearing in the match should actually be a variable match expression or whether some element in the fix expression should actually be a function of some variable. The main idea is that any of these possibilities can still be “recovered” when a new example shows that indeed a variable is needed. Using this idea, we maintain each expression as a constant until a new example shows that some expression cannot actually be a constant. This is exactly what happens when processing the input example in Figure 4a. At this point in order to find a rule that is consistent with both examples we need to introduce a variable match as the second expression of the command match, and some function application as the second element of the fix. To do so, our algorithm applies the following operations to the previously computed rule. Symbolic representation of multiple rules Since there can be exponentially many rules consistent with the input examples, we adopt a symbolic representation of the set R that is guaranteed to always have polynomial size. Our synthesis algorithm takes as input a list of examples E and produces as output a symbolic rule of the form match cmd and err →s f ixes, where cmd and err are tuples of expressions that can consist of either constants or variables, and f ixes = [f1 , . . . , fm ] is a list of expressions that symbolically represents a set of outputs that is consistent with the examples E. Formally, each fi in f ixes is either a constant expression F STR(s) for some s, or a set of 1. All match expressions that cannot be constants are “promoted” to variable match expressions (making sure that all variable names are unique), which match on the longest shared prefix and suffix of all previously seen values at that position. The following table illustrates the idea for the case in which we try 4 2016/8/31 cmd1: java Run.java err1: Could not find or load main class Run.java fix1: java Run cmd2: java Meta.java err2: Could not find or load main class Meta.java fix2: java Meta (a) First example. (a) Second example. match [S TR(java), VAR -M ATCH(1, ε, .java)] and [S TR(Could), S TR(not), S TR(find), S TR(or), S TR(load), S TR(main),  S TR(class), VAR -M ATCH(2, ε, .java)]   S UB - LR(I POS(0), I POS(−5), ε, ε, VAR(1))])  S UB - LR(I POS(0), C POS(., 1, 0), ε, ε, VAR(1))]) ] →s [F STR(java),  S UB - LR(I POS(0), C POS(., −1, 0), ε, ε, VAR(1))])  match [S TR(java), S TR(Run.java)] and [S TR(Could), S TR(not), S TR(find), S TR(or), S TR(load), S TR(main), S TR(class), S TR(Run.java)] →s [F STR(java), F STR(Run)] (a) Symbolic rule representation synthesized after first example. (a) Symbolic rule representation synthesized after both examples. Figure 7: Two input examples e1 and e2 and symbolic rules synthesized after processing e1 and e2 . the input—i.e., VAR(i) denotes the i-th string in the list s̄cmd @s̄err obtained by concatenating the command and error input lists. to unify the command cmd2 in Figure 4a with the matching part of the already computed rule in Figure 5a. rule: new-ex: new-rule: S TR(java) java S TR(java) S TR(Run.java) Meta.java VAR -M ATCH(1, ε, .java) Lazy pattern matching The function F INDVARIABLES, given a rule r and a new example e, iterates over the input components of the new example e and outputs the set of variables necessary to match this new example with respect to the previously computed symbolic rule r. The function S YNTH F IX, given a rule r and a list of examples E, individually synthesizes all the components fi of the symbolic output fix expression that are consistent with E. S YNTH F IX is incremental in the sense that it tries to minimally change the original fix expression of r: 2. All the fix expressions that cannot be constants are “promoted” to S UB - LR expressions that are consistent with the current examples and are allowed to use the variables appearing in the match expressions. The second rule in Figure 7(d) reflects this update. The figure also shows how multiple S UB - LR expressions are represented symbolically as a set. We describe all of these components in detail in the next section. 4.3 • if the i-th component ti of the fix expression of r is a con- stant string consistent with the new example, then it is left unchanged; • in any other case the output has to be a substring operation, Synthesis algorithm and the function S YNTH S UBSTRINGS is used to compute all the possible S UB - LR expressions that are consistent with the set of examples E. Given a list of input examples, the function S YNTH RULES uses the first example and the function C ONST RULE to generate the symbolic rule composed only of constant operators. It then iteratively refines the rule on the remaining examples as shown in Figure 8. This second operation is done by the function R E FINE RULE which takes as input a symbolic rule r, one new example (s̄cmd , s̄err , s̄f ix ), and the list of examples E on which every concrete rule represented by r behaves correctly. R EFINE RULE executes two main steps using the following functions. Given a list of examples e :: E, the function S YNTH S UBSTRINGS first synthesizes all the S UB - LR expressions that are consistent with e using the function A LL S UBSTRINGS and then runs each synthesized expression on examples in E to remove the inconsistent ones. ALLSUBSTRINGS Figure 8 omits the formal definition of the function A LL S UBSTRINGS due to space limitations, but we describe its main components. Given an example e = (s̄cmd , s̄err , s̄f ix ), a set of variable names V , and the index i corresponding to the element of the output sequence we are trying to synthesize, A LL S UBSTRINGS computes the set of all substring expressions of the form f un = S UB - LR(pL , pR , l, r, VAR(j)) that are consistent with e such that the result of applying f un to the j-th string in s̄cmd @s̄err is the i-th string in s̄f ix . Let’s assume that |s̄cmd | + |s̄err | = nI , |s̄f ix | = nO , and nL is the length of the longest string appearing in any of the three lists in the input example. To compute the set A LL S UBSTRINGS(e, V, i) we iterate over all variable indices and for each variable index j ∈ V we do the following. F INDVARIABLES tries to unify the inputs s̄cmd and s̄err with the corresponding match expressions cmd and err in the symbolic rule r and generates new variable match expressions if necessary—i.e., when r contains a matching expression S TR(s) but the corresponding component in the example is a string different from s. In this case, a VAR -M ATCH(i, l, r) expression is generated such that i is a new variable name, and l and r are the longest prefix and suffix shared by s, respectively. When F INDVARIABLES is presented with a new s̄cmd or s̄err after a constant match expression has been ‘promoted’ to a VAR -M ATCH(i, l, r) expression, the prefix and suffix are updated accordingly. F INDVARIABLES determines the longest prefix r0 and suffix l0 of l and r, respectively, that is consistent with the appropriate component of the new example, and generates VAR -M ATCH(i, l0 , r0 ). 1. Extract the string sj corresponding to the variable VAR(j) — O(nI ) iterations. S YNTH F IX uses the variables computed in the previous step to synthesize all possible fix expressions that are consistent with the list of examples {(s̄cmd , s̄err , s̄f ix )} :: E. In order to simplify variable naming and guarantee unique names, each variable has the index of the corresponding element in 2. For each string s that is a substring of both s̄f ix [i] and sj , compute all possible pairs of indices k1 , k2 such that substr(sj , k1 , k2 ) = s — O(n2K ) possible substrings and O(nK ) possible ways to place the substring in s̄f ix [i]. 5 2016/8/31 //Outputs the fixes consistent with all the examples E and such that S UB - LR expressions can depend on any variable in V . The fix component of the latest example and the fixes computed on the previous examples are also passed as input fun S YNTH F IX([s1 , . . . , sn ], [t1 , . . . , tn ], e :: E, V ) if n 6= m then return ⊥ f ← [] for 1 ≤ i ≤ n do if ti = F STR(s) ∧ s = si then f ← f @[F STR(si )] else f ← f @[S YNTH S UBSTRINGS(e :: E, V, i)] return f //Rules consistent with input examples fun S YNTH RULES([e0 , . . . , en ]) r ← C ONST RULE(e0 ) for 1 ≤ i ≤ n do . refine on each example ei r ← R EFINE RULE(r, [e0 , . . . , ei−1 ], ei ) return r //Constant rule consistent with one example fun C ONST RULE([sc1 , . . . , scn ], [se1 , . . . , sem ], [sf1 , . . . , sfl ]) cstcmd ← [S TR(sc1 ), . . . , S TR(scn )] csterr ← [S TR(se1 ), . . . , S TR(sem )] cstf ix ← [F STR(sf1 ), . . . , F STR(sfl )] return (match cstcmd and csterr →s cstf ix ) //Refines a rule to make it consistent with one more example fun R EFINE RULE(r, E, (s̄cmd , s̄err , s̄f ix )) r ≡ (match cmd and err →s f ixes) (cmd0 , Vc ) ← F INDVARIABLES(s̄cmd , cmd, 0) (err0 , Ve ) ← F INDVARIABLES(s̄err , err, |s̄cmd |) V ← Vc ∪ Ve E 0 ← (s̄cmd , s̄err , s̄f ix ) :: E f ixes0 ← S YNTH F IX(s̄f ix , f ixes, E 0 , V ) return (match cmd0 and err0 →s f ixes0 ) //Outputs all S UB - LR expressions consistent with all the examples that can appear at position i in the fix expression fun S YNTH S UBSTRINGS(e :: E, V, i) F ← A LL S UBSTRINGS(e, V, i) for all (s̄cmd , s̄err , s̄f ix ) ∈ E do F0 ← ∅ for all f un ∈ F do let S UB - LR(pL , pR , l, r, VAR(j)) = f un o ← |s̄cmd | if j < o then . The variable is in s̄cmd if EVAL(f un, s̄cmd [j] = s̄f ix ) then F 0 ← f un :: F 0 else . The variable is in s̄err if EVAL(f un, s̄err [j − o] = s̄f ix ) then F 0 ← f un :: F 0 0 F ←F return F //Finds variables necessary to match example fun F INDVARIABLES([s1 , . . . , sn ], [t1 , . . . , tm ], o) if n 6= m then . Input length same as match length? return ⊥ (m, V ) ← ([], ∅) for 1 ≤ i ≤ n do case ti = S TR(s) ∧ s = si (m, V ) ← (m@S TR(si ), V ) case ti = S TR(s) ∧ s 6= si pref ← L ONGEST C OMMON P REFIX(s, si ) suf ← L ONGEST C OMMON S UFFIX(s, si ) newId ← i + o . Create new variable m ← m@[VAR -M ATCH(newId, pref, suf )] V ← V ∪ {newId} case ti = VAR -M ATCH(j, l, r) pref ← L ONGEST C OMMON P REFIX(s, l) suf ← L ONGEST C OMMON S UFFIX(s, r) m ← m@[VAR -M ATCH(j, pref, suf )] V ← V ∪ {j} return (m, V ) //Outputs all S UB - LR expressions consistent with one example that can appear at position i in the fix expression fun A LL S UBSTRINGS((s̄cmd , s̄err , s̄f ix ), V, i) return all S UB - LR(pL , pR , l, r, VAR(j)) that when evaluated on s̄cmd and s̄err output s̄f ix [i] and such that j ∈ V . Figure 8: Algorithm for synthesizing F IXIT rules from concrete examples. C POS(c, i, δ), the size reduces to O(nI n3K ), and the synthesis algorithm is still sound and complete for this fragment of F IXIT. This last restriction of the language can capture all the rules we are interested in. Notice that this analysis still holds in the extreme case in which all input matches are variable expressions of the form VAR -M ATCH(i, ε, ε). In our experiments on real-world commands, worst-case performance is uncommon, and is induced by substring operations over heterogeneous strings which yield many possible implementations. Consider the following two examples. 3. For each k1 (resp. k2 ) compute every position expression p1 (resp. p2 ) such that evaluating p1 (resp. p2 ) on sj produces the index k1 (resp. k2 ) — O(nK ) possible positions. 4. For each of these possibilities yield the expression S UB - LR(p1 , p2 , l, r, VAR(j)) where l and r are such that s̄f ix [i] = l · substr(sj , k1 , k2 ) · r. A LL S UBSTRINGS produces a set of expressions that in the worst case has size O(nI n5K )3 . If we restrict the offset component δ to only range over the values {−1, 0, 1} for the symbolic expressions cmd1: aaaa aaaa err1: aaaa aaaa fix1: aa 3 Note that the efficiency of this implementation is contingent on our specific choice of data structure and algorithms. A more naive solution, based on set intersection (like that of the DAG-based algorithm in FlashFill) may experience exponential blow-up in the number of examples, due to the quadratic nature of the intersection operations. cmd2: bbbb bbbb err2: bbbb bbbb fix1: bb Performing synthesis on this pair of examples yields a pattern match consisting of four VAR -M ATCH(i, , ) expressions. Due to the uniformity of the input strings, synthesis yields 48 possible 6 2016/8/31 cmd1: e1 err1: fix1: cmd2: e2 err2: fix2: cmd3: e3 err3: fix3: cmd4: e4 err4: fix4: cmd5: e5 err5: fix5: cmd6: e6 err6: fix6: S UB - LR expressions. In particular, the desired fix can be generated from any of the four strings in the supplied scmd and serr . Each of the four strings has three substrings of length 2, any of which yields the desired output. For each such substring, there are four pairs of I POS values that supply the appropriate indices: The pair with two positive indices, the pair with two negative indices, and the two pairs consisting of one positive and one negative index. Key point At this point we are ready to explain why all the match expressions can be kept as constants for as long as possible. If after processing a set of examples E, some expression in cmd or err is of the form S TR(si ), then, for every input example, the value of the i-th component is the string si . Therefore, even if we replace this expression with a variable, all its instantiations will have the same values. Consequently, every function of the form S UB - LR(p1 , p2 , l, r, VAR(i)) will produce a constant output, making it equivalent to the some constant function F STR(s0 ). 4.4 Partition-Based Synthesis F IXIT can learn repair rules from a set of examples corresponding to a specific incorrect use of a command. In practice, however, it may be difficult to present F IXIT with a collection of neatly curated sets of examples, from each of which, F IXIT learns a single symbolic rule. Such a process is both labor-intensive and error-prone. We instead envision large-scale learning of F IXIT rules from undifferentiated sets of examples submitted by many users. To facilitate this, we propose a simple multi-stage partitioning strategy. As a consequence of F IXIT’s structure, each symbolic rule matches on a pair of command and error strings, each of which has a fixed number of tokens. Upon a match, F IXIT generates a repaired command with a fixed number of tokens. Conversely, every symbolic F IXIT expression must be learned from a set SE of example triples of the form (scmd , serr , sf ix ) for which the lengths of scmd , serr , and sf ix do not vary. Given an undifferentiated set of examples,SSE , we partition SE into n disjoint subsets δi where SE = n i=0 δi . For every δi the property ∀(scmd , serr , sf ix ) ∈ δi , (s̄cmd , s̄err , s̄f ix ) ∈ δi . |scmd | = |s̄cmd | ∧ |serr | = |s̄err | ∧ |sf ix | = |s̄f ix |. This divides SE into subsets from which it is possible to synthesize F IXIT rules. After dividing SE , it may still be the case that individual sets δi contain examples representing distinct command repair rules which share the same triple of scmd , serr , and sf ix lengths. At this point, we attempt to find the smallest set of rules that can be synthesized from the examples in δi . The search ranges over all partitions S P of δi , where P is the set {δi,1 , δi,2 , . . . , δi,m } such that m j=1 δi,j = δi and ∀j 6= k, δi,j ∩ δi,k = ∅. We enumerate the partitions in ascending order of size m, starting with P = {δi }, and ending with the partition consisting entirely of singleton sets. Given a partition P , we attempt to synthesize a symbolic F IXIT rule for each set in P , stopping when we have generated a rule for each δi,j . As we will show in section 6.2, this expensive procedure is only feasible when using our novel contribution of lazy VSA. java Run.java Could not find or load main class Run.java java Run java Test.java Could not find or load main class Test.java java Test composer pkg did you mean one of these? pkg1 pkg2 composer pkg1 composer hptt did you mean one of these? http html composer http mv photo.jpg Mary/summer12.jpg can’t rename ‘photo.jpg’: No such file or directory mkdir Mary && mv photo.jpg Mary/summer12.jpg mv dec31.jpg Bob/family.jpg can’t rename ‘dec31.jpg’: No such file or directory mkdir Bob && mv dec31.jpg Bob/family.jpg Figure 9: Examples requiring more than one F IXIT rule. While there exists a F IXIT program that is consistent with the examples in the set S2 , no F IXIT program can describe a transformation that is consistent with all the examples in S1 . We therefore proceed by iteratively partitioning the set Si , attempting to find a partition Pi for which we can synthesize a rule for every Si,j ∈ Pi . For S2 , we can clearly do so for the initial partition P2 = {S2 }, yielding the rule from Section 2.2. For S1 , the first partition for which we can generate a F IXIT rule for every element is P1 = {S1,1 = {e1 , e2 }, S1,2 = {e3 , e4 }}. S1 yields the rule from Section 2.1, and S2 yields the simple substitution rule described previously. 4.5 More Succinct Representation The version of symbolic rule we presented is already able to store exponentially many concrete F IXIT rules in polynomial space. In this section, we discuss further improvements that can make the representation more succinct. Avoid redundancy In the set of fix expressions enumerated by the function A LL S UBSTRINGS, the last three components of the the expression S UB - LR(p1 , p2 , l, r, VAR(j)) are often repeated many times. Looking at Figure 6a we can see how all the synthesized functions have l = r = ε and are applied to the variable VAR(1). We define a data structure for representing sets of fix expressions that avoids these repetitions. A set of fix expressions is represented symbolically using a partial function d : N 7→ (Σ∗ × Σ∗ ) 7→ Set(P × P ) where P is the set of all position expressions. Formally, given a variable index i and two strings l and r, the set d(i, l, r) symbolically represents the set of fix expressions {S UB - LR(p1 , p2 , l, r, VAR(i)) | (p1 , p2 ) ∈ d(i, l, r)}. The function d can be efficiently implemented and avoids redundancy. Considering again the example rule in Figure 6a, all the fix expressions in the second component of the output can be succinctly represented by the function d that is only defined on the input (1, ε, ε) and such that d(1, ε, ε) = { (I POS(0), I POS(−5)), (I POS(0), C POS(., 1, 0)), (I POS(0), C POS(., −1, 0)) }. Example partitioning Consider the example set shown in Figure 9. The first two examples in this set correspond to the repair in Section 2.1 while the last two correspond to the repair in Section 2.3. The third and fourth example correspond to the rule that outputs composer, followed by the token at index 8 in the input (i.e., the first token suggested by the error message). We first group the examples based on the length of their components. For the first four examples, we have |scmd | = 2, |serr | = 8, |sf ix | = 2 and for the two remaining examples, |scmd | = 3, |serr | = 8, |sf ix | = 6. Thus, we obtain two groups S1 = {e1 , e2 , e3 , e4 } and S2 = {e5 , e6 }. Avoid example representation Each synthesized rule is in some sense coupled to the set of examples used to synthesize it. We present a data structure that only keeps track of the important 7 2016/8/31 “parts” of the input examples and therefore allows us to discard each example after it has been processed. We modify the symbolic rule representation as follows. Given a n n set of examples (s̄1cmd , s̄1err , s̄1f ix ) . . . (s̄n cmd , s̄err , s̄f ix ), S YNTH RULES, and run it on the command and error of any of the examples provided to S YNTH RULES for the synthesis of r, we will obtain the fix originally provided in that example. Theorem 2 (Soundness). Given a list of examples E, for every rule r ∈ con(SynthRules(E)) and for every example (s̄cmd , s̄err , s̄f ix ) ∈ E, JrK(s̄cmd , s̄err ) = s̄f ix . • every variable VAR -M ATCH(i, l, r) in the match component becomes a pair (VAR -M ATCH(i, l, r), [b1 , . . . , bn ]) where the second component is the list of strings that binds to VAR(i) in the input components of the examples—i.e. bj = (s̄jcmd s̄jerr )[i]; Proof sketch. The repeated applications of F INDVARIABLES will promote any S TR(s) expression if a new example does not match on s. Moreover, when refining a VAR -M ATCH, F INDVARIABLES chooses the longest prefix and suffix consistent with all examples seen so far. Thus, cmd and err will correctly match on all examples. The soundness of the resulting f ix derives from the fact that at each iteration of the loop in S YNTH RULES, the invocation of S YNTH S UBSTRING in S YNTH F IX takes into account all examples seen in previous iterations of the loop. Moreover, each invocation begins with the set of all possible S UB - LR expressions, and prunes those inconsistent with any example seen so far. Since parts of the match expressions are “promoted” to variables only when the input examples show that this is required, our synthesis algorithm does not explicitly keep track of all the possible rules that can be consistent with the examples. Our completeness result reflects this idea. • every set of fix expressions represented by a function di and corresponding to the i-th component of the fix expression becomes a pair (di , [b1 , . . . , bn ]) where the second component is the list of strings that appear in position i in the output components of the examples—i.e. bj = s̄jf ix [i]; Using this data structure we do not need to store examples as we can always re-infer them from the symbolic rule representation. 4.6 Concrete outputs Taking into account the updated data structures, the algorithm S YNTH RULES returns a symbolic rule r of the form match cmd and err →s f ixes where cmd = [c1 , . . . , cn ] and err = [e1 , . . . , em ] are lists of expressions of the form S TR(s) or (VAR(i), B), while f ixes = [f1 , . . . , fl ] is a list of expressions of the form F STR(s) or (d, B) where d is the data structure for representing multiple fix expressions. The set of concrete F IXIT rules induced by this symbolic representation is the following. Theorem 3 (Completeness). Given a set of examples E, for every Fixit rule r that is consistent with E, either r ∈ con(SynthRules(E)) or there exists an example e such that r ∈ con(SynthRules(e :: E)). con(match cmd and err →s f ix) = {match cmd and err → f | f ∈ con(f ix)} con([f1 , . . . , fl ]) = {[f10 , . . . , fl0 ] | fi0 ∈ con(fi )} con(F STR(s)) = {F STR(s)} con(d, B) = {S UB - LR(p1 , p2 , l, r, VAR(i)) | ∃i, l, r.(p1 , p2 ) ∈ d(i, l, r)}. 5. Proof sketch. Concretely, a particular rule r that is consistent with E might not appear in R = S YNTH RULES(E). However, this can only happen because the match expression of r has more variables than the match of any rule in R. This can be fixed by providing an example that forces the algorithm to promote to variables all the required match expressions. Formal properties Properties of the language Fixit We define the size of an input example e = (s̄cmd , s̄err , s̄f ix ) and the size of each rule r consistent with e as the sum of its lengths size(e) = size(r) = |s̄cmd | + |s̄err | + |s̄f ix |. For each set of examples, there can be exponentially many rules consistent with it. We study the formal properties of the synthesis algorithm and of the language F IXIT. These specific properties describe the behavior of the synthesis algorithm in the absence of the partitioning strategy described in Section 4.4. Properties of the synthesis algorithm First, our synthesis algorithm is invariant with respect to the order in which the training examples are presented. Thus, the properties of a symbolic rule generated by S YNTH RULES, can be discussed solely in terms of the set of examples provided to S YNTH RULES. Theorem 4 (Number of consistent rules). Given a set of examples E, each of size k, the set con(SynthRules(E)) contains 2O(poly(k)) rules. Proof sketch. As we showed in Section 4.3, for each position in the output of a F IXIT rule there are potentially polynomially many S UB - LR expressions consistent with the provided examples. For the ith position in f ix, we are free to choose any of the possible S UB - LRs, independently of our choice at other positions. Thus, the number of possible rules is potentially exponential in |s̄f ix |. Despite the exponential number of rules represented, our data structure allows the S YNTH RULES to encode these rules using only polynomial size. Next, there exists an active learning algorithm for learning F IXIT rules that requires only a polynomial number of examples— i.e., queries to the user. Theorem 1 (Order invariance). Given a list of examples E, for every permutation of examples E 0 of E, we have con(SynthRules(E)) = con(SynthRules(E 0 )). Proof sketch. Consider a list of examples E. If two examples differ at the ith position in their respective commands, the ith expression in cmd will be promoted to a VAR -M ATCH, regardless of the order in which they are presented to S YNTH RULES. Moreover, if all |E| strings at the ith position in the commands share a prefix or suffix, reordering E does not change this fact. Thus, the discovered VAR -M ATCH expressions will not vary based on order. The same holds for err and the “promotion” of constants in S YNTH F IX. Moreover, S YNTH S UBSTRING starts from scratch at each iteration of the loop in S YNTH RULES and f ix depends only on the output of S YNTH F IX in the final iteration. Since the variable set does not vary based on the ordering of E, the final invocation of S YNTH F IX does not depend on the ordering of E. Second, the synthesis algorithm produces only rules that are consistent with the input examples. If we select an arbitrary concrete rule r from the set specified by a symbolic rule generated by Theorem 5 (Complexity of active learning). If there exists a target rule r of size k, there exists an active learning algorithm that will learn r by asking O(poly(k)) queries of the form: What should the output of r be on the input (s̄cmd , s̄f ix ). Proof sketch. The algorithm first asks k queries to figure out which match expressions are variables and which ones are constants. Then, for each output component for which there exists two possible fix expressions S UB - LR consistent with the examples, it asks 8 2016/8/31 a query that differentiates the two. Since there are only O(knI n5K ) many expressions in the output the algorithm will ask at most polynomially many queries. 6. We present both qualitative and quantitative analysis of the algorithm. We assess the expressiveness of N O FAQ by attempting synthesis on a benchmark suite that includes the rules in the tool T HE F XXX. We then evaluate the performance of N O FAQ and its scalability. Implementation and Evaluation 6.2.1 We now describe the implementation details of N O FAQ, as well as our experimental evaluation of N O FAQ on a set of examples and test cases isolated from T HE F XXX and web forums. 6.1 Implementation We implemented the language F IXIT and its synthesis algorithm in a system called N O FAQ. N O FAQ is implemented in F#4 and consists of some additional optimizations and design choices as described below. 6.1.1 Implementation optimizations The function A LL S UBSTRINGS in Figure 8 synthesizes all S UB - LR functions that are consistent with the first input/output pair (s, t) of strings in the example set E and then applies each of the synthesized functions to the other elements of E for filtering only consistent functions. In practice, we first compute the longest common prefixes and suffixes of the strings appearing in the components s̄f ix of E to avoid enumerating instances of the form S UB - LR(_, _, l, r, _) such that l or r are not prefixes or suffixes of some output string t appearing in E. The other optimization is based on the following property of the R EFINE RULE function: when adding a new example to r, if the function F INDVARIABLES introduces a new set of variables V , all the new instances of S UB - LR that did not already appear in r depend on one of the newly introduced variables in V . Based on this idea, the function A LL S UBSTRINGS only has to compute functions of the form S UB - LR(_, _, _, _, VAR(i)) where i ∈ V , and can reuse the previously computed functions for the other variables by simply filtering the ones that behave correctly on the newly introduced example. 6.1.2 Number of examples We observed that it was natural to provide two to five examples per benchmark for N O FAQ to uniquely learn the desired fix rule. We also provided additional examples for manually testing the learned rules, yielding a set of three to six examples. Given the rule appearing in Figure 7, for example, we used the two examples in Figure 7 and another example with the file name Employee.java. In future, we envision users to contribute different examples to the system for automatically building a large corpus of learned fix rules. While these examples are synthetic examples reverse engineered from other sources, they are also natural examples which exercise the range of e.g. path and file names one would expect to see in a real Unix system. In the case of the repaired command in Section 2.3, the natural two-example set would consist of two distinct directory names which do not share prefixes and suffixes, as well as filenames with distinct prefixes and extensions. Ranking Since there can be multiple possible expressions in F IXIT that are consistent with the examples, we employ a simple ranking technique to select an expression amongst them. If there are multiple S UB - LR expressions that can generate the desired output string, we select the expression that uses the variable with the lowest index—i.e., the leftmost one. Similarly, the l and r included in VAR -M ATCH expressions implicitly encode all rules matching on prefixes and suffixes of l and r, respectively. We choose the longest l and r over all others. As the example set increases in size, we envision users will likely submit diverse sets of examples, particularly in use cases with thousands of users submitting examples. As users submit examples which draw from heterogeneous collections of command parameters, VAR -M ATCH prefixes and suffixes should converge to the least restrictive versions. Similarly N O FAQ should discover the least restrictive set of constants for both match expressions. As these input parameters vary over the set of examples, spurious ambiguities in S UB - LR should be eliminated when N O FAQ is presented with specific fix examples which function as counterexamples to unnecessary substring expressions. 6.2 Benchmark Suite We compiled our benchmark suite from an initial set of of 92 benchmarks, which were collected from both T HE F XXX (76) and online help forums (16). We considered the 76 repair rules hardcoded in the T HE F XXX tool to assess the expressiveness of N O FAQ. Since rules in T HE F XXX can use arbitrary Python code, it is hard to exactly compare them to the ones produced by N O FAQ. We use manual testing to check that a rule r generated by our tool is consistent with a rule r0 in T HE F XXX. To do so, we manually constructed a set of examples based on the pattern-matching and textual substitutions performed by the T HE F XXX rules. The other sixteen example sets were obtained from examples found during a non-exhaustive survey of command-line help forums on the web. These commands consist of various types of git, svn, and mvn commands, including committing, reverting, and deleting from repositories, as well as installing and removing packages. The N O FAQ system is able to synthesize a rule for 81 of the 92 benchmarks. The remaining 11 failing benchmarks can be divided into three broad categories: i) Hard-coded operations searching for specific strings in some context (8), ii) Complex patterns checking relationships between variable expressions (2), and iii) Error messages displaying parts of the input file’s content (1). We did not provide examples for these 11 rules. We elaborate more about these categories in Section 7. 6.2.2 Qualitative evaluation Given a single set containing examples for all the 81 cases in which N O FAQ is capable of synthesizing a rule, we performed synthesis as described in Section 4.4. For each rule we retained a single example from the training set and used it to test the accuracy of each rule. We also report how often a given input could be repaired using more than one rule. Results For all 81 cases, N O FAQ synthesized a rule consistent with the corresponding T HE F XXX rule or web forum answer. In some cases we had to synthesize more than one F IXIT rule to capture the different possible behaviors of a single rule in T HE F XXX. For example, one can try adding ‘sudo’ in front of a command for several possible errors such as “Command not found”, “You don’t have the permission" etc. In such cases, thanks to the partitioning algorithm, N O FAQ generated a separate rule for each possible error message. For each case where we synthesized a rule, correctness Evaluation We now describe our experimental evaluation. The experiments were run on an Intel Core i7 2.30GHz CPU with 16 GB of RAM. 4 The implementation will be made open-source and publicly available after the review process. 9 2016/8/31 Eager  vs  Lazy  VSA Size of the Expressions 35 CmdSize 30 ErrSize Synthesis  Time  in  s econds Distribution of Cmd, Err, Fix Expr Size FixSize 25 20 15 10 5 11 21 31 41 51 61 71 Eager  VSA 1,500 Lazy  VSA 1,000 Enumerating   Partitions 500 0 12 13 14 15 16 17 Size  of  Largest  Group 0 1 2,000 81 Benchmarks Figure 11: Synthesis times for different benchmarks for the lazy and non-lazy rule representations. Figure 10: The distribution of benchmarks in terms of individual sizes of s̄cmd , s̄err , and s̄f ix expressions in the examples. Evaluation of lazy VSA synthesis time In Figure 11, we show the time taken to partition and synthesize F IXIT rules for the 81 benchmarks, using both the lazy and a non-lazy rule representation, as the number of examples per benchmark increases. The nonlazy representation always considers match and fix expressions as variables, rather than initially starting with constants. To test the performance of the lazy and non-lazy representations as the size of the input set increases, we iteratively increase the size of the training set. For each test, we add a single example to one of the benchmarks and then attempt synthesis. We plot the synthesis time with respect to the largest set of examples for which we must enumerate possible partitions until we successfully synthesize rules. To understand the performance overhead induced by synthesis, we also evaluate a version of the algorithm which enumerates partitions without performing synthesis. For each algorithm, we iteratively increased the training set size until the algorithm reached a 2, 000 second timeout. The non-lazy VSA incurs a significant overhead, and scales much worse than the lazy version, reaching the timeout when the largest set has 14 examples. The lazy VSA, in contrast, is much closer to the optimum; the synthesis time is negligible compared to the inherent cost of enumerating all partitions of a set. In fact, the lazy synthesis actually completes faster than exhaustive enumeration. This is reasonable, as the first partitioning which yields a successful F IXIT rule for all subsets tends to be somewhere near the middle of the enumeration, and thus does not incur the cost of enumerating the remainder of the search space. In summary, the lazy VSA strictly outperforms non-lazy VSA and can handle much larger sets of examples. was independent of our choice of examples. If the correct rule was synthesized, it was synthesized regardless of which subset of the examples provided for that rule we selected. Distribution of rule sizes We define the size of an expression such as s̄cmd , s̄err , and s̄f ix as the number of strings present in it. The distribution of the size of the benchmarks in terms of the sizes of the s̄cmd , s̄err , and s̄f ix tuples in input-output examples is shown in Figure 10. Note that we do not show two benchmarks in the graph with disproportionately high s̄err expression size of 110 for clarity. The average total size of the examples in the benchmarks was 15.91 ± 17.185 , with the maximum size of 116. The average sizes for the individual expressions of the examples were: i) s̄cmd : 2.38 ± 1.01 with maximum of 6, ii) s̄err : 10.12 ± 16.85 with a maximum of 110, and iii) s̄f ix : 3.41 ± 1.55 with a maximum of 7. Distribution of rule matching For each set of example provided for an individual rule, we isolated one example to measure the accuracy of the tool. All the test examples were correctly described by at least one of the synthesized rules. For the majority of the test cases, there was exactly one rule which matched both the command and error message. The remaining 12 test cases which matched against multiple rules came from collections of example sets which represented different fixes of the same command and error messages. Total test cases Test cases matched by one rule Test cases matched by multiple rules 81 69 12 S UB - LR expression in synthesized rules The distribution of F STR and S UB - LR expressions in the synthesized F IXIT rules is shown in Figure 12. The output components of the synthesized rule contain on average 29.01% ± 24.4% S UB - LR expressions. Concretely, a synthesized rule contains on average 0.91±0.76 S UB - LR expressions. Ranking Consistent with our hypothesis in Section 6.1.2, a diverse set of examples was sufficient for eliminating spurious restrictions and substring expressions. In every test case, the rule chosen by our ranking policy was capable of correcting all test cases presented. In practice, many rules still have several possible correct S UB - LR expressions. However, this remaining ambiguity occurs because the same string can appear many times in the command and error message (e.g., the string Employee in the example in Section 2.1). 6.2.3 Synthesis time vs. number of S UB - LR expressions The synthesis time for different numbers of S UB - LR expressions in the repair rule is shown in Figure 13. As expected, the benchmarks that do not contain S UB - LR expressions take negligible time. The benchmarks involving two S UB - LR expressions on average require more time than the benchmarks with a single S UB - LR expression. Interestingly, the benchmarks with 3 S UB - LR expressions take lesser time than the benchmarks with 2 S UB - LR expressions. A possible explanation for this behavior is that the complexity of substring extraction tasks for these benchmarks is relatively simpler (e.g. identity) than the benchmarks with 2 S UB - LR expressions. Quantitative evaluation We now report on the quantitative metrics of our synthesis algorithm. In this section we only report data for the 81 benchmarks for which N O FAQ can successfully synthesize a F IXIT rule. 5 We use a ± s to denote an average a with standard deviation s. 10 2016/8/31 FStr 7 SYNTHRULE time vs # Example Exprs SubLR Learning Time (in ms) Size of the Fix Expression # of S ub LR and FS tr Exprs in Fix Exprs 8 6 5 4 3 2 1 0 1 11 21 31 41 51 61 71 81 Benchmarks 5000 4000 3000 2000 1000 0 7 77 147 217 287 357 Number of Expressions in Examples Figure 12: The distribution of F STR and S UB - LR expressions in the final synthesized repair expression. Figure 14: Synthesis times with increasing size of examples. input matching. F IXIT also cannot check whether some string in the input command is repeated more than once. Learning Time (in ms) SYNTHRULES Time vs # SubLR Exprs 450 400 350 300 250 200 150 100 50 0 Context-dependencies Eight rules had hard-coded operations that were searching some context (the file system, a configuration file, etc.) for specific strings to complete the output. F IXIT only receives as inputs the command and the error message, and the rules currently cannot use any context. 8. 0 1 2 Version-space algebra for synthesis The concept of Versionspace algebra (VSA) was first introduced by Mitchell [17] in the context of machine learning and was later used by Lau et al. to learn programs from demonstrations in a Programming By Examples/Demonstrations system called SmartEdit [11]. It has since been used for many PBE systems from various domains including syntactic string transformations in FlashFill [7], table transformations [9, 25], number transformations [24], text extraction from semi-structured text files in FlashExtract [12], and transformation of semi-structured spreadsheets to relational tables in FlashRelate [2]. Our synthesis algorithm also uses VSA to succinctly represent a large set of conforming expressions. However, in contrast to previous approaches that represent all conforming expressions concretely and then use intersection for refinement, our synthesis algorithm maintains a lazy representation of rules and concretizes the choices on demand in a lazy fashion only when it is needed. Moreover, our careful design of DSL operators and the corresponding VSA in N O FAQ lead to a polynomial time synthesis algorithm unlike most previous approaches that have exponential time synthesis algorithms. In particular, it is illustrative to compare the FlashFill DSL with F IXIT. While, like F IXIT, FlashFill synthesizes string manipulations from input-output examples, specific performance properties make it less suitable for large scale learning from large sample sets. Prior to developing N O FAQ, we evaluated the possibility of simply using the FlashFill algorithm as-is for our purpose of learning command repair rules. Early empirical results indicated that the offthe-shelf algorithm scaled poorly as the error messages increased in length, which was a common occurrence for our benchmarks. Moreover, other limitations of no offset operator in position expressions and support for finite hard-coded regular expression tokens made FlashFill unsuitable for learning S UB - LR expressions. We isolated several theoretical properties of FlashFill’s key operators which yielded poor performance on large inputs. In particular, the binary concatenation operator over arbitrary substrings of 3 Number of SubLR Expressions in Fix Expr Figure 13: Synthesis times for varying number of S UB - LR expressions in the repair rule. Scalability of synthesis algorithm with example size Since all real-world examples we collected are relatively of small size (with maximum size of 116 space-separated strings), we evaluate the scalability of the S YNTH RULES algorithm by creating artificial examples of increasing sizes. We create these artificial examples by repeating the s̄cmd , s̄err , and s̄f ix commands multiple times for the example shown in Section 2.2. The synthesis times for increasing size of examples is shown in Figure 14. From the graph, we observe that the synthesis times scale in a quadratic fashion with respect to the example size. 7. Related work Limitations We showed that the language F IXIT is able to express many realworld command line repair rules and that these rules can be synthesized using few examples. We now present some limitations of our approach, in particular with respect to the 11 T HE F XXX rules that F IXIT could not describe. Complex patterns Two rules were checking complex properties of the input that F IXIT cannot capture. For example, F IXIT cannot check whether the error message contains some special character. F IXIT’s conditional matching is limited to whole string or prefix/suffix matching, and thus cannot check if e.g. a file name contains a non-unicode whitespace character. All character relative logic occurs in the substring generation after 11 2016/8/31 T HE F XXX provides a Python interface for command substitution and repair rules, and it requires a degree of language and toolspecific knowledge that may not be accessible to command line novices, particularly if non-trivial substring operations are required to derive the desired command. Much like FlashFill, we aim to emulate the workflow of non-technical users communicating with experts on web forums. For a beginner learning the command line, Python string manipulations are likely a fairly challenging task, and the cost of an incorrectly transformed shell command is potentially catastrophic. In such a situation where a non-expert desires a new T HE F XXX rule, such a user may provide an example of several command/error pairs, and the desired fix for each, from which an expert would write the desired Python code. NoFAQ shortens this loop by moving the fix synthesis into a polynomial time algorithm on the user’s machine. the entire input string induces a DAG structure for the symbolic representation of programs. More explicitly, given an example output string S, there exists a node np for each position p in S. An edge from np to n0p , p < p0 represents the substring S[p : p0 ]. Each edge is labelled with the set F of functions over the example inputs which yield the substring. Thus, a path from n0 to n|S| represents some concatenation of the output of several string operations which yields the desired output. Given a DAG D consistent with a set of examples E, FlashFill incorporates a new example e represented by DAG D0 by taking the cartesian product of the vertices of D and D0 , to construct a new DAG D00 . An edge with label set F 00 in the new DAG represents a set of functions which were part of a correct program for the examples E, and also map from the inputs of e to a substring of e’s output. The iterated cartesian products yield time complexity exponential in the number of examples. F IXIT, in contrast, posesses unary string operations constrained to specific variable terms. F IXIT’s unary S UB - LR operator yields a language that is disjoint from FlashFill with concatenation removed; we obtain a language expressive enough for a large set of practical command repair transformations isolated from real use cases, while dramatically improving worst-case performance. The constrained nature of the program representation lets the synthesis algorithm eliminate programs inconsistent with a new example without directly computing the intersection of two sets of candidate programs, ensuring polynomial-time performance even in the worst case. Moreover, F IXIT also allows for repair transformations that require arbitrary offsets from a regex match, which are not expressible in the FlashFill DSL. Rule learning Rules provide a simple way to represent programmers actions and in general any type of data transformation. Rule learning has been extensively investigated in classical machine learning and data mining [5]. The goal of rule learning is to discover and mine rules describing interesting relations appearing in data. Common concept classes for describing rules are Horn clauses or association rules [19]. The approach presented in this paper differs from rule learning in two aspects: 1) the rules are expressed in a complex concept class and are hard to learn — i.e., F IXIT programs; 2) the examples are given by a teacher that has in mind a target rule. In the future we plan to build a system that uses rule learning techniques to mine F IXIT rules from unsupervised data. Programming by Examples (PBE) PBE has been an active research area in the AI and HCI communities from a long time [15]. In addition to VSA-based data wrangling [8], PBE techniques have recently been developed for various domains including interactive synthesis of parsers [14], synthesis of recursive functional programs over algebraic data types [4, 18], synthesizing sequence of program refactorings [20], imperative data structure manipulations [26], and network policies [31]. Our technique also learns repair rules from few input-output examples of buggy and fixed commands, but both our problem domain of learning command repairs and the learning techniques of using lazy VSA are quite different from these PBE systems. Program synthesis There has been a resurgence in Program Synthesis research in recent years [1]. In addition to examples (as described above), there have been several techniques developed for handling other forms of specifications such as partial programs [27, 28], reference implementations [23], and concrete traces [29]. While these specification mechanisms have been found to be useful in several domains, we believe examples are the most natural mechanism for specifying command line repairs especially for beginners. There is also a recent movement towards using data-driven techniques for synthesis [22], e.g. the PLINY project (http://pliny.rice.edu/index.html). In future, we envision our system to also make use of large number of examples of buggy commands and their corresponding repairs to learn a big database of F IXIT rules. Program repair Research in automated program repair focuses on automatically changing incorrect programs to make them meet a desired specification [6]. The main challenge is to efficiently search the space of all programs to find one that behaves correctly. The most prominent search techniques are enumerative or data-driven. GenProg uses genetic programming to repeatedly alter the incorrect program in the hope to make it correct [13]. Data-driven approaches use the large amount of code that is publicly available online to synthesize likely changes to the input program [21, 30]. Prophet [16] is a patch generation system that learns a probabilistic application-independent model of correct code from a set of successful human patches. Unlike these techniques that learn a global model of code repair across different applications, our technique learns command-specific repairs by observing how expert users fix their buggy commands — i.e., from both the incorrect command the user started with (together with the error message) and the correct command she wrote as a fix. 9. Conclusion and Future Directions We presented a tool N O FAQ that suggests possible fixes to common buggy commands by learning from examples of how experts fix such issues. Our language design walks a fine line between expressivity and performance: by careful choice of unary operators over pre-defined variables, and exclusion of arbitrary substring operations, we avoid exponential-time worst case performance, while still maintaining a useful degree of functionality. N O FAQ was able to instantly synthesize 85% of the rules appearing in the popular repair tool T HE F XXX and 16 other rules from online help forums. Although N O FAQ tool is aimed towards repairing commands, we believe our novel combination of synthesis and rule-based program repair is quite general and is applicable in many other domains as well. We plan to to apply this methodology to more complex tasks, such as correcting syntax errors in source code, applying code optimization, and editing configuration files. In the future, we hope to create a tool which can take large command histories from expert users and quickly derive rules, as well as synthesize new rules online as experts use the shell. Crowdsourced Repairs HelpMeOut is a social recommender system that helps novice users facing programming errors by showing them examples of how other programmers have corrected similar errors [10]. While HelpMeOut can show examples of similar fixes it does not concretely show the user how the code should be corrected. This aspect is the major difference between HelpMeOut and N O FAQ. 12 2016/8/31 References ence on Software Engineering, ICSE ’12, pages 3–13, Piscataway, NJ, USA, 2012. IEEE Press. ISBN 978-1-4673-1067-3. URL http: //dl.acm.org/citation.cfm?id=2337223.2337225. [1] R. Alur, R. Bodík, E. Dallal, D. Fisman, P. Garg, G. Juniwal, H. KressGazit, P. Madhusudan, M. M. K. Martin, M. Raghothaman, S. Saha, S. A. Seshia, R. Singh, A. Solar-Lezama, E. Torlak, and A. Udupa. Syntax-guided synthesis. In Dependable Software Systems Engineering, pages 1–25. 2015. [14] A. Leung, J. Sarracino, and S. Lerner. Interactive parser synthesis by example. In Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation, Portland, OR, USA, June 15-17, 2015, pages 565–574, 2015. doi: 10. 1145/2737924.2738002. URL http://doi.acm.org/10.1145/ 2737924.2738002. [2] D. W. Barowy, S. Gulwani, T. Hart, and B. Zorn. Flashrelate: Extracting relational data from semi-structured spreadsheets using examples. In Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2015, pages 218–228, New York, NY, USA, 2015. ACM. ISBN 978-1-4503-34686. doi: 10.1145/2737924.2737952. URL http://doi.acm.org/ 10.1145/2737924.2737952. [15] H. Lieberman. Your wish is my command: Programming by example. Morgan Kaufmann, 2001. [16] F. Long and M. Rinard. Automatic patch generation by learning correct code. In Proceedings of the 43rd Annual ACM SIGPLANSIGACT Symposium on Principles of Programming Languages, POPL 2016, pages 298–312, 2016. [3] S. M. Doane, D. S. McNamara, W. Kintsch, P. G. Polson, and D. M. Clawson. Prompt comprehension in unix command production. Memory & cognition, 20(4):327–343, 1992. [17] T. M. Mitchell. Generalization as search. Artif. Intell., 18(2), 1982. [4] J. K. Feser, S. Chaudhuri, and I. Dillig. Synthesizing data structure transformations from input-output examples. In Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation, Portland, OR, USA, June 15-17, 2015, pages 229–239, 2015. doi: 10.1145/2737924.2737977. URL http: //doi.acm.org/10.1145/2737924.2737977. [18] P. Osera and S. Zdancewic. Type-and-example-directed program synthesis. In Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation, Portland, OR, USA, June 15-17, 2015, pages 619–630, 2015. doi: 10. 1145/2737924.2738007. URL http://doi.acm.org/10.1145/ 2737924.2738007. [5] J. Furnkranz, D. Gamberger, and N. Lavrac. Rule learning in a nutshell. In Foundations of Rule Learning, Cognitive Technologies, pages 19–55. Springer Berlin Heidelberg, 2012. ISBN 978-3-54075196-0. doi: 10.1007/978-3-540-75197-7_2. URL http:// dx.doi.org/10.1007/978-3-540-75197-7_2. [19] G. Piatetsky-Shapiro. Discovery, analysis and presentation of strong rules. In G. Piatetsky-Shapiro and W. J. Frawley, editors, Knowledge Discovery in Databases, pages 229–248. AAAI Press, 1991. [20] V. Raychev, M. Schäfer, M. Sridharan, and M. T. Vechev. Refactoring with synthesis. In Proceedings of the 2013 ACM SIGPLAN International Conference on Object Oriented Programming Systems Languages & Applications, OOPSLA 2013, part of SPLASH 2013, Indianapolis, IN, USA, October 26-31, 2013, pages 339–354, 2013. doi: 10.1145/2509136.2509544. URL http://doi.acm.org/ 10.1145/2509136.2509544. [6] C. Goues, S. Forrest, and W. Weimer. Current challenges in automatic software repair. Software Quality Journal, 21(3):421–443, Sept. 2013. ISSN 0963-9314. doi: 10.1007/s11219-013-9208-0. URL http: //dx.doi.org/10.1007/s11219-013-9208-0. [7] S. Gulwani. Automating string processing in spreadsheets using inputoutput examples. In Proceedings of the 38th Annual ACM SIGPLANSIGACT Symposium on Principles of Programming Languages, POPL ’11, pages 317–330, New York, NY, USA, 2011. ACM. ISBN 9781-4503-0490-0. doi: 10.1145/1926385.1926423. URL http: //doi.acm.org/10.1145/1926385.1926423. [21] V. Raychev, M. Vechev, and E. Yahav. Code completion with statistical language models. In Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’14, pages 419–428, New York, NY, USA, 2014. ACM. ISBN 978-1-4503-2784-8. doi: 10.1145/2594291.2594321. URL http://doi.acm.org/10.1145/2594291.2594321. [8] S. Gulwani, W. R. Harris, and R. Singh. Spreadsheet data manipulation using examples. Commun. ACM, 55(8):97–105, Aug. 2012. ISSN 0001-0782. doi: 10.1145/2240236.2240260. URL http: //doi.acm.org/10.1145/2240236.2240260. [22] V. Raychev, M. T. Vechev, and A. Krause. Predicting program properties from "big code". In Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2015, Mumbai, India, January 15-17, 2015, pages 111–124, 2015. doi: 10.1145/2676726.2677009. URL http: //doi.acm.org/10.1145/2676726.2677009. [9] W. R. Harris and S. Gulwani. Spreadsheet table transformations from examples. In Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2011, San Jose, CA, USA, June 4-8, 2011, pages 317–328, 2011. doi: 10. 1145/1993498.1993536. URL http://doi.acm.org/10.1145/ 1993498.1993536. [23] E. Schkufza, R. Sharma, and A. Aiken. Stochastic superoptimization. In Architectural Support for Programming Languages and Operating Systems, ASPLOS ’13, Houston, TX, USA - March 16 - 20, 2013, pages 305–316, 2013. doi: 10.1145/2451116.2451150. URL http://doi.acm.org/10.1145/2451116.2451150. [10] B. Hartmann, D. MacDougall, J. Brandt, and S. R. Klemmer. What would other programmers do: Suggesting solutions to error messages. In Proceedings of the SIGCHI Conference on Human Factors in Computing Systems, CHI ’10, pages 1019–1028, New York, NY, USA, 2010. ACM. ISBN 978-1-60558-929-9. doi: 10. 1145/1753326.1753478. URL http://doi.acm.org/10.1145/ 1753326.1753478. [24] R. Singh and S. Gulwani. Synthesizing number transformations from input-output examples. In Proceedings of the 24th International Conference on Computer Aided Verification, CAV’12, pages 634–651, Berlin, Heidelberg, 2012. Springer-Verlag. ISBN 978-3-642-31423-0. doi: 10.1007/978-3-642-31424-7_44. URL http://dx.doi. org/10.1007/978-3-642-31424-7_44. [11] T. Lau, S. A. Wolfman, P. Domingos, and D. S. Weld. Programming by demonstration using version space algebra. Mach. Learn., 53(1-2):111–156, Oct. 2003. ISSN 0885-6125. doi: 10. 1023/A:1025671410623. URL http://dx.doi.org/10.1023/ A:1025671410623. [25] R. Singh and S. Gulwani. Learning semantic string transformations from examples. Proc. VLDB Endow., 5(8):740–751, Apr. 2012. ISSN 2150-8097. doi: 10.14778/2212351.2212356. URL http://dx. doi.org/10.14778/2212351.2212356. [12] V. Le and S. Gulwani. Flashextract: A framework for data extraction by examples. In Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’14, pages 542–553, New York, NY, USA, 2014. ACM. ISBN 978-14503-2784-8. doi: 10.1145/2594291.2594333. URL http:// doi.acm.org/10.1145/2594291.2594333. [26] R. Singh and A. Solar-Lezama. Synthesizing data structure manipulations from storyboards. In SIGSOFT FSE, pages 289–299, 2011. [27] A. Solar-Lezama. Program Synthesis By Sketching. PhD thesis, EECS Dept., UC Berkeley, 2008. [28] A. Solar-Lezama, R. Rabbah, R. Bodik, and K. Ebcioglu. Programming by sketching for bit-streaming programs. In PLDI, 2005. [13] C. Le Goues, M. Dewey-Vogt, S. Forrest, and W. Weimer. A systematic study of automated program repair: Fixing 55 out of 105 bugs for $8 each. In Proceedings of the 34th International Confer- [29] A. Udupa, A. Raghavan, J. V. Deshmukh, S. Mador-Haim, M. M. K. Martin, and R. Alur. TRANSIT: specifying protocols with concolic 13 2016/8/31 k, and si = s. If for every 1 ≤ i ≤ c, P CompF i(fi , E, i) holds, then we say that that f ixes is partially complete with respect to V , P CompF (f ixes, E). snippets. In ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’13, Seattle, WA, USA, June 16-19, 2013, pages 287–296, 2013. doi: 10.1145/2462156.2462174. URL http://doi.acm.org/10.1145/2462156.2462174. [30] M. Yakout, A. K. Elmagarmid, J. Neville, M. Ouzzani, and I. F. Ilyas. Guided data repair. Proc. VLDB Endow., 4(5):279–289, Feb. 2011. ISSN 2150-8097. doi: 10.14778/1952376.1952378. URL http://dx.doi.org/10.14778/1952376.1952378. [31] Y. Yuan, R. Alur, and B. T. Loo. Netegg: Programming network policies by examples. In Proceedings of the 13th ACM Workshop on Hot Topics in Networks, HotNets-XIII, Los Angeles, CA, USA, October 2728, 2014, pages 20:1–20:7, 2014. doi: 10.1145/2670518.2673879. URL http://doi.acm.org/10.1145/2670518.2673879. A. Definition 10 (fi -completeness). If there exists a V = {i1 , . . . , ij } such that Comp(cmd, err, E, V ) we say that fi is complete with respect to V at position i, CompF i(fi , E, V, i), iff: • P CompF i(fi , E, i). • fi = [t1 , . . . , tm ] such that for all ind, tind 6= Fstr(s) (for any s) iff the following properties hold. l For every ind ≤ m and l ≤ k, Jtind Kfun σl = s̄f ix [i] (where l l for all y ≤ j, σl (iy ) = (s̄cmd @s̄err )[iy ]). If there exists a Sub-lr function t such that for every ind ≤ n l and l ≤ k, , JtKfun σl = s̄f ix [i] (where for all y ≤ j, l l σl (iy ) = (s̄cmd @s̄err )[iy ]), then there exists x ≤ m such that tx = t. Proofs of Theorems 1, 2, and 3 We first define a notion of completeness for a symbolic rule. Intuitively a symbolic rule has to summarize all possible correct rules to be complete. Definition 11 (Fix completeness). If for every 1 ≤ i ≤ c, CompF i(fi , E, V, i) holds, then we say that that f ixes is complete with respect to V , CompF (f ixes, E, V ). Definition 6 (Command-string completeness). Let r = match cmd and err →s f ixes Definition 12 (Rule completeness). If there is a V such that Comp(cmd, err, E, V ) and CompF (f ixes, E, V ), we say that r is complete for E, CompR(r, E). be a symbolic rule such that cmd = [c1 , . . . , ca ], err = [m1 , . . . , mb ], f ixes = [f1 , . . . , fc ], and E = [e1 , . . . , en ] a sequence of examples. We say that cmd is complete for E and produces variables V1 , CompC(cmd, E, V1 ) iff for every 1 ≤ i ≤ a: Notice that for any permutation E 0 of E CompR(r, E) iff CompR(r, E 0 ). Proposition 13 (CompR and con). Let E a sequence of examples and r = match cmd and err →s f ixes be a symbolic rule. If CompR(r, E) then every concrete rule r0 ∈ con(r) is consistent with any example in E. Moreover, for every (non-symbolic) rule • ci = Str(s) (for some s) iff every example (s̄cmd , s̄err , s̄f ix ) in E is such that s̄cmd = [s1 , . . . , sk ], for some k, and sj = s. • ci = Var-Match(j, l, r) iff i ∈ V , i = j, and there exists two examples (s̄1cmd , s̄1err , s̄1f ix ) and (s̄2cmd , s̄2err , s̄2f ix ) in E such that s̄1cmd = [s1 , . . . , sk ], s̄2cmd = [s01 , . . . , s0k ], for some k, and sj 6= s0j . • If ci = Var-Match(j, l, r), then for every example (s̄cmd , s̄err , s̄f ix ) in E where s̄cmd = [s1 , . . . , sk ], l is a prefix of sj . Moreover, l is the longest such prefix. • If ci = Var-Match(j, l, r), then for every example (s̄cmd , s̄err , s̄f ix ) in E where s̄cmd = [s1 , . . . , sk ], r is a suffix of sj . Moreover, r is the longest such suffix. r1 = match cmd and err → [t1 , . . . , tn ] n n consistent with E = [(s̄1cmd , s̄1err , s̄1f ix ), . . . , (s̄n cmd , s̄err , s̄f ix )] the following is true: if for every i, ti 6= Fstr(s) iff for some j1 , j2 ≤ n s̄jf1ix [i] 6= s̄jf2ix [i], then r1 ∈ con(r). Proof. Immediate from Definition 12 and the definition of con. More specifically, assume there is some r0 ∈ con(r) not consistent with an example e ∈ E. The only way it can be inconsistent with s̄cmd or s̄err is if some match expression in cmd or err is a fixed string not equal to some string in s̄cmd or s̄err . Definition 8 precludes this possibility. Similarly, it follows from Definition 9 that if one of the fix expressions is a constant string, then it is consistent with every example fix. By Definition 10, if it is a set of S UB - LR expressions, then each one is consistent with every example. Definition 7 (Error-string completeness). Analogously, we say that err is complete for E and produces variables V2 , CompE(err, E, V2 ), iff for every 1 ≤ i ≤ b: • mi = Str(s) (for some s) iff every example (s̄cmd , s̄err , s̄f ix ) in E is such that s̄cmd = [s1 , . . . , sk ], for some k, and sj = s. • mi = Var-Match(j, l, r) iff i ∈ V , i + a = j, and there exists two examples (s̄1cmd , s̄1err , s̄1f ix ) and (s̄2cmd , s̄2err , s̄2f ix ) in E such that s̄1err = [s1 , . . . , sk ], s̄2err = [s01 , . . . , s0k ], for some k, and si 6= s0i . • If mi = Var-Match(j, l, r), and i + a = j, then for every example (s̄cmd , s̄err , s̄f ix ) in E where s̄err = [s1 , . . . , sk ], l is a prefix of si . Moreover, l is the longest such prefix. • If mi = Var-Match(j, l, r), and i + a = j then for every example (s̄cmd , s̄err , s̄f ix ) in E where s̄err = [s1 , . . . , sk ], r is a suffix of si . Moreover, r is the longest such suffix. We now show that S YNTH S UBSTRING and S YNTH F IX have the intended behaviour with respect to Definition 12. Lemma 14 (Correctness of S YNTH S UBSTRING). Let n n E = [(s̄1cmd , s̄1err , s̄1f ix ), . . . , (s̄n cmd , s̄err , s̄f ix )] be a sequence v of examples where every s̄f ix has length m, V = {i1 , . . . , ij } be a set of variables, and i ≤ m be an index in the output fix. If there exist a and b such that s̄afix [i] 6= s̄bf ix [i], then SynthSubstring(E, V, i) = S iff Comp(S, E, V, i). Definition 8 (Input completeness). If both CompC(cmd, E, V1 ) and CompE(err, E, V2 ) hold we say that cmd and err are complete for E and produce variables V1 ∪ V2 , Comp(cmd, err, E, V1 ∪ V2 ). Proof. This lemma states that S YNTH S UBSTRING returns all the S UB - LR functions consistent with the given examples. Again the proof is by induction on the length of E. The base case |E| = 1 follows from the definition of A LL S UBSTRINGS. The inductive step is also trivial: S YNTH S UBSTRING simply runs all the functions computed so far on the added example and filters out those that are not consistent with it. Since, by IH, the varaible F was correct at Definition 9 (Partial fi -completeness). We say that fi is partially complete, P CompF i(fi , E, i), with respect to E if the following condition holds: fi = [Fstr(s)] (for some s) iff every example (s̄cmd , s̄err , s̄f ix ) in E is such that s̄f ix = [s1 , . . . , sk ], for some 14 2016/8/31 Lemma 17 (Correctness of R EFINE RULE). Let r be a symbolic rule, E be a sequence of examples, e be an example, and r0 = RefineRule(r, E, e). If CompR(r, E) then CompR(r0 , e :: E). the beginning of the loop, it remains correct. Notice that the order of the examples does not matter. Lemma 15 (Correctness of S YNTH F IX). Let S = [s1 , . . . , sn ] be a list of strings, T = [t1 , . . . , tn ] be a sequence of symbolic fix expressions, Proof. Immediate from Definition 12 and Lemmas 15 and 16. n n E = [(s̄1cmd , s̄1err , s̄1f ix ), . . . , (s̄n cmd , s̄err , s̄f ix )] Lemma 18 (Correctness of S YNTH RULES). Let E be a sequence of examples. If r0 = SynthRules(E) then CompR(r, E). s̄vf ix be a sequence of examples where every has length m, e = (s̄cmd , s̄err , s̄f ix ) be an example such that for each 1 ≤ i ≤ n, s̄f ix [i] = si , and V be a set of variables. If P CompF (T, E), then SynthFix(S, T, e :: E, V ) = f ixes iff CompF (f ixes, e :: E, V ). Proof. By induction on the length of E. Case |E| = 1 and E = [e]: the result of C ONST RULE(e) clearly satisfies CompR(r, E). The inductive step follows from Lemma 17. We can now conclude the proofs of Theorems 1, 2, and 3. Theorem 1 and 2 follow from the order invariance of CompR(r, E) and from Proposition 13 and Lemmas 18. Proof. Immediate by induction on m and by using Lemma 14 at each step. As S YNTH F IX iterates over each string in the example fix, and compares it to the corresponding fix expression, we can see that the only interesting case of the proof is when ti is either a fixed string not equal to the correpsonding s̄n+1 f ix [i] in e, or ti is a set of S UB - LR expressions. In this case, correctness follows directly from Lemma 14, as S YNTH F IX calls S YNTH S UBSTRING to refine the set of substring operation to those generating s̄n+1 f ix [i] as well as all other s̄f ix [i] values. Proof of Theorem 3 Let n n E = [(s̄1cmd , s̄1err , s̄1f ix ), . . . , (s̄n cmd , s̄err , s̄f ix )] be a sequence of examples, S YNTH RULES(E) = r = match cmd and err →s f ixes be the symbolic rule for E and r0 = match cmd0 and err0 → f ix0 be a concrete rule that is consistent with all the examples in E. If r0 belongs to con(r) then we are done. Assume it doesn’t. Case 1. cmd = cmd0 and err = err0 . Then by Proposition 13 there exists some ti1 , . . . , tik such that each tiv is of the form S UB - LR(pvL , pvR , lv , rv , VAR(jv )), and for all j ≤ n s̄jf ix [iv ] = s for some s (i.e., the output is a function of the input, but all examples can be captured using a constant output). In this case it is enough to create a new example e0 starting from any example (s̄cmd , s̄err , s̄f ix ) ∈ E where for each iv we modify sjv = (s̄cmd @s̄err )[jv ] so that S UB - LR(pvL , pvR , lv , rv , VAR(jv )) now returns a value different from the previous one (this can be done by simply adding a new character between pvL and pvR ). s̄f ix is replaced by the result of applying r0 to the modified input. Case 2. cmd@err 6= cmd0 @err0 . This means that r0 uses more variables then r (notice that from Definition 12 the set of variables used by r0 is necessary). This can be fixed by changing the input of any example (s̄cmd , s̄err , s̄f ix ) ∈ E. For each variable VAR(i) that is in cmd0 @err0 but not in cmd@err replace the string (s̄cmd @s̄err )[i] = a1 . . . an with ba1 . . . an where b is a symbol not appearing in a1 . . . an . s̄f ix is replaced by the result of applying r0 to the modified input. If the rule is still not in con(r0 ) we can then modify the example using the techniques from Case 1 since now cmd = cmd0 and err = err0 . Next we show the correctness of R EFINE RULE and F INDVARI ABLES . Lemma 16 (Correctness of F INDVARIABLES). Let n n E = [(s̄1cmd , s̄1err , s̄1f ix ), . . . , (s̄n cmd , s̄err , s̄f ix )] be a sequence of examples, and cmd and err be two sequences of match expressions of lengths |s̄icmd | and |s̄ierr | respectively. If there exists two sets of variables V1 and V2 such that CompC(cmd, E[1 :: (n − 1)], V1 ) and CompE(err, E[1 :: (n − 1)], V2 ), then (cmd0 , V10 ) = FindVariables(s̄n then cmd , cmd, 0), CompC(cmd0 , E, V10 ). i • if (err 0 , V20 ) = FindVariables(s̄n err , err, |s̄cmd |), then CompE(err0 , E, V20 ). • if Proof. The two statements can be proved separately but the proof is identical. The proofs are both by induction on the length of the first argument of F INDVARIABLES and are very simple case analysis following Definitions 6 and 7. W.L.O.G, consider the case for cmd. Over a run of F INDVARIABLES, a S TR(s) in cmd is only changed if, at the nth iteration of the loop, cmd[i] is S TR(S) where S is not equal to s̄n cmd [i]. In that case F INDVARIABLES introduces a new variable match expression VAR -M ATCH(i, l, r) where l and r are (respectively) the longest shared prefix and suffix of S and s̄n cmd [i]. By the I.H, cmd was command complete. It follows directly from Definition 6 that command completeness continues to hold. A VAR -M ATCH(i, l, r) in cmd is only changed if, at iteration n, the longest common prefix (suffix), x, shared by s̄n cmd [i] and l (r) is not equal to l (r). In this case VAR -M ATCH(i, l, r) is replaced by VAR -M ATCH(i, l0 , r) (VAR -M ATCH(i, l, r0 )), where r0 (l0 ) is equal to the common prefix (suffix) x. By the I.H, l was the longest prefix (suffix) shared by the first n − 1 values of s̄kcmd [i]. Clearly, x = r0 (l0 ) is the longest prefix (suffix) shared by the first n values of s̄kcmd [i]. Moreover, by the I.H. cmd satisfied all other criteria for command completeness. Thus, it follows that command completeness continues to hold. It is clear that determining the shorteset prefix and suffix shared by every s̄kcmd [i] does not depend on the order in which the examples are presented. 15 2016/8/31
6cs.PL
Learning to Compose Neural Networks for Question Answering Jacob Andreas and Marcus Rohrbach and Trevor Darrell and Dan Klein Department of Electrical Engineering and Computer Sciences University of California, Berkeley {jda,rohrbach,trevor,klein}@eecs.berkeley.edu arXiv:1601.01705v4 [cs.CL] 7 Jun 2016 Abstract We describe a question answering model that applies to both images and structured knowledge bases. The model uses natural language strings to automatically assemble neural networks from a collection of composable modules. Parameters for these modules are learned jointly with network-assembly parameters via reinforcement learning, with only (world, question, answer) triples as supervision. Our approach, which we term a dynamic neural module network, achieves state-of-theart results on benchmark datasets in both visual and structured domains. 1 What cities are in Georgia? Atlanta Module inventory (Section 4.1) and lookup relate and (a) find find relate in lookup Georgia (c) Network layout (Section 4.2) Knowledge source and find[city] city Montgomery relate[in] Georgia (b) lookup[Georgia] (d) Atlanta Figure 1: A learned syntactic analysis (a) is used to assemble a collection of neural modules (b) into a deep neural network (c), and applied to a world representation (d) to produce an answer. Introduction This paper presents a compositional, attentional model for answering questions about a variety of world representations, including images and structured knowledge bases. The model translates from questions to dynamically assembled neural networks, then applies these networks to world representations (images or knowledge bases) to produce answers. We take advantage of two largely independent lines of work: on one hand, an extensive literature on answering questions by mapping from strings to logical representations of meaning; on the other, a series of recent successes in deep neural models for image recognition and captioning. By constructing neural networks instead of logical forms, our model leverages the best aspects of both linguistic compositionality and continuous representations. Our model has two components, trained jointly: first, a collection of neural “modules” that can be freely composed (Figure 1a); second, a network layout predictor that assembles modules into complete deep networks tailored to each question (Figure 1b). Previous work has used manually-specified modular structures for visual learning (Andreas et al., 2016). Here we: • learn a network structure predictor jointly with module parameters themselves • extend visual primitives from previous work to reason over structured world representations Training data consists of (world, question, answer) triples: our approach requires no supervision of network layouts. We achieve state-of-the-art performance on two markedly different question answering tasks: one with questions about natural images, and another with more compositional questions about United States geography.1 2 Deep networks as functional programs We begin with a high-level discussion of the kinds of composed networks we would like to learn. 1 We have released our code at http://github.com/ jacobandreas/nmn2 Andreas et al. (2016) describe a heuristic approach for decomposing visual question answering tasks into sequence of modular sub-problems. For example, the question What color is the bird? might be answered in two steps: first, “where is the bird?” (Figure 2a), second, “what color is that part of the image?” (Figure 2c). This first step, a generic module called find, can be expressed as a fragment of a neural network that maps from image features and a lexical item (here bird) to a distribution over pixels. This operation is commonly referred to as the attention mechanism, and is a standard tool for manipulating images (Xu et al., 2015) and text representations (Hermann et al., 2015). The first contribution of this paper is an extension and generalization of this mechanism to enable fully-differentiable reasoning about more structured semantic representations. Figure 2b shows how the same module can be used to focus on the entity Georgia in a non-visual grounding domain; more generally, by representing every entity in the universe of discourse as a feature vector, we can obtain a distribution over entities that corresponds roughly to a logical set-valued denotation. Having obtained such a distribution, existing neural approaches use it to immediately compute a weighted average of image features and project back into a labeling decision—a describe module (Figure 2c). But the logical perspective suggests a number of novel modules that might operate on attentions: e.g. combining them (by analogy to conjunction or disjunction) or inspecting them directly without a return to feature space (by analogy to quantification, Figure 2d). These modules are discussed in detail in Section 4. Unlike their formal counterparts, they are differentiable end-to-end, facilitating their integration into learned models. Building on previous work, we learn behavior for a collection of heterogeneous modules from (world, question, answer) triples. The second contribution of this paper is a model for learning to assemble such modules compositionally. Isolated modules are of limited use—to obtain expressive power comparable to either formal approaches or monolithic deep networks, they must be composed into larger structures. Figure 2 shows simple examples of composed structures, but for realistic question-answering tasks, even larger net- (c) black and white true describe exists color (d) Montgomery Georgia Atlanta (a) find bird find state (b) Montgomery Georgia Atlanta Figure 2: Simple neural module networks, corresponding to the questions What color is the bird? and Are there any states? (a) A neural find module for computing an attention over pixels. (b) The same operation applied to a knowledge base. (c) Using an attention produced by a lower module to identify the color of the region of the image attended to. (d) Performing quantification by evaluating an attention directly. works are required. Thus our goal is to automatically induce variable-free, tree-structured computation descriptors. We can use a familiar functional notation from formal semantics (e.g. Liang et al., 2011) to represent these computations.2 We write the two examples in Figure 2 as (describe[color] find[bird]) and (exists find[state]) respectively. These are network layouts: they specify a structure for arranging modules (and their lexical parameters) into a complete network. Andreas et al. (2016) use hand-written rules to deterministically transform dependency trees into layouts, and are restricted to producing simple structures like the above for non-synthetic data. For full generality, we will need to solve harder problems, like transforming What cities are in Georgia? (Figure 1) into (and find[city] (relate[in] lookup[Georgia])) In this paper, we present a model for learning to select such structures from a set of automatically generated candidates. We call this model a dynamic neural module network. 2 But note that unlike formal semantics, the behavior of the primitive functions here is itself unknown. 3 Related work There is an extensive literature on database question answering, in which strings are mapped to logical forms, then evaluated by a black-box execution model to produce answers. Supervision may be provided either by annotated logical forms (Wong and Mooney, 2007; Kwiatkowski et al., 2010; Andreas et al., 2013) or from (world, question, answer) triples alone (Liang et al., 2011; Pasupat and Liang, 2015). In general the set of primitive functions from which these logical forms can be assembled is fixed, but one recent line of work focuses on inducing new predicates functions automatically, either from perceptual features (Krishnamurthy and Kollar, 2013) or the underlying schema (Kwiatkowski et al., 2013). The model we describe in this paper has a unified framework for handling both the perceptual and schema cases, and differs from existing work primarily in learning a differentiable execution model with continuous evaluation results. Neural models for question answering are also a subject of current interest. These include approaches that model the task directly as a multiclass classification problem (Iyyer et al., 2014), models that attempt to embed questions and answers in a shared vector space (Bordes et al., 2014) and attentional models that select words from documents sources (Hermann et al., 2015). Such approaches generally require that answers can be retrieved directly based on surface linguistic features, without requiring intermediate computation. A more structured approach described by Yin et al. (2015) learns a query execution model for database tables without any natural language component. Previous efforts toward unifying formal logic and representation learning include those of Grefenstette (2013), Krishnamurthy and Mitchell (2013), Lewis and Steedman (2013), and Beltagy et al. (2013). The visually-grounded component of this work relies on recent advances in convolutional networks for computer vision (Simonyan and Zisserman, 2014), and in particular the fact that late convolutional layers in networks trained for image recognition contain rich features useful for other vision tasks while preserving spatial information. These features have been used for both image captioning (Xu et al., 2015) and visual QA (Yang et al., 2015). Most previous approaches to visual question answering either apply a recurrent model to deep representations of both the image and the question (Ren et al., 2015; Malinowski et al., 2015), or use the question to compute an attention over the input image, and then answer based on both the question and the image features attended to (Yang et al., 2015; Xu and Saenko, 2015). Other approaches include the simple classification model described by Zhou et al. (2015) and the dynamic parameter prediction network described by Noh et al. (2015). All of these models assume that a fixed computation can be performed on the image and question to compute the answer, rather than adapting the structure of the computation to the question. As noted, Andreas et al. (2016) previously considered a simple generalization of these attentional approaches in which small variations in the network structure per-question were permitted, with the structure chosen by (deterministic) syntactic processing of questions. Other approaches in this general family include the “universal parser” sketched by Bottou (2014), the graph transformer networks of Bottou et al. (1997), the knowledge-based neural networks of Towell and Shavlik (1994) and the recursive neural networks of Socher et al. (2013), which use a fixed tree structure to perform further linguistic analysis without any external world representation. We are unaware of previous work that simultaneously learns both parameters for and structures of instance-specific networks. 4 Model Recall that our goal is to map from questions and world representations to answers. This process involves the following variables: 1. 2. 3. 4. 5. w a world representation x a question y an answer z a network layout θ a collection of model parameters Our model is built around two distributions: a layout model p(z|x; θ` ) which chooses a layout for a sentence, and a execution model pz (y|w; θe ) which applies the network specified by z to w. For ease of presentation, we introduce these models in reverse order. We first imagine that z is always observed, and in Section 4.1 describe how to evaluate and learn modules parameterized by θe within fixed structures. In Section 4.2, we move to the real scenario, where z is unknown. We describe how to predict layouts from questions and learn θe and θ` jointly without layout supervision. 4.1 Evaluating modules The modules used in this paper are shown below, with names and type constraints in the first row and a description of the module’s computation following. Lookup Given a layout z, we assemble the corresponding modules into a full neural network (Figure 1c), and apply it to the knowledge representation. Intermediate results flow between modules until an answer is produced at the root. We denote the output of the network with layout z on input world w as JzKw ; when explicitly referencing the substructure of z, we can alternatively write Jm(h1 , h2 )K for a top-level module m with submodule outputs h1 and h2 . We then define the execution model: pz (y|w) = (JzKw )y the world representation, represented as a collection of vectors w1 , w2 , . . . (or W expressed as a matrix). The nonlinearity σ denotes a rectified linear unit. (1) (This assumes that the root module of z produces a distribution over labels y.) The set of possible layouts z is restricted by module type constraints: some modules (like find above) operate directly on the input representation, while others (like describe above) also depend on input from specific earlier modules. Two base types are considered in this paper are Attention (a distribution over pixels or entities) and Labels (a distribution over answers). Parameters are tied across multiple instances of the same module, so different instantiated networks may share some parameters but not others. Modules have both parameter arguments (shown in square brackets) and ordinary inputs (shown in parentheses). Parameter arguments, like the running bird example in Section 2, are provided by the layout, and are used to specialize module behavior for particular lexical items. Ordinary inputs are the result of computation lower in the network. In addition to parameter-specific weights, modules have global weights shared across all instances of the module (but not shared with other modules). We write A, a, B, b, . . . for global weights and ui , v i for weights associated with the parameter argument i. ⊕ and denote (possibly broadcasted) elementwise addition and multiplication respectively. The complete set of global weights and parameter-specific weights constitutes θe . Every module has access to (→ Attention) lookup[i] produces an attention focused entirely at the index f (i), where the relationship f between words and positions in the input map is known ahead of time (e.g. string matches on database fields). Jlookup[i]K = ef (i) (2) where ei is the basis vector that is 1 in the ith position and 0 elsewhere. Find (→ Attention) computes a distribution over indices by concatenating the parameter argument with each position of the input feature map, and passing the concatenated vector through a MLP: find[i] Jfind[i]K = softmax(a σ(Bv i ⊕ CW ⊕ d)) (3) (Attention → Attention) directs focus from one region of the input to another. It behaves much like the find module, but also conditions its behavior P on the current region of attention h. Let w̄(h) = k hk wk , where hk is the k th element of h. Then, Relate relate Jrelate[i](h)K = softmax(a σ(Bv i ⊕ CW ⊕ Dw̄(h) ⊕ e)) (4) And (Attention* → Attention) and performs an operation analogous to set intersection for attentions. The analogy to probabilistic logic suggests multiplying probabilities: Jand(h1 , h2 , . . .)K = h1 h2 ··· (5) (Attention → Labels) under the input attention. This average is then used to predict an answer representation. With w̄ as above, Describe describe[i] computes a weighted average of w Jdescribe[i](h)K = softmax(Aσ(B w̄(h) + v i )) (6) (Attention → Labels) is the existential quantifier, and inspects the incoming attention directly to produce a label, rather than an intermediate feature vector like describe:    Jexists](h)K = softmax max hk a + b (7) Exists exists k What cities are in Georgia? (a) be city Georgia what in (b) relate[in] find[city] lookup[Georgia] (c) and relate[in] find[city] lookup[Georgia] (d) relate[in] lookup[Georgia] ... Figure 3: Generation of layout candidates. The input sentence (a) is represented as a dependency parse (b). Fragments of this dependency parse are then associated with appropriate modules (c), and these fragments are assembled into full layouts (d). With z observed, the model we have described so far corresponds largely to that of Andreas et al. (2016), though the module inventory is different— in particular, our new exists and relate modules do not depend on the two-dimensional spatial structure of the input. This enables generalization to nonvisual world representations. Learning in this simplified setting is straightforward. Assuming the top-level module in each layout is a describe or exists module, the fully- instantiated network corresponds to a distribution over labels P conditioned on layouts. To train, we maximize (w,y,z) log pz (y|w; θe ) directly. This can be understood as a parameter-tying scheme, where the decisions about which parameters to tie are governed by the observed layouts z. 4.2 Assembling networks Next we describe the layout model p(z|x; θ` ). We first use a fixed syntactic parse to generate a small set of candidate layouts, analogously to the way a semantic grammar generates candidate semantic parses in previous work (Berant and Liang, 2014). A semantic parse differs from a syntactic parse in two primary ways. First, lexical items must be mapped onto a (possibly smaller) set of semantic primitives. Second, these semantic primitives must be combined into a structure that closely, but not exactly, parallels the structure provided by syntax. For example, state and province might need to be identified with the same field in a database schema, while all states have a capital might need to be identified with the correct (in situ) quantifier scope. While we cannot avoid the structure selection problem, continuous representations simplify the lexical selection problem. For modules that accept a vector parameter, we associate these parameters with words rather than semantic tokens, and thus turn the combinatorial optimization problem associated with lexicon induction into a continuous one. Now, in order to learn that province and state have the same denotation, it is sufficient to learn that their associated parameters are close in some embedding space—a task amenable to gradient descent. (Note that this is easy only in an optimizability sense, and not an information-theoretic one—we must still learn to associate each independent lexical item with the correct vector.) The remaining combinatorial problem is to arrange the provided lexical items into the right computational structure. In this respect, layout prediction is more like syntactic parsing than ordinary semantic parsing, and we can rely on an off-the-shelf syntactic parser to get most of the way there. In this work, syntactic structure is provided by the Stanford dependency parser (De Marneffe and Manning, 2008). The construction of layout candidates is depicted in Figure 3, and proceeds as follows: 1. Represent the input sentence as a dependency tree. 2. Collect all nouns, verbs, and prepositional phrases that are attached directly to a wh-word or copula. 3. Associate each of these with a layout fragment: Ordinary nouns and verbs are mapped to a single find module. Proper nouns to a single lookup module. Prepositional phrases are mapped to a depth-2 fragment, with a relate module for the preposition above a find module for the enclosed head noun. 4. Form subsets of this set of layout fragments. For each subset, construct a layout candidate by joining all fragments with an and module, and inserting either a measure or describe module at the top (each subset thus results in two parse candidates.) All layouts resulting from this process feature a relatively flat tree structure with at most one conjunction and one quantifier. This is a strong simplifying assumption, but appears sufficient to cover most of the examples that appear in both of our tasks. As our approach includes both categories, relations and simple quantification, the range of phenomena considered is generally broader than previous perceptually-grounded QA work (Krishnamurthy and Kollar, 2013; Matuszek et al., 2012). Having generated a set of candidate parses, we need to score them. This is a ranking problem; as in the rest of our approach, we solve it using standard neural machinery. In particular, we produce an LSTM representation of the question, a feature-based representation of the query, and pass both representations through a multilayer perceptron (MLP). The query feature vector includes indicators on the number of modules of each type present, as well as their associated parameter arguments. While one can easily imagine a more sophisticated parsescoring model, this simple approach works well for our tasks. Formally, for a question x, let hq (x) be an LSTM encoding of the question (i.e. the last hidden layer of an LSTM applied word-by-word to the input question). Let {z1 , z2 , . . .} be the proposed layouts for x, and let f (zi ) be a feature vector representing the ith layout. Then the score s(zi |x) for the layout zi is s(zi |x) = a> σ(Bhq (x) + Cf (zi ) + d) (8) i.e. the output of an MLP with inputs hq (x) and f (zi ), and parameters θ` = {a, B, C, d}. Finally, we normalize these scores to obtain a distribution: n .X s(zi |x) p(zi |x; θ` ) = e es(zj |x) (9) j=1 Having defined a layout selection module p(z|x; θ` ) and a network execution model pz (y|w; θe ), we are ready to define a model for predicting answers given only (world, question) pairs. The key constraint is that we want to minimize evaluations of pz (y|w; θe ) (which involves expensive application of a deep network to a large input representation), but can tractably evaluate p(z|x; θ` ) for all z (which involves application of a shallow network to a relatively small set of candidates). This is the opposite of the situation usually encountered semantic parsing, where calls to the query execution model are fast but the set of candidate parses is too large to score exhaustively. In fact, the problem more closely resembles the scenario faced by agents in the reinforcement learning setting (where it is cheap to score actions, but potentially expensive to execute them and obtain rewards). We adopt a common approach from that literature, and express our model as a stochastic policy. Under this policy, we first sample a layout z from a distribution p(z|x; θ` ), and then apply z to the knowledge source and obtain a distribution over answers p(y|z, w; θe ). After z is chosen, we can train the execution model directly by maximizing log p(y|z, w; θe ) with respect to θe as before (this is ordinary backpropagation). Because the hard selection of z is nondifferentiable, we optimize p(z|x; θ` ) using a policy gradient method. The gradient of the reward surface J with respect to the parameters of the policy is ∇J(θ` ) = E[∇ log p(z|x; θ` ) · r] (10) (this is the REINFORCE rule (Williams, 1992)). Here the expectation is taken with respect to rollouts of the policy, and r is the reward. Because our goal is to select the network that makes the most accurate predictions, we take the reward to be identically the negative log-probability from the execution phase, i.e. E[(∇ log p(z|x; θ` )) · log p(y|z, w; θe )] (11) Thus the update to the layout-scoring model at each timestep is simply the gradient of the log-probability of the chosen layout, scaled by the accuracy of that layout’s predictions. At training time, we approximate the expectation with a single rollout, so at each step we update θ` in the direction (∇ log p(z|x; θ` ))· log p(y|z, w; θe ) for a single z ∼ p(z|x; θ` ). θe and θ` are optimized using ADADELTA (Zeiler, 2012) with ρ = 0.95, ε = 1e−6 and gradient clipping at a norm of 10. test-dev Zhou (2015) Noh (2015) Yang (2015) NMN D-NMN What is in the sheep’s ear? What color is she wearing? What is the man dragging? (describe[what] (and find[sheep] find[ear])) (describe[color] find[wear]) (describe[what] find[man]) tag white boat (board) Figure 4: Sample outputs for the visual question answering task. The second row shows the final attention provided as input to the top-level describe module. For the first two examples, the model produces reasonable parses, attends to the correct region of the images (the ear and the woman’s clothing), and generates the correct answer. In the third image, the verb is discarded and a wrong answer is produced. 5 Experiments The framework described in this paper is general, and we are interested in how well it performs on datasets of varying domain, size and linguistic complexity. To that end, we evaluate our model on tasks at opposite extremes of both these criteria: a large visual question answering dataset, and a small collection of more structured geography questions. 5.1 Questions about images Our first task is the recently-introduced Visual Question Answering challenge (VQA) (Antol et al., 2015). The VQA dataset consists of more than 200,000 images paired with human-annotated questions and answers, as in Figure 4. We use the VQA 1.0 release, employing the development set for model selection and hyperparameter tuning, and reporting final results from the evaluation server on the test-standard set. For the experiments described in this section, the input feature representations wi are computed by the the fifth convolutional layer of a 16-layer VGGNet after pooling (Simonyan and Zisserman, 2014). Input images are scaled to 448×448 before computing their representations. We found that performance on this task was test-std Yes/No Number Other All All 76.6 80.7 79.3 81.2 81.1 35.0 37.2 36.6 38.0 38.6 42.6 41.7 46.1 44.0 45.5 55.7 57.2 58.7 58.6 59.4 55.9 57.4 58.9 58.7 59.4 Table 1: Results on the VQA test server. NMN is the parameter-tying model from Andreas et al. (2015), and D-NMN is the model described in this paper. best if the candidate layouts were relatively simple: only describe, and and find modules are used, and layouts contain at most two conjuncts. One weakness of this basic framework is a difficulty modeling prior knowledge about answers (of the form most bears are brown). This kinds of linguistic “prior” is essential for the VQA task, and easily incorporated. We simply introduce an extra hidden layer for recombining the final module network output with the input sentence representation hq (x) (see Equation 8), replacing Equation 1 with: log pz (y|w, x) = (Ahq (x) + BJzKw )y (12) (Now modules with output type Labels should be understood as producing an answer embedding rather than a distribution over answers.) This allows the question to influence the answer directly. Results are shown in Table 1. The use of dynamic networks provides a small gain, most noticeably on ”other” questions. We achieve state-of-the-art results on this task, outperforming a highly effective visual bag-of-words model (Zhou et al., 2015), a model with dynamic network parameter prediction (but fixed network structure) (Noh et al., 2015), a more conventional attentional model (Yang et al., 2015), and a previous approach using neural module networks with no structure prediction (Andreas et al., 2016). Some examples are shown in Figure 4. In general, the model learns to focus on the correct region of the image, and tends to consider a broad window around the region. This facilitates answering questions like Where is the cat?, which requires knowledge of the surroundings as well as the object in question. Accuracy Model LSP-F LSP-W NMN D-NMN GeoQA GeoQA+Q 48 51 51.7 54.3 – – 35.7 42.9 Is Key Largo an island? (exists (and lookup[key-largo] find[island])) yes: correct What national parks are in Florida? (and find[park] (relate[in] lookup[florida])) everglades: correct Table 2: Results on the GeoQA dataset, and the GeoQA dataset with quantification. Our approach outperforms both a purely logical model (LSP-F) and a model with learned perceptual predicates (LSP-W) on the original dataset, and a fixedstructure NMN under both evaluation conditions. 5.2 What are some beaches in Florida? (exists (and lookup[beach] (relate[in] lookup[florida]))) yes (daytona-beach): wrong parse What beach city is there in Florida? Questions about geography The next set of experiments we consider focuses on GeoQA, a geographical question-answering task first introduced by Krishnamurthy and Kollar (2013). This task was originally paired with a visual question answering task much simpler than the one just discussed, and is appealing for a number of reasons. In contrast to the VQA dataset, GeoQA is quite small, containing only 263 examples. Two baselines are available: one using a classical semantic parser backed by a database, and another which induces logical predicates using linear classifiers over both spatial and distributional features. This allows us to evaluate the quality of our model relative to other perceptually grounded logical semantics, as well as strictly logical approaches. The GeoQA domain consists of a set of entities (e.g. states, cities, parks) which participate in various relations (e.g. north-of, capital-of). Here we take the world representation to consist of two pieces: a set of category features (used by the find module) and a different set of relational features (used by the relate module). For our experiments, we use a subset of the features originally used by Krishnamurthy et al. The original dataset includes no quantifiers, and treats the questions What cities are in Texas? and Are there any cities in Texas? identically. Because we are interested in testing the parser’s ability to predict a variety of different structures, we introduce a new version of the dataset, GeoQA+Q, which distinguishes these two cases, and expects a Boolean answer to questions of the second kind. Results are shown in Table 2. As in the original work, we report the results of leave-oneenvironment-out cross-validation on the set of 10 en- (and lookup[beach] lookup[city] (relate[in] lookup[florida])) [none] (daytona-beach): wrong module behavior Figure 5: Example layouts and answers selected by the model on the GeoQA dataset. For incorrect predictions, the correct answer is shown in parentheses. vironments. Our dynamic model (D-NMN) outperforms both the logical (LSP-F) and perceptual models (LSP-W) described by (Krishnamurthy and Kollar, 2013), as well as a fixed-structure neural module net (NMN). This improvement is particularly notable on the dataset with quantifiers, where dynamic structure prediction produces a 20% relative improvement over the fixed baseline. A variety of predicted layouts are shown in Figure 5. 6 Conclusion We have introduced a new model, the dynamic neural module network, for answering queries about both structured and unstructured sources of information. Given only (question, world, answer) triples as training data, the model learns to assemble neural networks on the fly from an inventory of neural models, and simultaneously learns weights for these modules so that they can be composed into novel structures. Our approach achieves state-of-the-art results on two tasks. We believe that the success of this work derives from two factors: Continuous representations improve the expressiveness and learnability of semantic parsers: by replacing discrete predicates with differentiable neural network fragments, we bypass the challenging combinatorial optimization problem associated with induction of a semantic lexicon. In structured world representations, neural predicate representations allow the model to invent reusable attributes and relations not expressed in the schema. Perhaps more importantly, we can extend compositional questionanswering machinery to complex, continuous world representations like images. Semantic structure prediction improves generalization in deep networks: by replacing a fixed network topology with a dynamic one, we can tailor the computation performed to each problem instance, using deeper networks for more complex questions and representing combinatorially many queries with comparatively few parameters. In practice, this results in considerable gains in speed and sample efficiency, even with very little training data. These observations are not limited to the question answering domain, and we expect that they can be applied similarly to tasks like instruction following, game playing, and language generation. Acknowledgments JA is supported by a National Science Foundation Graduate Fellowship. MR is supported by a fellowship within the FIT weltweit-Program of the German Academic Exchange Service (DAAD). This work was additionally supported by DARPA, AFRL, DoD MURI award N000141110688, NSF awards IIS1427425 and IIS-1212798, and the Berkeley Vision and Learning Center. References Jacob Andreas, Andreas Vlachos, and Stephen Clark. 2013. Semantic parsing as machine translation. In Proceedings of the Annual Meeting of the Association for Computational Linguistics, Sofia, Bulgaria. Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Dan Klein. 2016. Neural module networks. In Proceedings of the Conference on Computer Vision and Pattern Recognition. Stanislaw Antol, Aishwarya Agrawal, Jiasen Lu, Margaret Mitchell, Dhruv Batra, C Lawrence Zitnick, and Devi Parikh. 2015. VQA: Visual question answering. In Proceedings of the International Conference on Computer Vision. Islam Beltagy, Cuong Chau, Gemma Boleda, Dan Garrette, Katrin Erk, and Raymond Mooney. 2013. Montague meets markov: Deep semantics with probabilistic logical form. Proceedings of the Joint Conference on Distributional and Logical Semantics, pages 11– 21. Jonathan Berant and Percy Liang. 2014. Semantic parsing via paraphrasing. In Proceedings of the Annual Meeting of the Association for Computational Linguistics, volume 7, page 92. Antoine Bordes, Sumit Chopra, and Jason Weston. 2014. Question answering with subgraph embeddings. Proceedings of the Conference on Empirical Methods in Natural Language Processing. Léon Bottou, Yoshua Bengio, and Yann Le Cun. 1997. Global training of document processing systems using graph transformer networks. In Proceedings of the Conference on Computer Vision and Pattern Recognition, pages 489–494. IEEE. Léon Bottou. 2014. From machine learning to machine reasoning. Machine learning, 94(2):133–149. Marie-Catherine De Marneffe and Christopher D Manning. 2008. The Stanford typed dependencies representation. In Proceedings of the International Conference on Computational Linguistics, pages 1–8. Edward Grefenstette. 2013. Towards a formal distributional semantics: Simulating logical calculi with tensors. Joint Conference on Lexical and Computational Semantics. Karl Moritz Hermann, Tomas Kocisky, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa Suleyman, and Phil Blunsom. 2015. Teaching machines to read and comprehend. In Advances in Neural Information Processing Systems, pages 1684–1692. Mohit Iyyer, Jordan Boyd-Graber, Leonardo Claudino, Richard Socher, and Hal Daumé III. 2014. A neural network for factoid question answering over paragraphs. In Proceedings of the Conference on Empirical Methods in Natural Language Processing. Jayant Krishnamurthy and Thomas Kollar. 2013. Jointly learning to parse and perceive: connecting natural language to the physical world. Transactions of the Association for Computational Linguistics. Jayant Krishnamurthy and Tom Mitchell. 2013. Vector space semantic parsing: A framework for compositional vector space models. In Proceedings of the ACL Workshop on Continuous Vector Space Models and their Compositionality. Tom Kwiatkowski, Luke Zettlemoyer, Sharon Goldwater, and Mark Steedman. 2010. Inducing probabilistic CCG grammars from logical form with higherorder unification. In Proceedings of the Conference on Empirical Methods in Natural Language Processing, pages 1223–1233, Cambridge, Massachusetts. Tom Kwiatkowski, Eunsol Choi, Yoav Artzi, and Luke Zettlemoyer. 2013. Scaling semantic parsers with onthe-fly ontology matching. In Proceedings of the Con- ference on Empirical Methods in Natural Language Processing. Mike Lewis and Mark Steedman. 2013. Combining distributional and logical semantics. Transactions of the Association for Computational Linguistics, 1:179– 192. Percy Liang, Michael Jordan, and Dan Klein. 2011. Learning dependency-based compositional semantics. In Proceedings of the Human Language Technology Conference of the Association for Computational Linguistics, pages 590–599, Portland, Oregon. Mateusz Malinowski, Marcus Rohrbach, and Mario Fritz. 2015. Ask your neurons: A neural-based approach to answering questions about images. In Proceedings of the International Conference on Computer Vision. Cynthia Matuszek, Nicholas FitzGerald, Luke Zettlemoyer, Liefeng Bo, and Dieter Fox. 2012. A joint model of language and perception for grounded attribute learning. In International Conference on Machine Learning. Hyeonwoo Noh, Paul Hongsuck Seo, and Bohyung Han. 2015. Image question answering using convolutional neural network with dynamic parameter prediction. arXiv preprint arXiv:1511.05756. Panupong Pasupat and Percy Liang. 2015. Compositional semantic parsing on semi-structured tables. In Proceedings of the Annual Meeting of the Association for Computational Linguistics. Mengye Ren, Ryan Kiros, and Richard Zemel. 2015. Exploring models and data for image question answering. In Advances in Neural Information Processing Systems. K Simonyan and A Zisserman. 2014. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556. Richard Socher, John Bauer, Christopher D. Manning, and Andrew Y. Ng. 2013. Parsing with compositional vector grammars. In Proceedings of the Annual Meeting of the Association for Computational Linguistics. Geoffrey G Towell and Jude W Shavlik. 1994. Knowledge-based artificial neural networks. Artificial Intelligence, 70(1):119–165. Ronald J Williams. 1992. Simple statistical gradientfollowing algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256. Yuk Wah Wong and Raymond J. Mooney. 2007. Learning synchronous grammars for semantic parsing with lambda calculus. In Proceedings of the Annual Meeting of the Association for Computational Linguistics, volume 45, page 960. Huijuan Xu and Kate Saenko. 2015. Ask, attend and answer: Exploring question-guided spatial attention for visual question answering. arXiv preprint arXiv:1511.05234. Kelvin Xu, Jimmy Ba, Ryan Kiros, Kyunghyun Cho, Aaron Courville, Ruslan Salakhutdinov, Richard Zemel, and Yoshua Bengio. 2015. Show, attend and tell: Neural image caption generation with visual attention. In International Conference on Machine Learning. Zichao Yang, Xiaodong He, Jianfeng Gao, Li Deng, and Alex Smola. 2015. Stacked attention networks for image question answering. arXiv preprint arXiv:1511.02274. Pengcheng Yin, Zhengdong Lu, Hang Li, and Ben Kao. 2015. Neural enquirer: Learning to query tables. arXiv preprint arXiv:1512.00965. Matthew D Zeiler. 2012. ADADELTA: An adaptive learning rate method. arXiv preprint arXiv:1212.5701. Bolei Zhou, Yuandong Tian, Sainbayar Sukhbaatar, Arthur Szlam, and Rob Fergus. 2015. Simple baseline for visual question answering. arXiv preprint arXiv:1512.02167.
9cs.NE
CHR as grammar formalism A first report arXiv:cs/0106059v1 [cs.PL] 29 Jun 2001 Henning Christiansen Roskilde University, Computer Science Dept., P.O.Box 260, DK-4000 Roskilde, Denmark E-mail: [email protected] Abstract. Grammars written as Constraint Handling Rules (CHR) can be executed as efficient and robust bottom-up parsers that provide a straightforward, non-backtracking treatment of ambiguity. Abduction with integrity constraints as well as other dynamic hypothesis generation techniques fit naturally into such grammars and are exemplified for anaphora resolution, coordination and text interpretation. 1 Introduction The language of Constraint Handling Rules [16,17], CHR, was introduced as a tool for writing constraint solvers for traditional constraint domains such as real or integer number arithmetic and finite domains. CHR, however, has turned out to be of more general value and is now available as an extension of among others, SICStus Prolog [27]. The CHR web pages [8] contains a growing collection of applications. Being of special interest to language processing, [3] has shown that CHR adds bottom-up evaluation to Prolog and a flexibility to combine topdown and bottom-up; [2] has taken this a step further showing that abduction and integrity constraints can be expressed in a straightforward way in CHR. Here we investigate CHR applied as a grammatical formalism and it appears that a grammar can be written in a straightforward way as propagation rules of CHR that execute as a robust bottom-op parser which handles ambiguity without backtracking. Constructed in the most naive way, these parsers are of a high time-complexity, typically cubic or worse, but by means the so-called pragmas provided by current implementations of CHR, realistic and almost linear parsers are achieved, executing quite similary to shift-reduce parsers. Look-ahead techniques are easily expressed and ambiguous grammars can be made unambiguous using simplification rules instead of propagation rules. Similarly as for Definite Clause Grammars [26] (DCGs), CHR grammars (as we deliberately call them) can take arbitrary attributes in a similar way but accepts a wider class of context-free bases. Except for direct loops in the grammar, CHR grammars works correctly for any such basis. As is well-known, DCG’s top-down evaluation with backtracking may lead to combinatorial explosion in time which is avoided by a bottom-up evaluation that examines all hypotheses in the same space. However, there are other and more significant differences, most importantly the way in which arbitrary hypotheses can be produced and consumed in CHR and applied for controlling the parser and for evaluation of semantics. Assumption grammars [12] that use linear and intuitionistic assumptions in various ways can be implemented very easily in CHR and abduction with integrity constraints works fine as well. Examples are given of anaphora resolution, coordination, and text interpretation by abduction. Related work The notion of constraints, with slightly different meanings, is often associated with language processing. “Constraint grammars” and “unification grammars” is often used for feature structure grammars and constraint programming techniques have been applied for the complex constraints that arise in natural language processing, see, e.g., [4,15] for introduction and overview. Constraint logic programming, in terms of using black-box constraint solvers, has been applied at many occasions as well. What we propose is to capture fundamental processes such as parsing and semantic analysis by means of declaratively specified constraint solvers, more specifically, expressed and implemented in the language of CHR. While our results are promising, there is still very little work to report in this context. The basic principle of using CHR’s propagation rules for context-free parsing has also been suggested by [23] but not elaborated further; [25] has used CHR for evaluation of feature structures for HPSG. Assumption Grammars [12], inspired by Linear Logic, provide a structured way to generate and manage dynamically generated hypothesis. This provides elegant solutions to problems that are otherwise difficult to handle, although there seems to be a need for more detailed methods to control the scope of such hypotheses. We do not provide new suggestion for this, but it seems possible to implement a variety of such mechanisms in our CHR based framework. The close similarity between our representation of abduction and of Assumption Grammars in CHR seems to indicate a closer relation between the two that still needs to be investigated. References related to abduction are given in section 5. Overview Section 2 explains how propagation rules provide obviously correct parsers and section 3 concerns their time complexity. Section 4 shows how assumption grammars can be implemented and discusses some improvements and section 5 introduces abduction and integrity constraints into the model. The final section 6 provides a summary and discusses possible syntactic sugar for CHR grammars and other perspectives. No introduction to CHR is given; we refer to [16,17] or online manuals [8,27]. 2 CHR as grammar formalism: The basic principle A set P of propagation rules of CHR constitutes a natural bottom-up evaluator: The set of initial hypotheses H is given as a query and the evaluator produces as answer the set A of all atoms that are logical consequences of P ∪ H, of course provided that no infinite loop occurs. The set H is the initial constraint store, A the final constraint store in which all rules of P that can apply have been applied. Using CHR for parsing, we represent a string to be analyzed as a set of initial constraints of the form token(t,n−1,n), where t is a Prolog atom and n − 1, n indicates the position in the string. So, e.g., “Peter likes Mary” is represented as token(peter,0,1), token(likes,1,2), token(mary,2,3). Nonterminals, say Q, of a context-free grammar can be represented as a binary constraint symbol Q(n,m) with the interpretation “substring between positions n and m comprises an instance of Q”. Each context-free grammar rule Q0 ::= Q1 , . . . , Qk , with k > 0, Q0 a nonterminal and each Qi , 0 ≤ i ≤ k, a terminal or nonterminal, is represented as a propagation rule S1 ,...,Sk ==> Q0 (N0,Nk). where, if Qi is a terminal, Si = token(Qi,k−1,k), and if Qi is a nonterminal, Si = Qi (Ni−1,Ni). Empty productions N ::= ǫ can be handled by inserting N (0,0), N (1,1), etc. in the initial constraint store but in the following we consider only grammars without empty productions. We may distinguish a particular nonterminal of a grammar as its start symbol. Example: The grammar {sentence::= np verb np; np::= peter | mary; verb::= likes} is translated into the following CHR program. np(N0,N1), verb(N1,N2), np(N2,N3) ==> sentence(N0,N3). token(peter,N0,N1) ==> np(N0,N1). token(mary, N0,N1) ==> np(N0,N1). token(likes,N0,N1) ==> verb(N0,N1). A parser given in this way for a context-free grammar G is obviously correct in that the following properties hold; let t1 · · · tx be the input string and S the start symbol. 1. If the grammar contains no loops, i.e., no nonterminal can derive itself, the parser is guaranteed to terminate. Given this premise, we have also: 2. If and only if nonterminal N can generate substring ti · · · tj , the final constraint store contains the constraint N (i,j). 3. The final constraint store contains S(0,x) if and only if S can derive t1 · · · tx . 4. If the grammar is ambiguous and a substring ti · · · tj corresponds to n different parse trees, each with top node N1 , . . . , Nn , the final constraint store contains exactly n constraints with argument list (i,j), namely N1 (i,j), . . . , Nn (i,j). Properties 1 and 3 express the usual notion of correctness for a parser. Property 2 means that the parser is robust in the sense that if the entire string does not conform with the grammar, it is still possible to extract those parts that represent recognizable subphrases. Property 4 shows that ambiguity is handled in a natural way without backtracking; the constraints can be extended with an argument representing a parse tree (or some semantic representation) and all possible trees (or meanings) can be read out of the final state. These properties are desirable especially for natural language processing where the language usually is richer than any grammatical formalization of it and where ambiguity is an inherent property. However, property 2 shows also that the final constraint store may become quite large as it contains all nonterminals that has been possible to recognize, even in case they do not contribute to the overall parse due to “local ambiguity”. Using such a parser for the grammar {as::= a; as::= a as} for a string of length n will result in a final state with n(n + 3)/2 constraints. Extra arguments can be added to the nonterminals in the same way as in a DCG and string indices can be hidden by means of syntactic sugar à la DCG. In the final section, we discuss possible syntactic sugaring, but until then we stay with our goal, namely to investigate the full CHR language as a grammatical formalism. The declarative semantics of CHR provides a semantics for our grammars but we will also refer to the procedural semantics and implemented features for various adjustments. 3 Time complexity and what to do about it Time complexity for constraint solvers similar to CHR’s propagation rules has been studied by [22]. It is shown that a parser for a context-free grammar in Chomsky Normal Form (max. two grammar symbols on rhs) runs in time gn3 where g is the no. of grammar rules and n the length of the input string. This conforms with the classical result for the Cocke-Younger-Kasami parsing algorithm that works quite similarly to a parser comprised by propagation rules; see, e.g., [5] for background. We made an empirical test by analyzing random sequences of as and bs with a propagation rule parser for the grammar G = {S ::= a AB | B A; A::= B BB | a; B ::= A S | b; AB ::= A B ; BB ::= B B }. This grammar has an extreme degree of local ambiguity, resulting in an huge number of derived constraints. Our test with SICStus Prolog’s implementation of CHR shows indeed a complexity of n3 until an exponential factor takes over around n = 30, probably due to a very active garbage collector. For n = 30, the final store contains in average more that 1500 constraints. The complexity increases to higher powers of n when more grammar symbols appear in each rule. We believe that more interesting grammars will produce far less final constraints, but still the n3 makes the method unrealistic for any practical application. Fortunately, there are several ways to reduce time complexity that we illustrate for a parser of arithmetic expressions based on a straightforward, ambiguous grammar. One of the rules is the following. exp(N0,N1), token(+,N1,N2), exp(N2,N3) ==> exp(N0,N3). Current CHR implementations (that do not recognize the pattern of recurrence of the variables) will test this rule twice whenever a new exp is created, once to check if it matches the leftmost exp in the rule and secondly for the rightmost. In addition, the entering of token(+,· · ·) will also result in a check for applicability of the rule. CHR’s so-called pragmas can be applied to force the parser to work more like a classical shift-reduce parser. We do this by making each but the rightmost grammar symbol passive in each rule, e.g., exp(N0,N1)#Id1, token(+,N1,N2)#Id2, exp(N2,N3) ==> exp(N0,N3), pragma passive(Id1), passive(Id2). This means that whenever a new exp constraint is created, only one test is generated for this rule, namely for a potential match with the rightmost exp at the lhs of this rule. The advent of token(+,· · ·) will never trigger this rule. It can observed1 that the modified constraint solver produces exactly the same constraints as the original one (and even in the same order), the parts removed from the computation process are a lot of tests for applicability of rules anyhow destined to fail. We have not made a formal analysis of the time complexity for these modified parsers but tests for a variety of grammars indicate a linear or almost linear behaviour. Another source of inefficiency is the potentially large number of constraints that pile up in the state; fewer final constraints will also make it easier to interpret the result of the parsing process. One way to reduce this is to apply CHR’s reduction rules instead of propagation rules, i.e., write “<=>” instead of “==>”. The effect is that the constraints matched on the lhs of the rule are removed from the constraint store and thus fewer parse trees will be recognized. Thus reduction rules should only be used for parts of a grammar known to be unambiguous. Alternatively, it can be seen as a method to make an ambiguous grammar unambiguous and a mixture of propagation and reduction rules can be used. Some degree of ambiguity, however, can be handled in a reduction rule by means of backtracking using disjunctions at the rhs of rule, cf. [3], or by launching all different hypothesis into the constraint store at the same time. Since the position of tokens are explicit in the rules we can also let parsing depend on other symbols than the sequence being reduced. One example of this is to incorporate a look-ahead based on LR-items (see, e.g., [6]) as in the following grammar for arithmetic expressions. Here we use CHR’s so-called simpagation 1 To prove this, one needs to argue in terms of a fairly detailed model of CHR’s execution model [1]. rules: Constraints matched to the left of the backslash stay in the constraint store and the other ones are removed; the test in front of the vertical bar is the a guard. We assume the text is followed by the terminal symbol eof and the following rule says that “exp + exp” is reduced provided the next input token is the specified list. token(R, N3,N4) \ exp(N0,N1), token(+,N1,N2), exp(N2,N3) <=> member(R,[+,’)’,eof]) | exp(N0,N3). The passive pragmas can be added as described provided that “right-most symbol” in the lhs of a rule is identified by means of the indices so that, in the rule above, the token in front of the backslash is the non-passive one and thus the one and only that can trigger the rule. Together with the following rules (pragmas understood), we have a grammar for arithmetic expressions with traditional associativity and precedence. token(R,N3,N4) \ exp(N0,N1), token(*,N1,N2), exp(N2,N3) <=> member(R,[*,+,’)’,eof]) | exp(N0,N3). token(R,N3,N4) \ exp(N0,N1), token(^,N1,N2), exp(N2,N3) <=> R \= ^ | exp(N0,N3). token(’(’,N0,N1), exp(N1,N2), token(’)’,N2,N3) <=> exp(N0,N3). token(Int,N0,N1) <=> integer(Int) | exp(N0,N1). As a result we achieve an efficient parser in which the constraint store is used effectively as a stack and the parser performs exactly the same steps and comparisons as a traditional LR(1) parser. We conclude that time complexity is not a problem for CHR parsers and that flexibility is available for the grammar writer to consider symbols (not only terminals!) to the left and to right of the symbols reduced, to combine CHR’s different kinds of rules and pragmas with different effects, to add new tokens on the rhs (not shown), etc., etc. In addition, the parser may refer to constraints that represent other than purely syntactic hypothesis; this appears in the following. 4 Assumption Grammars and beyond With CHR it is possible to let rules produce and consume arbitrary hypotheses. Consider the following sketch of two CHR grammar rules, ... ==> ... h(X) ... . ... h(X) ... ==> ... . The first rule produces a hypothesis, say h(a), extracted from the context in which the rule is applied and the second rule can be executed when such a hypothesis is present and the value X=a becomes available. Anaphora in natural language can be treated by passing hypotheses through the constraint store in this way. Assumption grammars [12] include specialized operators for managing such hypotheses and we show how they can be implemented and applied in CHR grammars. In an assumption grammar, the expression +h(a) asserts a linear hypothesis which can be used once in the following text by means of the expression −h(a) (or −h(X)), called an expectation. Asserting the hypothesis by ∗h(a) means that it can be used over and over again. We represent an assertion +h(a) by a constraint +(h,[a],n); the predicate symbol and argument list are split for technical reasons and n indicates a position in the string where the hypothesis is supposed to be created. The two other operators are represented in analogous ways. Deviating slightly from the syntax of [12] (as to achieve a more symmetric notation), we introduce three new operators for “time-less” hypotheses, =+, =-, and =*, whose meanings are similar except that hypotheses can be used and consumed in any order; for these we can leave out the string index. The following simplification and simpagation rules provide an implementation in CHR. =+(P,A) =*(P,A) +(P,A,Z1) *(P,A,Z1) , \ , \ =-(P,B) =-(P,B) -(P,B,Z2) -(P,B,Z2) <=> true <=> true <=> Z1 < Z2 <=> Z1 < Z2 & & & & A=B A=B A=B A=B | | | | true. true. true. true. The explicit unification in the guard serves as test for unifiability as well as for porting the argument value from the asserted hypothesis (supposed to be ground) to its application.2 Correct derivation in an assumption grammar requires that all expectations are matched by corresponding assertions in the end and an optional test all_consumed is available meaning that all linear hypotheses have been consumed; these and similar facilities are easily implemented by means of CHR’s auxiliary predicates.3 However, the use of hypotheses introduces one technical problem in CHR, because a give parse tree has its specific set of hypotheses. Thus, with an ambiguous grammar and propagation rules we would mix up hypotheses corresponding to different trees. For the present we assume unambiguous grammars and use simplification rules. We give excerpts from a sample grammar inspired by [12] demonstrating anaphora and coordination. An occurrence of a proper name for some individual (“X” in the following rule) introduces a hypothesis that this individual can be referred to subsequently by a pronoun. proper_name(X,Gender,N1,N2) <=> *(active_individual,[X,Gender],N1), np(X,Gender,N1,N2). pronoun(Gender,N1,N2) <=> -(active_individual,[X,Gender],N1), np(X,Gender,N1,N2). Coordination arise in relation to ellipses as in “Mary likes and Martha hates Peter”. The object for the first sentence is implicit and shared with the second sentence. Simple and full sentences are described as follows. 2 3 CHR matches constraints to be processed by a common “instance of” condition, so that the rule =+(P,A), =-(P,A) <=> true would apply in fewer cases than the corresponding one above. E.g., all_consumed:- \+ find_constraint(+(_,_,_),_), \+ find_constraint(=+(_,_,_),_). np(Sub,_,N1,N2), verb(V,N2,N3), np(Obj,_,N3,N4) <=> sent(V-(Sub,Obj),N1,N4). The following two rules take care of coordination. Notice that the ellipsis is identified by a look-ahead for “and”; the second of two and’ed sentences offers its object to anyone missing its object. token(and,N3,N4) \ np(Sub,_,N1,N2), verb(V,N2,N3) <=> =-(ref_object,[Obj]), sentence(V-(Sub,Obj),N1,N3). sent(S1,N1,N2), token(and,N2,N3), sent(V2-(Sub2,Obj2),N3,N4) <=> =+(ref_object,[Obj2]), sent(S1+(V2-(Sub2,Obj2)), N1,N4). With these and a few other obvious rules, the analysis of “Mary likes Peter. She loves and Martha hates him.” yields the following semantic representation. likes-(mary,peter) + loves-(mary,peter) + hates-(martha,peter) However, this example gives rise to some discussion of assumption grammars. First of all, if the sentence preceding “and” happens to be complete, the asserted hypothesis will not be used here but may interfere with the analysis of subsequent ellipses. To avoid this, the CHR rule can be refined so that it only asserts the hypothesis if there is need for one; replacing the unconditional assertion by the following piece of code will do. find_constraint(=-(ref_object,_),_) -> =+(ref_object,[Obj2]) ; true In general, we believe that a more detailed control of the scope of asserted hypothesis is needed than what is feasible with assertion grammars. The explicit string indices are useful for this as well as the low-level primitives of CHR and it seems that suggestions for any such “high-level” scoping mechanism can be implemented.4 Another feature missing in assumption grammars is the selection of a best hypothesis for, say, resolving a pronoun, e.g., considering distances in the string or which hypothesis has been applied most often. We can sketch a rule as follows; the constraint before the backslash serves as a test that there are applicable hypotheses. +(active_individual,[_,Gender],N) \ pronoun(Gender,N1,N2) <=> N<N1 | select the best hypothesis of form +(active_individual,[X,Gender],_) according to some criteria and remove it from the constraint store, np(X,Gender,N1,N2). If more hypotheses are feasible, they can be tested on backtracking. — We leave it to competent linguists to design such mechanisms. What we have indicated here is that CHR seems to provide a framework for implementing them. 4 A tree-like scoping provided by implications goals [9,19,24] does not seem sufficient as some hypotheses may be relevant from, say, position 10 to 25 and others from 20 to 30. In addition, some hypotheses may be temporarily overruled by others. 5 Abduction and integrity constraints As several authors [11,7,18,20] have noticed, abduction is a useful way to conceive and to implement aspects of natural language interpretation. A deductive approach, as exercised in section 4, represents the meaning of a text by a complex structure attached to the start symbol and which has been synthesized from meanings of its constituents. By abduction, the meaning appear as assumptions generated in parallel with the syntactic analysis as they are needed, and integrity constraints can check dynamically that the collected set of hypothesis is consistent. Consider the following DCG rule. A --> B1 , . . ., Bn , {P }. Now the instance of a nonterminal should be understood as the presence of a good phrase, e.g., a true sentence or a noun phrase referring to an existing object, and the related instance of P is the precondition for the composition of good subphrases itself to be a good phrase. When formulating language interpretation as abduction, the unknown is a body of assumptions that entails the set of all such P instances that have been applied. The literature is rich of abduction procedures which can do this job, e.g., [10,13,14,21]. In [2] we have shown how abduction with integrity constraints can be expressed in CHR. In the following we illustrate how to integrate it with a CHR parser, however, without caring about the formal relation. A DCG rule as above is written as the following CHR grammar rule: B1 (N0,N1), . . ., Bn (Nn−1,Nn) <=> P , A(N0,Nn). Applying it will introduce into the constraint store the instance of P that was necessary for the previous DCG rule to apply.5 The active_individual(· · ·) hypotheses generated in the example of section 4 can be seen as an part of abductive explanation why the text could have been sensibly and correctly uttered. Gender of an individual may be recognized from its proper name in a lexicon or deduced from context. Thus the following integrity constraint is relevant: active_individual(X,masc), active_individual(X,fem) <=> fail. Sentence meanings can be removed from the nonterminal and instead be launched into the constraint store: np(Sub,_,N1,N2), verb(V,N2,N3), np(Obj,_,N3,N4) <=> fact(V,Sub,Obj), sent(N1,N4). Different anaphoric resolutions can be thinned out along the way by means of “semantic” integrity constraints such as: fact(likes,X,Y), fact(hates,X,Y) <=> fail. fact(loves,X,Y), fact(hates,X,Y) <=> fail. fact(hates,X,X) <=> fail. 5 This is likely to produce several instances of the same hypothesis but CHR has means to avoid this. This will provide a correct interpretation of tricky combinations such as “Mary likes Martha. She hates her.” Abduction provides also a way to work with negative hypotheses by means of explicit negation as expressed in the sketch of an integrity constraint, not H, H <=> fail. It means that anything can be asserted until the opposite has been proved. We have indicated that CHR as grammar formalism seems capable of integrating abductive text interpretation which has several benefits over explicit synthesis of meanings. However, the principle we have illustrated still needs to be refined and its formal grounds to be established. As we have described it, grammar rules have to be represented as simplification rules, otherwise different hypothesis sets for different parse trees will be mixed up. Thus alternatives can only be explored by backtracking in the rule bodies. However, it seems to be a matter of proper engineering to find ways to manage sets of alternative and mutually exclusive hypotheses in the same constraint store; weighted abduction [20] seems to fit into such a model or a more structured approach based on fuzzy logic could be used. Integrity constraints should also behave in a less rude way, by simple having wrong hypotheses to vanish instead of provoking failure and thus backtracking. 6 Conclusion and perspectives What we have called CHR grammars relates to CHR the same way that DCGs relate to Prolog. Grammar rules are written in a systematic way as rules of the host language and can be used directly as a parser that inherits the computational characteristics of the underlying machinery. Where DCGs work top-down with backtracking, CHR grammars works bottom-up. In addition to provide an evaluation strategy better suited for parsing, especially of natural language, the CHR paradigm supports the use of dynamically generated hypotheses, e.g., for abduction or as in Assumption Grammars, that is extremely useful for natural language analysis. The experiences we have reported here are indeed promising for the use of CHR as a grammatical formalism. It provides a high degree of flexibility and expressive power for language processing of which we believe to have exposed only a small portion. The comparison with DCGs may suggest to add a layer of syntactic sugar to suppress arguments for syntactic indices and to introduce high-level devices to replace the different uses of them. Take the simplification rule for an arithmetic plus shown in section 3. By means of a suitable preprocessor, we may suggest to write it in the following nice way. exp, [+], exp /- ([+];[’)’];[eof]) <-> exp. We prefer to keep the order of lhs and rhs of the rules to indicate their bottomup nature and to let the choice of propagation and simplification rule be visible using symbols “-->” and “<->”. As in DCG, curly brackets can be used to indicated code to be bypassed by the preprocessor, and notice that it is relevant to apply this at both sides of a CHR grammar rule. The “/-” marker indicates a reference to the right context of the sequence being reduced; an analogous “-\” marker can be used at the beginning of a rule to indicate references to the left context. To add passive pragmas to all but the leftmost grammar symbol at the lhs as described in section 3, a rule may be prefixed with an operator “ruleLR” or a global directive “:- modeLR.” can affect all rules. The LR mode should not be forced as it may affect the final result for CHR grammars using reduction rules. Our investigation has also exposed interesting topics for future work: To study the possible relation between abduction and assumption grammars (perhaps as instances of a more general framework of hypothetical reasoning) and to design high-level facilities for controlling the scope of hypotheses. As we pointed out in section 5, technical work is needed in order to achieve a full bottom-up and non-backtracking version of abduction. Plans for the near future include extraction of noun phrases to be used in a Danish ontology-based search systems which is developed in parallel with an implementation using traditional language processing tools. A grammar for a substantial subset of Danish is under consideration with contextual and perhaps some kind of semantic analysis. Acknowledgment: This research is supported in part by the OntoQuery funded by the Danish Research Councils, and the IT-University of Copenhagen. References 1. Abdennadher, S., Operational semantics and confluence of constraint propagation rules. In Third International Conference on Principles and Practice of Constraint Programming, CP97, LNCS 1330. Springer-Verlag, November 1997. 2. Abdennadher, S., Christiansen, H., An Experimental CLP Platform for Integrity Constraints and Abduction. Proceedings of FQAS2000, Flexible Query Answering Systems, pp. 141-152, Advances in Soft Computing series, Physica-Verlag (Springer), 2000. 3. Abdennadher, S., Schütz, H. CHR∨ : A flexible query language. Flexible Query Answering Systems, LNAI 1495, 1998. 4. Allen, J., Natural language understanding. Benjamin Cummings. Second edition, 1995. 5. Aho, A.V., Ullman, J.D., The theory of parsing, translation, and compiling. Volume I: Parsing. Prentice-Hall, 1972. 6. Aho, A.V., Sethi, R., Ullman, J.D., Compilers. Principles, techniques, and tools. Addison-Wesley, 1986. 7. Charniak, E., McDermott, D., Introduction to Artificial Intelligence. AddisonWesley, 1985. 8. Constraint handling rules online. http://www.pms.informatik.uni-muenchen.de/~webchr/ 9. Christiansen, H., Declarative semantics of a meta-programming language. Bruynooghe, M., ed., Proc. of the Second Workshop on Meta-programming in Logic. April 4–6, 1990, Leuven, Belgium. pp. 159–168, 1990. 10. Christiansen, H., Automated reasoning with a constraint-based metainterpreter. Journal of Logic Programming, 37(1-3):213–254, 1998. Special issue on Constraint Logic Programming. 11. Christiansen, H., Open theories and abduction for context and accommodation. 2nd International and Interdisciplinary Conference on Modeling and Using Context (CONTEXT’99) Bouquet, P., Brezillon, P., Serafini, L. (eds.) Lecture Notes in Artificial Intelligence 1688. Springer-Verlag, pp. 455–458, 1999. 12. Dahl, V., Tarau, P., Li, R., Assumption grammars for processing natural language. Proc. Fourteenth International Conference on Logic Programming. pp. 256–270, MIT Press, 1997. 13. Decker, H. (1996). An extension of sld by abduction and integrity maintenance for view updating in deductive databases. In Proc. of JICSLP’96, pages 157–169. 14. Denecker, M. and de Schreye, D. (1998). SLDNFA: An abductive procedure for abductive logic programs. Journal of Logic Programming, 34(2):111–167. 15. Duchier, D. Constraint Programming For Natural Language Processing. Lecture Notes, ESSLLI 2000, August 2000. 16. Frühwirth, T.W., Constraint handling rules, Lecture Notes in Computer Science 910, pp. 90-107, 1995. 17. Frühwirth, T.W., Theory and Practice of Constraint Handling Rules, Journal of Logic Programming, Vol. 37(1-3), pp. 95-138 18. Gabbay, D., Kempson, R., Pitt, J., Labeled abduction and relevance reasoning. Nonstandard Queries and Nonstandard Answers, Demolombe, R., Imielinski, T., (eds.), pp. 155–185, Oxford Science Publications, 1994. 19. Gabbay. D.M., Reyle, U., N-Prolog: An Extension of Prolog with Hypothetical Implications I. Journal of Logic Programming, vol. 2, pp. 319–355, 1984. 20. Hobbs, J.R., Stickel, M.E., Appelt D.E., and Martin, P., Interpretation as abduction. Artificial Intelligence 63, pp. 69-142, 1993. 21. Kakas, A.A., Kowalski, R.A., Toni, F., The role of abduction in logic programming, Handbook of Logic in Artificial Intelligence and Logic Programming, vol. 5, Gabbay, D.M, Hogger, C.J., Robinson, J.A., (eds.), Oxford University Press, pp. 235-324, 1998. 22. McAllester, D.A., Meta-complexity theorems: Talk abstract. Proc. Principles and Practice of Constraint Programming, CP 2000, 6th International Conference, Dechter, R. (ed.). Lecture Notes in Computer Science 1894, pp. 13–17, 2000. 23. Meyer, B. A constraint-based framework for diagrammatical reasoning. Journal of Applied Artificial Intelligence 14, pp. 327–244, 2000. Special Issue on Constraint Handling Rules. 24. Miller, D., Lexical scoping as universal quantification, Proc. of Sixth International Conference on Logic Programming, eds. Levi, G. and Martelli, M., MIT Press, pp. 268–283, 1989. 25. Penn, G., Applying Constraint Handling Rules to HPSG. Proc. First Workshop on Rule-Based Constraint Reasoning and Programming (Workshop at First International Conference on Computational Logic, July 24–28, 2000, Imperial College, London, UK. Available electronically at http://www.cs.cmu.edu/~gpenn/trale.ps.gz and CoRR: http://xxx.lanl.gov/ps/cs.CL/0007013. 26. Pereira, F.C.N., Warren, D.H.D., Definite clause grammars for language analysis. A survey of the formalism and a comparison with augmented transition grammars. Artificial Intelligence 10, no. 3–4, pp. 165–176, 1980. 27. SICStus Prolog user’s manual. Version 3.8, SICS, Swedish Institute of Computer Science, 2001. http://www.sics.se/isl
6cs.PL
arXiv:1803.03482v1 [cs.DC] 9 Mar 2018 Ensuring referential integrity under causal consistency∗ Marc Shapiro Annette Bieniusa Sorbonne Université-LIP6, Paris, France Inria, Paris, France TU Kaiserslautern, Germany Peter Zeller Gustavo Petri TU Kaiserslautern, Germany IRIF, Paris Diderot – Paris 7, France ABSTRACT Referential integrity (RI) is an important correctness property of a shared, distributed object storage system. It is sometimes thought that enforcing RI requires a strong form of consistency. In this paper, we argue that causal consistency suffices to maintain RI. We support this argument with pseudocode for a reference CRDT data type that maintains RI under causal consistency. QuickCheck has not found any errors in the model. purpose of this paper is to construct a reference data type demonstrating that causal consistency (with progress guarantees) suffices to ensure RI and to implement a safe deletion operation. We support this claim with pseudocode. The solution that we sketch in this paper uses a form of reference counting (designed for distributed systems), called reference listing [4, 5, 10]. Objects with a non-empty reference list must not be deleted. ACM Reference Format: Marc Shapiro, Annette Bieniusa, Peter Zeller, and Gustavo Petri. 2018. Ensuring referential integrity under causal consistency. In PaPoC’18: 5th Work2 REFERENTIAL shop on Principles and Practice of Consistency for Distributed Data, April 23– CONSISTENCY 26, 2018, Porto, Portugal. ACM, New York, NY, USA, 5 pages. https://doi.org/10.1145/3194261.3194262 1 REFERENCES AND REFERENTIAL INTEGRITY Consider a shared store (memory) of objects, and a reference data type for linking objects in the store. Let’s call a referencing object the source of the reference, and the referenced object its target. Intuitively, the referential integrity (RI) invariant states that if an application can reference some target, then the target “exists,” in the sense that the application can access the target safely. A referenced object must not be deleted; conversely, when an object cannot be reached by any reference, deleting it is allowed. We say that an object is unreachable if it is not the target of a reference, and never will be in the future (the latter clause is problematic under weak consistency). The RI property that we wish to achieve is the following: • Safety: An object can be deleted only if it is unreachable. • Liveness: Unreachability of an object will eventually be detected. In a storage system where the application can delete objects explicitly, the programmer must be careful to preserve the RI invariant. This problem has been studied in the context of (concurrent) garbage collection for decades. Folklorically, it is often thought that enforcing RI requires synchronisation and strong consistency. In fact, previous work has stated otherwise [2, 4, 12]. The main ∗ Produces the permission block, and copyright information ACM acknowledges that this contribution was authored or co-authored by an employee, contractor or affiliate of a national government. As such, the Government retains a nonexclusive, royalty-free right to publish or reproduce this article, or to allow others to do so, for Government purposes only. PaPoC’18, April 23–26, 2018, Porto, Portugal © 2018 Association for Computing Machinery. ACM ISBN 978-1-4503-5655-8/18/04. . . $15.00 https://doi.org/10.1145/3194261.3194262 INTEGRITY AND CAUSAL The safety property of RI is an instance of an implication invariant P =⇒ Q: If a reference to an object exists, the object can accessed (has not been deallocated). Elementary logic tells us that the sequential pattern of first making Q true, followed by making P true, will maintain such an invariant (the “backward pattern”). Similarly, making P false followed by making Q false (the “forward pattern”) also works. The backward pattern translates to “first allocate the object, then assign reference to it,” and the forward pattern to “first delete all references to object, then delete the object.” In a concurrent system with causal consistency [1], if two updates are ordered by happened-before [7], then all processes observe them in the same order. Therefore, we expect the same patterns to extend to such a system. Unfortunately, this does not suffice to maintain RI, because both patterns may be executing in parallel. It is encouraging to remember that some datatypes can be engineered to support apparently-conflicting concurrent updates. For instance, a set can support concurrent insertion and removal of the same element, by making one operation “win” deterministically, the other one being superseded [11]. However, we cannot re-use this design directly since handling references also requires to handle the referred objects accordingly (including transitive reachability). Furthermore, while it is easy to ensure safety by never deleting anything, we also require liveness. Note that causal consistency is only a safety property; it allows arbitrarily old versions to be observed. We need to add a progress guarantee assumption to ensure that our algorithm is live. We assume that the objects of interest are accessed only via the reference datatype discussed herein. We do not address the more complex problem of objects that are accessible via some external means, e.g., through a well-known key, through a URL, or via a database query. These are called “root” objects (in garbagecollection parlance), which for our purposes are never deleted. PaPoC’18, April 23–26, 2018, Porto, Portugal Marc Shapiro, Annette Bieniusa, Peter Zeller, and Gustavo Petri Object A Object A a= ... Object X ... Object X a = null ... Object B Object B b = null ... b = null ... (a) Initial state. Object A a= ... Object X ... Object B b= ... (b) On Replica 1. (c) On Replica 2. Figure 1: Concurrently creating references and deleting objects can lead to dangling references. How should the replicas be reconciled? Object A a b X,100 ... An outref can invoke its target, but this makes sense only if it has a single (non-null) target. If the outref contains multiple values, the invocation fails (the application can fix this by performing a new assignment). Figure 2 illustrates three source objects A, B, C, each containing an attribute single outref named a, b, c respectively, and two target objects X and Y. The state illustrated might result from the following code snippet: init(A.a,X) Object B Object X X,42 X,314 Y,99 ... A,100 B,42 B,314 ... inref init (A.a, X); init (C.c, Y); B.b := A.a || B.b := A.a || B.b := C.c; Our algorithm design hinges on two principles that can be implemented assuming only causal consistency: (1) before an outref is assigned to a source object (in initialisation or assignment), we Object Y ensure that the corresponding inref has been added to the target init(C.c,Y) Object C object; importantly, causal consistency is enough to enforce this C,101 c Y,101 inref ordering of updates. (2) To delete a target, we require that no inB,99 ... ... ref exists, nor will later be added, for this target. This property can be checked by well-known mechanisms which rely only on causal consistency and progress guarantees [14]. The combination Figure 2: References with inref/outref after concurrently asof these properties is sufficient to ensure RI as defined in the introsigning B.b to A.a (twice) and C.c. duction. 3 HIGH-LEVEL DESCRIPTION We sketch in the following the reference handling protocol; a pseudocode description is given in Appendix A. A source object contains an instance of a data type called outref for every attribute that refers to another object. A (target) object is associated with exactly one inref. The inref identifies the currently-known sources pointing to this target. Creating a new reference initialises both the inref and an outref. The only application-level operations supported by inref are initialisation and testing whether deleting the target is allowed. A (source) object contains any number of distinct outrefs. An outref supports the following application-level operations: (i) initialisation, (ii) assigning from another outref, (iii) assigning null (we assume that deleting an object first automatically nulls out all of its outrefs), and (iv) invocation, detailed shortly. To support concurrency, assigning an outref behaves much like a Multi-Value Register. Assignment overwrites its previous value; when concurrent assignments occur, the resulting reconciled value contains all the concurrently-assigned values. To simplify the semantics, we check that the right-hand side of the assignment is single-valued. 4 SYSTEM MODEL AND PSEUDOCODE The pseudocode for references is listed in Appendix A. Some preliminary explanations are required. References are layered above a lower-level unmanaged addressing mechanism (similar to a memory address used by the JVM), which we call key; a key uniquely identifies a single discrete (but possibly replicated) object. Our system model is based on invocation split into two phases: the generator executes at a single replica, and generates a list of downstream messages that are eventually received at all replicas and executed by corresponding effectors [6, 8, 11]. At the source replica, the downstream messages are processed atomically with the generator. Other replicas may observe delays between the different downstream messages, but they will always receive them in the order specified by the generator. The generator may check preconditions (noted precond) against shared state; if any precondition is false, the operation fails. A generator may not have side effects on shared state. The effector must have the same effect at every replica, and therefore may not depend on testing shared state. We assume an operation’s preconditions are stable, i.e., evaluating Ensuring referential integrity under causal consistency PaPoC’18, April 23–26, 2018, Porto, Portugal the precondition to true does not change under any concurrent operation [6].1 We assume causal consistency, i.e., one operation’s effector is delivered (to some replica) only after the effectors of operations that are visible to it. We consider two alternatives for composed operations: • Atomic: an operation is the atomic composition of all of its sub-operations. All the sub-generators (resp. sub-effectors) compose into a single atomic generator (resp. effector). This is somewhat similar to closed-nested transactions, without the isolation property. • Pure causal: An effector updates a single object, but effectors can be chained, respecting the order defined in the code. This is somewhat similar to transaction chaining. In both cases, if any precondition is false, the whole operation fails. Appendix A provides pseudocode for the latter option.2 The logic is relatively simple. On creating or copying a reference, avoid races by following the backward direction, first adding to the target, then to the source. On resetting (removing) a reference, follow the forward direction, first removing from the source, then from the target. We deal with concurrency by ensuring every reference has a unique identifier, and being careful of not losing any information. The details are tedious, but hopefully explained in the comments. The may_delete operation merits a more detailed explanation. This operation returns true if and only if the inref argument is not reachable; however, in order to break circular reference patterns, the last_refs argument lists references to ignore. The stably notation in may_delete and in the third invariant means that the assertion is true, and that there are no concurrent mutations that could make it false.3 Detecting stably boils down to detecting termination. Its implementation is well understood, requiring replicas to know about each other in order to exchange information on their progress [14]. Note that causal consistency is usually defined as a safety guarantee only [1, 13]. In order to ensure that a stably check eventually succeeds, we must add an assumption of progress, i.e., reads do not indefinitely return an old version. in earlier drafts of the implementation and were able to fix them. For the updated implementation, our tests did not find a problem after 50 000 random executions. ACKNOWLEDGMENTS This research is supported in part by European H2020 project number 732 505 LightKone, and by the RainbowFS project of Agence Nationale de la Recherche, France, number ANR-16-CE25-0013-01. REFERENCES [1] Mustaque Ahamad, Gil Neiger, James E. Burns, Prince Kohli, and Phillip W. Hutto. 1995. Causal memory: definitions, implementation, and programming. Distributed Computing 9, 1 (March 1995), 37–49. https://doi.org/10.1007/BF01784241 [2] Peter Bailis, Alan Fekete, Michael J. Franklin, Ali Ghodsi, Joseph M. Hellerstein, and Ion Stoica. 2014. Coordination Avoidance in Database Systems. Proc. VLDB Endow. 8, 3 (Nov. 2014), 185–196. https://doi.org/10.14778/2735508.2735509 Int. Conf. on Very Large Data Bases (VLDB) 2015, Waikoloa, Hawai’i, USA. [3] Koen Claessen and John Hughes. 2000. QuickCheck: a lightweight tool for random testing of Haskell programs. In Proceedings of the Fifth ACM SIGPLAN International Conference on Functional Programming (ICFP). https://doi.org/10.1145/351240.351266 [4] Paulo Ferreira and Marc Shapiro. 1994. Garbage Collection and DSM Consistency. In Symp. on Op. Sys. Design and Implementation (OSDI). ACM, Monterey CA, USA, 229–241. http://www.usenix.org/publications/library/proceedings/osdi/ferr.html [5] Paulo Ferreira and Marc Shapiro. 1996. Larchant: Persistence by Reachability in Distributed Shared Memory through Garbage Collection. In Int. Conf. on Distributed Comp. Sys. (ICDCS). Hong Kong, 394–401. https://doi.org/10.1109/ICDCS.1996.507987 [6] Alexey Gotsman, Hongseok Yang, Carla Ferreira, Mahsa Najafzadeh, and Marc Shapiro. 2016. ’Cause I’m Strong Enough: Reasoning about Consistency Choices in Distributed Systems. In Symp. on Principles of Prog. Lang. (POPL). St. Petersburg, FL, USA, 371–384. https://doi.org/10.1145/2837614.2837625 [7] Leslie Lamport. 1978. Time, Clocks, and the Ordering of Events in a Distributed System. Commun. ACM 21, 7 (July 1978), 558–565. http://doi.acm.org/10.1145/359545.359563 [8] Cheng Li, Daniel Porto, Allen Clement, Johannes Gehrke, Nuno Preguiça, and Rodrigo Rodrigues. 2012. Making Geo-Replicated Systems Fast as Possible, Consistent when Necessary. In Symp. on Op. Sys. Design and Implementation (OSDI). Hollywood, CA, USA, 265–278. [9] Tobias Nipkow, Lawrence C. Paulson, and Markus Wenzel. 2002. Isabelle/HOL — A Proof Assistant for Higher-Order Logic. LNCS, Vol. 2283. Springer. [10] Marc Shapiro, Peter Dickman, and David Plainfossé. 1992. SSP Chains: Robust, Distributed References Supporting Acyclic Garbage Collection. Rapport de Recherche 1799. Institut National de la Recherche en Informatique et Automatique (Inria), Rocquencourt, France. http://lip6.fr/Marc.Shapiro/papers/SSPC_rr1799.pdf [11] Marc Shapiro, Nuno Preguiça, Carlos Baquero, and Marek Zawirski. 2011. Conflict-free Replicated Data Types. In Int. Symp. on Stabilization, Safety, and Security of Dist. Sys. (SSS) (Lecture Notes in Comp. Sc.), Xavier Défago, Franck Petit, and V. Villain (Eds.), Vol. 6976. Springer-Verlag, Grenoble, France, 386–400. https://doi.org/10.1007/978-3-642-24550-3_29 [12] Marcin Skubiszewski and Patrick Valduriez. 1998. Using GC-Consistent Cuts for Concurrent Garbage Collection in O2 . Networking and Information Systems 1, 2-3 (1998), 213–230. [13] Paolo Viotti and Marko Vukolić. 2016. Consistency in NonTransactional Distributed Storage Systems. 49, 1 (jul 2016), 19:1–19:34. https://doi.org/10.1145/2926965 [14] Gene T. J. Wuu and Arthur J. Bernstein. 1984. Efficient solutions to the replicated log and dictionary problems. In Symp. on Principles of Dist. Comp. (PODC). Vancouver, BC, Canada, 233–242. http://doi.acm.org/10.1145/800222.806750 Correctness. In order to validate the correctness of our CRDT references implementation, we formalized the system model and pseudocode implementation in Isabelle/HOL [9] and tested it with Haskell QuickCheck [3]. The corresponding code is available on GitHub.4 The QuickCheck tests generate random executions and then check the first and the third invariant described in the pseudocode. To generate interesting random executions, we let each generated event depend on two randomly chosen previous events. Then, we randomly decide how many of their effector messages have been delivered to the new event. By doing this, it is likely that an event observes other events only partially, which is a common source of bugs. Indeed, we were able to discover some flaws A PSEUDOCODE 1 The pseudocode also makes use of local_precond, which does not need to be stable. Our use of the term “stable” in this section follows the terminology used in relyguarantee logic. 2 The “atomic” version is easier to read, but we prefer to minimise the assumptions. It is obtained from the pure-causal version by replacing the chained effectors by a single atomic one with the same text. 3 This is called a “stable” property in the literature on distributed algorithms; we use “stably” to distinguish from the usage in Footnote 1. 4 https://github.com/peterzeller/ref-crdt The following pseudocode describes the pure-causal version of references. The atomic version differs essentially by replacing the cascaded effectors with a single atomic one. Block structure is indicated by indentation. Comments are preceded by the “%” character. 1 datatype outref of T PaPoC’18, April 23–26, 2018, Porto, Portugal 2 % A reference to an object of type T containing an inref. Marc Shapiro, Annette Bieniusa, Peter Zeller, and Gustavo Petri 71 72 4 5 6 7 8 9 % Key of embedding object. If object has multiple outrefs, assume % each one has a distinct object_key. object_key: write_once register of Key % routing information to referenced object dest_keys: MV_register of (outkey: Key, id: uid), initial (nullkey, nulluid) 74 75 76 77 78 79 11 12 13 14 15 16 17 18 20 21 22 23 25 26 27 28 datatype inref % key of embedding object object_key: write_once register of Key % set of reverse references rev_refs: 2P_set of (inkey: Key, id: uid), initial emptyset % call "init" only once inuse: CRDT_flag, initial false 80 % correct type invariant forall r: outref of T (k,u) in r . dest_keys ==> k in T 94 81 82 31 32 33 34 35 37 38 39 40 42 43 44 45 47 48 49 50 51 52 53 54 55 56 57 59 60 61 62 64 65 66 67 68 69 70 % create a reference from outref to inref init (outref: outref of T, inref: inref) generator (outref, inref) precond ! inref . inuse % call init only once effector#1(inref) % run _outref_update effectors after effector#1 _outref_update(outref, inref.object_key) effector#1(inref) inref.inuse := true % Remove an inref. % Deleting the object that embeds inref calls this; therefore, the 86 % outer delete will fail if there are any remaining references. 87 reset (inref: inref) 88 generator % if outref exists, inref exists 89 % Non-reachability is monotonic invariant 90 precond inref . may_delete() forall r: outref of T 91 effector (k,u) in r . dest_keys ==> (r . object_key, u) in k . inref . rev_refs 92 skip 84 85 95 96 97 98 30 % finally, remove old reverse refs k . inref . rev_refs . remove ((source_key, u)) % Remove an outgoing reference % Deleting the object that embeds the outref calls this. reset (outref: outref of T) generator (outref) % same as assigning nullkey: _outref_update(outref, nullkey) % once an inref is unreachable, it remains unreachable 99 invariant forall i: inref 101 := (outTo: outref of T, outVal: outref of T) % "stably" = true at all replicas and no concurrent updates in flight 102 assign (outTo, outVal) stably { i . rev_refs = emptyset } ==> henceforth { i . rev_refs = emptyset } 104 % outTo := outVal 105 % %% constructor; not part of API 106 % Copy outVal into outTo; reset outTo; in that order. Either may be _create_inref (k: Key, inref: inref) 107 % initially null. No-op if outVal target already in outTo. % the inref is embedded inside the object with key k 108 % inref . object_key := k 109 % Concurrent "assign"s to outref store multiple values inside MV_register. 110 % The user should resolve by a subsequent "assign" %% constructor; not part of API 111 % _create_outref (k: Key of T, outref: outref of T) 112 assign (outTo: outref of T, outVal: outref of T) % the outref is embedded inside the object with key k 113 generator (outTo, outVal) outref . object_key := k 114 % simplification: ensure outVal has no more than one target 115 % local check, not necessarily stable %% updates outref with new key value; not part of API 116 local_precond outVal . dest_keys . count() = 1 _outref_update(outTo: outref of T, new_key: Key) 117 let (new_key, _) = outVal . dest_keys . get1 () generator(outTo, new_key) 118 _outref_assign(outTo, newKey) let source_key = outTo . object_key let to_reset = outTo . dest_keys . getall () 120 % Use a reference to call the target object let newuid = new_uid() 121 deref (outref: outref of T, invocation: invocation of T) % explicit effector chaining 122 generator (outref, invocation) if new_key != nullkey 123 % local checks, not necessarily stable effector#1 (outTo, source_key, new_key, to_reset, newuid) 124 local_precond outref . dest_keys . count() = 1 else 125 local_precond outref . dest_keys . get1() != (nullkey, _) effector#2 (outTo, source_key, new_key, to_reset, newuid) 126 let (key1, _) = outref . dest_keys.get1() 127 effector(key1, invocation) effector#1 (outTo, source_key, new_key, to_reset, newuid) 128 invoke (key1, invocation) % first insert into new target new_key . inref . rev_refs . add ((source_key, newuid)) 130 % Is target object reliably not referenced? effector#2 (outTo, source_key, new_key, to_reset, newuid) 131 % To be tested in a generator. last_refs: if only these exist we are 132 % still OK, because the effector will to reset them shortly. effector#2 (outTo, source_key, new_key, to_reset, newuid) 133 may_delete (inref: inref, % then assign source 134 last_refs: set of outref, default emptyset outTo . dest_keys := (new_key, newuid) % conc. assign possible 135 ): boolean forall (k, u) in to_reset 136 generator (inref, last_refs) % chain reset 137 % check that the only remaining rev_refs are those in last_refs effector#3 (k, u, source_key) 138 % (none by default) effector#3 (k, u, source_key) 139 last_keypairs: set of (Antidote_key, uid) Ensuring referential integrity under causal consistency 140 141 142 143 144 = { fold (last_refs, lambda (r) cons (r.object_outref, "_")) } return stably inref . rev_refs = last_keypairs effector () skip PaPoC’18, April 23–26, 2018, Porto, Portugal This figure "ref-example.jpg" is available in "jpg" format from: http://arxiv.org/ps/1803.03482v1
8cs.DS
The Value of Distributed Energy Resources for Heterogeneous Residential Consumers Siddharth Patel* and Ram Rajagopal*† arXiv:1709.08140v2 [cs.SY] 25 Oct 2017 * Department of Civil and Environmental Engineering, Stanford University Department of Electrical Engineering (by Courtesy), Stanford University † Abstract The presence of behind-the-meter rooftop PV and storage in the residential sector is poised to increase significantly. Here we quantify in detail the value of these technologies to consumers and service providers. We characterize the heterogeneity in household electricity cost savings under time-varying prices due to consumption behavior differences. The top 15% of consumers benefit two to three times as much as the remaining 85%. Different pricing policies do not significantly alter how households fare with respect to one another. We define the value of information as the financial value of improved forecasting capabilities for a household. The typical value of information is 3.5 cents per hour per kWh reduction of standard deviation of forecast error. Coordination services that combine the resources available at all households can reduce costs by an additional 15% to 30% of the original total cost. Surprisingly, on the basis of coordinated action alone, service providers will not encourage adoption beyond 50% within a group. Coordinated information, however, enables the providers to generate additional value with increasing adoption. Distributed energy resources (DERs) are an essential part of modernizing and de-carbonizing the grid [1–3] and pose challenges for the design, management, and operation of the electricity system [4–6]. Dramatic changes are expected as consumers adopt behind-the-meter DERs and become prosumers capable of responding to prices and other signals from grid operators [7, 8]. Technology vendors (e.g. Solar City) and DER resource aggregators (e.g. OhmConnect) will play a significant role in the emerging ecosystem by making DERs accessible to smaller consumers and ensuring that they operate those technologies in a manner aligned with their self-interest and compatible with the needs of the grid as a system. The proliferation of DERs will create opportunities for new business models as well. The coming impact of the adoption of energy storage and rooftop photovoltaic (PV) systems by residential consumers is not well understood [9]. The impact of DERs depends on the adoption rate of technology, the operations strategy, and the financial and policy arrangements for system participants. Consumer behavior and the resulting consumption pattern heterogeneity are critical drivers of DER value and govern the interactions between these dimensions. Residential electricity consumption exhibits significantly more diversity than previously believed [10]. Yet this heterogeneity is seldom accounted for in existing studies, which use data from a small number of residential or commercial consumers to evaluate the consumer-side economics of PV [11–15], storage [16, 17], or both combined [18–24]. In this paper we propose a simple and scalable methodology to estimate DER value and impact that incorporates consumption heterogeneity. We apply our methodology to provide a first of its 1 kind assessment of the value of these technologies to residential consumers, technology vendors, and aggregators under various business models and policy arrangements. We focus on PV and batteries because they are commercially available and gaining traction as their costs decrease [25–29]. Our study accounts for adoption rates and consumption heterogeneity in unique ways to identify tipping points for impact. We utilize a large dataset of hourly power consumption recordings for residential consumers in Northern California to capture heterogeneity. Based on this data we build various models to assess the value of storage and PV to consumers in the form of bill savings. We estimate the value that can be delivered by entities that provide improved information to and enable resource sharing among residential consumers. Households rely on information about future consumption and generation when deciding how to operate their DERs. We model how constraints on this information impact the value of DERs to households. This analysis gives an estimate of the value of services that improve the accuracy of information available to the households. Communication technology enables aggregators to coordinate and share DERs among a group of households. We analyze the value that these coordination services can generate, which depends on the pattern of technology adoption by households and the sharing mechanism. 1 Assessing value from data Storage devices enable households to shift their energy usage in time, and rooftop PV generates electricity that households can consume directly or sell back to the grid. Both technologies allow households to reduce their electricity costs. We estimate how much households and groups of households could save on their bills if they adopted a 5 kW rooftop PV system and a 7 kWh storage device1 and operated these devices to minimize their electricity costs. We take a household’s hourly smart meter data as its inflexible end-use consumption. We provide an a-priori snapshot of potential bill savings. Thus, electricity prices are exogenous in our model. Similarly, we assume that households do not significantly alter their electricity consumption behavior when they adopt DERs or when they face differing rates. Refer to the Methods section for detailed explanations of the data sources and analyses. 2 Value of technology for households We define absolute savings for a household, Sa,i , as how much its electricity bill decreases when it adopts PV and storage. A household’s normalized savings is Sn,i = Sa,i /(1T Li ), its absolute annual savings divided by its original total energy consumption. This gives a cents per kilowatt-hour savings estimate for each household. Relative savings is the ratio between a household’s normalized  savings and that of the top household under a given policy, i.e. Sn,i / max Sn,i . Relative savings i are always between 0 and 1, and they enable a comparison of the concentration of benefits under the different pricing policies. We compute savings under three pricing policies, incorporating time-of-use (TOU), wholesale, and dynamic rates, as listed in the table in Figure 1. 1 We conducted five sensitivity studies with varying PV and storage device sizes. Most of the qualitative results of our study were unchanged. 2 count count 4000 2000 7500 5000 2500 0 0 0 L2 Policy 1 2 3 Purchase Price Retail TOU Retail dynamic Retail TOU Sale Price Wholesale Discounted dynamic Discounted TOU 3 0.1 0.2 (a) 40 30 20 ●●●●● Peak 0 1 6 12 Hour (c) 0.4 0.5 (b) ●●●●●●●●●●●●●●●● ●●● ●●●●●●●●●●●●●●●●●●●●●●●● 10 0.3 Peak fraction 18 24 Price (c/kWh) Coordinator 2 Mean load (kW) Price (c/kWh) L1 1 6 4 2 ●● ● ●●● ●● ● ●● ●● ● ●● ● ● ●● ●● ●● ● ● ●● ●●● ●● ● ● ●● ●● ● ● ● ●● ● ● 0 1 6 12 18 24 Hour (d) Figure 1: There is considerable heterogeneity in the households in our dataset, which together consume about 0.8 GWh of electrical energy annually. Fig. (a) shows the distribution of mean electrical load for the households in our dataset (range 0.1-13.0 kW), and Fig. (b) shows the distribution of the fraction of consumption that takes place during peak hours (range 0.01-0.65). In our study, each household has a given inflexible load, Li , and a 7 kWh storage device and 5 kW rooftop PV system, which are connected to the house AC bus through inverters. The table defines pricing policies used in the simulations. The retail dynamic rate exposes households directly to wholesale market price variations. Fig. (c) plots the retail TOU rate for a summer (red) and winter (blue) business day. Figure (d) does the same for the wholesale rate. The retail dynamic rate is a scaled version of the wholesale rate. 3 2.1 Heterogeneity in savings Figure 2(a) illustrates the distribution of annual absolute savings under the different pricing policies. The variation in annual savings between households is the greatest under Policy 1. In this case, the sale price is much less than the purchase price, so the benefit from offsetting consumption is much greater than that from selling electricity back to the grid. Thus, heterogeneity in household consumption patterns drives greater differences in savings. In contrast, under Policies 2 and 3, in which the sale price is close to the purchase price, offsetting consumption is at most a little better than selling electricity back to the grid. Thus, the variation between household savings is reduced, given that they all have the same size PV and battery. 2.2 Policy impact on savings Policy has a fundamental impact on the absolute savings available to the households. Policies 2 and 3 are the most advantageous to them, allowing households to sell back electricity at almost the full retail rate. Switching to Policy 1, which reduces the sale price to the wholesale rate, cuts the available savings in half as compared to Policy 2. Households fare better under Policy 2 than Policy 3 because the dynamic rate is in effect a more pronounced version of the TOU, with higher peaks and lower troughs. Thus, under Policy 2 PV is worth more because higher peak hour prices coincide with peak generation hours, and the storage devices also have higher inter-hour price differentials to work upon. 2.3 Segmentation of households by normalized savings Figure 2(b) shows that under all three pricing policies, the households are divided into three segments based on normalized savings - the top 15%, the middle 80%, and the bottom 5%. The average normalized savings among the top savers is about twice that of the rest under Policy 1, and about thrice that of the rest under Policies 2 and 3. This concentration of benefits has a significant implication for vendors who could provide rooftop PV and storage to households. Because they stand to save more, the top savers represent a pool of greater potential surplus. The first vendor to enter into this market would reap substantial benefits by targeting them. Later entrants would have to compete over the remaining households, who have relatively similar, and lower, potential savings. 2.4 Policy impact on household savings rank Figures 2(c) and (d) compare savings under different policies. For absolute savings, the ranking of households is very similar under the two policies in which the sale price is close to the purchase price (Policies 2 and 3) and somewhat different when the sale price is much lower than the purchase price (Policy 1). That said, the correlation in ordering is strong across all three policies. The ranking of households by normalized savings is almost identical under all three pricing policies. Thus pricing policy has a strong impact on the magnitude of savings but a weak effect on the ordering of which households do best. 4 1.00 Relative savings Savings ($/year) 3000 2000 1000 0 0.75 T 0.50 M B 0.25 0.00 Rank Rank (a) (b) (c) (d) Figure 2: (a) Absolute annual savings are plotted for Policy 1 (red), Policy 2 (blue), and Policy 3 (green). For each pricing policy, the households are ranked in decreasing order based on savings. About half of the available savings under Policy 2 are eliminated by switching to Policy 1. Policy 3 savings are about halfway between the other two. (b) Relative savings are plotted for the three pricing policies. The top 15% saver segment is labeled with a ”T,” the middle 80% with an ”M,” and the bottom 5% with a ”B.” Under Policy 1, the mean savings among the top households is 1.8 times the mean savings of the rest; that ratio is 3.1 under Policies 2 and 3. This concentration presents an opportunity for targeting. (c) Absolute annual savings under different policies are plotted against each other, with Spearman’s rank correlation coefficient rs given on each plot. The ordering of households by absolute annual savings is very similar under Policies 2 and 3, while the ordering under Policy 1 is less strongly correlated. (d) Normalized savings under different policies are plotted against each other. The household ordering is practically the same under all three policies. While not shown here, absolute annual savings are negatively correlated with normalized savings, strongly for Policy 1 and weakly for Policies 2 and 3. 5 3 Value of information When deciding how to operate its storage device, a household relies on a forecast of its future consumption and rooftop PV generation. The preceding sections have assumed that households have perfect foresight of these quantities. An imperfect forecast leads a household to operate its storage suboptimally, so it saves less money than it would if its forecast were perfect. We can thus characterize the value of information for a household by evaluating how much more it pays for electricity as the forecast error level increases. This metric gives a sense of how much a household should be willing to pay a service provider for reducing forecast error through data analytics or improved algorithms. For each household, we increase the coefficient of variation2 (CV) of its forecast error from 0% (perfect foresight) to 100%, and we compute how much its cost of electricity increases in absolute and normalized terms given Policy 1 pricing. The relationship between cost and CV is highly linear in this range. Thus, the slope of the best fit line between cost and CV provides a good estimate of the sensitivity of the household’s electricity cost to forecast error. This sensitivity is what we define to be the value of information for a given household. Heterogeneous consumption behavior leads to variation in the value of information to households. Figure 3(a) shows the distribution of the value of information in absolute terms. About 50% of households have an annual value of information greater than $270 per unit of CV. In other words, assuming they adopt storage and PV, 50% of households should be willing to pay $90 annually for a service that reduces the standard deviation of their forecast errors by an amount equivalent to one third of their mean consumption. The distribution of the value of information in normalized terms is shown in Figure 3(b). The mode is around 3.5 ¢/hour/kWh of standard deviation of forecast error. Most households should be willing to pay 3.5¢ hourly for reducing the standard deviation of their forecast errors by 1 kWh. This is not insignificant when compared to the 20-35 ¢/kWh purchase price for electricity under Policy 1, considering that most households consume on average less than 1 kWh each hour. 4 Value of coordination We define a coordinator as an entity that collectively manages the storage and rooftop PV of a group of households. Coordinators (or aggregators) can provide services to consumers by enabling the sharing of existing assets. They can also provide services to the grid ecosystem by limiting ramping events caused by synchronized activity, shaving peak load, and regulating voltage and frequency [30, 31]. We focus on the additional value that coordination can bring to a group of households that includes adopters and non-adopters. We define the value of coordination as the additional savings that the coordinator can achieve for the group of households, beyond what they can achieve acting separately. These additional savings represent a fund which the coordinator can draw upon to compensate the adopters for allowing the coordinator to use their devices for the benefit of others in the group. The value of coordination is the sum of the value of coordinated action (VCA) and the value of coordinated information (VCI). 2 The coefficient of variation is defined as the standard deviation of the forecast residuals divided by the mean of the actuals. 6 0.20 0.75 0.15 density CDF 1.00 0.50 0.10 0.05 0.25 0.00 0.00 100 200 300 400 0 Value of info. ($/year/CV) 10 20 Value of info. (c/hour/kWh) (a) (b) Figure 3: The value of information is the increase in electricity costs incurred by a household due to an increase in the CV of its forecast errors. Fig. (a) shows the cumulative distribution function for the value of information in absolute terms. Fig. (b) gives the distribution of the value of information in normalized terms. The blue line is a fitted log-normal density with a log-mean of 1.497 and log-standard deviation of 0.539. These values are under Policy 1 pricing. The value of coordination depends on the adoption rate and pattern. The pattern in which households adopt technology is subject to complex economic, behavioral, and social factors. We consider two simple adoption rules. Under forward adoption, the adopters are those who stand to save the most in absolute annual savings terms. Under reverse adoption, the adopters are those who stand to save the least. We also consider random adoption. 4.1 Value of coordinated action The coordinator can use the capacity of a storage device in one home in order to shift energy usage in other homes. The coordinator can also ensure that electricity generated by the rooftop PV of homes in the group is used to offset consumption within the group rather than exported to the grid. In essence, the coordinator manages the group of households as one large aggregated household with a large PV system and storage device, redirecting technology capacity to the uses that decrease the group’s cost the most. We define the VCA as the additional savings that the coordinator achieves for the group of households beyond what they save when they act separately, in the perfect foresight case. The VCA can be substantial - up to 29% of the original total cost of electricity, as shown in Figure 4. 4.1.1 VCA increasing in adoption rate up to a point For all three adoption patterns, coordination provides increasing value with increasing adoption, up to a point. Beyond 50% adoption, the value of coordination decreases. The reason for this decline is as follows. The TOU rate has an expensive peak period and an inexpensive off-peak period. When acting alone to minimize its cost of electricity, a household will use its devices to offset its consumption during the peak period first. If there is spare capacity after that, it will offset its consumption during off-peak times, and then it will sell electricity back to the grid. The coordinator, on the other hand, is minimizing the entire group’s cost of electricity. Therefore, it will use any capacity available to first offset as much of the peak period consumption across all households as possible. Thus, under coordination, more of the adopters’ home energy technology capacity goes 7 to offsetting peak period consumption, which means greater savings. For this reason, the VCA is much lower under Policies 2 and 3, when the sale price is very close to the purchase price. When the level of adoption is low, there are many households who do not have the technology and who therefore need help in offsetting their peak period consumption. The coordinator provides this help. When the level of adoption is high, more households have the technology to offset their own peak period consumption. The coordinator has fewer opportunities to redirect technology capacity to offset peak period consumption, and it instead ends up offsetting off-peak period consumption or selling surplus electricity back to the grid, both of which accrue less savings. Thus, as adoption increases beyond a certain point, the coordinator is left with lower-value opportunities for redirecting capacity. In our setting, on the basis of the VCA alone, a coordinator would not encourage DER adoption beyond 50% in a group of households because doing so would reduce the value of its services. Nonetheless, even at 100% adoption, coordinated action has value because some households consume enough electricity that they can make good use of other households’ storage and PV in addition to their own. 4.1.2 Mitigating inefficient adoption Coordination captures the value that would otherwise be lost due to inefficient adoption patterns by ensuring that the technology capacity is redirected to its most efficient application. For example, under reverse adoption, the households that stand to save the least adopt first. The coordinator does very well by redirecting their capacity to those in the group who can save more with it. Thus the VCA is higher under reverse adoption than under forward adoption. Even adopters with the highest total annual savings may not take full advantage of their DER capacity every day (e.g. when on vacation), so under forward adoption, the coordinator is still able to realize additional value by reallocating underutilized capacity. At high adoption rates, the VCA under forward adoption remains at a high fraction of its maximum because the later adopters save the least from their DERs - so redirecting their capacity elsewhere remains a very valuable service. 4.2 Value of coordinated information When operating the aggregated storage devices of the adopters, the coordinator only needs to forecast aggregate quantities. Thus, it faces much lower forecast errors than the individual households [32], enabling it to achieve a more optimal outcome. We define the value of coordinated information as the additional savings beyond the VCA that the coordinator achieves in the presence of forecast error. The VCI increases with adoption level and with forecast error CV for all adoption patterns, as shown in Figure 5. The adoption pattern does not have much effect on the VCI. At higher levels of adoption, the VCI increases more for a given increase in forecast error level. This is because when adoption is higher, the coordinator is operating a greater amount of technology capacity, so its forecasting advantage yields a greater amount of additional savings. Figure 6 shows the value of coordination as the sum of the VCI and VCA for the forward and reverse adoption patterns at a forecast error level of 50%. In the case of forward adoption, at higher levels of adoption the increasing VCI more than offsets the drop in VCA, so a coordinator would encourage adoption beyond 50%. In general, the value of coordination may be increasing or decreasing in adoption rate, depending on the adoption pattern, adoption level, and forecast error level. 8 VCA (%) 30 20 10 0 0 20 40 60 80 100 Adoption (%) Figure 4: The value of coordinated action (VCA) is given here as a percentage of the baseline total cost of electricity for all households prior to any technology adoption. The purple curve is for the forward adoption pattern, the orange curve is for reverse adoption, and the gray curve is for random adoption. The VCA increases as the level of PV and storage adoption within the group increases up to about 50%, after which coordination provides less value. The VCA is greater under the reverse adoption pattern because the coordinator is able to redirect capacity and therefore overcome inefficient initial allocations of technology. The values here are computed under Policy 1 pricing. 9 15 10 5 0 15 VCI (%) VCI (%) VCI (%) 15 10 5 0 0 20 40 60 80 100 10 5 0 0 20 Adoption (%) 40 60 80 100 0 20 Adoption (%) (a) Forward adoption 40 60 80 100 Adoption (%) (b) Random adoption (c) Reverse adoption VCA TCS TCC (a) Value of Coordination (%) VCI Value of Coordination (%) Figure 5: These plots show the value of coordinated information (VCI) as a function of adoption level and forecast error level for the (a) forward, (b) random, and (c) reverse adoption patterns. In each graph, the lightest line corresponds to a forecast error CV of 10%, and the darkest a CV of 100%, with the intermediate colors at 10% increments. The VCI is greater when the forecast error is greater and when the adoption level is greater. The VCI is reported as a percent of the baseline total electricity cost for all households (as in Fig. 4). The values here are under Policy 1 pricing. 30 20 10 0 0 25 50 75 Adoption (%) 100 30 20 10 0 0 25 50 75 100 Adoption (%) (b) Forward adoption (c) Reverse adoption Figure 6: (a) This diagram illustrates the definitions of VCA and VCI. TCS is the total cost of electricity paid by the group of households when they optimize separately. TCC is the total cost they pay under coordination. The light gray bars are costs under perfect foresight, and the dark gray bars are the additional costs due to forecast error. VCA is the reduction in cost under perfect foresight. VCI is the additional reduction in cost in the presence of forecast errors. The sum of VCA and VCI is the value of coordination. The value of coordination when the forecast error CV is 50% is plotted for the (b) forward and (c) reverse adoption patterns. The lighter color is VCA, and the darker color is VCI. As in Fig. 4, the values are reported as a percent of the baseline total cost of electricity without technology, and Policy 1 prices apply. 10 5 Discussion Our methodology and results are useful to stakeholders developing their plans of action with respect to behind-the-meter DERs. We provide a tool for policy makers to understand the high-level impact of different pricing policies on household incentives and ordering. Pricing policy is a useful lever to adjust the amount of savings available to households and hence their economic incentives to adopt DERs. It does not, however, significantly alter which households fare the best when adopting DERs. For that purpose other policy tools, such as targeted subsidies, would be required. Enabling sharing arrangements that allow for coordination is another way that policy makers can ensure that as many households as possible can benefit from DER adoption. With coordination, even if the households who consume the most electricity are the ones who adopt DERs, other households can share in their capacity and reduce their costs as well. In the end, all households are better off with coordination, and the technology capacity is deployed to its most efficient applications. Our study reveals key insights for emerging business models that serve households who adopt DERs. The magnitude and distribution of household savings give a sense of the market size and structure for vendors of DER equipment. These vendors will do best when households have the largest potential savings - so they would do well to support pricing policies that are the most generous to households, like Policies 2 and 3. These two policies also result in more even benefits across all households, which would make targeting less of a priority if the vendors’ sales and operations take place on an absolute dollar basis. On the other hand, under Policy 1, targeting is important because absolute savings are rather unevenly distributed. By contrast, vendors who operate on a normalized ($ per kWh) basis must prioritize targeting no matter what because the market is segmented similarly under all pricing policies. Normalized savings are negatively correlated with absolute savings, meaning that the top market segment is composed of households who don’t save a large amount in total but whose consumption behavior is aligned very well with the incentives created by the pricing policies. This finding underscores the importance of devising arrangements and business models for coordinating DER capacity among groups of households, many of whom would not adopt on their own but who could collectively benefit a great deal from a shared resource. The value of information analysis gives clear guidance to information service providers about potential price points for algorithms and analytics that help households manage their DERs. Similarly, the value of coordination analysis gives aggregators a sense of the revenue possibilities for sharing DERs among households. We also identify a tipping point for these aggregators. When the adoption rate within a group of households exceeds a certain level, the VCA declines. In the presence of uncertainty, however, the aggregator can deliver a VCI that increases in adoption rate. The combined value of coordination may increase or decrease with increasing adoption, depending on the adoption pattern, adoption level, and uncertainty level. It may be the case that the aggregator delivers maximum value when it assembles households into groups that include adopters and non-adopters in a particular mix. Finally, we note a tension between the business models of the equipment vendor and the coordination service provider. An equipment vendor interested in selling PV and storage systems to households does best by targeting those with the highest potential savings because they can pay the most for the equipment. It will be inclined to proceed along the forward adoption pattern so that it can charge higher prices and get more customers. On the other hand, a coordination service provider would want to encourage the reverse adoption pattern because that makes its services more valuable. However, the coordination service provider will not encourage adoption beyond the 11 point at which the value of its services is maximized (e.g., 50% adoption in Figure 4). The tension between these two business models could manifest in support for competing policies dealing with pricing, equipment subsidies, and sharing mechanisms. 6 Methods Our study incorporates actual smart meter data, pricing data, solar irradiance data, and specifications for currently available home energy technologies. We assume that households and groups of households operate the technologies to minimize their cost of electricity. Here, we describe in detail the data sources we use and the analyses we perform. 6.1 6.1.1 Data sources Household consumption The household electricity consumption data comes from over 100,000 residential smart meters over a one year period spanning from August 2010 to July 2011. The households are all customers of Pacific Gas and Electric Company (PG&E) in California. These meters include single family homes and apartments. Meters with very low consumption (<0.1 kW annual mean) are excluded, as are meters with a high amount of zero readings (>50% of all readings). We treat the smart meter data that we have for a household as its inflexible load Li . This move rests on two assumptions. The first is that consumption behavior does not change due to rate changes. Thus, even though almost all of these households were on an inclining block rate for the period of time of the meter data, their electricity consumption behavior does not change when exposed to the pricing policies in our study. Note that retail rate design typically aims for revenue neutrality, which means that between different rates, the marginal price faced by consumers varies much more than the average price. Both [33] and [34] find that household electricity consumption responds most strongly to the average price of electricity, lending support to using the meter data as the inflexible load. The second assumption is that consumption behavior does not change due to DER adoption. For the sizes of PV systems we study, [35] suggests that most households would increase their overall electricity consumption. Computing bill savings based on greater consumption would result in larger savings than what we report, so our study is conservative in that sense. 6.1.2 Prices Retail TOU Utilities are moving towards time-varying rates, which create incentives for consumers to shift their electricity purchases to periods when the rate is lower [36]. PG&E’s E-TOU Option B serves as the retail TOU rate for this study [37]. Table 1 contains the relevant elements of the tariff. We exclude fixed charges in the tariff when computing household electricity bills. Discounted TOU In a recent survey, industry professionals were asked what households should receive for electricity they sell back to the grid. A plurality of them favored the full retail rate minus the costs of using the physical infrastructure of the grid [38]. These costs are estimated as 20% of the retail rate, so households would be compensated at 80% of the retail rate - what we call the discounted TOU. 12 June - September October - May Off peak hours $ 0.25511 / kWh $ 0.20191 / kWh Peak hours (4pm-9pm) $ 0.35817 / kWh $ 0.22071 / kWh Table 1: The retail TOU rate for this study comes from PG&E’s E-TOU. Peak hour rates apply only on non-holiday weekdays. On holidays and weekends, all hours are charged at the off peak rate. Wholesale Locational marginal prices (LMPs) serve as the wholesale price. They come from a wholesale energy market administered by the California Independent System Operator (CAISO). We use the day ahead LMPs published by CAISO for the dates corresponding to the household consumption data, but we set any negative prices to zero. The wholesale rate varies by location. We use a rough mapping from a household’s zip code to the nearest CAISO pricing node by latitude and longitude, and we use the LMP from that node as the wholesale price for the household. Thus all households in a given zip code face the same wholesale price. Retail dynamic The retail dynamic rate is a scaled version of the wholesale rate. The scaling is designed to maintain day-by-day revenue neutrality with the retail TOU. For each day, across all zip codes, the total cost of all of the households’ inflexible load at the retail TOU rate and the wholesale rate is computed. The LMPs for each zip code are then scaled up by the ratio of the retail TOU revenue to the wholesale revenue. The retail dynamic rate exposes households more directly to the fluctuations of the wholesale market. Discounted dynamic The discounted dynamic rate is 80% of the dynamic rate. 6.1.3 Home technologies We assume that households can install DERs behind the meter without interference from their electricity provider, and that households living in apartments can adopt DERs by participating in a building or neighborhood sharing arrangement [39]. Rooftop PV We size the rooftop PV system for an output of 5 kW under the PVUSA Test Condition (PTC) of 140 W/m2 . This equates to an array area of about 35.7 m2 . According to the Solar Energy Industries Association, 5 kW was the average size of installed residential systems in the United States a few years ago [40]. Storage device The storage device specifications are based on the first generation of the 7 kWh Tesla Powerwall. The capacity is 7 kWh. The maximum sustained charging rate is 2 kW, which is also the maximum sustained discharging rate. The round trip efficiency is 0.92. We take the square root of that, 0.959, to split it into a charging and discharging efficiency. We assume no self-discharge. Interconnection We assume that the rooftop PV is connected to the house AC bus through an inverter with 92% efficiency. The storage device is connected in the same way. Thus, all energy 13 flows to and from the storage device, and from the PV, incur 8% loss through the inverters. We assume that there is no limit on the power that a household can draw from or provide to the grid. 6.1.4 Solar irradiance There are 67 Class 1 and 2 (CRN1 and CRN2) weather stations with solar irradiance data in California [41–43]. For each station, we fit a beta distribution for global horizontal irradiance (GHI) based on statistics for 2010 published by the National Solar Radiation Data Base (NSDRB). The only geographic information we have for the households is their zip code. For the weather stations we have latitude and longitude. We use a rough mapping to match a zip code to the nearest weather station.3 We sample from the beta distribution for that station to generate a solar irradiance for the households in the zip code, i.e. all households in the same zip code get the same irradiance sample. 6.2 Pricing scenarios We analyze three different pricing policies, as listed in the table in Figure 1 of the main text. Under Policy 1, households purchase electricity at the retail TOU rate, and they sell any surplus back to the grid at the wholesale rate. Investor-owned utilities in California have proposed this price structure in recent discussions with regulators. This is generally considered the least generous compensation scheme that households are likely to encounter. Under Policy 2, households purchase at the retail dynamic rate and sell surplus back at the discounted dynamic rate. Under Policy 3, households purchase electricity at the retail TOU, and they sell it back to the grid at the discounted retail TOU. The retail TOU or discounted retail TOU rate is the same for all households. Thus, all households face the same prices under Policy 3. In all three scenarios, electricity prices are exogenous4 ; there is no dynamic market clearing in our study. In other words, households are price takers; their actions do not influence the prices they face. 6.3 Operation of storage device We consider rooftop PV an uncontrollable system - it will produce however much power is dictated by the solar irradiance. The storage device, however, is controllable, and households have to determine how to operate it. In our study, households solve a linear program on a daily basis to choose an optimal schedule for charging and discharging the battery. Here we describe that linear program. (j) Li is the ith household’s hourly smart meter data for a year, and li is the data for the jth day, (1) (365) (j) so that Li = [li · · · li ]. We take li as the household’s inflexible electrical energy consumption for the day. We multiply the day’s solar irradiance for the household by the panel power rating to get the (j) energy generated by the household’s PV system, ei . (If the household doesn’t have a PV system, (j) (j) (j) then ei = 0.) Finally, we get the household’s net load for the day, n = li − ηI ei , where ηI is 3 The San Francisco International Airport (SFO) weather station has a particularly low irradiance when compared to nearby areas. Therefore, we manually assigned zip codes near SFO to weather stations in the area using the average GHI as reported by the NSRDB Data Viewer as a guide [44]. 4 Conventional residential retail rates do not change rapidly, so for all intents and purposes the retail TOU rate in our study would be fixed as households begin the uptake of DERs. 14 (j) the inverter efficiency. In this section we assume that households have perfect foresight of li and (j) ei for the coming 24 hours. Let Qi and Ri be the year-long vectors of hourly prices at which the household buys and sells (j) (j) electricity, respectively, under the given pricing policy. Let qi and ri denote the prices on the jth day. Each day, the household must select u(j) , a sequence of hourly actions for the storage device. (j) (j) Let uh denote the action during hour h of the day. When uh is positive, the device is charging in hour h; when it is negative, the device is discharging. Similarly, x denotes the state of charge of the device, and xh the state of charge at the end of hour h. Let ηC and ηD be the charging and discharging efficiencies, respectively. Finally, g denotes the hourly net exchange with the grid. When gh is positive, the household is drawing power from the grid during hour h; when it is negative, the household is supplying power to the grid. The household seeks to minimize what it pays for electricity this day. It solves the following linear program. (j) (j) minimize [g]T+ qi + [g]T− ri u(j) ,x,g ∈ (1a) R24 subject to g = n + 1 [u(j) ]+ + (ηD ηI )[u(j) ]− ηC ηI (1b) − u ≤ u(j) ≤ u (1c) 0≤x≤x (1d) x0 = x 0 (1e) (j) xh = xh−1 + uh , ∀h ∈ {1, . . . , 24}, (1f) where u and u are respectively the maximum charge and discharge rates for the storage device, x is the maximum capacity of the storage device, and x0 is the state of charge of the device at the end of the prior day. The [·]+ and [·]− operators represent element-wise application of max(·, 0) and min(·, 0), respectively. Let the optimal schedule be denoted u(j)? . The household operates the battery per u(j)? , so the minimized objective is what it pays for electricity this day. Denote the minimized objective value as (j) ci . 6.4 Household savings analysis For a given pricing policy, we first compute the baseline annual bill for the household in the absence of the home energy technologies: bBL,i = LTi Qi . Next, we compute the household’s new bill in the P (j) presence of the technologies for the given pricing policy: bN,i = 365 j=1 ci . The absolute annual savings Sa,i = bBL,i − bN,i . The distribution of absolute annual savings under the different pricing policies is plotted in Figure 2(a). The normalized savings Sn,i = 1100 T L Sa,i . We convert normalized savings to relative savings i  by dividing by the maximum value over all households under a given policy, i.e. Sn,i / max Sn,i . i Figure 2(b) plots the distribution of relative savings under different pricing policies. 15 We compute error bars for the absolute annual savings and normalized savings by bootstrap resampling from the 365 days of the year for each household. The error bars are very small, so we omit them in the graphs. 6.5 Value of information analysis We estimate the value of information as the additional cost incurred by a household due to an increase in forecasting errors. (j) For a given day, instead of having perfect foresight of its inflexible consumption li and generation (j) (j) (j) ei , the household must generate forecasts l̂i and êi . Note that the household will know all relevant prices without uncertainty because the retail TOU does not change on a daily basis, and the day ahead LMPs are published prior to the start of the day on which they apply. (j) (j) (j) We introduce forecast error based on the coefficient of variation [32]. Let l̂i,h = [li,h + h ]+ , (j) (j) (j) (j) (j) and êi,h = [ei,h + γh ]+ where h and γh are independently and identically distributed across j (j) and h. For the forecast error CV of P , h is normally distributed with µ = 0 and σ = P L̄i , where L̄i is the mean of all of the entries of Li . In other words, L̄i is the mean hourly inflexible load of (j) the ith household. Similarly, γh is normally distributed with µ = 0 and σ = P Ēi , where Ēi is the mean hourly solar generation for household i. The household uses these forecasts to schedule the operation of its storage device. Let n̂ = (j) (j) l̂i − ηI êi . The household solves the same linear program as before, except that n̂ replaces n in constraint (1b). The optimal schedule u(j)† from this solution is what the household uses to operate its storage device. The household’s cost of electricity in this case is not the objective from the linear program because the true consumption and solar generation are different from the forecasts. Let g† = (j) (j) n + ηC1ηI [u(j)† ]+ + (ηD ηI )[u(j)† ]− , where n is the true net load, i.e. n = li − ηI ei . Then the (j)† (j) (j) household’s cost of electricity for this day is ci = [g† ]T+ qi + [g† ]T− ri . P (j)† The household’s annual cost of electricity at this level of forecast error CV is b†N,i (P ) = 365 j=1 ci . We compute b†N,i (P ) for P = 10, 20, . . . , 100, and b†N,i (0) = bN,i . We then perform a linear regression of b†N,i (P ) on P . The value of information for household i in absolute terms is the slope coefficient from this regression, which has units of $/year/CV. The cumulative distribution of this metric under Policy 1 prices is given in Figure 3(a). † To get the value of information for household i in normalized terms, we linearly regress 1100 T L bN,i (P ) i on P . This is the same as multiplying the value of information in absolute terms by 1100 T L , which i 5 will then have units of ¢/hour/kWh of standard deviation of forecast error. The distribution of this metric under Policy 1 pricing is given in Figure 3(b). Multiplying the total annual cost ($/year) by 100 ¢/$ gives total annual cost in ¢/year. Dividing that figure by total annual load (kWh/year) yields cost per unit load (¢/kWh). The coefficient of variation is defined as the standard deviation of the forecast errors divided by the mean of the actual signal. For the hourly load, the CV has units of standard deviation kWh standard deviation over hourly kWh load. Dividing kWhc load by kWhkWh yields units of ¢/hour/kWh load/hour standard deviation of forecast error. For the hourly solar generation, the units still work out to ¢/hour/kWh, but the standard deviation CV has units of kWhkWh , so the cancellations aren’t as clean as in the case of load. We choose to report solar/hour the metric as ¢/hour/kWh standard deviation of forecast error because the CV for solar generation scales directly with the CV for load in our method. 5 16 6.6 Value of coordination analysis For a given scenario, we compute the value of coordination as the additional savings that the entire group of about 100,000 households could obtain if they acted collectively instead of as individuals. We break the value of coordination into two components: the value of coordinated action (VCA) and the value of coordinated information (VCI). 6.6.1 Total costs without coordination Index all households by i = 1, . . . , N , where N is the total number of households. Under a given pricing policy, let f (i) be the ordering position of household i when the households are sorted in decreasing order of Sa,i . Let r(i) be the ordering position of household i when the households are sorted in increasing order of Sa,i . Finally, let s(i) be the ordering position of household i in a random permutation. Thus, if household m saved the most under this policy, then f (m) = 1, r(m) = N , and s(m) is wherever m is in the random permutation. Consider a given adoption rate, t%. Define Afwd (t) = {i : f (i) ≤ N · t%}, Arev (t) = {i : r(i) ≤ N · t%}, and Ardm (t) = {i : s(i) ≤ N · t%}. Define Bfwd (t) = {1, . . . , N } \ Afwd (t), and define Brev (t) and Brdm (t) analogously. P P Define the total cost under forward adoption as Tfwd (t) = i∈Afwd (t) bN,i + i∈Bfwd (t) bBL,i . In other words, add up the new bills (i.e., with technology) for the adopters and the baseline bills (i.e., without technology) for the non-adopters. The total costs under reverse adoption and randomP adoption are defined analogously. Next, define the baseline total cost without technology as TBL = N i=1 bBL,i . Figure 7 plots Tfwd (t), Trev (t), and Trdm (t) as a percent of TBL , under Policy 1 pricing. 6.6.2 Value of Coordinated Action The group minimizes its electricity costs on a daily basis. For a given day, we set up the optimization as follows. Note that the VCA is under perfect foresight. We take the mean of prices across all households to be the prices the coordinator faces. That is, P (j) (j) (j) (j) 1 PN qG = N1 N i=1 qi , and rG = N i=1 ri . Take a given level of adoption, t%, and assume the forward adoption pattern. The solar (j) (j) energy generated by the group, eG , is that generated by the PV systems of the adopters: eG = P P (j) (j) (j) N i∈Afwd (t) ei . The group’s inflexible load is the total across all households: lG = i=1 li . The (j) (j) group’s net load nG = lG − ηI eG . We obtain the group’s storage device capacity and charging and discharging rates by scaling up the parameters of the household storage device by the number of adopters n = N · t%. The coordinator solves the following optimization problem to schedule the operation of the collective storage. 17 Total Cost (% of baseline) 100 75 50 25 0 0 20 40 60 80 100 Adoption (%) Figure 7: The total annual cost of electricity without coordination for all households, as a percent of the baseline total cost without technology (TBL ), is plotted against the percent of households that have adopted storage and PV. This analysis is under Policy 1 prices. The purple curve is for the forward adoption pattern, the orange curve is for reverse adoption, and the gray curve is for random adoption. TBL is about $182 million, and it serves as the baseline cost used for Figs. 4 through 6. 18 minimize (j) uG ,x,gG ∈ R24 [gG ]T+ pb + [gG ]T− ps subject to gG = nG + (2a) 1 (j) (j) [u ]+ + (ηD ηI )[uG ]− ηC ηI G (2b) (j) − nu ≤ uG ≤ nu (2c) 0 ≤ x ≤ nx (2d) x0 = x 0 (2e) xh = xh−1 + (j) uG,h , ∀h ∈ {1, . . . , 24}, (2f) The coordinator then controls the adopters’ storage devices to execute the optimal schedule (j)? (j)? uG at the aggregate level. There are generally many ways to distribute uG over the adopters’ devices. An implicit assumption of this model of coordination is that the group of households has free use of the wires between the homes and that there are no losses in sharing energy this way. Energy supplied to the grid by one home in the group, whether by its rooftop PV or its storage device, can be used to offset the consumption of a separate home in the group with no loss and no fees, other than the losses induced by the first home’s inverter and storage device inefficiencies. In effect, this model of coordination treats the group of homes as one big household, combining their consumption, rooftop PV generation, and storage devices. The cost of electricity for the group of households for this day will be the optimal value of the P (j) (j) objective; call it cG . Define Cf wd (t) = 365 j=1 cG . The VCA for the forward adoption pattern at adoption level t% is then VCAfwd (t) = Tfwd (t) − Cfwd (t). The VCA for the reverse and random adoption patterns are defined analogously. Figure 4 plots the VCA for different adoption patterns and levels. 6.6.3 Value of Coordinated Information The VCI is defined as the additional savings achieved by coordination on top of the VCA in the presence of forecast errors. (j) (j) (j) (j) (j) For a given day, the coordinator must generate forecasts l̂G and êG . Let l̂G,h = [lG,h + G,h ]+ , (j) (j) (j) (j) (j) and êG,h = [eG,h + γG,h ]+ where G,h and γG,h are independently and identically distributed across h and j. The coordinator is forecasting aggregate quantities, so its error is lower than that of (j) the individual household. G,h is normally distributed with µ = 0 and σ = w(L̄G )L̄G , where P L̄G = N1 N i=1 L̄i , and w(·) is the fit for the CV scaling law for forecasting model M3 from [32]. P (j) γG,h is normally distributed with µ = 0 and σ = w(ĒG )ĒG , where ĒG = N1 N i=1 Ēi . (j) (j) Let n̂G = l̂G − ηI êG . The coordinator solves the same linear program as before, except that (j)† n̂G replaces nG in constraint (2b). The optimal schedule uG from this solution is the coordinator’s schedule of charging and discharging for the collective storage. (j) (j) Let g†G = nG + ηC1ηI [u†G ]+ +(ηD ηI )[u†G ]− , where nG is the true net load, i.e. nG = lG −ηI eG . The P †(j) (j) (j) †(j) † group’s cost of electricity for this day is cG = [g†G ]T+ qG + [g†G ]T− rG . Let Cfwd (t) = 365 j=1 cG . The P VCI for the forecast error CV of P and adoption level of t% is then VCIfwd (t) = i∈Afwd (t) b†N,i (P ) + 19 Case 1 2 3 4 5 PV size 5 kW 5 kW 2 kW Net 0 Net 0 Storage capacity 13.5 kWh 2 kWh 2 kWh 7 kWh 2 kWh Table 2: Five sensitivity study cases were evaluated. Net 0 means that household i’s PV system is sized so that over the course of the year, it generates as much energy as the household’s inflexible load (1T Li ). This leads to variation in the size of the panels among households, with the shape of the distribution basically in line with that of the mean load given in Fig. 1(a). The maximum charging and discharging rates for the 2 kWh storage device are scaled from the 5 kWh device parameters. The maximum charging and discharging rates for the 13.5 kWh device are both 5 kW, based on the second generation Tesla Powerwall. † − Cfwd (t) − VCAfwd (t). The VCI for the reverse and random adoption patterns are defined analogously. Figure 5 plots the VCI for different adoption patterns, forecast error CV levels, and adoption levels. P i∈Bfwd (t) bBL,i 6.7 Sensitivity studies We conducted five sensitivity studies on a subset of 12,000 households as listed in Table 2. All of the qualitative results are preserved in cases 1 and 2. In case 3, the only major difference is that the VCA under forward adoption is monotonically increasing - there is no maximum before 100% adoption. Because the capacities are relatively small in this case, the storage and PV of even the last adopter can be redirected to high value applications for other households (i.e., offsetting peak period energy consumption). In cases 4 and 5, households with larger inflexible loads have larger PV systems. Thus, the absolute annual savings distribution is very uneven, with the largest energy consumers saving much more compared to other households. On the other hand, normalized savings, which are scaled to household consumption, are more even across the population, to the point of being almost the same for all households under Policy 3. Relatedly, the ordering of households by normalized savings under Policy 2 is weakly correlated with the orderings under Policies 1 and 3. Thus, pricing policy does have a significant impact on which households do best by the normalized savings metric. 6.8 Data availability The pricing and solar irradiance data are publicly available. The smart meter data is the property of PG&E and was obtained by the authors under a non-disclosure agreement. To preserve privacy, resampled versions of the data underlying Figures 1, 2, and 3 were made available to the editors and reviewers. The data underlying Figures 4, 5, and 6 were made available in original form. The analysis code was made available to the editors and reviewers. In addition, reviewers were able to modify the simulation parameters and evaluate the altered results. 20 References [1] California State Assembly. (2013, Oct. 7) Assembly bill No. 327. [Online]. Available: https://leginfo.legislature.ca.gov/faces/billNavClient.xhtml?bill id=201320140AB327 [2] M. F. Akorede, H. Hizam, and E. Pouresmaeil, “Distributed energy resources and benefits to the environment,” Renewable and Sustainable Energy Reviews, vol. 14, no. 2, pp. 724 – 734, 2010. [Online]. Available: http://www.sciencedirect.com/science/article/pii/S1364032109002561 [3] R. K. Jain, J. Qin, and R. Rajagopal, “Data-driven planning of distributed energy resources amidst socio-technical complexities,” Nature Energy, vol. 6, p. nenergy2017112, 2017. [4] K. Kok and S. Widergren, “A Society of Devices: Integrating Intelligent Distributed Resources with Transactive Energy,” IEEE Power and Energy Magazine, vol. 14, no. 3, pp. 34–45, May 2016. [5] P. D. F. Ferreira, P. M. S. Carvalho, L. A. F. M. Ferreira, and M. D. Ilic, “Distributed Energy Resources Integration Challenges in Low-Voltage Networks: Voltage Control Limitations and Risk of Cascading,” IEEE Transactions on Sustainable Energy, vol. 4, no. 1, pp. 82–88, Jan 2013. [6] G. Xu, W. Yu, D. Griffith, N. Golmie, and P. Moulema, “Towards Integrating Distributed Energy Resources and Storage Devices in Smart Grid,” IEEE Internet of Things Journal, vol. PP, no. 99, pp. 1–1, 2016. [7] Y. Parag and B. K. Sovacool, “Electricity market design for the prosumer era,” Nature Energy, vol. 1, p. 16032, 2016. [8] I. S. Bayram and T. S. Ustun, “A survey on behind the meter energy management systems in smart grid,” Renewable and Sustainable Energy Reviews, vol. 72, pp. 1208 – 1232, 2017. [Online]. Available: http://www.sciencedirect.com/science/article/pii/S1364032116306852 [9] S. Agnew and P. Dargusch, “Effect of residential solar and storage on centralized electricity supply systems,” Nature Clim. Change, vol. 5, no. 4, pp. 315–318, 04 2015. [10] J. Kwac, J. Flora, and R. Rajagopal, “Household Energy Consumption Segmentation Using Hourly Data,” IEEE Transactions on Smart Grid, vol. 5, no. 1, pp. 420–430, Jan 2014. [11] N. R. Darghouth, G. Barbose, and R. Wiser, “The impact of rate design and net metering on the bill savings from distributed pv for residential customers in california,” Energy Policy, vol. 39, no. 9, pp. 5243 – 5253, 2011. [Online]. Available: http://www.sciencedirect.com/science/article/pii/S0301421511004265 [12] S. Borenstein, “Electricity Rate Structures and the Economics of Solar PV: Could Mandatory Time-of-Use Rates Undermine Californias Solar Photovoltaic Subsidies?” 2007. [13] Bright Power Inc., Energywiz Inc., and the Association of Energy Affordability, “Solar RealTime Pricing: Is Real-Time Pricing Beneficial to Solar PV in New York City?” New York City Economic Development Corporation, Tech. Rep., 2009. 21 [14] A. Mills, R. Wiser, G. Barbose, and W. Golove, “The impact of retail rate structures on the economics of commercial photovoltaic systems in California,” Energy Policy, vol. 36, no. 9, pp. 3266 – 3277, 2008. [Online]. Available: http: //www.sciencedirect.com/science/article/pii/S0301421508002309 [15] O. VanGeet, E. Brown, T. Blair, and A. McAllister, “Solar San Diego: The Impact of Binomial Rate Structures on Real PV Systems,” 2008. [16] D. Wu, M. Kintner-Meyer, T. Yang, and P. Balducci, “Economic analysis and optimal sizing for behind-the-meter battery storage,” in 2016 IEEE Power and Energy Society General Meeting (PESGM), July 2016, pp. 1–5. [17] S. B. Peterson, J. Whitacre, and J. Apt, “The economics of using plug-in hybrid electric vehicle battery packs for grid storage,” Journal of Power Sources, vol. 195, no. 8, pp. 2377 – 2384, 2010. [Online]. Available: http://www.sciencedirect.com/science/article/pii/S0378775309017303 [18] A. Nottrott, J. Kleissl, and B. Washom, “Storage dispatch optimization for grid-connected combined photovoltaic-battery storage systems,” in 2012 IEEE Power and Energy Society General Meeting, July 2012, pp. 1–7. [19] W.-F. Su, S.-J. Huang, and C.-E. Lin, “Economic analysis for demand-side hybrid photovoltaic and battery energy storage system,” IEEE Transactions on Industry Applications, vol. 37, no. 1, pp. 171–177, Jan 2001. [20] M. Stadler, H. Aki, R. Firestone, J. Lai, C. Marnay, and A. Siddiqui, “Distributed energy resources on-site optimization for commercial buildings with electric and thermal storage technologies,” Lawrence Berkeley National Laboratory, Tech. Rep., 2008. [21] M. Stadler, C. Marnay, A. Siddiqui, J. Lai, and H. Aki, “Integrated Building Energy Systems Design Considering Storage Technologies,” Lawrence Berkeley National Laboratory, Tech. Rep., 2009. [22] J. Neubauer and M. Simpson, “Deployment of behind-the-meter energy storage for demand charge reduction,” National Renewable Energy Lab.(NREL), Golden, CO (United States), Tech. Rep., 2015. [23] T. E. Hoff, R. Perez, and R. M. Margolis, “Maximizing the value of customer-sited pv systems using storage and controls,” Solar Energy, vol. 81, no. 7, pp. 940 – 945, 2007. [Online]. Available: http://www.sciencedirect.com/science/article/pii/S0038092X06002829 [24] Y. Riffonneau, S. Bacha, F. Barruel, and S. Ploix, “Optimal power flow management for grid connected pv systems with batteries,” IEEE Transactions on Sustainable Energy, vol. 2, no. 3, pp. 309–320, July 2011. [25] Energy Information Administration, “Electric Power Monthly,” Tech. Rep., Dec 2015. [26] ——, “Electric Power Monthly,” Tech. Rep., Dec 2016. [27] Deutsche Bank Markets Research, “Welcome to the Lithium-ion Age,” May 9 2016. 22 [28] B. Nykvist and M. Nilsson, “Rapidly falling costs of battery packs for electric vehicles,” Nature Clim. Change, vol. 5, no. 4, pp. 329–332, 04 2015. [29] P. Bronski, J. Creyts, M. Crowdis, S. Doig, J. Glassmire, L. Guccione, P. Lilienthal, J. Mandel, B. Rader, D. Seif et al., “The Economics of Load Defection: How Grid-Connected Solar-PlusBattery Systems Will Compete with Traditional Electric Service–Why it Matters, and Possible Paths Forward,” Rocky Mountain Institute, Tech. Rep., 2015. [30] H. Li, F. Li, Y. Xu, D. T. Rizy, and J. D. Kueck, “Adaptive voltage control with distributed energy resources: Algorithm, theoretical analysis, simulation, and field test verification,” IEEE Transactions on Power Systems, vol. 25, no. 3, pp. 1638–1647, Aug 2010. [31] Y. J. Kim, G. Del-Rosario-Calaf, and L. K. Norford, “Analysis and experimental implementation of grid frequency regulation using behind-the-meter batteries compensating for fast load demand variations,” IEEE Transactions on Power Systems, vol. 32, no. 1, pp. 484–498, Jan 2017. [32] R. Sevlian and R. Rajagopal, “Short Term Electricity Load Forecasting on Varying Levels of Aggregation ,” arXiv preprint arXiv:1404.0058, April 2014. [33] K. Ito, “Do consumers respond to marginal or average price? Evidence from nonlinear electricity pricing,” The American Economic Review, vol. 104, no. 2, pp. 537–563, 2014. [34] S. Borenstein, “To what electricity price do consumers respond? Residential demand elasticity under increasing-block pricing,” Preliminary Draft April 30, 2009. [35] J. A. McAllister, Solar adoption and energy consumption in the residential sector. of California, Berkeley, 2012. University [36] California Public Utilities Commission. (2015, Nov) Fact Sheet: Residential Rate Reform. [Online]. Available: http://www.cpuc.ca.gov/uploadedFiles/CPUC Public Website/Content/ Meetings and Events/ResidentialRateReformFactSheet.pdf [37] Pacific Gas and Electric Company. (2016) Electric Schedule E-TOU. [Online]. Available: https://www.pge.com/tariffs/tm2/pdf/ELEC SCHEDS E-TOU.pdf [38] GTM Squared, “GTM Squared Annual Survey Report 2016,” Tech. Rep., Feb. 2016. [39] D. Feldman, A. M. Brockway, E. Ulrich, and R. Margolis, “Shared Solar. Current Landscape, Market Potential, and the Impact of Federal Securities Regulation,” National Renewable Energy Lab.(NREL), Golden, CO (United States), Tech. Rep., 2015. [40] Solar Energy Industries Association. (2012) Solar Photovoltaic Technology - Presentation Transcript. [Online]. Available: http://www.seia.org/research-resources/ solar-photovoltaic-technology [41] National Oceanic and Atmospheric Administration and National Climatic Data Center, “U.S. Climate Reference Network Site Information Handbook,” Tech. Rep., Dec. 2010. [42] S. Wilcox, “National Solar Radiation Database 1991-2005 Update: User’s Manual,” National Renewable Energy Laboratory (NREL), Golden, CO., Tech. Rep., 2007. 23 [43] National Solar Radiation Data Base. Individual Site-Year Files. [Online]. Available: http://rredc.nrel.gov/solar/old data/nsrdb/1991-2010/hourly/list by state.html [44] ——. NSDRB Data Viewer. [Online]. Available: https://maps.nrel.gov/nsrdb-viewer/ 24
3cs.SY
Nonparametric Bayesian posterior contraction rates for scalar diffusions with high-frequency data Kweku Abraham arXiv:1802.05635v1 [math.ST] 15 Feb 2018 Abstract We consider inference in the scalar diffusion model dXt = b(Xt ) dt + σ(Xt ) dWt with discrete data (Xj∆n )0≤j≤n , n → ∞, ∆n → 0 and periodic coefficients. For σ given, we prove a general theorem detailing conditions under which Bayesian posteriors will contract in L2 –distance around the true drift function b0 at the frequentist minimax rate (up to logarithmic factors) over Besov smoothness classes. We exhibit natural nonparametric priors which satisfy our conditions. Our results show that the Bayesian method adapts both to an unknown sampling regime and to unknown smoothness. 1 Introduction Consider a scalar diffusion process (Xt )t≥0 starting at some X0 and evolving according to the stochastic differential equation dXt = b(Xt ) dt + σ(Xt ) dWt , where Wt is a standard Brownian motion. It is of considerable interest to estimate the parameters b and σ, which are arbitrary functions (until we place further assumptions on their form), so that the model is naturally nonparametric. As we will explain in Section 2, the problems of estimating σ and b can essentially be decoupled in the setting to be considered here, so in this paper we consider estimation of the drift function b when the diffusion coefficient σ is assumed to be given. It is realistic to assume that we do not observe the full trajectory (Xt )t≤T but rather the process sampled at discrete time intervals (Xk∆ )k≤n . The estimation problem for b and σ has been studied extensively and minimax rates have been attained in two sampling frameworks: low-frequency, where ∆ is fixed and asymptotics are taken as n → ∞ (see Gobet–Hoffmann– Reiss [15]), and high-frequency, where asymptotics are taken as n → ∞ and ∆ = ∆n → 0, typically assuming also that n∆2 → 0 and n∆ → ∞ (see Hoffmann [17], Comte et al. [8]). See also e.g. [9], [16], [20], [26] for more papers addressing nonparametric estimation for diffusions. For typical frequentist methods, one must know which sampling regime the data is drawn from. In particular, the low-frequency estimator from [15] is consistent in the high-frequency setting but numerical simulations suggest it does not attain the minimax rate (see the discussion in Chorowski [7]), while the high-frequency estimators of [17] and [8] are not even consistent with low-frequency data. The only previous result known to the author regarding adaptation to the sampling regime in the nonparametric setting is found in [7], where Chorowski is able to estimate the diffusion coefficient σ but not the drift, and obtains the minimax rate when σ has 1 derivative but not for smoother volatilities. For this paper we consider estimation of the parameters in a diffusion model from a nonparametric Bayesian perspective. Bayesian methods for diffusion estimation can be implemented in practice (see Papaspiliopoulos et al. [24]). For Bayesian estimation, the statistician need only specify a prior; for estimating diffusions from discrete samples the prior need not reference the 1 sampling regime, so Bayesian methodology provides a natural candidate for a unified approach to the high- and low-frequency settings. Our results imply that Bayesian methods can adapt both to the sampling regime and also to unknown smoothness of the drift function (see the remarks after Proposition 4 and Proposition 2 respectively for details). These results are proved under the frequentist assumption of a fixed true parameter, so this paper belongs to the field of frequentist analysis of Bayesian procedures. See, for example, Ghosal & van der Vaart [11] for an introduction to this field. It has previously been shown that in the low-frequency setting we have a posterior contraction rate, guaranteeing that posteriors corresponding to reasonable priors concentrate their mass on neighbourhoods of the true parameter shrinking at the fastest possible rate (up to log factors) – see Nickl & Söhl [23]. To complete a proof that such posteriors contract at a rate adapting to the sampling regime, it remains to prove a corresponding contraction rate in the high-frequency setting. This forms the key contribution of the current paper: we prove that a large class of “reasonable” priors will exhibit posterior contraction at the optimal rate (up to log factors) in L2 –distance. This in turn guarantees that point estimators based on the posterior will achieve the frequentist minimax optimal rate (see the remark after Theorem 1) in both high- and lowfrequency regimes. The broad structure of the proof is inspired by that in [23]: we use the testing approach of Ghosal–Ghosh–van der Vaart [10], coupled with the insight of Giné and Nickl [14] that one may prove the existence of the required tests by finding an estimator with good enough concentration around the true parameter. The main ingredients here are: • A concentration inequality for a (frequentist) estimator, from which we construct tests of the true b0 against a set of suitable (sufficiently separated) alternatives. See Section 4. • A small ball result, to relate the L2 –distance to the information-theoretic Kullback–Leibler “distance”. See Section 5. Though the structure reflects that of [23] the details are very different. Estimators for the lowfrequency setting are typically based on the mixing properties of (Xk∆ ) viewed as a Markov chain and the spectral structure of its transition matrix (see [15]) and fail to take full advantage of the local information one sees when ∆ → 0. Here we instead use an estimator introduced in Comte et al. [8] which uses the assumption ∆ → 0 to view estimation of b as a regression problem. To prove this estimator concentrates depends on a key insight of this paper: the Markov chain concentration results used in the low-frequency setting (which give worse bounds as ∆ → 0) must be supplemented by Hölder type continuity results, which crucially rely on the assumption ∆ → 0, and by martingale concentration results. Similarly, the small ball result in the low-frequency setting depends on Markov chain mixing. Here, we instead adapt the approach of van der Meulen & van Zanten [21]. They demonstrate that the Kullback–Leibler divergence in the discrete setting can be controlled by the corresponding divergence in the continuous data model; a key new result of the current paper is that this control can be extended to bound the variance of the log likelihood ratio. As described above, a key attraction of the Bayesian method is that it allows a unified approach to the low- and high-frequency regimes. Another attraction is that it naturally suggests uncertainty quantification via posterior credible sets. The contraction rate theorems proved in this paper and [23] are not by themselves enough to prove that credible sets behave as advertised. For that one may aim for a nonparametric Bernstein–von Mises result – see for example Castillo & Nickl [5, 6]. The posterior contraction rate proved here constitutes a key first step towards a proof of a Bernstein–von Mises result for the high-frequency sampled diffusion model, since it allows one to localise the posterior around the true parameter, as in the proofs in Nickl [22] for a non-linear inverse problem comparable to the problem here. 2 2 Framework and assumptions The notation introduced throughout the paper is gathered in Appendix B. We work with a scalar diffusion process (Xt )t≥0 starting at some X0 and evolving according to the stochastic differential equation dXt = b(Xt ) dt + σ(Xt ) dWt , (1) for Wt a standard Brownian motion. The parameters b and σ are assumed to be 1–periodic and we also assume the following. 1 ([0, 1]) is given. Continuity guarantees the existence of an upper bound Assumption 1. σ ∈ Cper σU < ∞ and we further assume the existence of a lower bound σL > 0 so that σL ≤ σ(x) ≤ σU 1 ([0, 1]) denotes C 1 ([0, 1]) functions with periodic boundary conditions for all x ∈ [0, 1]. Here Cper ′ (i.e. σ(0) = σ(1) and σ (0) = σ ′ (1)). Assumption 2. b is continuously differentiable with given norm bound. Precisely, we assume b ∈ Θ, where 1 = kf k∞ + kf ′ k∞ ≤ K0 } Θ = {f ∈ Cper ([0, 1]) : kf kCper 1 for some arbitrary, but given, constant K0 . Note in particular that K0 upper bounds kf k∞ and that f is Lipschitz continuous with constant at most K0 . Θ is the maximal set over which we prove contraction, and we will in general make the stronger assumption that in fact b ∈ Θs (A0 ) := {f ∈ Θ : kf kB s 2,∞ ≤ A0 < ∞}, s denotes a periodic Besov space and k·k denotes the associated norm: see Secwhere Bp,q s Bp,q tion 2.1 for a definition of the periodic Besov spaces we use (readers unfamiliar with Besov spaces s s ⊆ Bs may substitute the L2 –Sobolev space H s = B2,2 2,∞ for B2,∞ and only mildly weaken the results). We generally assume the regularity index s ≥ 1 unknown. Our results will therefore aim to be adaptive, at least in the smoothness index (to be fully adaptive we would need to adapt to K0 also). Under Assumptions 1 and 2, there is a unique strong solution to (1) (see, for example, Bass [2] Theorem 24.3). Moreover, this solution is also weakly unique (= unique in law) and satisfies (x) the Markov property (see [2] Proposition 25.2 and Theorem 39.2). We denote by Pb the law (on the cylindrical σ–algebra of C([0, ∞])) of the unique solution of (1) started from X0 = x. We consider “high-frequency data” (Xk∆n )nk=0 sampled from this solution, where asymptotics are taken as n → ∞, with ∆n → 0 and n∆n → ∞. We will suppress the subscript and simply write ∆ for ∆n . Throughout we will write X (n) = (X0 , . . . , Xn∆ ) as shorthand for our data and similarly we write x(n) = (x0 , . . . , xn∆ ). We will denote by I the set {K0 , σL , σU } so that, for example, C(I) will be a constant depending on these parameters. Beyond guaranteeing existence and uniqueness of a solution, our assumptions also guarantee the existence of an invariant distribution µb for the periodised process Ẋ = X mod 1. Defining x Z Ib (x) = 0 2b (y) dy, σ2 x ∈ [0, 1], the probability density of the invariant distribution is given by πb (x) = Hb = Z 0 eIb (x)  Ib (1) e Hb σ 2 (x) 1 eIb (x)  Ib (1) e σ 2 (x) Z Z 1 x 1 x e−Ib (y) dy + e−Ib (y) dy + 3 Z Z 0 x 0 x  e−Ib (y) dy ,  e−Ib (y) dy dx, x ∈ [0, 1], (see Bhattacharya et al. [3], equations 2.15 to 2.17). Note we have chosen a different normalisation so the expressions appear slightly different. Observe that πb is bounded uniformly away from zero and infinity, i.e. there exist constants 0 < πL , πU < ∞ depending only on I so that for any b ∈ Θ and any x ∈ [0, 1] we have πL ≤ πb (x) ≤ πU . Precisely, we see that −2 −2 σU−2 e−6K0 σL ≤ Hb ≤ σL−2 e6K0 σL , −2 and we deduce we can take πL = πU−1 = σL2 σU−2 e−12K0 σL . We assume that X0 follows this invariant distribution. Assumption 3. X0 ∼ µb . We will write Pb for the law of the full process X under Assumptions 1 to 3, and we will write Eb for expectation according to this law. Note µb is not invariant for Pb , but nevertheless Eb (f (Xt )) = Eb (f (X0 )) for any 1–periodic function f (see the proof of Theorem 6). Since we will be estimating the 1–periodic function b, the implicit assumption that X0 ∈ [0, 1) is unimportant. Finally, we need to assume that ∆ → 0 at a fast enough rate. Precisely we will use the following. Assumption 4. n∆2 log(1/∆) ≤ L0 for some (unknown) constant L0 . Since we already assume n∆ → ∞, this new assumption is equivalent to n∆2 log(n) ≤ L′0 for some constant L′0 . Throughout we will make the frequentist assumption that the data is generated according to some fixed true parameter denoted b0 . We will use µ0 as shorthand for µb0 , and similarly for π0 and so on. Where context allows, we will simply write µ for µb with a generic drift b. Remarks (Comments on assumptions). Assuming that σ is given: If we observe continuous data (Xt )t≤T then σ is known exactly (atR least at any point visited by the process) via the expression for the quadratic variation hXit = 0t σ 2 (Xs ) ds. With high-frequency data we cannot perfectly reconstruct the diffusion coefficient from the data, but we can estimate it at a much faster rate than the drift. When b and σ are both assumed unknown, if b is s-smooth and σ is s′ -smooth, ′ ′ the minimax errors for b and σ respectively scale as (n∆)−s/(1+2s) and n−s /(1+2s ) , as can be shown by adapting the proofs from [17] slightly so that they apply in the periodic setting we use here. Since we assume that n∆2 → 0, it follows that n∆ ≤ n1/2 for large n, hence we can estimate σ at a faster rate than b regardless of their relative smoothnesses. Further, note that the problems of estimating b and σ in the high-frequency setting are essentially independent. For example, the smoothness of σ does not affect the rate for estimating b, and vice-versa – see [17]. We are therefore not substantially simplifying the problem of estimating b through the assumption that σ is given. Assuming a known bound on kbkCper 1 : The assumption that b has one derivative is a typical minimal assumption to ensure that the diffusion equation (1) has a strong solution and that this 1 –norm of the solution has an invariant density. The assumption of a given bound for the Cper function is undesirable, but needed for the proofs, in particular ensuring a uniform lower bound πL on the invariant densities. This lower bound is essential for the Markov chain mixing results since its reciprocal controls the mixing time in Theorem 6. It is plausible that needing this assumption is inherent to the problem rather than an artefact of the proof: methods to bypass the Markov chain mixing arguments, such as the martingale approach of [8] Lemma 1, also rely on such a uniform lower bound, and moreover the lower bound πL scales unfavourably as e−K0 . These boundedness assumptions in principle exclude Gaussian priors, which are computationally attractive. In practice, one could choose a very large value for K0 and approximate Gaussian priors arbitrarily well using truncated Gaussian priors. 4 Assuming X0 ∼ µb : It can be shown (see the proof of Theorem 6) that the law of Ẋt converges to µb at exponential rate from any starting distribution, so assuming X0 ∼ µb is not restrictive. As mentioned, the implicit choice that X0 ∈ [0, 1), rather than in any other unit interval, is arbitrary, but unimportant since we estimate the 1–periodic function b. Assuming n∆2 log(1/∆) ≤ L0 : It is typical in the high-frequency setting to assume n∆2 → 0 (indeed the minimax rates in [17] are only proved under this assumption) but for technical reasons in the concentration section (Section 4.2) we need the above slightly strenghtened assumption. 2.1 Spaces of approximation We will throughout depend on a family {Sm : m ∈ N ∪ {0}} of function spaces. For our purposes we will take the Sm to be periodised Meyer-type wavelet spaces Sm = span({ψlk : 0 ≤ k < 2l , 0 ≤ l ≤ m} ∪ {1}). We will denote ψ−1,0 = 1 for convenience. Denote by h·, ·i the L2 ([0, 1]) inner product and by k·k2 the L2 –norm, i.e. hf, gi = Z 1 f (x)g(x) dx, 0 One definition of the Besov norm kf kB s 2,∞ kf kB s 2,∞ kf k2 = hf, f i1/2 , f, g ∈ L2 ([0, 1]). is, for flk := hf, ψlk i the wavelet coefficients, ls = |f−1,0 | + sup 2 l≥0 l −1 2X 2 flk k=0 1/2 , (2) s defined as those f ∈ Cper ([0, 1]) for which this norm is finite. See Giné & Nickl [13] with B2,∞ Sections 4.2.3 and 4.3.4 for a construction of periodised Meyer-type wavelets and a proof that this wavelet norm characterisation agrees with other possible definitions of the desired Besov space. P 2 . It therefore immediNote that orthonormality of the wavelet basis means kf k22 = lk flk s ately follows from this definition of the Besov norm that for any b ∈ B2,∞ ([0, 1]) we have kπm b − bk2 ≤ KkbkB s 2−ms , 2,∞ (3) for some constant K = K(s), where πm is L2 –orthogonal projection onto Sm . Remarks. Uniform sup-norm convergence of wavelet series: The wavelet projections πm b converge to b in supremum norm for any b ∈ Θ, that is kπm b − bk∞ → 0 as m → ∞. Moreover, the convergence is actually uniform in b ∈ Θ, i.e. supkπm b − bk∞ → 0 as m → ∞. (4) b∈Θ for This follows by applying Proposition 4.3.24 in [13] because K0 uniformly bounds kbkCper 1 b ∈ Θ. s are s regular Boundary regularity: Functions in the periodic Besov space here denoted B2,∞ at the boundary, in the sense that the weak derivatives of order s are 1–periodic. Alternative approximation spaces: The key properties we need for our approximation spaces are (3) and (4). Of these, only the first is needed when using our spaces Sm to specify priors (see Section 3.1). A corresponding inequality holds for many other function spaces if we replace 2m by Dm = dim(Sm ); for example, for Sm the set of trigonometric polynomials of degree at most m, or (provided s ≤ smax for some given smax ∈ R) for Sm generated by periodised Daubechies wavelets. Priors built using these other spaces will achieve the same posterior contraction rate. 5 3 Main contraction theorem Let Π be a (prior) probability distribution on some σ−algebra S of subsets of Θ. Given b ∼ Π assume that (Xt : t ≥ 0) follows the law Pb as described in Section 2. Write pb (∆, x, y) for the transition densities pb (∆, x, y) dy = Pb (X∆ ∈ dy | X0 = x), and recall we use p0 as shorthand for pb0 . Assume that the mapping b 7→ pb (∆, x, y) is S − BR measurable for all x, y, where BR is the Borel σ-algebra on R. Then by standard arguments, for example as in Chapter 7.3 of [13], it can be shown that the Bayesian posterior distribution given the data is b|X (n) (n) πb (X0 ) ni=1 pb (∆, X(i−1)∆ , Xi∆ ) dΠ(b) p (X (n) ) dΠ(b) Qn ≡ R b (n) ∼R , (n) ) dΠ(b) (X p Θ πb (X0 ) i=1 pb (∆, X(i−1)∆ , Xi∆ ) dΠ(b) Θ b Q (n) where we introduce the shorthand pb (x(n) ) = πb (x0 ) ni=1 pb (∆, x(i−1)∆ , xi∆ ) for the joint probability density of the data (X0 , . . . , Xn∆ ). A main result of this paper is the following. Theorem 1A is designed to apply to adaptive sieve priors, while Theorem 1B is designed for use when the smoothness of the parameter b is known. See Section 3.1 for explicit examples of the results in use. Q Theorem 1. Consider data X (n) = (Xk∆ )0≤k≤n sampled from a solution X to (1) under Assumptions 1 to 4. Let the true parameter be b0 , so that Pb0 is the law of the full path of X. A. Let Π be a sieve prior on Θ, i.e. let Π = ∞ m=1 h(m)Πm , where Πm (Sm ∩ Θ) = 1, for Sm a periodic Meyer-type wavelet space of resolution m as described in Section 2.1. Suppose we have, for all ε > 0 and m ∈ N, and for some constants ζ, β1 , β2 , B1 , B2 > 0, P (i) B1 e−β1 Dm ≤ h(m) ≤ B2 e−β2 Dm , (ii) Πm ({b ∈ Sm : kb − πm b0 k2 ≤ ε}) ≥ (εζ)Dm , where πm is L2 –orthogonal projection onto Sm and Dm = dim(Sm ) = 2m + 1. Then for any b0 ∈ Θs (A0 ) we have, for some constant M = M (A0 , s, I, L0 , β1 , β2 , B1 , B2 , ζ),   Π {b ∈ Θ : kb − b0 k22 ≤ M (n∆)−2s/(1+2s) log(n∆)} | X (n) → 1 in probability under Pb0 . B. Suppose now b0 ∈ Θs (A0 ) where s ≥ 1 and A0 > 0 are both known. Let jn ∈ N be such that Djn ∼ (n∆)1/(1+2s) , i.e. for some positive constants L1 , L2 we have L1 (n∆)1/(1+2s) ≤ Djn ≤ L2 (n∆)1/(1+2s) for all n. Let Π(n) be a sequence of priors satisfying, for εn = (n∆)−s/(1+2s) log(n∆)1/2 , and for some constant ζ > 0, (I) Π(n) (Θs (A0 ) ∩ Θ) = 1 for all n, (II) Π(n) ({b ∈ Θ : kπjn b − πjn b0 k2 ≤ εn }) ≥ (εn ζ)Djn . Then we achieve the same rate of contraction; i.e. for some M = M (A0 , s, I, L0 , ζ)   Π(n) {b ∈ Θ : kb − b0 k22 ≤ M (n∆)−2s/(1+2s) log(n∆)} | X (n) → 1 in probability under Pb0 . 6 Remark. Optimality: The minimax lower bounds of [17] do not strictly apply because we have assumed σ is given. Nevertheless, the minimax rate in this model should be (n∆)−s/(1+2s) . This follows by adapting arguments for the continuous data case from Kutoyants [18] Section 4.5 to apply to the periodic model and observing that with high-frequency data we cannot outperform continuous data. Since a contraction rate of εn guarantees the existence of an estimator converging to the true parameter at rate εn (for example, the centre of the smallest posterior ball of mass at least 1/2 – see Theorem 8.7 in Ghosal & van der Vaart [11]) the rates attained in Theorem 1 are optimal, up to log factors. The proof is given in Section 6. 3.1 Explicit examples of priors Our results guarantee that the following priors will exhibit posterior contraction. The proofs can be found in Section 6.1. For technical convenience, we will employ a slightly stronger assumption on b0 than simply lying in Θ. Precisely, recalling that {ψlk } form a family of Meyer-type wavelets as in Section 2.1 and ψ−1,0 denotes the constant function 1, we assume the following. Assumption 5. For a constant B we assume b0 = X where |βlk | ≤ B for all l ≥ −1 and all 0 ≤ k < 2l , τl βlk ψlk , l≥−1 0≤k<2l (5) for some sequence τl to be specified. The explicit priors for which we prove contraction will be random wavelet series priors. Let iid ulk ∼ q, where q is a density on R satisfying q(x) ≥ ζ for |x| ≤ B, q(x) = 0 for |x| > B + 1, where ζ > 0 is a constant and B > 0 is the constant from Assumption 5. For example one might choose q to be the density of a Unif[0, B] random variable or a truncated Gaussian density. We define a prior Πm on Sm as the law associated to a random wavelet series X b(x) = τl ulk ψlk (x), −1≤l≤m 0≤k<2l x ∈ [0, 1], for τl as in Assumption 5. We give three examples of priors built from the Πm . Example 1 (Basic sieve prior). Let τl = ( 1 2−3l/2 l−2 l = −1, 0 l ≥ 1. m Let h be a probability distribution on N as described in Theorem 1A, for example, h(m) = γe−2 , P where γ is a normalising constant. Let Π = ∞ m=1 h(m)Πm where Πm is as above. Proposition 2. The preceding prior meets the conditions of Theorem 1A for any b0 satisfying Assumption 5 with the same τl used to define the prior, and for an appropriate constant K0 . Thus, if also b0 ∈ Θs (A0 ) for some constant A0 , then for some constant M ,   Π {b ∈ Θ : kb − b0 k2 ≤ M (n∆)−s/(1+2s) log(n∆)1/2 } | X (n) → 1 in Pb0 -probability. 7 Remark. Adaptive estimation: If we assume b0 ∈ Θsmin (A0 ), for some smin > 3/2 Assumption 5 automatically holds for some constant B = B(smin , A0 ). Thus, in contrast to the low-frequency results of [23], the above prior adapts to unknown s in the range smin ≤ s < ∞. When s ≥ 1 is known, we can fix the rate of decay of wavelet coefficients to ensure a draw from the prior lies in Θs (K0 ) by hand, rather than relying on the hyperparameter to choose the right resolution of wavelet space. We demonstrate this with the following example. Example 2 (Known smoothness prior). Let τ−1 = τ0 = 1 and τl = 2−l(s+1/2) l−2 for l ≥ 1. Let L̄n ∈ N ∪ {∞}. Define a sequence of priors Π(n) = ΠL̄n for b (we can take L̄n = ∞ to have a genuine prior, but a sequence of priors will also work provided L̄n → ∞ at a fast enough rate). Proposition 3. Assume L̄n /(n∆)1/(1+2s) is bounded away from zero. The preceding sequence of priors meets the conditions of Theorem 1B for any b0 satisfying Assumption 5 with the same τl used to define the prior, and for an appropriate constant K0 . Thus, if also b0 ∈ Θs (A0 ) for some constant A0 , then for some constant M ,   Π(n) {b ∈ Θ : kb − b0 k2 ≤ M (n∆)−s/(1+2s) log(n∆)1/2 } | X (n) → 1 in Pb0 -probability. Remark. Assumption 5 with τl = 2−l(s+1/2) l−2 is only mildly stronger than the assumption that b0 ∈ Θs (A0 ) because we have the wavelet characterisation (2) of Θs (A0 ). The same minimax lower bounds for Θs (A0 ) should hold for the slightly smaller class of functions satisfying Assumption 5, except for a possible log factor induced by the weighting factor l2 in τl . Example 3 (Prior on the invariant density). In some applications it may be more natural to place a prior on the invariant density and only implicitly on the drift function. With minor adjustments, Theorem 1 can still be applied to such priors. We outline the necessary adjustments. • b is not identifiable from πb and σ 2 . We therefore introduce the identifiability constraint Ib (1) = 0. We could fix Ib (1) as any positive constant and reduce to the case Ib (1) = 0 by a translation, so we choose Ib (1) = 0 for simplicity (this assumption is standard in the periodic model, for example see van Waaij & van Zanten [30]). With this restriction, we I (x) have πb (x) = Ge σb2 (x) for a normalising constant Gb , so that b = ((σ 2 )′ + σ 2 log(πb )′ )/2. b • In place of Assumption 5, we need a similar assumption but for H0 := log πb0 . Precisely, we assume H0 = X l≥−1 0≤k<2l τl hlk ψlk , where |hlk | ≤ B for all − 1 ≤ l, 0 ≤ k < 2l , (6) for τ−1 = τ0 = 1 and τl = 2−l(s+3/2) l−2 for l ≥ 1, where s ≥ 1 is assumed known. • Put the prior Π(n) = ΠL̄n on H, where L̄n is as in Proposition 3. • Since b = ((σ 2 )′ + σ 2 H ′ )/2, in order to ensure b ∈ Θs (A0 ) we assume σ 2 ∈ Θs+1 (A′0 ) for ≤ K0′ for some K0′ . These last two some A′0 . To ensure b ∈ Θ, we assume k(σ 2 )′ kCper 1 conditions can be bypassed with a more careful statement of the theorem and treatment of the bias. Proposition 4. Make the changes listed above. Then   Π(n) {b ∈ Θ : kb − b0 k2 > M (n∆)−s/(1+2s) log(n∆)1/2 } | X (n) → 0 in Pb0 -probability. 8 Remarks. Adaptation to sampling regime: We have essentially shown that the Bayesian posterior adapts to an unknown sampling regime. Strictly, one must show that the above priors also contract in the low-frequency setting, since the model assumptions here differ from those in [23]. However, one can apply standard contraction rates for Markov chains from [12] and use results of [23] to translate from contraction for the invariant density to contraction for b, with minor technical changes also needed because here we use a periodic diffusion while in [23] they use a reflected diffusion. Note that when σ is given in the low-frequency setting the minimax rate for estimating b is n−s/(2s+3) (for example see [29]), which is faster than the n−s/(2s+5) rate attained in [15] when σ is unknown. This improvement is possible because one bypasses the delicate interweaving of the problems of estimating b and σ. It remains an interesting open problem to simultaneously estimate b and σ with a method which adapts to the sampling regime. Adapting the proofs of this paper to the case where σ is unknown would show that the Bayesian method fulfils this goal. The key difficulty in making these adaptations arises in the small ball section (Section 5), because Girsanov’s Theorem does not apply to diffusions Y and Z with different diffusion coefficients. Intermediate sampling regime: Strictly speaking, we only demonstrate robustnestness to the sampling regime in the extreme cases where ∆ > 0 is fixed or where n∆2 → 0. The author is not aware of any papers addressing the intermediate regime, where ∆ → 0 at a slower rate than n−1/2 : the minimax rates are not even known. The Bayesian method should attain the correct rates in this intermediate regime (up to log factors), so it remains to find explicitly the rates attained by the posterior and to prove corresponding lower bounds. To find the rates attained by the posterior one could “interpolate” between the low-frequency Markov chain concentration inequalities of Theorem 6 and the high-frequency martingale and Hölder continuity based inequalities of Lemmas 8 and 13. 4 Construction of tests In this section we construct the tests needed to apply the general contraction rate theory from [10]. The main result of this section is the following. Recall that Sm is a periodic Meyer-type wavelet space of resolution m as described in Section 2.1, πn is L2 –orthogonal projection onto Sm and Dm = dim(Sm ) = 2m + 1. Lemma 5. Let X (n) = (Xk∆ )0≤k≤n be sampled from a diffusion X satisfying (1) and grant Assumptions 1 to 4. Let Θn ⊆ {b ∈ Θ : kπln b − bk2 ≤ εn }. Suppose b0 ∈ Θn . Assume Dln ≤ Ln∆ε2n for a sequence εn → 0 satisfying n∆ε2n / log(n∆) → ∞ and a constant L > 0. Then for any D > 0, there is an M = M (I, L0 , D, L) > 0 for which there exist tests ψn ({0, 1}–valued functions of the data) such that, for all n sufficiently large,  max Eb0 ψn (X (n) ), sup Eb [1 − ψn (X (n) )] : b ∈ Θn , kb − b0 k2 > M εn   2 ≤ e−Dn∆εn . The proof is given in Section 4.2 and is a straightforward consequence of our constructing an estimator with appropriate concentration properties. First, we introduce some general concentration results we will need. 4.1 General concentration results We will use three forms of concentration results as building blocks for our theorems. The first comes from viewing the data (Xj∆ )0≤j≤n as a Markov chain and applying Markov chain concentration results; these results are similar to those used in [23] for the low-frequency case, but here we need to track the dependence of constants on ∆. The second form apply only in the high-frequency case because they use a quantitative form of Hölder continuity for diffusion 9 processes. An inequality of the third form, based on martingale properties, is introduced only where needed (in Lemma 13). 4.1.1 Markov chain concentration results applied to diffusions Our main concentration result arising from the Markov structure is the following. Theorem 6. There exists a constant κ depending only on I such that, for all n sufficiently large and all bounded, 1–periodic functions f : R → R, Pb n X k=1 f (Xk∆ ) − Eµ [f ] ≥ t ! t2 t 2 , kf k nkf kµ ∞ 1 ≤ 2 exp − ∆ min κ !! , (7) or equivalently  Pb  n X j=1  √ f (Xj∆ ) − Eµ [f ] ≥ max( κv 2 x, κux) ≤ 2e−x , (8) where v 2 = n∆−1 kf k2µ and u = ∆−1 kf k∞ . Further, if F is a space of such functions indexed by some (subset of a) d–dimensional vector space, then for V 2 = supf ∈F v 2 and U = supf ∈F u, we also have  Pb  sup n X f ∈F j=1 f (Xj∆ ) − Eµ [f ] ≥ κ̃ max q   V 2 (d + x), U (d + x)  ≤ 4e−x . for some constant κ̃ = κ̃(I). (9) The proof is an application of the following abstract result for Markov chains. Theorem 7 (Paulin [25], Proposition 3.4 and Theorem 3.4). Let M1 , . . . , Mn be a time-homogeneous Markov chain taking values in S with transition kernel P (x, dy) and invariant density π. Suppose M is uniformly ergodic, i.e. supx∈S kP n (x, ·) − πkT V ≤ Kρn for some constants K < ∞, ρ < 1, where P n (x, ·) is the n−step transition kernel and k·kT V is the total variation norm for signed measures. Write tmix = min{n ≥ 0 : kP n (x, ·) − πkT V < 1/4}. Suppose M1 ∼ π and f : S → R is bounded. Let Vf = Var[f (M1 )], let C = kf − E[f (M1 )]k∞ . Then ! ! n X −t2 . P | f (Mi ) − E[f (M1 )]| ≥ t ≤ 2 exp 2tmix (8(n + 2tmix )Vf + 20tC) i=1 Proof of Theorem 6. First note that since f is assumed periodic we see f (Xk∆ ) = f (Ẋk∆ ) where Ẋ = X mod 1 is X viewed as a diffusion on the circle. Denote by ṗb (t, x, y) the transition densities of Ẋ, i.e. X ṗb (t, x, y) = pb (t, x, y + j). j∈Z Lemma 2.6 in [3] tells us that if Ẋ0 has a density η0 on [0, 1], then Ẋt has a density ηt satisfying  1  1 t , kηt − πb kT V ≤ kη0 /πb − 1kT V exp − 2 2Mb where Mb := sup n 2 −1 (σ (z)πb (z)) z∈[0,1] 10 Z 0 z πb (x) dx Z 1 z o πb (y) dy . We can regularise to extend the result so that it also applies when the initial distribution of Ẋ is a point mass: if Ẋ0 = x then Ẋ1 has density ṗb (1, x, ·), hence the result applies to show 1 1 (t − 1)). kṗb (t, x, ·) − πb kT V ≤ kṗb (1, x, ·)/πb − 1kT V exp(− 2 2Mb Moreover, note kṗb (1, x, ·)/πb − 1kT V ≤ πL−1 kṗb (1, x, ·) − πb kT V ≤ πL−1 . Also note we can upper bound Mb by a constant M = M (I): precisely, we can take M = σL−2 πL−1 πU2 . Thus, we see that for t ≥ 1, we have 1 t) 2M for some constant K = K(I). It follows that, for each fixed ∆, the discrete time Markov chain (Ẋk∆ )k≥0 is uniformly ergodic and has mixing time tmix ≤ 1 + 2M log(4K)∆−1 ≤ K ′ ∆−1 for some constant K ′ . Theorem 7 now applies to tell us kṗb (t, x, ·) − πb kT V ≤ K exp(− P n X | i=1 f (Mi ) − E[f (M1 )]| ≥ t ! ! t2 ≤ 2 exp − . 2K ′ ∆−1 (8(n + 2K ′ ∆−1 )Vf + 20tC) Since n∆ → ∞ by assumption, we see 8(n + 2K ′ ∆−1 ) ≤ K ′′ n for some constant K ′′ . Using the bound 2/(a + b) ≥ min(1/a, 1/b) for a, b > 0 and upper bounding the centred moments Vf and C by the uncentred moments kf k2µ and kf k∞ , we deduce (7). The result (8) is obtained by a change of variables. For the supremum result (9), we use a standard chaining argument, e.g. as in Baraud [1] Theorem 2.1, where we use (8) in place of Baraud’s assumption 2.1, noting that Baraud only uses assumption 2.1 to prove an expression mirroring (8), and the rest of the proof follows through exactly. Precisely, following the proof, we can take κ̃ = 36κ. Remark. The proof simplifies if we restrict Θ to only those b satisfying Ib (1) = 0. In this case, the invariant density (upon changing normalising constant to some Gb ) reduces to the more familiar form πb (x) = (Gb σ 2 (x))−1 eIb (x) . The diffusion is reversible in this case, and we can use Theorem 3.3 from [25] instead of Theorem 3.4 to attain the same results but with better constants. 4.1.2 Hölder continuity properties of diffusions Diffusions can be realised as rescaled, time-shifted Brownian motions. Realising diffusions in this way allows us to see that they inherit a form of Hölder continuity from Brownian motion. Note that this Hölder continuity will only tell us about changes in X over sufficiently small time steps, hence can only be applied to the high-frequency regime, in contrast to Theorem 6 which also applies in the low-frequency setting. Writing wm (δ) = δ1/2 ((log δ−1 )1/2 + log(m)1/2 ), δ ∈ (0, 1] for m ≥ 1, and defining wm (δ) := w1 (δ) for m < 1, the key result of this section is the following. Lemma 8. Let X solve the scalar diffusion equation (1), and grant Assumptions 1 and 2. There is a constant λ = λ(I) > 0 so that for sufficiently large u, and for any initial value x  (x)   Pb  sup s,t∈[0,m], t6=s,|t−s|≤τ  |Xt − Xs | wm (|t − s|)   2 −λu , > u  ≤ 2e  where τ = τ (I) ≤ 1 is a constant. As in the remark after the proof of Lemma 9, u is “sufficiently large” if it is bigger than C max(log(m), 1) for some constant C = C(I). 11 Remarks. i. We will need to control all increments X(j+1)∆ − Xj∆ simultaneously, hence we include the parameter m, which we will take to be the time horizon n∆ when applying this result. Simply controlling over [0, 1] and using a union bound does not give sharp enough results. ii. The lemma applies for any distribution of X0 , not only point masses, by an application of the tower law. The proof strategy is to build from the corresponding result for a Brownian motion via time changes and rescaling. Brownian motion is well known to have modulus of continuity δ1/2 (log δ−1 )1/2 in that there exists a C > 0 such that, almost surely, |Bt − Bs | ≤ C|t − s|1/2 (log(|t − s|−1 ))1/2 , for t, s ∈ [0, 1] sufficiently close. We need a quantitative version of this statement which is supplied by the following result, proved in the appendix using Gaussian process techniques. Lemma 9. Let B be a standard Brownian motion on [0, m]. There is a (universal) constant λ > 0 so that for sufficiently large u,   Pr   sup s,t∈[0,m], s6=t,|s−t|≤e−2  |Bt − Bs | wm (|t − s|)   2 −λu . > u  ≤ 2e  By a time change we are able to deduce the following. Lemma 10. Let Y be a local martingale with quadratic variation satisfying | hY it − hY is | ≤ A|t − s| for a constant A ≥ 1. Then there is a constant λ > 0 depending only on A so that for sufficiently large u,    Pr   sup s,t∈[0,m],s6=t, |s−t|≤A−1 e−2  |Yt − Ys | wm (|t − s|)  2 −λu . > u  ≤ 2e  In particular the result applies when Y is a solution to dYt = σ̃(Yt ) dWt , provided kσ̃ 2 k∞ ≤ A. As in the remark after the proof of Lemma 9, u is “sufficiently large” if it is bigger than C max(log(m), 1) for some constant C = C(A). Proof. By the (Dambis–)Dubins-Schwarz Theorem (Rogers & Williams [28], (34.1)), we can write Yt = Y0 + Bηt for B a standard Brownian motion and for ηt = hY it the quadratic variation of Y . Define the event   C = sup |Bt′ − Bs′ | : s′ , t′ ∈ [0, Am], |s′ − t′ | ≤ e−2 , s′ 6= t′ wAm (|t′ − s′ |)   ≤u , 2 and note that, for u sufficiently large, C occurs with probability at least 1−2e−λu for a universal constant λ, by Lemma 9. On this event we see that for s, t ∈ [0, m] with |s − t| ≤ e−2 A−1 , s 6= t, we have 12 |Yt − Ys | = |Bηt − Bηs | ≤ sup{|Bt′ − Bs′ | : t′ , s′ ∈ [0, Am], |t′ − s′ | ≤ A|t − s|} ≤ u sup{wAm (|t′ − s′ |) : t′ , s′ ∈ [0, Am], |t′ − s′ | ≤ A|t − s|} ≤ wAm (A|t − s|)u, where we have used that wAm (δ) is increasing in the range δ ≤ e−2 to attain the final inequality. It is easy to see (recalling we assumed A ≥ 1) that wAm (Aδ) ≤ A1/2 wAm (δ) provided δ ≤ A−1 , which holds in the relevant range. Thus, on C, and for s, t in the considered range,  |Yt − Ys | ≤ A1/2 u|s − t|1/2 (log(Am))1/2 + (log|s − t|−1/2 )1/2   ≤ A′ u|s − t|1/2 (log(m))1/2 + (log|s − t|−1 )1/2 ,  where A′ is a constant depending on A (note we have absorbed a term depending on log(A) into the constant, using that log(|s − t|−1 ) ≥ 2). The desired result follows upon relabelling A′ u 7→ u since we here allow λ to depend on A. R For the particular case dYt = σ̃(Yt ) dWt , we simply observe that | hY it − hY is | = | st σ̃ 2 (Ys ) ds| ≤ kσ̃ 2 k∞ |t − s|. Proof of Lemma 8. Set Yt = S(Xt ), where S(x) = Z x 0  exp − Z 0 y  2b (z) dz dy 2 σ is the scale function, and let ψ be the inverse of S. Since S ′′ exists and is continuous, Itô’s formula applies to yield dYt = σ̃(Yt ) dWt , σ̃(y) := S ′ (ψ(y))σ(ψ(y)). Let A = A(I) = max(σU2 exp(4K0 /σL2 ), 1) and observe that kσ̃ 2 k∞ ≤ A. Thus, the event |Yt − Ys | : s, t ∈ [0, m], |s − t| ≤ e−2 A−1 , s 6= t ≤ u , D = sup wm (|t − s|)     2 occurs with probability at least 1−2e−λu for a constant λ = λ(I) by Lemma 10. Now Xt = ψ(Yt ) and ψ is Lipschitz with constant kψ ′ k∞ = k1/(S ′ ◦ ψ)k∞ ≤ exp(2K0 σL−2 ). It follows that on D we have, for any s, t ∈ [0, τ ], s 6= t, |Xt − Xs | ≤ exp(2K0 σL−2 )|Yt − Ys | ≤ exp(2K0 σL−2 )wm (|t − s|)u The result follows upon relabelling (exp(2K0 /σL2 )u) 7→ u and absorbing the constant multiplier into λ. 13 4.2 Concentration of a drift estimator 4.2.1 Defining the estimator We will adapt an estimator introduced in [8]. The estimator is constructed by considering drift estimation as a regression-type problem. Specifically, defining Zk∆ 1 = ∆ Z (k+1)∆ σ(Xs ) dWs , k∆ Rk∆ 1 = ∆ Z (k+1)∆ (b(Xs ) − b(Xk∆ )) ds, k∆ we can write X(k+1)∆ − Xk∆ = b(Xk∆ ) + Zk∆ + Rk∆ . ∆ Note Rk∆ is a discretization error which vanishes as ∆ → 0 and Zk∆ takes on the role of noise. We define the empirical norm and the related empirical loss function kukn = n 1X u(Xk∆ )2 , n k=1 γn (u) = n 1X [∆−1 (X(k+1)∆ − Xk∆ ) − u(Xk∆ )]2 , n k=1 u : [0, 1] → R. In both we leave out the k = 0 term for notational convenience. Recalling that Sm is a Meyer-type wavelet space as described in Section 2.1 and K0 is an 1 –norm of any b ∈ Θ, we define b̃ as a solution to the minimisation upper bound for the Cper n problem S̃m := {u ∈ Sm : kuk∞ ≤ K0 + 1}, b̃n ∈ argmin γn (u), u∈S̃ln where ln is to be chosen, and we choose arbitrarily among minimisers if there is no unique minimiser.1 4.2.2 Main concentration result For the estimator defined above we will prove the following concentration inequality. Theorem 11. Let (Xk∆ )0≤k≤n be sampled from a diffusion X satisfying (1) and grant Assumptions 1 to 4. Let Θn ⊆ {b ∈ Θ : kπln b − bk2 ≤ εn }, where πln is L2 −orthogonal projection onto Sln . Let b̃n be defined as above. Assume Dln = dim(Sln ) ≤ Ln∆ε2n for a sequence εn → 0 satisfying n∆ε2n / log(n∆) → ∞. Then for any D > 0 there is a C = C(I, L0 , D, L) > 0 such that, uniformly across b ∈ Θn ,   2 Pb kb̃n − bk2 > Cεn ≤ e−Dn∆εn , for all n sufficiently large. Remark. Previous proofs of Bayesian contraction rates using the concentration of estimators approach (see [14],[23],[27]) have used duality arguments, i.e. the fact that kf k2 = supv:kvk2 =1 hf, vi, to demonstrate that the linear estimators considered satisfy a concentration inequality of the desired form. A key insight of this paper is that for the model we consider we can achieve the required concentration using the above non-linear minimum contrast estimator (see Birgé & Massart [4]), for which we need techniques which differ substantially from duality arguments. Before proceeding to the proof, we demonstrate how this can be used to prove the existence of tests of b0 against suitably separated alternatives. 1 It is typical that we do not have uniqueness, since if u is a minimiser of γn , then so is any ũ ∈ S̃ln such that ũ(Xk∆ ) = u(Xk∆ ) for 1 ≤ k ≤ n. 14 Proof of Lemma 5. Let b̃n be the estimator outlined above and let D > 0. Let C = C(I, L0 , D, L) be a constant such that, uniformly across b ∈ Θn , we have   2 Pb kb̃n − bk2 > Cεn ≤ e−Dn∆εn . Define a test ψn = ( 0 1 if kb̃n − b0 k2 ≤ Cεn otherwise 2 We see immediately that Eb0 ψn (X (n) ) = Pb0 (kb̃n − b0 k2 > Cεn ) ≤ e−Dn∆εn . For M = 2C we further have sup b∈Θn kb−b0 k2 >M εn Eb [1 − ψn (X (n) )] = sup b∈Θn kb−b0 k2 >M εn Pb (kb̃n − b0 k ≤ Cεn ) ≤ sup Pb (kb̃n − bk2 > (M − C)εn ) b∈Θn 2 ≤ e−Dn∆εn . Proof of Theorem 11. It is enough to show that, uniformly across b ∈ Θn , for any D > 0 there is a C > 0 such   2 Pb kb̃n − bk2 > Cεn ≤ 12e−Dn∆εn , because by initially considering a D ′ > D and finding the corresponding C ′ , we can eliminate the factor of 12 in front of the exponential (indeed, it is enough to prove with any constant multiplier in front of the exponential, and the multiplier 12 will be convenient). The structure of the proof is as follows. The uniform upper bound on kbk∞ and the bounds on σ mean that the L2 – and L2 (µ)–norms are equivalent. We further show that the L2 (µ)–norm is equivalent to the empirical norm k·kn on an event of sufficiently high probability. Finally, the definition of the estimator will allow us to control the empirical distance kb̃n − bkn . To this end, write t̃n = (b̃n − πln b)kb̃n − πln bk−1 µ (defining t̃n = 0 if b̃n = πln b) and introduce the following set and events: n o In = t ∈ Sln : ktkµ = 1, ktk∞ ≤ C1 ε−1 , n  An = t̃n ∈ In ∪ {t̃n = 0},   1 2 Ωn = ktkn − 1 ≤ , ∀t ∈ I , 2 where the constant C1 is to be chosen. Then we can decompose Pb kb̃n − bk2 > Cεn ≤ Pb kb̃n − bk2 1Acn > Cεn + Pb Ωcn + Pb ( kb̃n − bk2 1An ∩Ωn > Cεn .    Thus, we will have proved the theorem once we have completed the following:  1. Show the theorem holds (deterministically) on Acn , for a large enough constant C. 2 2. Show that Pb (Ωcn ) ≤ 4e−Dn∆εn for a suitable choice of C1 . 3. Show that, for any D, we can choose a C such that Pb kb̃n − bk2 1An ∩Ωn > Cεn ≤ 2 8e−Dn∆εn .  15 Step 1: Intuitively we reason as follows. The event Acn can only occur if the L2 (µ)–norm of b̃ − πln b is small compared to the L∞ –norm. Since we have assumed a uniform supremum bound on functions b ∈ Θ, in fact An holds unless the L2 (µ)–norm is small in absolute terms. But if kb̃ − πln bkµ is small, then so is kb̃ − bk2 . We formalise this reasoning now. Define A′n = {kb̃n − πln bkµ > C2 εn }, where C2 is to be chosen. On A′n we have kt̃n k∞ ≤ (kb̃n k∞ + kπln bk∞ )C2−1 ε−1 n . Note kb̃n k∞ ≤ K0 + 1 by definition. Since, for n large enough, kπln b − bk∞ ≤ 1 uniformly across b ∈ Θn ⊆ Θ by (4) so that kπln bk∞ ≤ kbk∞ + 1 ≤ K0 + 1, we deduce that on A′n , kt̃n k∞ ≤ (2K0 + 2)C2−1 ε−1 n . ′ Since also kt̃n kµ = 1 (or t̃n = 0) by construction, we deduce that An ⊆ An provided C2 ≥ C1−1 (2K0 + 2). Thus, Acn is contained in the event (A′n )c , on which we find, using that b ∈ Θn and using −1/2 k·k2 ≤ πL k·kµ , −1/2 kb̃n − bk2 ≤ kb̃n − πln bk2 + kπln b − bk2 ≤ (C2 πL + 1)εn . −1/2 So on Acn , we have kb̃n − bk2 ≤ Cεn deterministically for any C ≥ C2 πL Pb kb̃n − bk2 1Acn > Cεn = 0 for C large enough (depending on C1 and I). + 1. That is, Step 2: We show that for n sufficiently large, and C1 = C1 (I, D, L) sufficiently small, Pb (Ωcn ) ≤ 2 4e−Dn∆εn . P For t ∈ In we have ktk2n − 1 = n−1 nk=1 t2 (Xk∆ ) − Eµ [t2 ] , so that Ωcn = ( sup n t∈In −1 n X k=1 2 ) 2 t (Xk∆ ) − Eµ [t ] > 1/2 is of the form required to apply Theorem 6. Each t ∈ In has kt2 k∞ ≤ C12 ε−2 n and kt2 k2µ = Eµ [t4 ] ≤ kt2 k∞ ktk2µ ≤ C12 ε−2 n . Since the indexing set In lies in a vector space of dimension Dln , we apply the theorem with x = Dn∆ε2n to see Pb sup n X t∈In k=1 ! 2 t2 (Xk∆ ) − Eµ [t2 ] ≥ 36 max{A, B} ≤ 4e−Dn∆εn . q 2 2 −1 −2 2 where A = κ̃C12 n∆−1 ε−2 n (Dn∆εn + Dln ) and B = κ̃C1 ∆ εn (Dn∆εn + Dln ), for some constant κ̃ = κ̃(I). Provided we can choose C1 so that 36 max{A/n, B/n} ≤ 1/2 the result is proved. Such a choice for C1 can be made because we have assumed Dln ≤ Ln∆ε2n . Step 3: Since b ∈ Θn and πln is L2 -orthogonal projection, we have kb̃n −bk22 ≤ kb̃n −πln bk22 +ε2n . −1/2 Recall that k·k2 ≤ πL k·kµ and note that on An ∩ Ωn , we further have 1 kb̃n − πln bk2µ ≤ kb̃n − πln bk2n . 2 Since also kb̃n − πln bk2n ≤ 2(kπln b − bk2n + kb̃n − bk2n ) we deduce that kb̃n − bk22 1An ∩Ωn ≤  1  4kπln b − bk2n + 4kb̃n − bk2n 1An ∩Ωn + ε2n , πL 16 where we have dropped indicator functions from terms on the right except where we will need them later. Thus, using a union bound, Pb (kb̃n − bk2 1An ∩Ωn > Cεn ) ≤ Pb kπln b − bk2n > C ′ ε2n + Pb kb̃n − bk2n 1An ∩Ωn > C ′ ε2n ,   for some constant C ′ (precisely we can take C ′ = (πL C 2 − 1)/8). It remains to show that both probabilities on the right are exponentially small. Bounding Pb (kπln b − bkn > Cεn ): We show that for any D > 0 there is a constant C such that 2 (10) Pb (kπln b − bkn > Cεn ) ≤ 2e−Dn∆εn , for all n sufficiently large. Since Eb kgk2n = kgk2µ for any 1–periodic deterministic function g and kπln b − bk2µ ≤ πU kπln b − bk22 ≤ πU ε2n for b ∈ Θn , it is enough to show that   2 Pb kπln b − bk2n − Eb kπln b − bk2n > Cε2n ≤ 2e−Dn∆εn for some different C. As in step 2, we apply Theorem 6, but now working with the single function (πln b − b)2 . For large enough n we have the bounds kπln b − bk∞ ≤ 1 (derived from (4)), and 1/2 k(πln b − b)2 kµ ≤ kπln b − bk∞ kπln b − bkµ ≤ πU εn (because b ∈ Θn ) and so applying the theorem with x = Dn∆ε2n gives Pb n h X k=1 2 (πln b − b) (Xk∆ ) − kπln b − bk2µ i ≥ max{a, b} ! 2 ≤ 2e−Dn∆εn , √ for a = κπU Dn∆−1 ε2n n∆ε2n = nε2n κπU D and b = κD∆−1 n∆ε2n = nε2n κD, for some constant κ = κ(I). We see that a/n and b/n are both upper bounded by a constant multiple of ε2n , hence, by choosing C large enough, (10) holds. p Bounding Pb kb̃n − bk2n 1An ∩Ωn > Cε2n : We show that Pb kb̃n − bk2n 1An ∩Ωn > Cε2n ≤ 2 6e−Dn∆εn for some constant C. Recall an application of (4) showed us that kπln bk∞ ≤ K0 + 1 for sufficiently large n, hence we see that πln b lies in S̃ln , so by definition γn (b̃n ) ≤ γn (πln b). We now use this to show that   n 1 7 8X 2 2 2 R2 , kb̃n − bkn 1An ∩Ωn ≤ kπln b − bkn + 8νn (t̃n ) 1An + 4 4 n k=1 k∆ (11) where νn (t) = n1 nk=1 t(Xk∆ )Zk∆ and we recall that t̃n = (b̃n − πln b)kb̃n − πln bk−1 µ . The −1 argument, copied from [8] Sections 3.2 and 6.1, is as follows. Using ∆ (X(k+1)∆ − Xk∆ ) = b(Xk∆ ) + Zk∆ + Rk∆ we see that P γn (u) − γn (b) = ku − bk2n + 2νn (b − u) + n 2X Rk∆ (b − u)(Xk∆ ). n k=1 Expanding γn (b̃n ) − γn (b) ≤ γn (πln b) − γn (b) and rearranging yields kb̃n − bk2n ≤ kπln b − bk2n + 2ν(b̃n − πln b) + n 2X Rk∆ (b̃n − πln b)(Xk∆ ). n k=1 We repeatedly apply the standard AM-GM–derived inequality 2ab ≤ θ 2 a2 + b2 /θ 2 with θ 2 = 8 to yield 17 n n 8X 1 2X 2 Rk∆ (b̃n − πln b)(Xk∆ ) ≤ Rk∆ + kb̃n − πln bk2n , n k=1 n k=1 8 1 2ν(b̃n − πln b) = 2kb̃n − πln bkµ ν(t̃n ) ≤ 8νn (t̃n )2 + kb̃n − πln bk2µ . 8 So far we have therefore shown that, for n large enough, kb̃n − bk2n ≤ kπln b − bk2n + 8νn (t̃n )2 + n 1 1 8X 2 + kb̃n − πln bk2n + kb̃n − πln bk2µ . Rk∆ n k=1 8 8 Next recall that on An ∩ Ωn , we have kb̃n − πln bk2µ ≤ 2kb̃n − πln bk2n . Since kb̃n − πln bk2n ≤ 2kb̃ − bk2n + 2kπln b − bk2n , we deduce (11), where on the right hand side we have only included indicator functions where they will help us in future steps. Thus, by a union bound, 1 Pb (kb̃n −bk2n An ∩Ωn > Cε2n ) ≤ Pb (kπln b−bk2n > 1 C ′ ε2n )+Pb (νn (t̃n )2 An n 1X > C εn )+Pb ( R2 > C ′ ε2n ), n k=1 k∆ ′ for some constant C ′ (we can take C ′ = C/96). We have already shown that Pb (kπln b − 2 bk2n 1An ∩Ωn > Cε2n ) ≤ 2e−Dn∆εn for a large enough constant C, thus the following lemmas conclude the proof. Lemma 12. Under the conditions of Theorem 11, for any D > 0 there is a constant C = C(I, L0 , D) > 0 for which, for n sufficiently large, Pb n 1X R2 > Cε2n n k=1 k∆ ! 2 ≤ 2e−Dn∆εn . Lemma 13. Under the conditions of Theorem 11, for any D > 0 there is a constant C = C(I, D, L) > 0 for which, for n sufficiently large, Pb (νn (t̃n )1An > Cεn ) ≤ 2e−Dn∆εn . 2 Proof of Lemma 12. Recall that Rk∆ 1 = ∆ Z (k+1)∆ k∆ (b(Xs ) − b(Xk∆ )) ds, and recall that any b ∈ Θ is Lipschitz continuous with Lipschitz constant at most K0 , so that |Rk∆ | ≤ K0 maxs≤∆ |Xk∆+s − Xk∆ |. It is therefore enough to bound sup{|Xs − Xt | : s, t ∈ [0, n∆], |s − t| ≤ ∆}. We apply the Hölder continuity result (Lemma 8) with u = D1/2 λ−1/2 (n∆ε2n )1/2 for λ = λ(I) the constant of the lemma, noting that the assumption n∆ε2n / log(n∆) → ∞ ensures that u is large enough compared to m = n∆ that the conditions for the lemma are met, at least when n is large. We see that sup   |Xs − Xt | ≤ ∆1/2 log(n∆)1/2 + log(∆−1 )1/2 D 1/2 λ−1/2 (n∆ε2n )1/2 , s,t∈[0,n∆] |s−t|≤∆ 18 2 on an event D of probability at least 1 − 2e−Dn∆εn , where we are able to take the supremum over |s − t| ≤ ∆ instead of over |s − t| ≤ τ because ∆ ≤ τ for large enough n. Note we have used that wm (δ) increases with δ for δ ≤ ∆, at least for n large enough that ∆ < e−1 , which can be derived from the fact that δ log(1/δ) increases in this range. Now observe that log(n∆)1/2 ≤ (log(∆−1 )1/2 ) for large enough n because n∆2 → 0 (so n∆ ≤ −1 ∆ eventually). Further, from the assumption n∆2 log(∆−1 ) ≤ L0 we are able to deduce that 1/2 ∆1/2 log(∆−1 )1/2 (n∆ε2n )1/2 ≤ L0 εn . It follows that on D, we have Rk∆ ≤ Cεn for a suitably chosen constant C (independent of k and n), which implies the desired concentration. Proof of Lemma 13. Recall νn (t) = Lemma 2 in [8], tells us Pb (νn (t) ≥ 1 n Pn k=1 t(Xk∆ )Zk∆ , ξ, ktk2n where Zk∆ = 1 R (k+1)∆ ∆ k∆ σ(Xs ) dWs . ! n∆ξ 2 ≤ u ) ≤ exp − 2 2 , 2σU u 2 for any t, u, and for any drift function b ∈ Θ, so that n∆ξ 2 Pb (νn (t) ≥ ξ) ≤ exp − 2 2 2σU u ! + Pb (ktk2n > u2 ). (⋆) We can apply Theorem 6 to see that, for some constant κ = κ(I), Pb (ktk2n 2 > u ) = Pb n 1 X t(Xk∆ )2 − Eµ t2 n k=1 ! 2 >u − ktk2µ ! n2 (u2 − ktk2µ )2 n(u2 − ktk2µ ) 1 , ≤ exp − ∆ min κ kt2 k∞ nkt2 k2µ ( )! 1 −2 2 ≤ exp − n∆(u2 − ktk2µ )ktk−2 ∞ min(u ktkµ − 1, 1) , κ   where to obtain the last line we have used that kt2 k2µ ≤ ktk2∞ ktk2µ . Now write u2 = ktk2µ + ξη. Then ξ 2 /u2 ≥ 12 min(ξ 2 /ktk2µ , ξ/η) so that, returning to (⋆), we find !  n∆ 1 −2 −2 −1 Pb (νn (t) ≥ ξ) ≤ exp − 2 min(ξ 2 ktk−2 µ , ξη ) + exp − n∆ξηktk∞ min(ξηktkµ , 1) 4σU κ  n o 1 −2 −2 −2 −1 2 2 , ξη , ξ η ktk ktk , ξηktk , ≤ 2 exp − ′ n∆ min ξ 2 ktk−2 µ ∞ µ ∞ κ for some constant κ′ = κ′ (I). We now show that for η suitably chosen, the minimum inside this exponential reduces to −1 min(ξ 2 ktk−2 µ , ξktk∞ ). The η dependent part of the minimum is optimised when −2 −2 ξη −1 = min(ξ 2 η 2 ktk−2 ∞ ktkµ , ξηktk∞ ). Working on this expression, one finds that the natural cases to split into are ξktk∞ ≷ ktk2µ , or, −1 equivalently, ξ 2 ktk−2 µ ≷ ξktk∞ . If ξktk∞ > ktk2µ , the η dependent part of the bound is optimised when η = ktk∞ , and the −1 −1 overall minimum is min(ξ 2 ktk−2 µ , ξktk∞ ) = ξktk∞ . 19 If ξktk∞ ≤ ktk2µ , the η dependent part of the bound is optimised when ξη 3 = ktk2∞ ktk2µ , lead- 4/3 ktk−2/3 ktk−2/3 ). The assumption ing to the overall minimum taking the form min(ξ 2 ktk−2 µ ,ξ ∞ µ 2 that ξktk∞ ≤ ktkµ guarantees that the first term is the smaller of the two. In both cases, therefore, we have the bound ξ2 1 ξ Pb (νn (t) ≥ ξ) ≤ 2 exp − n∆ min , 2 κ ktkµ ktk∞ !! . By changing variables we attain the bound  Pb νn (t) ≥ max √  v 2 x, ux ≤ 2 exp(−x). (12) where v 2 = κ(n∆)−1 ktk2µ and u = κ(n∆)−1 ktk∞ . As in Theorem 6, a standard chaining argument allows us to deduce that q Pb sup νn (t) ≥ κ̃ t∈I V 2 (D ln !  + x) + U (Dln + x) ≤ 4e−x , −1 for V 2 = supt∈I ktk2µ (n∆)−1 = (n∆)−1 , U = supt∈I ktk∞ (n∆)−1 = C1 ε−1 n (n∆) , and a constant κ̃ = κ̃(I). Taking x = Dn∆ε2n and recalling the assumption Dln ≤ Ln∆ε2n we obtain the desired result (conditional on t̃n ∈ I, which is the case on the event An ). 5 Small ball probabilities Now we show that the Kullback–Leibler divergence between the laws corresponding to different parameters b0 , b can be controlled in terms of the L2 –distance between the parameters, kb − b0 k2 . Denote by K(p, q) the Kullback–Leibler divergence between probability distributions with R densities p and q; that is, K(p, q) = Ep log( pq ) = log( p(x) q(x) )dp(x). Also write  KL(b0 , b) = Eb0 log  p0 (∆, X0 , X∆ ) pb (∆, X0 , X∆ )  , (n) (note KL(b0 , b) implicitly depends on n via ∆). Recalling that pb (x(n) ) = πb (x0 ) ni=1 pb (∆, x(i−1)∆ , xi∆ ) is the density on Rn+1 of X (n) under Pb , we introduce the following Kullback–Leibler type neighbourhoods: for ε > 0, define (n) BKL (ε) = ( b∈Θ: (n) (n) K(p0 , pb )  2 ≤ (n∆ + 1)ε , Varb0 log (n) p0  (n) pb Q 2 ≤ (n∆ + 1)ε ) , Bε = {b ∈ Θ : K(π0 , πb ) ≤ ε2 , Varb0 [log(π0 /πb )] ≤ ε2 , KL(b0 , b) ≤ ∆ε2 , Varb0 [log(p0 /pb )] ≤ ∆ε2 }. The main result of this section is the following. Theorem 14. Let X (n) = (Xk∆ )0≤k≤n be sampled from a diffusion X satisfying (1) and grant Assumptions 1 to 4. Assume that n∆ε2n → ∞ for a sequence (εn )n≥1 with εn > 0. Then there is (n) a constant A = A(I) such that, for all n sufficiently large, {b ∈ Θ : kb−b0 k2 ≤ Aεn } ⊆ BKL (εn ). Proof. Applying Lemma 24 in the appendix where it is shown that (n) Var log p0 (X (n) ) (n) pb (X (n) ) ! π0 (X0 ) p0 (X0 , X∆ ) ≤ 3 Var log + 3n Var log , πb (X0 ) pb (X0 , X∆ )   20   (n) (n) and noting also that K(p0 , pb ) = K(π0 , πb )+n KL(b0 , b) by linearity, we observe that Bε/√3 ⊆ (n) BKL (ε). It is therefore enough to show that there is an A = A(I) such that {b ∈ Θ : kb − b0 k2 ≤ Aε} ⊆ Bε/√3 . This follows immediately by applying Lemma 15 below with the substitution √ εn 7→ εn / 3. Lemma 15. Under the conditions of Theorem 14, there is an A = A(I) such that, for all n sufficiently large, {b ∈ Θ : kb − b0 k2 ≤ Aεn } ⊆ Bεn . The key idea in proving Lemma 15 is to use the Kullback–Leibler divergence between the (x) (x) laws Pb0 , Pb of the continuous-time paths to control the Kullback–Leibler divergence between pb and p0 . This will help us because we can calculate the Kullback–Leibler divergence between the full paths using Girsanov’s Theorem, which gives us an explicit formula for the likelihood ratios. (x) (x) Let Pb,T denote the law of (Xt )0≤t≤T conditional on X0 = x, i.e. the restriction of Pb to (x) (x) C([0, T ]). We write Wσ,T for Pb,T when b = 0. Throughout this section we will simply write (x) Pb (x) (x) for Pb,∆ and similarly with Wσ . We have the following. Theorem 16 (Girsanov’s Theorem). Assume b0 , b ∈ Θ and σ satisfies Assumption 1. Then the (x) (x) laws Pb0 ,T and Pb,T are mutually absolutely continuous with, for any continuous path (Ut )t≤T where U0 = x, (x) dPb0 ,T (x) dPb,T ((Ut )t≤T ) = exp "Z 0 T b0 − b 1 (Ut ) dUt − 2 σ 2 Z 0 T # b20 − b2 (Ut ) dt . σ2 Proof. See [19], Theorem 7.19, noting that the assumptions are met because b, b0 and σ are all Lipschitz and bounded, and σ ≥ σL . We write (x) (x) p̃0 = dPb0 (x) , (x) p̃b dWσ (x) = dPb (13) (x) dWσ (x) for the Radon-Nikodym derivatives (i.e. densities on C([0, ∆]) with respect to Wσ ) whose existence Girsanov’s Theorem guarantees. We will simply write X for (Xt )t≤∆ where context (x) allows, and similarly with U . Since p̃0 (X) = 0 for any path X with X0 6= x, we will further (X ) omit the superscripts on our densities in general, writing p̃0 (X) for p̃0 0 (X), and similarly for p̃b . Proof of Lemma 15. We break the proof into a series of lemmas. We will upper bound the variances in the definition of Bε by the corresponding second moments. Step 1. We show that for some constant A = A(I) we have A2 KL(b0 , b) ≤ ∆kb − b0 k22 , which shows that KL(b0 , b) ≤ ∆ε2n whenever kb − b0 k2 ≤ Aεn . This is the content of Lemma 17. Step 2. We show that, for some A = A(I), if kb − b0 k2 ≤ Aε then we have Eb0 [log(p0 /pb )2 ] ≤ ∆ε2n . This is the content of Lemma 18. Note that the other steps do not need any assumptions on εn , but this step uses n∆ε2n → ∞. Step 3. We show that for some constant A = A(I) we have n o A2 max K(π0 , πb ), Eb0 [log(π0 /πb )2 ] ≤ kb0 − bk22 , from which it follows that if kb−b0 k2 ≤ Aεn then K(π0 , πb ) ≤ ε2n and Eb0 [log(π0 /πb )2 ] ≤ ε2n . This is the content of Lemma 19. 21 Together, then, the three lemmas below conclude the proof. Lemma 17. Under the conditions of Theorem 14, there is a constant A = A(I) such that A2 KL(b0 , b) ≤ ∆kb0 − bk22 . Proof. We follow the proof given in [21] Lemma 5.1, adapting and expanding on some of the (x) (x) steps. Let X ∼ Pb0 and let U ∼ Wσ . The probability density of a transition of X from x to y, with respect to the (Lebesgue) density p∗ of transitions of U from x to y, can be calculated by integrating the likelihood p̃0 (U ) over all paths of U which start at x and end at y. But (x) performing this integration will exactly yield the conditional expectation of p̃0 (U ) given U∆ . That is to say, p0 (∆, x, y) = EW(x) [p̃0 (U ) | U∆ = y]. σ p∗ (∆, x, y) A similar expression holds for pb (∆, x, y), so that p0 (∆, X0 , X∆ ) KL(b0 , b) := Eb0 log pb (∆, X0 , X∆ )    = Eb0 log EW(X0 ) [p̃0 ((Ut )t≤∆ ) | U∆ = X∆ ] σ EW(X0 ) [p̃b ((Ut )t≤∆ ) | U∆ = X∆ ] σ  . Lemma 22 in the appendix allows us to simplify the ratio of conditional expectations. It says that for any mutually absolutely continuous probability distributions P and Q, we have, for f = dQ dP , for any measurable function g and any sub-σ-algebra G, EP [f g | G] . EP [f | G] EQ [g | G] = (X0 ) We apply with P = Wσ (X0 ) , Q = Pb0 (X0 ) and g = p̃b (X0 ) /p̃0 to deduce 1 KL(b0 , b) = Eb0 log EP (X0 ) [(p̃b /p̃0 )(X) | X∆ ]  ≤ Eb0 b0   p̃0 log (X) , p̃b  where we have used (conditional) Jensen’s inequality to deduce the final line. The right-hand (X ) (X ) side is the Kullback–Leibler divergence between the laws Pb0 0 and Pb 0 of continuous paths for different drift parameters, averaged over the same starting distribution X0 ∼ µ0 . Introducing the notation f = b0σ−b , we evaluate by applying Girsanov’s Theorem and Fubini’s Theorem: Eb0 i p̃0 log (X) = Eb0 p̃b h = Eb0 = 1 2 Z "Z "Z ∆ 0 ∆ 0 b0 − b 1 (Xt ) dXt − 2 σ 2 ∆ 0 f (Xt ) dWt + Z ∆ 0 Z 0 ∆ b20 − b2 (Xt ) dt σ2 # ! b20 − b2 b0 − b (X )b (X ) − (Xt ) dt t 0 t σ2 2σ 2 # Eb0 f 2 (Xt ) dt.   For the final line we have dropped one of the terms using that for X ∼ Pb0 , ( 0t f (Xs ) dWs )t is a martingale (a bounded semimartingale integrated against a square integrable martingale yields a martingale, as in [28] IV.27.4; note that f is bounded because b and b0 are both bounded and σ is bounded away from zero). Since f is periodic, we can replace the Xt in the final expectation R 22 with the periodised version Ẋt = Xt mod 1. Then the expectation is with respect to the law of Ẋ started from its invariant distribution µ0 . We thus deduce b0 − b 1 KL(b0 , b) ≤ ∆ 2 σ 2 . µ0 We can replace the σ in the denominator with its lower bound σL , and further note our assumptions ensure that the L2 (µ0 )– and L2 –norms are equivalent with constants depending only on I. The result follows. Lemma 18. Under the conditions of Theorem 14, there is a constant A = A(I) so that, for n sufficiently large, Eb0 [log(p0 /p)2 ] ≤ ∆ε2n whenever kb − b0 k2 ≤ Aεn . Proof. We wish to apply a similar argument to the previous proof, but are hindered by the fact that x 7→ (log(x))2 is not convex, unlike x 7→ − log(x), so we will not directly be able to apply Jensen’s inequality as before. We therefore instead consider the smallest convex function dominating log(x)2 , which is given by h(x) = ( log(x)2 x<e −1 2e x − 1 x ≥ e (it is in fact more convenient, and equivalent, to think of h as dominating the function x 7→ (log x−1 )2 ). We will find that we can control the second moment of log(p0 /pb ) by the second moment of the corresponding expression log(p̃0 /p̃b ) for the full paths, up to an approximation error which is small when ∆ is small. We have  Eb0 log  p (∆, X , X ) 2  0 0 ∆ pb (∆, X0 , X∆ ) ≤ Eb0 [h(pb /p0 )]  E = Eb0 h (X0 ) Wσ EW(X0 ) [p̃0 (U ) | U∆ = X∆ ] (X ) σ (X0 ) As before, we apply Lemma 22 with P = Wσ 0 , Q = Pb0 Jensen’s inequality and the tower law to find Eb0  log  [p̃b (U ) | U∆ = X∆ ]  (X0 ) and g = p̃b (X0 ) /p̃0 . , then conditional h p̃ i  p0 2 b (X) | X∆ ≤ Eb0 h EP (X0 ) pb p̃0 b0 h  p̃ i b ≤ Eb0 h (X) p̃0    We thus have the promised decomposition into a corresponding quantity for the continuous case and an approximation error: Eb0 " p0 log pb 2 #   p̃b ≤ Eb0 h ≤ Eb0 p̃0 "  (X) 2 # p̃0 log (X) p̃b  + Eb0 (2e−1 o n p̃ p̃b b (X) − 1)1 (X) ≥ e . p̃0 p̃0  We conclude by showing that each of these two terms is bounded by 12 ∆ε2n , provided kb − b0 k ≤ Aεn for some sufficiently small constant A = A(I). 23 Showing Eb0  log  p̃0 2 p̃b  1 2 2 ∆εn : ≤ b0 −b σ . Write f = Then we apply Girsanov’s Theorem (Theorem 16) as before to find Eb0 " 2 # p̃0 log (X) p̃b = Eb0 " Z  = Eb0 hZ ∆ 0 1 f (Xt ) dWt + 2 ∆ 0 f (Xt ) dWt + Eb0 ∆ h Z 2 i Z ∆ 0 h 1 + Eb0 4 f (Xt ) dWt 0 f 2 (Xt ) dt 0 ∆ Z  ∆ Z 0 2 # , f 2 (Xt ) dt i 2 i f 2 (Xt ) dt . Recall that 0∆ f (Xt ) dWt is a martingale for X ∼ Pb0 since f is bounded, and note that 2 0 f (Xt ) dt is a finite variation process. It follows that the third term on the right of the final expression vanishes (e.g. see [28] IV.32.12). For the first term on the right, we use Itô’s isometry ([28] IV.27.5), Fubini’s Theorem, periodicity of f and stationarity of µ0 for the periodised process Ẋ = X mod 1 to find R R∆ Eb0 Z ∆ 0 f (Xt ) dWt 2 = Eb0 Z ∆ 0 f 2 (Xt ) dt = ∆kf k2µ0 . 2 i h R ∆ 1 2 is upper bounded 0 f (Xt ) dt 4 Eb0 R∆ 2 2 R the bound ( 0 f ) ≤ ∆kf k2∞ 0∆ f 2 . Since kf k∞ is 0, this term is dominated by ∆kf k2µ0 when n is large. The second term from ∆→ we find Eb0 2 # " p̃0 log (X) p̃b by 41 ∆2 kf k2∞ kf k2µ0 , as can be seen uniformly bounded for b ∈ Θ, and Thus, for some constant A = A(I) 1 ≤ 2∆kf k2µ0 ≤ A−2 ∆kb0 − bk22 , 2 where as usual our assumptions allow us to upper bound kf kµ0 by kb0 − bk2 , up to a constant. h i For kb0 − bk2 ≤ Aεn we then have Eb0 log(p̃b /p̃0 ) ≤ ∆ε2n /2. Showing Eb0 (2e−1 p̃p̃0b (X) − 1)1{ p̃p̃0b (X) ≥ e} ≤ 12 ∆ε2n : We use the standard trick of expressing an expectation in terms of tail probabilities. In Lemma 23 it is shown that h i (x)  Pb0 log((p̃b /p̃0 )(X)) > u ≤ 2e−κu  2 ∆−1 (log ∆−1 )−1 for some constant κ = κ(I) > 0, and by the tower law this also holds for X0 ∼ µ, hence we have the following: Eb0  −1 p̃b 2e p̃0  n p̃ b (X) − 1 1 p̃0 o (X) ≥ e −1 ≤ 2e = 2Pb0 Z ∞ 0  p̃ b p̃0 Pb0  p̃ b p̃0  (X) ≥ e + −κ∆−1 (log ∆−1 )−1 + −1 (log ∆−1 )−1 + ≤ 2e = 2e−κ∆ R∞ −κu2 ∆−1 (log ∆−1 )−1 eu du. By noting I ≤ Write I = 1 2e integrating by parts it is easy to show that I≤ n p̃ (X)1 Z p̃0 ∞ e ∞ Z Ze ∞ 1 R∞ 1 b Pb0   p̃ b p̃0  (X) ≥ x dx −κ log(x)2 ∆−1 (log ∆−1 )−1 2e 2e−κu 2ue−κu 2e∆ log(∆−1 ) −κ∆−1 (log(∆−1 ))−1 e , 2κ − ∆ log(∆−1 ) 24 o (X) ≥ e ≥ x dx 2 ∆−1 (log ∆−1 )−1 2 ∆−1 (log ∆−1 )−1 dx eu du. eu du and at least for n large enough that the denominator is positive. It follows that for sufficiently large −1 (log ∆−1 )−1 . n, I is dominated by the term 2e−κ∆ i h −1 −1 −1 p̃b −1 So far we have shown that Eb0 (2e p̃0 (X) − 1)1{ p̃p̃0b (X) ≥ e} ≤ 4e−κ∆ (log ∆ ) , and recall our aim is to show that for some A = A(I), if kb − b0 k2 ≤ Aεn then this expectation is bounded by 21 ∆ε2n . Hence we will be done if we can prove that, for large enough n, 8e−κ∆ −1 (log ∆−1 )−1 ≤ ∆ε2n = n−1 (n∆ε2n ). Since n∆ε2n → ∞, so that it is greater than 8 when n is sufficiently large, it is enough to show −1 −1 −1 e−κ∆ (log ∆ ) ≤ n−1 . Recall we assume n∆ → ∞ and n∆2 → 0. It follows that for large enough n we have log(∆−1 ) ≤ log(n), and ∆ ≤ κ log(n)−2 . Then observe ∆ ≤ κ log(n)−2 ∆ ≤ κ(log ∆−1 )−1 log(n)−1 =⇒ =⇒ log(n) ≤ κ∆−1 (log ∆−1 )−1 n−1 ≥ e−κ∆ =⇒ −1 (log ∆−1 )−1 , as required. Lemma 19. Under the conditions of Theorem 14, there is a constant A = A(I) such that n o A2 max K(π0 , πb ), Eb0 [log(π0 /πb )2 ] ≤ kb0 − bk22 . Proof. By the comment after Lemma 8.3 in [10], it suffices to prove h2 (π0 , πb )kπ0 /πb k∞ ≤ Ckb − b0 k22R for some C = C(I), where h is the Hellinger distance between densities defined by √ √ h2 (p, q) = ( p − q)2 . Since π0 , πb are uniformly bounded above and away from zero, we can absorb the term kπ0 /πb k∞ into the constant. We initially prove pointwise bounds on the difference between the densities π0 , πb . Recall we R saw in Section 2 that, for Ib (x) = 0x σ2b2 (y) dy, we have πb (x) = Hb = Z eIb (x)  Ib (1) e Hb σ 2 (x) 1 0 eIb (x)  Ib (1) e σ 2 (x) Z Z 1 e−Ib (y) dy + x 1 x e−Ib (y) dy + Z Z x 0 x 0  e−Ib (y) dy , x ∈ [0, 1],  e−Ib (y) dy dx. We can decompose |πb (x) − π0 (x)| ≤ D1 + D2 + D3 + D4 , where D1 = D2 = D3 = D4 = Z x Z  eIb (x) 1 1  Ib (1) 1 −Ib (y) −Ib (y) e dy , e dy + − e σ 2 (x) Hb Hb0 0 x |eIb (x) − eIb0 (x) |  Ib (1) e Hb0 σ 2 (x) Ib0 (1) Z 1 x e−Ib (y) dy +  e eIb (1) − eIb0 (1) 2 Hb0 σ (x) eIb0 (1) eIb0 (1) Hb0 σ 2 (x) Z 1 x Z 1 x Z x 0  e−Ib (y) dy , e−Ib (y) dy , (e−Ib (y) − e−Ib0 (y) ) dy − 25 Z 0 x (e−Ib (y) − e−Ib0 (y) ) dy . We have the bounds −2 −2 −2 σU−2 e−6K0 σL ≤ Hb ≤ σL−2 e6K0 σL , −2 and e−2K0 σL ≤ eIb (x) ≤ e2K0 σL . An application of the mean value theorem then tells us eIb (x) − eIb0 (x) = exp Z x 0  2b (y) dy − exp 2 σ x Z 0 x 2|b − b|  2b0 0 ≤ C(I) (y) dy (y) dy σ2 σ2 0 ≤ C ′ (I)kb0 − bk2 , Z for some constants C,C ′ , and the same expression upper bounds |e−Ib (x) − e−Ib0 (x) |. It follows that, for some constant C = C(I), we have Di ≤ Ckb − b0 k2 for i = 2, 3, 4. For |H −H | i = 1 the same bound holds since | H1b − H1b | ≤ Hbb Hbb0 and a similar decomposition to the 0 0 above yields |Hb − Hb0 | ≤ C(I)kb − b0 k2 . Thus, we have shown that |πb (x) − π0 (x)| ≤ C(I)kb − b0 k2 . Integrating this pointwise bound, we find that kπ0 − πb k2 ≤ C(I)kb0 − bk2 . Finally, since h2 (π0 , πb ) ≤ 4π1L kπ0 − πb k22 ≤ C ′ (I)kb0 − bk22 , for some different constant C ′ , we are done. 6 Main contraction results: proofs We now have the tools we need to apply general theory in order to derive contraction rates. We first deduce the following abstract contraction result, then we demonstrate that Theorem 1 follows. Recall that K(p, q) denotes the Kullback–Leibler divergence between probability distributions with densities p and q, and recall the definition (n) BKL (ε) = ( b∈Θ: (n) (n) K(p0 , pb ) 2  ≤ (n∆ + 1)ε , Varb0 log (n) p0  (n) pb 2 ≤ (n∆ + 1)ε ) . Theorem 20. Let (Xk∆ )0≤k≤n be sampled from a diffusion X satisfying (1) and grant Assumptions 1 to 4. Let εn → 0 be a sequence of positive numbers and let ln be a sequence of positive integers such that, for some constant L we have, for all n, Dln = 2ln + 1 ≤ Ln∆ε2n , and n∆ε2n / log(n∆) → ∞. (14) For each n let Θn be S-measurable and assume b0 ∈ Θn ⊆ {b ∈ Θ : kπln b − bk2 ≤ εn }, (15) where πln is L2 –orthogonal projection onto Sln as described in Section 2.1. Let Π(n) be a sequence of priors on Θ satisfying 2 (a) Π(n) (Θcn ) ≤ e−(ω+4)n∆εn , (n) 2 (b) Π(n) (BKL (εn )) ≥ e−ωn∆εn , for some constant2 ω > 0. Then for some constant M = M (I, L0 , ω, L),   Π(n) {b ∈ Θ : kb − b0 k2 ≤ M εn } | X (n) → 1 in probability under Pb0 . 2 In fact we can replace the exponent ω + 4 in (a) with any B > ω + 1. We choose ω + 4 because it simplifies the exposition and the exact value is unimportant. 26 A main step in the proof is to demonstrate an evidence lower bound, the (standard) proof of which is relegated to the appendix. Lemma 21 (Evidence lower bound, ELBO). Recall we defined (n) BKL (ε) = ( b∈Θ: (n) (n) K(p0 , pb )  2 ≤ (n∆ + 1)ε , Varb0 log (n) p0  (n) pb 2 ≤ (n∆ + 1)ε ) , (n) where pb is the joint probability density of X0 , . . . , Xn∆ started from the invariant distribution (n) (n) (n) (n) when b is the true parameter and p0 denotes pb0 . Let n∆ε2n → ∞ and write BKL for BKL (εn ). Define the event Z An = Then as n → ∞, Pb0 (Acn ) n Θ 2 (n) (n) (n) o (pb /p0 ) dΠ(b) ≥ Π(BKL )e−2n∆εn . → 0.   Proof of Theorem 20. We write Π for Π(n) . It is enough to show Eb0 Π {b ∈ Θ : kb − b0 k2 > M εn } | X (n) → 0. Observe, for any measurable sets S and Θn , any event An and any {0, 1}–valued function ψn we can decompose Π(S | X (n) ) ≤ 1Acn + ψn + Π(Θcn | X (n) )1An + Π(S ∩ Θn | X (n) )1An (1 − ψn ). We apply the above to (n) S = SM = {b ∈ Θ : kb − b0 k2 > M εn } An = nZ Θ 2 (n) (n) o (pb /p0 )(X (n) ) dΠ(b) ≥ e−(ω+2)n∆εn , with Θn as given in the statement of the theorem and with ψn the test given by Lemma 5, noting that the assumptions for Theorem 20 include those needed for Lemma 5. We take expectation and bound each of the terms separately. Bounding Eb0 1Acn : 2 e−ωn∆εn . Bounding Eb0 ψn : (n) We have Pb0 (Acn ) → 0 from Lemma 21, since by assumption Π(BKL (εn )) ≥ This expectation tends to zero by Lemma 5. Bounding Eb0 [Π(Θcn | X (n) )1An ]: Π(Θcn |X (n) We have R (n) Θcn )1An = R = pb (X (n) ) dΠ(b) (n) (n) ) dΠ(b) Θ pb (X (n) (n) (n) ) dΠ(b) Θcn (pb /p0 )(X An R (n) (n) (n) ) dΠ(b) Θ (pb /p0 )(X R 1 2 ≤ e(ω+2)n∆εn (n) 1An Z Θcn (n) (n) (pb /p0 )(X (n) ) dΠ(b). (n) Since Eb0 [(pb /p0 )(X (n) )] = Eb [1] = 1, we apply Fubini’s Theorem to see that Eb0 [Π(Θcn | X (n) )1An ] ≤ e(ω+2)n∆εn Π(Θcn ). 2 2 Since we assumed Π(Θcn ) ≤ e−(ω+4)n∆εn , we deduce that Eb0 [Π(Θcn | X (n) )1An ] ≤ exp (ω + 2)n∆ε2n − (ω + 4)n∆ε2n → 0.  27  Bounding Eb0 [Π(S ∩ Θn | X (n) )1An (1 − ψn )]: that By a similar argument to the above, observe Eb0 [Π(S ∩ Θn | X (n) )1An (1 − ψn )] ≤ e(ω+2)n∆εn 2 Z b∈Θn :kb−b0 k2 >M εn Eb [1 − ψn (X (n) )] dΠ(b). By construction of the tests we see that the integrand is bounded by supb∈Θn :kb−b0 k2 >M εn Eb [1 − 2 ψn (X (n) )] ≤ e−Dn∆εn , where by choosing M large enough we could attain any fixed D in the exponential term. Choosing M corresponding to some D > ω + 2 we see Eb0 [Π(S ∩ Θn | X (n) )1An (1 − ψn )] → 0. Proof of Theorem 1. A. We apply Theorem 20. The key idea which allows us to control the bias and obtain this adaptive result with a sieve prior is undersmoothing. Specifically, when we prove the small ball probabilities, we do so by conditioning on the hyperprior choosing a resolution jn which corresponds to the minimax rate (n∆)−s/(1+2s) rather than corresponding to the slower rate (n∆)−s/(1+2s) log(n∆)1/2 at which we prove contraction. This logarithmic gap gives us the room we need to ensure we can achieve the bias condition (a) and the small ball condition (b) for the same constant ω. The argument goes as follows. Write ε̄2n = (n∆)−2s/(1+2s) and let ε2n = (n∆)−2s/(1+2s) log(n∆). Choose jn and ln natural numbers satisfying (at least for n large enough) 1 n∆ε̄2n ≤ Djn = 2jn + 1 ≤ n∆ε̄2n , 2 1 Ln∆ε2n ≤ Dln = 2ln + 1 ≤ Ln∆ε2n , 2 where L is a constant to be chosen. Note that (14) holds by definition. Recall now from our choice of approximation spaces in Section 2.1 that we have kπm b0 − b0 k2 ≤ K(s)kb0 kB s 2−ms . For any fixed L we therefore find that for n large enough, writing 2,∞ K(b0 ) = K(s)kb0 kB s 2s , we have 2,∞ kπln b0 − b0 k2 ≤ K(b0 )(Ln∆ε2n )−s = K(b0 )(Ln∆ε̄2n log(n∆))−s = K(b0 )L−s ε̄n log(n∆)−s ≤ εn . Similarly, it can be shown that, with A = A(I) the constant of the small ball result (Theorem 14) and for n large enough, we have kb0 − πjn b0 k2 ≤ Aεn /2. Set Θn = {b0 } ∪ (Sln ∩ Θ) and observe that the above calculation shows that the bias condition (15) holds (since also for b ∈ Θn , if b 6= b0 we see kπln b − bk2 = 0). All that remains is therefore to show that from the assumptions of Theorem 1A we can deduce for some constant ω that we have both 2 (a) Π(Θcn ) ≤ e−(ω+4)n∆εn , and (n) 2 (b) Π(BKL (εn )) ≥ e−ωn∆εn . (n) For (b), recall Theorem 14 tells us that {b ∈ Θ : kb − b0 k2 ≤ Aεn } ⊆ BKL (εn ) for all n large enough. Thus it suffices to show, for some ω > 0 for which we can also achieve (a), 2 that Π({b ∈ Θ : kb − b0 k2 ≤ Aεn }) ≥ e−ωn∆εn . 28 Observe now that Π({b ∈ Θ : kb − b0 k2 ≤ Aεn }) = X m h(m)Πm ({b ∈ Sm : kb − b0 k2 ≤ Aεn }), ≥ h(jn )Πjn ({b ∈ Sjn : kb − b0 k2 ≤ Aεn }). Next note that kb − b0 k2 ≤ kb − πjn b0 k2 + kπjn b0 − b0 k2 ≤ kb − πjn b0 k2 + Aεn /2. Thus we see, using our assumptions on h and Πm , that Π({b ∈ Θ : kb − b0 k2 ≤ Aεn }) ≥ h(jn )Πjn ({b ∈ Sjn : kb − πjn b0 k2 ≤ Aεn /2}) ≥ h(jn )(εn Aζ/2)Djn ≥ B1 exp(−β1 Djn + Djn [log(εn ) + log(Aζ/2)])   ≥ B1 exp −Cn∆ε̄2n − Cn∆ε̄2n log(ε−1 n ) for some constant C = C(I, β1 , ζ). Using that log(ε−1 n )= s 1 log(n∆) − log log(n∆) 1 + 2s 2 ≤ log(n∆), we see that Π({b ∈ Θ : kb − b0 k2 ≤ Aεn }) ≥ B1 e−C ′ n∆ε̄2 log(n∆) n ′ 2 = B1 e−C n∆εn , with a different constant C ′ . Changing the constant again to some ω = ω(I, β1 , B1 , ζ), we can absorb the B1 factor into the exponential for large enough n. For (a), since Π(Θc ) = 0 by assumption, we have Π(Θcn ) ≤ Π(Slcn ) = ∞ X h(m). m=ln +1 We have assumed that h(m) ≤ B2 e−β2 Dm , which ensures that the sum is at most a constant 1 2 times e−β2 Dln ≤ e− 2 Lβ2 n∆εn . For the ω = ω(I, β1 , B1 , ζ) for which we proved (b) above, 2 we can therefore choose L large enough to guarantee Π(Θcn ) ≤ e−(ω+4)n∆εn . B. Let εn and jn be as in the statement of the theorem and define ln as above (here we can take L = 1). Similarly to before, we can apply results from Section 2.1 to see kπln b − bk2 ≤ εn kπjn b − bk2 ≤ εn ) for all n sufficiently large and all b ∈ Θs (A0 ), Set Θn = Θs (A0 ) for all n. Our assumptions then guarantee the bias condition (a) will hold for any ω (indeed, Π(n) (Θcn ) = 0). Thus it suffices to prove for some constant ω that 2 Π(n) ({b ∈ Θs (A0 ) : kb − b0 k2 ≤ 3εn }) ≥ e−ωn∆εn , since we can absorb the factor of 3 into the constant M by substituting 3εn 7→ εn . Because the prior concentrates on Θs (A0 ) and b0 ∈ Θs (A0 ), we see both that Π(n) ({b : kπjn b − bk2 ≤ εn }) = 1 and that kπjn b0 − b0 k2 ≤ εn . Thus Π(n) ({b ∈ Θs (K0 ) : kb − b0 k2 ≤ 3εn }) ≥ Π(n) ({b ∈ Θs (K0 ) : kπjn b − πjn b0 k2 ≤ εn }) From here the argument is very similar to the previous part (indeed, it is slightly simpler) so we omit the remaining details. 29 6.1 Explicit priors: proofs Proof of Proposition 2. We verify that the prior satisfies the conditions of Theorem 1A. Condition (i) holds by construction of h. s –norm has the wavelet characterisation Since the B∞,1 kf kB s ∞,1 = |f−1,0 | + ∞ X l=0 2l(s+1/2) max |flk |, 0≤k<2l (16) 1 with (see [13] Section 4.3) we see Assumption 5 for our choice of τl ensures that b0 ∈ B∞,1 P −2 kb0 kB 1 ≤ B(2 + l≥1 l ). It follows from standard Besov spaces results (e.g. [13] Proposition ∞,1 1 ([0, 1]), with a C 1 –norm 4.3.20, adapted to apply to periodic Besov spaces) that b0 ∈ Cper per bounded in terms of B. Thus b0 ∈ Θ for an appropriate choice of K0 . We similarly see that Π(Θ) = 1. It remains to show that (ii) holds. We have kb − πm b0 k22 = X −1≤l≤m 0≤k<2l  τl2 (ulk − βlk )2 ≤ 1 + m X 2−2l l=0  max |ulk − βlk |2 −1≤l≤m, 0≤k<2l < 4 max |ulk − βlk |2 , −1≤l≤m, 0≤k<2l so that Π({b ∈ Sm : kb − πm b0 k2 ≤ ε}) ≥ Π(|ulk − βlk | ≤ ε/2 ∀l, k, −1 ≤ l ≤ m, k < 2l ). Since we have assumed |βlk | ≤ Bτl and q(x) ≥ ζ for |x| ≤ B, it follows from independence of the ulk that the right-hand side of this last expression is lower bounded by (εζ/2)Dm , so that (ii) holds with ζ/2 in place of ζ. Proof of Proposition 3. We verify the conditions of Theorem 1B. Throughout the proof we will simply write Π for Π(n) . Since s ≥ 1, we have Π(Θ) = 1 for an appropriate choice of K0 as in the proof of Proposition 2. Observe also that for A0 = B we have Π(Θs (A0 )) = 1 by construction, using the wavelet characterisation of k·kB s . Thus (I) holds and it remains to check (II). 2,∞ Let jn ∈ N be such that jn ≤ L̄n , 2jn ∼ (n∆)1/(1+2s) . Similarly to the proof of Proposition 2 we have Π({b ∈ Θ : kπjn b − πjn b0 k2 ≤ εn }) ≥ Π(|ulk − βlk | ≤ εn /2 ∀l ≤ jn , ∀k < 2l ), ≥ (εn ζ/2)Djn , as required. Proof of Proposition 4. We include only the key differences to the previous proofs. 2 – From (6) with our choice of τl and from (16), it can be seen that H and H0 both have B∞,1 P −2 norm bounded by B(2 + l≥1 l ), so that b0 ∈ Θ(K0 ) and Π(Θ(K0 )) = 1, for an appropriate constant K0 = K0 (B). From the wavelet characterisation kf kB s = |f−1,0 | + 2,2 ∞ X 30 l=0 2ls 2 l −1 2X k=0 2 flk 1/2 (17) s+1 it can be seen that H and H0 both lie in B2,2 , hence that b0 ∈ Θs (A0 ) and Π(Θs (A0 )) = 1 for an appropriate constant A0 . Also note that kH − πm HkB 1 . 2−ms and similarly for H0 . 2,2 Observe, for jn as in the previous proof, kπjn b − πjn b0 k2 ≤ kb − b0 k2 = kσ 2 (H ′ − H0′ )/2k2 1 ≤ σU2 kH − H0 kB 1 2,2 2  1 2 ≤ σU kH − πjn HkB 1 + kH0 − πjn H0 kB 1 + kπjn H − πjn H0 kB 1 . 2,2 2,2 2,2 2 Now σU2 kH − πjn HkB 1 ≤ σU2 A0 2−jn s ≤ C(n∆)−s/(1+2s) ≤ 2,2 1 (n∆)−s/(1+2s) log(n∆)1/2 2 for large enough n, and similarly for H0 . Thus,  Π b : kπjn b − πjn b0 k2 ≤ εn   ≥Π b : kπjn H − πjn H0 kB 1 ≤ εn /2 2,2  ≥ Π(|ulk − βlk | ≤ εn /6 ∀l ≤ jn , ∀k < 2l ), where the final inequality can be seen to hold from the wavelet representation of k·k1B2,2 (using P −2ls ≤ 4/3). The small ball condition (II) follows from our updated also that s ≥ 1 so that ∞ l=0 2 assumptions. Appendix A Remaining proofs, and technical lemmas Proof of Lemma 9. We follow and adapt the proof of Dudley’s Theorem from [13] (Theorem 2.3.8). For a Gaussian process B, indexed by T and with intrinsic covariance (pseudo-)metric d(s, t) = (E[Bs − Bt ]2 )1/2 , Dudley’s Theorem says " E sup s,t∈T,s6=t |Bs − Bt | R d(s,t) p log N (T, d, x) dx 0 # < ∞, where N (T, d, x) is the number of balls of d−radius x needed to cover T . Defining the process Bu − Bu 1 Cu = R d(u ,u ) p 2 1 2 log(N (T, d, x)) dx 0 on U = {u = (u1 , u2 ) : u1 , u2 ∈ T, d(u1 , u2 ) 6= 0}, it is shown in the proof that C is a Gaussian process on with bounded and continuous sample paths. It follows by [13] Theorem 2.1.20 that ( Pr sup|Cu | − E sup|Cu | > v u∈U u∈U ) ≤ 2e−v 2 /2σ 2 , 2 where σ 2 = sup p E[Cu ]. We can upper R au∈U √ bound Cu by applying the trivial lower bound for the denominator 0 log N (T, d, x) ≥ a2 log 2 for any a = d(u, v) for some u, v ∈ T (this follows from the fact that N (T, d, x) ≥ 2 if x is less than half the diameter of T ). Using also that d is the intrinsic covariance metric, we deduce that ECu2 ≤ 4/ log 2, so we can take σ 2 = 4/ log 2. 31 We will apply the result to B a standard Brownian motion on T = [0, m], which has intrinsic covariance metric d(s, t) = |s − t|1/2 . For this T and d, we have N (T, d, x) ≤ mx−1/2 . Then, applying Jensen’s inequality, we see Z 0 d(s,t) q 1/2 log N (T, d, x) dx ≤ d(s, t) Z d(s,t) ( log(N (T, d, x))1/2 0  ≤ 2−1/2 d(s, t) 1 + log(d(s, t)−1 ) + 2 log m 1/2 If we restrict the supremum to s, t satisfying |s − t| ≤ e−2 , observe that 1 1 + log(d(s, t)−1 ) = 1 + log(|s − t|−1 ) ≤ log(|s − t|−1 ). 2 Noting further that (a + b)1/2 ≤ a1/2 + b1/2 for a, b ≥ 0 and recalling we defined wm (δ) = δ1/2 ((log δ−1 )1/2 + log(m)1/2 ), we see Z 0 d(s,t) q log N (T, d, x) dx ≤ wm (|s − t|). " |Bs −Bt | Thus, writing M = E sups,t∈T,s6=t,|s−t|≤e−2 R d(s,t) √ 0  log N (T,d,x) dx # we see   2 |Bs − Bt | ≤ 2e−(u (log 2)/8) . > (M + u)  s,t∈T,s6=t, wm (|s − t|)  Pr   sup |s−t|≤e−2 Since M is a fixed finite number, we can write M + u = (1 + ε)u with ε → 0 as u → ∞. Then    |Bs − Bt | 2 2 ≤ 2e−(u (log 2)/8(1+ε) ) . > u  s,t∈T,s6=t, wm (|s − t|)  Pr   sup |s−t|≤e−2 Thus provided u is larger than M , we have the result with the constant λ = (log 2)/32. Remark. We need to know how M grows with m in order to know when u is large enough for the lemma to apply. Observe that we can write M = E maxk Mk , where Mk = sup |Bs − Bt | R d(s,t) p log N (T, d, x) dx s,t∈Tk ,s6=t, 0 |s−t|≤e−2 , Tk = [ke−2 , (k + 2)e−2 ]. Since N (T, d, x) ≥ N (Tk , d, x), we see Mk ≤ Mk′ , where Mk′ = sup |Bs − Bt | R d(s,t) p log N (Tk , d, x) dx s,t∈Tk ,s6=t, 0 |s−t|≤e−2 . As with the whole process C we can apply [13] Theorem 2.1.20 to each Mk′ to see that Pr(|Mk′ − EMk′ | > v) ≤ 2e−v 2 /2σ 2 , with√ σ 2 = 4/ log 2 as before. That is, each Mk′ is (uncentred) subgaussian with parameter 12/ log 2 (see [13] Lemma 2.3.1). They all have the same constant (i.e. not depending on m) 32 expectation, we can bound their maximum, by standard results for subgaussian variables (e.g. see [13] Lemma 2.3.4): EM = E[M0′ + max{Mk′ − M0′ }] q ≤ EM0′ + 12 2 log N/ log 2, where N is the number of Mk′ over which p we take the maximum and scales linearly with m. It follows that M is of order bounded by log(m) as m → ∞. (n) (n) Proof of Lemma 21. Write Π′ = Π/Π(BKL ) for the renormalised restriction of Π to BKL . Then by Jensen’s inequality we have Z Θ (n) (n) (pb /p0 )(X (n) ) dΠ(b) Write Z = R (n) (n) (n) BKL ≥ (n) Π(BKL ) exp log(pb /p0 ) dΠ′ (b) = − (n) Z (n) BKL ! (n) (n) log(pb /p0 )(X (n) )) dΠ′ (b) (n) R (n) BKL . (n) log(p0 /pb ) dΠ′ (b). Applying Fubini’s The- orem and using the definition of BKL , we see that (n) (n) Eb0 Z ≥ − sup Eb0 log(p0 /pb ) ≥ −(n∆ + 1)ε2n . (n) b∈BKL Further, applying Jensen’s inequality and twice applying Fubini’s Theorem, we see Varb0 Z = Eb0 Z = Eb0 Z ≤ Eb0 = Z (n) (n) log(pb /p0 ) dΠ′ (b) (n) BKL h (n) (n) log(pb /p0 ) − (n) BKL Z (n) BKL (n) BKL  − Eb0 Z i (n) (n) Eb0 log(pb /p0 ) (n) (n) (n) !2 (n) 2 log(pb /p0 ) − Eb0 log(pb /p0 )  (n) (n)  ′ !2 dΠ (b) dΠ′ (b) Varb0 log(p0 /pb ) dΠ′ (b) ≤ (n∆ + 1)ε2n , (n) (n) where to obtain the last line we have used the bound on the variance of log(p0 /pb ) for (n) b ∈ BKL . Together, these bounds on the mean and variance of Z tell us that     Pb0 exp(Z) < exp(−2n∆ε2n ) ≤ Pb0 |Z − EZ| > (n∆ − 1)ε2n ≤ (n∆ + 1)ε2n , (n∆ − 1)2 ε4n where we have applied Chebyshev’s inequality to obtain the final inequality. The rightmost expression tends to zero since n∆ε2n → ∞ by assumption, and the result follows. Remark. The same is true, but with Pb0 (Acn ) tending to zero at a different rate, if we define An R 2 (n) (n) (n) instead by An = { Θ (pb /p0 dΠ(b) ≥ Π(BKL )e−Bn∆εn } for any B > 1. That is to say, the exact value 2 in the exponent is not important for the proof. Lemma 22. Let Q, P be mutually absolutely continuous probability measures and write f = Then for any measurable function g and any sub-σ-algebra G, we have EQ [g | G] = EP [f g | G] . EP [f | G] 33 dQ dP . Proof. This follows straightforwardly using the characterisation of conditional expectation in terms of expectations against G–measurable functions. Precisely, we recall that EP [c(X)v(X)] = EP [u(X)v(X)] (⋆) holds for any G-measurable function v if c(X) = EP [u(X) | G] a.s., and conversely if c(X) is G-measurable and (⋆) holds for any G-measurable v then c(X) is a version of the conditional expectation EP [u(X)]. For the converse statement it is in fact enough for (⋆) to hold for all indicator functions v = 1A , A ∈ G. Applying (⋆) repeatedly we find, for A ∈ G, EP [EQ [g | G]EP [f | G]1A ] = EP [f EQ [g | G]1A ] = EQ [EQ [g | G]1A ] = EQ [g1A ] = EP [f g1A ], so that, since also EQ [g | G]EP [f | G] is G-measurable, it is (a version of) EP [f g | G], as required. Lemma 23. Grant Assumptions 1 and 2 and let p̃, p̃0 be as in (13). Then there exists a constant κ = κ(I) > 0 such that for any u > 0 and any initial value x, (x) Pb0  log  p̃b 2 −1 −1 −1 ((Xt )t≤∆ ) > u ≤ 2e−κu ∆ (log(∆ )) p̃0 for all sufficiently large n. Proof. Applying Girsanov’s Theorem (Theorem 16) we have, for f = (b0 − b)/σ, (x) Pb0    p̃b (x) log (X) > u = Pb0 p̃0 (x) ≤ Pb0 Z ∆ 0 Z 1 −f (Xt ) dWt − 2 ∆ 0 Z ∆ 0  f (Xt )2 dt > u  −f (Xt ) dWt > u . Write Mt = 0t −f (Xs ) dWs . Then M is a martingale whose quadratic variation satisfies | hM it − hM is | ≤ A|t − s| for A = max(1, (2K0 /σL )2 ), since A uniformly upper bounds kf k2∞ for b ∈ Θ. We can thus apply Lemma 10 to find, provided n is large enough so that ∆ ≤ A−1 e−2 , R (x) Pb0  log   u  |Mt − Ms | p̃b (x) (X) > u ≤ Pb0 > sup p̃0 w1 (∆) s,t≤∆,s6=t w1 (|t − s|) ≤ 2 exp  −λu2  w12 (∆) , where λ is a constant depending only on I and we recall w1 (δ) = δ1/2 log(δ−1 )1/2 . The result follows, noting that the condition “u is large enough” of Lemma 10 can be replaced here by “u > 0, and n is large enough” because w1 (∆) → 0. Lemma 24. The variance of the log likelihood ratio tensorises in this model, up to a constant. Precisely we have (n) Varb0 log p0 (X (n) ) (n) pb (X (n) ) !  ≤ 3 Varb0 log π0 (X0 ) πb (X0 ) 34   + 3n Varb0 log p0 (X0 , X∆ ) . pb (X0 , X∆ )  Proof. We write log  p(n) (X (n) )  0 (n) pb (X (n) ) = U + V + W, where U = log π0 (X0 ) πb (X0 ) V = X log 1≤k≤n k odd p0 (X(k−1)∆ , Xk∆ ) pb (X(k−1)∆ , Xk∆ ) W = X log 1≤k≤n k even p0 (X(k−1)∆ , Xk∆ ) . pb (X(k−1)∆ , Xk∆ ) Note now that V and W are both sums are of independent terms since (Xk∆ )k≤n is a Markov chain. We thus have  Varb0 (V ) = #{1 ≤ k ≤ n : k odd} Varb0 log p0 (X0 , X∆ ) pb (X0 , X∆ )  and a corresponding result for W . Using Var(R + S + T ) = Var(R) + Var(S) + Var(T ) + 2 Cov(R, S) + 2 Cov(S, T ) + 2 Cov(T, R) and 2 Cov(R, S) ≤ Var(R) + Var(S), one derives the elementary inequality Var(U + V + W ) ≤ 3(Var(U ) + Var(V ) + Var(W )). The result follows. Appendix B Notation We collect most of the notation used in the course of this paper. X: A solution to dXt = b(Xt ) dt + σ(Xt ) dWt . Ẋ: The periodised diffusion Ẋ = X mod 1. b, σ: Drift function, diffusion coefficient(=volatility). µ = µb ; πb : Invariant distribution/density of Ẋ. (x) Pb : Law of X on C([0, ∞]) (on C([0, ∆]) in Section 5) for initial condition X0 = x. Eb ; Pb ; Varb : Expectation/probablity/variance according to the law of X started from µb . (x) (x) Wσ : Notation for Pb when b = 0. pb (t, x, y), ṗb (t, x, y): Transition densities of X, Ẋ (with respect to Lebesgue measure). (x) (x) p̃b : Density (with respect to Wσ ) of Pb Ib (x) = Rx 0 on C([0, ∆]). (2b/σ 2 (y)) dy. (n) X (n) = (X0 , . . . , Xn∆ ); x(n) = (x0 , . . . , xn∆ ); pb (x(n) ) = πb (x0 ) b0 : The true parameter generating the data. µ0 , π0 , p0 etc.: Shorthand for µb0 , πb0 , pb0 etc. σL > 0; 1 ≤ σU < ∞: A lower and upper bound for σ. L0 : A constant such that n∆2 log(1/∆) ≤ L0 for all n. 35 Qn i=1 pb (∆, x(i−1)∆ , xi∆ ). 1 ([0, 1]) : kf k ≤ K0 }. Θ = Θ(K0 ): The maximal paramater space: Θ = {f ∈ Cper 1 Cper Θs (A0 ) = {f ∈ Θ : kf kB s 2,∞ s a (periodic) Besov space. ≤ A0 }, for B2,∞ I = {K0 , σL , σU }. Sm : Wavelet approximation space of resolution m, generated by periodised Meyer wavelets: Sm = span{ψlk : −1 ≤ l ≤ m, 0 ≤ k < 2l }, where ψ−1,0 is used as notation for the constant function 1. Dm = dim(Sm ) = 2m + 1; πm =(L2 –)orthogonal projection onto Sm . wm (δ) = δ1/2 (log(δ−1 )1/2 + log(m)1/2 ) if m ≥ 1, wm := w1 if m < 1. 1A : Indicator of the set (or event) A. K(p, q): Kullback–Leibler divergence between densities p, q: K(p, q) = Ep [log(p/q)]. KL(b0 , b) = Eb0 log(p0 /p). (n) n (n)  (n) (n)  (n)  BKL (ε) = b ∈ Θ : K(p0 , pb ) ≤ (n∆ + 1)ε2 , Varb0 log p0 /pb o ≤ (n∆ + 1)ε2 . Bε = {b ∈ Θ : K(π0 , πb ) ≤ ε2 , Varb0 [log(π0 /πb )] ≤ ε2 , KL(b0 , b) ≤ ∆ε2 , Varb0 [log(p0 /pb )] ≤ ∆ε2 }. Π: The prior distribution. Π(· | X (n) ): The posterior distribution given data X (n) . h·, ·i: the L2 ([0, 1]) inner product, hf, gi = k·k2 : The L2 ([0, 1])–norm, kf k22 = k·kµ : The L2 (µ)–norm, kf k2µ = R1 0 R1 0 R1 0 f (x)g(x) dx. f (x)2 dx. f (x)2 µ(dx) = R1 0 f (x)2 πb (x) dx. k·k∞ : The L∞ – (supremum) norm,3 kf k∞ = supx∈[0,1] |f (x)|. 1 = kf k∞ + kf ′ k∞ . kkCper 1 : The Cper –norm, kf kC 1 per k·kn : The empirical L2 –norm kf k2n = Pn 2 k=1 f (Xk∆ ) . References [1] Y. Baraud. “A Bernstein-type inequality for suprema of random processes with applications to model selection in non-Gaussian regression”. In: Bernoulli 16.4 (2010), pp. 1064– 1085. doi: 10.3150/09-BEJ245. url: http://projecteuclid.org/euclid.bj/1290092896. [2] R. F. Bass. Stochastic Processes. 1st ed. Cambridge University Press, 2011. [3] R. Bhattacharya, M. Denker, and A. Goswami. “Speed of convergence to equilibrium and to normality for diffusions with multiple periodic scales”. In: Stochastic Processes and their Applications 80.1 (1999), pp. 55–86. doi: 10.1016/S0304-4149(98)00069-6. url: http://www.sciencedirect.com/science/article/pii/S0304414998000696. 3 All functions we use will be continuous hence we can take the supremum rather than needing the essential supremum. 36 [4] L. Birgé and P. Massart. “Minimum contrast estimators on sieves: exponential bounds and rates of convergence”. In: Bernoulli 4.3 (1998), pp. 329–375. url: https://projecteuclid.org:443/eucl [5] I. Castillo and R. Nickl. “Nonparametric Bernstein–von Mises theorems in Gaussian white noise”. In: The Annals of Statistics 41.4 (2013), pp. 1999–2028. doi: 10.1214/13-AOS1133. url: https://doi.org/10.1214/13-AOS1133. [6] I. Castillo and R. Nickl. “On the Bernstein–von Mises phenomenon for nonparametric Bayes procedures”. In: The Annals of Statistics 42.5 (2014), pp. 1941–1969. doi: 10.1214/14-AOS1246. url: https://doi.org/10.1214/14-AOS1246. [7] J. Chorowski. “Statistics for diffusion processes with low and high-frequency observations”. PhD thesis. Humboldt-Universität zu Berlin, Mathematisch-Naturwissenschaftliche Fakultät, 2016. doi: http://dx.doi.org/10.18452/17652. [8] F. Comte, V. Genon-Catalot, and Y. Rozenholc. “Penalized nonparametric mean square estimation of the coefficients of diffusion processes”. In: Bernoulli 13.2 (2007), pp. 514–543. doi: 10.3150/07-BEJ5173. url: http://projecteuclid.org/euclid.bj/1179498759. [9] A. Dalalyan. “Sharp adaptive estimation of the drift function for ergodic diffusions”. In: Ann. Statist. 33.6 (2005), pp. 2507–2528. doi: 10.1214/009053605000000615. url: https://doi.org/10.1214/009053605000000615. [10] S. Ghosal, J. K. Ghosh, and A. W. van der Vaart. “Convergence rates of posterior distributions”. In: The Annals of Statistics 28.2 (2000), pp. 500–531. doi: 10.1214/aos/1016218228. url: http://projecteuclid.org/euclid.aos/1016218228. [11] S. Ghosal and A. W. van der Vaart. Fundamentals of nonparametric Bayesian inference. Cambridge University Press, 2017. [12] S. Ghosal and A. van der Vaart. “Convergence rates of posterior distributions for noniid observations”. In: The Annals of Statistics 35.1 (2007), pp. 192–223. doi: 10.1214/009053606000001172. url: https://doi.org/10.1214/009053606000001172. [13] E. Giné and R. Nickl. Mathematical Foundations of Infinite-Dimensional Statistical Models. Cambridge University Press, 2016. doi: 10.1017/CBO9781107337862. url: http://ebooks.cambridg [14] E. Giné and R. Nickl. “Rates of contraction for posterior distributions”. In: The Annals of Statistics 39.6 (2011), pp. 2883–2911. doi: 10.1214/11-AOS924. url: http://projecteuclid.org/eucli [15] E. Gobet, M. Hoffmann, and M. Reiß. “Nonparametric estimation of scalar diffusions based on low frequency data”. In: The Annals of Statistics 32.5 (2004), pp. 2223–2253. doi: 10.1214/009053604000000797. url: http://dx.doi.org/10.1214/009053604000000797. [16] S. Gugushvili and P. Spreij. “Nonparametric Bayesian drift estimation for multidimensional stochastic differential equations”. In: Lithuanian Mathematical Journal 54.2 (2014), pp. 127–141. doi: 10.1007/s10986-014-9232-1. url: https://doi.org/10.1007/s10986-014-9232-1. [17] M. Hoffmann. “Adaptive estimation in diffusion processes”. In: Stochastic Processes and their Applications 79.1 (1999), pp. 135–163. doi: 10.1016/S0304-4149(98)00074-X. url: http://linkinghub.elsevier.com/retrieve/pii/S030441499800074X. [18] Y. A. Kutoyants. Statistical Inference for Ergodic Diffusion Processes. Springer London, 2004. doi: 10.1007/978-1-4471-3866-2. [19] R. S. Liptser and A. N. Shiryaev. Statistics of Random Processes : I. General Theory. 1st ed. Springer Berlin Heidelberg, 1977, p. 395. [20] F. van der Meulen, M. Schauer, and J. van Waaij. “Adaptive nonparametric drift estimation for diffusion processes using Faber–Schauder expansions”. In: Statistical Inference for Stochastic Processes (2017). doi: 10.1007/s11203-017-9163-7. url: https://doi.org/10.1007/s1120 37 [21] F. van der Meulen and H. van Zanten. “Consistent nonparametric Bayesian inference for discretely observed scalar diffusions”. In: Bernoulli 19.1 (2013), pp. 44–63. doi: 10.3150/11-BEJ385. [22] R. Nickl. Bernstein - von Mises theorems for statistical inverse problems I: Schrödinger equation. 2017. url: https://arxiv.org/abs/1707.01764. [23] R. Nickl and J. Söhl. “Nonparametric Bayesian posterior contraction rates for discretely observed scalar diffusions”. In: The Annals of Statistics 45.4 (2017), pp. 1664–1693. doi: 10.1214/16-AOS1504. url: https://doi.org/10.1214/16-AOS1504. [24] O. Papaspiliopoulos et al. “Nonparametric estimation of diffusions: a differential equations approach”. In: Biometrika 99.3 (2012), pp. 511–531. doi: 10.1093/biomet/ass034. url: http://dx.doi.org/10.1093/biomet/ass034. [25] D. Paulin. “Concentration inequalities for Markov chains by Marton couplings and spectral methods”. In: Electronic Journal of Probability 20 (2015), 32 pp. doi: 10.1214/EJP.v20-4039. url: https://doi.org/10.1214/EJP.v20-4039. [26] Y Pokern, A. M. Stuart, and J. H. van Zanten. “Posterior consistency via precision operators for Bayesian nonparametric drift estimation in SDEs”. In: Stochastic Processes and their Applications 123.2 (2013), pp. 603–628. doi: https://doi.org/10.1016/j.spa.2012.08.010. url: http://www.sciencedirect.com/science/article/pii/S0304414912001779. [27] K. Ray. “Bayesian inverse problems with non-conjugate priors”. In: Electronic Journal of Statistics 7.1 (2013), pp. 2516–2549. doi: 10.1214/13-EJS851. [28] L. Rogers and D. Williams. Diffusions, Markov processes and martingales. Vol.2, Ito calculus. 2nd ed. Cambridge University Press, 2000. [29] J. Söhl and M. Trabs. “Adaptive confidence bands for Markov chains and diffusions: Estimating the invariant measure and the drift”. In: ESAIM: Probability and Statistics 20 (2016), pp. 432–462. doi: 10.1051/ps/2016017. url: https://doi.org/10.1051/ps/2016017. [30] J. van Waaij and H. van Zanten. “Gaussian process methods for one-dimensional diffusions: Optimal rates and adaptation”. In: Electronic Journal of Statistics 10.1 (2016), pp. 628– 645. doi: 10.1214/16-EJS1117. url: https://doi.org/10.1214/16-EJS1117. 38
10math.ST
Stick-Breaking Policy Learning in Dec-POMDPs Miao Liu1 , Christopher Amato2 , Xuejun Liao3 , Lawrence Carin3 , and Jonathan P. How4 arXiv:1505.00274v2 [cs.AI] 23 Nov 2015 1 Laboratory for Information and Decision Systems , MIT, Cambridge, MA 02139, USA, [email protected] 2 Department of Computer Science , University of New Hampshire, Durham, NH 03824, USA , [email protected] 3 Department of Electrical & Computer Engineering , Duke University, Durham NC 27708, USA , {xjliao,lcarin}@duke.edu 4 Department of Aeronautics & Astronautics , MIT, Cambridge, MA 02139, USA , [email protected] Abstract Expectation maximization (EM) has recently been shown to be an efficient algorithm for learning finite-state controllers (FSCs) in large decentralized POMDPs (Dec-POMDPs). However, current methods use fixed-size FSCs and often converge to maxima that are far from optimal. This paper considers a variable-size FSC to represent the local policy of each agent. These variable-size FSCs are constructed using a stick-breaking prior, leading to a new framework called decentralized stick-breaking policy representation (Dec-SBPR). This approach learns the controller parameters with a variational Bayesian algorithm without having to assume that the Dec-POMDP model is available. The performance of Dec-SBPR is demonstrated on several benchmark problems, showing that the algorithm scales to large problems while outperforming other state-of-the-art methods. 1 Introduction Decentralized partially observable Markov decision processes (Dec-POMDPs) [3, 25] provide a general framework for solving the cooperative multiagent sequential decision-making problems that arise in numerous applications, including robotic soccer [24], transportation [4], extraplanetary exploration [8], and traffic control [35]. Dec-POMDPs can be viewed as a POMDP controlled by multiple distributed agents. These agents make decisions based on their own local streams of information (i.e., observations), and their joint actions control the global state dynamics and the expected reward of the team. Because of the decentralized decision-making, an individual agent generally does not have enough information to compute the global belief state, which is a 1 sufficient statistic for decision making in POMDPs. This makes generating an optimal solution in a Dec-POMDP more difficult than for a POMDP [10], especially for long planning horizons. To circumvent the difficulty of solving long-horizon Dec-POMDPs optimally, while still generating a high quality policy, this paper presents scalable learning methods using a finite memory policy representation. For infinite-horizon problems (which continue for an infinite number of steps), significant progress has been made with agent policies represented as finite-state controllers (FSCs) that map observation histories to actions [9, 2]. Recent work has shown that expectation-maximization (EM) [14] is a scalable method for generating controllers for large Dec-POMDPs [19, 27]. In addition, EM has also been shown to be an efficient algorithm for policy-based reinforcement learning (RL) in Dec-POMDPs, where agents learn FSCs based on trajectories, without knowing or learning the Dec-POMDP model [35]. An important and yet unanswered question is how to define an appropriate number of nodes in each FSC. Previous work assumes a fixed FSC size for each agent, but the number of nodes affects both the quality of the policies and the convergence rate. When the number of nodes is too small, the FSC is unable to represent the optimal policy and therefore will quickly converge to a sub-optimal result. By contrast, when the number is too large, the FSC overfits data, often yielding slow convergence and, again, a sub-optimal policy. This paper uses a Bayesian nonparametric approach to determine the appropriate controller size in a variable-size FSC. Following previous methods [35, 25], learning is assumed to be centralized, and execution is decentralized. That is, learning is accomplished offline based on all available information, but the optimization is only over decentralized solutions. Such a controller is constructed using the stick-breaking (SB) prior [18]. The SB prior allows the number of nodes to be variable, but the set of nodes that is actively used by the controller is encouraged to be compact. The nodes that are actually used are determined by the posterior, combining the SB prior and the information from trajectory data. The framework is called the decentralized stick-breaking policy representation (Dec-SBPR) to recognize the role of the SB prior. In addition to the use of variable-size FSCs, the paper also makes several other contributions. Specifically, our algorithm directly operates on the (shifted) empirical value function of DecPOMDPs, which is simpler than the likelihood functions (a mixture of dynamic Bayes nets (DBNs)) in existing planning-as-inference frameworks [19, 35]. Moreover, we derive a variational Bayesian (VB) algorithm for learning the Dec-SBPR based only on the agents’ trajectories (or episodes) of actions, observations, and rewards. The VB algorithm is linear in the number of agents and at most square in the problem size, and is therefore scalable to large application domains. In practice, these trajectories can be generated by a simulator or a set of real-world experiences that are provided, and this batch data scenario is general and realistic, as it is widely adopted in learning from demonstration [23], and reinforcement learning. To the best of our knowledge, this is the first application of Bayesian nonparametric methods to the difficult and little-studied problem of policy-based RL in Dec-POMDPs, and the proposed method is able to generate high-quality solutions for large problems. 2 Background and Related Work Before introducing the proposed method, we first describe the Dec-POMDP model and some related work. 2 2.1 Decentralized POMDPs A Dec-POMDP can be represented as a tuple M = hN , A, S, O, T , Ω, R, γi, where N = {1, · · · , N } is a finite set of agent indices; A = ⊗n An and O = ⊗n On respectively are sets of joint actions and observations, with An and On available to agent n. At each step, a joint action ~a = (a1 , · · · , aN ) ∈ A is selected and a joint observation ~o = (o1 , · · · , oN ) is received; S is a set of finite world states; T : S × A × S → [0, 1] is the state transition function with T (s0 |s, ~a) denoting the probability of transitioning to s0 after taking joint action ~a in s; Ω : S × A × O → [0, 1] is the observation function with Ω(~o|s0 , ~a) the probability of observing ~o after taking joint action ~a and arriving in state s0 ; R : S × A → R is the reward function with r(s, ~a) the immediate reward received after taking joint action ~a in s; γ ∈ [0, 1) is a discount factor. A global reward signal is generated for the team of agents after joint actions are taken, but each agent only observes its local observation. Because each agent lacks access to other agents’ observations, each agent maintains a local policy πn , defined as a mapping from local observation histories to actions. A joint policy consists of the local policies of all agents. For an infinite-horizon Dec-POMDP with initial belief state b0 , the objective find a joint policy Ψ = ⊗n Ψn , such that the value of Ψ starting from b0 ,  P∞ is to  Ψ t V (b(s0 )) = E at )|b0 , Ψ , is maximized. t=0 γ r(st , ~ An FSC is a compact way to represent a policy as a mapping from histories to actions. Formally, a stochastic FSC for agent n is defined as a tuple Θn = hAn , On , Zn , µn , Wn , πn i, where, An and On are the same as defined in the Dec-POMDP; Zn is a finite set of controller nodes for agent n; µn is the initial node distribution with µzn the probability of agent n initially being in z; Wn is a set z,z 0 of Markov transition matrices with Wn,a,o denoting the probability of the controller node transiting from z to z 0 when agent n takes action a in z and sees observation o; πn is a set of stochastic policies a with πn,z the probability of agent n taking action a in z. For simplicity, we use the following notational conventions. Zn = {1, 2, · · · , Cn }, where def. Cn = |Zn | is the cardinality of Zn , and An and On follow similarly. Θ = {Θ1 , · · · , ΘN } is the joint FSC of all agents. A consecutively-indexed variable is abbreviated as the variable with the index range shown in the subscript or superscript; when the index range is obvious from the context, a simple “:” is used instead. Thus, an,0:T = (an,0 , an,1 , . . . , an,T ) represents the actions of z,|Z | z,: z,1 z,2 agent n from step 0 to T and Wn,a,o = (Wn,a,o , Wn,a,o , · · · , Wn,a,on ) represents the node transition probabilities for agent n when starting in node z, taking action a and seeing observation o. Given hn,t = {an,0:t−1 , on,1:t }, a local history of actions and observations up to step t, as well as an agent controller, Θn , we can calculate a local policy p(an,t |hn,t ,Θn ), the probability that agent n chooses its action an,t . 2.2 Planning as Inference in Dec-POMDPs A Dec-POMDP planning problem can be transformed into an inference problem and then efficiently solved by EM algorithms. The validity of this method is based on the fact that by introducing binary rewards R such that P (R = 1|a, s) ∝ r(a, s), ∀a ∈ A, s ∈ S and choosing P∞the geometric time prior T p(T ) = γ (1−γ), maximizing the likelihood L(Θ) = P (R = 1; Θ) = T =0 P (T )P (R = 1|T ; Θ) of a mixture of dynamic Bayes nets is equivalent to optimizing the associated Dec-POMDP policy, 3 as the joint-policy value V (Θ) and L(Θ) can be related through an affine transform [19] P (1 − γ)(V (Θ)− T γ T Rmin ) (1 − γ)V̂ (Θ) L(Θ) = = , (1) Rmax − Rmin Rmax − Rmin P def. where Rmax and Rmin are maximum and minimum reward values and V̂ (Θ) =V (Θ)− T γ TRmin is a shifted value. Previous EM methods [19, 27] have achieved success in scaling to larger problems by factoring the distribution over states and histories for inference, but these methods require using a DecPOMDP model to construct a Bayes net for policy evaluation. When the exact model parameters T , Ω and R are unknown, one needs to solve a reinforcement learning (RL) problem. To address this important yet less addressed problem, a global empirical value function extended from the single-agent case [20], is constructed based on all the action, observation and reward trajectories, and the product of local policies of all agents. This serves as the basis for learning (fixed-size) FSCs in RL settings. Definition 1. (Global empirical value function) Let D(K) = {(~o0k~a0k r0k~o1k~a1k r1k · · · ~oTkk~aTkk rTkk )}k=1,··· ,K be a set of episodes resulting from N agents who choose actions according to Ψ = ⊗n Ψn , a set of stochastic behavior policies with pΨn (a|h) > 0, ∀ action a, ∀ history h. The global empirical Qt QN  P P t (r k −R def. p(akn,τ |hkn,τ ,Θn ) γ ) K T min k t Qτt=0 Qn=1 value function is defined as V̂ D(K) ; Θ = k=1 t=0 where N K pΨn (ak |hk ) τ =0 n=1 n,τ n,τ k hn,t = (akn,0:t−1 , okn,1:t ), 0 ≤ γ < 1 is the discount.  According to the strong law of large numbers [32], V̂ (Θ) = limK→∞ V̂ D(K) ; Θ , i.e., with a  large number of trajectories, the empirical value function V̂ D(K) ; Θ approximates V̂ (Θ) accu rately. Hence, applying (1), V̂ D(K) ; Θ approximates L(Θ), and offers an objective for learning the decentralized policies and can be directly maximized by the EM algorithms in [20]. 3 Bayesian Learning of Policies EM algorithms infer policies based on fixed-size representation and observed data only, it is difficult to explicitly handle model uncertainty and encode prior (or expert) knowledge. To address these issues, a Bayesian learning method is proposed in this section. This is accomplished by measuring the likelihood of Θ using L D(K) ; Θ , which is combined with the prior p(Θ) in Bayes’ rule to yield the posterior   −1 p(Θ|D(K) ) = L D(K) ; Θ p(Θ) p D(K) , (2)  where p D(K) is the marginal likelihood of the joint FSC and, up to additive constant, proportional to the marginal value function, Z   (K) def. V̂ D = V̂ D(K) ; Θ p(Θ)dΘ   R ∝ L D(K) ; Θ p(Θ)dΘ = p D(K) . (3) To compute the posterior, p(Θ|D(K) ), Markov chain Monte Carlo (MCMC) simulation [32] is the most straight forward method. However, MCMC is costly in terms of computation and storage, and 4 lacks a strong convergence guarantee. An alternative is a variational Bayes (VB) method [7], which performs approximate posterior inference by minimizing the Kullback-Leibler (KL) divergence between the true and approximate posterior distributions. Because the VB method has a (local) convergence guarantee and is able to trade-off scalability and accuracy, we focus on the derivation k of VB method here. Denoting q(Θ) as the variational approximation to p(Θ|D(K) ), and qtk (~z0:t ) as k k 1 the approximation to p(~z0:t |~o1:t , Θ), a VB objective function is KL  k qtk (~z0:t )q(Θ)  k k || νt p(~z0:t , Θ) k=1:K  k=1:K    k = lnV̂ D(K) − LB qtk (~z0:t ) , q(Θ) , (4) where LB  k qtk (~z0:t )  def. , q(Θ) = X Z k k,t,z1:N,0:t k qtk (~z0:t ) ν k p(~zk , Θ|hk0:t ) dΘ ln t k 0:tk K/q(Θ) qt (~z0:t )q(Θ) (5)  is the lower bound of lnV̂ D(K) and def. νtk = QN γ t rtk Qt n=1 QN τ =0 p(akn,0:t |okn,1:t ) , ∀ t, k, pΨn (ak |hk )Vb (D(K) ) n=1 n,τ (6) n,τ  k is the re-weighted reward. Since lnV̂ D(K) in equation (4) is independent of Θ and {qtk (~z0:t )}, minimizing the KL divergence is equivalent to maximizing the lower bound, leading to the following constrained optimization problem,   k max k k  LB qtk (~z0:t ) , q(Θ) qt ~ z0:t q(Θ) Q k k k k subject to: qt (~z0:t , Θ) = N n=1 qt (zn,0:t )q(Θn ), |Z| Tk K X X X k k qtk (~z0:t ) = K, qtk (~z0:t ) ≥ 0, ∀~ztk , t, k, k=1 t=0 z k 1:N,0:t =1 R p(Θ)dΘ = 1 and p(Θ) ≥ 0, ∀Θ, (7) where the constraint in the second line arises both from the mean-field approximation and from the decentralized policy representation, and the last two lines summarize the normalization constraints. It is worth emphasizing that we developed this variational mean-field approximation to optimize a decentralized policy representation, showing that the VB learning problem formulation (7) is both a general and accurate method for the multiagent problem considered in this paper. 3.1 Stick-breaking Policy Priors To solve the Bayesian learning problem described above and obtain the variable-size FSCs, the stick-breaking prior is used to specify the policy’s structure. As such, Dec-SBPR is formally given in definition 2. 1 Refer to the appendix for derivation details 5 Definition 2. The decentralized stick breaking policy representation (Dec-SBPR) is a tuple (N , A, O, Z, µ, η, ρ), where N , A and O are as in the definition of Dec-POMDP; Z is an unbounded set of nodes indexed by positive integers; for notational simplicity2 ,µ are assumed to be deterministic with µ1n = 1, µ2:∞ = 0, ∀n; (η, ρ) determine (W, π), the FSC parameters defined in section 2.1, as n follows 1:|An | i,1:∞ i,1:∞ i,1:∞ Wn,a,o ∼SB(σn,a,o , ηn,a,o ), πn,i 1:|An | ∼ Dir(ρn,i ) (8) where Dir represents distribution and SB represents the stick-breaking process with Qj−1 Dirichlet i,j i,j i,m i,j i,j i,j i,j Wn,a,o = Vn,a,o m=1 (1 − Vn,a,o ) and Vn,a,o ∼ Beta(σn,a,o , ηn,a,o ), ηn,a,o ∼ Gamma(c, d), n = 1, · · · , N and i, j = 1, · · · , ∞. DECSBPR differs from previous nonparametric Bayesian RL methods [21, 16]. Specifically, Dec-SBPR performs policy-based RL and generalizes the nonparametric Bayesian policy representation of POMDPs [21] to the decentralized domain. Whereas [16] is a model-based RL method that doesn’t assume knowledge about the world’s model, but explicitly learns it and then performs planning. Moreover, Dec-SBPR further distinguishes from previous methods [16, 21] by the prior distributions and inference methods employed. These previous methods employed hierarchical Dirichlet processes hidden Markov models (HDP-HMM) to infer the number of controller nodes. However, due to the lack of conjugacy between two levels of DPs in the HDP-HMM, a fully conjugate Bayesian variational inference does not exist3 . Therefore, these methods used MCMC which requires high computational and storage costs, making them not ideal for solving large problems. In contrast, Dec-SBPR employs single layer SB priors over FSC transition matrices W and sparse Gamma priors over SB weight hyperparameters η to bias transition among nodes with smaller indices. A similar framework has been explored to infer HMMs, and we refer readers to [26] for more details. It is worth noting that SB processes subsume Dirichlet Processes (DPs) [17] as a special case, i,j when σn,a,o = 1, ∀i, j, n, a, o (in Dec-SBPR). The purpose of using SB priors is to encourage a small number of FSC nodes. Compared to a DP, the SB priors can represent richer patterns of sparse transition between the nodes of an FSC, because it allows arbitrary correlation between the stick-breaking weights (the weights are always negatively correlated in a DP). 3.2 Variational Stick-breaking Policy Inference It is shown in [18] that the random weights constructed by the SB prior are equivalently governed by a generalized Dirichlet distribution (GDD) and are therefore conjugate to the multinomial distribution; hence an efficient variational Bayesian algorithm for learning the decentralized policies can be derived. To accommodate an unbounded number of nodes, we apply the retrospective representation of SB priors [28] to the Dec-SBPR. For agent n, the SB prior is set with a truncation level |Zn |, taking into account the current occupancy as well as additional nodes reserved for future new occupancies. The solution to (7) under the stick-breaking priors is given in Theorem 3, the proof of which is provided in the appendix. 2 3 Nonparametric priors over µ can also be used. The VB method in [12] imposes point-mass proposals over top level DPs, lacking a uncertainty measure. 6 Algorithm 1: Batch VB Inference for Dec-SBPR 1: Input: Episodes D(K) , the number of agents N , initial policies Θ, VB lower bound LB0 = −Inf, ∆LB = 1, Iter = 0; 2: while ∆LB > 10−3 do 3: for k = 1 to K, n = 1 to N do 4: Update the global rewards {ν̂tk } using (9). n,k 5: Compute {ατn,k } and {βt,τ }. 6: end for 7: Iter = Iter + 1. 8: Compute LBIter using (5) 9: ∆LB = (LBIter − LBIter−1 )/|LBIter−1 | 10: for n = 1 to N do n,k 11: Compute {ξt,τ (i, j)} and {φn,k t,τ (i)} using (11). 12: Update the hyper-parameters of Θn using (10). 13: Compute |Zn | using (13). 14: end for 15: end while N 16: Return: Policies {Θn }N n=1 , and controller sizes {|Zn |}n=1 . Theorem 3. Let p(Θ) be constructed by the SB priors defined in (8) with hyper-parameters (σ̂, η̂, ρ̂), then iterative application of the following updates leads to monotonic increase of (5), until convergence to a maxima. The updates of {qtk } are k k e n ), ∀ n, t, k, qtk (zn,0:t ) = ν̂tk p(zn,0:t |okn,1:t , akn,0:t , Θ (9) e = {e f }, a set of under-normalized where ν̂tk is computed using (6) with Θ replaced by Θ π, µ e, W i,j a ip(W |σ̂,η̂) a f i,j = ehln Wn,a,o probability (mass) functions , with π en,i = ehln πn,i ip(π|ρ̂) , and W , and h·ip n,a,o denotes expectations of · with respect to distributions p. The hyper-parameters of the posterior distribution are updated as i,j σ̂n,a,o = i,j σn,a,o + i,j ζn,a,o , i,j η̂n,a,o = i,j ηn,a,o + |Zn | X i,l ζn,a,o , l=j+1 ρ̂an,i = ρan,i + Tk X K X t X k=1 t=0 τ =1 ν̂tk n,k φt,τ −1 (i)Ia (aτk ) K (10) P PTk Pt ν̂tk n,k i,j k k with ζn,a,o = K k=1 t=0 τ =1 K ξt,τ −1 (i, j)Ia,o (aτ −1 , oτ ), where I(·) is the indicator function, and n,k k k both ξt,τ and φn,k t,τ are marginals of qt (zn,0:t ), i.e. n,k k k k k e ξt,τ (i, j) = p(zn,τ = i, zn,τ +1 = j|an,0:t , on,1:t , Θn ) k k k e φn,k t,τ (i) = p(zn,τ = i|an,0:t , on,1:t , Θn ) (11) (12) The update equations in Theorem 3 constitute the VB algorithm for learning a variable-size joint FSCs under SB priors with batch data. In particular, (9) is a policy-evaluation step where the rewards are reweighted to reflect the improved marginal value of the new policy posterior updated in the previous iteration, and (10) is a policy-improvement step where the reweighted rewards are 7 used to further improve the policy posterior. Both steps require (11), which are computed based on k =i,o k  e p(a k +1:t |zn,τ n,k n,τ +1:t ,Θn ) k k k e n and βt,τ Qt ατn,k (i)=p zn,τ =i|an,0:τ , on,1:τ ,Θ (i)= n,τ , ∀ n, k, t, τ . The (α, β) k τ 0 =τ e n) p(aτk |hn,τ 0 ,Θ are forward-backward messages. Their updating equations are derived in the appendix. To determine the number of controller nodes {|Zn |}N n=1 , the occupancy of a node is computed by checking if there is a positive reward assigned to it. For example, for action a and node i, ρ̂an,i − ρan,i is the reward being assigned. If this quantity is greater than zero, then node i is visited. Summing over all actions gives the value of node i. Hence |Zn | can be computed based on the following formula  P P|An | a a |Zn | = ∞ I (ρ̂ − ρ ) > 0 . (13) n,i n,i i=1 a=1 The complete algorithm is described in Algorithm 1. Upon the convergence of Algorithm 1, point estimates of the decentralized policies may be obtained by calculating the expectation: E[µ̂in ], a i,j E[π̂n,i ], and E[Ŵn,a,o ] (see the appendix for details). Table 1: Computational Complexity of Algorithm 1. 3.3 VAR BEST CASE WORST CASE α β νtk Θ LB Ω(N |Z|2 KT ) Ω(N |Z|2 KT ) Ω(K) Ω(N |Z|2 KT ) P Ω(|Z|2 N n=1 |An ||On |) O(N |Z|2 KT ) O(N |Z|2 KT 2 ) O(KT ) O(N |Z|2 KT 2 ) P O(|Z|2 N n=1 |An ||On |) Computational complexity The time complexity of Algorithm 1 for each iteration is summarized in Table 1, assuming the length of an episode is on the order of magnitude of T , and the number of nodes per controller is on the order of magnitude of |Z|. In Table 1, the worst case refers to when there is a nonzero reward at every time step of an episode (dense rewards), while the best case is when nonzero reward is received only at the terminal step. Hence in general, the algorithm scales linearly with the number of episodes and the number of agents. The time dependency on T is between linear and quadratic. In any case, the computational complexity of Algorithm 1 is independent of the number of states, making it is scalable to large problems. 3.4 Exploration and Exploitation Tradeoff Algorithm 1 assumes off-policy batch learning where trajectories are collected using a separate behavior policy. This is appropriate when data has been generated from real-world or simulated experiences without any input from the learning algorithm (e.g., learning from demonstration). Off-policy learning is efficient if the behavior policy is close to optimal, as in the case when expert information is available to guide the agents. With a random behavior policy, it may take a long time 8 for the policy to converge to optimality; in this case, the agents may want to exploit the policies learned so far to speed up the learning process. An important issue concerns keeping a proper balance between exploration and exploitation to prevent premature convergence to a suboptimal policy, but allow the algorithm to learn quickly. Since the execution of Dec-POMDP policies is decentralized, it is difficult to design an efficient exploration strategy that guarantees optimality. [35] count the visiting frequency of FSC nodes and apply upper-confidence-bound style heuristic to select next controller nodes, and use -greedy strategy to select actions. However -greedy might be sample inefficient. [6] proposed a distributed learning approach where agents take turns to learn the best response to each other’s policies. This framework applies an R-max type of heuristic, using the counts of trajectories to distinguish known and unknown histories, to tradeoff exploration and exploitation. However, this method is confined to tree-based policies in finite-horizon problems, and requires synchronized multi-agent learning. To better accommodate our Bayesian policy learning framework for RL in infinite-horizon Dec-POMDPs, we define an auxiliary FSC, Ωn = hY, On , Zn , Wn , µn , ϕn i, to represent the policy of each agent in balancing exploration and exploitation. To avoid confusion, we refer to Θn as a primary FSC. The only two components distinguishing Ψn from Θn are Y and ϕn , where Y = {0, 1} n,z encodes exploration (y = 1) or exploitation (y = 0), and ϕn = {ϕn,z y } with ϕy denoting the probability of agent n choosing y in z. One can express p(yn,t |hn,t , Ψn ) in the same way as one expresses p(an,t |hn,t , Θn ) (which is described in section 2.1). The behavior policy Πn of agent n is given as X pΠn (a|h, Θn , Ωn ) = p(a|y, h)p(y|h, Ωn ), (14) y=0,1 where p(a|y = 0, h) ≡ p(a|h, Θn ) is the primary FSC policy, and p(a|y = 1, h) is the exploration policy of agent n, which is usually a uniform distribution. The behavior policy in (14) has achieved significant success in the single-agent case [13, 21, 22]. Here we extend it to the multi-agent case (centralized learning and decentralized exploration/execution) and provide empirical evaluation in the next section. 4 Experiments The performance of the proposed algorithms are evaluated on five benchmark problems [1] and a large-scale problem (traffic control) [35]. The experimental procedure in [35] was used for all the results reported here. For Dec-SBPR, the hyperparameters in (8) are set to c = 0.1 and d = 10−6 to promote sparse usage of FSC nodes.4 The policies are initialized as FSCs converted from the episodes with the highest rewards using a method similar to [5]. Learning variable-size FSC vs learning fixed-size FSC To demonstrate the advantage of learning variable-size FSCs, Dec-SBPR is compared with an implementation of the previous EM algorithm [35]. The comparison is for the Mars Rover problem using K = 300 episodes 5 to learn the FSCs and evaluating the policy by the discounted accumulated reward averaged over 100 test episodes of 1000 steps. Here, we consider off-policy learning and apply a semi-random policy to 4 5 These values were chosen for testing, but our approach is robust to other values of c and d. Using smaller training sample size K, our method can still perform robustly, as it is shown in the appendix. 9 Mars Rover (|S|=256,|A|=6,|O|=8) 25 20 Mars Rover (|S|=256,|A|=6,|O|=8) EM SB DP CPU Time (sec) 15 Policy Value 4 10 EM (max) EM (mean) SB DP 10 5 3 10 2 10 0 −5 −10 1 1 10 2 10 Number of Nodes 1 10 10 Number of Nodes 2 10 Figure 1: Comparison between the variable-size controller learned by Dec-SBPR and fixed-size controllers learned by EM. Left: testing value; Right: averaged computation time. Although EM has less computational complexity than our VB algorithm per iteration, empirically, the VB algorithm uses less time to reach convergence. Moreover, the average value of using the SB prior and its special Dirichlet instance (DP) are close to the best result of EM (dotted sky-blue line), but are much better than the average results of EM (solid back line). Using the SB prior achieves slightly better performance than the DP, which can be explained the flexibility of SB prior, as explained by the last paragraph of section 3.1. Table 2: Performance of Dec-SBPR on benchmark problems compared to other state-of-art algorithms. Shows policy values (higher value indicates better performance) and CPU times of all algorithms, and the average controller size |Z| inferred by Dec-SBPR. POLICY LEARNING ( UNKNOWN MODEL ) P ROBLEMS (|S|, |A|, |O|) D EC -T IGER (2, 3, 3) B ROADCAST (4, 2, 5) R ECYCLING ROBOTS (3, 3, 2) B OX P USHING (100, 4, 5) M ARS ROVERS (256, 6, 8) D EC -SBPR( FIXED ITERATION ) VALUE |Z| T IME -18.63 6 96 S 9.20 2 7S 31.26 3 147 S 77.65 14 290 S 20.62 5 1286 S D EC -SBPR( FIXED TIME ) VALUE |Z| T IME -19.42 9.27 25.16 58.27 15.2 8 2 2 9 6 20 S 24 S 19 S 32 S 160 S PLANNING ( KNOWN MODEL ) MCEM VALUE |Z| T IME -32.31 9.15 30.78 59.95 8.16 3 3 3 3 3 20 S 24 S 19 S 32 S 160 S P ERI EM VALUE |Z| T IME 9.42 31.80 106.68 18.13 7 × 10 – 6 × 10 4 × 10 3 × 10 6540 S 272 S 7164 S 7132 S FB-HSVI VALUE |Z| T IME 13.45 9.27 31.93 224.43 26.94 52 102 108 331 136 6.0 S 19.8 S 0S 1715.1 S 74.31 S collect samples. Specifically, the learning agent is allowed access to episodes collected by taking actions according to a POMDP algorithm (point-based value iteration (PBVI) [29]). Let  be the probability that the agents follow the PBVI policy and 1 −  be the probability that the agents take random actions. This procedure mimics the approach used in previous work [35]. The results with η = 0.3 are reported in Figure 1, which shows the exact value and computation time as a function of the number of controller nodes |Z|. As expected, for the EM algorithm, when |Z| is too small, the FSCs cannot represent the optimal policy (under-fitting), and when the number of nodes is too large, FSCs overfits a limited amount of data and perform poorly. Even if |Z| is set to the number inferred by Dec-SBPR, EM can still suffer severely from initialization and local maxima issues, as can be seen from a large error-bar. By setting a high truncation level (|Z| = 50), Dec-SBPR employs Algorithm 1 to integrate out the uncertainty of the policy representation (under the SB prior). As a result, Dec-SBPR can infer both the number of nodes that is needed (≈ 5) and optimal controller parameters simultaneously. Furthermore, this inference is done with less computation time and with a higher value and improved robustness (low variance of test value) than EM. 10 5 150 4 |Z| Value 200 100 50 0 0 MCEM Dec−SBPR w/o heuristic Dec−SBPR w/ heuristic MCEM Dec−SBPR w/o heuri Dec−SBPR w/ heuri 3 2 1 0 20 40 Number of Iterations 10 20 30 40 50 Number of Iterations 20 (10 states and 100 agents). Figure 2: Performance comparison on traffic control problem and inferred controller size (right) of Dec-SBPR, as a function of algorithmic iteration. Test reward (left) Comparison with other methods The performance of Dec-SBPR is also compared to several state-of-art methods, including: Monte Carlo EM (MCEM) [35]. Similar to Dec-SBPR, MCEM is a policy-based RL approach. We apply the exploration-exploitation strategy described in section 3.4 and follow the same experimental procedure in [35] to report the results6 . The rewards after running a fixed number of iterations and a fixed amount of time are summarized (respectively) in Table 2 (the first column under policy-learning category). Dec-SBPR is shown to achieve better policy values than MCEM on all problems 7 . These results can be explained by the fact that EM is (more) sensitive to initialization and (more) prone to local optima. Moreover, by fixing the size of the controllers, the optimal policy from EM algorithms might be over/under fitted . By using a Bayesian nonparametric prior, Dec-SBPR learns the policy with variable-size controllers, allowing more flexibility for representing the optimal policy. We also show the result of Dec-SBPR running the same amount of clock time as MCEM (Dec-SBPR (fixed time)), which indicates Dec-SBPR can achieve a better trade-off between policy value and learning time than MCEM. Finally, Dec-SBPR is compared to Periodic EM (PeriEM) [27] and FB-HSVI [15], two state-ofart planing methods (with known models) for generating controllers. Because having a Dec-POMDP model allows more accurate value function calculations than a finite number of trajectories, the value of PeriEM and FB-HSVI are treated as upper-bounds for the policy-based methods. Our Dec-SBPR approach can sometimes outperform PeriEM, but produces lower value than FB-HSVI. FB-HSVI is a boundedly-optimal method, showing that Dec-SBPR can produce near optimal solutions in some of these problems and produces solutions that are much closer to the optimal than previous RL methods. It is also worth noting that neither PeriEM nor FB-HSVI can scale to large problems (such as the one discussed below), while by using a policy-based RL approach, Dec-SBPR can scale well. Scaling up to larger domains To demonstrate scalability to both large problem sizes and large numbers of agents, we test our algorithm on a traffic problem [35], with 1020 states. Here, there are 100 agents controlling the traffic flow at 10 × 10 intersections with one agent located at each intersection. Except for MCEM, no previous Dec-POMDPs algorithms are able to solve such large 6 The learning curves of Dec-SBPR are shown in the appendix. The results are provided by personal communication with its authors and run on the same benchmarks that are available online. 7 11 problems. Since the authors in [35] use a hand-coded policy (comparing the traffic flow between two directions) as a heuristic for generating training trajectories, we also use such a heuristic for a fair comparison. In addition, to examine the effectiveness of the exploration-exploitation strategy described in Section 3.4, we also consider the case where the initial behavior policy is random and then it is optimized as discussed. From Figure 2, we can see that, with the help of the heuristic, Dec-SBPR can achieve the best performance. Without using the heuristic (by just using our exploration-exploitation strategy), in a few iterations, Dec-SBPR is able to produce a higher quality policy than MCEM. Moreover, the inferred number of FSC nodes (averaged over all agents) is smaller than the number preselected by MCEM. This shows that not only can Dec-SBPR scale to large problems, but it can also produce higher-quality solutions than other methods for those large problems. 5 Conclusions The paper presented a scalable Bayesian nonparametric policy representation and an associated learning framework (Dec-SBPR) for generating decentralized policies in Dec-POMDPs. An new exploration-exploitation method, which extends the popular -greedy method, was also provided for reinforcement learning in Dec-POMDPs. Experimental results show Dec-SBPR produces higher-quality solutions than the state-of-art policy-based method, and has the additional benefit of inferring the number of nodes needed to represent the optimal policy. The resulting method is also scalable to large domains (in terms of both the number of agents and the problem size), allowing high-quality policies for large Dec-POMDPs to be learned efficiently from data. Acknowledgments Acknowledgments This research was supported by the US Office of Naval Research (ONR) under MURI program award #N000141110688 and NSF award #1463945. Appendices A Proof of Theorem 3:(Mean-field) Variational Bayesian (VB) Inference for DEC-SBPR Under the standard variational theory [7, 11], minimizing the KL divergence between q(Θ, z) and p(Θ, z|D) is equivalent to minimizing the lower bound of log marginal likelihood (empirical value function for our case). Using Jensen’s inequality, we can obtain the following lower bound of the log marginal value function K Tk k X Z 1 XX r̃k p(Θ)p(η)p(~ak0:t , ~z0:t |~ok1:t , Θ) (K) k b ln V (D ) = ln qtk (~z0:t )q(Θ)q(η) t dΘdη k K k=1 t=0 k qtk (~z0:t )q(Θ)q(η) k ~ z0 ,··· ,~ zt 12 K Tk k X Z r̃k p(Θ)p(η)p(ρ)p(~ak0:t , ~z0:t |~ok1:t , Θ) 1 XX k )q(Θ)q(η) ln t ≥ qtk (~z0:t dΘdη k K k=1 t=0 k qtk (~z0:t )q(Θ)q(η) k ~ z0 ,··· ,~ zt   k  k k ξ t k k k (K) p(~z0:t , Θ, η|~a0:t , ~o1:t ) = ln Vb (D ) − KL qt (~z0:t )q(Θ)q(η) (K) ) Vb (D !    k k def = LB qt (zn,0:t ) k,t , q(Θn ), q(ηn ) (15) n=1···N R Q where ξtk = r̃tk p(~ak0:t |~ok1:t , Θ)p(Θ)dΘ and r̃tk = γ t rtk /pΨ (~a|~hkt ). We assume p(Θ) = N n=1 p(Θ) QN and p(~a0:t , ~z0:t |~o0:t , Θ) = n=1 p(an,0:t , zn,0:t |on,0:t , Θn ) to accommodate decentralized policy representations. To derive the VB updating equations, we rewrite the lower bound in equation (15) as follows !    k k LB qt (zn,0:t ) k,t , q(Θn ), q(ηn ) n=1,···N K Tk X  q(Θ) q(η) 1 XX k k dΘ − q(η) ln dη − qtk (~z0:t ) ln qtk (~z0:t ) p(Θ) p(η) K k=1 t=0 k ~ z0 ,··· ,~ ztk Z T K N N k X Y Y  1 XX k k qtk (~z0:t )q(Θn )q(ηn ) ln r̃tk pkt (akn,0:t , zn,0:t |okn,1:t , Θn ) dΘn dηn(16) . + K k=1 t=0 k k n=1 n=1 Z Z =− q(Θ) ln ~ z0 ,··· ,~ zt The VB Inference algorithm for DEC-SBPR is based on maximizing LB w.r.t. the distribution of  k k the joint DEC-SBPR parameters {qt (zn,0:t )}k,t , q(Θn ), q(ηn ) n=1,··· ,N , which can be achieved by alternating the following steps. Update the distribution of nodes (VB E-step): Keeping {q(Θn )}n=1,··· ! ,N and {q(ηn )}n=1,··· ,N    k k fixed, solve max{qtk (zn,0:t qt (zn,0:t ) k,t , q(Θn ), q(ηn ) , ∀n, k, t subject to the k )} LB n=1,··· ,N k normalization constraint for qtk (zn,0:t ). In this step, we construct the Lagrangian !     N X Y  k k k k Fqtk (zn,0:t qt (zn,0:t ) k,t , q(Θn ), q(ηn ) −λ K − qt (zn,0:t ) , (17) k ) = LB n=1,··· ,N k n=1 k,t,zn,0:t k then take derivative w.r.t qtk (zn,0:t ) and set the result to zero ∂Fqtk (zn,0:t k ) Z 1 k  |ok1:t , Θn )dΘn = p(Θn ) ln r̃tk p(akn,0:t , zn,0:t k k K ∂ qt (zn,0:t )   Y Z T N K k 1 XX X Y k k k k k k k + qt (zi,0:t )q(Θn )q(ηn ) ln r̃t pt (an,0:t , zn,0:t |on,1:t , Θn ) dΘn dηn K k=1 t=0 k k n=1 i6 = n ~ z0 ,··· ,~ zt Y  Tk K X N K Tk X X Y X Y 1 1 XX k k k k k − ) qt (zi,0:t ) ln qt (zn,0:t ) − qtk (zi,0:t K k=1 t=0 k K k i6=n k k n=1 k=1 t=0 i6=n ~ z0 ,··· ,~ zt ~ z0 ,··· ,~ zt 13 +λ Tk K X X X Y k ) = 0, qtk (zi,0:t (18) k=1 t=0 ~ z0k ,··· ,~ ztk i6=n k which is solved to give the distribution of nodes zn,0:t for the nth agent Z  r̃tk k k k k k qt (zn,0:t ) = exp q(Θn ) ln p(an,0:t , zn,0:t |on,1:t , Θn )dΘn Cz   t t X X k k k r̃tk zn,τ zn,0 akn,τ −1 ,zn,τ hln Wn,ak ,ok ip(W |σ̂,η̂) = exp ln µn + hln πn,zk ip(π|ρ̂) + n,τ n,τ −1 τ Cz τ =1 τ =0 t k r̃k zk akn,0 Y zn,τ = t µnn,0 π en,zk π e z k ,z k n,0 Cz k f n,τ τ −1 k τ =1 n,an,τ W k (19) n,aτ −1 ,oτ where     |A| X n,i n,i n,i ρ̂m )i hln πa ip(π|ρ̂) = exp hψ(ρ̂a ) − ψ( m=1     i,1 i,1 i,1 f Wn,a,o = exp hln Wn,a,o ip(W |σ̂,η̂) = exp hln Vn,a,o ip(V |σ̂,η̂) ,     j−1 X i,j i,j i,j i,m fn,a,o = exp hln Wn,a,o ip(W |σ̂,η̂) = exp hln Vn,a,o ip(V |σ̂,η̂) + W hln(1 − Vn,a,o )ip(V |σ̂,η̂) , π ean,i = exp m=1 i,|Zn | fn,a,o W for j = 2, · · · ,|Zn |−1   X  |Zn | n,a,o i,|Zn | = exp hln Wn,a,o ip(W |σ̂,η̂) = exp hln(1 − Vi,m )ip(V |σ̂,η̂) m=1 with i,j hln Vn,a,o ip(V |σ̂,η̂) = i,j ψ(σn,a,o + i,j ωn,a,o )   |Zn | X i,l i,j i,j ωn,a,o , − ψ σn,a,o + hηn,a,o i + l=j i,j hln(1 − Vn,a,o )ip(V |σ̂,η̂)     |Zn | |Zn | X X i,j i,l i,l i,j i,j = ψ hΣn,a,o i + ωn,a,o − ψ σn,a,o + hΣn,a,o i + ωn,a,o , l=j+1 i,j ip(η|ĉ,d) hηn,a,o ˆ = l=j ˆi,j ĉi,j n,a,o /dn,a,o i,j where ψ(·) is digamma function, ωn,a,o is the reward (soft-count) allocated to the transition from i,j i,j i,j ˆ state i to j, both ĉn,a,o and dn,a,o are the posterior parameters of ηn,a,o . k Update the sufficient statistics (VB-M Step) In VB-M Step, the distribution of nodes {qtk (~z0···t )}, !    k k ∀k, t are fixed, the objective is to solve maxq(Θn ),q(ηn ) LB qt (zn,0:t ) k,t , q(Θ), q(ηn ) , ∀n n=1,··· ,N R subject to the normalization constraint that q(Θ)dΘ = 1. First we consider finding q(Θn ). To that end, we construct the Lagrangian !     Z  k k FqΘn = LB qt (zn,0:t ) k,t , q(Θn ), q(ηn ) − λ 1 − q(Θ)dΘ) . (20) n=1,··· ,N 14 Then Z Y N N Y ∂FqΘ 1 X k k k k = |ok1:t , Θn )dη p(ηn )p(akn,0:t , zn,0:t q(ηn )qt (zn,0:t ) ln r̃t K ∂ q(Θ) k n=1 n=1 k,t,zn,0:t q(Θn ) +λ=0 p(Θn ) −1 − ln ⇒ N Y p(Θn )  1 X k k k k k q(Θ) = exp qt (zn,0:t ) ln p(an,0:t , zn,0:t |on,1:t , Θn ) 1−λ e K n=1 k,t,z   X |Zn | |Zn | N t X t X Y p(Θn ) X 1 X n,akτ−1 ,okτ n,akn,τ n,k n,k k = exp Kνt φt,τ (i) ln πi + ξt,τ (i, j) ln Wi,j e1−λ K k,t n=1 τ =1 i=1 τ =1 i,j=1  |Zn | |An |  |Zn | |On | N Y n,k p(Θn ) Y Y  i Pk,t,τ νtk φkt,τ (i)I(akn,τ ,a) Y Y i,j Pk,t,τ νtk ξt,τ (i,j)I(akn,τ −1 ,a)I(okn,τ ,o) −1 = [πn,a ] [Wn,a,o ] e1−λ i=1 a=1 n=1 j=1 o=1  (from the relation between stick-breaking weights p and independent beta random variables in V (28)) |Zn | |An |  N Y P n,k p(Θn ) Y Y k n,k a k,t,τ νt φt,τ (i)I(a,aτ ) = [π ] n,i 1−λ e n=1 i=1 a=1  |Zn | |On | j−1 YY Y n,k k k Pk,t,τ νtk ξt,τ i,j i,m −1 (i,j)I(an,τ −1 ,a)I(on,τ ,o) × Vn,a,o (1 − Vn,a,o ) j=1 o=1 = N Y n=1 Dir(ρ̂n,i ) m=1 |An | |O|n YY i,: i,: GDD(σ̂n,a,o , η̂n,a,o ) (21) a=1 o=1 where PK PTk Pt k n,k k τ =1 νt φt,τ −1 (i)I(aτ −1 = a) t=0 k=1 i,j i,j i,j σ̂n,a,o = σn,a,o + ωn,a,o K Tk X t 1 XX i,j = σn,a,o + ν k ξ n,k (i, j)I(akτ−1 = a)I(okτ = o) K k=1 t=0 τ =1 t t,τ −1 |Zn | X i,j i,j i,l η̂n,a,o = ηn,a,o + ωn,a,o l=j+1 |Zn | K Tk t X 1 X XX n,k i,j k k ν̂tk ξt,τ = ηn,a,o + −1 (i, j)I(aτ −1 = a)I(oτ , o), K l=j+1 k=1 t=0 τ =1 ρ̂an,i = ρan,i + 1 K (22) and νtk is the marginalized re-weighted reward computed by equation 6. To find q(η), we construct the Lagrange, Fq(Σ) = LB {qtk }, g(Θ), q(η)  15   Z − λ 1 − q(η)dη) (23) ∂Fη 1 = K ∂ q(η) Z q(Θ) ln p(η)p(Θ)dΘ − 1 ln q(η) + λ = 0 K (24) ⇒ Z q(η) ∝ exp  q(Θ) ln p(η)p(Θ|η)dΘ Z  ∝ exp q(Θ) ln p(Θ|η)dΘ + ln p(η)  ∝ p(η) exp hln p(Θ)i = ≈ N |A n | |On | |Zn | |Zn | Y Y YYY n=1 a=1 j=1 i=1 j=1 N |A n | |On | |Zn | |Zn | Y Y YYY n=1 a=1 j=1 i=1 j=1 n,a,o Ga(ηi,j ; c, d) (25) n,a,o n,a,o n,a,o −1 Γ(σi,j + ηi,j ) n,a,o σi,j n,a,o V (1 − Vjn,a,o )ηi,j −1 n,a,o n,a,o i,j Γ(σi,j )Γ(ηi,j ) n,a,o n,a,o Γ(σi,j + ηi,j )  n,a,o ηi,j n,a,o Γ(ηi,j ) c−1  n,a,o exp − ηi,j (d − ln(1 − Vjn,a,o )) n,a,o One can set σi,j = 1, in this case, the VB approximation of q(σ) is a product of independent n,a,o gamma distributions. However, when σi,j 6= 1, (24) is no longer a gamma distribution (the prior and likelihood are not conjugate). To solve this issue, one might consider the VB inference method for non-conjugate priors [33], by which we consider a point estimate of η, such at q(η) is maximized. One way to obtain the maximum estimate of η is to solve ∂q(η) = 0, however this operation involves ∂η taking derivative w.r.t gamma functions, which does not have a simple form solution. To circumvent this difficult, we use grid search. To make the search more efficient, we use the bounds of Γ(a+x) to Γ(x) give an initial estimate of the searching range. The bounds are from Wendel’s double Inequality [30]. x(x + a)a−1 ≤ Γ(a + x)/Γ(x) ≤ xa (26) where x, a > 0. B Some Basics of Stick-breaking Priors Here we provide the definition of stick-breaking prior (SBP), its connection to generalized Dirichlet distribution and the corresponding posterior inference, as well as the main statistics characteristics which are useful for developing the inference methods in our paper. For more detailed mathematical treatment, readers are referred to [18, 34] Definition 4. The stick-breaking priors [18] are almost surely discrete random probability measures P over the the measurable space (Ω, B) which are partitioned into d disjoint regions with Ω = ∪Bk for 1, · · · , d. It is expressed as d X d Pa,b = pi δΘi (27) k=1 and p1 = V1 and pi = (1 − V1 )(1 − V2 ) · · · (1 − Vi−1 )Vi , i > 2 are the weights with Vi are independent Beta(ak , bk ) random variables for ai , bi > 0. 16 (28) SBP allows Beta-distributed RVs Vi , ∀i and the atoms Θi , ∀i associated with the resulting weights to be drawn simultaneously. B.1 Stick-breaking prior and generalized Dirichlet distribution We denote p ∼ SB(v, w) as constructing p as an infinite process (d → ∞) as (28), and p ∼ GDD(v, w) when p is finite. Here, GDD stands for generalized Dirichlet distribution. To see the connection between SBP and GDD, set the truncation level (number of occupied states) to d with P pd+1 = 1 − di=1 pi , then we can write down the density function of V = (V1 , · · · , Vd ) as d Y d Y Γ(vi + wi ) vi −1 Vi f (V ) = f (Vi ) = (1 − Vi )wi −1 . Γ(v )Γ(w ) i i i=1 i=1 (29) By changing variables from V to p and using the relation between V and p as described by (28), the density of p can be obtained as follows,  d  i Y X wi −(vi+1 +wi+1 ) wd −1 Γ(vi + wi ) vi −1 ∂V |f (V ) = p 1− pj f (p) = | pd+1 (30) ∂p Γ(vi )Γ(wi ) i i=1 j=1 which has a mean and variance for an element pi , Q wl vi i−1 , E[pi ] = Qi l=1 l=1 (vl + wl ) (31) Qi−1 wl (wl − 1) vi (vi + 1) l=1 V[pi ] = Qi . l=1 (vl + wl )(vl + wl + 1) P When wi = K j=i+1 vi for i < d, and keeping wd = wd , the GDD is equivalent to the standard Dirichlet distribution. As a concrete example, consider the case d = 3, we have p1 p2 p3 p4 = V1 = (1 − V1 )V2 = (1 − V1 )(1 − V2 )V3 = (1 − V1 )(1 − V2 )(1 − V3 )V4 = (1 − V1 )(1 − V2 )(1 − V3 ) V 1 = p1 p2 1 − p1 p3 V3 = 1 − p 1 − p2 p4 V4 = = 1. 1 − p 1 − p2 − p3 V2 = ⇐⇒ Plugging these relations into (30), we can obtain ∂V f (p) = | |f (V ) ∂p 4 i−1 Y X Γ(vi + wi ) p2 v2 −1 p2 w2 −1 × pv11 −1 (1 − p1 )w1 −1 · ( = (1 − pj ) ) (1 − ) (32) Γ(vi )Γ(wi ) 1 − p1 1 − p1 i=1 j=1 p2 p4 p4 p3 =( )v3 −1 (1 − )w3 −1 · ( )v4 −1 (1 − )w4 −1 1 − p 1 − p2 1 − p1 − p2 1 − p1 − p2 − p 3 1 − p1 − p2 − p3 4 i Y X Γ(vi + wi ) vi −1 = pi (1 − pj )wi −(vi+1 +wi+1 ) . Γ(v )Γ(w ) i i i=1 j=1 17 B.2 Bayesian Inference for GDD i.i.d. Given a set of discrete observations {Xn } ∼ Discrete(p), and the prior p ∼ SB(v, w), the posterior of p can be written down as p(p|{Xn }) ∝ N Y d Y I(X ,i) pi n n=1 i=1 ∝ d Y Vi i=1 ∝ d Y i−1 Y  (1 − Vj ) d  Y Γ(vi + wi ) i=1 PN n=1 Γ(vi )Γ(wi ) pvi i −1 1− i X pj wi −(vi+1 +wi+1 )  d −1 pw d+1 j=1 I(Xn ,i) Vivi −1 (1 − Vi )wi −1 j=1 P vi + N n=1 I(Xn ,i)−1 Vi (1 − Vi )wi + P j>i PN n=1 I(Xn ,i)−1 i=1 = GDD(v 0 , w0 ) (33) P 0 where the posterior hyper-parameters are updated as vi0 = vi + N n=1 I(Xn = i) and wi = P PN wi + j>i n=1 I(Xn = i), where I(·) is an indicator function with value equal to one when the argument is true and zero otherwise. C The Computation of Forward and Backward Variables (α, β)  n,k k k k The forward and backward variables (α, β) ατn,k (i) = p zn,τ = i|an,0:τ , on,1:τ , Θn and βt,τ (i) = k k =i,o k p(an,τ |zn,τ n,τ +1:t ,Θn ) Q+1:t , t k |h k p(a ,Θn ) τ τ 0 =τ n,τ 0 ∀ n, k, t, τ defined in section 3.2 are similar to the forward-backward messages in the Baum-Welch algorithm for hidden Markov models [31]. These variables are computed recursively by each agent using (34)-(36).  µ(z k =i)π(z k =i,a k ) n,0 n,0 n,0  if τ = 0 k |h k ,Θ ) p(an,0 n n,k n,0 P|Zn | (34) ατ (i) = k k k k k k k  j=1 α(zi,τ −1 (j)W (zi,τ −1 =j,an,τ −1 ,on,τ ,zn,τ =i)π(zn,τ =i,an,τ ) if τ > 0 p(a k |h k ,Θn ) n,τ n,k βt,τ (j) =    n,τ 1 k |h k ,Θ ) p(an,0 n P|Zn | n,0 k k k k k k k n=1 W (zn,τ =i,an,τ −1 ,on,τ ,zn,τ +1 =j)π(zn,τ +1 =j,an,τ +1 )βn,t,τ +1 (j) k k p(an,τ |hn,τ ,Θn ) if τ = 0 if τ > 0 (35)  P |Zn | k k k  = i)π(zn,0 = i, an,0 ) if τ = 0  j=1 µ(zn,0 P|Zn | k k k k k k k k p(an,τ |hn,τ , Θn ) = α(zn,τ −1 = i)W (zn,τ −1 = i, an,τ −1 , on,τ , zn,τ = j)π(zn,τ = j, an,τ )  i,j=1  if τ > 0 (36) D D.1 Additional Experimental results learning variable-size FSC vs learning fixed-size FSC Additional experiments are added to study the impact of number of training samples. 18 Mars Rover (|S|=256,|A|=6,|O|=8) 20 15 10 5 0 Mars Rover (|S|=256,|A|=6,|O|=8) 25 EM (max) EM (mean) SB DP 20 Policy Value 15 Policy Value Mars Rover (|S|=256,|A|=6,|O|=8) 25 EM (max) EM (mean) SB DP 10 5 15 10 5 0 0 −5 −5 −10 −10 1 10 Number of Nodes 4 2 10 −5 −10 1 Mars Rover (|S|=256,|A|=6,|O|=8) −15 2 10 Number of Nodes 1 10 Number of Nodes 10 2 10 Mars Rover (|S|=256,|A|=6,|O|=8) 10 100 EM (K=30) EM (K=100) EM(K=300) SB DP 80 3 10 CPU Time (sec) CPU Time (sec) EM (max) EM (mean) SB DP 20 Policy Value 25 2 10 60 40 20 1 10 1 10 2 10 0 1 10 2 10 3 10 Number Number of Nodes Figure 3: Comparison between variable-size controller learned byof Nodes Dec-SBPR and fixed-size controller learned by EM algorithm. Top: testing value of policies learned using different number of training episodes(K = 30(left),K = 100(middle),K = 300(right)); Bottom: averaged computation time of EM (left) and SB (right). D.2 Sequential Batch Learning with Exploration Exploitation Trade-offs Additional results from sequential batch learning with exploration exploitation trade-offs for five domains are plotted in Figure 4. In each iteration, a batch of samples are collected with updated behavior policies8 and are used to learn a set new policies with Algorithm 1. These results are associated with the numbers reported in the first two columns of Table 2 in the main body of the paper. 8 To generate these plots, 50 trajectories are collected in each iteration and the exploration parameter is set to be u = 100. 19 Figure 4: Additional plots for illustrating exploration-exploitation tradeoff, including testing value (left), inferred controller numbers (middle) and exploration rate (right). In each iteration, a batch of samples are collected with updated behavior policies and are used to learn a set new policies with Algorithm 1. 20 References [1] Benchmarks. http://rbr.cs.umass.edu/camato/decpomdp/download.html. 2015. [2] C. Amato, D. S. Bernstein, and S. Zilberstein. Optimizing fixed-size stochastic controllers for POMDPs and decentralized POMDPs. J. Autonomous Agents and Multi-Agent Systems, 2(3):293–320, 2010. [3] C. Amato, G. Chowdhary, A. Geramifard, N. K. Ure, and M. J. Kochenderfer. Decentralized control of partially observable Markov decision processes. In Proc. of the Conf. on Decision and Control, 2013. [4] C. Amato, G. D. Konidaris, G. Cruz, C. A. Maynor, J. P. How, and L. P. Kaelbling. Planning for decentralized control of multiple robots under uncertainty. In ICRA, 2015. [5] C. Amato and S. Zilberstein. Achieving goals in decentralized POMDPs. In Proc. of the 8th Int’l Conf. on Autonomous Agents and Multiagent Systems, 2009. [6] B. Banerjee, J. Lyle, L. Kraemer, and R. Yellamraju. Sample bounded distributed reinforcement learning for decentralized POMDPs. In Proc. of the 26th AAAI Conf. on Artificial Intelligence, 2012. [7] M. J. Beal. Variational algorithms for approximate Bayesian inference. PhD thesis, University of London, 2003. [8] D. Bernstein, S. Zilberstein, R. Washington, and J. Bresina. Planetary rover control as a Markov decision process. In 6th Int’l Symposium on Artificial Intelligence, Robotics, and Automation in Space, 2001. [9] D. S. Bernstein, C. Amato, E. A. Hansen, and S. Zilberstein. Policy iteration for decentralized control of Markov decision processes. J. Artificial Intelligence Research, 34:89–132, 2009. [10] D. S. Bernstein, R. Givan, N. Immerman, and S. Zilberstein. The complexity of decentralized control of Markov decision processes. Mathematics of Operations Research, 27(4):819–840, 2002. [11] C. M. Bishop et al. Pattern recognition and machine learning, volume 1. springer New York, 2006. [12] M. Bryant and E. B. Sudderth. Truly nonparametric online variational inference for hierarchical dirichlet processes. In Advances in Neural Information Processing Systems, 2012. [13] C. Cai, X. Liao, and L. Carin. Learning to explore and exploit in POMDPs. In Proc. of the 23th Annual Conf. on Neural Information Processing Systems, 2009. [14] A. Dempster, N. Laird, and D. Rubin. Maximum likelihood from incomplete data via the EM algorithm. J. Royal Statistical Society B, 39:1–38, 1977. [15] J. S. Dibangoye, O. Buffet, and F. Charpillet. Error-bounded approximations for infinite-horizon discounted decentralized POMDPs. In Machine Learning and Knowledge Discovery in Databases. Springer, 2014. [16] F. Doshi-Velez, D. Wingate, N. Roy, and J. B. Tenenbaum. Nonparametric Bayesian policy priors for reinforcement learning. In Advances in Neural Information Processing Systems, 2010. [17] T. S. Ferguson. A Bayesian analysis of some nonparametric problems. Annals of Statistics, 1:209–230, 1973. [18] H. Ishwaran and L. F. James. Gibbs sampling methods for stick-breaking priors. J. Am. Statist. Assoc., 96(453), 2001. [19] A. Kumar and S. Zilberstein. Anytime planning for decentralized POMDPs using expectation. In Proc. of the 26th Conf. on Uncertainty in Artificial Intelligence, 2010. [20] H. Li, X. Liao, and L. Carin. Multi-task reinforcement learning in partially observable stochastic environment. J. Machine Learning Research, 10(1):1131–1186, 2009. 21 [21] M. Liu, X. Liao, and L. C. and. Infinite regionalized policy representation. In Proc. of the 28th Int’l Conf. on Machine Learning, 2011. [22] M. Liu, X. Liao, and L. Carin. Online expectation maximization for reinforcement learning in POMDPs. In Proc. of 23rd Int Joint Conf. on Artificial Intelligence, 2013. [23] M. F. Martins and Y. Demiris. Learning multirobot joint action plans from simultaneous task execution demonstrations. In Proc. of the 9th Int’l Conf. on Autonomous Agents and Multiagent Systems, 2010. [24] J. Messias, M. Spaan, and P. Lima. Multi-robot planning under uncertainty with communication: a case study. In Fifth Workshop on Multi-agent Sequential Decision Making in Uncertain Domains (MSDM), 2010. [25] F. A. Oliehoek. Decentralized POMDPs. In Reinforcement Learning: State of the Art, Adaptation, Learning, and Optimization, pages 471–503. Springer Berlin Heidelberg, Berlin, Germany, 2012. [26] J. Paisley and L. Carin. Hidden Markov models with stick-breaking priors. Signal Processing, IEEE Trans. on, 57(10):3905–3917, 2009. [27] J. Pajarinen and J. Peltonen. Periodic finite state controllers for efficient POMDP and DEC-POMDP planning. In Proc. of the 25th Annual Conf. on Neural Information Processing Systems, 2011. [28] O. Papaspiliopoulos and G. O. Roberts. Retrospective Markov chain Monte Carlo methods for Dirichlet process hierarchical models. Biometrika, 95(1):169–186, 2008. [29] J. Pineau, G. Gordon, and S. Thrun. Point-based value iteration: an anytime algorithm for POMDPs. In Proc. of the 18th Int Joint Conf. on Artificial Intelligence, 2003. [30] F. Qi and L. Losonczi. Bounds for the ratio of two gamma functions. Journal of Inequalities and Applications, 2010:204, 2010. [31] L. R. Rabiner. A tutorial on hidden Markov models and selected applications in speech recognition. Proceedings of the IEEE, 77(2):257–286, 1989. [32] C. P. Robert and G. Casella. Monte Carlo statistical methods, volume 319. Citeseer, 2004. [33] C. Wang and D. Blei. Variational Inferecne in Nonconjugate Models. Journal of Machine Learning Rsearch, 14:1005–1031, 2013. [34] T.-T. Wong. Generalized dirichlet distribution in bayesian analysis. Applied Mathematics and Computation, 97(2):165–181, 1998. [35] F. Wu, S. Zilberstein, and N. R. Jennings. Monte-carlo expectation maximization for decentralized POMDPs. In Proc. 23rd Int’l. Joint Conf. on Artificial Intelligence, 2013. 22
3cs.SY
arXiv:1508.07096v1 [stat.ML] 28 Aug 2015 Partitioning Large Scale Deep Belief Networks Using Dropout Sai Zhang University of Washington [email protected] Yanping Huang University of Washington [email protected] Abstract Deep learning methods have shown great promise in many practical applications, ranging from speech recognition, visual object recognition, to text processing. However, most of the current deep learning methods suffer from scalability problems for large-scale applications, forcing researchers or users to focus on smallscale problems with fewer parameters. In this paper, we consider a well-known machine learning model, deep belief networks (DBNs) that have yielded impressive classification performance on a large number of benchmark machine learning tasks. To scale up DBN, we propose an approach that can use the computing clusters in a distributed environment to train large models, while the dense matrix computations within a single machine are sped up using graphics processors (GPU). When training a DBN, each machine randomly drops out a portion of neurons in each hidden layer, for each training case, making the remaining neurons only learn to detect features that are generally helpful for producing the correct answer. Within our approach, we have developed four methods to combine outcomes from each machine to form a unified model. Our preliminary experiment on the MNIST handwritten digit database demonstrates that our approach outperforms the state of the art test error rate. 1 Introduction Deep learning methods [1] aim to learn a multilayer neural network that can extract the feature hierarchies of the input data, by maximizing the likelihood of its training data. Their promise largely lies in the potential to use vast amounts of unlabeled data to learn complex, highly nonlinear models with millions of parameters. In recent competitions, deep learning methods have shown adavantanges over nearest-neighbor based (shallow) methods such kernel methods [2, 3] and ensemble methods [4, 5, 6]. In this paper, we consider a well-known machine learning model, deep belief networks (DBNs), that can learn hierarchical representations of their inputs. DBN has been applied to a number of machine learning applications, including speech recognition [7], visual object recognition [8, 9] and text processing [10], among others. In particular, DBN is especially well-suited to problems with high-dimensional inputs, over which it can infer rich models with many hidden layers. For example, when applied to images, a DBN can easily have tens of millions of free parameters, and ideally, we would want to use millions of unlabeled training examples to richly cover the input space. It has been demonstrated that increasing the scale of deep learning, with respect to the number of training examples, the number of model parameters, or both, can drastically improve ultimate classification accuracy [11]. Unfortunately, with most of the current algorithms, even training a moderate-sized DBN can take weeks using a conventional implementation on a single CPU [12]. This is primarily due to the daunting computational requirements in DBN training — a large number of parameters need to be trained on the available examples. 1 To address the DBN scalability problem, this paper proposes an approach to scale up large-scale deep belief networks (DBNs) by adapting the idea of random dropout. Random dropout, proposed by Hinton et al. [13], was originally used to prevent complex co-adaptations on the training data in a single processor. On each training case, each hidden unit is randomly omitted from the network with a probability of 0.5, so a hidden unit cannot rely on other hidden units being present. By doing so, many separate DBNs are trained and then applied independently to the test data to reduce the predication bias of a single DBN. Our approach extends the random dropout idea to the distributed and parallel setting. Rather than omitting a hidden unit with a probability of 0.5, our approach randomly drops out a portion of hidden units on each processor on each training case. To combine DBNs in each processor, our approach offers four different ways (Section 3.2): 1. performing model averaging with all trained DBNs. 2. using majority vote over the predication result of each trained DBN for each test case. 3. (each processor) synchronously updating its parameters after fetching the needed parameters from other processors. 4. (each processor) asynchronously fetching the computed parameters from other processors and pushing its computed parameters to other processors. As validated in our preliminary evaluation, by using random dropout, our approach outperforms the state-of-the-art [13] DBN algorithms on the same data set, and have the potential to exhibit nearly linear speedup with its parallel implementation. This paper makes the following contributions: • Approach. We propose an approach to scale up deep belief networks using random dropout [13] on large clusters (Section 3). • Implementation. We implemented our approach in an open-source prototype, which is publicly available at: http://deeplearning.googlecode.com • Evaluation. We applied our approach to the MNIST dataset, and demonstrated its effectiveness (Section 4). 2 Related Work Recently, many approaches have been developed to scale up machine learning algorithms within a machine (via multithreading) and across machines (via message passing) [14, 15, 16, 17]. Much of the existing work focuses on linear, convex models, and takes distributed gradient computation as the first step. Some other approaches relax synchronization requirements, exploring delayed gradient updates for convex problems [14], or exploring lock-less asynchronous stochastic gradient descent on shared-memory architectures (i.e. single machines) [18]. Another way to scale up machine learning algorithms is to provide better abstractions and wellencapsulated computation tools. MapReduce [19] and GraphLab [20] are two notable examples. However, MapReduce, originally designed for parallel data processing, has a number of limitations for training deep belief network [20]. On the other hand, GraphLab [20] was designed for general unstructured graph computations and does not exploit the computational effectiveness in a typical structured graph as in a deep belief network. Thus, it is still unknown whether the abstraction of GraphLab can be used for training large-scale DBNs. In the deep learning community, some work has been done to train relatively small models on a single machine [1]. In general, training a many-layer model is computationally intensive. Thus, full model parallelism as well as smart distributed optimization techniques is required. Recent years saw a surge of interest in scaling up the training and inference algorithms used for DBNs [19, 12] and in improving applicable optimization procedures [11]. Existing approaches primarily fall into the following two categories. Approaches in the first category use graphics processors (GPUs) [12, 8, 21] to achieve significant speedup for training moderate-sized DBNs. The use of GPUs has significantly reduced the computation time of matrix operations, which dominate most of the computation cost of deep learning 2 algorithms. However, a known limitation of such GPU-based approaches is that the speedup will be small when the model does not fit in GPU memory (typically less than a few gigabytes). Thus, to effectively leverage a GPU, researchers often reduce the model size and the parameter number to alleviate the impact of lacking enough GPU memory. While data and parameter reduction work well for small problems (e.g. acoustic modeling for speech recognition [22]), they are less attractive for realistic problems with a large number of examples and dimensions (e.g., high-resolution images [23]). Approaches in the second category use model parallelism to achieve scalability. For example, DistBelief [23] is a notable framework that enables model parallelism across machines (via message passing) , with the details of parallelism, synchronization and communication managed by the framework. Model parallelism under the DistBelief framework suffers a very large communication overhead due to the dense connections between layers of neurons. Data parallelism is also supported in DistBelief by using multiple replicas of a model to optimize a single objective. However, as pointed out by Hinton et al. [13], a large neural network, such as the one trained by DistBelief, can still perform poorly on held-out test data, if the relationship between the input and the correct output is complicated and the network has enough hidden units to model it accurately. In such cases, there will typically be many different settings of the weights that can model the training set almost perfectly. Each of these weight vectors will make different predictions on held-out test data and almost all of them will do worse on the test data than on the training data because the feature detectors have been tuned to work well together on the training data but not on the test data. Our approach is inspired by those above mentioned approaches, and aims to address their limitations. With the goal of scaling up deep learning techniques to train very large DBNs, our approach combines the intrinsic parallelism in the ensemble learning algorithms, with the random dropout approach [13] to improve generalization results of neural networks. Using random dropout, our approach trains a separate DBN (much smaller than the original DBN) on an individual (graphical) processor in a large cluster, and then combines their results using four proposed methods. Compared to existing approaches, our random dropout-based approach has several noticeable benefits. First, it becomes possible to train a huge number of different networks in a reasonable time, since the number of parameters to be trained on a single machine is much smaller than the original DBN. Second, our approach permits to better use the modern GPU memory due to the reduced model size. Third, data transferring between processors would incur less communication overhead. 3 Proposed Approach To train large DBNs, we propose an approach that supports distributed computation in neural networks. At a high level, our approach consists of two steps: model parallelism (Section 3.1) and model combination (Section 3.2). In the first model parallelism step, our approach automatically parallelizes computation in each machine using all available resources, and manages communication, synchronization and data transfer between machine. In the second step, our approach supports four different ways to combine results from each machine to form a unified DBN. 3.1 Model Parallelism Figure 1 illustrates the model parallelism step on two machines. It is worthy noting that the computational needs of training a DBN on one machine depends on its connectivity structure, and random dropout can significantly reduce the complexity of a DBN as well as the number of parameters: dropping out 50% of neurons at each layer can lead to a reduction of 75% of the parameters (connection weights). In general, given a dropout probability p, our approach permits model parallelism among at most 1/p2 machines, with each machine updating a disjoint portion of weight matrix. This is fundamentally different from existing model parallelism approaches [23]. For example, in the DistBelief [23] framework, a user needs to define the computation that takes place at each machine in each layer of the model, while our approach distributes the computation of training each DBN fully automatically to each machine. In addition, for a framework like DistBelief [23], the complexity of a DBN is not reduced; rather, a DBN is partitioned (as a graph) into available machines, and each machine must communicate frequently (with the parameter server) for updating weights. Therefore, large models with high computational demands might ben3 Processor 1 Combining DBNs: 1. Averaging weights 2. Majority vote over predications 3. Synchronized weight update 4. Asynchronized weight update Processor 2 Figure 1: An example of model parallelism of a 3-layer neural network on 2 machines. In this example, each machine randomly drops out a portion of neurons and trains a separate DBN independently. Later, our approach combines the trained DBNs using four methods described in Section 3.2. 1: 2: 3: 4: compute ∆w {calculate the gradient} fetch w from the weight queue w0 ← w - η∆w push w0 to other machines’ weight queues Figure 2: The asynchronous parameter updating algorithm in each machine on each training data. Each machine has a weight queue receiving the updated parameters from other machines. At the beginning, each machine has the same replica of parameters. efit from access to more CPUs and memory at the beginning, but will be limited by the bottleneck where communication costs dominate at some point. By contrast, in our approach, DBNs produced by random dropout tend to be more amenable to extensive distribution than fully-connected structures, given their less complex structures and lower communication requirements. Doing so will also help alleviate the bottleneck in which many machines are waiting for the single slowest machine to finish a given phase of computation. 3.2 Model Combination Our approach provides four ways to combine the trained DBN from each machine: 1. Averaging weights of the trained DBN in each machine. 2. Majority voting of the predication result for test data using the trained DBN in each machine (our implementation breaks possible cycles by arbitrarily ranking the predication results, but this did not occur in our experiments). 3. Synchronously updating parameter weights during DBN training in each machine. 4. Asynchronously updating parameter weights during DBN training in each machine. The first two ways for model combination are straightforward, and are omitted in this paper for space reasons. We next describe how to update parameter weights (a)synchronously. Figure 2 sketches the asynchronous parameter weight updating algorithm in each machine on each training data. This lock-free asynchronous algorithm prevents each machine from waiting for others to finish before proceeding to the next training data, while sacrificing the data consistency of parameters – it is possible that two machines are updating the same parameters simultaneously without an explicit ordering. As a consequence, this asynchronous algorithm may introduce additional stochasticity in training. 4 1: 2: 3: 4: compute ∆w {calculate the gradient} fetch w from the parameter server {wait until all other machines finish updating w} w0 ← w - η∆w update w0 on the parameter server {wait until all other machines finish updating w0 } Figure 3: The sychronous parameter updating algorithm in each machine on each training data. Only the parameter serve stores all weights; each machine fetches the needed weights from the server before updating. Figure 3 sketches the synchronous parameter weight updating algorithm in each machine. In this algorithm, there is a central parameter server storing weights of all parameters. At the end of each mini-batch (a set of training data), each machine sends a request to the parameter server to fetch the needed parameter weights. If other machines are updating the requested parameters, this machine needs to wait until all machines finish their updates. Comparing to the asynchronous algorithm, this algorithm eliminates possible data races and improves data consistency of the same parameters, but introduces higher overhead. 3.3 Implementation We implemented our approach in a prototype using Matlab and Python. Our prototype uses the Theano [24] library to define, optimize, and evaluate mathematical expressions involving multidimensional arrays efficiently. Specifically, our implementation uses Theano to achieve significant speedup in data-intensive calculations by leveraging the transparent use of a GPU. When combining the trained DBNs, our implementation uses inter-process communication (IPC) [25] to exchange data among multiple threads in one or more processes. Our implementation is publicly available at: http://deeplearning.googlecode.com. 4 4.1 Evaluation Details of dropout training on MINST dataset The architectures of a deep network (the number of layers and the number of hidden units in each layer) varies on different benchmark tasks. Our first step is to develop a prototype and evaluate its effectiveness on the MNIST handwritten digits dataset [1], which consists of 28 × 28 digit images, - 60,000 for training and 10,000 for testing. The objective is to classify the digit images into their correct digit class. We experimented a neural network with size 784–500–500–2000–10, and pretrained that network as a layer-wise Restricted Boltzmann Machine (RBM) for 50 epochs. Here one epoch means a pass through training data. During the pre-training phase, we employs a greedy Contrastive Divergence–1 learning algorithm. The learning rate is exponentially decaying, with initial value 10.0 and a decay rate 0.998 for each epoch of training. Weights were updated at the end of each mini-batch of size 100. Momentum is also used, with an initial value of 0.5, and a linear increasing rate of 0.001 over the first 490 epochs, after which it stays at 0.99. For the fine tuning using back-propagation with dropout for 200 epochs, we employed the stochastic gradient descent with mini-batches of size 100. We use the same dropout rates p for all hidden units and 20% dropout for input pixels. A constant learning rate 1.0 was used and there’s no constraints imposed on the norms of weight vectors. 4.2 Generalization Performance as a function of dropout probability In the original dropout [13] article, Hinton et al claims that a better generalization performance can be achieved with various dropout probabilities. With implementation details shown in section 4.1, here we show how the test error rate varies as a function of dropout probability. As demonstrated in figure 4.2, dropout does decrease the test error rate by about 0.1% (10 less misclassified examples in the test data set). Contrary to their claim, we found that the generation performance of dropout actually depends on the dropout probability. When the dropout probability is greater than 0.6, the test error rate increases significantly. Such inconsistency might be due to the much smaller training epochs (1,000 epochs used in Hinton’s paper) used in our implementation. 5 Figure 4: The test error rate on the MNIST for a variety of dropout probabilities. The input visible neurons also use 20% dropout. The best previous published results for this task using DBN without dropout are 1.18% (with RBM pre-training) and 1.6% (without RBM pre-training ), using more than 1,000 epochs [13]. 4.3 Generalization Performance of our distributed algorithm Here we evaluate the generalization performance on the MNIST dataset using various algorithms to combine results from different machines, as listed in section 3.2,. Algorithms Error Rate (%) Sequential 1.08 Weight Averaging 0.98 Majority Vote 1.04 Synchronous Update 0.97 Asynchronous Update 1.06 Table 1: Test error rate using different algorithms for 200 epochs of fine tuning. Weight averaging and majority vote algorithms collect final weights from 7 independent runs of the standard dropout algorithms. Synchronous update and asynchronous update algorithms combine results from two processes after each input instance. Dropout rate is 50% for all algorithms. Both weight averaging and synchronous update algorithms achieved notable improvement in the generalization performance. Surprisingly the majority vote method didn’t reduce the test error rate by a large margin. The asynchronous update algorithm introduced additional noise in the weight updates by its lock free mechanism, thus its generalization performance was relatively the same as the sequential dropout algorithm. However, as exhibited in figure 5, the convergence rate for both synchronous and asynchronous update algorithms are faster than the sequential dropout algorithm. 4.4 Limitations Our current evaluation was performed on a desktop with a Dual Core Intel E7400 processor, 3GB RAM, and a NVIDIA 8800GS graphics card. Pretraining/fine tuning are generally very time consumption on this machine. Due to time constraints, we were only able to evaluate our proposed algorithm on the relatively small MNIST dataset. However, we plan to further evaluate our algorithm on other speech and object recognition benchmark tasks such as the TIMIT Acoustic-Phonetic Continuous Speech Corpus [26], Reuters Corpus for news article topic recognition [27], and the ImageNet dataset of millions of labeled images in thousands of categories [28]. 6 Figure 5: The test error rate on the MNIST as a function of number of epochs, using synchronous/asynchronous updates. 5 Conclusion This paper proposes an approach to scale up deep belief networks (DBNs). At the core of our approach is the use of random dropout to prevent co-adaptions on the training data for a DBN, reduce overfitting, and enable DBN training to use the computational power of clusters in a distributed environment. Empirically, our implementation outperforms some state-of-the-art approaches [13], and promising nearly linear speedups. Furthermore, our approach allows parallel training of a DBN even when some gradients are computationally intensive. For future work, it would be interesting to compare our approach with other approaches using different abstractions [20, 29]. For example, the PowerGraph [20] abstraction exploits the internal structure of graph programs to address the challenges of computation on natural graphs. Thus, it may be possible to adapt a similar random dropout idea to reduce memory consumption and communications between processors. An investigation into how to generalize this approach to other structures and problems would enable even faster computation of machine learning problems. References [1] Geoffrey E. Hinton, Simon Osindero, and Yee-Whye Teh. A fast learning algorithm for deep belief nets. Neural Comput., 18(7):1527–1554, July 2006. [2] Songlin Zhao. From fixed to adaptive budget robust kernel adaptive filtering. University of Florida, 2012. [3] Bernhard Schölkopf and Alex Smola. Support vector machines. Encyclopedia of Biostatistics, 1998. [4] Yoav Freund and Robert E Schapire. A decision-theoretic generalization of on-line learning and an application to boosting. Journal of computer and system sciences, 55(1):119–139, 1997. [5] Tianqi Chen, Hang Li, Qiang Yang, and Yong Yu. General functional matrix factorization using gradient boosting. In Proceeding of 30th International Conference on Machine Learning (ICML’13), volume 1, pages 436–444, 2013. [6] Nan Wang. A new boosting algorithm based on dual averaging scheme. International Journal of Innovative Science and Modern Engineering, 3(9):18–22, 2015. 7 [7] Li Deng, Dong Yu, and J. Platt. Scalable stacking and learning for building deep architectures. In Acoustics, Speech and Signal Processing (ICASSP), 2012 IEEE International Conference on, pages 2133 –2136, march 2012. [8] Dan Claudiu Ciresan, Ueli Meier, Luca Maria Gambardella, and Jürgen Schmidhuber. Deep big simple neural nets excel on handwritten digit recognition. CoRR, abs/1003.0358, 2010. [9] Jia Wu, Raymond Tse, and Linda G Shapiro. Learning to rank the severity of unrepaired cleft lip nasal deformity on 3d mesh data. In Pattern Recognition (ICPR), 2014 22nd International Conference on, pages 460–464. IEEE, 2014. [10] Yoshua Bengio, Réjean Ducharme, Pascal Vincent, and Christian Janvin. A neural probabilistic language model. J. Mach. Learn. Res., 3:1137–1155, March 2003. [11] Quoc Le, Jiquan Ngiam, Adam Coates, Ahbik Lahiri, Bobby Prochnow, and Andrew Ng. On optimization methods for deep learning. In Lise Getoor and Tobias Scheffer, editors, Proceedings of the 28th International Conference on Machine Learning (ICML-11), ICML ’11, pages 265–272, New York, NY, USA, June 2011. ACM. [12] Rajat Raina, Anand Madhavan, and Andrew Y. Ng. Large-scale deep unsupervised learning using graphics processors. In Proceedings of the 26th Annual International Conference on Machine Learning, ICML ’09, pages 873–880, New York, NY, USA, 2009. ACM. [13] Geoffrey E. Hinton, Nitish Srivastava, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Improving neural networks by preventing co-adaptation of feature detectors. CoRR, pages –1–1, 2012. [14] John Langford, Er J. Smola, and Martin Zinkevich. Slow learners are fast. In In NIPS, pages 2331–2339, 2009. [15] Gideon Mann, Ryan Mcdonald, Mehryar Mohri, Nathan Silberman, and Daniel D. Walker. Efficient large-scale distributed training of conditional maximum entropy models. In In Advances in Neural Information Processing Systems, 2009. [16] Ryan McDonald, Keith Hall, and Gideon Mann. Distributed training strategies for the structured perceptron. In Human Language Technologies: The 2010 Annual Conference of the North American Chapter of the Association for Computational Linguistics, HLT ’10, pages 456–464, Stroudsburg, PA, USA, 2010. Association for Computational Linguistics. [17] Martin Zinkevich, Markus Weimer, Alex Smola, and Lihong Li. Parallelized stochastic gradient descent. In J. Lafferty, C. K. I. Williams, J. Shawe-Taylor, R.S. Zemel, and A. Culotta, editors, Advances in Neural Information Processing Systems 23, pages 2595–2603, 2010. [18] Feng Niu, Benjamin Recht, Christopher Re, and Stephen J. Wright. Hogwild!: A lock-free approach to parallelizing stochastic gradient descent. In In NIPS, pages 2331–2339, 2011. [19] Jeffrey Dean and Sanjay Ghemawat. Mapreduce: simplified data processing on large clusters. Commun. ACM, 51(1):107–113, January 2008. [20] Joseph E. Gonzalez, Yucheng Low, Haijie Gu, Danny Bickson, and Carlos Guestrin. Powergraph: Distributed graph-parallel computation on natural graphs. In Proceedings of the 10th USENIX Symposium on Operating Systems Design and Implementation (OSDI ’12), Hollywood, October 2012. [21] George E. Dahl, Student Member, Dong Yu, Senior Member, Li Deng, and Alex Acero. Context-dependent pre-trained deep neural networks for large vocabulary speech recognition. In IEEE Transactions on Audio, Speech, and Language Processing, 2012. [22] L. Deng, D. Yu, G. Dahl, A. Mohamed, N. Jaitly, A. Senior, V. Vanhoucke, P. Nguyen, T. Sainath, and B. Kingsbury. Deep neural networks for acoustic modeling in speech recognition. IEEE Signal Processing Magazine, 2012. [23] Jeffrey Dean, Greg Corrado, Rajat Monga, Kai Chen, Matthieu Devin, Quoc Le, Mark Mao, Marc’Aurelio Ranzato, Andrew Senior, Paul Tucker, Ke Yang, and Andrew Ng. Large scale distributed deep networks. In Advances in Neural Information Processing Systems 25, 2012. [24] The Theano Library. http://deeplearning.net/software/theano/. [25] W. Richard Stevens, Bill Fenner, and Andrew M. Rudoff. UNIX Network Programming, Vol. 1. Pearson Education, 3 edition, 2003. 8 [26] A. Mohamed, G. Dahl, and G. Hinton. Acoustic modeling using deep belief networks. IEEE Transactions on Audio, Speech, and Language Processing, 20(14), 2012. [27] Tony Rose, Mark Stevenson, and Miles Whitehead. The reuters corpus volume 1 - from yesterdays news to tomorrows language resources. In In Proceedings of the Third International Conference on Language Resources and Evaluation, pages 29–31, 2002. [28] Jia Deng, Wei Dong, Richard Socher, Li jia Li, Kai Li, and Li Fei-fei. Imagenet: A large-scale hierarchical image database. In In CVPR, 2009. [29] Aapo Kyrola, Guy Blelloch, and Carlos Guestrin. Graphchi: Large-scale graph computation on just a pc. In Proceedings of the 10th USENIX Symposium on Operating Systems Design and Implementation (OSDI ’12), Hollywood, October 2012. 9
9cs.NE
arXiv:1709.06661v1 [cs.SY] 19 Sep 2017 Simulation-based reachability analysis for nonlinear systems using componentwise contraction properties Murat Arcak and John Maidens Department of Electrical Engineering and Computer Sciences University of California, Berkeley September 21, 2017 Abstract A shortcoming of existing reachability approaches for nonlinear systems is the poor scalability with the number of continuous state variables. To mitigate this problem we present a simulationbased approach where we first sample a number of trajectories of the system and next establish bounds on the convergence or divergence between the samples and neighboring trajectories. We compute these bounds using contraction theory and reduce the conservatism by partitioning the state vector into several components and analyzing contraction properties separately in each direction. Among other benefits this allows us to analyze the effect of constant but uncertain parameters by treating them as state variables and partitioning them into a separate direction. We next present a numerical procedure to search for weighted norms that yield a prescribed contraction rate, which can be incorporated in the reachability algorithm to adjust the weights to minimize the growth of the reachable set. 1 Introduction Reachability analysis is critical for testing and verification of control systems [1], and for formal methods-based control synthesis where reachability dictates the transitions in a discrete-state abstraction of a system with continuous dynamics [2]. Existing reachability approaches for nonlinear systems include level set methods [3], linear or piecewise linear approximations of nonlinear models followed by linear reachability techniques [4, 5], interval Taylor series methods [6, 7], and differential inequality methods [8, 9]. However, these results typically scale poorly with the number of continuous state variables, limiting their applicability in practice. On the other hand trajectory-based approaches [10, 11, 12] scale well with the state dimension, as they take advantage of inexpensive numerical simulations and are naturally parallelizable. In [13] we leveraged concepts from contraction theory [14, 15] to develop a new trajectory-based approach where we first sample a number of trajectories of the system and next establish bounds on the divergence between the samples and neighboring trajectories. We then use these bounds to provide a guaranteed over-approximation of the reachable set. Unlike [11] that uses Lipschitz constants to bound the divergence between trajectories we use matrix measures that can take 1 negative values, thus allowing for convergence of trajectories and reducing the conservatism in the over-approximation. Another related reference, [10], uses sensitivity equations to track the convergence or divergence properties along simulated trajectories; however, this approach does not guarantee that the computed approximation contains the true reachable set. In this note we generalize [13] by partitioning the state vector into several components and analyzing the growth or contraction properties in the direction defined by each component. Unlike [13] which searches for a single growth or contraction rate to cover every direction of the state space, the new approach takes advantage of directions that offer more favorable rates. With this generalization we can now analyze the effect of constant but uncertain parameters by treating them as state variables and partitioning them into a separate direction along which no growth occurs. A related approach is employed in [16] where every state variable defines a separate direction; however, this may lead to overly conservative results since the dynamics associated with multiple state variables may possess a more favorable rate than the individual state variables in isolation. In Section 2 we present the main contraction result and a corollary that serves as the starting point for the reachability algorithm. In Section 3 we detail the algorithm and demonstrate with an example that it can significantly reduce the conservatism in [13] and [16]. In Section 4 we present a numerical procedure to search for weighted norms that yield a prescribed contraction rate, which can be incorporated in the reachability algorithm to adjust the weights to minimize the growth of the reachable set as it propagates through time. In the sequel we make use of matrix measures, as defined in [17]. Let | · | be a norm on Rn and let k · k denote the induced matrix norm. The measure µ(A) of a matrix A ∈ Rn×n is the upper right-hand derivative of k · k at I ∈ Rn×n in the direction of A: µ(A) , lim h→0+ kI + hAk − 1 . h (1) Unlike a norm the matrix measure can take negative values, as evident in the table below. Vector norm P |x|1 = j |xj | qP 2 |x|2 = j xj |x|∞ = maxj |xj | Induced matrix norm P kAk1 = maxj i |aij | p kAk2 = maxj λj (AT A) P kAk∞ = maxi j |aij | Induced matrix measure   P µ1 (A) = maxj ajj + i6=j |aij |   µ2 (A) = maxj 21 λj (A + AT )   P µ∞ (A) = maxi aii + j6=i |aij | Table 1: Commonly used vector norms and their corresponding matrix norms and measures. 2 Componentwise Contraction Consider the nonlinear dynamical system ẋ(t) = f (t, x(t)), x(t) ∈ Rn , (2) where f : [0, ∞) × Rn 7→ Rn is continuous in t and continuously differentiable in x. We partition the state vector x into k components, x = [xT1 · · · xTk ]T , where xi ∈ Rni , i = 1, . . . , k, and n1 + · · · + nk = 2 n. Likewise we decompose the n × n Jacobian matrix J(t, x) = (∂f /∂x)(t, x) into conformal blocks Jij (t, x) ∈ Rni ×nj , i, j = 1, . . . , k. The following proposition gives a growth bound between two trajectories of the system (2). Variants of this proposition appear in [18, 19, 20]; we provide an independent proof in Section 5. Proposition 1. Let C ∈ Rk×k be a constant matrix such that ( µ(Jii (t, x)) i = j Cij ≥ kJij (t, x)k i 6= j (3) for all (t, x) ∈ [0, T ] × D on some domain D ⊂ Rn . If x(·) and z(·) are two trajectories of (2) such that every trajectory starting on the line segment {sx(0) + (1 − s)z(0) : s ∈ [0, 1]} remains in D until time T , then     |x1 (t) − z1 (t)| |x1 (0) − z1 (0)|     .. .. (4)   ≤ exp(Ct)   ∀t ∈ [0, T ], . . |xk (t) − zk (t)| |xk (0) − zk (0)| 2 where ≤ denotes element-wise inequality. We can use a different vector norm for each component in (4), say | · |pi for xi (t) − zi (t), provided that we interpret (3) as ( µpi (Jii (t, x)) i=j Cij ≥ (5) kJij (t, x)kpi ,pj i 6= j, where µpi (·) is the matrix measure for | · |pi , and k · kpi ,pj is the mixed norm defined as kAkpi ,pj = max |Ax|pi . |x|pj =1 We next derive a corollary to Proposition 1 that is useful for reachability analysis. Let ξ(t, x0 ) denote the solution of (2) starting from x0 at t = 0, and define the reachable set at time t from initial set Z as Reacht (Z) , {ξ(t, z) : z ∈ Z}. Likewise define the reachable set over the time interval [0, T ] as Reach[0,T ] (Z) , ∪t∈[0,T ] Reacht (Z). Corollary 1. Let x(·) be a trajectory of (2) and define the norm ball of initial conditions B(1 ,··· ,k ) (x(0)) , {z : |x1 (0) − z1 | ≤ 1 , · · · , |xk (0) − zk | ≤ k }, centered at x(0). Suppose a coarse over-approximating set D ⊂ Rn is available such that Reach[0,T ] (B(1 ,··· ,k ) (x(0))) ⊂ D 3 (6) and C ∈ Rk×k satisfies (3) for all (t, x) ∈ [0, T ] × D. Then, ReachT (B(1 ,··· ,k ) (x(0))) ⊂ B(δ1 ,··· ,δk ) (x(T )) (7) where   δ1   ..   .  = exp(CT )  δk   1 ..  . .  k (8) 2 Corollary 1 relies on a coarse over-approximation D of the reachable set in (6) to find a constant matrix C satisfying (3). It then uses this C in (7)-(8) to find a more accurate over-approximation of the reachable set at the end of the time interval. One can choose D to be a bounded invariant set for the system (2), or the entire state space if a global upper bound exists on the right-hand side of (3). For a less conservative estimate one can find a bound on each component of the vector field f on an invariant set of interest, |fi (t, x)| ≤ Mi , i = 1, . . . , k, (9) and let D = B(1 +M1 T,··· ,k +Mk T ) (x(0)), (10) which gives a tighter bound when the interval length T is smaller. 3 Simulation-based Reachability Algorithm Given a sequence of simulation points x[l] , x(tl ), l = 0, 1, . . . , L, Algorithm 1 below tracks the evolution of the initial norm ball along this trajectory by applying Corollary 1 along with the bound (10) to each interval [tl , tl+1 ], l = 0, 1, . . . , L − 1. Algorithm 1 Algorithm for bounding reachable tube along a sample trajectory Require: Vector  = [1 , · · · , k ]T for the initial ball size, sequence of simulation points x[l] , x(tl ), l = 0, 1, . . . , L, and bounds M1 , · · · , Mk as in (9) 1: Set δ[0] =  2: for l from 0 to L − 1 do 3: Compute matrix Cl that satisfies (3) for 4: tl ≤ t ≤ tl+1 and x ∈ B(δ1 [l]+M1 (tl+1 −tl ),··· ,δk [l]+Mk (tl+1 −tl )) (x[l]). 5: Set δ[l + 1] = exp(Cl (tl+1 − tl ))δ[l] 6: end for 7: return Bδ1 [l],··· ,δk [l] (x[l]), l = 1, . . . , L A similar approach to reachability was pursued in [13], using the special case of Proposition 1 for k = 1. The choice k = 1 amounts to looking for a single growth or contraction rate to cover every direction of the state space, which is conservative when some directions offer more favorable rates than others. The other extreme, k = n, used in [16] can also lead to overly conservative results, since 4 the dynamics associated with multiple state variables may possess a more favorable rate than the individual state variables in isolation. The following example illustrates that intermediate choices of k may give tighter bounds than the extremes k = 1 and k = n. Example 1. We consider the harmonic oscillator ṗ(t) = ωq(t) (11) q̇(t) = −ωp(t) (12) and treat the constant frequency ω as a state variable satisfying ω̇(t) = 0, (13) so that we can view different values of ω as variations of the initial condition ω(0). Thus, the state vector is x = [p q ω]T and the Jacobian matrix for (11)-(13) is   0 ω q   (14) J(x) = −ω 0 −p . 0 0 0 If we partition x into k = 2 components as x1 = [p q]T and x2 = ω, then " # " # h i 0 ω q J11 (x) = J12 (x) = J21 (x) = 0 0 J22 (x) = 0, −ω 0 −p (15) and the matrix measures and norms induced by the Euclidean norm are p µ(J11 (x)) = 0, kJ12 (x)k = r , p2 + q 2 , kJ21 (x)k = 0, µ(J22 (x)) = 0. Thus, # " 0 r̄ C= 0 0 satisfies (3) on the invariant set r ≤ r̄, and it follows from Corollary 1 that the initial norm ball {(p, q, ω) : (p − p(0))2 + (q − q(0))2 ≤ 21 , |ω − ω(0)| ≤ 2 } (16) {(p, q, ω) : (p − p(T ))2 + (q − q(T ))2 ≤ δ12 , |ω − ω(T )| ≤ δ2 }, (17) evolves to where ω(T ) = ω(0) is the nominal frequency with which the sample trajectory is obtained, and δ1 = 1 + r̄2 T, δ2 = 2 (18) from (8). Note that (18) correctly predicts the absence of growth in the ω direction, while accounting for the effect of frequency variation on (p, q) by enlarging the radius of the corresponding ball to δ1 = 1 + r̄2 T . Algorithm 1 gives a tighter estimate of δ1 by applying Corollary 1 along with the 5 2 2 1 1 q 0 q 0 -1 -1 -2 -2 -2 -1 0 p 1 2 -2 -1 0 p 1 2 Figure 1: Algorithm 1 applied to a sample trajectory of (11)-(13) with ω = 1. The initial norm ball is as in (16) with 1 = 0.1. The plot on the left takes 2 = 0.02, which means a ±2% uncertainty around the nominal frequency ω = 1. This uncertainty leads to a growth of the radius of the norm ball in the (p, q) direction. The plot on the right takes 2 = 0 and, since there is no uncertainty in the frequency, the radius of the norm ball in the (p, q) direction remains constant. The bound M1 p used in the algorithm is calculated on the invariant set p2 + q 2 ≤ 2. bound (10) in every interval [tl , tl+1 ], l = 0, 1, . . . , L − 1, of the simulated trajectory. A result of this algorithm is shown in Figure 1 (left) when w = 1 and 2 = 0.02, that is when a ±2% uncertainty is allowed around the nominal frequency. The right panel shows the result with 2 = 0, in which case there is no uncertainty in frequency and the radius of the norm ball remains constant. In this example we applied Proposition 1 by partitioning the state into k = 2 components. The alternative choice k = 1 (no partition) amounts to searching for a single growth rate in each direction and fails to identify the lack of change in the ω direction. Indeed the matrix measure of (14) is positive for any choice of the norm and, thus, the norm ball grows in every direction. The choice k = 3 is also overly conservative because it misses the non-expansion property of the combined (p, q) dynamics (11)-(12), instead applying (8) with a matrix of the form   0 ω̄ r̄   C = ω̄ 0 r̄  , 0 0 0 which falsely predicts a rapid growth of the norm ball in the (p, q) direction even when no uncertainty is present in the frequency. 4 Automatic Selection of Weighted Norms In [13] we demonstrated that bounding the matrix measure induced by weighted 1-, 2- or ∞-norms can be expressed as constraints that are convex functions of the weights. We used this fact to develop a heuristic for minimizing growth of the reachable set as it propagates through time. The 6 authors of [21] use the linear matrix inequality (LMI) constraint corresponding to the weighted 2norm together with interval bounds on the Jacobian to argue that optimal bounds on the Jacobian matrix measure can be computed automatically by solving a sequence of semidefinite programs (SDPs). In this section, we demonstrate how these types of methods can be extended to the case of componentwise contraction. In Proposition 2 we show that for a fixed matrix C the set of weight matrices for which a weighted 2-norm version of (3) holds is a convex set that can be expressed as the conjunction of an infinite number of LMIs. Then in Proposition 3 we show how polytopic bounds on the Jacobian can be exploited to compute an inner approximation of the set of feasible weight matrices, enabling weight matrices to be selected automatically using a standard numerical SDP solver. We begin with two Lemmas that demonstrate how weighted matrix measure and norm bounds can be expressed as LMIs. Throughout this section the inequality symbol A  B is used to denote that B − A is a positive semidefinite matrix. Lemma 1. (Lemma 2 of [22]) If ΓA + AT Γ  2cΓ where Γ is a positive definite matrix then µ(A) ≤ c in the norm x → |P x|2 where P = Γ1/2  0. Lemma 2. If AT Γi A  c2 Γj where Γi and Γj are positive definite matrices and c ≥ 0 then kAk ≤ c where k · k denotes the mixed norm kAk = max |Pi Ax|2 |Pj x|2 =1 1/2 where Pi = Γi 1/2 and Pj = Γj . Proof. AT Γi A  c2 Γj implies that for all x |Pi Ax|22 = xT AT Γi Ax ≤ c2 xT Γj x = c2 |Pj x|22 . Thus kAk2 = max |Pi Ax|22 ≤ c2 , |Pj x|2 =1 or equivalently kAk ≤ c. Combining Lemmas 1 and 2 along with the reasoning used to derive Equation (5), we arrive at the following result: Proposition 2. Given a matrix C ∈ Rk×k , the search for weighted Euclidean norms xi 7→ |Pi xi | for i = 1, . . . , k in which (3) is satisfied can be formulated as a semidefinite program: find subject to Γ1 , . . . , Γk Γi  0, ∀i = 1, . . . , k Γi Jii (t, x) + Jii (t, x)T Γi  2cii Γi , Jij (t, x)T Γi Jij (t, x)  c2ij Γj ∀(t, x) ∈ [0, T ] × D, ∀(t, x) ∈ [0, T ] × D, 7 ∀i = 1, . . . , k ∀j 6= i, i = 1, . . . , k (19) where Γi = PiT Pi . Note that (19) contains an infinite number of LMI constraints and therefore cannot be solved numerically using a standard SDP solver. To address this we show how a conservative inner approximation of the feasible set can be defined in terms of a finite conjunction of LMIs. Before stating this result, we prove the following lemma which shows how an infinite family of LMIs can be conservatively approximated by a finite family of LMIs by assuming the existence of polytopic bounds on the coefficient matrices. Lemma 3. For all i = 0, . . . , n let Fi (z) be a family of symmetric matrices parameterized by z ∈ Z. Assume that there exist a finite set of matrices {Fiki : ki = 1, . . . , Ni ; i = 0, . . . , n} such that for each i the family Fi (z) is bounded by the matrix polytope with vertices Fiki : {Fi (z) : z ∈ Z} ⊆ Conv({Fiki : ki = 1, . . . , Ni }) (20) where Conv denotes the convex hull. Then F0k0 + x1 F1k1 + . . . xn Fnkn  0 ∀(k0 , . . . kn ) ∈ [N0 ] × · · · × [Nn ], where [Ni ] := {1, . . . , Ni }, implies F0 (z) + x1 F1 (z) + · · · + xn Fn (z)  0 ∀z ∈ Z. Proof. Let z ∈ Z. Using the assumption (20) we know that for each i there exist nonnegative P P weights λiki with ki λiki = 1 such that Fi (z) = ki λiki Fiki . Therefore F0 (z) + x1 F1 (z) + · · · + xn Fn (z) X X X = λ0k0 F0k0 + x1 λ1k1 F1k1 + · · · + xn λnkn Fnkn k0 k1 kn      X X Y X Y X   = λjkj   λ0k0 F0k0  + · · · + xn λjkj   λnkn Fnkn   = j6=0 kj X X k0 ··· k0 j6=n kj kn (λ0k0 . . . λnkn )(F0k0 + x1 F1k1 + . . . xn Fnkn ) kn  0. We now state a result that allows us to find a set of weights satisfying (3) by solving only a finite set of LMIs. Proposition 3. For each i let {Ei`i : `i = 1, . . . , ni (ni + 1)/2} be a basis for the space of ni × ni symmetric matrices. Suppose that there exist matrices such that {Ei`i Jii (t, x) + Jii (t, x)T Ei`i : (t, x) ∈ [0, T ] × D} ⊆ Conv({Fi`i ki`i : ki`i ∈ [Ni`i ]}) 8 and {Jij (t, x)T Ei`i Jij (t, x) : (t, x) ∈ [0, T ] × D} ⊆ Conv({F̃ij`i kij`i : kij`i ∈ [Nij`i ]}). Then any solution to the SDP find subject to xi`i ∀i ∈ [k] ∀`i ∈ [ni (ni + 1)/2] X xi`i Ei`i  0, ∀i ∈ [k] `i X xi`i Fi`i ki`i  2cii X `i xi`i Ei`i , ∀i ∈ [k] `i ∀(ki1 , . . . , ki,ni (ni +1)/2 ) ∈ [Ni1 ] × · · · × [Ni,ni (ni +1)/2 ] X xi`i F̃ij`i kij`i  c2ij X `i xj`j Ejkj ∀i ∈ [k] ∀j ∈ [k] \ {i} `j ∀(kij1 , . . . , kij,ni (ni +1)/2 ) ∈ [Nij1 ] × · · · × [Nij,ni (ni +1)/2 ] (21) yields a solution Γi = P `i xi`i Ei`i to (19). The proof follows in a straightforward manner from (19) by expanding the decision variables P as Γi = `i xi`i Ei`i then applying Lemma 3. Note that if D is compact and (t, x) 7→ J(t, x) is continuous, it is always possible to find a collection of such matrices F and F̃ . 5 Proof of Proposition 1 Let ψ(t, s) denote the solution of (2) with initial condition sx(0) + (1 − s)z(0); that is, ∂ψ(t, s) = f (t, ψ(t, s)) ∂t ψ(0, s) = sx(0) + (1 − s)z(0). (22) (23) In particular, ψ(t, 1) = x(t) and ψ(t, 0) = z(t). (24) Taking the derivative of both sides of (22) with respect to s we get ∂ 2 ψ(t, s) ∂f (t, ψ(t, s)) ∂ψ(t, s) = = J(t, ψ(t, s)) , ∂t∂s ∂s ∂s which means that the variable w(t, s) , ∂ψ(t, s) ∂s (25) satisfies ∂w(t, s) = J(t, ψ(t, s))w(t, s). ∂t We then conclude from Lemma 4 below that X D+ |wi (t, s)| ≤ µ(Jii (t, ψ(t, s)))|wi (t, s)| + kJij (t, ψ(t, s))k|wj (t, s)|, j6=i 9 (26) (27) where D+ denotes the upper right-hand derivative with respect to t. Since ψ(t, s) ∈ D for t ∈ [0, T ] and (3) holds for all (t, x) ∈ [0, T ] × D, we conclude X D+ |wi (t, s)| ≤ Cii |wi (t, s)| + Cij |wj (t, s)|. (28) j6=i This means that     |w1 (t, s)| |w1 (t, s)|     .. .. D+  ≤C  . . |wk (t, s)| |wk (t, s)| and, since the matrix C is Metzler (Cij theorems for positive systems that  |w1 (t, s)|  ..  . (29) ≥ 0 when i 6= j), it follows from standard comparison    |w1 (0, s)|    ..  ≤ exp(Ct)  . . |wk (t, s)| |wk (0, s)| (30) Note from (25) and (23) that w(0, s) = ∂ψ(0, s) = x(0) − z(0) ∂s (31) and, thus,     |w1 (0, s)| |x1 (0) − z1 (0)|     .. ..  = . . . |wk (0, s)| |xk (0) − zk (0)| (32) Substituting (32) in (30) we get     |w1 (t, s)| |x1 (0) − z1 (0)|     .. ..   ≤ exp(Ct)  . . . |wk (t, s)| |xk (0) − zk (0)| (33) Next, note from (24) that Z x(t) − z(t) = ψ(t, 1) − ψ(t, 0) = 0 1 ∂ψ(t, s) ds = ∂s Z 1 w(t, s)ds, (34) 0 which implies   R1  |x1 (t) − z1 (t)| 0 |w1 (t, s)|ds     .. ..  ≤ . . . R1 |xk (t) − zk (t)| 0 |wk (t, s)|ds  (35) Noting from (33) that  R1    |w1 (t, s)|ds |x1 (0) − z1 (0)|     .. ..   ≤ exp(Ct)   . . R1 |xk (0) − zk (0)| 0 |wk (t, s)|ds 0 (36) 2 and combining with (35) we obtain (4). 10 Lemma 4. Consider the linear time-varying system ẇ(t) = A(t)w(t), w(t) ∈ Rn , (37) where A(·) is continuous. Suppose we decompose A(t) ∈ Rn×n into blocks Aij (t) ∈ Rni ×nj , i, j = 1, . . . , k such that n1 + · · · + nk = n, and let wi (t) ∈ Rni , i = 1, . . . , k, constitute a conformal partition of w(t) ∈ Rn . Then D+ |wi (t)| , lim h→0+ X |wi (t + h)| − |wi (t)| ≤ µ(Aii (t))|wi (t)| + kAij (t)k|wj (t)|. h (38) j6=i Proof of Lemma 4: Note that lim h→0+ |wi (t + h)| − |wi (t)| h = = lim h→0+ lim |wi (t) + hẇi (t)| − |wi (t)| h P |wi (t) + hAii (t)wi (t) + h j6=i Aij (t)wj (t)| − |wi (t)| h X |wi (t) + hAii (t)wi (t)| − |wi (t)| ≤ lim +| Aij (t)wj (t)| h h→0+ h→0+ j6=i ≤ lim h→0+ kI + hAii (t)k − 1 |wi (t)| + h Then (38) follows from the definition of the matrix norm, (1). X kAij (t)k |wj (t)|. j6=i 2 References [1] J. Kapinski, J. V. Deshmukh, X. Jin, H. Ito, and K. Butts. Simulation-based approaches for verification of embedded control systems: An overview of traditional and advanced modeling, testing, and verification techniques. IEEE Control Systems, 36(6):45–64, Dec 2016. [2] P. Tabuada. Verification and control of hybrid systems: a symbolic approach. Springer, 2009. [3] I.M. Mitchell, A.M. Bayen, and C.J. Tomlin. A time-dependent Hamilton-Jacobi formulation of reachable sets for continuous dynamic games. IEEE Trans. Autom. Control, 50(7):947–957, 2005. [4] M. Althoff, O. Stursberg, and M. Buss. Reachability analysis of nonlinear systems with uncertain parameters using conservative linearization. In IEEE Conf. Decision Control, pages 4042–4048, 2008. [5] A. Chutinan and B.H. Krogh. Computational techniques for hybrid system verification. IEEE Trans. Autom. Control, 48(1):64–75, 2003. [6] Youdong Lin and Mark A. Stadtherr. Validated solutions of initial value problems for parametric ODEs. Appl. Numer. Math., 57(10):1145–1162, 2007. 11 [7] M. Neher, K. R. Jackson, and N. S. Nedialkov. On Taylor model based integration of ODEs. SIAM J. Numer. Anal, 45, 2007. [8] V. Lakshmikantham and S. Leela. Differential and Integral Inequalities, volume 1. Academic Press, New York, 1969. [9] Joseph K. Scott and Paul I. Barton. Bounds on the reachable sets of nonlinear control systems. Automatica, 49(1):93–100, 2013. [10] Alexandre Donzé and Oded Maler. Systematic simulation using sensitivity analysis. In Hybrid Sys.: Comp. Control, pages 174–189. Springer-Verlag, 2007. [11] Zhenqi Huang and Sayan Mitra. Computing bounded reach sets from sampled simulation traces. In Hybrid Sys.: Comp. Control, pages 291–294, 2012. [12] A. Agung Julius and George J. Pappas. Trajectory based verification using local finite-time invariance. In Hybrid Sys.: Comp. Control, pages 223–236. Springer, 2009. [13] John Maidens and Murat Arcak. Reachability analysis of nonlinear systems using matrix measures. IEEE Transactions on Automatic Control, 60(1):265 – 270, 2015. [14] J.-J. Lohmiller, W. Slotine. On contraction analysis for nonlinear systems. 34:683–696, 1998. [15] Eduardo D. Sontag. Contractive systems with inputs. In Perspectives in Mathematical System Theory, Control, and Signal Processing, pages 217–228. Springer-Verlag, 2010. [16] Matthias Rungger and Majid Zamani. SCOTS: a tool for the synthesis of symbolic controllers. In Proceedings of the 19th International Conference on Hybrid Systems: Computation and Control, HSCC ’16, 2016. [17] C.A. Desoer and M. Vidyasagar. Feedback Systems: Input-Output Properties. Society for Industrial and Applied Mathematics, Philadelphia, 2009. Originally published by Academic Press, New York, 1975. [18] T. Kapela and P. Zgliczyński. A Lohner-type algorithm for control systems and ordinary differential equations. Discrete and Continuous Dynamical Systems Series B, 11(2):365–385, 2009. [19] G. Russo, M. di Bernardo, and E. D. Sontag. A contraction approach to the hierarchical analysis and design of networked systems. IEEE Transactions on Automatic Control, 58(5):1328– 1331, 2013. [20] G. Reissig, A. Weber, and M. Rungger. Feedback refinement relations for the synthesis of symbolic controllers. IEEE Transactions on Automatic Control, 62(4):1781–1796, 2017. [21] Chuchu Fan, James Kapinski, Xiaoqing Jin, and Sayan Mitra. Locally optimal reach set overapproximation for nonlinear systems. In Proceedings of the 13th International Conference on Embedded Software, EMSOFT ’16, pages 6:1–6:10, 2016. 12 [22] Z. Aminzare, Y. Shafi, M. Arcak, and E.D. Sontag. Guaranteeing spatial uniformity in reactiondiffusion systems using weighted L2 -norm contractions. In V. Kulkarni, G.-B. Stan, and K. Raman, editors, A Systems Theoretic Approach to Systems and Synthetic Biology: Models and System Characterizations, pages 73–102. Springer-Verlag, 2014. 13
3cs.SY
ALGEBRAIC INVARIANTS OF PROJECTIVE MONOMIAL CURVES ASSOCIATED TO GENERALIZED ARITHMETIC SEQUENCES arXiv:1512.00617v1 [math.AC] 2 Dec 2015 ISABEL BERMEJO *, EVA GARCÍA-LLORENTE *, AND IGNACIO GARCÍA-MARCO A BSTRACT. Let K be an infinite field and let m1 < · · · < mn be a generalized arithmetic sequence of positive integers, i.e., there exist h, d, m1 ∈ Z+ such that mi = hm1 + (i − 1)d for all i ∈ {2, . . . , n}. We consider the projective monomial curve C ⊂ PnK parametrically defined by x1 = sm1 tmn −m1 , . . . , xn−1 = smn−1 tmn −mn−1 , xn = smn , xn+1 = tmn . In this work, we characterize the Cohen-Macaulay and Koszul properties of the homogeneous coordinate ring K[C] of C. Whenever K[C] is Cohen-Macaulay we also obtain a formula for its Cohen-Macaulay type. Moreover, when h divides d, we obtain a minimal Gröbner basis G of the vanishing ideal of C with respect to the degree reverse lexicographic order. From G we derive formulas for the Castelnuovo-Mumford regularity, the Hilbert series and the Hilbert function of K[C] in terms of the sequence. 1. I NTRODUCTION Let R = K[x1 , . . . , xn+1 ] be the polynomial ring in n + 1 variables over an infinite field K, where n ≥ 2. Let m1 < · · · < mn be positive integers and consider the projective monomial curve C ⊂ PnK parametrically defined by x1 = sm1 tmn −m1 , . . . , xn−1 = smn−1 tmn −mn−1 , xn = smn , xn+1 = tmn . Consider the K-algebra homomorphism ϕ : R → K[s, t] induced by ϕ(xi ) = smi tmn −mi for i ∈ {1, . . . , n − 1}, ϕ(xn ) = smn and ϕ(xn+1 ) = tmn . Since K is infinite, the prime ideal ker(ϕ) ⊂ R is the vanishing ideal I(C) of C (see, e.g., [13, Corollary 7.1.12]). Thus, R/I(C) is the homogenous coordinate ring K[C] of C. Moreover, I(C) is a homogeneous binomial ideal (see, e.g., [12, Lemmas 4.1 and 4.14]). The Castelnuovo-Mumford regularity , or regularity, of K[C] is defined as follows: if 0→ βp M j=1 R(−epj ) − → ··· − → β1 M R(−e1j ) − →R− → K[C] → 0 j=1 is a minimal graded free resolution of K[C], then reg(K[C]) := max{eij − i; 1 ≤ i ≤ p, 1 ≤ j ≤ βi } (see, e.g., [9] or [1] for equivalent definitions). Whenever K[C] is Cohen-Macaulay, the integer βp is the Cohen-Macaulay type of K[C]; in addition, if βp = 1, the K-algebra K[C] is Gorenstein. The corresponding ideal, I(C), is a complete intersection if it can be generated by a set of n − 1 polynomials. K[C] is said to be a Koszul algebra if its residue class field K has a linear free resolution as K[C]-module. The study of Koszul algebras is a topic of considerable current interest, for a recent account of the theory we refer the reader to [8]. For all s ∈ N, we denote by Rs the K-vector space spanned by all homogeneous polynomials of degree s. The Hilbert function P and Hilbert series of K[C] are HFK[C] (s) := dimK (Rs /I(C) ∩ Rs ) for all s ∈ N, and HK[C] (t) := s∈N HFK[C](s) ts , respectively. In this paper we study the already mentioned invariants and properties when m1 < · · · < mn is a generalized arithmetic sequence of relatively prime integers, i.e., there exist h, d, m1 ∈ Z+ such that mi = hm1 + (i − 1)d for each i ∈ {2, . . . , n} and gcd{m1 , d} = 1. In this context, we prove that K[C] is Cohen-Macaulay if and only if m1 < · · · < mn is an arithmetic sequence. It is The three authors are partially supported by Ministerio de Economía y Competitividad, Spain MTM2013-40775-P. 1 2 ISABEL BERMEJO *, EVA GARCÍA-LLORENTE *, AND IGNACIO GARCÍA-MARCO remarkable that this result is obtained as a consequence of a new result providing a large family of projective monomial curves that are not arithmetically Cohen-Macaulay. We also provide an alternative proof of [3, Theorem 6.1], where we determine that I(C) is a complete intersection if and only if either n = 2 or n = 3, h = 1 and m1 is even. Moreover, we prove that K[C] is Koszul if and only if m1 , . . . , mn are consecutive numbers and n > m1 . In addition, we study in detail when m1 < · · · < mn is a generalized arithmetic sequence and h divides d. In this setting we provide a formula for reg(K[C]). To this end, our main reference is [6]. In this paper, the authors prove that for any projective monomial curve C, the regularity of K[C] is equal to the regularity of R/in(I(C)), where in(I(C)) denotes the initial ideal of I(C) with respect to the degree reverse lexicographic order with x1 > · · · > xn+1 (see [6, Section 4]). Moreover, they obtain that the regularity of R/in(I(C)) is the maximum of the regularities of the irreducible components of in(I(C)) (see [6, Corollary 3.17]). Since the regularity of an irreducible monomial ideal is easy to compute, our strategy consists of obtaining a minimal Gröbner basis G of I(C) with respect to the degree reverse lexicographic order with x1 > · · · > xn+1 . From G, we get the irreducible components of in(I(C)), which allow us to deduce the value of reg(K[C]) in terms of the arithmetic sequence m1 < · · · < mn . For obtaining this result we separate two cases: the Cohen-Macaulay case, i.e., when m1 < · · · < mn is an arithmetic sequence (Section 2); and the non Cohen-Macaulay one, i.e., when h ≥ 2 and h divides d (Section 3). We also exploit the knowledge of G to describe Hilbert series and the Hilbert function of K[C]. Additionally, in the Cohen-Macaulay case, we provide a formula for its Cohen-Macaulay type yielding a characterization of the Gorenstein property. The results in the Cohen-Macaulay case extend in a natural way those of [11] that consider the particular setting where {m1 , . . . , mn } form a minimal set of generators of the semigroup they generate. The contents of the paper are the following. Section 2 is devoted to arithmetic sequences. The key result is Theorem 2.2, which provides G. As a byproduct, we derive in Corollary 2.3 that the homogeneous coordinate ring of any projective monomial curve associated to an arithmetic sequence is Cohen-Macaulay. Proposition 2.5 gives the irreducible components of in(I(C)). As a consequence of this, in Theorem 2.7, we get the value of the regularity of K[C] in terms of the sequence m1 < · · · < mn . In Theorems 2.9, 2.11 and 2.13 we provide the Hilbert series, the Hilbert function and the Cohen-Macaulay type of K[C]. In addition, we give in Corollary 2.14 a characterization of the Gorenstein property for K[C]. In the third section we begin by providing in Theorem 3.1 a large family of projective monomial curves whose corresponding coordinate ring is not Cohen-Macaulay. More precisely, we prove that K[C] is not Cohen-Macaulay whenever C is the projective monomial curve associated to a sequence of integers containing a generalized arithmetic sequence of at least l ≥ 3 terms satisfying some additional hypotheses. The rest of this section concerns when m1 < · · · < mn is a generalized arithmetic sequence and n ≥ 3. In particular, as a byproduct of Theorem 3.1, we derive in Corollary 3.2 that in this setting K[C] is not Cohen-Macaulay unless m1 < · · · < mn is an arithmetic sequence, i.e., if h = 1. As a consequence of this we characterize in Corollary 3.3 the complete intersection property for I(C). Then, we study in detail the setting where h > 1 and h divides d. Under these hypotheses, we obtain the Gröbner basis G in Theorem 3.10, which also is a minimal set of generators of I(C). In Proposition 3.13 we present the irreducible decomposition of in(I(C)). The formula for reg(K[C]) is provided in Theorem 3.14, while in Corollary 3.15 we prove that the regularity is always attained at the last step of the minimal graded free resolution. The Hilbert series, the Hilbert function and the Hilbert polynomial are given in Theorems 3.16, 3.18 and Corollary 3.19, respectively. The last section is devoted to the study of the Koszul property for K[C]. In particular, Theorem 4.1 characterizes when K[C] is a Koszul algebra when m1 < · · · < mn is a generalized arithmetic ALG. INVARIANTS OF PROJECTIVE MON. CURVES ASSOC. TO GENERALIZED ARITHMETIC SEQUENCES 3 sequence. Finally, we also characterize the Koszul property when n = 3 (Theorem 4.3) and when n = 4 (Theorem 4.4). 2. A RITHMETIC SEQUENCES This section concerns the study of K[C] when m1 < · · · < mn an arithmetic sequence of relatively prime integers and n ≥ 2. The key point of this section is to prove Theorem 2.2, where we describe a minimal Gröbner basis G of I(C) with respect to the degree reverse lexicographic order with x1 > · · · > xn+1 . We begin with a technical lemma. In it we associate to the sequence m1 < · · · < mn a pair (α, k) ∈ N2 . This pair of integers plays an important role in the rest of the paper. Lemma 2.1. Take q ∈ N and r ∈ {1, . . . , n − 1} such that m1 = q(n − 1) + r and set α := q + d and k := n − r. Then, (a) αm1 + mi = mn−k+i + qmn forPall i ∈ {1, . . . , k}, (b) α + 1 = min {b ∈ Z+ | b m1 ∈ ni=2 Nmi }. P Proof. Being (a) trivial, let us prove (b). Set M := min {b ∈ Z+ | b m1 ∈ ni=2 Nmi }. By (a) it follows that (α + 1)m1 = mn−k+1 + qmn , so M ≤ α + 1. Assume by contradiction that M ≤ α. We have that n X (1) Mm1 = δi mi for some δ2 , . . . , δn ∈ N. i=2 We are proving the following facts which clearly lead to a contradiction: P (i) M − Pni=2 δi > 0, (ii) M − ni=2 δi <Pd, and (iii) d divides M − ni=2 δi . P P d, which gives From (1) we get (i). Also from (1) we have (M − ni=2 δi ) m1 = ni=2 (i − 1)δiP n (iii) because gcd{m , d} = 1. From (1) and the assumption M ≤ α, we obtain ( 1 i=2 δi ) mn ≥ Pn i=2 δi mi = Mm1 = Mmn − M(n − 1)d ≥ Mmn − α(n − 1)d > (M − d) mn . This proves (ii) and completes the proof of (b).  Following the notation of Lemma 2.1, we can state the main result of this section. Theorem 2.2. G = {xi xj − xi−1 xj+1 | 2 ≤ i ≤ j ≤ n − 1} ∪ {xα1 xi − xn+1−i xqn xdn+1 | 1 ≤ i ≤ k} is a minimal Gröbner basis of I(C) with respect to the degree reverse lexicographic order. Proof. One can easily check that G ⊆ I(C) by using Lemma 2.1.(a). Let us prove that in(I(C)) ⊆ hin(G)i where in(G) = {xi xj | 2 ≤ i ≤ j ≤ n − 1} ∪ {xα1 xi | 1 ≤ i ≤ k}. By contradiction, suppose that in(I(C)) 6⊆ hin(G)i. We claim that there exist two monomials l1 , l2 ∈ / hin(G)i such that l1 − l2 ∈ I(C). Indeed, if in(I(C)) 6⊆ hin(G)i, then the cosets of {l | l is a monomial and l ∈ / hin(G)i} do not form a K-basis of K[C]. / hin(G)i Pt Then there exist monomials l1 , . . . , lt ∈ and λ1 , . . . , λt ∈ K \ {0} such that f = i=1 λi li ∈ I(C). Since ϕ(f ) = 0 and ϕ(l1 ) 6= 0, there exists j ∈ {2, . . . , t} such that ϕ(l1 ) = ϕ(lj ). Suppose that j = 2, then l1 − l2 ∈ I(C) and l1 , l 2 ∈ / hin(G)i. We can also assume that gcd{l1 , l2 } = 1 because I(C) is prime. Since in(G) = {xi xj | 2 ≤ i ≤ j ≤ n − 1} ∪ {xα1 xi | 1 ≤ i ≤ k}, we may assume that δ 2 1 , where: and l2 = xjj xbn2 xcn+1 l1 = xa1 xδi i xbn1 xcn+1 (a) 0 ≤ a ≤ α, (b) 2 ≤ i, j ≤ n − 1, i 6= j, (c) δi , δj ∈ {0, 1}, 4 ISABEL BERMEJO *, EVA GARCÍA-LLORENTE *, AND IGNACIO GARCÍA-MARCO (d) b1 , b2 , c1 , c2 ≥ 0, and (e) if a = α and δi = 1, then i > k (otherwise l1 ∈ hin(G)i). Moreover, since ϕ(l1 ) = ϕ(l2 ), we get that am1 + δi mi + b1 mn = δj mj + b2 mn . If a = 0, we may assume that b1 = 0 because gcd{l1 , l2 } = 1. However, in this setting we have that δi mi = δj mj + b2 mn , but this implies that b2 = 0 and that mi = mj . Hence l1 = l2 , a contradiction. From now on, we assume that a ≥ 1. Firstly, we observe that b1 = 0; otherwise b2 = 0 and am1 + δi mi + b1 mn ≥ mn > δj mj , a contradiction. Hence, we get that (2) am1 + δi mi = δj mj + b2 mn . We consider several different cases: Case 1: If δi = 0 then (2) becomes am1 = δj mj + b2 mn . By Lemma 2.1.(b), we get that a ≥ α + 1, a contradiction. Case 2: If δj = 0 then (2) becomes am1 + δi mi = b2 mn . From Lemma 2.1 we get that a = α, then δi = 1 and i = k, a contradiction. Case 3: If δi = δj = 1, then am1 + mi = mj + b2 mn from (2). Subcase 3.1: If i > j, one can derive that am1 = mn−i+j + (b2 − 1)mn . By Lemma 2.1.(b), this implies that a ≥ α + 1, a contradiction. Subcase 3.2: If i < j, one can easily obtain that am1 + mn−j+i = (b2 + 1)mn , which implies that a ≥ α. Thus, a = α and n − j + 1 = k, a contradiction to (e). Moreover, one can easily check that G is minimal.  We observe in Theorem 2.2 that the variables xn and xn+1 do not appear in the minimal set of generators of in(I(C)). Thus we apply [5, Proposition 2.1] to deduce the following result. Corollary 2.3. K[C] is Cohen-Macaulay. It is worth mentioning that this result is a generalization of [11, Proposition 1.2] where the authors obtain the result in a more P restrictive setting, i.e., when {m1 , . . . , mn } is a minimal system of generators of the semigroup ni=1 Nmi . It is worth mentioning that our techniques are different from theirs. Remark 2.4. The Gröbner basis G provided in Theorem 2.2 is also a minimal set of generators of I(C), see [10, Remark  3.13]. Thus, the first Betti number β1 in the minimal graded free resolution n−1 of K[C] equals 2 + k. Our next objective is to provide an explicit description of the irredundant irreducible decomposition of the initial ideal in(I(C)) of I(C) with respect to the degree reverse lexicographic order. An ideal is irreducible if it cannot be written as intersection of two ideals properly containing it. A monomial ideal is irreducible if it is generated by pure powers of variables (see, e.g., [13, Proposition 5.1.6]). Moreover, an irreducible decomposition of a monomial ideal is an expression of it as intersection of irreducible monomial ideals. If there is no redundant ideal in the intersection, this expression is unique (see, e.g., [13, Theorem 5.1.17]) and we call it the irredundant irreducible decomposition of I. Proposition 2.5. Let α, k be the as in Lemma 2.1. (1) If k < n − 1, then Tn−1 α+δi hx1 , x2 , . . . , xi−1 , x2i , xi+1 , . . . , xn−1 i in(I(C)) = i=2 is the irredundant irreducible decomposition of in(I(C)), where δi = 0 if i ∈ {2, . . . , k} and δi = 1 if i ∈ {k + 1, . . . , n − 1}. (2) If k = n − 1, then Tn−1 α  in(I(C)) = T i=2 hx1 , x2 , . . . , xi−1 , x2i , xi+1 , . . . , xn−1 i , x2 , . . . , xn−1 i hxα+1 1 ALG. INVARIANTS OF PROJECTIVE MON. CURVES ASSOC. TO GENERALIZED ARITHMETIC SEQUENCES 5 is the irredundant irreducible decomposition of in(I(C)). i Proof. Let us denote Ai := hxα+δ , x2 , . . . , xi−1 , x2i , xi+1 , . . . , xn−1 i, for every i ∈ {2, . . . , n − 1}, 1 with δi = 0 if i ∈T{2, . . . , k} and δi = 1 if i ∈ {k + 1, . . . , n − 1}, and B := hxα+1 , x2 , . . . , xn−1 i. 1 T n−1 n−1 We denote A := i=2 Ai if k < n−1, or A := i=2 Ai ∩B otherwise, and we aim at proving that in(I(C)) = A. From Theorem 2.2, we have that {xi xj | 2 ≤ i ≤ j ≤ n − 1} ∪ {xα1 xi | 1 ≤ i ≤ k} is a minimal system of generators of in(I(C)) with respect to the degree reverse lexicographic order with x1 > · · · > xn+1 . We observe that in(I(C)) ⊆ Ai for all i ∈ {2, . . . , n − 1} and, if k = n − 1, that in(I(C)) ⊆ B. Thus in(I(C)) ⊆ A. In order to see the reverse inclusion, we take a monomial l ∈ / in(I(C)). We have three possibilities: (a) l = xa1 xi xbn xcn+1 with 0 ≤ a < α, i ∈ {2, . . . , n − 1} and b, c ≥ 0, (b) l = xa1 xbn xcn+1 with 0 ≤ a ≤ α and b, c ≥ 0, or (c) l = xα1 xi xbn xcn+1 with i ∈ {k + 1, . . . , n − 1} and b, c ≥ 0. If (a) holds, then l ∈ / Ai . In (b), we have that l ∈ / An−1 if k < n − 1 and l ∈ / B if k = n − 1. In (c), we observe that k < i ≤ n − 1, and then l ∈ / Ai . Thus, in(I(C)) = A. It only remains to see that there is no redundant ideal in the intersection. For all i ∈ {2, . . . , n − 1}, we observe that xi ∈ Aj for all j 6= i, and xi ∈ B if k = n − 1, but xi ∈ / in(I(C)); hence Ai is α / in(I(C)), hence B not redundant. If k = n − 1, then x1 ∈ Ai for all i ∈ {2, . . . , n − 1}, but xα1 ∈ is not redundant.  As we claimed in the Introduction, reg(K[C]) = reg(R/in(I(C))) and the regularity of R/in(I(C)) can be expressed in terms of the Castelnuovo-Mumford regularity of the irreducible components of in(I(C)). This is due to the fact that in(I(C)) is a monomial ideal of nested type, i.e., its associated primes are of the form (x1 , . . . , xi ) for various i. The following result states this relation. Lemma 2.6. [6, Corollary 3.17] Let I ⊂ R be a monomial ideal of nested type, and let I = q1 ∩ · · · ∩ qr be its irredundant irreducible decomposition. Then, reg(R/I) = max{reg(R/qi ); 1 ≤ i ≤ r} Moreover, for q an irreducible monomial ideal whose monomial minimal generators have degrees d1 , . . . , ds it is known that reg(R/q) = d1 + · · · + ds − s (see, e.g., [5, Remark 2.3]). The following result gives the value of the regularity of K[C] in terms of the arithmetic sequence. Theorem 2.7. Let m1 < · · · < mn be an arithmetic sequence with gcd {m1 , d} = 1. Then,   mn − 1 reg(K[C]) = . n−1 Proof. We take α, k as in Lemma 2.1. A direct application of Proposition 2.5 and Lemma 2.6 yields  α + 1 if k < n − 1, reg(K[C]) = α if k = n − 1. We observe that k = n − 1 if and if mn ≡ 1 (mod n − 1). Hence, if k = n − 1, then  only  m −1 m1 −1 mn −1 n α = q + d = n−1 + d = n−1 = n−1 . Moreover, if k 6= n − 1, then α + 1 = q + d + 1 =  m1 −1   mn −1   mn −1  + d + 1 = + 1 = .  n−1 n−1 n−1 Now we exploit the description of in(I(C)) to provide an explicit description of the Hilbert series, the Hilbert function and the Cohen-Macaulay type of K[C]. These results have also been obtained inP[11] in the more restrictive setting when {m1 , . . . , mn } is a minimal system of generators of ni=1 Nmi . Before going to the particular case when m1 < · · · < mn is an arithmetic 6 ISABEL BERMEJO *, EVA GARCÍA-LLORENTE *, AND IGNACIO GARCÍA-MARCO sequence, we introduce a general result expressing the Hilbert series of K[C] in terms of the monomials not belonging to in(I(C)). This result applies to any projective monomial curve. Proposition 2.8. Let m1 < · · · < mn be a sequence of positive integers. The Hilbert series of K[C] is P P |γ| t |γ| − t xγ ∈J / +hxn+1 i t xγ ∈J+hx / n ,xn+1 i xn xγ ∈J HK[C](t) = , (1 − t)2 P n+1 and J := in(I(C)). Moreover, if K[C] is where |γ| := n+1 i=1 γi for γ = (γ1 , . . . , γn+1 ) ∈ N Cohen-Macaulay, then P t |γ| xγ ∈J+hx / n ,xn+1 i HK[C] (t) = . (1 − t)2 Proof. It is well known that the Hilbert series of K[C] coincides with that of R/J, then HK[C] (t) = P |γ| xγ ∈J / t . We observe that X X HK[C] (t) = t |γ| + t |γ| . xγ ∈J / γn+1 =0 xγ ∈J / γn+1 6=0 Since we are considering the degree reverse lexicographic order and I(C) is a homogeneous prime ideal, then xn+1 does not appear in any minimal generator of J. Thus, it follows that {xγ ∈ / J | γn+1 6= 0} = {xn+1 xβ | xβ ∈ / J}. Hence, X X X HK[C] (t) = t |γ| + t t |β| = t |γ| + t HK[C] (t). xγ ∈J / γn+1 =0 xγ ∈J / γn+1 =0 xβ ∈J / Then, we get that (1 − t) HK[C](t) = X t |γ| = xγ ∈J / γn+1 =0 X t |γ| + xγ ∈J / γn =γn+1 =0 X t |γ| . xγ ∈J / γn 6=0, γn+1 =0 Moreover, X t |γ| = t xγ ∈J / γn 6=0, γn+1 =0 X xβ ∈J / βn+1 =0 t |β| − t X t |β| . xβ ∈J, / xn xβ ∈J βn+1 =0 To conclude the result it suffices to observe that X t t |β| = t(1 − t) HK[C](t). xβ ∈J / βn+1 =0 Additionally, when K[C] is Cohen-Macaulay, by [5, Proposition 2.1] we have that xn xγ ∈ J if and only if xγ ∈ J and the result follows.  As a consequence, when m1 < · · · < mn is an arithmetic sequence of relatively prime integers, we obtain the following result. Theorem 2.9. The Hilbert series of K[C] is HK[C](t) = 1 + (n − 1)(t + · · · + tα ) + (n − 1 − k)tα+1 . (1 − t)2 Proof. Since K[C] is Cohen-Macaulay, by Corollary 2.3, we have that P (1 − t)2 HK[C](t) = xγ ∈in(I(C))+hx t |γ| . / n ,xn+1 i Now, we apply Theorem 2.2 to get that {xγ | xγ ∈ / in(I(C)) + hxn , xn+1 i} = {1} ∪ {xa1 xi | 1 ≤ α i ≤ n − 1 and 0 ≤ a ≤ α − 1} ∪ {x1 xi | k + 1 ≤ i ≤ n − 1} and we deduce the result.  ALG. INVARIANTS OF PROJECTIVE MON. CURVES ASSOC. TO GENERALIZED ARITHMETIC SEQUENCES 7 Remark 2.10. It is worth pointing out that from Theorem 2.9 we can also get the value of reg(K[C]) because K[C] is Cohen-Macaulay. Indeed, the regularity of K[C] is attained at the last step of a minimal graded free resolution (see, e.g., [4, Proposition 1.1]). Moreover, the Hilbert series of K[C] is related to a minimal graded free resolution by the formula HK[C] (t) = P i eij P 1 t ). Thus, reg(K[C]) equals the degree of the h-polinomial. Since (1 + pi=1 (−1)i βj=1 (1−t)n+1 the h-polynomial of K[C] is 1 + (n − 1)(t + · · · + tα ) + (n − 1 − k)tα+1 , then reg(K[C]) = α if k = n − 1 and reg(K[C]) = α + 1 if k < n − 1. Theorem 2.11. The Hilbert function of K[C] is  s+2  + (n − 2) s+1 2 2 HFK[C](s) = mn s + α(2 − n + k) − α+1 2  − (n − 2) α 2  +1 if 0 ≤ s < α, if s ≥ α. Proof. The Hilbert function of K[C] coincides with that of R/in(I(C)). Thus from Theorem 2.2, we have that n L   L L L λ β γ λ β γ K[C] ≃ γ,β∈N } K{x x x K{x x x x } 0≤λ<α 1 n n+1 1 i n n+1 0≤λ≤α 2≤i≤n−1 L L α β γ k+1≤i≤n−1 K{x1 xi xn xn+1 } Then, for 0 ≤ s ≤ α, we have that     s+1 s+2 . + (n − 2) HFK[C](s) = 2 2 And for s ≥ α + 1, we have that P P HFK[C](s) = αi=0 (s + 1 − i) + (n − 2) α−1 i=0 (s − i) + (n  − 1 − k)(s − α) α+1 α = (s + 1)(α + 1) − 2 + (n − 2) sα − 2 + (n − 1 − k)(s  − α) α+1 α = ((n − 1)α + n − k) s + α(2 − n + k) − 2 − (n − 2) 2 + 1. Finally, we observe from Lemma 2.1 that α = q + d and then (n − 1)α + n − k = (n − 1)(q + d) + n − k = mn .  Remark 2.12. Since K[C] is Cohen-Macaulay, the Castelnuovo-Mumford regularity of K[C] is one unit bigger than the regularity of its Hilbert function (see, e.g., [5, Theorem 2.5]). The regularity of the Hilbert function of K[C] is the smallest integer s0 such that for all s ≥ s0 its Hilbert polynomial and its Hilbert function in s coincide. Thus, using this approach, Theorem 2.11 allows us to reprove Theorem 2.7. Indeed, the Hilbert polynomial of K[C] is PK[C](s) :=  α+1 mn s + α(2 − n + k) − 2 − (n − 2) α2 + 1 and PK[C] (s) = HFK[C](s) for all s ≥ α. Moreover, it is easy to check that PK[C](α − 1) 6= HFK[C](α − 1) if and only if k < n − 1. Nevertheless, if k = n − 1, then PK[C](α − 2) 6= HFK[C] (α − 2). Thus, the regularity of the Hilbert function equals α if k < n − 1, or α − 1 if k = n − 1. Now, we obtain the Cohen-Macaulay type of K[C]. Theorem 2.13. Take c ∈ N and τ ∈ {1, . . . , n − 1} such that m1 − 1 = c(n − 1) + τ . Then, the Cohen-Macaulay type of K[C] is τ . Proof. We set ai := (mi , mn − mi ) ∈ N2 for all i ∈ {1, . . . , n} and an+1 := (0, mn ) ∈ N2 and consider the grading in R induced by deg(xi ) := ai for all i ∈ {1, . . . , n} and deg(xn+1 ) := an+1 . We also consider the sets B := {deg(xγ ) | xγ ∈ / in(I(C)) + (xn , xn+1 )} ⊂ N2 and B̃ = {s ∈ B | s + ai ∈ / B for all i : 1 ≤ i ≤ n − 1} ⊂ B. By [7, Theorem (4.9)], the Cohen-Macaulay type of K[C] is the number of elements in B̃. By Theorem 2.2, we have that B = {(0, 0)} ∪ {ba1 + ai | 0 ≤ b ≤ α − 1, 1 ≤ i ≤ n − 1} ∪ {αa1 + ai | k + 1 ≤ i ≤ n − 1}, 8 ISABEL BERMEJO *, EVA GARCÍA-LLORENTE *, AND IGNACIO GARCÍA-MARCO where k ∈ {1, . . . , n − 1} satisfies that m1 + k ≡ 1 (mod n − 1). We claim that  {αa1 + ai | k + 1 ≤ i ≤ n − 1} if k < n − 1 B̃ = {(α − 1)a1 + ai | 1 ≤ i ≤ n − 1} if k = n − 1. For k < n − 1, if c = ba1 + ai with 0 ≤ b ≤ α − 1 and 1 ≤ i ≤ n − 1, then c + an−i = ba1 + ai + an−i = (b + 1)a1 + an−1 ∈ B and, hence, c ∈ / B̃. Moreover, it is easy to check that αa1 + ai ∈ B̃ for all i : k + 1 ≤ i ≤ n − 1. For k = n − 1 the claim follows easily. Therefore, the Cohen-Macaulay type of K[C] is n − 1 if k = n − 1, or n − 1 − k otherwise. Thus, the result follows from the definition of k.  From Theorem 2.13 we easily deduce the following characterization of the Gorenstein property for K[C]. Corollary 2.14. K[C] is Gorenstein ⇐⇒ m1 ≡ 2 (mod n − 1). Let us illustrate the results of this section with some examples. Example 2.15. Consider the set {m1 , m2 , m3 , m4 , m5 } with m1 := 10, m2 := 13, m3 := 16, m4 := 19 and m5 := 22. We observe that m1 = 2 · 4 + 2, then q = 2 and r = 2 and we have that α = q + d = 5 and that k = 5 − 2 = 3. From Theorem 2.7 we get that reg(K[C]) = ⌈(22 − 1)/(5 − 1)⌉ = 6. Since, m1 − 1 = 2(n − 1) + 1, from Theorem 2.13 we obtain that the Cohen-Macaulay type is τ = 1 and hence K[C] is Gorenstein. Moreover, by Theorem 2.9, the Hilbert series is P 1 + 5i=1 4 ti + t6 HK[C](t) = (1 − t)2 and by Theorem 2.11 the Hilbert function is  s+2  + 3 s+1 if 0 ≤ s < 5, 2 2 HFK[C] (s) = 22 s − 44 if s ≥ 5, being α = 5 the regularity of the Hilbert function, because k = 3 < n − 1 = 4 (see Remark 2.12). Example 2.16. Consider the set {m1 , m2 , m3 , m4 , m5 } with m1 := 4, m2 := 5, m3 := 6, m4 := 7 and m5 := 8. We observe that m1 = 0 · 4 + 4, then q = 0 and r = 4, and we have that v = 1, α = 1 and that k = 1. Then reg(K[C]) = ⌈(8 − 1)/(5 − 1)⌉ = 2. Since m1 − 1 = 0(n − 1) + 3, the Cohen-Macaulay type is τ = 3. Moreover, the Hilbert series and Hilbert function are respectively  1 if s = 0, 1+4 t+3 t2 HK[C] (t) = (1−t)2 and HFK[C] (s) = 8 s − 2 if s ≥ 1, being α = 1 the regularity of the Hilbert function. 3. G ENERALIZED ARITHMETIC SEQUENCES This section concerns the study of K[C] when m1 < · · · < mn is a generalized arithmetic sequence and n ≥ 3. We discard the case n = 2 because two integers always form an arithmetic sequence and, thus, the study of K[C] was covered by the previous section. The first goal of this section is to prove that whenever m1 < · · · < mn is a generalized arithmetic sequence, then K[C] is Cohen-Macaulay if and only if h = 1. We prove this as a direct consequence of Theorem 3.1, a more general result providing a big family of projective monomial curves that are not arithmetically Cohen-Macaulay. More concretely, this result concerns projective monomial curves C defined by a sequence m1 < · · · < mn containing a generalized arithmetic ALG. INVARIANTS OF PROJECTIVE MON. CURVES ASSOC. TO GENERALIZED ARITHMETIC SEQUENCES 9 sequence of l terms with l ≥ 3 and finishing in mn , i.e., there exist 1 ≤ i1 < · · · < il = n and h, d ∈ Z+ such that mij = hmi1 + (j − 1)d for all j ∈ {2, . . . , l}. Theorem 3.1. Let m1 < · · · < mn contain a generalized arithmetic sequence mi1 < · · · < mil = mn with l ≥ 3. If h > 1 and hmi1 ∈ / {m1 , . . . , mn }, then K[C] is not Cohen-Macaulay. Proof. We are proving that there exists a monomial minimal generator of in(I(C)) involving the variable xn ; thus, by [5, Proposition 2.1], we can conclude that K[C] is not Cohen-Macaulay. We h consider the binomial f := xhi1 xn − xi2 xil−1 xh−1 n+1 ∈ I(C) and observe that in(f ) = xi1 xn because h > 1. If xhi1 ∈ / in(I(C)), then there exists a minimal generator of in(I(C)) involving xn and K[C] is not Cohen-Macaulay. So assume that xhi1 ∈ in(I(C)), then there exists xβ ∈ / in(I(C)) n+1 h β with β = (β1 , . . . , βn+1 ) ∈ N such that g := xi1 − x ∈ I(C). We claim that βn+1 < h − 1. Indeed xβ has degree h and xβ 6= xhn , so βn+1 ≤ h − 1, and if βn+1 = h − 1 we have that g = xhi1 −xj xh−1 n+1 ∈ I(C), for some j ∈ {1 . . . , n}, which implies that hmi1 = mj , a contradiction. Consider now the binomial f − xn g = xβ xn − xi2 xil−1 xh−1 n+1 ∈ I(C). Since βn+1 < h − 1 Q Qn β βj h−1−βj+1 ′ ∈ I(C) and in(g ′) = nj=1 xj j xn ∈ in(I(C)). we get that g := j=1 xj xn − xi2 xil−1 xn+1 Nevertheless, xβ ∈ / in(I(C)), so there exists a minimal generator of in(I(C)) involving xn and the result follows.  Now, from Theorems 2.3 and 3.1 we directly derive the following characterization of the CohenMacaulay property for K[C] when m1 < · · · < mn is a generalized arithmetic sequence and n ≥ 3. Corollary 3.2. K[C] is Cohen-Macaulay if and only if m1 < · · · < mn is an arithmetic sequence. Moreover, as a consequence of Corollary 3.2 and Remark 2.4 we can easily recover [3, Theorem 6.1], where the complete intersection property for I(C) is characterized. Corollary 3.3. Let m1 < · · · < mn be a generalized arithmetic sequence of relatively prime integers. Then, I(C) is a complete intersection if and only if n = 3, h = 1, and m1 is even. Proof. (⇒) Assume that I(C) is a complete intersection, then K[C] is Cohen-Macaulay and, by Corollary 3.2, m1 < · · · < mn is an arithmetic sequence. Hence, by Remark 2.4, we have that  n−1 I(C) is a complete intersection if and only if 2 + k = n − 1. This equality can only hold if n = 3 and k = 1 or, equivalently, if n = 3 and m1 even. (⇐) A direct application of Remark 2.4 gives the result.  In the rest of this section we assume that m1 < · · · < mn is a generalized arithmetic sequence of relatively prime integers with n ≥ 3, h > 1 and h divides d. It turns out that under this hypotheses I(C) is closely related to I(C ′ ), where C ′ is the projective monomial curve associated to the arithmetic sequence m2 < · · · < mn or, equivalently, to the arithmetic sequence of relatively prime integers m2 /h < · · · < mn /h, which we have studied in detail in the previous section. For a sake of convenience we assume that I(C ′ ) ⊂ K[x2 , . . . , xn+1 ]. The following result shows how the initial ideals of I(C) and I(C ′ ) with respect to the degree reverse lexicographic order with x1 > · · · > xn+1 are related and will be useful in the rest of this section. Proposition 3.4. in(I(C ′ )) = in(I(C)) ∩ K[x2 , . . . , xn+1 ]. Proof. It is obvious that in(I(C ′ )) ⊂ in(I(C)) ∩ K[x2 , . . . , xn+1 ]. To prove the converse we consider λ = (0, λ2, . . . , λn , λn+1 ) ∈ Nn+1 such that xλ ∈ in(I(C)) and we assume without loss of generality that λn+1 = 0. Then, there exists ǫ = (ǫ1 , . . . , ǫn+1 ) ∈ Nn+1 such that f = xλ − xǫ ∈ I(C) with in(f ) = xλ . We consider two cases: Case 1: If ǫ1 = 0, then f ∈ I(C) ∩ K[x2 , . . . , xn ] = I(C ′ ). Case 2: If ǫ1 6= 0, then we are proving that there exists µ = (µ1 , . . . , µn+1 ) ∈ Nn+1 such that µ1 < ǫ1 andPg := xλ − xµ ∈ I(C) with in(g) = xλ . Firstly, we claim that ǫ1 ≥ h. n Indeed, ǫ1 m1 = i=2 (λi − ǫi )mi , gcd{m1 , h} = 1 and h divides mi for all i ∈ {2, . . . , n}; 10 ISABEL BERMEJO *, EVA GARCÍA-LLORENTE *, AND IGNACIO GARCÍA-MARCO thus, ǫ1 = hǫ′1 . P Moreover, there exist j ∈ {3, . . . , n} such that ǫj > 0. Otherwise, we have Pn n ǫ1 m1 + ǫ2 m2 = i=2 λi mi and m1 < m2 ≤ mi for all i ∈ {2, . . . , n}, then i=2 λi < ǫ1 + ǫ2 . This implies that λn+1 > 0 since f homogeneous, a contradiction. So we take j ∈ {3, . . . , n} −1 h−1 λ µ such that ǫj > 0 and consider xµ = xǫ x−h 1 x2 xj−1 xj xn+1 and g := x − x . One can easily check µ ǫ that g ∈ I(C), that x < x , so in(g) = in(f ), and µ1 = ǫ1 − h < ǫ1 . Iterating the same argument if necessary, we get the result.  Remark 3.5. When h does not divide d it is easy to find examples where the conclusion of Proposition 3.4 does not hold. For example, we consider the set {m1 , m2 , m3 , m4 , m5 } with m1 := 2, m2 := 35, m3 := 46, m4 := 57 and m5 := 68, where h = 12 and d = 11. By Proposition 2.2, 22 2 2 we have that in(I(C ′ )) = hx23 2 , x2 x3 , x3 , x3 x4 , x4 i. However, with the help of a computer one can 2 2 check that in(I(C)) ∩ K[x2 , . . . , x6 ] = hx2 , x3 , x3 x4 , x24 i. Even if we consider {m1 , m2 , m3 , m4 } with m1 := 5, m2 := 26, m3 = 32 and m4 := 38, where 2 9 6 h = 4, d = 6 and then gcd{h, d} = h/2 = 2. We observe that in(I(C ′ )) = hx10 2 , x2 x3 , x3 i = 6 5 2 in(I(C)) ∩ K[x2 , . . . , x5 ] = hx2 , x2 x3 , x3 i. In order to describe a minimal Gröbner basis of I(C) we introduce two technical lemmas. Lemma 3.6. Take p ∈ N and s ∈ {1, . . . , n−1} such that m1 = p(n−1)+s and set δ := ph+d+h. Then, (a) δm1 = ms+1 + pmn , ′ (b) if δm1 = mj + p′ mn with pP ∈ N, j ∈ {2, . . . , n}, then j = s + 1 and p′ = p, and (c) δ = min {b ∈ Z+ | b m1 ∈ ni=2 Nmi }. + Proof. Pn It is straightforward to check (a) and (b). Let us denote M := min {b ∈ Z | b m1 ∈ {2, . . . , n} and i=2 Nmi }. We observe that h divides M because h divides mi for all i ∈ P n ′ gcd{m1 , h} = 1. Hence, M = hM ′ , where M ′ = min {b ∈ Z+ | b m1 ∈ i=2 Nmi } and m′i = mi /h for all i ∈ {2, . . . , n}. Applying Lemma 2.1 to {m1 , m′2 , . . . , mn } we get that M ′ = p + d/h + 1. Then M = hM ′ = δ and (c) is proved.  Following the notation of the previous lemma, we state the next result. P Lemma 3.7. Set βj := min {b ∈ Z+ | (jh)m1 + bm2 ∈ ni=3 Nmi }, for all j ∈ {0, . . . , δ ′ − 1}, where δ ′ := δ/h, then (a) for each j ∈ {0, . . . , δ ′ − 1}, there exist unique σj ∈ {3, . . . , n} and λj ∈ N such that jhm1 + βj m2 = mσj + λj mn , and (b) setting σδ′ := s + 1, λδ′ := p and βδ′ := 0, then, for all j ∈ {1, . . . , δ ′ } we have the following: (b.1) if σj 6= n, then σj−1 = σj + 1, λj−1 = λj and βj−1 = βj + 1; (b.2) if σj = n, then σj−1 = 3, λj−1 = λj + 1 and βj−1 = βj + 2. Proof. By definition of βj we can write jhm1 + βj m2 = mσj + λj mn , where λj ∈ N and σj ∈ {3, . . . , n}. Suppose now that there exist σj′ ∈ {3, . . . , n} and λ′j ∈ N such that jhm1 + βj m2 = mσj′ + λ′j mn . We assume without loss of generality that σj ≥ σj′ . Then, λ′j ≥ λj and we get that mσj − mσj′ = (λ′j − λj )mn . Hence λ′j = λj and σj = σj′ , and get (a). Let us now prove (b). We first consider the case σj 6= n. Since jhm1 + βj m2 = mσj + λj mn , then (j − 1)hm1 + (βj + 1)m2 = mσj +1 + λj mn , so βj−1 ≤ βj + 1. On the other hand, (j−1)hm1 +βj−1m2 = mσj−1 +λj−1 mn , which implies jhm1 +(βj−1 −1)m2 = mσj−1 −1 +λj−1 mn and we derive βj−1 − 1 ≥ βj . Thus βj = βj−1 − 1, σj = σj − 1 and λj = λj−1. Finally, we consider the case σj = n. From the equalities jhm1 + βj m2 = mn + λj mn and 2m2 = m3 + hm1 , we obtain (j − 1)hm1 + (βj + 2)m2 = m3 + (λj + 1)mn and we deduce that ALG. INVARIANTS OF PROJECTIVE MON. CURVES ASSOC. TO GENERALIZED ARITHMETIC SEQUENCES 11 βj−1 ≤ βj + 2. On the other hand, from (j − 1)hm1 + βj−1 m2 = mσj−1 + λj−1 mn , we obtain that (3) jhm1 + (βj−1 − 1)m2 = mσj−1 −1 + λj−1 mn . If σj−1 = 3, then βj−1 − 2 ≥ βj ; and if σj−1 > 3, βj−1 − 1 ≥ βj . So, βj + 1 ≤ βj−1 ≤ βj + 2. Suppose that βj−1 = βj + 1, from (3) we get jhm1 + βj m2 = mσj−1 −1 + λj−1mn . Then, from (a), σj = σj−1 − 1, a contradiction because σj = n. We conclude then that βj−1 = βj + 2, σj−1 = 3 and λj−1 = λj + 1.  Remark 3.8. Lemma 3.7 gives an algorithmic way of computing the integers βj , σj and λj starting from βδ′ = 0, λδ′ = p and σδ′ = s + 1 where p and s are given by Lemma 3.6. Nevertheless one can easily derive an explicit formula for βj , σj , λj for all j ∈ {1 . . . , δ ′ }. Indeed, we have that βδ′ −j = j + ⌊(j + s − 2)/(n − 2)⌋, σδ′ −j is the only integer in {3, . . . , n} such that σδ′ −j ≡ s + 1 + j (mod n − 2), and λδ′ −j = p + ⌊(j + s − 2)/(n − 2)⌋. P Remark 3.9. Notice that β0 = min{b ∈ Z+ | bm2 ∈ ni=3 Nmi }, so, applying Lemma 2.1 to the sequence of relatively prime integers m2 /h < · · · < mn /h, we get that β0 = α + 1, where α = ⌊(mn − h)/(nh − 2h)⌋. Moreover, if C ′ denotes the projective monomial curve associated to the arithmetic sequence m2 < · · · < mn , we have that reg(K[C ′ ]) equals β0 if σ0 6= 3, or β0 − 1 if σ0 = 3. Following the notation of Lemmas 3.6 and 3.7, we can describe a minimal Gröbner basis of I(C) with respect to the degree reverse lexicographic order. Theorem 3.10. Let G1 ⊂ K[x2 , . . . , xn , xn+1 ] be a minimal Gröbner basis with respect to the degree reverse lexicographic order of I(C ′ ), where C ′ is the projective monomial curve associated to the arithmetic sequence m2 < · · · < mn . Then, G := G1 ∪ {xh1 xi − x2 xi−1 xh−1 n+1 | 3 ≤ i ≤ n} λj j(h−1)+(d/h) jh βj ∪ {x1 x2 − xσj xn xn+1 | 1 ≤ j ≤ δ/h}, is a minimal Gröbner basis of I(C) with respect to the degree reverse lexicographic order. Moreover, G is a minimal set of generators of I(C). β jh j Proof. We set hi := xh1 xi − x2 xi−1 xh−1 n+1 ∈ I(C) for all i ∈ {3, . . . , n} and pj := x1 x2 − λ j(h−1)+(d/h) xσj xnj xn+1 for all j ∈ {1, . . . , δ/h}. By Lemma 3.7, we have that pj ∈ I(C). Moreover, since I(C ′ ) ⊂ I(C), we clearly have that G1 ⊂ I(C). Let us prove now that in(I(C)) ⊂ in(G), where in(G) is the ideal generated by the initial terms of binomials in G with respect to the degree reverse lexicographic order. We consider a binomial f = xλ − xǫ ∈ I(C) with λ = (λ1 , . . . , λn+1), ǫ = (ǫ1 , . . . , ǫn+1 ) ∈ Nn+1 , gcd {xλ , xǫ } = 1 and in(f ) = xλ . We consider different cases: Case 1: If λ1 = 0, then in(f ) ∈ in(I(C)) ∩ k[x2 , . . . , xn+1 ] and, by Proposition 3.4, we get that in(f ) ∈ in(G1 ) ⊂ in(G) . Pn Case 2: If λ1 > 0, then h divides λ1 because λ1 m1 = i=2 (ǫi − λi )mi , h divides mi for all i ∈ {2, . . . , n} and gcd{m1 , h} = 1. If there exists i ∈ {3, . . . , n} such that λi > 0, then in(hi ) divides xλ and we deduce that xλ ∈ in(G). So, it only remains to consider when f = ǫn+1 xλ1 1 xλ2 2 − xǫ22 · · · xn+1 . If λ1 ≥ δ, then in(pδ/h ) divides xλ by Lemma 3.6. If λ1 < δ, then λ1 m1 + λ2 m2 = ǫ3 m3 + · · · + ǫn mn and, taking j := (δ − λ1 )/h we have that δ2 ≥ βj by the definition of βj . Thus in(pj ) divides in(f ) and the proof is complete. To prove that G is a minimal set of generators, it suffices to prove it when G1 is the Gröbner basis of I(C ′ ) described in Theorem 2.2. By Remark 2.4, G1 is a minimal set of generators of I(C ′ ). Since all the elements of degree 2 in G belong to G1 it follows that the elements of degree 2 are not redundant. Let us take f ∈ G of degree ≥ 3, if f = hi or f = pi , then in(f ) is not divided by any other of the monomials appearing in the elements of G \ {f } and, hence, f is not 12 ISABEL BERMEJO *, EVA GARCÍA-LLORENTE *, AND IGNACIO GARCÍA-MARCO redundant. Assume now that in(f ) = xα2 xi and X (4) f= hg g, g∈G\{f } where hg = 0 or deg(hg ) = deg(f ) − deg(g). We consider the homomorphism τ induced by x1 7→ 0, xn+1 7→ 0 and xi 7→ xi for all i ∈ {2, . . . , n}. Applying τ to (4), we derive that there exists a linear form l such that xα2 l ∈ L, where L is the binomial prime ideal hxj xk −xj−1 xk+1 | 3 ≤ j < k ≤ n − 1i. Hence l ∈ L, a contradiction. Thus, G is a minimal set of generators of I(C).  Remark 3.11. Putting together Theorems 2.2 and 3.10, we obtain a minimal Gröbner basis of I(C) with respect to the the degree reverse lexicographic order. Observe that if we consider h = 1 in this basis, the set G obtained is not a minimal Gröbner basis of I(C). Remark 3.12. If we remove the assumption that h divides d, in general, a minimal Gröbner basis of I(C) with respect to the degree reverse lexicographic order may not be a minimal system of generators of I(C). Indeed, if we consider the first example in Remark 3.5, one has that a minimal Gröbner basis of I(C) has 9 elements, whereas the first Betti number is 8. In the next result, we exploit the description of the minimal Gröbner basis of I(C) obtained in Theorem 3.10 to get the irreducible decomposition of in(I(C)). Proposition 3.13. Let δ and βj be the as in Lemmas 3.6 and 3.7 and let {qi }i∈I be the irreducible components of I(C ′ ). Then,   δ/h \ \ jh β in(I(C)) = hxh1 , qi i ∩  hx1 , x2 j−1 , x3 , . . . , xn i . i∈I j=2 is the irredundant irreducible decomposition of in(I(C)). β j−1 Proof. We set Ai = hxh1 , qi i and Bj := hxjh , x3 , . . . , xn i. From Theorem 3.10 we obtain i , x2 that β j in(I(C)) = in(I(C ′ )) + hxh1 xi | 3 ≤ i ≤ ni + hxjh 1 x2 | 1 ≤ j ≤ δ/hi is a minimal system of generators of in(I(C)) with respect to the degree reverse lexicographic order with x1 > · · · > xn+1 . Then, it is easy to check that in(I(C)) ⊂ Ai , Bj , for all i ∈ I and for all j ∈ {2, . . . , δ/h}. In order to see the reverse inclusion, we consider l ∈ / in(I(C)), we distinguish two possibilities: (a) l = xa1 xi xcn+1 with 0 ≤ a < h, i ∈ {2, . . . , n} and c ≥ 0, or (b) l = xa1 xb2 xcn+1 with h ≤ jh ≤ a < δ, b < βj and c ≥ 0. In (a), setting l′ = xi xcn+1 we have that l′ ∈ / in(I(C ′ )) and, as a consequence, l′ ∈ / qi for some i ∈ I, thus l ∈ / Ai . If (b) holds, then l ∈ / Bj+1. It only remains to show that there is no redundant ideal in the intersection. The same argument as in Theorem 2.5 applies here to derive that Ai is not redundant for all i ∈ I. Finally, Bj is no β −1 / in(I(C)), but x1jh−1 ∈ Bk for all k < j redundant for j ∈ {2, . . . , δ/h} because x1jh−1 x2 j−1 ∈ β −1 and x2 j−1 ∈ Bk for all k > j.  Once we have the irreducible decomposition of in(I(C)) we can obtain the value of the regularity. Theorem 3.14. Let m1 < · · · < mn be a generalized arithmetic sequence with gcd {m1 , d} = 1, h > 1 and h divides d. Set δ := ⌊(m1 − 1)/(n − 1)⌋h + d + h, then  δ − 1 if n − 1 does not divide m1 , reg(K[C]) = δ if n − 1 divides m1 . ALG. INVARIANTS OF PROJECTIVE MON. CURVES ASSOC. TO GENERALIZED ARITHMETIC SEQUENCES 13 Proof. Observe that, by Proposition 3.13, we have   δ/h \ \ jh β in(I(C)) = hxh1 , qi i ∩  hx1 , x2 j−1 , x3 , . . . , xn i , i∈I j=2 where {qi }i∈I are the irreducible components of in(I(C ′ )). A direct application of Lemma 2.6 yields reg(K[C]) = max {h − 1 + reg (K[C ′ ]), max {jh + βj−1 − 2}}. j∈{2,...,δ/h} Moreover, it is clear that maxj∈{2,...,δ/h} {jh + βj−1 − 2} = δ + βδ/h−1 − 2 since h ≥ 2 and βj−1 −βj ≤ 2 for all j ∈ {2, . . . , δ/h}. Thus we get that reg(K[C]) = max{h−1+reg(K[C ′ ]), δ+ βδ/h−1 − 2}. Our objective is to prove that this maximum equals δ + βδ/h−1 − 2 or, equivalently, that (5) reg(K[C ′ ]) − β(δ/h)−1 ≤ δ − h − 1. In the proof we use the following three facts: (i) By Theorem 2.7 and Remark 3.9, we have that reg(K[C ′ ]) ∈ {β0 − 1, β0 }. (ii) By Lemma 3.7, we have that P(δ/h)−1 β0 − β(δ/h)−1 = i=1 (βi−1 − βi ) ≤ 2((δ/h) − 1) = 2(δ/h) − 2. Pn (iii) Since h divides δ and m1 ∈ / i=2 Nmi , from Lemma 3.6(c) we have that δ ≥ 2h. We divide the proof in four cases: (a) h ≥ 3, (b) reg(K[C ′ ]) = β0 − 1, (c) β0 − β(δ/h)−1 ≤ 2(δ/h) − 3, and (d) h = 2, reg(K[C ′ ]) = β0 and β0 − β(δ/h)−1 = 2(δ/h) − 2. If (a) holds, then by (iii) we have that h(h − 1) ≤ 2h(h − 2) ≤ (h − 2)δ, then 2(δ/h) − 2 ≤ δ − h − 1. Therefore, by (i) and (ii), we get that reg(K[C ′ ]) − β(δ/h)−1 ≤ β0 − β(δ/h)−1 ≤ 2(δ/h) − 2 ≤ δ − h − 1, and we conclude (5). If (b) or (c) holds, then 2(δ/h) − 2 ≤ δ − h. Therefore, by (i) and (ii), in both cases we get that reg(K[C ′ ])−β(δ/h)−1 ≤ 2(δ/h)−3 ≤ δ −h−1, and we conclude (5). Let us prove that (d) is not possible. By contradiction, assume that (d) holds. Since reg(K[C ′ ]) = β0 , by Theorem 2.7 we get that n ≥ 4. We claim that δ = 4. Indeed, setting ∆i := βi−1 − βi for all i ∈ {1, . . . , (δ/2) − 1} we observe that ∆i ∈ {1, 2} and that P(δ/2)−1 ∆i = β0 − β(δ/2)−1 = 2(δ/2) − 2, so ∆i = 2 for all i ∈ {1, . . . , (δ/2) − 1}. Nevertheless i=1 n ≥ 4, hence from Lemma 3.7 we have that two consecutive values of ∆i cannot be both 2, so we conclude that δ = 4 and β0 − β1 = 2, so β0 = 3 and σ0 = 3. However, this implies that reg(K[C ′ ]) = β0 − 1 (see Remark 3.9), a contradiction. To conclude the result it suffices to observe that, by Lemma 3.7, β(δ/h)−1 ∈ {1, 2} and that it is 2 if and only if n − 1 divides m1  In the following result we make use of a result of [4] to prove that in this setting, the regularity is always attained at the last step a minimal graded free resolution of K[C]. Corollary 3.15. reg(K[C]) is attained at the last step of a minimal graded free resolution of K[C]. Proof. Let F be the set of γ = (γ1 , . . . , γn−1 , 0, 0) ∈ Nn+1 such that xγ ∈ in(I(C))|xn =xn+1 =1 and xγ ∈ / in(I(C))|xn =xn+1 =0 . According to [4, Corollary 2.11], a sufficient condition for the regularity Pn−1 γi | γ ∈ F }. From to be attained at the last step of the resolution is that reg(K[C]) = max{ i=1 Theorem 3.10, we get that in(I(C))|xn =xn+1 =1 = in(I(C ′ ))|xn=xn+1 =1 + hxh1 i, in(I(C))|xn =xn+1 =0 = in(I(C ′ ))|xn=xn+1 =0 + h{xh1 xi | 3 ≤ i ≤ n − 1}i+ βi h{xih 1 x2 | 1 ≤ i ≤ δ/h}i, 14 ISABEL BERMEJO *, EVA GARCÍA-LLORENTE *, AND IGNACIO GARCÍA-MARCO where C ′ is the projective monomial curve associated to the arithmetic sequence {m2 , . . . , mn }. From Theorem 2.2, we have that in(I(C ′ ))|xn =xn+1 =1 = in(I(C ′ ))|xn =xn+1 =0 ; and then we obtain that F = {(γ1 , γ2 , 0, . . . , 0) | jh ≤ γ1 < (j + 1)h, 0 ≤ γ2 < βj , for all j ∈ {1, . . . , δ/h − 1}}. Pn−1 γi | γ ∈ F } = δ + βδ/h−1 − 2, which Since h ≥ 2 and βj ≤ βj+1 + 2 we conclude that max{ i=1 equals reg(K[C]), from where the result follows.  In the last part of this section we provide formulas for the Hilbert series and the Hilbert function of K[C] in this setting. Theorem 3.16. The Hilbert series of K[C] is HK[C](t) = (1 + · · · + th−1 )HK[C ′] (t) + Pδ−1 j=h j t − P h−1 j j=0 t  P (δ/h)−1 ih+βi t i=1 (1 − t)2  , where HK[C ′ ] (t) is the Hilbert series of K[C ′ ] with C ′ is the projective monomial curve associated to the arithmetic sequence m2 < · · · < mn . Proof. By Proposition 2.8, setting J := in(I(C)) we have that P P |γ| (1 − t)2 HK[C](t) = t |γ| − t xγ ∈J / +hxn+1 i t xγ ∈J+hx / n ,xn+1 i γ ∈J x x n P |γ| = + S, xγ ∈J / +hxn ,xn+1 i t γ1 <h P P |γ| |γ| − t xγ ∈J . We observe in Theorem 3.10 that xh1 xn is where S := xγ ∈J / +hxn+1 i t / +hxn ,xn+1 i t γ1 ≥h xn xγ ∈J the unique minimal generator of J where xn appears, so for all λ = (λ1 , . . . , λn+1 ) ∈ Nm+1 we have that λn+1 (a) xλ ∈ / in(I(C)) with λ1 < h if and only if xλ2 2 · · · xn+1 ∈ / in(I(C ′ )), (b) if xλ ∈ / in(I(C)), then xn xλ ∈ in(I(C)) if and only if λ1 ≥ h. From (a) we derive that P |γ| xγ ∈J / +hxn ,xn+1 i t γ1 <h h−1 . (1 + t + · · · + t )HK[C ′] (t) = (1 − t)2 From (b) we derive that P |γ| S = (1 − t) xγ ∈J / +hxn+1 i, t γ ≥h Pδ−1 j P1h−1 j  Pδ/h−1 ih+βi  = t − , t j=h j=0 t i=1 where the last equality is directly deduced from Theorem 3.10 and we are done.  As a direct consequence of the previous result, we obtain a simpler expression of the Hilbert series of K[C] when n = 3. h(t) Corollary 3.17. If n = 3, the Hilbert series of K[C] is HK[C] (t) = (1−t) 2 , where Ph (1) h(t) = 1 + 2t + j=2 3tj + th+1 − t2h , if δ = 2h and m1 is odd, P (2) h(t) = 1 + 2t + 3t2 + hj=3 4tj + 3th+1 + th+2 − t2h − t2h+1 , if δ = 2h and m1 is even, P (3) h(t) = 1 + 2t + (δ−4)/2 3tj − ((δ − 6)/2)tδ−1 − ((δ − 2)/2)tδ , if δ > 4 and h = 2, j=2 Ph−1 P P (m /h)−1 (m3 /h)+j (4) h(t) = j=0 (j + 1)tj + j=h3 (h + 1)tj + h−3 + t(m3 /h)+h−2 j=0 (h − j)t P(δ/h)−1 jh+βj (t + tjh+βj +1 ) − tδ , if δ > 2h, h ≥ 3 and m1 is odd, − j=2 P(m3 /h)−1 P P (m3 /h)+j j + t(m3 /h)+h−2 (h + 1)tj + h−3 (5) h(t) = h−1 j=h j=0 (h − j)t j=0 (j + 1)t + Pδ/h jh+βj − j=2 (t + tjh+βj +1 ), if δ > 2h, h ≥ 3 and m1 is even. ALG. INVARIANTS OF PROJECTIVE MON. CURVES ASSOC. TO GENERALIZED ARITHMETIC SEQUENCES 15 Theorem 3.18. The Hilbert function of K[C] is HFK[C] (s) = h−1 X HFK[C ′] (s − i) + (n − 3)∆s + ∆s+1 , i=0 where ∆s := #{(a, b) ∈ N2 | a + b < s and b < βj , with j := ⌊a/h⌋ ≥ 1}, C ′ is the projective monomial curve associated to the arithmetic sequence m2 < · · · < mn and HFK[C ′] (a) := 0 whenever a < 0. Proof. The Hilbert function of K[C] coincides with that of R/in(I(C)). Thus HFK[C] (s) = #{xγ ∈ / in(I(C)) | deg(xγ ) = s}. We write HFK[C] (s) = #{xγ ∈ / in(I(C)) | deg(xγ ) = s, γ1 < h} γ + #{x ∈ / in(I(C)) | deg(xγ ) = s, γ1 ≥ h}. ′ From Theorem 3.10, we easily deduce that {xγ ∈ / in(I(C)) | deg(xγ ) = s, γ1 < h} = {xγ11 xγ ∈ / ′ ′ in(I(C)) | γ ′ = (0, γ2, . . . , γn+1 ), deg(xγ )+γ1 = s, and γ1 < h} = {xγ ∈ / in(I(C ′ )) | s−h+1 ≤ ′ deg(xγ ) ≤ s, γ1′ = 0}. Thus HFK[C](s) = h−1 X HFK[C ′] (s − i) + #{xγ ∈ / in(I(C)) | deg(xγ ) = s, γ1 ≥ h}. i=0 γ n+1 Moreover, from Theorem 3.10 we get that #{xγ ∈ / in(I(C)) | deg(xγ ) = s, γ1 ≥ h} = #{xγ11 xγ22 xǫi i xn+1 ∈ / in(I(C))) | γ1 +γ2 +ǫi +γn+1 = s, γ1 ≥ h, ǫi ∈ {0, 1} and i ∈ {3, . . . , n−1}} = (n−3)∆s +∆s+1 , which completes the proof.  Moreover, we can also describe the Hilbert polynomial PK[C](s) of K[C] in terms of the Hilbert polynomial PK[C ′] (s) = (mn /h)s + γ of K[C ′ ] described in Theorem 2.11 (see also Remark 2.12). Corollary 3.19. The Hilbert polynomial of K[C] is δ/h−1 X h−1 PK[C](s) = mn s + mn βi . + hγ + (n − 2)h 2 i=0 P β . To get the result it suffices to observe that ∆s = ∆ for all Proof. We set ∆ := h δ/h−1 i=0 Ph−1i  s >> 0 and that PK[C](s) = i=0 PK[C ′] (s − i) + ∆ by Theorem 3.18. Let us illustrate the results of this section with an example. Example 3.20. Consider the set {m1 , m2 , m3 , m4 , m5 , m6 } with m1 := 7, m2 := 30, m3 := 39, m4 := 48, m5 := 57 and m6 := 66. We observe that m1 , . . . , m6 are relatively prime, h = 3 and d = 9, so h divides d. We compute δ = ⌊(7 − 1)/(6 − 1)⌋3 + 9 + 3 = 15 and observe that n − 1 does not divide m1 . Then, by Theorem 3.14, we get that reg(K[C]) = 14. Moreover, from the expression m1 = 1 · 5 + 2, we get that p = 1 and s = 2. Following remark 3.8 we get that β1 = 4 + ⌊(4 + 2 − 2)/4⌋ = 5, β2 = 3 + ⌊(3 + 2 − 2)/4⌋ = 3, β3 = 2 + ⌊(2 + 2 − 2)/4⌋ = 2 and β4 = 1 + ⌊(1 + 2 − 2)/4⌋ = 1. By Theorem 3.16 we obtain that P14 j 2 8 9 11 13 j=3 t − (1 + t + t )(t + t + t + t ) 2 HK[C](t) = (1 + t + t )HK[C ′ ] (t) + . (1 − t)2 We observe that the sequence 10 < 13 < 16 < 19 < 22 defines the same projective monomial curve as the sequence 30 < 39 < 48 < 57 < 66. Then, from Example 2.15 we get that P 1+ 5i=1 4ti +t6 HK[C ′ ] (t) = . Hence, we conclude that HK[C] (t) equals (1−t)2 1 + 5t + 9t2 + 13(t3 + t4 + t5 ) + 10t6 + 6t7 + t8 − t9 − t10 − t11 − t13 − t15 . (1 − t)2 16 ISABEL BERMEJO *, EVA GARCÍA-LLORENTE *, AND IGNACIO GARCÍA-MARCO 4. KOSZULNESS In this section we characterize when K[C] is a Koszul algebra when m1 < · · · < mn is a generalized arithmetic sequence (Theorem 4.1), when n = 3 (Theorem 4.3) and when n = 4 (Theorem 4.4). We recall (see, e.g., [8]) that the following well known implications (i) ⇒ (ii) ⇒ (iii) hold: (i) I(C) possesses a quadratic Gröbner basis (ii) K[C] is Koszul (iii) I(C) is generated by quadrics. These implications will be frequently used in this section. Theorem 4.1. Let m1 < · · · < mn be a generalized arithmetic sequence of relatively prime integers. Then, K[C] is a Koszul algebra if and only if m1 < · · · < mn are consecutive numbers and n > m1 . For proving this result we make use of the following lemma. Lemma 4.2. Take i ∈ {1, . . . , n − 1}; if I(C) is generated by quadrics, then 2mi = mj + µml , where j, l ∈ {1, . . . , n} \ {i} and µ ∈ {0, 1}. Q αj Proof. Set w ∈ Z+ the minimum integer such that f := xw ∈ I(C) for some j∈{1,...,n+1} xj i − j6=i α1 , . . . , αi−1 , αi+1 , . . . , αn+1 ∈ N. It turns out that there exists a minimal set of generators of I(C) containing f (see, e.g., [2, Lemma 3.1.(b)]); hence, f is a quadric. This implies that f = x2i − xj xl for some j ∈ {1, . . . , n} \ {i}, l ∈ {1, . . . , n + 1} \ {i}. Thus we conclude that 2mi = mj if k = n + 1, or 2mi = mj + ml otherwise.  Proof of Theorem 4.1. (⇒) Since I(C) is generated by quadrics, by Lemma 4.2 we get that 2m1 > m2 and, thus, h = 1. Moreover, if n ≤ m1 , then 2m1 6= mj for all j ∈ {1, . . . , n − 1} and 2m1 6= mj + ml for all j, l ∈ {2, . . . , n}, then again by Lemma 4.2 we derive that n > m1 . (⇐) We observe that m1 < · · · < mn is an arithmetic sequence, d = 1, and that α = ⌈m1 /(n − 1)⌉ + d − 1 = 1. As a consequence, the Gröbner basis G in Theorem 2.2 only consists of quadrics and we conclude that K[C] is a Koszul algebra.  In the rest of this section we aim at listing all projective monomial curves C such that its corresponding algebra K[C] is Koszul when n = 3 (Theorem 4.3) and n = 4 (Theorem 4.4). Theorem 4.3. If n = 3 and gcd{m1 , m2 , m3 } = 1; then, K[C] is a Koszul algebra if and only if {m1 , m2 , m3 } is {1, 2, 3}, {1, 2, 4} or {2, 3, 4}. Theorem 4.4. If n = 4 and gcd{m1 , m2 , m3 , m4 } = 1; then, K[C] is a Koszul algebra if and only if {m1 , m2 , m3 , m4 } is one of the following sequences {1, 2, 3, 4}, {1, 2, 3, 5}, {1, 2, 3, 6}, {1, 2, 4, 6}, {1, 2, 4, 8}, {2, 3, 4, 5}, {2, 3, 4, 6}, {2, 3, 4, 8}, {2, 4, 5, 6}, {2, 4, 5, 8}, {3, 4, 5, 6}, {3, 4, 6, 8}, {4, 5, 6, 8} or {4, 6, 7, 8}. To obtain these results we first introduce two lemmas concerning a new projective curve Cm , defined for m < mn . More precisely, Cm is the projective monomial curve in Pn+1 K parametrically defined by x1 = sm1 tmn −m1 , . . . , xn−1 = smn−1 tmn −mn−1 , xn = smn , xn+1 = tmn , y = sm tmn −m , we denote by I(Cm ) ⊂ K[x1 , . . . , xn+1 , y] the vanishing ideal of Cm . We denote by Bm the integer gcd{m1 , . . . , mn }/ gcd{m1 , . . . , mn , m}. Lemma 4.5. Take d ∈ Z+ and set mi := 2i−1 d for all i ∈ {1, . . . , n}; then, K[C] is a Koszul algebra. Moreover, if Bm = 2 and 2m = mi + mj for some i, j ∈ {1 . . . , n}, then K[Cm ] is also a Koszul algebra. ALG. INVARIANTS OF PROJECTIVE MON. CURVES ASSOC. TO GENERALIZED ARITHMETIC SEQUENCES 17 Proof. We have that mi /d = 2i−1 for all i ∈ {1, . . . , n}. Thus, by [2, Theorem 5.3 and Corollary 5.8], I(C) is a complete intersection and it is generated by quadrics, which implies that K[C] is Koszul (see, e.g., [8, Corollary 8 and Theorem 10]). We observe that Bm (m, mn − m) = 2(m, mn − m) = (mi , mn − mi ) + (mj , mn − mj ). Therefore, by [2, Lemma 2.1 and Proposition 2.3], we get that I(Cm ) = I(C) + hy 2 − xi xj i and I(Cm ) is also a complete intersection generated by quadrics, then K[Cm ] is a Koszul algebra.  Lemma 4.6. We set d := gcd{m1 , . . . , mn }. If m1 /d, . . . , mn /d are consecutive numbers, n > m1 , Bm = 2 and 2m = mi + µmj for some i, j ∈ {1, . . . , n} and µ ∈ {0, 1}, then K[Cm ] is a Koszul algebra. Proof. By Theorem 4.1 and its proof, the Gröbner basis with respect to the degree reverse lexicographic order G provided by Theorem 2.2 consists of quadrics. Moreover, we observe that Bm (m, mn −m) = 2(m, mn −m) = (mi , mn −mi )+(mj , mn −mj ) if µ = 1 or Bm (m, mn −m) = 2(m, mn − m) = (mi , mn − mi ) + (0, mn ) if µ = 0; thus by [2, Lemma 2.1 and Proposition 2.3] we get that I(Cm ) = I(C) + hy 2 − xi xl i, where l = j if µ = 1 or l = n + 1 if µ = 0. Let us prove that Gm := G ∪ {y 2 − xi xl } is a Gröbner basis for I(Cm ) with respect to the monomial ordering >y in K[x1 , . . . , xn+1 , y] given by:  Qn+1 αi α Qn+1 βi β α > β, or Qn+1 βi Q αi i=1 xi y >y i=1 xi y ⇐⇒ α = β and n+1 i=1 xi , i=1 xi >dp where >dp is the degree reverse lexicographic order in K[x1 , . . . , xn+1 ]. Indeed we take f = Qn+1 αi α Qn+1 αi α Qn+1 βi β i=1 xi y , i=1 xi y − i=1 xi y ∈ I(Cm ), where αi , α, βi , β ∈ N and suppose that in>y (f ) = we consider three different cases. Qn+1 βi Q αi Case 1: If α = 0, then β = 0 and f = n+1 i=1 xi ∈ I(C). Then there exist i=1 xi − g ∈ G ⊂ Gm such that in>y (g) = in>gr (g) | in>y (f ). Qn+1 βi Q αi x − Case 2: If α = 1, then β ∈ {0, 1}. If β = 1, then f /y = n+1 i i=1 xi ∈ I(C). Thus i=1 there exists g ∈ G ⊂ Gm such that in>y (g) = in>dp (g) | in>dp (f /y) | in>y (f ). If β = 0, then Qn+1 βi Q αi f = n+1 i=1 xi ∈ I(Cm ), and it follows that i=1 xi y − Pn+1 Pn+1 i=1 βi (mi , mn − mi ), i=1 αi (mi , mn − mi ) + (m, mn − m) = P and then m ∈ i∈{1,...,n} Zmi , which implies Bm = 1, a contradiction. Case 3: If α ≥ 2, then in>y (y 2 − xi xj ) = y 2 | in>y (f ). Thus Gm = G ∪ {y 2 − xi xj } is a quadratic Gröbner basis of I(Cm ) with respect to >y ; therefore K[Cm ] is a Koszul algebra.  Proof of Theorem 4.3. (⇒) Since I(C) is generated by quadrics, by Lemma 4.2 we get that either 2m1 ∈ {m2 , m3 } and that 2m2 ∈ {m3 , m1 + m3 }. Since gcd{m1 , m2 , m3 } = 1 we easily derive that {m1 , m2 , m3 } equals {1, 2, 4}, {1, 2, 3} or {2, 3, 4}. (⇐) For {m1 , m2 , m3 } = {1, 2, 4} then K[C] is Koszul by Lemma 4.5. If {m1 , m2 , m3 } equals {1, 2, 3} or {2, 3, 4}, we conclude that K[C] is Koszul by Theorem 4.1.  Proof of Theorem 4.4. (⇒) Since I(C) is generated by quadrics, by Lemma 4.2, we have that 2m1 ∈ {m2 , m3 , m4 }, 2m2 ∈ {m3 , m4 , m1 + m3 , m1 + m4 } and that 2m3 ∈ {m4 , m1 + m4 , m2 + m4 }. A case by case analysis of all the possible values of 2m1 , 2m2 and 2m3 together with the fact that gcd{m1 , m2 , m3 , m4 } = 1 proves this implication. (⇐) For {1, 2, 3, 4}, {2, 3, 4, 5} and {3, 4, 5, 6}, we get that K[C] is a Koszul algebra by Theorem 4.1. By Lemma 4.5, we get that K[C] is Koszul for the sets {1, 2, 4, 8}, {2, 4, 5, 8} and {2, 3, 4, 8}. Moreover, for {1, 2, 4, 6}, {2, 4, 5, 6}, {2, 3, 4, 6}, {3, 4, 6, 8}, {4, 5, 6, 8} and {4, 6, 7, 8} we prove the implication applying Lemma 4.6. Finally, for {1, 2, 3, 6} and {1, 2, 3, 5}, a direct computation 18 ISABEL BERMEJO *, EVA GARCÍA-LLORENTE *, AND IGNACIO GARCÍA-MARCO yields that the Gröbner basis of I(C) with respect to the degree reverse lexicographic order is formed by quadrics, so K[C] is Koszul as well.  ACKNOWLEDGMENTS The authors were partially supported by Ministerio de Economía y Competitividad, Spain (MTM2010-20279-C02-02, MTM2013-40775-P). The second author was also partially supported by CajaCanarias. R EFERENCES [1] D. Bayer, D. Mumford, What can be computed in algebraic geometry? Computational Algebraic Geometry and Commutative Algebra (Cortona 1991), 1–48, Cambridge Univ. Press, Cambridge, 1993. [2] I. Bermejo, I. García-Marco, Complete intersections in simplicial toric varieties. J. Symbolic Comput. 68 (2015), part 1, 265–286. [3] I. Bermejo, I. García-Marco, Complete intersections in certain affine and projective monomial curves, Bull Braz Math Soc, New Series 45(4), 2014, 1-26. [4] I. Bermejo, P. Gimenez, On Castelnuovo-Mumford regularity of projective curves. Proc. Amer. Math. Soc. 128 (2000), no. 5, 1293–1299. [5] I. Bermejo, P. Gimenez, Computing the Castelnuovo-Mumford regularity of some subeschemes of PnK using quotients of monomial ideals. J. Pure Appl. Algebra 164 (2001), 23–33. [6] I. Bermejo, P. Gimenez, Saturation and Castelnuovo-Mumford regularity. J. Algebra 303 (2006), 592–617. [7] M.P. Cavaliere, G. Niesi, On monomial curves and Cohen-Macaulay type. Manuscripta Math. 42 (1983), 147– 159. [8] A. Conca, E. De Negri, M.E. Rossi, Koszul algebras and regularity. Commutative algebra, 285–315, Springer, New York, 2013. [9] D. Eisenbud, S. Goto, Linear free resolutions and minimal multiplicities. J. Algebra 88 (1984), 84–133. [10] P. Li, D.E. Patil, L.G. Roberts, Bases and ideal generators for projective monomial curves. Comm. Algebra 40 (2012),no. 1,173–191 [11] S. Molinelli, G. Tamone, On the Hilbert function of certain rings of monomial curves. J. Pure Appl. Algebra 101 (1995), no. 2, 191–206 [12] B. Sturmfels, Gröbner bases and convex polytopes. University Lecture Series 8. American Mathematical Society, Providence, 1996. [13] R.H. Villarreal, Monomial Algebras, Monographs and Textbooks in Pure and Applied Mathematics 238. Marcel Dekker, New York, 2001. [14] R.H. Villarreal, Monomial Algebras, Second Edition, Monographs and Research Notes in Mathematics. Chapman and Hall/CRC, 2015. FACULTAD DE C IENCIAS , S ECCIÓN DE M ATEMÁTICAS , U NIVERSIDAD DE L A L AGUNA , L A L AGUNA , 38200, S PAIN , E-mail address: [email protected] FACULTAD DE C IENCIAS , S ECCIÓN DE M ATEMÁTICAS , U NIVERSIDAD DE L A L AGUNA , L A L AGUNA , 38200, S PAIN E-mail address: [email protected] LIP, ENS LYON - CNRS -UCBL - INRIA, U NIVERSITÉ DE LYON UMR 5668, LYON , F RANCE E-mail address: [email protected], [email protected]
0math.AC
Performance of Test Supermartingale Confidence Intervals for the Success Probability of Bernoulli Trials Peter Wills,1 Emanuel Knill,2, 3, ∗ Kevin Coakley,2 and Yanbao Zhang4, 5 1 Department arXiv:1709.04078v1 [math.ST] 12 Sep 2017 of Applied Mathematics, University of Colorado Boulder, Boulder, Colorado 80309, USA 2 National Institute of Standards and Technology, Boulder, Colorado 80305, USA 3 Center for Theory of Quantum Matter, University of Colorado, Boulder, Colorado 80309, USA 4 Institute for Quantum Computing and Department of Physics and Astronomy, University of Waterloo, Waterloo, Ontario N2L 3G1, Canada 5 NTT Basic Research Laboratories, NTT Corporation, 3-1 Morinosato-Wakamiya, Atsugi, Kanagawa 243-0198, Japan Given a composite null hypothesis H0 , test supermartingales are non-negative supermartingales with respect to H0 with initial value 1. Large values of test supermartingales provide evidence against H0 . As a result, test supermartingales are an effective tool for rejecting H0 , particularly when the p-values obtained are very small and serve as certificates against the null hypothesis. Examples include the rejection of local realism as an explanation of Bell test experiments in the foundations of physics and the certification of entanglement in quantum information science. Test supermartingales have the advantage of being adaptable during an experiment and allowing for arbitrary stopping rules. By inversion of acceptance regions, they can also be used to determine confidence sets. We use an example to compare the performance of test supermartingales for computing p-values and confidence intervals to Chernoff-Hoeffding bounds and the“exact” p-value. The example is the problem of inferring the probability of success in a sequence of Bernoulli trials. There is a cost in using a technique that has no restriction on stopping rules, and for a particular test supermartingale, our study quantifies this cost. Contents I. Introduction II. Basic Concepts 4 III. Bernoulli Hypothesis Tests 6 IV. Comparison of p-Values 10 V. Comparison of Confidence Intervals ∗ 2 Corresponding author. 11 2 VI. Conclusion 17 VII. Appendix A. Preliminaries B. Closed-Form Expression for PPBR C. Log-p-Value Approximations D. Asymptotic Normality of the log(p)-Values and Their Differences E. Confidence Interval Endpoints 17 17 18 19 23 25 Acknowledgments 31 References 31 Figures 33 I. INTRODUCTION Experiments in physics require very high confidence to justify claims of discovery or to unambiguously exclude alternative explanations [6]. Particularly striking examples in the foundations of physics are experiments to demonstrate that theories based on local hidden variables, called local realist (LR) theories, cannot explain the statistics observed in quantum experiments called Bell tests. See Ref. [7] for a review and Refs. [8, 9, 16, 18] for the most definitive experiments to date. Successful Bell tests imply the presence of some randomness in the observed statistics. As a result, one of the most notable applications of Bell tests is to randomness generation [1]. In this application, it is necessary to certify the randomness generated, and these certificates are equivalent to extremely small significance levels in an appropriately formulated hypothesis test. In general, such extreme significance levels are frequently required in protocols for communication or computation to ensure performance. Bell tests consist of a sequence of “trials”, each of which gives a result Mi . LR models restrict the statistics of the Mi and therefore constitute a composite null hypothesis to be rejected. Traditionally, data has been analyzed by estimating the value of a Bell function B̂ and its standard error σ̂ from the collective result statistics (see [12, 21]). Under the null hypothesis, B̂ is expected to be negative, so a large value of B̂ compared to σ̂ is considered strong evidence against the null hypothesis. This method suffers from several problems, including the failure of the Gaussian approximation in the extreme tails and the fact that the trials are observably not independent and identically distributed (i.i.d.) [21]. In Ref. [21] a method was introduced that can give rigorous p-value bounds against LR. These p-value bounds are memory-robust, that is, without any assumptions on dependence of trial statistics on earlier trials. The method can be seen as an application of test supermartingales as defined in Ref. [17]. Test supermartingales were first considered, and many of their basic properties were proved, by Ville [20] in the same work that introduced the notion of martingales. The method involves constructing a non-negative stochastic process Vi determined by (Mj )j≤i such that the initial value is V0 = 1 and, under LR models, the expectations conditional on all past events are non-increasing. As explained further below, the final value of Vi in a sequence of n trials has expectation bounded by 1, so its inverse p = 1/Vn is a p-value bound according to Markov’s inequality. A large observed value of such 3 a test supermartingale thus provides evidence against LR models. Refs. [21, 22] give methods to construct Vi that achieve asymptotically optimal gain rate E(− log(p)/n) for i.i.d. trials, where E(. . .) is the expectation functional. This is typically an improvement over other valid memory-robust Bell tests. Additional benefits are that Vi can be constructed adaptively based on the observed statistics, and the p-value bounds remain valid even if the experiment is stopped based on the current value of Vi . These techniques were successfully applied to experimental data from a Bell test with photons where other methods fail [5]. Although the terminology is apparently relatively recent, test supermartingales have traditionally played a major theoretical role. Carefully constructed test supermartingales contribute to the asymptotic analysis of distributions and proofs of large deviation bounds. They can be constructed for any convex-closed null hypothesis viewed as a set of distributions, so they can be used for memory- and stopping-robust adaptive hypothesis tests in some generality. The application to Bell tests shows that at least in a regime where high significance results are required, test supermartingales can perform well or better than other methods. Here we compare the performance of test supermartingales directly to (1) the standard large deviation bounds based on the Chernoff-Hoeffding inequality [4, 10], and (2) “exact” p-value calculations. Our comparison is for a case where all calculations can be performed efficiently, namely for testing the success probability in Bernoulli trials. The three p-value bounds thus obtained have asymptotically optimal gain rates. Not surprisingly, for any given experiment, test supermartingales yield systematically worse p-value bounds, but the difference is much smaller than the experiment-to-experiment variation. This effect can be viewed as the cost of robustness against arbitrary stopping rules. For ease of calculation, we do not use an optimal test supermartingale construction, but we expect similar results no matter which test supermartingale is used. Any hypothesis test parametrized by φ can be used to construct confidence regions for φ by acceptance region inversion (see Ref. [19], Sect. 7.1.2). Motivated by this observation, we consider the use of test supermartingales for determining confidence regions. We expect that they perform well in the high-confidence regime, with an increase in region size associated with robustness against stopping rules. We therefore compared the methods mentioned above for determining confidence intervals for the success probability in Bernoulli trials. After normalizing the difference between√the interval endpoints and the success probability by the standard deviation, which is O(1/ n), we find that while large deviation bounds and exact regions differ by a constant p at fixed confidence levels, the test supermartingale’s normalized endpoint deviation is Ω( log(n)) instead of O(1). This effect was noted in Ref. [17] and partially reflects a suboptimalpchoice of supermartingale. To maintain robustness against stopping rule, one expects Ω( log log(n)) according to the law of the iterated logarithm. However, we note that if the number of trials n is fixed in advance, the normalized endpoint deviation can be reduced to O(1) with an adaptive test supermartingale. So although the increase in confidence region necessitated by stopping rule robustness is not so large for reasonably sized n, when n is known ahead of time it can, in principle, be avoided without losing the ability to adapt the test supermartingale on the fly during the experiment in non-i.i.d. situations. The remainder of the paper is structured as follows. We establish the notation to be used and define the basic concepts in Sect. II. Here we also explain how adaptivity can help reject hypotheses for stochastic processes. We introduce the three methods to be applied to Bernoulli trials in Sect. III. Here we also establish the basic monotonicity properties and 4 relationships of the three p-value bounds obtained. In Sect. IV we determine the behavior of the p-value bounds in detail, including their asymptotic behavior. In Sect. V we introduce the confidence intervals obtained by acceptance region inversion. We focus on one-sided intervals determined by lower bounds but note that the results apply to two-sided intervals. The observations in Sects. IV and V are based on theorems whose proofs can be found in the Appendix. While many of the observations in these sections can ignore asymptotically small terms, the results in the Appendix uncompromisingly determine interval bounds for all relevant expressions, with explicit constants. Concluding remarks can be found in Sect. VI. II. BASIC CONCEPTS We use the usual conventions for random variables (RVs) and their values. RVs are denoted by capital letters such as X, Y, . . . and their values by the corresponding lower case letters x, y, . . .. All our RVs are finite valued. Probabilities and expectations are denoted by P(. . .) and E(. . .), respectively. For a formula φ, the expression {φ} refers to the event where the formula is true. The notation µ(X) refers to the distribution of X induced on its space of values. We use the usual conventions for conditional probabilities and expectations. Also, µ(X|φ) denotes the probability distribution induced by X conditional on the event {φ}. We consider stochastic sequences of RVs such as X = (Xi )ni=1 and X≤k = (Xi )ki=1 . We think of the Xi as the outcomes from a sequence of trials. For our study, we consider B = (Bi )ni=1 , where the Bi are {0, 1}-valued RVs. The standard {0, 1}-valued RV with parameter θ is the Bernoulli RV B satisfying E(B) = θ. The parameter θ is also referred to as the success P probability. We denote the distribution of B by νθ . We define Sk = ki=1 Bi and Θ̂k = Sk /k. P We extend the RV conventions to the Greek letter Θ̂k . That is, θ̂k = sk /k = ki=1 bi /k is the value of the RV Θ̂k determined by the values bi of Bi . We may omit subscripts on statistics such as Sn and Θ̂n when they are based on the full set of n samples. Some expressions involving Θ̂n require that nΘ̂n is an integer, which is assured by the definition. A null hypothesis for X is equivalent to a set H0 of distributions of X, which we refer to as the “null”. For our study of Bernoulli RVs, we consider the nulls Bϕ = {νθ |θ ≤ ϕ} (1) parametrized by 0 ≤ ϕ ≤ 1. the set of distributions of Bernoulli RVs with P(B = 1) ≤ ϕ. One can test the null hypothesis determined by a null by means of special statistics called p-value bounds. A statistic P = P (X) ≥ 0 is a p-value bound for H0 if for all µ ∈ H0 and p ≥ 0, Pµ (P ≤ p) ≤ p. Here, the subscript µ on Pµ (. . .) indicates the distribution with respect to which the probabilities are to be calculated. We usually just write “p-value” instead of “p-value bound”, even when the bounds are not achieved by a member of H0 . Small p-values are strong evidence against the null. Since we are interested in very small pvalues, we preferentially use their negative logarithm − log(P ) and call this the log(p)-value. In this work, logarithms are base e by default. A general method for constructing p-values is to start with an arbitrary real-valued RV Q jointly distributed with X. Usually Q is a function of X. Define the worst-case tail probability of Q as P (q) = supµ∈H0 Pµ (Q ≥ q). Then P (Q) is a p-value for H0 . The argument is standard. Define Fµ (q) = Pµ (Q ≥ q). The function Fµ is non-increasing. We need to show that for all µ ∈ H0 , Pµ (P (Q) ≤ p) ≤ p. Since Fµ (q) ≤ P (q), we have 5 Pµ (P (Q) ≤ p) ≤ Pµ (Fµ (Q) ≤ p). The set {q : Fµ (q) ≤ p} is either of the form [qmin , ∞) or (qmin , ∞) for some qmin . In the first S case, Pµ (Fµ (Q) ≤ p) = Pµ (Q ≥ qmin ) = Fµ (qmin ) ≤ p. In the second, Pµ (Fµ (Q) ≤ p) = Pµ ( n {q : q ≥ qmin + 1/n}) = limn Pµ ({q : q ≥ qmin + 1/n}) = limn Pµ (Fµ (Q) ≤ qmin + 1/n) ≤ p, with σ-additivity applied to the countable monotone union. When referring to H0 as a null for X, we mean that H0 consists of the distributions where the Xi are i.i.d., with Xi distributed according to µ for some fixed µ independent of i. To go beyond i.i.d., we extend H0 to the set of distributions of X that have the property that for all x≤i−1 , µ(Xi |X≤i−1 = x≤i−1 ) = µi for some µi ∈ H0 , where µi depends on i and x≤i−1 . We denote the extended null by H0 . In particular, Bϕ = {µ : for all i and b≤i−1 , µ(Bi |B≤i−1 = b≤i−1 ) = νθ for some θ ≤ ϕ}. (2) The LR models mentioned in the introduction constitute a particular null HLR for sequences of trials called Bell tests. In Ref. [21], a technique called the probability-based ratio (PBR) method was introduced to construct p-values Pn that achieve asymptotically optimal gain rates defined as E(log(1/Pn ))/n. The method is best understood as a way of constructing a test supermartingale for HLR . A test supermartingale of X for H0 is a stochastic sequence T = (Ti )ni=0 where Ti is a function of X≤i , T0 = 1, Ti ≥ 0 and for all µ ∈ H0 , Eµ (Ti+1 |X≤i ) ≤ Ti . In this work, to avoid unwanted boundary cases, we further require Ti to be positive. The definition of test supermartingale used here is not the most general one because we consider only discrete time and avoid the customary increasing sequence of σ-algebra by making it dependent on an explicit stochastic sequence X. Every test supermartingale defines a p-value by Pn = 1/Tn . This follows from E(Tn ) ≤ T0 = 1 (one of the characteristic properties of supermartingales) and Markov’s inequality for non-negative statistics, according to which P(Tn ≥ κ) ≤ E(Tn )/κ ≤ 1/κ. From martingale theory, the stopped process Tτ for any stopping rule τ with respect to X also defines a p-value by P = 1/Tτ . Further, Pn∗ = 1/ maxni=1 Ti also defines a p-value. See Ref. [17] for a discussion and examples. A test supermartingale T can be viewed as the running product of the Fi = Ti /Ti−1 , which we call the test factors of T. The defining properties of T are equivalent to having Fi > 0 and E(Fi |X≤i−1 ) ≤ 1 for all distributions in the null, for all i. The PBR method adaptively constructs Fi as a function of the next trial outcome Xi from the earlier trial outcomes X≤i−1 . The method is designed for testing H0 for a closed convex null H0 , where asymptotically optimally gain rates are achieved when the trials are i.i.d. with a trial distribution ν not in H0 . If ν were known, the optimal test factor would be given by x 7→ ν(x)/µ(x), where µ P∈ H0 is the distribution in H0 closest to ν in Kullback-Leibler (KL) divergence KL(ν|µ) = x ν(x) log(ν(x)/µ(x)) [11]. Since ν is not known, the PBR method obtains an empirical estimate ν̂ of ν from x≤i−1 and other information available before the i’th trial. It then determines the KL-closest µ ∈ H0 to ν̂. The test factor Fi is then given by Fi (x) = ν̂(x)/µ(x). The test factors satisfy Eµ0 (Fi ) ≤ 1 for all µ0 ∈ H0 , see Ref. [21] for a proof and applications to the problem of testing LR. The ability to choose test factors adaptively helps reject extended nulls when the distributions vary as the experiment progresses, both when the distributions are still independent (so only the parameters vary) and when the parameters depend on past outcomes. Suppose that the distributions are sufficiently stable so that the empirical frequencies over the past k trials are statistically close to the next trial’s probability distribution. Then we can adap- 6 tively compute the test factor to be used for the next trial from the past k trials’ empirical frequencies, for example by following the strategy outlined in the previous paragraph. The procedure now has an opportunity to reject an extended null provided only that there is a sufficiently long period where the original null does not hold. For example, consider the extended null Bϕ . The true success probabilities θi at the i’th trial may vary, maybe as a result of changes in experimental parameters that need to be calibrated. Suppose that the goal is to calibrate for θi > ϕ. If we use adaptive test factors and find at some point that we cannot reject Bϕ according to the running product of the test factors, we can recalibrate during the experiment. If the the recalibration succeeds at pushing θi above ϕ for the remaining trials, we may still reject the extended null by the end of the experiment. In many cases, the analysis is performed after the experiment, or it may not be possible to stop the experiment for recalibration. For this situation, if the frequencies for a run of k trials clearly show that θi < ϕ, the adaptive test factors chosen would tend to be trivial (equal to 1), in which case the next trials do not contribute to the final test factor product. This is in contrast to a hypothesis test based on the final sum of the outcomes for which all trials contribute equally. Let ϕ be a parameter of distributions of X. Here, ϕ need not determine the distributions. There is a close relationship between methods for determining confidence sets for ϕ and hypothesis tests. Let Hϕ be a null such that for all distributions µ with parameter ϕ, µ ∈ Hϕ . Given a family of hypothesis tests with p-values Pϕ for Hϕ , we can construct confidence sets for ϕ by inverting the acceptance region of Pϕ , see Ref. [19], Sect. 7.1.2. According to this construction, the confidence set Ca at level a is given by {ϕ|Pϕ (X) ≥ a} and is a random quantity. The defining property of a level a confidence set is that its coverage probability satisfies Pµ (ϕ ∈ Ca ) ≥ 1 − a for all distributions µ ∈ Hϕ . When we use this construction for sequences B of i.i.d. Bernoulli RVs with the null Bϕ , we obtain one-sided confidence intervals of the form [ϕ0 , 1] for θ = E(Bi ). When the confidence set is a one-sided interval of this type, we refer to ϕ0 as the confidence lower bound or endpoint. If B has a distribution µ that is not necessarily i.i.d., we can define Θmax = maxi≤n Eµ (Bi |B≤i−1 ). If we use acceptance region inversion with the extended null Bϕ , we obtain a confidence region for Θmax . Note that Θmax is an RV whose value is covered by the confidence set with probability at least 1−a. The confidence set need not be an interval in general, but including everything between its infimum and its supremum increases the coverage probability, so the set can be converted into an interval if desired. While our focus is on one-sided confidence intervals, our observations immediately apply to two-sided intervals ones with a standard method of obtaining a two-sided confidence interval from two one-sided intervals. For our example, we can obtain confidence upper bounds at level a by symmetry, for example by relabeling the Bernoulli outcomes 0 7→ 1 and 1 7→ 0. To obtain a two-sided interval at level a, we compute lower and upper bounds at level a/2. The two-sided interval is the interval between the bounds. The coverage probability of the two-sided interval is valid according to the union bound applied to maximum non-coverage probabilities of the two one-sided intervals. III. BERNOULLI HYPOTHESIS TESTS We compare three hypothesis tests for the nulls Bϕ or the extended nulls Bϕ : The “exact” test with p-value PX , the Chernoff-Hoeffding test with p-value PCH and a PBR test with pvalue PPBR . In discussing properties of these tests with respect to the hypothesis parameter 7 ϕ, the true success probability θ and the empirical success probability Θ̂, we generally assume that these parameters are in the interior of their range. In particular, 0 < ϕ < 1, 0 < θ < 1, and 0 < Θ̂ < 1. When discussing purely functional properties with respect to values θ̂ of Θ̂, we use the variable t instead of θ̂. By default nt is a positive integer. The p-value for the exact test is obtained from the tail for i.i.d. Bernoulli RVs: X n PX,n (Θ̂|ϕ) = ϕk (1 − ϕ)n−k , (3) k k≥Θ̂n P where Θ̂ = Sn /n = ni=1 Bi /n as defined in Sect. II. Note that unlike the other p-values we consider, PX,n is not just a p-value bound. It is achieved by a member of the null. The quantity PX,n (t|ϕ) is decreasing as a function of t, given 0 < ϕ < 1. It is smooth and monotonically increasing as a function of ϕ, given t > 0. To see this, compute    n X i d n−i i n−i n PX,n (t|ϕ) = ϕ (1 − ϕ) − i dϕ ϕ 1−ϕ i=nt     n n−1 X X i−1 n−i n − 1 i n−i−1 n − 1 =n ϕ (1 − ϕ) −n ϕ (1 − ϕ) i−1 i i=nt i=nt   X  ! n−1 n−1 X n − 1 n − 1 =n ϕi (1 − ϕ)n−1−i − ϕi (1 − ϕ)n−1−i i i i=nt−1 i=nt   n−1 = n ϕnt−1 (1 − ϕ)n(1−t) . nt − 1 (4) This is positive for ϕ ∈ (0, 1). The probability that Sn ≥ tn, given that all Bi are distributed as νθ with θ ≤ ϕ, is bounded by PX,n (t|θ) ≤ PX,n (t|ϕ). That PX is a p-value for the case where the null is restricted to i.i.d. distributions now follows from the standard construction of pvalues from worst-case (over the null) tails of statistics (here Sn ) as explained in the previous section. That PX is a p-value for the extended null Bϕ follows from the observations that the tail probabilities of Sn are linear functions of the distribution parameters θ1 , θ2 , ..., θn where θi ≤ ϕ, i = 1, 2, ..., n, the extremal distributions in Bϕ have Bi independent with P(Bi = 1) = θi ≤ ϕ, and the tail probabilities of Sn are monotonically increasing in P(Bi = 1) for each i separately. See also Ref. [2], App. C. Define Θ̂max = max(Θ̂, ϕ). The p-value for the Chernoff-Hoeffding test is the optimal Chernoff-Hoeffding bound [4, 10] for a binary random variable given by nΘmax  n(1−Θmax ) 1−ϕ ϕ PCH,n (Θ̂|ϕ) = Θ 1 − Θmax  max      ϕ nΘ̂ 1−ϕ n(1−Θ̂) if Θ̂ ≥ ϕ, = Θ̂ 1−Θ̂ 1 otherwise.  (5) This is a p-value for our setting because PCH,n (t|ϕ) ≥ PX,n (t|ϕ), see Ref. [10]. For ϕ ≤ t, we have − log(PCH,n (t|ϕ)) = nKL(νt |νϕ ). We abbreviate KL(νt |νϕ ) by KL(t|ϕ). For ϕ ≤ t < 1, 8 PCH,n (t|ϕ) is monotonically increasing in ϕ, and decreasing in t. For 0 ≤ t ≤ ϕ, it is constant. The p-value for the PBR test that we use for comparison is constructed from a p-value for the point null {νϕ } defined as   n 0 nΘ̂ n(1−Θ̂) PPBR,n (Θ̂|ϕ) = ϕ (1 − ϕ) (n + 1) . (6) nΘ̂ The PBR test’s p-value for Bϕ is 0 PPBR,n (Θ̂|ϕ) = max PPBR,n (Θ̂|ϕ0 ). 0 (7) 0≤ϕ ≤ϕ 0 That PPBR is a p-value for Bϕ is shown below. As a function of ϕ, PPBR,n (t|ϕ) has an isolated t 1−t maximum at ϕ = t. This can be seen by differentiating log (ϕ (1 − ϕ) ) = t log(ϕ) + (1 − t) log(1 − ϕ). Thus in Eq. 7 when ϕ ≥ Θ̂, the maximum is achieved by ϕ0 = Θ̂. We can therefore write Eq. 7 as  0 PPBR,n (Θ̂|ϕ) if Θ̂ ≥ ϕ, (8) PPBR,n (Θ̂|ϕ) = 0 (Θ̂|Θ̂) otherwise. PPBR,n By definition, PPBR,n (t|ϕ) is non-decreasing in ϕ and strictly increasing for ϕ ≤ t. As a function of t, it is strictly decreasing for t ≥ ϕ (integer-valued nt). To see this, consider k = nt ≥ nϕ and compute the ratio of successive values as follows: ϕ n−k 1−ϕk+1 ϕ 1−t = 1 − ϕ t + 1/n ϕ 1−t ≤ 1−ϕ t ≤ 1. 0 0 PPBR,n ((k + 1)/n|ϕ)/PPBR,n (k/n|ϕ) = (9) 0 is the final value of a test supermartingale obtained by conThe expression for PPBR,n structing test factors Fk+1 from Sk . Define ek = Θ 1 (Sk + 1) . k+2 (10) e k would be an empirical estimate of θ if there were two initial trials B−1 and B0 with Thus, Θ values 0 and 1, respectively. The test factors are given by Fk+1 (Bk+1 ) = ek Θ ϕ !Bk+1 ek 1−Θ 1−ϕ !1−Bk+1 . (11) 9 One can verify that Eνθ (Fk+1 ) = 1 for θ = ϕ. More generally, set δ = θ − ϕ and compute 1−t t + (1 − θ) ϕ 1−ϕ   t 1−t =1+δ − ϕ 1−ϕ t−ϕ =1+δ . ϕ(1 − ϕ) e k = t) = θ Eνθ (Fk+1 |Θ (12) Q As designed, Tn = nk=1 Fk is a test supermartingale for the point null {νϕ }. Thm. 5 0 in App. VII B, establishes that Tn = 1/PPBR,n (Θ̂|ϕ). The definition of PPBR,n (Θ̂|ϕ) as a 0 maximum of p-values for νϕ0 with ϕ ≤ ϕ in Eq. 7 ensures that PPBR,n (Θ̂|ϕ) is a p-value for Bϕ . To show that PPBR is a p-value for Bϕ , we establish that for all t (integer-valued nt), PPBR,n (t|ϕ) ≥ PCH,n (t|ϕ). By direct calculation for both ϕ ≤ t and t ≤ ϕ, we have   n nt n(1−t) PPBR,n (t|ϕ)/PCH,n (t|ϕ) = t (1 − t) (n + 1) . (13) nt  The expression tk (1 − t)k nk is maximized at k = nt as can be seen by considering ratios for successive values of k and the calculation in Eq. 9, now applied also for k < nt. Therefore, nt n(1−t) t (1 − t)   X   X   n n n nt n(1−t) n k k n t (1 − t) t (1 − t) (n + 1) = ≥ = 1. nt nt k k=0 k=0 (14) A better choice for test factors to construct a test supermartingale to test Bϕ would be  e k ≥ ϕ, Tk+1 if Θ 0 (15) Tk+1 = 1 otherwise. This choice ensures that Eνθ (Fk+1 |B≤k ) ≤ 1 for all θ ≤ ϕ but the final value of the test supermartingale obtained by multiplying these test factors is not determined by Sn , which would complicate our study. We summarize the observations about the three tests in the following theorem. Theorem 1. We have PX ≤ PCH ≤ PPBR . (16) The three tests satisfy the following monotonicity properties for 0 < ϕ < 1 and 0 < t < 1 with nt integer-valued: PX (t|ϕ) is strictly increasing in ϕ and strictly decreasing as a function of t. PCH (t|ϕ) is strictly increasing in ϕ for ϕ ≤ t, constant in ϕ for ϕ ≥ t, strictly decreasing in t for t ≥ ϕ and constant in t for t ≤ ϕ. PPBR (t|ϕ) is strictly increasing in ϕ for ϕ ≤ t, constant in ϕ for ϕ ≥ t and strictly decreasing in t for t ≥ ϕ. 10 IV. COMPARISON OF p-VALUES We begin by determining the relationships between PX , PCH and PPBR more precisely. Since we are interested in small p-values, √ it is convenient to focus on the log(p)-values instead and determine their differences to O(1/ n). Because of the identity − log(PCH,n (t, ϕ)) = nKL(t|ϕ), we reference all log(p)-values to − log(PCH,n ). Here we examine the differences for t ≥ ϕ determined by the following theorem: Theorem 2. For 0 < ϕ < t < 1,   1 1 1 , (17) − log(PPBR,n (t|ϕ)) = − log(PCH,n (t|ϕ)) − log(n + 1) + log(2πt(1 − t)) + O 2 2 n s !   1 1−ϕ 1 t − log(PX,n (t|ϕ)) = − log(PCH,n (t|ϕ)) + log(n) − log +O . 2 2π(1 − t) t − ϕ n (18) The theorem follows from Thms. 6, 7 and Cor. 8 proven in the Appendix, where explicit interval expressions are obtained for these log(p)-value differences. The order notation assumes fixed t > ϕ. The bounds are not uniform, see the expressions in the appendix for details. The most notable observation is that there are systematic gaps of log(n)/2+O(1) between the log(p)-values. As we already knew, there is no question that the exact test is the best of the three for this simple application. While these gaps may seem large on an absolute √ scale, representing factors close to n, they are in fact much smaller than the experiment-toexperiment variation of the p-values. To determine this variation, we consider the asymptotic distributions. We can readily determine that √ the log(p)-values are asymptotically normal with standard deviations proportional to n, which is transferred from the variance of Θ̂. Compared to these standard deviations the gaps are negligible. The next theorem determines the specific way in which asymptotic normality holds. Let N (µ, σ 2 ) denote the D normal distribution with mean µ and variance σ 2 . The notation Xn − → N (µ, σ 2 ) means that Xn converges in distribution to the normal distribution with mean µ and variance σ 2 . Theorem 3. Assume 0 < ϕ < θ < 1. For P = PCH,n , P = PPBR,n or P = PX,n , the log(p)-value − log(P ) converges in distribution according to √ D 2 n(− log(P )/n − KL(θ|ϕ)) − → N (0, σG ), with 2 σG (19)   2 θ 1−ϕ = θ(1 − θ) log . 1−θ ϕ The theorem is proven in the Appendix, see Thm. 10. For the rest of the paper, we write P or Pn for the p-values of any one of the tests when it does not matter which one. We display the behavior described in the above theorems for n = 100 and θ = 0.5 in Fig. 1. We conclude that the phenomena discussed above are already apparent for small numbers of trials. For Fig. 1, we computed the quantiles of the log(p)-values numerically using the formulas provided in the previous section, substituting for t the corresponding quantile of 11 Θ̂ given that P(B = 1) = θ. To be explicit, let tr,n (θ) be the r-quantile of Θ̂ defined as the minimum value θ̂ of Θ̂ satisfying P(Θ̂ ≤ θ̂) ≥ r. (For simplicity we do not place the quantile in the middle of the relevant gap in the distribution.) For example, t0.5,n (θ) is the median. Then, by the monotonicity properties of the tests, the r-quantile of − log(Pn (Θ̂|ϕ)) is given by − log(Pn (tr,n (θ)|ϕ)). As noted above, the gaps between the log(p)-values are of the form log(n)/2 + O(1). In fact, it is possible to determine the asymptotic behavior of these gaps. After accounting for the explicitly given O(1) terms in Thm. 2, they are asymptotically normal with variances of order O(1/n). The standard deviations of the gaps are therefore small compared to their size. The precise statement of their asymptotic normality is Thm. 11 in the Appendix. Fig. 2 shows how these gaps depend on the value θ̂ of Θ̂ given ϕ. The gaps are scaled by log(n) so that they can be compared to log(n)/2 visually for different values of n. The deviation from log(n)/2 is most notable near the boundaries, where convergence is also slower, particularly for PX . This behavior is consistent with the divergences as t approaches ϕ in the explicit interval bounds in Thm. 7 and Cor. 8. V. COMPARISON OF CONFIDENCE INTERVALS Let P be one of PCH,n , PPBR,n or PX,n . Given a value θ̂ of Θ̂, the level-a confidence set determined by the test with p-value P is I = {ϕ|P (θ̂|ϕ) ≥ a}. By the monotonicity properties of P , the closure of I is an interval [ϕa (θ̂; P ), 1]. We can compute the endpoint ϕa by numerically inverting the exact expressions for P . An example is shown in Fig. 3, where we show the endpoints according to each test for a = 0.01 and θ̂ = 0.5 as a function of n. All tests’ endpoints converge to 0.5 as the number of trials grows. Notably, the relative separation between the endpoints is not large at level a = 0.01. To quantify the behavior of theqendpoints for the different tests, we normalize by the empirical standard deviation σ̂ = defined as θ̂(1 − θ̂)/n. The empirical endpoint deviation is then θ̂ − ϕa (θ̂; P ) . (20) σ̂ For the exact test and for large n, we expect this quantity to be determined by the tail probabilities of a standard normal distribution. That is, if the significance a is the probability that a normal RV of variance 1 exceeds κ, we expect γa (θ̂; PX ) ≈ κ. We take the point of view that the performance of a test is characterized by the size of the endpoint deviation. If the relative size of the deviations for two tests is close to 1 then they perform similarly for the purpose of characterizing the parameter θ. Another way of comparing the intervals obtained is to consider their coverage probabilities. For our situation, the coverage probability for test P at a can be approximated by determining a0 such that γa0 (θ; PX ) = γa (θ; P ). From Thm. 4 below, one can infer that the coverage probability is then approximately 1 − a0 ≥ 1 − a. The coverage probabilities can be very conservative (larger than 1 − a), particularly for small a and P = PPBR . We determined interval bounds for the empirical endpoint deviation for all three tests. The details are in App. VII E. The next theorem summarizes the results asymptotically. γa (θ̂; P ) = 12 Theorem 4. Let q(x) = − log(PN (0,1) (N ≥ x)) be the negative logarithm of the tail of the standard normal. Fix θ̂ ∈ (0, 1). Write α = | log(a)|. There is a constant c (depending on θ̂) such that for α ∈ (1, cn], γa satisfies √ √ (21) γa (θ̂; PCH ) = 2α + O(α/ n), q √ γa (θ̂; PPBR ) = 2α + log(n)/2 − log(2π θ̂(1 − θ̂))/2 + O(α/ n), (22) √ (23) γa (θ̂; PX ) = q −1 (α) + O(α/ n). The last expression has the following approximation relevant for sufficiently large α: p √ γa (θ̂; PX ) = 2α − log(2π) − log(2α − log(2π)) + O(log(α)/α3/2 ) + O(α/ n). (24) √ For α = o( n), the relative error of the approximation in the first two identities goes to zero as n grows. This is not the case for the last identity, where the relative error for large n is dominated by the term O(log(α)/α3/2 ), and large α is required for a small relative error. Proof. The expression for γa (θ̂; PCH ) is obtained from Thm. 12 in the Appendix by changing the relative approximation errors into absolute errors. To obtain the expression for γa (θ̂; PPBR ), note that the term ∆ in Thm. 13 satisfies ∆ = log(n)/2 − log(2π θ̂(1p− θ̂))/2 + O(1/n), see Thm. 6. The O(1/n) under the square √ root pulls out to an O(1/( max(α, log(n))n)) term that is dominated by O(α/ n) because α ≥ 1 by assumption. To obtain the expressions for γa (θ̂; PX ), we refer to Thm. 14, where the lower bound on α implies α ≥ 1 > log(2). The intervals in Thm. 14 give relative errors that need to be converted to absolute quantities. By positivity and monotonicity of q −1 , for sufficiently large n and for some positive constants u and v, we have  √ √ √ √ √ √ √ √  γa (θ̂; PX ) ∈ q −1 (α(1 − u α/ n))(1 − v α/ n), q −1 (α(1 + u α/ n))(1 + v α/ n) . (25) −1 Explicit values for u and v can be obtained from Thm. 14. We simplified √ √ the argument of q by absorbing the additive terms in the theorem into the term √ uα√ α/ n with the constant u chosen to be sufficiently large. Consider Eq. 94 with δ = u α/ n. For sufficiently large n, the expression in the denominator of the approximation error on the right-hand side exceeds a constant multiple of α. From this, with some new constant u0 ,  √ √ √ √ √ √ √ √  γa (θ̂; PX ) ∈ q −1 (α)(1 − u0 α/ n)(1 − v α/ n), q −1 (α)(1 + u0 α/ n)(1 + v α/ n) , (26) which, with order notation simplifies further to √ √ γa (θ̂; PX ) = q −1 (α)(1 + O( α/ n)). (27) √ It now suffices to apply q −1 (α) = O( α) (see the proof of Eq. 24 below) and Eq. 23 is obtained. For Eq. 24, we bound x = q −1 (α), which we can do via bounds for α = q(x). From the expression q(x) = x2 /2 + log(2π)/2 − log(Y (x)) = x2 /2 + log(2π)/2 + log(x) − log(xY (x)) 13 in the statement of Thm. 14 and the bounds in Eq. 58, we have the two inequalities q(x) = x2 /2 + log(2π)/2 + log(x) − log(xY (x)) ≥ x2 /2 + log(2π)/2 + log(x), 2 2 q(x) ≤ x /2 + log(2π)/2 + log(x) + 1/x . (28) (29) Let l(x) = x2 /2 + log(2π)/2 + log(x), which is monotonically increasing, as is q. The first inequality implies that q −1 ≤ l−1 . We need a bound of the form q(x) ≤ dx2 , from which we can conclude that x2 ≥ α/d. A bound of this type can be obtained from Eq. 91 in the Appendix. For definiteness, we restrict to α ≥ 6√and show that the bound holds with d = 1. By Eq. 29, it suffices to establish that for x ≥ 6, l(x) + 1/x2 ≤ x2 . Since log(2π)/2 ≤ 1, we have log(2π)/2 + log(x) + 1/x2 ≤ 1 + log(1 + (x − 1)) + 1/x√2 ≤ x + 1/x2 . For x ≥ 9/4, x + 1/x2 ≤ x2 /2. To finish the argument, apply the inequality 6 ≥ 9/4. Given the bound x2 ≥ α, Eq. 29 becomes q(x) = α ≤ l(x) + 1/α. With Eq. 28 we get α = q(x) ∈ l(x) + [0, 1]/α. Equivalently, l(x) ∈ α + 1 [−1, 0]. α Applying the monotone l−1 on both sides gives   1 −1 −1 x = l (l(x)) ∈ l α + [−1, 0] . α (30) (31) Let α0 satisfy x = l−1 (α0 ) with α0 = α + δ and δ ∈ [−1, 0]/α. Write z = x2 and c = log(2π). We have l(z 1/2 ) = z/2 + c/2 + log(z)/2 = α0 , which we can write as a fixed point equation z = f (z) for z with f (z) = 2α0 − c − log(z). We can accomplish our goal by determining d lower and upper bounds on the fixed point. Since dy f (y) = −1/y < 0 for y > 0, the iteration 0 z0 = 2α − c and zk = f (zk−1 ) is alternating around the fixed point z, provided zk > 0 for all k. Provided z0 > 1, z1 = f (z0 ) < z0 , from which we conclude that z1 ≤ z < z0 . Since we are assuming that α ≥ 6 and from above z0 ≥ 2(α − 1/α) − c, the condition z0 > 1 is satisfied. d If z1 ≥ 1, then 0 > dy f (y) > −1 between z1 and z0 , which implies that z0 and z1 are in the region where the iteration converges to z. For our bounds, we only require z1 > 0, so that we can bound z according to z1 ≤ z ≤ z2 . That z1 > 0 follows from log(y) < y for y > 0. We have z2 − z1 = z0 − log(z1 ) − (z0 − log(z0 )) = log(z0 /z1 ) = log(z0 /(z0 − log(z0 ))) = − log(1 − log(z0 )/z0 ) = O(log(z0 )/z0 ) = O(log(α0 )/α0 ) = O(log(α)/α), (32) where z0 = 2α0 − c ∈ 2α − c + 2[−1, 0]/α, and so − log(z0 ) = − log(2α − c) + O(1/α2 ). For z1 we get z1 = z0 − log(z0 ) = 2α − c − log(2α − c) + O(1/α). Applying Eq. 32 and from the definitions, p q −1 (α) = x = 2α − c − log(2α − c) + O(log(α)/α). (33) The approximation error in Eq. 24 is obtained by expanding the square root. We could have 14 used Newton’s method starting from z0 to obtain better approximations in one step, but the resulting expression is more involved. The expression for γa (θ̂; PX ) confirms our expectation that it approaches the expected value for a standard normal distribution and may be compared to the Berry-Esseen theorem [14]. The empirical endpoint deviation of the CH test approaches that of the exact test for small a (large α). Their squares differ by a term of order log(α) = log | log(a)|. p Notably, the ratio of the PBR and CH tests’ empirical endpoint deviation grows as Θ( log(n)/α). The relationships are visualized in Figs. 4, 5 and 6 for different values of a. The figures show that theprelative sizes of the empirical endpoint deviations tend toward 1 with smaller a. The Θ( log(n)/α) relative growth of the PBR test’s endpoint deviations leads to less than a doubling of the deviations relative to the exact test’s at a = 0.01 and a = 0.001 even for n = 106 . So while the test’s coverage probabilities are much closer to 1 than the nominal value of 1 − a, we believe that it does not lead to unreasonably conservative results in many applications. Next we consider the behavior of the true endpoint deviations given by the normalized differencepof the true success probability θ and the endpoint obtained from one of the tests. Let σ = θ(1 − θ)/n be the true standard deviation and define the true endpoint deviation determined by test P as γ̃a (Θ̂|P ) = (θ − ϕa (Θ̂|P ))/σ = (θ − Θ̂)/σ + γa (Θ̂|P )σ̂/σ. (34) The true endpoint deviations show how the inferred endpoint compares to θ and therefore directly exhibits the statistical fluctuations of Θ̂. In contrast, the empirical endpoint deviations are to lowest order independent of θ̂ − θ. We take the view that two tests’ endpoints perform similarly if their true endpoint deviations differ by an amount that is small compared to the width of the distribution of the true endpoint deviations. To compare the three tests on this basis, we consider the quantiles for Θ̂ corresponding to ±κ Gaussian √ standard deviations from θ with κ constant. The quantiles satisfy θ±κ = θ ± κσ(1 + O(1/ n)), by the Berry-Esseen theorem or from Thm. 14. Since √ √ σ̂ = σ(1 + O(1/ n)), we can also see that γa (θ±κ |P ) = γa (θ̂|P ) + O(1/ n), and so by substituting into the definition, √ γ̃a (θ±κ |P ) = γa (θ|P ) ± κ + O(1/ n), (35) where the implicit constants depend on κ. For large α, the CH and exact tests’ endpoints are close and are dominated by κ, so they perform similarly. But this does not hold for the comparison of the CH or the exact p test’s endpoints to those of the PBR test, since the latter’s endpoint deviation grows as log(n)/2. The PBR test’s robustness to stopping rules requires that endpoint deviations must grow. p Qualitatively, we expect a growth of at least Ω( log log(n)) due to the law of the iterated p logarithm. This growth is slower than the log(n)/2 growth found above, suggesting that improvements are possible, as observed in Ref. [17]. In many applications, the number of trials to be acquired can be determined ahead of time, so full robustness to stopping rules is not necessary. However, the ability to adapt to changing experimental conditions may still be helpful, as the example in Sect. II shows. If we know the number of trials ahead of time, 15 we can retain the ability to adapt while avoiding the asymptotic growth of the endpoint deviations of the PBR test. A strategy for avoiding the asymptotic growth of the PBR test’s endpoint deviations is to set aside the first m = λn of the trials for training to infer the probability of success, and then use this to determine the test factor to be used on the remaining (1 − λ)n of the trials. With this strategy, the endpoint deviations are bounded on average and typically. We formalize the training strategy as follows: Modify Eq. 11 by setting Fk=1 = 1 for k < m and for k ≥ m, Fk+1 (Bk+1 ) = F (Bk+1 ) = Θ̂m ϕ !Bk+1 1 − Θ̂m 1−ϕ !1−Bk+1 . (36) Let G = F if ϕ ≤ Θ̂m and G = 1 otherwise. The Gk+1 are valid test factors for the null Bϕ . A p-value for testing B ϕ is given by 0 0 Pλ (B|ϕ) = G(1)−(n−m)Θ̂m G(0)−(n−m)(1−Θ̂m ) (37) where Θ̂0m is defined by (n − m)Θ̂0m + mΘ̂m = nΘ̂n . We call this the Pλ test. Define  (n−m)(1−Θ̂0m ) (n−m)Θ̂0m  ϕ 1−ϕ Qλ (B|ϕ) = . 1 − Θ̂m Θ̂m (38) Then for ϕ ≤ Θ̂m , Qλ (B|ϕ) = Pλ (B|ϕ). To investigate the behavior of these quantities, 0 of the corresponding RVs. As a function of ϕ, Qλ (b|ϕ) we consider values b, θ̂, θ̂m and θ̂m 0 0 0 , then . If θ̂m ≤ ϕ ≤ θ̂m is maximized at ϕ = θ̂m and monotone on either side of θ̂m 0 Qλ (b|ϕ) ≥ 1 = Pλ (b|ϕ), So for ϕ ≤ max(θ̂m , θ̂m ), we can use Qλ instead of Pλ without changing endpoint calculations. For determining the endpoint of a level-a one-sided confidence interval from Pλ , we seek the maximum ϕ such that for all ϕ0 ≤ ϕ, Pλ (b|ϕ0 ) ≤ a. This maximum value of ϕ satisfies 0 0 0 that ϕ ≤ min(θ̂m , θ̂m ): For θ̂m ≤ θ̂m , this follows from Pλ (b|θ̂m ) = 1. For θ̂m ≥ θ̂m , the 0 location of the maximum of Qλ implies that Pλ (b|θ̂m ) ≥ Pλ (b|θ̂m ) = 1. We show that endpoint deviations from the Pλ test are typically √ a constant factor larger than those of the CH test. For large α, the factor approaches 1/ 1 − λ, approximating the endpoint deviations for a CH test with (1 − λ)n trials. We begin by comparing Pλ to 0 PCH,(1−λ)n with the latter applied to the last (1 − λ)n trials and ϕ ≤ θ̂m , where we can use Qλ in place of Pλ . 0 Qλ (b|ϕ)/PCH,(1−λ)n (θ̂m |ϕ) = 0 θ̂m θ̂m 0 !(1−λ)nθ̂m 0 1 − θ̂m 1 − θ̂m 0 ) !(1−λ)n(1−θ̂m . (39) Or, for the log(p)-value difference lp , 0 0 lp = − log(Qλ (b|ϕ)) + log(PCH,(1−λ)n (θ̂m |ϕ)) = −(1 − λ)nKL(θ̂m |θ̂m ), (40) 16 which is non-positive. By expanding to second order, KL(t + x|t + y) = (t + x) (log(1 + x/t) − log(1 + y/t)) + (1 − t − x) (log(1 − x/(1 − t)) − log(1 − y/(1 − t))) (x − y)2 + O(max(|x|, |y|)3 ). = 2t(1 − t) (41) Let ∆ = Θ̂m − θ and ∆0 = Θ̂0m − θ. From the above expansion with t = θ, x = δ 0 and y = δ (where δ and δ 0 are values of ∆ and ∆0 )   (δ − δ 0 )2 0 3 lp = −(1 − λ)n + O(max(|δ|, |δ | )) . (42) 2θ(1 − θ) 0 The RVs ∆ and independent with means 0 and variances σ 2 /λ and σ 2 /(1 − λ). √ ∆ are √ Furthermore, n∆ and n∆0 are asymptotically normal with variances θ(1 − θ)/λ and √ 0 θ(1 − θ)/(1 − λ). Consequently, the RV n(∆ − ∆ ) is asymptotically normal with variance v = θ(1−θ)/(λ(1−λ)). Accordingly, the probability that n(∆−∆0 )2 ≥ κ2 θ(1−θ)/(λ(1−λ)) is asymptotically given by the two-sided tail for κ standard deviations of the standard normal. For determining typical behavior, we consider (δ − δ 0 )2 = κ2 θ(1 − θ)/(nλ(1 √ − λ)) with κ ≥ 0 3 03 constant for asymptotic purposes. Observe that n∆ and n∆ are Õ(1/ n) with probability 1, where the “soft-O” notation Õ subsumes the polylogarithmic factor from the law of the iterated logarithm. We can now write lp = − √ κ2 + Õ(1/ n). 2λ (43) q 0 (1 − θ̂ 0 )/(1 − λ)n, and let Fix the level a and thereby also α = | log(a)|. Define σ̂ = θ̂m m 0 0 − γ 0 σ̂ 0 be the smallest solution of − log(Qλ (b|ϕ0 )) = α. Because ϕ0 = θ̂m 0 − log(Qλ (b|ϕ0 )) = − log(PCH,(1−λ)n (θ̂m |ϕ0 )) + lp , (44) p √ 0 ; PCH ) = 2(α − lp ) + O(α/ n) with a0 = e−(α−lp ) . we can estimate γ 0 as γ 0 = γa0 ,(1−λ)n (θ̂m Here, the subscript (1 − λ)n of γa0 makes the previously implicit number of trials explicit. To finish our comparison, we express the endpoint ϕ0 relative to θ̂. For this, we write 0 ϕ0 = θ̂m − γ 0 σ̂ 0 s 0 = θ̂ + (θ̂m − θ̂) − γ 0 σ̂ 0 (1 − θ̂ 0 ) θ̂m m (1 − λ)θ̂(1 − θ̂)   γ 0 0 = θ̂ + (θ̂m − θ̂) − √ σ̂ 1 + O(|θ̂ − θ̂m |) . 1−λ 0 (45) 0 0 We have θ̂m − θ̂ = λ(θ̂m − θ̂m ) = λ(δ 0 − δ), and we are considering the case λ|δ 0 − δ| = 17 p κ λθ(1 − θ)/(n(1 − λ)), so ϕ0 = θ̂ − √ √  γ0 σ̂ 1 + O(1/ n) . 1−λ (46) We can therefore identify √ γ0 γa (θ̂|Pλ ) = √ (1 + O(1/ n)) 1−λ q √ √ 2(α + κ2 /(2λ) + Õ(1/ n)) + O(α/ n) √ √ (1 + O(1/ n)) = 1−λ p 2 √ 2(α + κ /(2λ)) √ + Õ(α/ n), = 1−λ √ √ which compares as promised to γa (θ̂; PCH ) = 2α + O(α/ n). VI. (47) CONCLUSION It is clear that for the specific problem of one-sided hypothesis testing and confidence intervals for Bernoulli RVs, it is always preferable to use the exact test in the ideal case, where the trials are i.i.d. For general nulls, exact tests are typically not available, so approximations are used. The approximations often do not take into account failure of underlying distributional assumptions. The approximation errors can be large at high significance. Thus trustworthy alternatives such as those based on large deviation bounds or test supermartingales are desirable. Our goal here is not to suggest that these alternatives are better for the example of Bernoulli RVs, but to determine the gap between them and an exact test, in a case where an exact test is known and all tests are readily calculable. The suggestion is that for high significance applications, the gaps are relatively small on the relevant logarithmic scale. For p-values, they are within what is expected from experiment-to-experiment variation, even for moderate significances. For confidence intervals, the increase in size is bounded by a constant if the number of trials is known ahead of time, but there is a slowly growing cost with number of trials if we allow for arbitrary stopping-rules. VII. A. APPENDIX Preliminaries Notation and definitions are as introduced in the text. The p-value bounds obtained by the three tests investigated are denoted by PX for the exact, PCH for the Chernoff-Hoeffding, and PPBR for the PBR test. They depend on n, ϕ and Θ̂. For reference, here are the 18 definitions again. PX (Θ̂|ϕ, n) = n X i n−i ϕ (1 − ϕ)   n , i i=nΘ̂    ϕ nΘ̂  1−ϕ n(1−Θ̂) if Θ̂ ≥ ϕ, 1−Θ̂ Θ̂ 1 otherwise. (  ϕnΘ̂ (1 − ϕ)n(1−Θ̂) (n + 1) nnΘ̂ if Θ̂ ≥ ϕ,  PPBR (Θ̂|ϕ) = Θ̂nΘ̂ (1 − Θ̂)n(1−Θ̂) (n + 1) nnΘ̂ otherwise. PCH (Θ̂|ϕ) = (48) The gain per trial for a p-value bound Pn is Gn (Pn ) = − log(Pn )/n. The values of ϕ, θ̂ and θ are usually constrained. Unless otherwise stated, we assume that 0 < ϕ, θ̂, θ < 1 and n ≥ 1. Most of this appendix is dedicated to obtaining upper and lower bounds on log(p)-values and lower bounds on endpoints of confidence intervals. We make sure that the upper and lower bounds differ by quantities that √ converge to zero as n grows. Their differences are O(1/n) for log(p)-values and O(1/ n) for confidence lower bounds. We generally aim for simplicity when expressing these bounds, so we do not obtain tight constants. B. Closed-Form Expression for PPBR Theorem 5. Define ek = Θ Fk+1 = Then 1 Qn k=1 1 (Sk + 1) , k+2 !B !1−Bk+1 e k k+1 1 − Θ ek Θ nΘ̂ Fk 1−ϕ ϕ =ϕ n(1−Θ̂) (1 − ϕ) .  n (n + 1) . nΘ̂ (49)  (50) Proof. The proof proceeds by induction. Write Pk for the right-hand side of Eq. 50. For n = 0, P0 = 1, and the left-hand side of Eq. 50 evaluates to 1 as required, with the usual convention that the empty product evaluates to 1. Now suppose that Eq. 50 holds at trial n = k. For n = k + 1 we can use (k + 1)Θ̂k+1 = Sk+1 = Sk + Bk+1 . We expand the binomial expression to rewrite the right-hand side as   k+1 kΘ̂k +Bk+1 k(1−Θ̂k )+(1−Bk+1 ) Pk+1 = ϕ (1 − ϕ) (k + 2) k Θ̂k + Bk+1   k = ϕkΘ̂k (1 − ϕ)k(1−Θ̂k ) (k + 1) k Θ̂k · ϕBk+1 (1 − ϕ)1−Bk+1 (k + 2)(k − k Θ̂k + 1)−(1−Bk+1 ) (k Θ̂k + 1)−Bk+1 . (51) 19 e k = (Sk + 1)/(k + 2) = (k Θ̂k + 1)/(k + 2) and 1 − Θ e k = (k − Sk + 1)/(k + 2) = Since Θ (k − k Θ̂k + 1)/(k + 2), the identity simplifies to Pk+1 = Pk · 1 Fk+1 , (52) thus establishing the induction step. The expression in Eq. 50 can be seen as the inverse of a positive martingale for H0 = {νϕ } determined by Sn . The complete family of such martingales was obtained by Ville [20], Chapter 5, Sect. 3, Eq. 21. Ours is obtained from Ville’s with dF (t) = dt as the probability measure. C. Log-p-Value Approximations We use − log(PCH,n (t|ϕ)) = nKL(t|ϕ) as our reference value. According to Thm. 1, the log(p)-values are ordered according to − log(PPBR ) ≤ − log(PCH ) ≤ − log(PX ). To express the asymptotic differences between the log(p)-values, we use auxiliary functions. The first is     √ nt n(1−t) n Hn (t) = − log t (1 − t) n+1 nt   n 1 = −nt log(t) − n(1 − t) log(1 − t) − log − log(n + 1). (53) nt 2 The first two terms of this expression can be recognized as the Shannon entropy of n independent random bits, each with t for bit value √ 1. For t ∈ [1/n, 1 − 1/n] and √ probability n 1/(12n+1) with Stirling’s approximation 2πn(n/e) e ≤ n! ≤ 2πn(n/e)n e1/(12n) applied to the binomial coefficient, we get     n n! log = log nt (tn)!((1 − t)n)! ! √   (n/e)n 2πn p ∈ log √ + log (tn/e)tn ((1 − t)n/e)(1−t)n 2πtn 2π(1 − t)n     1 1 1 1 1 1 + , + − − ,− − 12n + 1 12n 12tn 12(1 − t)n 12tn + 1 12(1 − t)n + 1 1 1 = − log(2πt(1 − t)) − log(n) − tn log(t) − (1 − t)n log(1 − t) 2 2  1 1 12n + 2 1 + − , − . (54) 12n + 1 12t(1 − t)n 12n (12tn + 1)(12(1 − t)n + 1) We can increase the interval to simplify the bounds while preserving convergence for large n. For the lower bound, we use −1/(12t(1 − t)n). For the upper bound, note that (12tn + 1)(12(1 − t)n + 1) is maximized at t = 1/2. We can therefore increase the upper bound 20 according to 12n + 2 1 2 1 − ≤ − ≤0 12n (12tn + 1)(12(1 − t)n + 1) 12n 6n + 1 (55) for n ≥ 1. From this we obtain the interval expression   1 1 1 Hn (t) ∈ log(2πt(1 − t)) − log(1 + 1/n) + 0, , 2 2 12nt(1 − t) (56) valid for t ∈ [1/n, 1 − 1/n]. The boundary values of Hn at t = 0 and t = 1 are − log(n + 1)/2. The next auxiliary function is   Z ∞ 1 1 t −s2 /2 Y (t) = −t2 /2 for t > 0, (57) , e ds ∈ 1 + t2 t e t where the bounds are from Ref. [13]. See this reference for a summary of all properties of Y mentioned here, or Ref. [15] for more details. The function Y is related to the tail of the √ −t2 /2 standard normal distribution, the Q-function, Y (t)/ 2π. The function Y pby Q(t) = e is monotonically decreasing, convex, Y (0) = π/2, and it satisfies the differential equation d Y (t) = tY (t) − 1. We make use of the following bounds involving Y : dt   1 − log tY (t) ∈ 0, 2 . (58) t The lower bound comes from the upper bound 1/t for Y (t). The upper bound is from the lower bound t/(1 + t2 ) for Y (t). Specifically, we compute − log(Y (t)) ≤ − log(t/(1 + t2 )) = log(t) + log(1 + 1/t2 ) ≤ log(t) + 1/t2 . With these definitions, we can express the log(p)-values in terms of their difference from − log(PCH ). Theorem 6. For 0 < ϕ ≤ t < 1, 1 log(n + 1) + Hn (t) (59) 2 1 1 1 ∈ − log(PCH,n (t|ϕ)) − log(n + 1) + log(2πt(1 − t)) − log(1 + 1/n) 2 2  2 1 + 0, , (60) 12nt(1 − t) − log(PPBR,n (t|ϕ)) = − log(PCH,n (t|ϕ)) − Proof. The theorem is obtained by substituting definitions and then applying the bounds of 21 Eq. 56 on Hn (t). Here are the details.    n nt n(1−t) − log(PPBR,n (t|ϕ)) = − log ϕ (1 − ϕ) (n + 1) nt !  ϕ nt  1 − ϕ n(1−t) = − log t 1−t    n nt n(1−t)) − log t (1 − t) (n + 1) nt 1 = − log(PCH,n (t|ϕ)) − log(n + 1) 2    √ n nt n(1−t)) − log t (1 − t) n+1 nt 1 = − log(PCH,n (t|ϕ)) − log(n + 1) + Hn (t). 2 (61) It remains to substitute the interval expression for Hn (t). Theorem 7. Define  lEn (t|ϕ) = min (t − ϕ) r  πn ,1 . 8ϕ(1 − ϕ) (62) Then for 0 < ϕ < t < 1, s ! (1 − ϕ) − log(PX,n (t|ϕ)) ∈ − log(PPBR,n (t|ϕ)) + log(n + 1) − log t ϕ     r √ lEn (t|ϕ) n (t − ϕ) + − ,0 , (63) − log nY ϕ(1 − ϕ) n(t − ϕ) s ! 1 t(1 − ϕ) − log(PX,n (t|ϕ)) ∈ − log(PCH,n (t|ϕ)) + log(n) − log 2 2π(1 − t)ϕ  r    √ n lEn (t|ϕ) 1 − log nY (t − ϕ) + − , . ϕ(1 − ϕ) n(t − ϕ) 12nt(1 − t) (64) Observe that lEn (t|ϕ) is O(1) with respect to n for t > ϕ constant. The first term in the defining minimum is smaller than 1 only for ϕ within less than one standard deviation √ (which is O(1/ n)) of t. It is defined so that the primary dependence on the parameters is visible in the interval bounds. Proof. For approximating PX , we apply Thm. 2 of Ref. [13] with the following sequence of 22 substitutions, the first four of which expand the definitions in the reference: B(k; n, p) ← n X b(j; n, p), j=k   n − 1 k−1 b(k − 1; n − 1, p) ← p (1 − p)n−k , k−1 x ← (k − pn)/σ, p σ ← np(1 − p), p ← ϕ, k ← nt. (65) With the given substitutions and Y (t) as defined by Eq. 57, we obtain for t ≥ ϕ,    p nt−1 n(1−t) n − 1 − log(PX ) ∈ − log nϕ(1 − ϕ)ϕ (1 − ϕ) nt − 1 !!   √ n(t − ϕ) lEn (t|ϕ) − log Y p ,0 + − n(t − ϕ) ϕ(1 − ϕ) ! p    nt nϕ(1 − ϕ) n = − log ϕnt (1 − ϕ)n(1−t) (n + 1) − log nt ϕn(n + 1) !!   √ n(t − ϕ) lEn (t|ϕ) ,0 − log Y p + − n(t − ϕ) ϕ(1 − ϕ) s ! (1 − ϕ) = − log(PPBR ) + log(n + 1) − log t ϕ !!   √ √ n(t − ϕ) lEn (t|ϕ) − log nY p + − ,0 . n(t − ϕ) ϕ(1 − ϕ) (66) The second identity of the theorem follows by substituting the expression from Thm. 6. We can eliminate the function Y from the expressions by applying the bounds from Eq. 58. Corollary 8. With the assumptions of Thm. 7, s 1−ϕ t t − ϕ 2π(1 − t)   lEn (t|ϕ) ϕ(1 − ϕ) 1 + − , + . n(t − ϕ) (t − ϕ)2 n 12nt(1 − t) − log(PX,n (t|ϕ)) ∈ − log(PCH,n (t|ϕ)) + 1 log(n) − log 2 ! (67) 23 p Proof. Define c = (t − ϕ)/ ϕ(1 − ϕ). In view of Eq. 58, we have r   √ √ √ n nY (t − ϕ) = − log( nY (c n)) − log ϕ(1 − ϕ) √ √ = log(c) − log(c nY (c n))   1 ∈ log(c) + 0, 2 . cn (68) Substituting in Eq. 64 and simplifying the expression gives the desired result. D. Asymptotic Normality of the log(p)-Values and Their Differences The main tool for establishing the asymptotic distribution of the log(p)-values is the “delta method”. A version sufficient for our purposes is Thm. 1.12 and Cor. 1.1 of Ref. [19]. The D → N (µ, σ 2 ) means that Xn converges in distribution to the normal distribution notation Xn − √ with mean µ and variance σ 2 . By the central limit theorem, Θ̂n = Sn /n satisfies n(Θ̂n − D θ) − → N (0, θ(1 − θ)). An application of the delta method therefore yields the next lemma. Lemma 9. Let F : R → R be differentiable at θ, with F 0 (θ) 6= 0. Then  √ D n(F (Θ̂n ) − F (θ)) − → N 0, F 0 (θ)2 θ(1 − θ) Theorem 10. For P = PCH , P = PPBR or P = PX , and 0 < ϕ < θ < 1 constant, the gain per trial Gn (P ) converges in distribution according to √ D 2 n(Gn (P ) − KL(θ|ϕ)) − → N (0, σG ), with 2 σG (69)   2 θ 1−ϕ = θ(1 − θ) log . 1−θ ϕ Proof. Consider P = PCH first. In Lem. 9, define F (x) = KL(x|ϕ) = x log(x/ϕ) + (1 − x) log((1 − x)/(1 − ϕ)) so that F (Θ̂n ) = Gn (PCH ). For the derivative of F at x = θ, we get   θ 1−ϕ 0 F (θ) = log . (70) 1−θ ϕ The theorem now follows for PCH by applying Lem. 9. √ √ Thm. 6 and the law of large numbers imply that (− log(PPBR )/ n) − (− log(PCH )/ √ n) converges in probability to 0. Cor. 8 implies the same for PX , namely that (− log(PX )/ n)− √ (− log(PCH )/ n) converges in probability to 0. In general, if Xn −Yn converges in probability D D to 0 and Yn − → µ, then Xn − → µ, see Ref. [3], Prop. 6.3.3. The statement √ of the theorem to be proven now follows for P = P and P = P by comparison of nGn (PPBR ) and PBR X √ √ nGn (PX ) to nGn (PCH ). 24 The differences of the log(p)-values have much tighter distributions. They are also asymptotically normal with scaling and variances √ given in the next theorem. The differences are Ω(log(n)) with standard deviations O(1/ n). √ Theorem 11. Let 0 < ϕ < θ < 1 be constant. If θ 6= 1/2, then PPBR /( nPCH ) satisfies ! p   √ 2πθ(1 − θ)PPBR D (1 − 2θ)2 √ − n log . (71) − → N 0, 4θ(1 − θ) nPCH If ϕ 6= θ(2θ − 1), then √ − n log √ nPX /PCH satisfies ! r   √ θ − ϕ 2π(1 − θ) nPX D (θ(1 − 2θ) + ϕ)2 , − → N 0, 1−ϕ θ PCH 4(θ − ϕ)2 θ(1 − θ) Proof. From Thm. 6, Eq. 60 and the law of large numbers, we see that  q    √ PPBR − log n − log √ 2π Θ̂(1 − Θ̂) nPCH (72) (73) converges in probability to zero. From Lem. 9 and 1 1 1 − 2x d log(x(1 − x))/2 = − = , dx 2x 2(1 − x) 2x(1 − x) we conclude   q p  √ D n log 2π Θ̂(1 − Θ̂) − log 2πθ(1 − θ) − →N  0, 1 − 2θ 2θ(1 − θ) (74) ! 2 θ(1 − θ) . (75) Combining the above observations gives Eq. 71. Similarly, from Cor. 8 and taking note of the definition of lEn (t|ϕ),    s √  √ nPX Θ̂ − ϕ 2π(1 − Θ̂)  n − log − log  PCH 1−ϕ Θ̂ (76) converges in probability to zero. The relevant derivative is d 1 1 1 x(1 − 2x) + ϕ (log(x − ϕ) + log((1 − x)/x)/2) = − − = , dx x − ϕ 2(1 − x) 2x 2(x − ϕ)x(1 − x) (77) 25 from which √   n log  Θ̂ − ϕ 1−ϕ s  2π(1 − Θ̂)  Θ̂ D  − log  − →N  0, θ−ϕ 1−ϕ s  2π(1 − θ̂)  θ̂ θ(1 − 2θ) + ϕ 2(θ − ϕ)θ(1 − θ) 2 ! θ(1 − θ) , (78) and combining the two observations gives Eq. 72. E. Confidence Interval Endpoints For the one-sided confidence intervals, we need to determine the lower boundaries of acceptance regions, that is the confidence lower bounds. By monotonicity of the p-values in ϕ, it suffices to solve equations of the form − log(P (θ̂, ϕ)) = α, where a = e−α is the desired significance level. Here we obtain lower and upper bounds on the solutions ϕ. To illuminate the asymptotic behavior of solutions ϕ of − log(P (θ̂, ϕ)) = α, we reparametrize qthe log-p-values so that our scale is set by an empirical standard deviation, namely σ̂ = θ̂(1 − θ̂)/n. Thus we express the solution as ϕ(γ, θ̂) = θ̂ − σ̂γ, (79) in terms of a scaled deviation down from θ̂. Inverting for γ we get γ = γ(ϕ, θ̂) = θ̂ − ϕ . σ̂ (80) Theorem 12. Let 0 < θ̂ < 1 and α > 0. Suppose that α ≤ nθ̂2 (1 − θ̂)2 /8. Then there is a solution γα > 0 of the identity − log(PCH (θ̂, ϕ(γα , θ̂))) = α satisfying γα ∈ √  2α 1 + √ −1/2 α 5 q [−1, 1] 2 nθ̂(1 − θ̂) . (81) The constants in this theorem and elsewhere are chosen for convenience, not for optimality; better constants can be extracted from the proofs. Note that the upper bound on α ensures that the reciprocal square root is bounded away from zero. However, for the relative error to go to zero as n grows requires α = o(n). Proof. Consider the parametrized bound α ≤ 2nθ̂2 (1 − θ̂)2 (1 − a1 )2 , where later we set a1 = 3/4 to match the theorem statement. Let F (γ) = − log(PCH (θ̂, ϕ(γ, θ̂))). F is continuous and monotone increasing. A standard simplification of the Chernoff-Hoeffding bound noted in Ref. [10] is 2 2 PCH ≤ e−2n(θ̂−ϕ) = e−2θ̂(1−θ̂)γ . (82) 26 p For ϕ = ϕ(γα , θ̂) solving the desired equation, we p have (θ̂−ϕ) ≤ α/(2n) (by monotonicity), which in turn is bounded above according to α/2n ≤ θ̂(1 − θ̂)(1 − a1 ) ≤ θ̂(1 − a1 ), according qbound. We conclude that ϕ ≥ a1 θ̂. For the solution γα , we get q to our assumed γα ≤ α/(2θ̂(1 − θ̂)) ≤ nθ̂(1 − θ̂)(1 − a1 ). We now Taylor expand KL(θ̂|ϕ) with remainder at third order around ϕ = θ̂. Write f (x) = KL(θ̂|θ̂ − x), where we can restrict x according to θ̂ ≥ θ̂ − x = ϕ ≥ a1 θ̂. The derivatives of f can be written explicitly as follows: f (k) (x) = (k − 1)! θ̂ (θ̂ − x)k − (−1)k−1 (k − 1)! 1 − θ̂ (1 − θ̂ + x)k . (83) We have f (1) (0) = 0, 1 1 1 = , f (2) (0) = + θ̂ 1 − θ̂ θ̂(1 − θ̂) f (3) (x) = 2 f (3) (x) ≤ 2 θ̂ (θ̂ − x)3 θ̂ (θ̂ − f (3) (x) ≥ −2 x)3 −2 1 − θ̂ (1 − θ̂ + x)3 ≤2 θ̂ a31 θ̂3 1 − θ̂ (1 − θ̂ + x)3 =2 ≥ −2 , 1 a31 θ̂2 , 1 − θ̂ (1 − θ̂)3 = −2 1 (1 − θ̂)2 , (84) since 0 < a1 < 1. We use the bounds on f (3) (x) to bound the remainder in the Taylor expansion, where, to get cleaner expressions, we can decrease θ̂ and 1 − θ̂ to θ̂(1 − θ̂) in the denominators.   x3 1 x2 KL(θ̂|θ̂ − x) ∈ + −1, 3 . (85) a1 2θ̂(1 − θ̂) 3(θ̂(1 − θ̂))2 q Substituting x = γα θ̂(1 − θ̂)/n gives α = − log(PCH (θ̂, ϕ(γα , θ̂))) = nKL(θ̂|θ̂ − x) ∈ γα2  1 + q 2γα 2 3 nθ̂(1 − θ̂)    1 −1, 3  . a1 (86) For θ̂ ≤ 1/2, f (4) (x) and f (3) (0) are non-negative, so we could have taken the lower bound in the interval to be zero for θ ≤ 1/2. q For the theorem, we prefer not to separate the cases. We substitute the bound γ ≤ nθ̂(1 − θ̂)(1 − a1 ) for the γ multiplying the interval in Eq. 86 and use the lower bound in the interval for the inequality   γ2 2(1 − a1 ) α≥ 1− . (87) 2 3 27 For the theorem, we have a1 = 3/4, so 1 − 2(1 − a1 )/3 = 5/6. Inverting the inequality for γ p √ gives γ ≤ 2 3/5 α. Now substituting this bound on γ for the γ multiplying the interval in Eq. 86 gives     √ 2 3 γ  4 α 4 α∈ 1+ √ q (88) −1, 3  . 2 3 15 nθ̂(1 − θ̂) By monotonicity of the appropriate operations, γ∈ √  √  3  −1/2 4 4 α −1, 3  2α 1 + √ q 3 15 nθ̂(1 − θ̂) . (89) √ For the theorem statement, we simplify the bounds with 1 ≤ 43 /33 and 44 /(33 15) ≤ 5/2. Theorem 13. Let 0 < θ̂ < 1 and α > 0. Define ∆ = log(n + 1)/2 − Hn (θ̂). Suppose that α + ∆ ≤ nθ̂2 (1− θ̂)2 /8. Then there is a solution γα > 0 of the identity − log(PPBR (θ̂, ϕ(γα , θ̂))) = α satisfying  −1/2 √ p 5 α+∆ . γα ∈ 2(α + ∆) 1 + q [−1, 1] 2 nθ̂(1 − θ̂) Proof. By Thm. 6, − log(PCH ) − (− log(PPBR )) = ∆. If we define α̃ = α + ∆, then solving − log(PPBR ) = α is equivalent to solving − log(PCH ) = α̃. Since ∆ depends only on n and θ̂, α̃ does not depend on γ. We can therefore apply Thm. 12 to get the desired bounds. √ 2 Theorem 14. For x ≥ 0, let q(x) = − log(e−x /2 Y (x)/ 2π) = x2 /2+log(2π)/2−log(Y (x)). Suppose that 0 < θ̂ < 1, and log(2) < α ≤ nθ̂2 (1 − θ̂)2 /8. Then there is a solution γα of the identity − log(PX (θ̂, ϕ(γα , θ̂)) = α satisfying     p  √ √ √ √ π/6 + 8 α/ 15 64 α/(15 15) q γα ∈ max 0, q −1 α 1 + q [−1, 1] + [−1, 1] nθ̂(1 − θ̂) nθ̂(1 − θ̂)   √ √ 2 α/ 5 × 1 + q [−1, 1] , (90) nθ̂(1 − θ̂) where we extend q −1 to negative values by q −1 (y) = −∞ for y ≤ 0 (if necessary) when evaluating this interval expression. The function q(x) is the negative logarithm of the Q-function, which is the tail of the standard normal distribution. The lower bound on α in Thm. 14 ensures that there is a solution with γα > 0, because√q(0) = log(2). For the constants multiplying the √ reference, p √ interval expressions are 64/(15 15) ≈ 1.102, 8/√ 15 ≈ 2.066, π/6 ≈ 0.724, 2/ 5 ≈ 0.894. Note that in the large n limit, where the O(1/ n) terms are negligible, the value of γα in Thm. 14 corresponds to the (1 − e−α )-quantile of the standard normal. 28 By monotonicity of q −1 , the explicit bounds in Eq. 90 are obtained by combining the lower or the upper bounds in intervals in the expression. We remark that q −1 behaves well with respect to relative error for α large enough because of the inequalities d −1 q (y) ≤ 1/q −1 (y), dy q −1 (y)2 ≥ y − q(1) + 1, for y ≥ q(1) ≈ 1.841, q −1 (y)2 ≤ 2(y − log(2)), for y ≥ q(0) = log(2), q −1 (y)/(1 + q −1 (y)2 ) ≤ (91) which we now establish. By implicit differentiation and from the properties of Y noted d −1 after Eq. 57, dy q (y)|y=q(x) = Y (x) ∈ [x/(1 + x2 ), 1/x]. Therefore q −1 (y)/(1 + q −1 (y)2 ) ≤ d −1 d −1 d −1 q (y) ≤ 1/q −1 (y). For y ≥ log(2), we can integrate dz q (z)2 = 2q −1 (z) dz q (z) ≤ 2 from dy −1 2 −1 2 −1 2 z = log(2) to y to show that q (y) = q (y) − q (log(2)) ≤ 2(y − log(2)), making use of the identity q −1 (log(2)) = 0. Consider y, z ≥ q(1). Since q −1 (z) and 0 ≤ x 7→ x2 /(1 + x2 ) are monotone increasing, q −1 (z)2 /(1 + q −1 (z)2 ) ≥ q −1 (q(1))2 /(1 + q −1 (q(1))2 ) = 1/2, so the d −1 d −1 integral of dz q (z)2 from z = q(1) to y with the lower bound on dz q (z) gives q −1 (y)2 − −1 2 −1 2 q (q(1)) = q (y) − 1 ≥ y − q(1). d −1 From the inequality dy q (y) ≤ 1/q −1 (y) in Eq. 91, integration and monotonicity, for 0 ≤ z ≤ δ,   z z −1 −1 −1 q (α − z) ≥ q (α) − −1 ≤ q (α) 1 − −1 , q (α − δ) q (α − δ)2   z z ≥ q −1 (α) 1 + −1 . (92) q −1 (α + z) ≤ q −1 (α) + −1 q (α − δ) q (α − δ)2 To determine the relative error, write δ 0 = δ/α to obtain the interval inclusion   αδ 0 −1 0 −1 [−1, 1] . q (α(1 + δ [−1, 1])) ⊆ q (α) 1 + −1 q (α(1 − δ 0 ))2 For α(1 − δ 0 ) > q(1), the interval relationship can be weakened to   αδ 0 −1 0 −1 q (α(1 + δ [−1, 1])) ⊆ q (α) 1 + [−1, 1] . α(1 − δ 0 ) − q(1) + 1 (93) (94) The relative error on the right-hand side is given by the term multiplying the interval, and can be written as αδ 0 /(α − (αδ 0 + q(1) − 1)). If αδ 0 + q(1) − 1 ≤ α/2, then the relative error is bounded by 2δ 0 which is twice the relative error of α. Of course, for the interval bounds to converge, we need α = o(n). Proof. As in the proof of Thm. 12, consider the parametrized bound α ≤ 2nθ̂2 (1−θ̂)2 (1−a1 )2 , where later we set a1 = 3/4 to match Thm. 14. From the Chernoff-Hoeffding q the statement ofq bound, we get ϕ ≥ a1 θ̂ and γα ≤ α/(2θ̂(1 − θ̂)) ≤ nθ̂(1 − θ̂)(1 − a1 ). 29 p Define γ̃ = (θ̂ − ϕ)/ ϕ(1 − ϕ)/n. We start from Eq. 64, rewritten as follows: ! 1 θ̂(1 − ϕ) 1 − log(PX ) ∈ nKL(θ̂|ϕ) + log(2π) − log Y (γ̃) − log 2 2 (1 − θ̂)ϕ " # lEn (θ̂|ϕ) 1 + − , . n(θ̂ − ϕ) 12nθ̂(1 − θ̂) (95) p If γ̃ ≥ 8/π ≈ 1.6, lEn (θ̂|ϕ) = 1. For better bounds at small values of γ̃, we use the other alternative in the definition of lEn , according to which the lower bound in the last interval of Eq. 95 is p p p π/8 π/8 π/8 lEn (θ̂|ϕ) − ≥ −q ≥ −q . (96) ≥ −p nϕ(1 − ϕ) n(θ̂ − ϕ) na1 θ̂(1 − ϕ) na1 θ̂(1 − θ̂) Next we approximate nKL(θ̂|ϕ) in terms of γ̃ instead of γ. We still write the interval bounds in terms of γ. Let f (x) = KL(ϕ + x|ϕ). We are concerned with the range 0 ≤ x ≤ θ̂ − ϕ, with ϕ ≥ a1 θ̂. We have f (1) (x) = log((ϕ + x)/ϕ) − log((1 − ϕ − x)/(1 − ϕ)) 1 1 f (2) (x) = + ϕ+x 1−ϕ−x 1 = (ϕ + x)(1 − ϕ − x) 1 1 f (3) (x) = − + 2 (ϕ + x) (1 − ϕ − x)2 1 − 2(ϕ + x) =− (ϕ + x)2 (1 − ϕ − x)2 1 , |f (3) (x)| ≤ 2 2 a1 θ̂ (1 − θ̂)2 (97) yielding KL(ϕ + x|ϕ) ∈ x2 x3 + [−1, 1], 2ϕ(1 − ϕ) 6a21 θ̂2 (1 − θ̂)2 (98) q p and with x = γ̃ ϕ(1 − ϕ)/n = γ θ̂(1 − θ̂)/n, nKL(θ̂|ϕ) ∈ γ̃ 2 + 2 γ3 q [−1, 1]. 2 6a1 nθ̂(1 − θ̂) (99) 30 For the fourth term on the right-hand side of Eq. 95, ! 1 1 1 θ̂(1 − θ̂ + x) d = + = , log dx (1 − θ̂)(θ̂ − x) 1 − θ̂ + x θ̂ − x (1 − θ̂ + x)(θ̂ − x) whose absolute value is bounded by 1/(a1 θ̂(1 − θ̂)) for x in the given range. Thus ! θ̂(1 − ϕ) γ log ∈ q [−1, 1]. (1 − θ̂)ϕ a1 nθ̂(1 − θ̂) (100) (101) p √ Since PX ≤ PCH , we can also use the bound γ ≤ 2 3/5 α obtained in the proof of Thm. 12. Substituting a1 = 3/4 as needed, the equation to solve is now γ̃ 2 1 α∈ + log(2π) − log Y (γ̃) 2 2 √ √ 3 8 64 α α +√ q [−1, 1] + √ q [−1, 1] 15 nθ̂(1 − θ̂) 15 15 nθ̂(1 − θ̂)   p π/6 1 . + − q , 12n θ̂(1 − θ̂) nθ̂(1 − θ̂) (102) The sum of the first three terms evaluates to q(γ̃). The remaining terms are now independent √ of γ and are q of order 1/ n. They can be merged by means of common bounds using 2nθ̂(1 − θ̂) ≥ nθ̂(1 − θ̂), since nθ̂(1 − θ̂) ≥ 1/2 for our standing assumptions that n ≥ 1 q and θ̂n is an integer different from 0 and n. Consequently, 12nθ̂(1 − θ̂) ≥ 6 nθ̂(1 − θ̂) ≥ q p 6/π nθ̂(1 − θ̂). The interval bounds then combine conservatively to p √ √ √ √ 3 π/6 + 8 α/ 15 + 64 α /(15 15) q . nθ̂(1 − θ̂) (103) p √ √ √ √ 3 π/6 + 8 α/ 15 + 64 α /(15 15) q α ∈ q(γ̃) + [−1, 1], nθ̂(1 − θ̂) (104)  p √ √ √ √ π/6 + 8 α/ 15 64 α/(15 15) q q(γ̃) ∈ α 1 + q [−1, 1] + [−1, 1]. nθ̂(1 − θ̂) nθ̂(1 − θ̂) (105) We can now write which holds iff  31 By monotonicity of q and extending q −1 to negative arguments as mentioned in the statement of Thm. 14 if necessary, the constraint is equivalent to  p    √ √ √ √ π/6 + 8 α/ 15 64 α/(15 15) q [−1, 1] + [−1, 1] . (106) γ̃ ∈ q −1 α 1 + q nθ̂(1 − θ̂) nθ̂(1 − θ̂) For α > log(2), we know that γ̃ > 0, so we can add max(0, . .q .) as in the theorem statement. To determine the interval equation for γ, we have γ = γ̃ ϕ(1 − ϕ)/(θ̂(1 − θ̂)). We use the first-order remainder to bound the factor on the right-hand side. For this consider the q numerator, and write g(x) = (θ̂ − x)(1 − θ̂ + x) with 0 ≤ x ≤ θ̂ − ϕ. We have 2(θ̂ − x) − 1 g (1) (x) = q , 2 (θ̂ − x)(1 − θ̂ + x) 1 |g (1) (x)| ≤ q 2 a1 θ̂(1 − θ̂) 1 =q , 3θ̂(1 − θ̂) q x g(x) ∈ θ̂(1 − θ̂) + q [−1, 1]. 3θ̂(1 − θ̂) (107) (108) (109) q p √ With x = γ θ̂(1 − θ̂)/n and the bound of γ ≤ 2 3/5 α, we get  √ √ 2 α/ 5 γ ∈ γ̃ 1 + q [−1, 1] . nθ̂(1 − θ̂)  (110) The theorem follows by composing this constraint with Eq. 106. Acknowledgments This work includes contributions of the National Institute of Standards and Technology, which are not subject to U.S. copyright. Y. Z. would like to acknowledge supports through the Ontario Research Fund (ORF), the Natural Sciences and Engineering Research Council of Canada (NSERC), and Industry Canada. [1] A. Acı́n and L. Masanes. Certified randomness in quantum physics. Nature, 540:213–219, 2016. 32 [2] P. Bierhorst. A robust mathematical model for a loophole-free Clauser-Horne experiment. J. Phys. A, 48:195302, 2015. [3] P. J. Brockwell and R. A. Davis. Time Series: Theory and Methods. Springer Verlag, New York, NY, 2nd edition, 1991. [4] Herman Chernoff. A measure of asymptotic efficiency for tests of a hypothesis based on the sum of observations. The Annals of Mathematical Statistics, 23:493–507, Dec. 1952. [5] B. G. Christensen, A. Hill, P. G. Kwiat, E. Knill, S. W. Nam, K. Coakley, S. Glancy, L. K. Shalm, and Y. Zhang. Analysis of coincidence-time loopholes in experimental Bell tests. Phys. Rev. A, 92:032130, Sep 2015. [6] Tommaso Dorigo. Extraordinary claims: the 0.000029% solution. In EPJ Web of Conferences, volume 95, page 02003. EDP Sciences, 2015. [7] Marco Genovese. Research on hidden variable theories: A review of recent progresses. Physics Reports, 413(6):319–396, 2005. [8] M. Giustina et al. Significant-loophole-free test of Bell’s theorem with entangled photons. Phys. Rev. Lett., 115:250401, Dec 2015. [9] B. Hensen et al. Loophole-free Bell inequality violation using electron spins separated by 1.3 km. Nature, 526:682, 2015. [10] W. Hoeffding. Probability inequalities for sums of bounded random variables. Journal of the American Statistical Association, 58:13, 1963. [11] S. Kullback and R. A. Leibler. On information and sufficiency. Ann. Math. Statist., 22:79, 1951. [12] J.-A. Larsson. Loopholes in Bell inequality tests of local realism. J. Phys. A, 47:424003, 2014. arXiv:1407.0363. [13] Brendan D. McKay. On Littlewood’s estimate for the binomial distribution. Adv. Appl. Prob., 21(2):475–478, 1989. [14] S. V. Nagaev and V. I. Chebotarev. On the bound of proximity of the binomial distribution to the normal one. Doklady Mathematics, 436(1):26–18, 2011. [15] Jagdish K Patel and Campbell B Read. Handbook of the normal distribution, volume 150. CRC Press, 1996. [16] Wenjamin Rosenfeld, Daniel Burchardt, Robert Garthoff, Kai Redeker, Norbert Ortegel, Markus Rau, and Harald Weinfurter. Event-ready Bell-test using entangled atoms simultaneously closing detection and locality loopholes. Phys. Rev. Lett., 119:010402, 2017. [17] Glenn Shafer, Alexander Shen, Nikolai Vereshchagin, and Vladimir Vovk. Test martingales, Bayes factors and p-values. Statist. Sci., 26:84–101, 2011. [18] L. K. Shalm et al. Strong loophole-free test of local realism. Phys. Rev. Lett., 115:250402, Dec 2015. [19] Jun Shao. Mathematical Statistics. Springer New York, 2nd edition, 2003. [20] J. Ville. Etude Critique de la Notion de Collectif. Gauthier-Villars, Paris, 1939. [21] Yanbao Zhang, Scott Glancy, and Emanuel Knill. Asymptotically optimal data analysis for rejecting local realism. Phys. Rev. A, 84:062118, Dec 2011. [22] Yanbao Zhang, Scott Glancy, and Emanuel Knill. Efficient quantification of experimental evidence against local realism. Phys. Rev. A, 88:052119, Nov 2013. 33 Figures 1.0 −0.05 0.05 0.15 0.0 0.5 − log(P) n 1.5 n = 100 median(− log(PCH) n) KL(θ | ϕ) n 0.16 and 0.84 quantiles of − log(PCH) n −0.20 median(− log(PX)) n − median(− log(PCH)) n median(− log(PPBR)) n − median(− log(PCH)) n 0.16 and 0.84 quantiles − median of − log(PCH) n 0.0 0.1 0.2 0.3 0.4 0.5 ϕ FIG. 1: Comparison of log(p)-values at n = 100 and θ = 0.5. The top half of the figure shows the median, the 0.16 and the 0.84 quantile of − log(PCH,n (Θ̂|ϕ))/n. For θ = 0.5, the median agrees with KL(θ|ϕ) by symmetry. The lower half shows the median differences − log(P (Θ̂|ϕ))/n + log(PCH,n (Θ̂|ϕ))/n for P = PPBR,n and P = PX,n . The difference between the 0.16 and 0.84 quantiles and the median for − log(PCH,n (Θ̂|ϕ))/n are also shown where they are within the range of the plot; even for n as small as 100, they dominate the median differences, except where ϕ approaches θ = 0.5, where the absolute p-values are no longer extremely small. 34 0.0 −0.5 (− log(PX) − (− log(PCH))) log(n), n = 100 (− log(PPBR) − (− log(PCH))) log(n), n = 100 (− log(PX) − (− log(PCH))) log(n), n = 1000 (− log(PPBR) − (− log(PCH))) log(n), n = 1000 (− log(PX) − (− log(PCH))) log(n), n = 10000 (− log(PPBR) − (− log(PCH))) log(n), n = 10000 −1.0 (− log(P) − (− log(PCH))) log(n) 0.5 FIGURES 0.5 0.6 0.7 0.8 0.9 1.0 θ^ FIG. 2: Gaps between the log(p)-values depending on θ̂ at ϕ = 0.5. We show the nor malized differences − log(Pn (θ̂|ϕ)) + log(PCH,n (θ̂|ϕ)) / log(n) for P = PCH and P = PX at n = 100, 1000, 10000. For large n, at constant θ̂ with 0.5 < θ̂ < 1, the PBR test’s normalized difference converges to −0.5, and the exact test’s converges to 0.5. The horizontal lines at ±0.5 indicate this limit. The lowest order normalized asymptotic differences from ±0.5 are O(1/ log(n)) and diverge at θ̂ = 0.5 and θ̂ = 1. 35 PX PCH PPBR 0.40 0.35 ϕa(θ^ ; P) 0.45 0.50 FIGURES 1e+02 1e+03 1e+04 1e+05 1e+06 n FIG. 3: Lower endpoints for the level 0.01 confidence set of the three tests as a function of n, where θ̂ = 0.5. FIGURES 36 PX PCH PPBR 3 2 γa(θ^ ; P) 4 5 PX (asymptotic) |0.1 quantile of unit normal| PCH (asymptotic) PPBR (asymptotic) 1e+02 1e+03 1e+04 1e+05 1e+06 n FIG. 4: Empirical confidence set endpoint deviations at level a = 0.1 for θ̂ = 0.5 as a function of √ n. The continuous lines show the expressions obtained after dropping the O(1/ n) terms. For the exact test, these expressions are the same as the normal approximation and therefore match the absolute value of the 0.1 quantile of a unit normal. 37 5.5 FIGURES PX PCH PPBR 4.0 2.5 3.0 3.5 γa(θ^ ; P) 4.5 5.0 PX (asymptotic) |0.01 quantile of unit normal| PCH (asymptotic) PPBR (asymptotic) 1e+02 1e+03 1e+04 1e+05 1e+06 n FIG. 5: Empirical confidence set endpoint deviations at level a = 0.01 for θ̂ = 0.5 as a function of n. See the caption of Fig. 4. 38 6.0 FIGURES PX PCH PPBR 4.5 3.0 3.5 4.0 γa(θ^ ; P) 5.0 5.5 PX (asymptotic) |0.001 quantile of unit normal| PCH (asymptotic) PPBR (asymptotic) 1e+02 1e+03 1e+04 1e+05 1e+06 n FIG. 6: Empirical confidence set endpoint deviations at level a = 0.001 for θ̂ = 0.5 as a function of n. See the caption of Fig. 4.
10math.ST
ImNet: An Imperative Network Programming Language Mohamed A. El-Zawawy1,2,∗ of Computer and Information Sciences Al Imam Mohammad Ibn Saud Islamic University (IMSIU) Riyadh Kingdom of Saudi Arabia arXiv:1403.8028v1 [cs.PL] 23 Feb 2014 1 College Adel I. AlSalem College of Computer and Information Sciences Al Imam Mohammad Ibn Saud Islamic University (IMSIU) Riyadh Kingdom of Saudi Arabia [email protected] 2 Department of Mathematics Faculty of Science Cairo University Giza 12613 Egypt [email protected] Abstract: One of the most recent architectures of networks is Software-Defined Networks (SDNs) using a controller appliance to control the set of switches on the network. The controlling process includes installing or uninstalling packet-processing rules on flow tables of switches. This paper presents a high-level imperative network programming language, called ImNet, to facilitate writing efficient, yet simple, programs executed by controller to manage switches. ImNet is simply-structured, expressive, compositional, and imperative. This paper also introduces an operational semantics to ImNet. Detailed examples of programs (with their operational semantics) constructed in ImNet are illustrated in the paper as well. Key–Words: Network programming languages, controller-switch architecture, operational semantics, syntax, ImNet. 1 Introduction A network is a group of appliances connected to exchange data. Among these appliances are switches forwarding data depending on MAC addresses, routers forwarding data depending on IP addresses, and firewalls taking care of forbidden data. The network appliances are connected using a model that efficiently allows forwarding, storing, ignoring, tagging, and providing statistics about data moving in the network. Some of the network appliances, like routers [21, 16], are special in their functionality as they have some control over the network. This enables routers to compute and determine routes of data in the network. Of course different networks have different characteristics and abilities. In 2011, the Open Networking Foundation [33], suggested removing the control owned by different network appliances and adding, instead, a generalpurpose appliance, controller, to program different network appliances and querying data flowing in the network. The impact of this simple suggestion is huge; giant networks do not need special-purpose, ∗ Corresponding author. complex, expensive switches any more. In such networks, cheap programmable switches can be used and programmed to configure and optimize networks via writing programs [20] running on controllers. Software-Defined Networks (SDNs) [10] are networks established using the controller-switch architecture. A precise implementation of this architecture is OpenFlow [2] used to achieve various network-wide applications such as monitoring data flow, balancing switch load, network management, controlling appliances access, detection of service absence, host mobility, and forwarding data center. Therefore SDNs caused the appearance of network programming languages [18, 19, 17, 11]. This paper presents ImNet, an imperative highlevel network programming language. ImNet expresses commands enabling controllers to program other network appliances including switches. ImNet has a clear and simply-structured syntax based on classical concepts of imperative programming that allows building rich and robust network application in a natural way. ImNet can be realized as a generalization of Frenetic [24] which is a functional network programming language. This is clear by the fact that the core of programs written in ImNet and Frenetic is based on a query result in the form of stream of values (packets, switches IDs, etc.). Commands for treating packets in ImNet include constructing and installing (adding to flow tables of switches) switch rules. ImNet supports building simple programs to express complex dynamic functionalities like load balancing and authentication. ImNet programs can also analyze packets and historical traffic patterns. Motivation The motivation of this paper is the lack of a simple syntax for an imperative network programming language. Yet, a stronger motivation is that most existing network programming languages are not supported theoretically (using operational semantics, type systems, program logics like FloydHoare logic,etc.). Contributions Contributions of this paper are the following. Definition 1 1. t ∈ Types = {int, Switch IDs, Packet, (Switch IDs, int, bool)}∪{(t1 , t2 ) | t1 , t2 ∈ Types}. 2. v ∈ Values = Natural numbers ∪ Switch IDs ∪ Packets ∪ Switch IDs × Natural numbers × Boolean values ∪ {(v1 , v2 ) | v1 , v2 ∈ Values}. The expression v : t denotes that the type of the value v is t. 3. ev ∈ Events = {(v1 , v2 , . . . , vn ) | ∃t(∀i vi : t)}. 4. Actions= {sendcontroller, change(h,v) }. sendall, sendout, 5. r ∈ Rules = Patterns × Actions. 6. rl ∈ Rule-lists = {[r1 , r2 , . . . , rn ] | ri ∈ Rules}. 7. ir ∈ Intial-rule-assignment = Switch IDs × Rules. 8. σ ∈ Swich-states = Switch IDs → Rule-lists. Flow-tables = 1. A new simply-structured syntax for an imperative network programming language; ImNet. 9. γ ∈ Variable-states = Var → Events∪Rule-lists. 2. An operational semantics (in the form of states and inference rules) for constructs of ImNet. 10. s ∈ States = Swich-states × Variable-states × Rule-lists. 3. Two detailed examples of programs constructed in ImNet with their precise operation semantics. A program in ImNet is a sequence of queries followed by a statement. The result of each query is an event which is a finite sequence of values. The event concept is also used in Frenetic. However an event in Frenetic is an infinite sequence of values. A value is an integer, a switch ID, a packet, a triple of a switch ID, an integer, and a Boolean value, or a pair of two values. Each value has a type of the set Types. In this paper, we focus on the details of statements as this is the most interesting part in a network programming language. Possible actions taken by a certain switch on a certain packet are sendcontroller, sendall, sendout, or change(h,v). The action sendcontroller sends a packet to the controller to take care of it. The action sendall sends the packet to all other switches. The action sendout sends the packet out of the switch through a certain port. The action change(h,v) modifies the header field h of the packet to the new value v. A rule in our semantics is a pair of pattern and action where pattern is a form that concretely describes a set of packets and action is the action to be taken on elements of this set of packets. Rules are stored in tables (called flow tables) of switches. Intial-ruleassignment represents an initial assignment of rules to flow tables of switches. Organization The rest of this paper is organized as following. Section 2 presents the syntax and semantics of ImNet. The proposed semantics is operational and hence consists of states and inference rules presented in Section 2. Two detailed examples of programmes built in ImNet are presented in Section 3. This section also explains how the two examples can be assigned precise semantics using our proposed operational semantics. Section 4 reviews related work and gives directions for future work. Section 5 concludes the paper. 2 Semantics This section presents the syntax and semantics of ImNet, a high-level programming language for SDN networks using switch-controller architecture. Figure 1 shows the syntax of ImNet. Figures 2 and 3 present the semantics of ImNet constructs. The proposed semantics is operational and its states are defined in the following definition. x ∈ lVar et ∈ Eventrans ::= Q ∈ Queries Lift(x, λt.f (t)) | ApplyLft(x, λt.f (t)) | ApplyRit(x, λt.f (t)) | Merge(x1 , x2 ) | MixFst(A, x2 , x3 ) | MixSnd(A, x2 , x3 ) | Filter(x, λ.f (t)) | Once(x) | MakForwRule(x) | MakeRule(x) S ∈ Stmts ::= x := et | S1 ; S2 | AddRules(x) | Register | Send(x) D ∈ Defs ::= ǫ | x := Q | DD. p ∈ Progs ::= D ≫ S. Figure 1: ImNet Syntax. A state in the proposed operational semantics is a triple (σ, γ, ir). In this triple γ captures the current state of the program variables and hence is a map from the set of variables to the set of events and rule lists. This is so because in ImNet variables may contain events or rule lists. The symbol σ captures the current state of flow tables of switches and hence is a map from switches IDs to rule lists. Finally, ir is an initial assignment of rules assigned to switches but have not been registered yet (have not been added to γ yet). There are five type of statements in ImNet. The assignment statement x := ef assigns the result of an event transformer (et) to the variable x. The statement AddRules(x) adds the switch rules stored in x to the reservoir of initially assigned rules. These are rules that are assigned to switches but are not added to flow tables yet. The statement Register makes the initial assignments permeant by adding them to flow tables of switches. The statement Send(x) sends specific packets to be treated in a certain way at certain switches. To keep a record of actions takes on packets on different switches we assume a map called history from the set of switches IDs to the set of lists of pairs of packets and taken actions. This map is used in the Rule (Sends ). Operational semantics of these statements are given in Figure 3. Judgement of inference rules in this figure have the form S : (σ, γ, ir) → (σ ′ , γ ′ , ir ′ ). This judgement reads as following. If the execution of S in the state (σ, γ, ir) ends then the execution reaches the state (σ ′ , γ ′ , ir ′ ). Inference rules in Figure 3 use that in Figure 2 to get the semantics of the other important construct of ImNet which is event transformers (et). Judgements of Figure 2 have the form et : γ → u meaning that the semantics of the transformer et in the variable state γ is u. The event transformer Lift(x, λt.f (t)) applies the map λt.f (t) to values of the event in x (Rule (Lifts )). The event transformer Filter(x, λ.f (t)) filters the event in x using the map λt.f (t) (Rule (Filters )). From a given set of actions A and two events x1 and x2 the event transformers MixFst(A, x1 , x2 ) and MixSnd(A, x1 , x2 ) create lists of rules (Rules (Mixs1 ) and (Mixs2 )). 3 Controller Programs This section presents two examples of programs constructed using the syntax of ImNet (Figure 1). The first example constructs rules based on information stored in the variable x and then installs the established rules to flow tables of switches stored in z. This program has the following statements. y = MakeRule(x); z = Lift(z, λt.(t, y)); AddRules(z); Register; The first statement of the program makes a rule for each value of the event stored in x. Then the second statement assigns these rules to switch IDs in the event stored in z. The third statement stores the rule assignment of z in ir as an initial rule assignment. The last statement of the program adds the established rules to the flow tables of switches. Figure 4 shows the operational semantics of this program using the semantics of the previous section. The second example constructs forwarding rules based on source IPs of arriving packets and then installs the established rules to flow tables of switch IDs stored in z. This program has the following statements. y = SourceIps; y = ApplyLft(y, λt.(t, port(t))); y = Lift(y, λt.(t, switch(t, z)); y = MakForwRule(y); AddRules(y); Register; vi : t γ(x) = (v1 , v2 , . . . , vn ) (Lifts ) Lift(x, λt.f (t)) : γ → (f (v1 ), f (v2 ), . . . , f (vn )) γ(x1 ) = (v1 , v2 , . . . , vn ) γ(x2 ) = (w1 , w2 , . . . , wn ) (Merges ) Merge(x1 , x2 ) : γ → ((v1 , w1 ), (v2 , w2 ), . . . , (vn , wn )) γ(x) = (v1 , v2 , . . . , vn ) A = {i | f (vi ) = true} (Filters ) Filter(x, λ.f (t)) : γ → (. . . , vi , . . . | i ∈ A) vi : t γ(x) = ((v1 , v1′ ), (v2 , v2′ ), . . . , (vn , vn′ )) ApplyLft(x, λt.f (t)) : γ → ((f (v1 ), v1′ ), (f (v2 ), v2′ ), . . . , (f (vn ), vn′ )) vi′ : t γ(x) = ((v1 , v1′ ), (v2 , v2′ ), . . . , (vn , vn′ )) ApplyRit(x, λt.f (t)) : γ → ((v1 , f (v1′ )), (v2 , f (v2′ )), . . . , (vn , f (vn′ ))) type(x) ∈ Types (Apps1 ) (Apps2 ) (Onces ) Once(x) : γ → (x, x, . . . , x) | {z } n times γ(x1 ) = (v11 , v21 , . . . , vn1 ) γ(x2 ) = (v12 , v22 , . . . , vn2 ) A1 = A ∪ {v11 } ∀i > 1.Ai = Ai−1 ∪ {vi1 } MixFst(A, x1 , x2 ) : γ → ((A1 , v12 ), (A2 , v22 ), . . . , (An , vn2 )) γ(x1 ) = (v11 , v21 , . . . , vn1 ) γ(x2 ) = (v12 , v22 , . . . , vn2 ) MixSnd(A, x1 , x2 ) : γ → A1 = A ∪ {v12 } ∀i > 1.Ai = Ai−1 ∪ {vi2 } ((v11 , A1 ), (v21 , A2 ), . . . , (vn1 , An )) (Mixs1 ) (Mixs2 ) γ(x) = ((v11 , a1 , v13 ), (v21 , a2 , v22 ), . . . , (vn1 , an , vn2 )) MakForwRule(x) : γ → [(v11 , (v13 , sendout(v12 ))), (v21 , (v23 , sendout(v22 ))), . . . , (vn1 , (vn3 , sendout(vn2 )))] γ(x) = ((v11 , a1 , v12 ), (v21 , a2 , v22 ), . . . , (vn1 , an , vn2 )) MakeRule(x) : γ → [(v11 , a1 (v21 )), (v12 , a2 (v22 )), . . . , (vni , an (v2n ))] (MFRs ) (MkRls ) Figure 2: Operational semantics for event functions of ImNet The first statement of the program assumes a function SourceIps that returns source IPs of arriving packets and stores them in the form of an event in y. The second statement transfers event of y into event of pairs of IPs and port numbers through which packets will be forwarded. The third statement augments values of event in y with switch IDs from the event stored in z. The fourth statement makes a forward rule for each value of the event stored in y. Then the fifth statement stores the rule assignment of y in ir as an initial rule assignment. The last statement of the program adds the established rules to the flow tables of switches. Figure 5 shows the operational semantics of this program using the semantics of the previous section. 4 Related and Future Work This section presents work most related to that presented in the current paper. One of the early attempts to develop software- defined networking (SDN) is NOX [9] based on ideas from [8] and 4D [7]. On the switch-level, NOX uses explicit and callbacks rules for packet-processing. Examples of applications that benefitted from NOX are load balancer [6] and the work in [4, 5]. Many directions for improving platforms of programming networks include Maestro [2] and Onix [3], which uses distribution and parallelization to provide better performance and scalability. A famous programming language for networks is Frenetic [24, 25] which has two main components. The first component is a collection of operators that are source-level. The operators aim at establishing and treating streams of network traffic. These operators also are built on concepts of functional programming (FP) and query languages of declarative database. Moreover the operators support a modular design, a cost control, a race-free semantics, a singletier programming, and a declarative design. The second component of Frenetic is a run-time system. This system facilitates all of the actions of adding and re- et : γ → u (Assgns ) x := et : (σ, γ, ir) → (σ, γ[x 7→ u], ir) S1 : (σ, γ, ir) → (σ ′′ , γ ′′ , ir ′′ ) S2 : (σ ′′ , γ ′′ , ir ′′ ) → (σ ′ , γ ′ , ir ′ ) ′ ′ ′ (seqs ) S1 ; S2 : (σ, γ, ir) → (σ , γ , ir ) γ(x) ∈ Intial-rule-assignment (Addrls ) AddRules(x) : (σ, γ, ir) → (σ, γ, ir ∪ γ(x)) (Regs ) Register : (σ, γ, ir) → (σ ∪ ir, γ, ∅) γ(x) = ((v11 , v12 , v13 ), (v21 , v22 , v23 ), . . . , (vn1 , vn2 , vn3 )) ∀i.(v2i , v3i ) ∈ history(v1i ) (Sends ) Send(x) : (σ, γ, ir) → (σ, γ, ir) Figure 3: Operational semantics statements of ImNet moving low-level rules to and from flow tables of switches. One advantage of ImNet, the language presented in this paper, over Frenetic is that ImNet is imperative. Therefore ImNet paves the way to the appearance of other types of network programming languages such as object-oriented network programming langues and context-oriented network programming languages. Other examples to program network components though high-level languages are NDLog and NetCore [1]. NetCore provides an integrated view of the whole network. NDLog is designed in an explicitly distributed fashion. As an extension of Datalog, NDLog [22, 23] was presented to determine and code protocols of routing [21], overlay networks, and concepts like hash tables of distributed systems. ImNet (presented in this paper), Frenetic, and NDLog can be classified as highlevel network programming languages. While NDLog main focus is overlay networks and routing protocols, Frenetic (in a functional way) and ImNet (in an imperative way) focus on implementing packet processing such as modifying header fields. Therefore ImNet equips a network programmer with a modular view of the network which is not provided by NDLog and Frenetic. This is supported by the fact that a program in NDLog is a single query that is calculated on each router of the network. The switch component [30] of networks can be programmed via many interfaces such as OpenFlow platform. Examples of other platforms include Shangri-La [31] and FPL-3E [32], RouteBricks [29], Click modular router [26], Snortran [27] and Bro [28]. The idea in Shangri-La [31] and FPL-3E [32] is to produce certain hardware for packet-processing from high-level programs that achieves packet-processing. In RouteBricks [29], stock machines are used to improve performance of program switches. As a modular approach, the platform of Click modular router [26], enables programming network components. This system focuses on software switches in the form of Linux kernel code. For the sake of intrusions detection and preserving network security, Snortran [27] and Bro [28] enable coding monitoring strategies and robust packet-filtering. One advantage of ImNet, the language presented in this paper, over all the related work is that ImNet overcomes the disadvantage of most similar languages of focusing on controlling a single device. There are many interning directions for future work. One such direction is develop methods for static analysis of network programming languages. Obviously associating these analyses with correctness proofs, in the spirit of [12, 13, 15, 14], will have many network applications. 5 Conclusion Software-Defined Networks (SDNs) is a recent architectures of networks in which a controller device programs other network devices (specially switches) via a sequence of installing and uninstalling rules to memories of these devices. In this paper, we presented a high-level imperative network programming language, called ImNet, to facilitate the job of controller through efficient, yet simple, programs. ImNet has the advantages of simplicity, expressivity, propositionally, and being imperative. The paper also introduced a concrete operational semantics to meanings of ImNet constructs. Detailed examples of using ImNet and the operational semantics were also illustrated in the paper. (∅, {z 7→ {id1 , id2 }, x 7→ {((srcport(80), sendall, ), (inport(1), sendcontroller, ))}, []) y = MakeRule(x); (∅, {z 7→ {id1 , id2 }, x 7→ {((srcport(80), sendall, ), (inport(1), sendcontroller, ))}, y 7→ {(srcport(80), [sendall]), (inport(1), [sendcontroller])}}, ∅) z = Lift(z, λt.(t, y)); (∅, {z 7→ {(id1 , γ(y)), (id2 , γ(y))}, x 7→ {((srcport(80), sendall, ), (inport(1), sendcontroller, ))}, y 7→ {(srcport(80), [sendall]), (inport(1), [sendcontroller])}}, ∅) AddRules(z); (∅, {z 7→ {(id1 , γ(y)), (id2 , γ(y))}, x 7→ {((srcport(80), sendall, ), (inport(1), sendcontroller, ))}, y 7→ {(srcport(80), [sendall]), (inport(1), [sendcontroller])}}, {(id1 , γ(y)), (id2 , γ(y))}) Register; ({(id1 , γ(y)), (id2 , γ(y))}, {z 7→ {(id1 , γ(y)), (id2 , γ(y))}, x 7→ {((srcport(80), sendall, ), (inport(1), sendcontroller, ))}, y 7→ {(srcport(80), [sendall]), (inport(1), [sendcontroller])}}, ∅) Figure 4: Example 1; an operational semantics of a program written in ImNet (∅, {z 7→ {id1 , id2 }}, []) y = SourceIps; (∅, {z 7→ {id1 , id2 }, y 7→ {(ip1 , pk1 ), (ip2 , pk2 )}}, ∅) y = ApplyLft(y, λt.(t, port(t))); (∅, {z 7→ {id1 , id2 }, y 7→ {(pr1 , pk1 ), (pr2 , pk2 )}}, ∅) y = Lift(y, λt.(t, switch(t, z)); (∅, {z 7→ {id1 , id2 }, y 7→ {(id1 , pr1 , pk1 ), (id2 , pr2 , pk2 )}}, ∅) y = MakForwRule(y); (∅, {z 7→ {id1 , id2 }, y 7→ {(id1 , (pk1 , sendout(pr1 )), (id2 , (pk2 , sendout(pr2 )))}}, ∅) AddRules(y); (∅, {z 7→ {id1 , id2 }, y 7→ {(id1 , (pk1 , sendout(pr1 )), (id2 , (pk2 , sendout(pr2 )))}}, {(id1 , (pk1 , sendout(pr1 )), (id2 , (pk2 , sendout(pr2 )))}) Register; ({(id1 , (pk1 , sendout(pr1 )), (id2 , (pk2 , sendout(pr2 )))}, {z 7→ {id1 , id2 }, y 7→ {(id1 , (pk1 , sendout(pr1 )), (id2 , (pk2 , sendout(pr2 )))}}, ∅) Figure 5: Example 2; an operational semantics of a program written in ImNet References: [1] B. Loo, J. Hellerstein, I. Stoica, and R. Ramakrishnan. Declarative routing: Extensible routing with declarative queries. SIGCOMM, 2005, pp.289-300. [2] Z. Cai, A. Cox, and T. Ng. Maestro. A system for scalable OpenFlow control. Technical Report TR10-08, Rice University, Dec 2010. [3] T. Koponen, M. Casado, N. Gude, J. Stribling, L. Poutievski, M. Zhu, R. Ramanathan, Y. Iwata, H. Inoue, T. Hama, and S. Shenker. Onix: A distributed control platform for large-scale production networks. OSDI, Oct 2010. [4] N. Handigol, S. Seetharaman, M. Flajslik, N. McKeown, and R. Johari. Plug-n-Serve. Loadbalancing web traffic using OpenFlow. Demo at ACM SIGCOMM, Aug 2009. [5] B. Heller, S. Seetharaman, P. Mahadevan, Y. Yiakoumis, P. Sharma, S. Banerjee, and N. McKeown. ElasticTree: Saving energy in data center networks. NSDI, Apr 2010. [6] R. Wang, D. Butnariu, and J. Rexford. OpenFlow-based server load balancing gone wild. Hot-ICE, Mar 2011. [7] A. Greenberg, G. Hjalmtysson, D. Maltz, A. Myers, J. Rexford, G. Xie, H. Yan, J. Zhan, and H. Zhang. A clean slate 4D approach to network control and management. SIGCOMM CCR 35, October 2005, pp.41-54. [8] M. Casado, M. Freedman, J. Pettit, J. Luo, N. Gude, N. McKeown, and S. Shenker. Rethinking enterprise network control. Trans. on Networking. 17(4), Aug 2009. [9] N. Gude, T. Koponen, J. Pettit, B. Pfaff, M. Casado, N. McKeown, and S. Shenker. NOX: Towards an operating system for networks. SIGCOMM CCR 38(3), 2008. [10] N. Foster, A. Guha, M. Reitblatt, A. Story, M. Freedman, N. Katta, C. Monsanto, J. Reich, J. Rexford, C. Schlesinger, D. Walker, R. Harrison. Languages for software-defined networks. IEEE Communications Magazine 51(2), 2013, pp. 128–134. [11] T. Bain, P. Campbell, J. Karlsson. Modeling growth and dynamics of neural networks via message passing in Erlang: neural models have a natural home in message passing functional programming languages. Erlang Workshop, 2011, pp. 94-97. [12] M. El-Zawawy. Flow sensitive-insensitive pointer analysis based memory safety for multithreaded programs. In: Murgante, B., Gervasi, O., Iglesias, A., Taniar, D., Apduhan, [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] B.O. (eds.) ICCSA, Part V. LNCS, vol. 6786, Springer, Heidelberg (2011), pp. 355-369. M. El-Zawawy. Probabilistic pointer analysis for multithreaded programs. ScienceAsia 37(4), 2011, pp. 344-354. M. El-Zawawy. Detection of Probabilistic Dangling References in Multi-core Programs Using Proof-Supported Tools. ICCSA 2013, pp. 516– 530. M. El-Zawawy. Frequent Statement and Dereference Elimination for Distributed Programs. ICCSA, 2013, pp. 82–97. T. Suzuki, K. Pinte, T. Cutsem, W. De Meuter, A. Yonezawa. Programming language support for routing in pervasive networks. PerCom Workshops, 2011, pp. 226–232. A. Elsts, L. Selavo. A user-centric approach to wireless sensor network programming languages. SESENA 2012, pp. 29–30. C. Monsanto, N. Foster, R. Harrison, D. Walker. A compiler and run-time system for network programming languages. POPL 2012, pp. 217– 230. S. Hong, Y. Joung. Meso: an object-oriented programming language for building stronglytyped internet-based network applications. SAC 2013, pp.1579–1586. J. Rexford. Programming languages for programmable networks. POPL 2012, pp. 215–216. H. Arneson, C. Langbort. A linear programming approach to routing control in networks of constrained linear positive systems. Automatica 48(5), 2012, pp. 800-807. B. Loo, T. Condie, J. Hellerstein, P. Maniatis, T. Roscoe, and I. Stoica. Implementing declarative overlays. SIGOPS 39(5), 2005, pp 75-90. B. Loo, J. Hellerstein, I. Stoica, and R. Ramakrishnan. Declarative routing: Extensible routing with declarative queries. SIGCOMM, 2005, pp. 289-300. N. Foster, R. Harrison, M. Meola, M. Freedman, J. Rexford, and D. Walker. Frenetic: A high-level langauge for OpenFlow networks. PRESTO, Nov 2010. N. Foster,R. Harrison, M. Freedman, C. Monsanto, J. Rexford, A. Story, and D. Walker. Frenetic: A Network Programming Language.the 16th ACM SIGPLAN international conference on Functional programming,2011 pp. 279–291. E. Kohler, R. Morris, B. Chen, J. Jannotti, and M. Kaashoek. The Click modular router. ACM Transactions on Computer Systems 18(3), Aug 2000, pp 263-297. [27] S. Egorov and G. Savchuk. SNORTRAN: An Optimizing Compiler for Snort Rules. Fidelis Security Systems, 2002. [28] V. Paxson. Bro: A system for detecting network intruders in realtime. Computer Networks 31(2324), Dec 1999, pp. 2435-2463. [29] M. Dobrescu, N. Egi, K. Argyraki, B. Chun, K. Fall, G. Iannaccone, A. Knies, M. Manesh, and S. Ratnasamy. RouteBricks: Exploiting parallelism to scale software routers. SOSP, Oct 2009. [30] N. McKeown, T. Anderson, H. Balakrishnan, G. Parulkar, L. Peterson, J. Rexford, S. Shenker, and J. Turner. Openflow: Enabling innovation in campus networks. SIGCOMM CCR 38(2), 2008, pp. 69-74. [31] M. Chen, X. Li, R. Lian, J. Lin, L. Liu, T. Liu, and R. Ju. Shangri-la: Achieving high performance from compiled network applications while enabling ease of programming. PLDI, Jun 2005, pp 224-236. [32] M. Cristea, C. Zissulescu, E. Deprettere, and H. Bos. FPL-3E: Towards language support for reconfigurable packet processing. SAMOS, Jul 2005, pp 201-212. [33] The Open Networking Foundation, Mar 2011. See http:// www.opennetworkingfoundation.org/
6cs.PL
1 Codon Context Optimization in Synthetic Gene Design Dimitris Papamichail, Hongmei Liu, Vitor Machado, Nathan Gould, J. Robert Coleman, Georgios Papamichail Abstract—Advances in de novo synthesis of DNA and computational gene design methods make possible the customization of genes by direct manipulation of features such as codon bias and mRNA secondary structure. Codon context is another feature significantly affecting mRNA translational efficiency, but existing methods and tools for evaluating and designing novel optimized protein coding sequences utilize untested heuristics and do not provide quantifiable guarantees on design quality. In this study we examine statistical properties of codon context measures in an effort to better understand the phenomenon. We analyze the computational complexity of codon context optimization and design exact and efficient heuristic gene recoding algorithms under reasonable constraint models. We also present a web-based tool for evaluating codon context bias in the appropriate context. Index Terms— Computational biology, Dynamic programming, Simulated annealing, Synthetic biology ——————————  —————————— 1 INTRODUCTION xpression of genes is crucial for cell activity; it is a major determinant of phenotype as derived from genotype, and inherently fundamental to modern biotechnology. Expression is the process by which information from a gene is used in the synthesis of a functional gene product, most often a protein. Several steps in the gene expression process may be modulated, including the transcription, RNA splicing, translation and posttranslational modification of a protein. We will concentrate on the process of translation, and the effect that synonymous mutations in a protein-coding gene confer to the expression of the corresponding protein, a method that has been traditionally employed to modify the posttranscriptional expression of genes [1]. Working towards the objectives of synthetic biology, precise protein expression control has direct implications in improving heterologous expression, and in successfully designing and finetuning gene regulatory networks. Recent years have seen significant advances toward the understanding and control of the rate of translation of genes [1], [3], [4], [5], [6]. Newfound knowledge led to the development of a number of algorithms and computational tools that aim to enable life scientists to create their own synthetic genes and constructs [7]. A first generation of design tools focused primarily on optimizing designs E ————————————————  D. Papamichail is with the Department of Computer Science, The College of New Jersey, 2000 Pennington Road, Ewing, NJ 08628-0718, USA. Email: [email protected].  H. Liu is with the Division of Biostatistics, Department of Public Health Science, Miller School of Medicine, University of Miami, Miami, FL 33136, USA.  V. Machado and N. Gould are with the Department of Computer Science, The College of New Jersey, 2000 Pennington Road, Ewing, NJ 08628-0718, USA.  J. R. Coleman is with the Department of Biology, Farmingdale State College (SUNY), Farmingdale, NY 11735-1021, USA.  G. Papamichail is with the department of Informatics, New York College, Amalias 38 Ave., Athens, 10558, Greece. for manufacturability (i.e. oligos without local secondary structures and end repeats) instead of biological activity. But soon the oligo design process was separated from the gene optimization process, and new tools emerged that address the two processes separately. Codon bias, a characteristic pattern of preference in the usage of synonymous codons in highly and lowly expressed genes, has been shown to be correlated to expression levels of a gene and is a dominant method in designing synthetic genes for translational efficiency [6]. Codon context bias has emerged as another critical feature affecting gene translation rates independently of codon bias [8], but is less well studied and understood than the latter, and current methods and tools used to optimize codon context of a gene rely on heuristics that provide no guarantees of optimality. In this study we examine statistical properties of codon context bias, in an effort to better understand the phenomenon and the measures used to quantify it. We also describe and analyze exact algorithms we designed for creating synthetic genes with optimized codon context, and evaluate the optimization potential of the simulated annealing heuristic as a method of choice toward efficient gene customization. Finally we make available a webbased utility to enable the characterization of a gene‘s codon pair bias, providing statistical information about its optimality. 2 BACKGROUND 2.1 Codon Bias In most species, synonymous codons are used at unequal frequencies. Codon usage bias is recognized as crucial in shaping gene expression and cellular function, affecting diverse processes from RNA processing to protein translation and protein folding. Rarely used codons have been associated with rare tRNAs and have been shown to inhibit protein translation, where favorable codons have 2 the opposite effect, something that is particularly pronounced in prokaryotic organisms [9]. The process of substituting rare codons with favorable ones is referred to as codon optimization. Controlling codon bias without considering other optimization objectives, in order to modulate translation rates, is computationally easy, since it involves only certain synonymous substitutions to reach a desired distribution. The quantification of the effect though is much more difficult. Experimentally, the use of particular codons through synonymous mutations has been shown in certain cases to increase the expression of transgenes (genes expressed in a heterologous host) by more than 1000-fold [10]. Several different statistical methods have been proposed and used to analyze codon usage bias. Methods such as the Frequency of optimal codons (Fop) [11], the Codon Adaptation Index (CAI) [12], and the tRNA adaptation index (tAI) [13] are used to quantify codon preferences towards over- or under-represented codons, and to predict gene expression levels. Alternative methods such as the Effective Number of codons (ENc) and Shannon entropy from information theory [14] are used to measure codon usage evenness. Relative Synonymous Codon Usage (RSCU) [15] and Synonymous Codon Usage Order (SCUO) [16] are additional measures from the latter category. Optimization of codon bias as a singular objective is algorithmically straightforward and can be performed in asymptotic linear time and space as a function of the sequence length, both in worst and average cases. This is true for maximization or minimization towards any given codon bias measure (such as CAI, RSCU, ENc, etc), as well as adoption/emulation of any given codon distribution, including the case when codon position assignments are performed randomly. 2.2 Codon Context Bias Gutman and Hatfield first noticed that codon pairs in prokaryotic genes exhibit another significant bias towards specific combinations [17]. Further studies [18] revealed that codon pair optimization influences translational elongation step times, but their functional significance was studied only in very small datasets. More recent work by [8], [19], and [20] who synthesized novel coding regions utilizing large scale codon pair optimization and de-optimization, coupled with de novo synthesis of the constructs and in-vivo experimentation, provided further evidence of the influence codon pair bias has on translational efficiency. Several mathematical methods have been proposed for the study of codon context bias, including [8], [21], [22], [23], [24], [25]. We are aware of at least three existing gene design tools that, as of date, provide functionality for controlling codon context [8], [26], [27]. Computational Complexity: Optimization of codon context as a singular objective has asymptotic linear time complexity in the worst case as a function of sequence length, as will be shown in subsection 4.1. Optimization of codon pair bias with a fixed codon distribution is considerably harder, although polynomially time solvable (section 4.2). This latter problem can be reduced to a vari- ation of the Travelling Salesperson Problem, which can be solved with a dynamic programming algorithm having O(n42) time and O(n41) space asymptotic complexity, where n is the length of the sequence being optimized. As a consequence, all currently available tools that attempt to codon context optimize synthetic genes, often in conjunction with other objectives, utilize metaheuristics such as simulated annealing or genetic algorithms. These heuristics do not guarantee an optimal solution, but limit the running time of the optimization procedure, while typically computing reasonable approximations. 2.3 Codon Context Optimization Software Several published gene design tools provide functionality for controlling codon context, albeit no two tools share the same measure of codon context bias. Eugene [26] is a standalone tool developed for multi-objective gene optimization. The program provides a graphical user interface and connects to databases such as GenBank to retrieve genomic sequences based on sequence identifiers. Among its numerous features, Eugene provides functionality to optimize mRNA codon context bias and codon autocorrelation. Eugene uses ‗percentages‘ to indicate improvement towards a target objective instead of scores, which makes it difficult for one to interpret and compare to score-based results. The software provides two optimization methods, simulated annealing and a genetic algorithm, the former being significantly more efficient. Codon Optimization OnLine (COOL) [27] is a web-based utility that can optimize for multiple objectives, including codon context bias. The optimization process uses a genetic algorithm to produce several approximately Paretooptimal solutions given a set of design criteria. Randomly generated sequences are evaluated, ranked, and mutated until a stability threshold is reached, at which point the fittest sequences based on the chosen properties are outputted and the algorithm terminates. Codon context optimization is based on matching a given host codon pair distribution and no cumulative score is available to quantify the end result. All current methods and tools have severe limitations, the most crucial being a lack of reference information about the optimization objectives and the optimality of the designs. Arbitrary scores are used to quantify codon and codon context bias, and it is hard to justify the use of one method over another. In the following sections we focus on codon context and study its statistical properties, as well as exact and approximate methods to evaluate the quality of an optimized design, which allow us to put codon context in the right context. 3 STATISTICAL PROPERTIES OF CODON CONTEXT BIAS The phenomenon of unequal usage of synonymous codons is observed in most protein-coding genes, and is called codon bias [28]. A widely used measure that quantifies how far the codon usage of a gene departs from equal usage of synonymous codons is the effective number ̂ . This measure of synonymous of codons used in a gene, 𝑁 3 codon usage bias is independent of the amino acid composition and the gene length [28]. 𝑁 [29] is calculated from the estimated homozygosity: ̂ = 1/𝐹̂ 𝑁 where the estimated homozygosity 𝐹̂ is: 3.1 Distribution of Codon Pair Bias First we will show that 𝐶𝑃𝑆 and 𝐶𝑃𝑆 pendent for different codon pairs AB and BC. 𝐹̂ = (𝑛 ∑ 𝑝 − 1)/(𝑛 − 1) and 𝑝 is the frequency of usage of the synonymous codons obtained by dividing the actual usage 𝑛 by total usage of the amino acid n (=𝑛 + ⋯ + 𝑛 ). ̂ values for each of the 20 amino acids can be The 𝑁 ̂ for added together to get an effective number of codons 𝑁 ̂ will vary from 20, the whole gene. Thus the value of 𝑁 when only one codon is used for each amino acid, to 61 when all codons are used equally for each amino acid. Codon Pair Bias (CPB) refers to the phenomenon where synonymous codon pairs are used more or less frequently than expected [17]. For example, the amino acid pair AlaGlu is expected to be encoded by GCCGAA and GCAGAG about equally frequently based on their codon frequencies. In fact, GCCGAA is used only one-seventh as frequently as GCAGAG in human genes ([8] supporting material). A measure of CPB was defined in [8] from the following formula of Codon Pair Score (CPS) as follows: 𝐶𝑃𝑆 = 𝑙𝑜𝑔 𝑂 𝐸 = 𝑙𝑜𝑔 𝐹(𝐴𝐵) 𝐹(𝐴) ∗ 𝐹(𝐵) ∗ 𝐹(𝑋𝑌) 𝐹(𝑋) ∗ 𝐹(𝑌) (1) where the codon pair AB encodes amino acid pair XY, F denotes frequency, O is the observed number of occurrences and E is the expected number of occurrences. CPS of a given codon pair indicates whether the pair is over-represented (+) or under-represented (-) in a given genome. Codon Pair Bias (CPB) for an entire gene sequence is the arithmetic mean of the codon pair scores of all pairs making up the entire gene sequence. 𝐶𝑃𝐵 = ∑ 𝐶𝑃𝑆 𝑛 analysis that follows we estimate the distribution of the CPB of human genes, based on which we calculate the pvalue of a protein being encoded by an mRNA with a specific CPB value. We also demonstrate that codon pair bias is independent from codon bias and amino acid bias. (2) where n+1 is length of the gene sequence measured in codons. Under the above definitions, the CPS scores for all 3721 possible codon pairs in human genes (excluding STOP codons) were calculated using the consensus CDS of the NCBI Reference Sequence Database, release date March 2nd 2005 ([8] supplementary material). CPB values for a main set of 14795 consistently annotated human genes were also calculated, and Figure 1B in [8] indicates a prevalent use of over-represent codon pairs in human genes. The mean codon pair bias for the 14795 annotated human genes is 0.07, which is also the peak of the distribution in that figure. We examined statistical properties of Codon Pair Scores such as population mean and variance in the consistently annotated human protein coding gene set. In the 𝑃(𝐵|𝐴) = are inde- 𝑃(𝐴𝐵) 𝐹(𝐴𝐵)/𝐹(𝑋𝑌) = 𝑃(𝐴) 𝐹(𝐴)/𝐹(𝑋) 𝑃(𝐵) = 𝐹(𝐵)/𝐹(𝑌) 𝐶𝑃𝑆 = 𝑙𝑜𝑔 𝐹(𝐴𝐵) 𝑃(𝐵|𝐴) = log[ ] 𝐹(𝐴) ∗ 𝐹(𝐵) 𝑃(𝐵) ∗ 𝐹(𝑋𝑌) 𝐹(𝑋) ∗ 𝐹(𝑌) Similarly, 𝑃(𝐶|𝐵) = 𝑃(𝐵𝐶) 𝐹(𝐵𝐶)/𝐹(𝑌𝑍) = 𝑃(𝐵) 𝐹(𝐵)/𝐹(𝑌) 𝑃(𝐶) = 𝐹(𝐶)/𝐹(𝑍) 𝐶𝑃𝑆 = 𝑙𝑜𝑔 𝐹(𝐵𝐶) 𝑃(𝐶|𝐵) = log[ ] 𝐹(𝐵) ∗ 𝐹(𝐶) 𝑃(𝐶) ∗ 𝐹(𝑌𝑍) 𝐹(𝑌) ∗ 𝐹(𝑍) Since 𝑃(𝐵|𝐴) and 𝑃(𝐶|𝐵) are independent and P(B) and P(C) are approximately independent, 𝐶𝑃𝑆 and 𝐶𝑃𝑆 are independent. Because 𝐶𝑃𝑆 , i=1,2,…,n, are mutually independent each with the same distribution (though unknown), by the Central Limit Theorem, 𝐶𝑃𝐵 = ∑ 𝐶𝑃𝑆 𝑛 is approximately normally distributed for large n with mean E(CPS) and variance Var(CPS)/n, where n+1 is the length of the gene sequence measured in codons. By the definition of population mean and variance, E(CPS) is the weighted arithmetic mean of 3721 possible codon pairs (excluding the STOP codon) in the human ORFeome: E(CPS) = ∑ [𝐶𝑃𝑆 × 𝑁 𝑁 ] And Var(CPS) is calculated from Var(𝐶𝑃𝑆) = ∑ [(𝐶𝑃𝑆 − E(𝐶𝑃𝑆)) × 𝑁 𝑁 ] Based on the data found in the supplementary material of [8], E(CPS) in human genes is equal to 0.075 and Var(CPS) is 0.132. Thus 𝐶𝑃𝐵 is normally distributed with mean 0.075 and variance 0.132/n, results which match Figure 1B in [8] of CPBs calculated for a core set of 14795 consistently annotated human genes using the formulas of CPS and CPB. The p-value of a protein being encoded by an mRNA with a specific codon pair bias c can be calculated as the two tail cumulative probability of the 𝐶𝑃𝐵 : 4 𝑝 = 𝑃(𝐶𝑃𝐵 ≤ 𝑐 𝑜𝑟 𝐶𝑃𝐵 ≥ 0.15 − 𝑐) 1 (𝑥 − 0.075) = 2∫ exp(− )𝑑𝑥 2 ∗ 0.132/𝑛 √2𝜋0.132/𝑛 Let 0.05 be the probability threshold of significance, 𝐶𝑃𝑆 = 𝑙𝑜𝑔 𝑂 . 𝐸 Here we selected a log base to 1.5 such that the variance of CPS is larger. 𝐶𝑃𝐵 can then vary in a larger range, reducing the effect of small numerical and rounding errors in resulting values. 10 20 30 40 50 3.2.2 Discounting codon bias Expected occurrences of a given codon pair AB, 𝐸 , are calculated under the assumption that codons A and B are independent. If A and B are not independent, the ratio of 𝑂 vs 𝐸 will be much larger or smaller than 1, which indicates a nonrandom utilization of codon pairs. Since the nonrandom usage of codons is not related to the independence of A and B, it cannot effect codon pair scores, thus does not contribute to the codon pair bias under the definition in this context. 0 dnorm(x, 0.075, 0.363/50) Thus the normalized CPS of codon pair AB is -0.10 -0.05 0.00 0.05 0.10 0.15 0.20 x Figure 1: CPB distribution of genes with length n = 49, 100, 225, 400, 900, 1600, 2500 (based on human ORFeome). where 𝑝 ≤ 0.05 implies that the probability of an n+1 length protein being encoded by an mRNA with a codon pair bias c is rare. Then the 95% significant interval for 𝐶𝑃𝐵 is (0.075-1.96*0.363/√𝑛, 0.075+1.96*0.363/√𝑛). Reference examples: For n=100, 95% significant interval for 𝐶𝑃𝐵 is (0.004, 0.146). For n=400, 95% significant interval for 𝐶𝑃𝐵 is (0.039, 0.111). For n=1600, 95% significant interval for 𝐶𝑃𝐵 is (0.057, 0.093). 3.2 Independence of codon context bias from amino acid and codon bias 3.2.1 Discounting Amino acid pair bias For randomly occurring amino acid pairs in a protein, the sum of the expected numbers of codon pairs encoding the same amino acid pair (400 amino acid pairs in total) should be equal to the sum of the observed numbers (1989, Gutman and Hatfield), i.e. ∑𝐸 ∑𝑂 where kl is any codon pair encoding the same amino acid pair XY. For each group of codon pairs encoding the same amino acid pair XY, the expected values can be normalized when multiplied by a normalizing coefficient. This way, the sum of the expected values is the same as that of the observed values in each group. 𝐸 = ∑ 𝑂 𝐸 ∑ 𝐸 4 ALGORITHMS FOR CODON CONTEXT OPTIMIZATION In this section we will examine the problem of designing an mRNA encoding of a given protein that optimizes codon context bias. Optimization can occur either towards maximization or minimization of a given measure that quantifies codon context bias, such as codon pair bias as defined by Coleman et al. [8], codon context bias as defined by Moura et al. [25], the normalized offset value as defined by Boycheva et al. [22], and any other codon context bias measure that bounds the span (in nucleotides) of the context of a codon by a constant. In all subsequent discussion we will only consider the problem of bias maximization, where minimization can be achieved in the same exact manner. We will concentrate on Codon Pair Score (CPS) and Codon Pair Bias (CPB), as defined in Equations (1) and (2) respectively, as the measures of choice to quantify codon context bias, because of the supporting experimental evidence for their validity [8], [19], [20], [30] ,[31] and our familiarity with their computation. 4.1 Algorithm1: Codon pair bias optimization without codon restrictions We have designed and implemented an algorithm to compute the maximum and minimum CPB of a proteincoding gene in polynomial time using dynamic programming. Given a protein coding gene G of length n, whose amino acid composition is A1A2A3…An, we can calculate the mRNA sequence with the maximum (similar for minimum) CPB encoding the protein as follows: Algorithm1 1. Starting with amino acid A1, process each amino acid Ai, 1 ≤ i ≤ n, in order, keeping track of the highest CPB of the mRNA prefix ending at each codon Ci,k, 1 ≤ k ≤ mi, where mi is the number of synonymous codons encoding amino acid Ai. Let CPBi,k be that highest score of any mRNA prefix ending with codon Ci,k at position i. In addition, for each codon Ci,k, keep track of the par- 5 ent codon (encoding amino acid Ai-1) that led to the Figure 2: Dynamic programming algorithm for codon context optimization highest CPB prefix score ending at that codon. 2. At each step of the algorithm, when proceeding from amino acid Ai to Ai+1, form all possible codon pairs encoding the amino acid pair AiAi+1. Compute the maximum CPB of all mRNA prefixes ending at each codon Ci+1,l, 1 ≤ l ≤ mi+1, as max(CPBi,k + CPS(Ci,k, Ci+1,l)), for 1 ≤ k ≤ mi, then store that value at codon Ci+1,l, together with the appropriate parent codon. Here the notation CPS(A, B) is used instead of CPSAB for clarity. 3. When all amino acids are processed, select the codon with the highest CPB score among all synonymous codons of An. That value is the highest CPB of any mRNA encoding of gene G. The mRNA encoding with the highest CPB can be generated by following parent pointers toward the start of the amino acid chain and concatenating the appropriate codons. An outline of the data structure used by Algorithm1 can be observed in Figure 2. Theorem 1. Algorithm1 computes the optimal CPB of a protein coding gene in O(n) worst case time and space complexity, where n is the length of amino acid sequence of the gene. Proof. For algorithm correctness it is sufficient to prove proposition P1(n) = ―Algorithm1 identifies the mRNA with the highest CPB translating into a given protein A1A2…An, for integer n ≥ 2.‖ Proposition P1(n) follows from a strengthened proposition P2(n) which is easier to prove using induction: P2(n) = ―Algorithm1 identifies the mRNA with the highest CPB translating into a given protein A1A2…An, n ≥ 2, and ending at codon Cn,k, 1 ≤ k ≤ mn‖, where mn is the number of synonymous codons translating to amino acid An. Base Case: After the first step of the algorithm, the codon pair with the highest CPS encoding A1A2 and ending at codon C2,k, 1 ≤ k ≤ m2 can be formed following the parent pointer to concatenate the two codons. The codon pair formed will have the highest CPB among all synonymous ones, since only the highest CPB value is stored at each codon at position 2. Therefore P2(2) is true. Inductive Step: Assuming that proposition P2(q) is true for an arbitrary but fixed integer q such that 2 ≤ q ≤ n-1, we will show that P2(q+1) is true. We claim that on its q-th step Algorithm1 will compute and store at codon Cq+1,k the highest CPB score of any mRNA encoding of the prefix of the protein ending at position q+1 and having Cq+1,k as its last codon. This is true since all possible codon pairs Cq,lCq+1,k are considered, for 1 ≤ l ≤ mq, and are concatenated with the optimal mRNA encodings ending at codons Cq,l, according to our inductive hypothesis. As such, selecting the mRNA sequence ending at codon Cq+1,k with the highest CPB score among these, and storing that score and the appropriate parent pointer at codon Cq+1,k, allows the identification of the mRNA sequence with the optimal CPB ending at codon Cq+1,k. Therefore P2(n) is true for all integers n ≥ 2, from which it follows that P1(n) is also true for all n ≥ 2. The linear time and space complexities of Algorithm1 follow from the linear number of steps that the algorithm takes, at each of which a constant number of codon pairs is processed (at most 36, since the maximum number of synonymous codons for any amino acid is 6) and a constant amount of information is stored, namely the CPB values for each prefix ending at a given synonymous codon, and the parent pointers, both quantities bounded by the constant 6.  4.2 Algorithm2: Polynomial CPB Optimization with Fixed Codon Distribution Due to the significant effect of codon bias in mRNA translation rates, it is important to control codon bias while recoding an amino acid sequence by optimizing its codon pair bias. For that reason we concentrate on optimizing CPB while assigning a fixed codon distribution to our mRNA sequence, which remains unchanged during our CPB optimization procedure. The problem of maximizing the presence of over- or under-represented codon pairs in an mRNA sequence, while keeping the amino acid sequence and codon frequency distributions intact, can be reduced to a variant of the TSP (Travelling Salesperson Problem). This particular variant, which can be thought as computing the shortest route to travel a series of countries (amino acids) in a prespecified sequence, and selecting the city (codon) we visit in each country from a given fixed distribution of cities, is polynomially solvable using dynamic programming with a time complexity of O(n42), where n is the number of codons in the examined mRNA sequence. We will now describe another algorithm, Algorithm2, which polynomially solves the aforementioned problem. The algorithm is similar to Algorithm1 for CPB optimization without codon restrictions. In this particular case though we have to keep track not only of the optimal CPB of mRNA prefixes ending at synonymous codons at each amino acid position, but also of all allocated codons in the prefixes, as future codon choices may be limited based on the selections made so far. We use dynamic programming to reduce the exponential number of codon permutations, utilizing the fact that knowledge of specific codon assignments at each position is not necessary, as only the 6 total number of codons of each type that have been already allocated restrict further selections. So it is sufficient to keep track of codon frequencies and the optimal CPB for every prefix ending at a specific codon having used a specific codon distribution. Since any codon may be placed in the mRNA of the protein a maximum of n times, and we have 61 non-terminating codons, at each amino acid position we have to keep track of a maximum of 6×n61 values. The algorithm executes for a total of n steps, resulting in a worst-case time complexity of O(n62), with worst-case space utilization of O(n61). The time complexity of the algorithm can be reduced to O(n42) by considering the synonymous codon degrees of freedom. For every amino acid encoded by k synonymous codons we only need to keep track of the frequencies of k-1 of its codons, since the frequency of the last codon can be derived from the rest. The improved time bound is therefore a result of the 41 degrees of freedom of codons. Similarly, the space required by this algorithm is O(n41). Even so, this algorithm, despite being polynomial, is not practical except for the smallest of protein coding genes. The correctness of this algorithm can be argued in a similar manner with the proof of Theorem 1. 4.3 Algorithm3: Branch and Bound CPB Optimization with Fixed Codon Distribution To study the effectiveness of heuristics in optimizing CPB of synthetic genes with fixed codon distributions, we need a reference algorithm that produces the optimal encodings against which to compare approximate solutions. We designed a branch and bound algorithm to calculate the maximum (and minimum) CPB of a given gene with a given codon distribution which examines all possible mRNA encodings of the gene with fixed codon frequencies. The algorithm simply enumerates all possible encodings, by assigning to each amino acid (in order) any corresponding codon from the pool of available codons. It performs a depth first search on the space of codon assignments at each position of the amino acid chain, where the explored tree has a height of n and each internal node has a maximum of 6 children. This process is depicted in Figure 3. To eliminate branches leading to provably sub-optimal solutions, we compare the best gene CPB result thus far with the potential of the current prefix CPB when added to the optimal CPB of the suffix of the mRNA, as determined by Algorithm1 which considers any possible codon assignments. Under CPB maximization, the initial bound can be an arbitrarily negative number or a previously computed sub-optimal design with a method such as simulated annealing (described in section 4.4). We pre-compute the optimal CPB of all suffixes of our mRNA by running the dynamic programming Algorithm1 starting at the end of the amino acid chain, and storing all intermediate results in an array. This provides constant lookup time for the optimal CPB under any codon distribution of any suffix of the given gene. The worst-case asymptotic time complexity of Algorithm3 is exponential as a function of protein length, which remains exponen- Figure 3: Branch and bound CPB optimization algorithm with fixed codon distribution tial in practice, as demonstrated in section 5. The worstcase space complexity is linear owing to the depth first search process and constant amount of information stored at each step of the algorithm, in addition to the linear-size precomputed suffix CPB upper bound scores. 4.4 Algorithm4: Simulated Annealing for CPB Optimization with Fixed Codon Distribution Simulated annealing [32] is a fast-converging metaheuristic well suited for TSP-like problems [33], [34]. It is particularly useful for problems such as synthetic gene design, since it can be effectively applied to optimize an mRNA sequence for multiple objectives in addition to codon pair bias, such as restriction site inclusion/elimination, and RNA folding energy manipulation. We have used single-objective simulated annealing extensively in the past to design the synthetic viral and bacterial genes that were featured in [8], [19], and [20], and have experimented with (conflicting) multi-objective simulated annealing in optimizing polio virus capsid protein encodings for codon pair utilization and CpG content (unpublished data), where the codon pair bias effect on translation was determined to be independent from the CpG content of coding sequences, at least for the RNA encoding of the capsid protein of Polio virus. Our simulated annealing procedure works as follows: Algorithm4 1. We initially create a random assignment of the codons in their respective amino acid allowed positions. If a new codon distribution is defined, first we assign codons to each amino acid according to the new distribution and then create the random assignment. 2. We calculate the codon pair bias of the coding sequence from the initial assignment. 3. We randomly select an amino acid and then randomly consider two locations where this amino acid is encoded in our coding sequence. If the codons at these positions are different, we calculate the sum of scores 7 of the four newly formed codon pairs as if these codons were exchanged, and compare it to the sum of the original four pairs. If there is an improvement to the overall score, we exchange the two codons. If not, we calculate the simulated annealing optimization function and decide whether to exchange the two codons based on its value. This way, even non-beneficial exchanges have a well-defined probability of being performed, with this probability varying throughout the execution based on the simulated annealing parameters and algorithm progress. 4. We repeat the previous step until we have reached the maximum number of allowed steps, which is specified at the execution of the algorithm. 5 EXPERIMENTAL RESULTS One of the goals of our study is to determine whether the simulated annealing heuristic produces CPB designs that are sufficiently close to optimal, as to reduce the need to run computationally expensive algorithms for further optimization. Toward that goal we implemented two algorithms to maximize CPB of protein coding genes and compare their results, Algorithm3, and Algorithm4, the former producing the maximal CPB design, and the latter an approximation. We also implemented Algorithm1 to aid the branch and bound algorithm in generating the necessary upper bounds on mRNA suffixes‘ CPB scores. We run all algorithmic experiments on a laptop equipped with a Haswell (22nm) i7-4900mq processor running at 2.8GHz, 32GB of memory and an SSD hard drive. All algorithms run on a single processor core. We produced maximal and near-maximal CPB designs for prefixes of the Aequorea victoria Green Fluorescent Protein (GFP), GenBank accession number M62653.1, that ranged in size from 10 to 70 amino acids. The upper size limit was set by computational time constraints of Algorithm3, which grows exponentially as a function of the amino acid sequence length. Algorithm4, which utilizes simulated annealing, was run for 500,000 iterations in each computational experiment, independent of protein size. The algorithm was run 5 times for each input protein prefix, and the best result was collected, although the results for each input length were always the same and optimal. The running time of Algorithm4 is dependent primarily on the number of iterations, and for all experiments presented herein ranged between 3.7 and 4.6 seconds. The CPB outcomes of the two algorithms and actual running time of Algorithm3 are shown in Table 1. TABLE 1 CPB OPTIMIZATION ALGORITHM RESULTS Sequence length (AAs) Algorithm3 running time (seconds) Maximal CPB (Algorithms 3 & 4) 10 0.086 0.294582188343425 20 0.065 0.298431996808867 30 0. 100 0.298816298402260 40 0. 790 0.268955938539740 50 9. 501 0.246521370447020 60 734.195 0.242171188081159 70 327337.980 0.233378389895599 The simulated annealing procedure (Algorithm4), whose parameters have been customized experimentally in the past to produce optimized designs of the Poliovirus P1 capsid protein [8] and numerous other genes from a variety of organisms, manages to match the optimal score of Algorithm3 for all GFP prefixes tested, up to 70 amino acids long. Although it is expected that differences will emerge as protein size increases, it is reassuring that, despite the already sizable solution space explored by the tested cases, simulated annealing identifies the optimal solution. Our belief that simulated annealing is a great choice for CPB optimization is corroborated by p-values of CPB scores for optimized mRNA encodings of larger proteins, which are consistently placed a large number of standard deviations from the respective mean. Figure 4: Codon Context tool (CCtool) input screen 6 CODON CONTEXT EVALUATION TOOL We have created a web-based tool that can compute the CPB of a given gene and graphically place the score in a range of values determined by the minimum and maximum CPB of the gene when approximated by simulated annealing. We also randomized codon assignments to corresponding amino acids and generated 100 alternate designs coding for the same protein, having the exact same codon distribution, to approximate the mean and variance of the CBP of that gene. An example of the input and output screen of our tool are shown in Figures 4 and 5 respectively. The tool is still under development and can be accessed online at http://algo.tcnj.edu/cctool. 6 CONCLUSION Codon context bias optimization significantly affects mRNA translation rates and is currently employed in several tools that design and evaluate synthetic protein 8 coding genes. Due to the computational complexity of [6] [7] [8] [9] [10] Figure 5: CCtool output page. optimizing codon context, current methods utilize heuristics that provide little to no information on solution optimality. In addition, no two methods employ the same measure of codon context, and results are not comparable. We performed a statistical analysis to better understand codon pair bias, the only experimentally validated codon context measure, and determined its independence from amino acid and codon biases. We also designed exact algorithms to optimize mRNA sequences for codon pair bias under different constraints, and run experiments to determine the performance of simulated annealing for codon context optimization. Finally we developed a webbased utility to enable synthetic gene designers to evaluate their own constructs and put codon context in the right context. [11] [12] [13] [14] [15] ACKNOWLEDGMENT This work has been supported by NSF Grant CCF1418874 and the MUSE program at The College of New Jersey. D. Papamichail is the corresponding author and can be reached at [email protected]. [16] [17] REFERENCES [1] [2] [3] [4] [5] M. Welch, A. Villalobos, C. Gustafsson, and J. Minshull, ―Designing genes for successful protein expression,‖ Methods Enzym., vol. 498, pp. 43–66. M. J. Czar, J. C. Anderson, J. S. Bader, and J. Peccoud, ―Gene synthesis demystified,‖ Trends Biotechnol, vol. 27, no. 2, pp. 63– 72, 2009. J. B. Plotkin, H. Robins, and A. J. Levine, ―Tissue-specific codon usage and the expression of human genes,‖ Proc Natl Acad Sci U S A, vol. 101, no. 34, pp. 12588–12591, 2004. G. Kudla, A. W. Murray, D. Tollervey, and J. B. Plotkin, ―Coding-sequence determinants of gene expression in Escherichia coli,‖ Science (80-. )., vol. 324, no. 5924, pp. 255–258, 2009. H. M. Salis, E. A. Mirsky, and C. A. Voigt, ―Automated design of synthetic ribosome binding sites to control protein expression.,‖ Nat. Biotechnol., vol. 27, pp. 946–950, 2009. [18] [19] [20] [21] M. Welch, S. Govindarajan, J. E. Ness, A. Villalobos, A. Gurney, J. Minshull, and C. Gustafsson, ―Design parameters to control synthetic gene expression in Escherichia coli,‖ PLoS One, vol. 4, no. 9, p. e7002, 2009. N. Gould, O. Hendy, and D. Papamichail, ―Computational Tools and Algorithms for Designing Customized Synthetic Genes ,‖ Frontiers in Bioengineering and Biotechnology , vol. 2 . 2014. J. R. Coleman, D. Papamichail, S. Skiena, B. Futcher, E. Wimmer, and S. Mueller, ―Virus attenuation by genome-scale changes in codon pair bias,‖ Science (80-. )., vol. 320, no. 5884, pp. 1784–1787, 2008. G. Lithwick and H. Margalit, ―Hierarchy of sequencedependent features associated with prokaryotic translation,‖ Genome Res, vol. 13, no. 12, pp. 2665–2673, 2003. C. Gustafsson, S. Govindarajan, and J. Minshull, ―Codon bias and heterologous protein expression,‖ Trends Biotechnol, vol. 22, no. 7, pp. 346–353, 2004. T. Ikemura, ―Correlation between the abundance of Escherichia coli transfer {RNAs} and the occurrence of the respective codons in its protein genes: A proposal for a synonymous codon choice that is optimal for the E. coli translational system,‖ J. Mol. Biol., vol. 151, no. 3, pp. 389–409, 1981. P. M. Sharp and W. H. Li, ―The codon Adaptation Index--a measure of directional synonymous codon usage bias, and its potential applications,‖ Nucleic Acids Res, vol. 15, no. 3, pp. 1281–1295, 1987. M. dos Reis, R. Savva, and L. Wernisch, ―Solving the riddle of codon usage preferences: A test for translational selection,‖ Nucleic Acids Res., vol. 32, pp. 5036–5044, 2004. H. Suzuki, R. Saito, and M. Tomita, ―The ‗weighted sum of relative entropy‘: A new index for synonymous codon usage bias,‖ Gene, vol. 335, pp. 19–23, 2004. P. M. Sharp, T. M. Tuohy, and K. R. Mosurski, ―Codon usage in yeast: cluster analysis clearly differentiates highly and lowly expressed genes.,‖ Nucleic Acids Res., vol. 14, no. 13, pp. 5125– 5143, Jul. 1986. X. F. Wan, D. Xu, A. Kleinhofs, and J. Z. Zhou, ―Quantitative relationship between synonymous codon usage bias and GC composition across unicellular genomes,‖ Bmc Evol. Biol., vol. 4, 2004. G. A. Gutman and G. W. Hatfield, ―Nonrandom utilization of codon pairs in Escherichia coli,‖ Proc Natl Acad Sci U S A, vol. 86, no. 10, pp. 3699–3703, 1989. B. Irwin, J. D. Heck, and G. W. Hatfield, ―Codon pair utilization biases influence translational elongation step times,‖ J Biol Chem, vol. 270, no. 39, pp. 22801–22806, 1995. S. Mueller, J. R. Coleman, D. Papamichail, C. B. Ward, A. Nimnual, B. Futcher, S. Skiena, and E. Wimmer, ―Live attenuated influenza virus vaccines by computer-aided rational design,‖ Nat Biotechnol, vol. 28, no. 7, pp. 723–726, 2010. J. R. Coleman, D. Papamichail, M. Yano, M. Garcia-Suarez Mdel, and L. A. Pirofski, ―Designed reduction of Streptococcus pneumoniae pathogenicity via synthetic changes in virulence factor codon-pair bias,‖ J Infect Dis, vol. 203, no. 9, pp. 1264– 1273, 2011. A. Fedorov, S. Saxonov, and W. Gilbert, ―Regularities of context-dependent codon bias in eukaryotic genes.,‖ Nucleic Acids Res., vol. 30, pp. 1192–1197, 2002. 9 [22] S. Boycheva, G. Chkodrov, and I. Ivanov, ―Codon pairs in the genome of Escherichia coli,‖ Bioinformatics, vol. 19, pp. 987–998, 2003. [23] A. A. Shah, M. C. Giddings, J. B. Parvaz, R. F. Gesteland, J. F. Atkins, and I. P. Ivanov, ―Computational identification of putative programmed translational frameshift sites.,‖ Bioinformatics, vol. 18, pp. 1046–1053, 2002. [24] S. D. Hooper and O. G. Berg, ―Detection of genes with atypical nucleotide sequence in microbial genomes.,‖ J. Mol. Evol., vol. 54, pp. 365–375, 2002. [25] G. Moura, M. Pinheiro, R. Silva, I. Miranda, V. Afreixo, G. Dias, A. Freitas, J. L. Oliveira, and M. A. S. Santos, ―Comparative context analysis of codon pairs on an ORFeome scale.,‖ Genome Biol., vol. 6, p. R28, 2005. [26] P. Gaspar, J. L. Oliveira, J. Frommlet, M. A. S. Santos, and G. Moura, ―EuGene: Maximizing synthetic gene design for heterologous expression,‖ Bioinformatics, vol. 28, pp. 2683–2684, 2012. [27] J. X. Chin, B. K.-S. Chung, and D.-Y. Lee, ―Codon Optimization On-Line (COOL): a web-based multi-objective optimization platform for synthetic gene design.,‖ Bioinformatics, p. btu192, 2014. [28] F. Wright, ―The &apos;effective number of codons&apos; used in a gene,‖ Gene, vol. 87, no. 1, pp. 23–29, 1990. [29] M. Kimura and J. F. Crow, ―THE NUMBER OF ALLELES THAT CAN BE MAINTAINED IN A FINITE POPULATION,‖ Genet. , vol. 49 , no. 4 , pp. 725–738, Apr. 1964. [30] N. Marr, T.-I. Wang, S. H. Y. Kam, Y. S. Hu, A. a Sharma, A. Lam, J. Markowski, A. Solimano, P. M. Lavoie, and S. E. Turvey, ―Attenuation of respiratory syncytial virus-induced and RIG-I-dependent type I IFN responses in human neonates and very young children.,‖ J. Immunol., vol. 192, no. 3, pp. 948– 57, 2014. [31] L. Gao, L. Wang, C. Huang, L. Yang, X.-K. Guo, Z. Yu, Y. Liu, P. Yang, and W. Feng, ―HP-PRRSV is attenuated by deoptimization of codon pair bias in its RNA-dependent RNA polymerase nsp9 gene,‖ Virology, vol. 485, pp. 135–144, Nov. 2015. [32] S. Kirkpatrick, C. D. Gelatt, and M. P. Vecchi, ―Optimization by simulated annealing.,‖ Science, vol. 220, no. 4598, pp. 671–680, 1983. [33] D. Bertsimas and J. Tsitsiklis, ―Simulated Annealing,‖ Statistical Science, vol. 8, no. 1. pp. 10–15, 1993. [34] D. Johnson, ―Local optimization and the Traveling Salesman Problem,‖ in Automata, Languages and Programming SE - 34, vol. 443, M. Paterson, Ed. Springer Berlin Heidelberg, 1990, pp. 446– 461.
5cs.CE
A Heuristic Method to Generate Better Initial Population for Evolutionary Methods E. Khaji(a), A. S. Mohammadi(b) a,b Graduate Students, Complex Adaptive Systems Group, School of Applied Physics, University of Gothenburg, Sweden. Abstract Initial population plays an important role in heuristic algorithms such as GA as it help to decrease the time those algorithms need to achieve an acceptable result. Furthermore, it may influence the quality of the final answer given by evolutionary algorithms. In this paper, we shall introduce a heuristic method to generate a target based initial population which possess two mentioned characteristics. The efficiency of the proposed method has been shown by presenting the results of our tests on the benchmarks. Introduction Evolutionary algorithms (EAs) have been introduced to solve nonlinear complex optimization problems [1],[2] and [3]. Some well-established and commonly used EAs are Genetic Algorithms (GA) [4] , Particle Swarms Optimization [5] and Differential Evolution (DE) [6] and [5]. Each of these method has its own characteristics, strengths and weaknesses; but long computational time is a common drawback for all population-based schemes, specially when the solution space is hard to explore [hamin maghala di]. Many efforts have been already done to accelerate convergence of these methods. Most of these works are focused on introducing or improving crossover and mutation operators, selection mechanisms, and adaptive controlling of parameter settings.[hamin maghala di] Although, population initialization can affect the convergence speed and also the quality of the final solution, there is only a little reported research in this field. Maaranen et al. introduced quasi-random population initialization for genetic algorithms [7]. The presented results showed that their proposed initialization method can improve the quality of final solutions with no noteworthy improvement for convergence speed. On the other hand, generation of quasi-random sequences is more difficult and their advantage vanishes for higher dimensional problems (theoretically for dimensions larger than 12) [8]. Also, Rahmanian et al [Hmian maghala di] presented a novel scheme for population initialization by applying opposition-based learning [9] to make EAs faster. This paper presents a heuristic method based on the combination of classical and evolutionary methods. We have suggested that solving some simplified equations of a complex function in addition to some random individuals can make a novel initial population which converges to an acceptable answer faster. Organization of the rest of the paper is as follows: in Section 2, the concept of opposition-based learning is briefly explained. The classical DE is briefly reviewed in Section 3. The proposed algorithm is presented in Section 4. Experimental results are given in Section 5. The results are 1 analysed in Section 6. Finally, the work is concluded in Section 7. All benchmark functions are listed in Appendix. Proposed Method Let X* be a local minimum on n-dimensional function of . If so that for every point such , the region , where is a dimensional sphere with the radius of and as its center, is called a CAVITY. Every function such f can be secreted into a union of cavities which may to be empty while each cavity involves one and only one local minimum. In order to have an appropriate initial population, generating at least one point in each cavity is clearly fruitful. Although there is no guarantee to generate an initial population which possess such characteristic, our method aims to introduce a heuristic approach to generate initial population which can cover too many cavities. The Main Proposed Method: Suppose as an n-dimensional continuous function on Rn. The initial population for approaching this function is the solution of the following equation: (1) Theoretically, the intersections are dimensional functions for . The task is just to find a point in each dimensions. As the task seems too challenging in application since solving the so called equation is not possible all the time, we are suggesting several tricks to tackle the mentioned difficulty. 1. Function Separation: if the function can be separated as follows: then the calculated points from the following equations may have the same quality as the solutions of (1): 2. Dimension Separation: if the function f can be separated as follows: , then the calculated points from the following equations may have the same quality as the solutions of (1): 2 … Experimental Results In order to compare convergence speed of the suggested method with random population initialization (DEr) some test set with 6 numerical benchmark functions is employed. All selected functions are well-known in the global optimization literature [10,13,15]. The test set includes unimodal as well as highly multimodal minimization problems. The dimensionality of problems varies from 2 to 100 to cover a wide range of problem complexity. The definition, the range of search space, and also the global minimum of each function are given in Appendix. We compare the convergence speed of our method and DEr by measuring the number of function calls (NFC) which is the most commonly used metric in the literature [14,12]. Smaller NFC means higher convergence speed (for more theoretical information about the convergence properties of evolutionary algorithms the reader is referred to [11]). In all solved problems, is the lowest positive value one can chose. Also, in all solved problems, size of initial population is 100. 1- Sphere Model, -5.12< Since , independently influences , then . Hence: 1 NFC(DE) 28151 2- Axis Parallel: NFC(Suggested Method) 1002 , NFC(DE) 37555 NFC(Suggested Method) 100 3 _________________________________________________________________________________ 1: It is obvious that the less the value of , the more the accuracy of the result. In experiments, 2: NFC=100 means that the final answer is among the initial population. 3- Rosenbrock Function: - , (1) According to (1) and the main function: NFC(DE) 295255 4- Rastrigin Function: NFC(Suggested Method) 100 , For cosine function we have: , Hence, 4 NFC(DE) 383377 5- Brainins’ function NFC(Suggested Method) 100 , , NFC(DE) 4918 6- Michalewicz function, For NFC(Suggested Method) 100 , function we have: 5 NFC(DE) 3132 NFC(Suggested Method) 100 Figure 1: The performance of complete random population, semi-random population, and selected initial population on the Michalewicz function after 40 runs for each sort of initial population. NFC(DE) 4500 7- Matyas function, NFC(Suggested Method) 4136 , = Inserting (2) in (1), we have: NFC(DE) 3132 NFC(Suggested Method) 100 6 Conclusion Our heuristic method has been applied into some famous benchmarks. The main idea of the method was to combine classical and arbitrary nature of the existed methods in order to generate more proper initial population for heuristic methods. Results show that in many continuous functions, the final answer can be obtained in selected population suggested by our method. In some cases such as f(6), the semi-random population work more efficiently within the time which indicates that the obtained answers with combination of random numbers in the initial population led to the best result faster than the case where the initial population includes random numbers or selected answers. Hence, it can be concluded from the experiments that with the same size of initial population, a semi-random population including selected results of solved equations and random numbers can outperform those include random numbers. References 1. T. Bäck, Evolutionary Algorithms in Theory and Practice: Evolution Strategies, Evolutionary Programming, Genetic Algorithms, 0195099710Oxford University Press, USA (1996) 2. H.-P. Schwefel, Computational Intelligence: Theory and Practice, , 3540432698Springer-Verlag, New York (2003) 3. T. Bäck, U. Hammel, H.-P. Schwefel, Evolutionary computation: Comments on the history and current state, IEEE Transactions on Evolutionary Computation, 1 (1) (1997), pp. 3–17 4. D.E. Goldberg, Genetic Algorithms in Search, Optimization, and Machine Learning, Addison-Wesley, New York (1989) 5. R. Storn, K. Price, Differential evolution — A simple and efficient heuristic for global optimization over continuous spaces, Journal of Global Optimization, 11 (1997), pp. 341–359 6. K. Price, R.M. Storn, J.A. Lampinen, Differential Evolution: A Practical Approach to Global Optimization (Natural Computing Series), (first ed.), 3540209506Springer (2005) 7. H. Maaranen, K. Miettinen, M.M. Mäkelä, A Quasi-Random Initial Population for Genetic Algorithms, Computers and Mathematics with Applications, vol. 47 (2004), pp. 1885–1895 8. P. Bratley, B.L. Fox, H. Niederreiter, Implementation and tests of low-discrepancy sequences, ACM Transaction on Modeling and Computer Simulation, 2 (3) (1992), pp. 195–213. 9. H.R. Tizhoosh, Opposition-based learning: A new scheme for machine intelligence, in: Int. Conf. on Computational Intelligence for Modelling Control andAutomation — CIMCA’2005, Vienna, Austria, 2005, pp. 695–701 10. G.C. Onwubolu, B.V. Babu, New Optimization Techniques in Engineering, Springer, Berlin, New York (2004) 11. G. Rudolph, Convergence Properties of Evolutionary Algorithms, Verlag Dr. Kovač, Hamburg (1997) 12. O. Hrstka, A. Kučerová, Improvement of real coded genetic algorithm based on differential operators preventing premature convergence, Advance in Engineering Software, 35 (2004), pp. 237–246 13. J. Andre, P. Siarry, T. Dognon, An improvement of the standard genetic algorithm fighting premature convergence in continuous optimization 14. Advance in Engineering Software, 32 (2001), pp. 49–60 15. J. Vesterstroem, R. Thomsen, A comparative study of differential evolution, particle swarm optimization, and evolutionary algorithms on numerical benchmark problems, in: Proceedings of the Congress on Evolutionary Computation (CEC-2004), IEEE Publications, vol. 2, 2004, pp. 1980–1987 16. Shahryar Rahnamayan, Hamid R. Tizhoosh, Magdy M.A. Salama, A novel population initialization method for accelerating evolutionary algorithms, Computers & Mathematics with Applications. Volume 53, Issue 10, May 2007, Pages 1605–1614. 7 8
9cs.NE
ON κ-SPARSE NUMERICAL SEMIGROUPS arXiv:1611.09898v1 [math.RA] 29 Nov 2016 G. TIZZIOTTI AND J. VILLANUEVA Abstract. Given a positive integer κ, we investigate the class of numerical semigroups verifying the property that every two subsequent non gaps, smaller than the conductor, are spaced by at least κ. These semigroups will be called κ-sparse and generalize the concept of sparse numerical semigroups. Introduction Let Z be the  set of integers numbers and N0 be the set of non-negative integers. A subset H = 0 = n0 (H) < n1 (H) < · · · of N0 is a numerical semigroup if its is closed respect to addition and its complement in N0 is finite. The numerical semigroup N0 is called trivial numerical semigroup. The cardinality g = g(H) of the set N0 \ H is is called genus of the numerical semigroup H. Note that g(H) = 0 if and only if H = N0 . If g > 0 the elements the complement N0 \ H are called gaps and the set of gaps will be denoted by Gaps(H). The smallest integer c = c(H) such that c + h ∈ H, for all h ∈ N0 is called the conductor of H. The least positive integer n1 (H) ∈ H is called the multiplicity of H. As N0 \ H is finite, the set Z \ H has a maximum, which is called Frobenius number and will be denoted by ℓg (H). A property known of this number is that ℓg (H) ≤ 2g − 1, see [6]. In particular, H = N0 if and only if −1 is the Frobenius number of H. At consequence of this fact, from now on we use the notation ℓ0  = ℓ0 (H) := −1, for all numerical semigroup H. When g > 0, we denote Gaps(H) = 1 = ℓ1 (H) < · · · < ℓg (H) . So, c = ℓg (H) + 1 and is clear that c = nc−g (H). For simplicity of notation we shall write ℓi for ℓi (H) and nk for nk (H), for all integers i, k such that 0 ≤ i ≤ g and k ≥ 0, when there is no danger of confusion. Let H = {0 = n0 < n1 < · · · } be a numerical semigroup of genus g > 0 with Gaps(H) = {ℓ1 < · · · < ℓg }. H is said to be sparse numerical semigroup if (0.1) ℓi − ℓi−1 ≤ 2, for all integer i such that 1 ≤ i ≤ g, or equivalently ni − ni−1 ≥ 2, for all integer i such that 1 ≤ i ≤ c − g. The concept of a sparse numerical semigroup was introduced in [5] and [10]. For convenience, we consider the numerical semigroup N0 as sparse. For each non-negative integer g, let Ng := {0} ∪ {n ∈ N : n ≥ g + 1} Keywords: numerical semigroup, Arf numerical semigroup, Frobenius variety, sparse numerical semigroup. 1 2 G. TIZZIOTTI AND J. VILLANUEVA (in the case g = 0, it notation is itself the N0 ). It is clear that Ng is a numerical semigroup of genus g. The semigroup Ng is called ordinary numerical semigroup and is a canonical examples of sparse numerical semigroups. In this work, we introduce and investigate the class of numerical semigroups verifying the property that every two subsequent non gaps, smaller than the conductor, are spaced by at least κ, where κ is a positive integer. These semigroups will be called κ-sparse and generalize the concept of sparse numerical semigroups. This paper is organized as follows. The Arf numerical semigroups was introduced in [1] and since then several equivalent properties for these numerical semigroups have appeared. In the Section 1, we present one of these properties, given in [3], and prove that it is equivalent to a characterization given in [2]. The Section 2, contains the concept of leaps on a numerical semigroup which serves as the basis for introducing the concept of κ-sparse numerical semigroup that will be presented in the Section 3. Finally, in the Section 4, we will present results on the structures of κ-sparse numerical semigroups. 1. Arf Numerical Semigroups Definition 1.1. A semigroup H = {0 = n0 < n1 < · · · } is called Arf numerical semigroup if (1.1) ni + nj − nk ∈ H, for all integers i, j, k such that 0 ≤ k ≤ j ≤ i. That is equivalent to ni + nj − nk ∈ H, for all integers i, j, k such that 0 ≤ k ≤ j ≤ i ≤ c − g. Examples of Arf numerical semigroups are ordinary numerical semigroups. Relevant examples of sparse numerical semigroups are Arf numerical semigroups. For more details about Arf semigroups see e.g. [2] and [8]. The Arf property (1.1) is equivalent to: 2ni − nj ∈ H, for all integers i, j such that 0 ≤ j ≤ i (cf. [3]). In [2], there is fifteen alternative characterizations of Arf numerical semigroups which are distinct of the given in the Definition 1.1. The goal of this section is to prove that the property of Arf given in Equation 1.1 is equivalent to the characterization given in the item (xv)∗ of [2, Theorem I.3.4]. Before describe of this proof we recall some basics concepts, more details can be found in [2]. For two sets E and F contained in Z and z ∈ Z, let E + F := {e + f : e ∈ E, f ∈ F } and E + z := {e + z : e ∈ E}. Let H be a semigroup numerical. A relative ideal of H is a nonempty subset E of Z such that E + H ⊂ E and E + h ⊂ H, for some h ∈ H. A relative ideal of H which is contained in H is simply called an ideal of H. A proper ideal is an ideal distinct from H, that is, an ideal that does not contain zero. By a principal ideal of H, we mean ∗Theorem I.3.4 (xv) : H(nk ) is stable ideal, for all integer k such that 1 ≤ k ≤ c − g. ON κ-SPARSE NUMERICAL SEMIGROUPS 3 relative ideal E such that E = H + z, for some z ∈ Z. In this case, E is called an relative ideal principal of H generated by z. If E and F are relative ideal of H then (E − F ) := {z ∈ Z : F + z ⊂ E} is also a relative ideal of H. For every relative ideal E of H, (E − E) is a numerical semigroup. A ideal E of H is called stable if E is a principal ideal of (E − E). Let H = {0 = n0 < n1 < · · · } be a numerical semigroup. For each i ∈ N0 , let H(ni ) = {h ∈ H : h ≥ ni }. Is clear that H(ni ) is an ideal of H, for all i ∈ N0 . If i 6= 0 then H(ni ) is an proper ideal of H. Theorem 1.2. Let H = {0 = n0 < n1 < · · · } be a numerical semigroup of genus g and conductor c. The following statements are equivalent: (1) H is an Arf numerical semigroup; (2) H(nk ) is stable ideal, for all k ∈ N; (3) H(nk ) is stable ideal, for all integer k such that 1 ≤ k ≤ c − g. Proof. We prove that (1) ⇒ (2) ⇒ (3) ⇒ (1). Initially suppose that H be a Arf numerical semigroup and let k be a positive integer. We must showthat H(nk ) =  H(nk )−H(nk ) +nk . Since nk ∈ H(nk ), it is clear that H(nk )−H(nk ) +nk ⊂ H(nk ). Now, let h ∈ H(nk ). So, h = nj for some j ≥ k. Since nj = (nj − nk ) + nk , in order to  show H(nk ) ⊂ H(nk ) − H(nk ) + nk is enough prove that nj − nk ∈ H(nk ) − H(nk ) . Since H is Arf, we have that ni +nj −nk ∈ H, for all i, j ≥ k. Thus, ni +nj −nk ∈ H(nk ), for all integer i such that i ≥ k.  Therefore, H(nk ) + (nj − nk ) ⊂ H(nk ) and follows that nj − nk ∈ H(nk ) − H(nk ) . Thus, we have (1) ⇒ (2). The implication (2) ⇒ (3) is trivial. Now, suppose (3). Let i, j, k integers such that 0 ≤ k ≤ j ≤ i ≤ c − g. If k = 0 is clear that ni + nj − nk ∈ H. So, let k ≥ 1 and suppose that H(nk ) is stable. Then, H(nk ) = H(n  k ) − H(nk ) + z, for some z ∈ Z. Note that z ∈ H(nk), since 0 ∈ H(nk ) − H(nk ) . Also, nk = x + z, for some x ∈ H(nk ) − H(nk ) . Then, nk = x +z ≥ x + nk ≥ nk . Therefore, x = 0 and we have that H(nk ) = H(nk ) − H(nk ) + nk . Let i, j, k be integers such that 1 ≤ k ≤ j ≤ i. Since nj ∈ H(nk ), we have that nj = y + nk , for some y ∈ H(nk ) − H(nk ) . Consequently, ni + nj − nk = ni + y ∈ H(ni ) + y ⊂ H(nk ) + y ⊂ H(nk ) ⊂ H and thus (3) ⇒ (1).  2. The sets of leaps Let H be a numerical semigroup of genus g > 0 and Gaps(H) = {1 = ℓ1 < · · · < ℓg }. Remembering that ℓ0 = −1, for each 1 ≤ i ≤ g, the ordered pair (ℓi−1 , ℓi ) will be called leap on H (or simply leap). The set of leaps on H will be denoted by  V = V(H) := (ℓi−1 , ℓi ) : 1 ≤ i ≤ g . 4 G. TIZZIOTTI AND J. VILLANUEVA Note that | V | = g. In [4], the authors work with the ordered pairs (ℓi−1 , ℓi ) such that ℓi − ℓi−1 = 1 and ℓi − ℓi−1 = 2, for sparse numerical semigroups of genus g ≥ 2 and 2 ≤ i ≤ g, not considering the element ℓ0 = −1. These pairs were called single leap and double leap, respectively. Based on this idea, for a positive integer m, if ℓi − ℓi−1 = m the ordered pair (ℓi−1 , ℓi ) will be called m-leap on H (or simply m-leap), for any numerical semigroups with genus g > 0 and i = 1, . . . , g. If m = 1, the 1-leap on H is called a single leap on H (or simply single leap). If m = 2, the 2-leap on H is called a double leap on H (or simply double leap). For a positive integer m, the set of m-leaps will be denoted by  Vm = Vm (H) := (ℓi−1 , ℓi ) : ℓi − ℓi−1 = m, 1 ≤ i ≤ g . For convenience, we define Vm (N0 ) := ∅, for all positive integer m. To simplify the notation we will denote the cardinality of the set Vm (H) by vm (H), that is, vm = vm (H) := | Vm (H) |. From definition the sets V and Vm ’s, for all numerical semigroup H, we get the disjoint union [ V(H) = · Vm (H). m∈N Observe that, if H is a numerical semigroup of genus g > 0, then V(H) is a finite union of non-empty disjoint sets. Before of the next result, let us remember that a numerical semigroup H is called hyperelliptic if 2 ∈ H. Theorem 2.1. Let H be a numerical semigroup of genus g > 0. Then, V is a finite P union of non-empty sets mutually disjoint. In particular, vm = g. More precisely, m∈N (1) H is hyperelliptic if and only if v1 = 0. In this case, v2 = g and vm = 0, for all integer m such that m ≥ 3; (2) H is non-hyperelliptic if and only if v1 6= 0. In this case, vg+m = 0, for all positive integer m. Proof. Let H be a numerical semigroup of genus g > 0 with Gaps(H) = {ℓ1 < · · · < ℓg }. Let us prove the item (1). By [6, Theorem 1.1 (i)], H is hyperelliptic if and only if ℓi = 2i − 1, for all integer i such that 1 ≤ i ≤ g. So, if H is hyperelliptic then v1 = 0. Reciprocally, if v1 = 0 then 2 ∈ H, otherwise we will have ℓ1 = 1 and ℓ2 = 2, and so (ℓ1 , ℓ2 ) is a single leap, contradiction. Moreover, since ℓi = 2i − 1, for all integer i such that 1 ≤ i ≤ g, follows that V2 = V and Vm = ∅, for all integer m such that m ≥ 3 and the assertion (1) follows. The first assertion in the item (2), follows directly from the item (1), that is, H is non-hyperelliptic if and only if v1 6= 0. Now, we prove the last assertion. By [6, Theorem 1.1 (ii)], H is non-hyperelliptic if and only if H = N2 or g ≥ 3 and ℓi ≤ 2i−2, ON κ-SPARSE NUMERICAL SEMIGROUPS 5 for all integer i such  that 2 ≤ i ≤ g − 1, and ℓg ≤ 2g − 1. Thus, if H = N2 then g = 2 and we have V = (ℓ1 , ℓ2 ) = V1 . So, V2+m = ∅, for all positive integer m. On the other hand, if g ≥ 3 then ℓi − ℓi−1 ≤ (2i − 1) − (i − 1) ≤ g − 2, for all integer i such that 2 ≤ i ≤ g − 1, and ℓg − ℓg−1 ≤ (2g − 1) − (g − 1) = g. This implies that Vg+m = ∅, for all positive integer m, and the proof is complete.  Proposition 2.2. Let H be a numerical semigroup of genus g. Then, (1) H = N0 if and only if v2 (H) = 0; (2) v2 (H) 6= 0 if and only if 1 6∈ H; (3) for g > 0, H = Ng if and only if v1 (H) = g − 1 and v2 (H) = 1. In this case, vm = 0, for all positive integer m ≥ 3; κ P (4) for all positive integer κ, vm (H) ≤ g. m=1 Proof. To prove (1), by definition, we have that Vm (N0 ) = ∅, for all positive integer m. So, H = N0 implies that v2 (H) = 0. Now, suppose that v2 (H) = 0. Then, 1 ∈ H and follows that H = N0 . The item (2), follows directly from the previous item. For the item (3), it is clear that if H = Ng , then ℓi = i, for all integer i such that 1 ≤ i ≤ g. So, v1 (H) = g − 1 and v2 (H) = 1. Reciprocally, suppose v1 (H) = g − 1 and v2 (H) = 1. If g = 1, we have that v1 (H) = 0 and, by item (1) from the Theorem 2.1, follows that H = N1 . Then, suppose g ≥ 2. Since |V(H)|  = g ≥ 2 and v1 (H) = g − 1, (ℓ0 , ℓ1 ) is the unique double leap. So, V1 (H) = V(H) \ (ℓ0 , ℓ1 ) and ℓi − ℓi−1 = 1, for all integer i such that 2 ≤ i ≤ g. Therefore, we conclude that ℓi = i, for all integer i such that 1 ≤ i ≤ g, and we have H = Ng . κ S The item (4) is trivial, since · Vm (H) ⊂ V(H), for all positive integer κ.  m=1 Theorem 2.3. Let H be a numerical semigroup of genus g. (1) H is a sparse numerical semigroup if and only if v1 (H) + v2 (H) = g. In this case, vm (H) = 0, for all positive integer m ≥ 3. (2) If H is a sparse numerical semigroup, then the Frobenius number of H is ℓg = v1 (H) + 2v2 (H) − 1. (3) If g > 0 and ℓg (H) = 2g − K, for some positive integer K, then H is a sparse numerical semigroup if and only if v1 (H) = K − 1 and v2 (H) = g − K + 1. Proof. To prove (1) first, suppose that H is a sparse numerical semigroup. Then, ℓi − ℓi−1 ≤ 2, for all 1 ≤ i ≤ g. Since | V(H) | = g, we have that v1 (H) + v2 (H) = g. The converse implication follows directly from V1 (H)∪· V2 (H) ⊂ V(H) and | V(H) | = g. Now, we prove (2). If H = N0 , then g = 0 and v1 (H) = v2 (H) = 0, and the equality is true since the Frobenius number of H = N0 is ℓ0 = −1. Suppose that g > 0. If H is hyperelliptic, by Theorem 2.1 item (1), we have that v1 (H) = 0 and v2 (H) = g. So, the equality follows, since ℓg = 2g − 1. If H is non-hyperelliptic, by Theorem 2.1 6 G. TIZZIOTTI AND J. VILLANUEVA item (2), V1 (H) 6= ∅. If Gaps(H) = {ℓ1 < · · · < ℓg }, since H is sparse, by Theorem 2.3 item (1), we have that g X (ℓi − ℓi−1 ) = i=1 X (ℓi − ℓi−1 ) + (ℓi−1 ,ℓi )∈V1 (H) X (ℓi − ℓi−1 ). (ℓi−1 ,ℓi )∈V2 (H) g P Note that ℓg − ℓ0 = (ℓi − ℓi−1 ). By the definitions of V1 (H) and V2 (H), follows that i=1 P P (ℓi − ℓi−1 ) = 2v2 (H). Therefore, ℓg − ℓ0 = (ℓi − ℓi−1 ) = v1 (H) and (ℓi−1 ,ℓi )∈V1 (ℓi−1 ,ℓi )∈V2 v1 (H) + 2v2 (H) by proving the result. Finally, we prove the item (3). Suppose that g > 0 and ℓg (H) = 2g − K. If H is a sparse numerical semigroup, by the item (1), we have that v1 (H) + v2 (H) = g and, by the item (2), ℓg = v1 (H) + 2v2 (H) − 1. So, 2g − K = g + v2 (H) − 1 implies v2 (H) = g − K + 1 and, using the item (1) again, v1 (H) = g − 1. The converse implication follows directly by the item (1) above.  3. κ-Sparse Numerical Semigroup Let H be a numerical semigroup of genus g. The Theorem 2.1 shows that Vg+m = ∅, for all integer m such that m ≥ 2, and g+1 X vm (H) = g. m=1 The item (1) in Theorem 2.3 motivates us to define a new class of numerical semigroups, which generalize the sparse numerical semigroups. Definition 3.1. Let κ be an integer positive. A numerical semigroup H of genus g is called κ-sparse numerical semigroup if κ X vm (H) = g. m=1 Note that if H is a κ-sparse numerical semigroup, then vk+j (H) = 0, for all positive κ S integer j. In particular, V(H) = · Vm (H). m=1 For κ ≥ 2, a κ-sparse numerical semigroup H with vκ (H) 6= 0 will be called pure κ-sparse numerical semigroup. By the definition above, N0 is a κ-sparse numerical semigroup, for all positive integer κ, and the sparse numerical semigroups are the 2-sparse numerical semigroups. Also, the pure 2-sparse numerical semigroups are the sparse numerical semigroups with genus positive. Example 3.2. For each non-negative integer g, the ordinary numerical semigroup Ng is a κ-sparse numerical semigroup, for all integer κ such that κ ≥ 2. ON κ-SPARSE NUMERICAL SEMIGROUPS 7 The definition of κ-sparse condition is equivalent a another properties as follows, which is our main result. Theorem 3.3. Let κ be an integer such that κ ≥ 2. Let H = {0 = n0 < n1 < · · · } be a numerical semigroup of genus g > 0 and Gaps(H) = {1 = ℓ1 < · · · < ℓg }, with conductor c. The following statements are equivalent: (1) H is be a κ-sparse numerical semigroups; (2) ℓi − ℓi−1 ≤ κ, for all integer i such that 1 ≤ i ≤ g; (3) ni+κ−2 − ni−1 ≥ κ, for all integer i such that 1 ≤ i ≤ c − g − κ + 2; (4) if i is a positive integer such that ni , ni + 1, . . . , ni + κ − 1 ∈ H, then ni ≥ c (that is, i ≥ c − g). Proof. We prove that (1) ⇒ (2) ⇒ (3) ⇒ (4) ⇒ (1). Initially suppose that H be a κ S κ-sparse numerical semigroup. Then, V(H) = · Vm (H). So, given i ∈ {1, . . . , g}, m=1 there exist m ∈ {1, . . . , κ} such that (ℓi−1 , ℓi ) ∈ Vm (H). Thus, ℓi − ℓi−1 = m ≤ κ and we have (1) ⇒ (2). Now, suppose (2). First, if c = g + κ − 1, then c − g − κ + 2 = 1 and we have that nκ−1 − n0 = nκ−1 ≥ κ. Now, let c ≥ g + κ and suppose that exist i ∈ {1, 2, . . . , c − g − κ + 2} such that ni+κ−2 − ni−1 < κ. Since ni+κ−2 − ni−1 ≥ (i + κ − 2) − (i − 1) = κ − 1, follows that ni+κ−2 − ni−1 = κ − 1. Note that on the interval [ni−1 , ni+κ−2 ] exists exactly κ consecutive numbers and thus ni+s−1 = ni−1 + s, for all integer s such that 1 ≤ s ≤ κ − 1. So, i < c − g − κ + 2, since nc−g = c. Choice the largest index i with that property. Then, ni+κ−2 + 1 is a gap of H. That is, there exist j ∈ {1, . . . , g} such that ℓj = ni+κ−2 + 1. Therefore, ℓj−1 < ni−1 and so ℓj − ℓj−1 > (ni+κ−2 + 1) − ni−1 = κ, a contradiction. Thus, we have that (2) ⇒ (3). To prove the implication (3) ⇒ (4), suppose there exist a positive integer i < c − g such that ni , ni +1, . . . , ni +κ−1 ∈ H. Note that ni+κ−1 = ni +κ−1 and i ≤ c−g+κ+1. Then, we have 1 ≤ i ≤ c − g − κ + 1 and ni+κ−1 − ni = (ni + κ − 1) − ni = κ − 1, a contradiction with the item (3). Finally, we proof the implication (4) ⇒ (1). Suppose that there is a number κ S i ∈ {1, . . . , g} such that (ℓi−1 , ℓi ) ∈ V(H) \ · Vm (H). So, ℓi − ℓi−1 > κ. Note that m=1 i ≥ 2, since κ ≥ 2 and g > 0. Then, ℓi −κ, ℓi −κ+1, . . . , ℓi −1 are κ consecutive non-gaps κ S with ℓi − κ < ℓi < c, a contradiction with the item (4). Therefore, V(H) = · Vm (H) and we have that H is a κ-sparse numerical semigroup. m=1  Corollary 3.4. Let κ be an integer such that κ ≥ 3. Let H be a numerical semigroup with conductor c. Then, H is a pure κ-sparse numerical semigroup if and only if H is a κ-sparse numerical semigroup and there is a positive integer i such that ni , ni + 1, . . . , ni + κ − 2 ∈ H, with ni < c. 8 G. TIZZIOTTI AND J. VILLANUEVA Proof. Initially suppose that H is a pure κ-sparse numerical semigroup. Thus, H is κsparse numerical semigroup and there is an integer j ∈ {1, . . . , g} such that ℓj − ℓj−1 = κ. So, there is i such that ni , ni + 1, . . . , ni + κ − 2 ∈ [ℓi−1 , ℓi ] ∩ H and, since ℓj < c, we have that ni < c. Reciprocally, suppose that H is a κ-sparse and there is a positive integer i such that ni , ni + 1, . . . , ni + κ − 2 ∈ H, with ni < c. By Theorem 3.3 item (iv), follows that ni − 1, ni + κ − 1 ∈ / H, that is, (ni − 1, ni + κ − 1) ∈ Vκ (H) and follows that H is a pure κ-sparse numerical semigroup.  Example 3.5. Let κ be an integer such that κ ≥ 3. For an integer a such that a ≥ κ, considerer the numerical semigroup H = {0 = n0 < n1 < · · · } of genus g = 2a − κ, where n1 = a and nκ = 2a. Then, H is be a pure κ-sparse numerical semigroup if and only if H = {a, a + 1, . . . , a + κ − 2} ∪ N2a−1 . In fact, suppose that H is be a pure κ-sparse numerical interval [n1 , nκ ] = [a, 2a] has a + 1 − κ gaps and g = 2a − κ, for all j ∈ N0 . Thus, the conductor c of H is such that c 3.4, follows that ni+1 = n1 + i, for all integer i such that H = {a, a + 1, . . . , a + κ − 2} ∪ N2a−1 . semigroup. Since on the follows that 2a + j ∈ H, ≤ 2a. So, by Corollary 1 ≤ i ≤ κ − 2. Then, Now, suppose that H = {a, a+1, . . . , a+κ−2}∪N2a−1 . Thus, if Gaps(H) = {ℓ1 < · · · < ℓg }, then ℓi = i and ℓj = j + κ − 1, for all integers i, j such that 1 ≤ i ≤ a − 1 and a ≤ j ≤ g = 2a − κ. So, ℓi − ℓi−1 = 1, for all integer i ∈ {2, . . . , g} \ {a}, and ℓa − ℓa−1 = κ. Therefore, H is be a pure κ-sparse numerical semigroup. 4. Structure of κ-Sparse Numerical Semigroups For each positive integer κ, let Sκ be the collection of κ-sparse numerical semigroups and let Sκ∗ be the collection of pure κ-sparse numerical semigroups, where, for κ = 1, we will denote S1∗ = S1 . Lemma 4.1. (1) Sκ = {N0 } if and only if κ = 1; (2) Sκ = {H : H is be a sparse numerical semigroup} if and only if κ = 2. Proof. We prove (1). First, suppose that Sκ = {N0 }. If κ > 1 there is H ∈ Sκ such that g(H) > 0, a contradiction. Reciprocally, suppose that κ = 1 and let H ∈ S1 . Then, vm (H) = 0, for all integer m such that m ≥ 2. In particular, v2 (H) = 0. Therefore, by Proposition 2.2 item (1), H = N0 and so S1 = {N0 }. Now, we prove (2). Suppose that Sκ be the collection of sparse numerical semigroups. From item (1), follows that κ ≥ 2. By Theorem 2.3 item (1), v1 (H)+v2 (H) = g, for all H ∈ Sκ . Then, κ ≤ 2 and we have κ = 2. Reciprocally, suppose that κ = 2 and let H ∈ S2 . Then, v1 (H) + v2 (H) = g. So, by Theorem 2.3 item (1), H is be a sparse numerical semigroup and the proof is complete.  ON κ-SPARSE NUMERICAL SEMIGROUPS 9 The following result is a generalization of Theorem 2.3. Theorem 4.2. Let κ be an integer such that κ ≥ 2. Let H be a numerical semigroup of genus g. Then: (1) If H is be a κ-sparse numerical semigroup, then the Frobenius number of H is ℓg = κ X mvm (H) − 1; m=1 (2) Let g > 0 and K := 2g − ℓg . Then, H is be a κ-sparse numerical semigroup if and only if κ X mvm (H) = 2g − K + 1 and κ X (m − 1)vm (H) = g − K + 1. m=2 m=1 Proof. We prove (1). If κ = 1, by Lemma 4.1 item (1), H = N0 . Then, g = 0 and v1 (H) = 0. So, the equality is true, since the Frobenius number of H = N0 is ℓ0 = −1. Suppose that κ > 1 and thus g > 0. If H is hyperelliptic, by Theorem 2.1 item (1), we have that v2 (H) = g and vm (H) = 0, for all positive integer m such that m 6= 2. So, the equality follows, since ℓg = 2g − 1 and 2g − 1 = 2g + κ X mvm (H) − 1. m=1 m6=2 Now, if H is non-hyperelliptic, by Theorem 2.1 item (2), V1 (H) 6= ∅. Let Gaps(H) = {ℓ1 < · · · < ℓg }. By the κ-sparse property, we have that g X (ℓi − ℓi−1 ) = g P X (ℓi − ℓi−1 ). m=1 (ℓi−1 ,ℓi )∈Vm (H) Vm (H)6=∅ i=1 Since ℓg − ℓ0 = κ X P (ℓi − ℓi−1 ) and i=1 (ℓi − ℓi−1 ) = mvm (H) (by the definition (ℓi−1 ,ℓi )∈Vm (H) of Vm (H)), follows the result. To prove (2), suppose that g > 0 and ℓg (H) = 2g − K. If H is be a κ-sparse κ P vm (H) = g and, by the item (1) above, 2g−K = numerical semigroup, we have that κ P mvm (H) − 1. So, κ P m=1 mvm (H) = 2g − K + 1 and we have m=1 m=1 κ X (m − 1)vm (H) = 2g − K + 1 − m=2 κ X vm (H) = g − K + 1. m=1 The converse implication is clear. Let S be the collection of all numerical semigroups. Theorem 4.3.  10 G. TIZZIOTTI AND J. VILLANUEVA (1) The sequence (Sκ )κ∈N is an strictly ascending chain. (2) Sκ∗1 ∩ Sκ∗2 = ∅, for all positive integers κ1 and κ2 such that κ1 6= κ2 . S S (3) S = Sκ = · Sκ∗ . κ∈N (4) T κ∈N Sκ = {N0 }. κ∈N Proof. We show the item (1). If κ = 1, by Lemma 4.1, is clear that S1 ( S2 . If κ ≥ 2, by Theorem 3.3, follows that Sκ ⊂ Sκ+1 and the Example 3.5 show that Sκ 6= Sκ+1 . The item (2), follows directly from the definition of pure κ-sparse numerical semigroup. S To prove (3), note that Sκ ⊂ S. Now, let H ∈ S with genus g. If g = 0, κ∈N then H = N0 ∈ S1 . In another case, if g > 0, taking κ := max{ℓi − ℓi−1 : 1 ≤ i ≤ g}, S follows that H ∈ Sκ . So, in any case, S ⊂ Sκ . The second equality is obvious. κ∈N The item (4) is trivial, by item (1) and Lemma 4.1 item (i).  The item (3) in the previous theorem allows to define an equivalence relation ∼ on S in the following way: given H1 , H2 ∈ S, H1 ∼ H2 ⇔ there is κ ∈ N such that H1 and H2 are in Sκ∗ . Now, we are interested in the Frobenius varieties, concept introduced by J. C. Rosales in [7]. We will show that the families of κ-sparse numerical semigroups, for κ ≥ 2, are examples of Frobenius varieties. Remember that the intersection of two numerical semigroups is a numerical semigroup and if H is a numerical semigroup of genus g > 0, then H ∪ {ℓg (H)} is also a numerical semigroup (see [9] for details). Definition 4.4. A Frobenius variety is a nonempty set V of numerical semigroups fulfilling the following conditions: (i) for all H1 , H2 ∈ V , H1 ∩ H2 ∈ V ; (ii) for all H ∈ V with genus g > 0, H ∪ {ℓg (H)} ∈ V . Lemma 4.5. Let κ an integer such that κ ≥ 2. If H1 , H2 ∈ Sκ , then H1 ∩ H2 ∈ Sκ . Proof. Let H1 and H2 are in Sκ , with genus g1 and g2 , respectively. It is clear that if g1 = 0 or g2 = 0, then H1 ∩ H2 ∈ Sκ . Thus, suppose that g1 > 0 and g2 > 0. Let Gaps(H1 ) = {ℓ1 (H1 ) < · · · < ℓg1 (H1 )} and Gaps(H2 ) = {ℓ1 (H2 ) < · · · < ℓg1 (H2 )}. If g is the genus of H1 ∩ H2 , then Gaps(H1 ∩ H2 ) = {ℓ1 < · · · < ℓg }, where {ℓ1 , . . . , ℓg } = {ℓ1 (H1 ), . . . , ℓg1 (H1 )} ∪ {ℓ1 (H2 ), . . . , ℓg2 (H2 )}. Note that, if g = 1, we have that g1 = g2 = 1 and then H1 ∩ H2 = N1 ∈ Sκ . For g > 1, let i ∈ {2, . . . , g}. If ℓi , ℓi−1 ∈ Gaps(Hr ), for some r ∈ {1, 2}, then ℓi − ℓi−1 ≤ κ. Now, if ℓi ∈ Gaps(Hr ) and ℓi−1 ∈ Gaps(Hs ), for r, s ∈ {1, 2} with r 6= s, then there is ON κ-SPARSE NUMERICAL SEMIGROUPS 11 j ∈ {1, . . . , g2 } such that ℓi−1 = ℓj (Hs ), since ℓi−1 ∈ Gaps(Hs ). So, if ℓi ∈ Gaps(Hs ), we have that ℓi = ℓj+1 (Hs ) and follows that ℓi − ℓi−1 = ℓj+1 (Hs ) − ℓj (Hs ) ≤ κ. On the other hand, if ℓi ∈ / Gaps(Hs ), we have that ℓi < ℓj+1 (Hs ) and follows that ℓi − ℓi−1 < ℓj+1 (Hs ) − ℓj (Hs ) ≤ κ. Therefore, we have that H1 ∩ H2 is a κ-sparse numerical semigroup, that is, H1 ∩ H2 ∈ Sκ .  Proposition 4.6. Let κ be an integer such that κ ≥ 2. The set Sκ is a Frobenius variety. Proof. The condition (i) in the Definition 4.4 is satisfied by the previous lemma. Now, we will show that the condition (ii) is also satisfied. In fact, let H ∈ Sκ with genus g > 0 and Gaps(H) = {ℓ1 < · · · < ℓg }. If g = 1, then H ∪ {ℓ1 } = N0 ∈ Sκ . If g > 1, then the genus of H ∪ {ℓg } is equal to g − 1 and Gaps(H ∪ {ℓg }) = {ℓ1 < · · · < ℓg−1 }. So, by Theorem 3.3 item (ii), follows that H ∪ {ℓg } ∈ Sκ .  The Figure 1, illustrates a retrospective of the κ-sparse numerical semigroups as a generalization of the sparse and Arf numerical semigroups. Numerical semigroups Pure (κ + 1)-sparse numerical semigroups (κ + 1)-sparse numerical semigroups Pure κ-sparse numerical semigroups κ-sparse numerical semigroups Sparse numerical semigroups Arf numerical semigroups Ordinary semigroups Trivial numerical semigroup: N0 Figure 1. Diagram of κ-sparse numerical semigroups 12 G. TIZZIOTTI AND J. VILLANUEVA References [1] C. Arf, Une interpretation algébrique de la suite des ordres de multiplicité dúne branche algébrique, Proc. London Math. Soc., 50 (1949), 256–287. [2] V. Barucci, D. E. Dobbs and M. Fontana, Maximality properties in numerical semigroups and applications to one-dimensional analytically irreducible local domains, Mem. Amer. Math. Soc. 125, 1997. [3] A. Campillo, J. I. Farrán and C. Munuera, On the parameters of algebraic-geometry codes related to Arf semigroups, IEEE Trans. Inform. Theory 46 (7) (2000), 2634–2638. [4] A. Contiero, C. G. T. A. Moreira and P. M. Veloso, On the structure of numerical sparse semigroups and applications to Weierstrass points, Journal of Pure and Applied Algebra 219 (2015), 3946-3957. [5] C. Munuera, F. Torres and J. Villanueva, Sparse Numerical Semigroups, Lecture Notes in Computer Science: Applied Algebra, Algebraic Algorithms and Error-Correcting Codes, 5527, 23–31, Springer-Verlag Berlin Heilderberg (2009). [6] G. Oliveira, Weierstrass semigroups and the canonical ideal of non-trigonal curves, Manuscripta Math., 71 (1991), 431–450. [7] J. C. Rosales, Families of numerical semigroups closed under finite intersections and for the Frobenius number, Houston J. Math. 34 (2008), 339–348. [8] J. C. Rosales, P. A. Garcı́a-Sánchez, J. I. Garcı́a-Garcı́a and M. B. Branco, Arf Numerical Semigroups, Journal of Algebra 276 (2004), 3–12. [9] J. C. Rosales and P. A. Garcı́a-Sánchez, Numerical Semigroups, Developments in Mathematics, Springer-Verlag New York Inc., United States (2012). [10] J. Villanueva, “Semigrupos fracamente de Arf e pesos de semigrupos”, Ph. D. Thesis, UNICAMP, 2008. Faculdade de Matemática, Universidade Federal de Uberlândia, Av. João Naves de Ávila 2160, 38408-100, Uberlândia - MG, Brasil Instituto de Ciências Exatas e da Terra, Campus Universitário do Araguaia, Universidade Federal de Mato Grosso, Rodovia MT-100, Km 3,5, 78698-000, Pontal do Araguaia - MT, Brasil E-mail address: [email protected] E-mail address: vz [email protected]
0math.AC
Solvency Markov Decision Processes with Interest Tomáš Brázdil∗1 , Taolue Chen2 , Vojtěch Forejt†2 , Petr Novotný1 , and Aistis Simaitis2 1 2 Faculty of Informatics, Masaryk University, Czech Republic Department of Computer Science, University of Oxford, UK arXiv:1310.3119v1 [cs.CE] 11 Oct 2013 Abstract Solvency games, introduced by Berger et al., provide an abstract framework for modelling decisions of a risk-averse investor, whose goal is to avoid ever going broke. We study a new variant of this model, where, in addition to stochastic environment and fixed increments and decrements to the investor’s wealth, we introduce interest, which is earned or paid on the current level of savings or debt, respectively. We study problems related to the minimum initial wealth sufficient to avoid bankruptcy (i.e. steady decrease of the wealth) with probability at least p. We present an exponential time algorithm which approximates this minimum initial wealth, and show that a polynomial time approximation is not possible unless P = NP. For the qualitative case, i.e. p = 1, we show that the problem whether a given number is larger than or equal to the minimum initial wealth belongs to NP ∩ coNP, and show that a polynomial time algorithm would yield a polynomial time algorithm for mean-payoff games, existence of which is a longstanding open problem. We also identify some classes of solvency MDPs for which this problem is in P. In all above cases the algorithms also give corresponding bankruptcy avoiding strategies. 1998 ACM Subject Classification G.3 Probability and statistics. Keywords and phrases Markov decision processes, algorithms, complexity, market models. 1 Introduction Markov decision processes (MDP) are a standard model of complex decision-making where results of decisions may be random. An MDP has a set of states, where each state is assigned a set of enabled actions. Every action determines a distribution on the set of successor states. A run starts in a state; in every step, a controller chooses an enabled action and the process moves to a new state chosen randomly according to the distribution assigned to the action. The functions that describe decisions of the controller are called strategies. They may depend on the whole history of the computation and the choice of actions may be randomized. MDPs form a natural model of decision-making in the financial world. To model nuances of financial markets, various MDP-based models have been developed (see e.g. [15, 2, 3]). A common property of these models is that actions correspond to investment choices and result in (typically random) payoffs for the controller. One of the common aims in this area is to find a risk-averse controller (investor) who strives to avoid undesirable events [12, 13]. In this paper we consider a model based on standard reward structures for MDPs, which is closely related to solvency games studied in [3]. The model is designed so that it captures essential properties of risk-averse investments. We assume finite-state MDPs and assign a (real) reward to every action which is collected whenever the action is chosen. The states ∗ † Tomáš Brázdil is supported by the Czech Science Foundation, grant No P202/12/P612. Vojtěch Forejt is also affiliated with FI MU, Brno, Czech Republic. licensed under Creative Commons License CC-BY Leibniz International Proceedings in Informatics Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl Publishing, Germany 2 Solvency Markov Decision Processes with Interest of the MDP capture the global situation on the market, prices of assets, etc. Note that it is usually plausible to model the prices by a finite-state stochastic process (see e.g. [15]). Rewards model money received (positive rewards) and money spent (negative rewards) by the controller. Controllers are then compared w.r.t. their ability to collect the reward over finite or infinite runs. Standard objectives such as the total reward, or the long-run average reward are not suitable for modelling the behaviour of a risk-averse investor as they allow temporary loss of an arbitrary amount of money (i.e., a long sequence of negative rewards), which is undesirable, because normally the controller’s access to credit is limited. The authors of [3] consider a “bankruptcy-avoiding” objective defined as follows: Starting with an initial amount of wealth W0 , in the n-th step, the current wealth Wn is computed from Wn−1 by adding the reward collected in the n-th step. The goal is to find a controller which maximizes the probability of having Wn > 0 for all n. Although the model of [3] captures basic behaviour of a risk-averse investor, it lacks one crucial aspect usually present in the financial environment, i.e., the interest. Interests model the value that is received from holding a certain amount of cash, or conversely, the cost of having a negative balance. To accommodate interests, we propose the following extension of the bankruptcy-avoiding objective: Fix an interest rate % > 1.1 Starting with an initial wealth W0 , in the n-th step, compute the current wealth Wn from Wn−1 by adding not only the collected reward but also the interest (% − 1)Wn−1 . The economical motivation for such a model is that the controller can earn additional amount of wealth by lending its assets for a fixed interest, and conversely, when the controller is in debt, it has to pay interest to its creditors (for the clarity of presentation, we suppose the interest earned from positive wealth is the same as the interest paid on debts). Hence, the objective is to “manage” the wealth so that it stays above some threshold and does not keep decreasing to negative infinity. More precisely, we want to maximize the probability of having lim inf n→∞ Wn > −∞. Intuitively, lim inf n→∞ Wn ≥ 0 means that the controller ultimately does not need to borrow money, and −∞ < lim inf n→∞ Wn < 0 means that the controller is able to sustain interest payments from its income. If lim inf n→∞ Wn = −∞, then the controller cannot sustain interest payments and bankrupts. An important observation is that this objective is closely related to another well-studied objective concerning the discounted total reward. Concretely, given a discount factor 0 < β < 1, the discounted total reward T accumulated on a run is defined to be the weighted sum of rewards of all actions on the run where the weight of the n-th action is β n . In particular, the threshold problem asks to maximize the probability of T ≥ t for a given threshold t. This problem has been considered in, e.g., [16, 10, 17, 18]. A variant of the threshold problem is the value-at-risk problem [4] which asks, for a given probability p, what is the infimum threshold, such that maximal probability of discounted reward surpassing the threshold is at least p? We show that for every controller, the probability of T ≥ t with discount factor β is equal to the probability of lim inf n→∞ Wn > −∞ with W0 = −t for the interest rate % := β1 . This effectively shows interreducibility of these problems. Note that the interpretation of the discount factor as the inverse of the interest is natural in financial mathematics. Contribution. We introduce a model of solvency MDPs with interests (referred to as solvency MDPs for brevity), which allows to capture the complex dynamics of wealth management under uncertainty. We show that for every solvency MDP there is a bound on 1 For notational convenience, we define the interest rate to be the number 1 + r, where r > 0 is the usual interest rate, i.e. the percentage of money paid/received over a unit of time. Tomáš Brázdil2 , Taolue Chen, Vojtěch Forejt3 , Petr Novotný, and Aistis Simaitis wealth such that above this bound the bankruptcy is surely avoided (no matter what the controller is doing), and another bound on wealth below which the bankruptcy is inevitable. Nevertheless, we also show that there still might be infinitely many reachable values of wealth between these two bounds. The main results of our paper concentrate on the complexity of computing minimal wealth with which the controller can stay away from bankruptcy. Let W(s0 , p) be the infimum of all initial wealths W0 such that starting in the state s0 with W0 the controller can avoid bankruptcy (i.e., lim inf n→∞ Wn > −∞) with probability at least p. Our overall goal is to compute this number W(s0 , p). Solution to this problem is important for a risk-averse investor, whose aim is to keep the risk of bankruptcy below some acceptable level. First we consider the qualitative case, i.e. W(s0 , 1). For this case we show a connection with two-player (non-stochastic) games with discounted total reward objectives. Then, using the results of [19] we show that there is an oblivious strategy (i.e., the one that looks only at the current state but is independent of the wealth accumulated so far) which starting in some state s0 with wealth W(s0 , 1) avoids bankruptcy with probability one. The problem whether W ≥ W(s0 , 1) for a given W (encoded in binary) is in NP ∩ coNP (we also obtain a reduction from discounted total reward games, showing that improving this complexity bound might be difficult). In addition, the number W(s0 , 1) can be computed in pseudo-polynomial time. Further it follows that for a restricted class of solvency Markov chains (i.e. when there is only one enabled action in every state) the value W(s0 , 1) can be computed in polynomial time. The main part of our paper concerns the quantitative case, i.e. W(s0 , p) for an arbitrary probability bound p. We give an exponential-time algorithm that approximates W(s0 , p) up to a given absolute error ε > 0. We actually show that the algorithm runs in time polynomial in the number of control states and exponential in log(1/(% − 1)), log(1/ε) and log(rmax ), where % is the interest rate and rmax is the maximal |r| where r is a reward associated to some action. Employing a reduction from the Knapsack problem, we show that the above complexity cannot be lowered to polynomial in either log(1/ε) or log(% − 1) + log(rmax ) unless P=NP. We give an exponential-time algorithm that for a given ε > 0 and initial wealth W0 computes v such that if the initial wealth is increased by ε, then the probability of avoiding bankruptcy is at least v (i.e. W0 + ε ≥ W(s0 , v)) and v ≥ sup{v 0 | W0 ∈ W(s0 , v 0 )}. Moreover, via the aforementioned interreducibility between discounted and solvency MDPs we establish new complexity bounds for value-at-risk approximation in discounted MDPs. We note that the aforementioned algorithms employ a careful rounding of numbers representing the current wealth Wn . Choosing the right precision for this rounding is quite an intricate step, since a naive choice would only yield a doubly-exponential algorithm. The paper is organized as follows: after introducing necessary definitions and clarifying the relation with the discounted MDPs in Section 2 we summarise the results for qualitative problem in Section 3. In Section 4 we give the contributions for the quantitative problem. Related work. Processes involving interests and their formal models naturally emerge in the field of financial mathematics. An MDP-based model of a financial market is presented, e.g., in Chapter 3 of [2]. There, in every step the investor has to allocate his current wealth between riskless bonds, on which he receives an interest according to some fixed interest rate, and several risky stocks, whose price is subject to random fluctuations. Optimization of the investor’s portfolio with respect to various utility measures was studied. However, this portfolio optimization problem was considered only in the finite-horizon case, where the trading stops after some fixed number of steps. In contrast, we concentrate on the long-term stability of the investor’s wealth. Also, the model in [2] was analysed mainly from 3 4 Solvency Markov Decision Processes with Interest the mathematical perspective (e.g., characterizing the form of optimal portfolios), while we focus on an efficient algorithmic computation of the optimal investor’s behaviour. The issues of a long-term stability and algorithms were considered for other related models, all of which concern total accumulated reward properties. Our model is especially close to solvency games [3], which are in fact MDPs with a single control state, where the investor aims to keep the total accumulated reward non-negative. In energy games (see e.g. [7, 8, 9]), there are two competing players, but no stochastic behaviour. In one-counter MDPs [6], the counter can be seen as a storage for the current value of wealth. All these models differ from the topic studied in this paper in that they do not consider interest on wealth. This makes them fundamentally different in terms of their properties, e.g. in our setting the set of all wealths reachable from a given initial wealth can have nontrivial limit points. Also, in all the three aforementioned models, the objective is to stay in the positive wealth. Here we focus on a different objective to capture the idea that it is admissible to be in debt as long as it is possible to maintain the debt above some limit. As mentioned before, our work is also related to the threshold discounted total reward objectives, which were considered in [16, 10, 17, 18], where the authors studied finite- and infinite-horizon cases. In the finite-horizon case, in particular [18] gave an algorithm to compute the probability, but a careful analysis shows that their algorithm has a doublyexponential worst-case complexity when the planning horizon (i.e., the number of steps after which the process halts) is encoded in binary. In [5] they proposed to approximate the probability through the discretisation of wealth, but in the worst the error of approximation is 1, no matter how small discretisation step is taken. In [18], the optimality equation characterising optimal probabilities has been provided for the infinite-horizon case, but no algorithm was proposed. Moreover, [4] considered the “value-at-risk” problem, but again only for the finite-horizon case, giving a doubly-exponential approximation algorithm. Although we consider only infinite-horizon MDPs, the exponential-time upper bound for the W(s, p) approximation and the NP-hardness lower bound can be easily carried over to the finitehorizon case. Thus, we establish new complexity bounds for value-at-risk approximation in both finite and infinite-horizon discounted MDPs. We also mention [11] which introduced the percentile performance criteria where the controller aims to find a strategy achieving a specified value of the long-run limit average reward at a specified probability level (percentile). 2 Preliminaries We denote by N, Z, Q and R the sets of all natural, integer, rational and real numbers, respectively. For an index set I, its member i and vector V ∈ RI we denote by V(i) the i-component of V. The encoding size of an object B is denoted by ||B||. We use log x to refer to the binary logarithm of x. We assume that all numbers are represented in binary and that rational numbers are represented as fractions of binary-encoded integers. We assume familiarity with basic notions of probability theory. Given an at most countable set X, we use dist(X) to denote all probability distributions on X. I Definition 1 (MDP). A Markov decision process (MDP) is a tuple M = (V, A, T ) where V is at most countable set of vertices, A is a finite set of actions, and T : V × A → dist(V ) is a partial transition function. We assume that for every v ∈ V the set A(v) of all actions available at v (i.e., the set off all actions a s.t. T (v, a) is defined) is nonempty. We denote by Succ(v, a) = {u | T (v, a)(u) > 0} the support of T (v, a). A Markov chain is an MDP with one action per vertex, i.e., |A(v)| = 1 for all v ∈ V . Tomáš Brázdil4 , Taolue Chen, Vojtěch Forejt5 , Petr Novotný, and Aistis Simaitis From a given initial vertex v0 ∈ V the MDP evolves as follows. An infinite path (or run) is a sequence v0 a1 v1 a2 v2 · · · ∈ (V × A)ω such that ai+1 ∈ A(vi ) and vi+1 ∈ Succ(vi , ai+1 ) for all i. A finite path (or history) is a prefix of a run ending with a vertex, i.e. a word of the form (V × A)∗ V . We refer to the set of all runs as RunsM and to the set of all histories as HistM . For a finite or infinite path ω = v0 a1 v1 a2 v2 . . . and i ∈ N we denote by ωi the finite path v0 a1 · · · ai vi . A strategy in M is a function that to every history w assigns a distribution on actions available in the last vertex of w. A strategy is deterministic if it always assigns distributions that choose some action with probability 1, and memoryless if it only depends on the last vertex of history. We use ΣM (or just Σ) for the set of all strategies of M . Each history w ∈ HistM determines the set Cone(w) consisting of all runs having w as a prefix. To an MDP M , its vertex v and strategy σ we associate the probability space (RunsM , F, PσM,v ), where F is the σ-field generated by all Cone(w), and PσM,v is the unique probability measure such that for every history w = v0 a1 . . . ak vk we have Qk PσM,v (Cone(w)) = µ(v0 ) · i=1 xi , where µ(v0 ) is 1 if v0 = v and 0 otherwise, and where xi = σ(wi−1 )(ai ) · T (vi−1 , ai )(vi ) for all 1 ≤ i ≤ k (the empty product is equal to 1). We drop M from the subscript when the MDP is clear from the context. I Definition 2 (Solvency MDP). A solvency Markov decision process is a tuple (S, A, T, F, %) where S is a finite set of states, A and T are such that (S, A, T ) is an MDP, F : S × A → Q is a partial gain function and % ∈ Q ∩ (1, ∞) is an interest rate. We stipulate that for every (s, a) ∈ S × A the value F (s, a) is defined iff a ∈ A(s). A solvency Markov chain is a solvency MDP with one action per state, i.e. |A(s)| = 1 for all s ∈ S. A configuration of a solvency MDP M = (S, A, T, F, %) is represented as a state-wealth pair (s, x) where s ∈ S and x ∈ Q. The semantics of M is given by an infinitestate MDP M% = (S × Q, A, T% ) where for every (s, x) ∈ S × Q and a ∈ A(s) we define T% ((s, x), a)(s0 , % · x + F (s, a)) = p whenever T (s, a)(s0 ) = p. We sometimes do not distinguish between M and M% and refer to strategies or runs of M where strategies or runs of M% are intended. A strategy σ for M% is oblivious if it is memoryless and does not make its decision based on the current wealth, i.e. for all w · (s, x) and (s, x0 ) we have σ(w · (s, x)) = σ((s, x0 )). Objectives. Given an solvency MDP M and its initial configuration (s0 , x0 ), we are interested in the set of runs in which the wealth always stays above some finite bound, denoted by Win = RunsM \ {(s0 , x0 )a1 (s1 , x1 ) · · · ∈ RunsM | lim inf n→∞ xn = −∞}. Intuitively, this objective models the ability of the investor not to go bankrupt, i.e. to compensate for the incurred interest by obtaining sufficient gains. We denote Val M (s0 , x0 ) = supσ PσM,(s0 ,x0 ) (Win) the maximal probability of winning with a given wealth, and WM (s, p) = inf{x | Val M (s, x) ≥ p} the infimum of wealth sufficient for winning with probability p. In this paper we are mainly interested in the problems of computing or approximating the values of WM (s, p). We also address the problem of computing a convenient risk-averse strategy for an investor with a given initial wealth x0 . A precise definition of what we mean by a convenient strategy is given in Section 4 (Theorem 11). We say that a strategy is p-winning (in an initial configuration (s0 , x0 )) if PσM,(s0 ,x0 ) (Win) ≥ p. A 1-winning strategy is called almost surely winning, and strategy σ with PσM,(s0 ,x0 ) (Win) = 0 is called almost surely losing. I Example 3. Consider the following solvency MDP M = (S, A, T, F, %): 5 6 Solvency Markov Decision Processes with Interest 1 1 work, 2 s0 profit, 60 invest, −10 1 loss, 0 s1 0.1 0.9 s2 Here S = {s0 , s1 , s2 }, A = {work, invest, profit, loss}, T is depicted by the arrows in the figure, for example T (s0 , invest) = [s1 7→ 0.1, s2 7→ 0.9], the function F is given by the bold numbers next to the actions, e.g. F (s, work) = 2, and % = 2 (we take this extremely large value to keep the example computations simpler). The MDP models the choices of a person who can either work, which ensures certain but relatively small income, or can invest a larger amount of money but take a significant risk. Starting in the configuration (s0 , −10) (i.e. in debt), an example strategy σ is the strategy which always chooses work in s0 , but as can be easily seen, we get PσM,(s0 ,−10) (Win) = 0 since the constant gains are not high enough to cover the interest incurred by the debt. An optimal strategy here is to pick work only in histories ending with a configuration (s0 , x) for x ≥ −2, and to pick invest otherwise. Such strategy shows that Val M (s0 , −10) = 0.1. Now suppose that the investor wants to find out what is the wealth needed to make sure the probability of winning is at least 0.7, i.e. wants to compute WM (s0 , 0.7). This number is equal to −2. To see this, observe that for any configuration (s0 , y) where y < −2 the optimal strategy must pick invest, which with probability 0.9 results in a debt from which it is impossible to recover. Finally, observe that Val M (s0 , −2) = 1 since a strategy that always chooses work is 1-winning in (s0 , −2). This demonstrates that the function Val(s, ·) for a given state s may not be continuous. Relationship with discounted MDPs. The problems we study for solvency MDPs are closely related to another risk-averse decision making model, so called discounted MDPs with threshold objectives. A discounted MDP is a tuple D = (S, A, T, F, β), where the first four components are as in a solvency MDP and 0 < β < 1 is a discount factor. The semantics of a discounted MDP is given by a finite-state MDP Dβ = (S, A, T ) and a reward function disc(·) which to every run ω = s0 a1 s1 a2 . . . in Dβ assigns its total discounted reward P∞ disc(ω) = i=1 F (si−1 , ai ) · β i . The threshold objective asks the controller to maximize, for a given threshold t ∈ Q, the probability of the event T hr(t) = {ω ∈ Run(Dβ ) | disc(ω) ≥ t}. Now consider a solvency MDP M = (S, A, T, F, %) with an initial configuration (s0 , x0 ) and a discounted MDP D = (S, A, T, F, 1/%) with a threshold objective T hr(−x0 ). Note that once an initial configuration (s0 , x0 ) ∈ S × Q is fixed, there is a natural one-to-one correspondence between runs in M% initiated in (s0 , x0 ) and runs in D1/% initiated in s: we identify a run (s0 , x0 )a1 (s1 , x1 )a2 . . . in M% with a run s0 a1 s1 a2 . . . in D1/% . This correspondence naturally extends to strategies in both MDPs, so we assume that these MDPs have identical sets of runs and strategies. I Proposition 4. Let M , D be as above. Then PσM,(s,x) (Win) = PσD,s (T hr(−x)) for all σ∈Σ. Proof. It suffices to show that for every run ω we have ω ∈ Win ⇔ disc(ω) ≥ −x. Fix a run def Pn ω = (s0 , x0 )a1 (s1 , x1 )a2 . . . , and define, for every n ≥ 0, disc n (ω) = i=1 F (si−1 , ai ) · %1i (an empty sum is assumed to be equal to 0). Obviously, for every n ≥ 0 we have xn = %n · (disc n (ω) + x0 ). Thus, if disc(ω) = limn→∞ disc n (ω) > −x0 , then limn→∞ xn exists and it is equal to +∞. Similarly, if disc(ω) < −x0 , then limn→∞ xn = −∞. If disc(ω) = −x0 , the infimum wealth xn along ω is finite (see Appendix A.1), and so ω ∈ Win. J It follows that many natural problems for solvency MDPs (value computation etc.) are polynomially equivalent to similar natural problems for discounted MDPs with threshold objectives. In particular, our problem of computing/approximating WM (s0 , p) is interreducible Tomáš Brázdil7 , Taolue Chen, Vojtěch Forejt8 , Petr Novotný, and Aistis Simaitis with the value-at-risk problem in discounted MDPs, where the aim is to compute/approximate the supremum threshold t such that under suitable strategy the probability (risk) of the discounted reward being ≤ t is at most 1 − p. 3 Qualitative Case In this section we establish a connection between the qualitative problem for solvency MDPs (i.e., determining whether x ≥ WM (s, 1) for a given state s and number x) and the problem of determining the winner in non-stochastic discounted games. I Definition 5 (Discounted game). A finite discounted game is a tuple G = (S1 , S2 , s0 , T, R, β) where S1 and S2 are sets of player 1 and 2 states, respectively; s0 ∈ S1 is the initial state; T ⊆ (S1 × S2 ) ∪ (S2 × S1 ) is a transition relation; R : (S1 ∪ S2 ) → R is a reward function; and 0 < β < 1 is a discount factor. A strategy for player i ∈ {1, 2} in a discounted game is a function ζi : (S1 ∪ S2 )∗ · Si → (S1 ∪ S2 ) such that (s, ζi (ws)) ∈ T for every s and w. A strategy is memoryless if it only depends on the last state. A pair of strategies ζ1 and ζ2 for players 1 and 2 yields a unique run run(ζ1 , ζ2 ) = s0 s1 . . . in the game, given by sj = ζi (s0 . . . sj−1 ) where i is 1 or 2 depending on whether sj−1 ∈ S1 or sj−1 ∈ S2 . The discounted total reward of the run is defined to be P∞ disc(s0 s1 . . .) := i=0 β i+1 R(si ). The discounted game problem asks, given a game G and a value x, whether there is a strategy ζ1 for player 1 such that for all strategies ζ2 of player 2 we have disc(run(ζ1 , ζ2 )) ≥ x. Such a strategy ζ1 is then called winning. By Proposition 4 the problem of determining whether x ≥ WM (s, 1) for a state s of a solvency MDP M is interreducible (in polynomial time) with the problem of determining whether there is σ ∈ ΣD such that PσD,s (T hr(−x)) = 1 in the corresponding discounted MDP D. We show that the latter is interreducible6 with the discounted game problem. Let us first fix a discounted MDP D = (S, A, T, F, β). We say that a run ω = s0 a1 s1 . . . of D is realisable under a strategy σ if σ(s0 a1 . . . sn )(an+1 ) > 0, and T (sn , an+1 )(sn+1 ) > 0 for all n. The idea of the reduction relies on the following lemma, which is proved in Appendix A. I Lemma 6. If σ ∈ ΣD satisfies PσD,s (T hr(x)) = 1, then all runs realisable under σ are in T hr(x). Using the lemma above we can construct a game G from D by stipulating that the results of actions are chosen by player 2 instead of being chosen randomly, and vice versa. The technical details of the reduction are presented in Appendix A. The next theorem follows from the reduction and the fact that memoryless (deterministic) strategies suffice in discounted games. I Theorem 7. For every solvency MDP M there exists an oblivious deterministic strategy which is almost-surely winning in every configuration (s, x) with x ≥ WM (s, 1). The discounted game problem is in NP ∩coNP and there exists a pseudopolynomial algorithm computing the optimal value [19]. Also, when one of the players controls no states in a game, the problem can be solved in polynomial time [19]. Hence, we get the following theorem. I Theorem 8. The qualitative problem for solvency MDPs is in NP ∩ coNP. Moreover, there is a pseudopolynomial algorithm that computes WM (s, 1) for every state s of M . For the 6 Actually, we use slightly different variants of the discounted game problem in reductions from and to the discounted MDPs problem, respectively. Nevertheless, they establish the desired complexity bounds. 7 8 Solvency Markov Decision Processes with Interest restricted class of solvency Markov chains, to compute WM (s, 1) and to decide the qualitative problem can be done in polynomial time. Note that the existence of a reduction from mean-payoff games to discounted games [1] suggests that improving the above complexity to polynomial-time is difficult, since a polynomialtime algorithm for solvency MDPs would give a polynomial-time algorithm for mean-payoff games, existence of which is a longstanding open problem in the area of graph games. 4 Quantitative Case This section formulates results on quantitative questions for solvency MDPs. We start with a proposition showing that we can restrict our attention to some subset of S × Q, since for every state there are two values below and above which all strategies are almost-surely winning or losing, respectively. Intuitively, these values represent wealth (positive or negative) for which losses/gains from the interest dominate gains/losses from the gain function F . An important consequence of the proposition, when combined with [14], is that deterministic strategies suffice to maximize the probability of winning. Therefore, in the rest of this section we consider only deterministic strategies. The proposition is proved in Appendix B.1. I Proposition 9. For every state s of the solvency MDP M there are rational numbers def U (M, s) = arg inf ∀σ . PσM,(s,x) (Win) = 1 x∈R and def L(M, s) = arg sup ∀σ . PσM,(s,x) (Win) = 0, x∈R of encoding size polynomial in ||M ||, and they can be computed in polynomial time using linear programming techniques. Moreover, we have PσM,(s,U (M,s)) (Win) = 1 for every strategy σ. To illustrate the proposition, we return to Example 3 and note that U (M, s0 ) = 20 3 and L(M, s0 ) = − 40 . Obviously, for every s we have K ≥ U (M, s) ≥ L(M, s) ≥ −K where 3 |F (s,a)| K = max(s,a)∈S×A %−1 , but as Example 3 shows, using U (M, s) and L(M, s) we can restrict the set of interesting configurations more than with the trivial bounds K and −K. def We also define the global versions of the bounds, i.e., L(M ) = mins∈S L(M, s) and def U (M ) = maxs∈S U (M, s). In accordance with the economic interpretation of our model, we call any configuration of the form (s, x) with x ≥ U (M, s) a rentier configuration. From Proposition 9 it follows that every run which visits a rentier configuration belongs to Win. Note that although Proposition 9 suggests that we can restrict our analysis to the configurations (s, x) where L(M, s) ≤ x ≤ U (M, s), the set of reachable configurations between these bounds is still infinite in general as the following example shows. I Example 10. Consider a solvency MDP M = ({s}, {a, b}, T, F, 23 ) with T (s, a) = T (s, b) = s, and F (s, a) = 12 and F (s, b) = − 21 . We have L(M ) = −1 and U (M ) = 1. We will show that for any n ∈ N there is a configuration (s, xn ) where xn = k/2n that is reachable in exactly n steps from an initial configuration (s, 12 ) and satisfies k ∈ N0 , 0 ≤ k < 2n , 2 - k. Hence the reachable state space from (s, 21 ) is infinite as the numbers xn are pairwise different. We set x0 = 12 , and let (s, xn ) be a reachable configuration where xn is of the form k/2n satisfying the above conditions. In one step we can reach configurations (s, x0 ) where n n x0 = %xn ± 12 = 3k±2 2n+1 . Clearly 2 - 3k ± 2 ; otherwise we would have 2 | 3k and thus 2 | k which contradicts the definition of xn . It remains to show that one of the values of x0 again satisfies the above conditions; this is a simple exercise, and we give a proof in Appendix B.2. Note that if the interest % is restricted to be an integer, the reachable configuration space between L(M ) and U (M ) is finite, because for the initial configuration (s, x) it holds x = pq Tomáš Brázdil9 , Taolue Chen, Vojtěch Forejt10 , Petr Novotný, and Aistis Simaitis where p, q ∈ Z, and % · x + y = %·p+y·q . Hence, any reachable wealth is a multiple of 1q , and q there are only finitely many such numbers between L(M ) and U (M ). This means that one can use off-the-shelf algorithms for finite-state MDPs, i.e., minimising the probability to reach configuration with (s, x), where x < L(M, s). However, for the general case, this is not possible and we need to devise new techniques. 4.1 Approximation Algorithms In this subsection we show how to approximate W(s, p). Our algorithm depends on the following theorem, which allows us, in a certain sense that will be explained soon, to approximate the function Val M (s0 , ·). I Theorem 11. There is an algorithm that computes, for a solvency MDP M with initial configuration (s0 , x0 ) and a given ε > 0, a rational number v and a strategy σ such that: 1. v ≥ Val M (s0 , x0 ). 2. Strategy σ is v-winning from configuration (s0 , x0 + ε).  The running time of the algorithm is polynomial in |S| · |A| · log p−1 min where pmin = min(s,s0 ,a)∈S 2 ×A T (s, a)(s0 ), and exponential in log(|rmax |/(% − 1)) and log(1/ε) where rmax = max(s,a)∈S×A |F (s, a)|. We will prove Theorem 11 later, but first we argue that the theorem is important in its own right. Consider the following scenario. Suppose that an investor starts with wealth x0 . It is plausible to assume that this initial wealth is not strictly fixed. Instead, one can assume that the investor is willing to acquire some small additional amount of wealth (represented by ε), in exchange for some substantial benefit. Here, the benefit consists of the fact that the small difference in the initial wealth allows the investor to compute and execute a strategy, under which the risk of bankruptcy is provably no greater than the lowest risk achievable with the original wealth. Note that the strategy σ may not be Val M (s0 , x0 + ε)-winning from (s0 , x0 + ε). We now proceed with the theorem providing the approximation of W(s, x) I Theorem 12. For a given solvency MDP M , its state s and rational numbers δ > 0, p ∈ [0, 1], it is possible to approximate W(s, p) up to the absolute error δ in time polynomial  in (|S| · |A|)O(1) · log p−1 , and exponential in log(|rmax |/(% − 1)) and log(1/δ), where pmin min an rmax are as in Theorem 11. Proof. Suppose that we already know that a ≤ W(s, p) ≤ b, for some a, b. We can use the algorithm of Theorem 11 for s0 = s, x0 = a + (b − a)/2 and ε = (b − a)/4. If the algorithm returns v ≤ p, we know that a + (b − a)/2 ≤ W(s, p) ≤ b, otherwise we can conclude that a ≤ W(s, p) ≤ a + 3(b − a)/4. Initially we know that L(M ) ≤ W(s, p) ≤ U (M ), so in order to approximate W(s, p) with absolute error δ it suffices to perform O(log((U (M )−L(M ))/δ)) iterations of this procedure, finishing when ε ≤ δ/4. J Later we will show that the time complexity of the algorithm cannot be improved to polynomial in either log(|rmax |/(% − 1)) or log(1/δ) unless P=NP. Proof of Theorem 11. For the rest of this section we fix a solvency MDP M = (S, A, T, F, %) and its initial configuration (s0 , x0 ). First we establish the existence of a strategy that, given a small additional amount of wealth, reaches a rentier configuration in at most exponential number of steps with probability at least Val M (s0 , x0 ). Then, we will show how to compute such a strategy in exponential time. To establish the proof of the following proposition, we use a suitable Bellman functional whose unique fixed point is equal to W. The proof can be found in Appendix B.3. 9 10 Solvency Markov Decision Processes with Interest I Proposition 13. For every initial configuration (s, x) and every ε > 0 there is a strategy σε such that starting in (s, x + ε/2), σε ensures hitting of a rentier configuration in at most  ))+log ε−1 +2  n = log (U (M )−L(M steps with probability at least Val M (s, x). In particular, log % ε Pσ(s,x+ε/2) (Win) ≥ Val M (s, x). The previous proposition shows that the number v and strategy σ of Theorem 11 can be computed by examining the possible behaviours of M during the first n steps. However, since log % ≈ % − 1 for % close to 1, the number n can be exponential in ||M ||. Thus, the trivial algorithm, that unfolds the MDP from the initial configuration (s0 , x0 + ε/2) into a tree of depth n, and on this tree computes a strategy maximising the probability of reaching a rentier configuration, has a doubly-exponential complexity. The key idea allowing to reduce this complexity to singly-exponential is to round the numbers representing the wealth in the configurations of M to numbers of polynomial size. If the size is chosen carefully, the error introduced by the rounding is not large enough to thwart the computation. In the following we assume that log % < log(U (M ) − L(M )) + log(ε−1 ) + 2, since otherwise n = 1 and we can compute the strategy σ and number v by computing an action that maximizes the one-step probability of reaching a rentier configuration from (s0 , x0 + ε/2). We now formalise the notion of rounding the numbers appearing in configurations of M . Let λ be a rational number. We say that two configurations (s, x), (s0 , x0 ) are λ-equivalent, denoted by (s, x) ∼λ (s0 , x0 ), if s = s0 and one of the following conditions holds: both x and x0 are greater than U (M, s) or less than or equal to L(M, s); or L(M, s) < x, x0 ≤ U (M, s) and there is k ∈ Z such that both x, x0 ∈ (kλ, (k + 1)λ]. Clearly, ∼λ is indeed an equivalence on the set S × Q, and every member of the quotient set (S × Q)/∼λ is a tuple of the form (s, D), with s ∈ S and D being either a half-open interval of length at most λ or one of the intervals (U (M, s), +∞), (−∞, L(M, s)]. For such D, we denote by wD the maximal element of D (putting w(U (M,s),+∞) = +∞). We also denote by [s, x]λ the equivalence class of (s, x). Now let n be as in Proposition 13. We define an MDP Mλ,n representing an unfolding of M into a DAG of depth n, in which the current wealth w is always rounded up to the least integer multiple of λ greater than w, with configurations exceeding the upper or dropping below the lower threshold of Proposition 9 being immediately recognized as winning or losing. The unfolded MDP Mλ,n is formally defined as follows. I Definition 14. [Unfolded MDP] Let M = (S, A, T, F, %) be an solvency MDP, and n > 0 and λ > 0 two numbers. We define an MDP Mλ,n = (S 0 , A, T 0 ) where S 0 is ((S × Q)/∼λ ) × {0, 1, . . . , n}, and the transition function T 0 is the unique function satisfying the following: for all (s, D, i) ∈ S 0 and a ∈ A where i < n and D is a bounded interval, the distribution T 0 ((s, D, i), a) is defined iff a ∈ A(s), and assigns T (s, a)(s0 ) to ([s0 , %·wD +F (s, a)]λ , i+1) for every other vertex (s, D, i) ∈ S 0 there is only a self loop on this vertex under every action, i.e., T 0 ((s, D, i), a) is given by [(s, D, i) 7→ 1] for every action a ∈ A. −1 O(1) The size of Mλ,n as well as the time needed to construct it is (|S| · |A| · log(p−1 ) . min ) · n · λ Now we denote by Hit the set of all runs in Mλ,n that contain a vertex of the form (t, (U (M, t), ∞), i), and by Ar(z) (for “almost rentier”) the set of all runs in M that hit a configuration of the form (t, y) with y ≥ U (M, t) − z in at most n steps. In particular, Ar(0) is the event of hitting a rentier configuration in at most n steps. The following lemma (proved in Appendix B.4) shows that Mλ,n adequately approximates the behaviour of M . I Lemma 15. Let (s, y) be an arbitrary configuration of M . Then the following holds: 1. For every σ ∈ ΣM there is π ∈ ΣMλ,n such that PπMλ,n ,([s,y]λ ,0) (Hit) ≥ PσM,(s,y) (Ar(0)). Tomáš Brázdil11 , Taolue Chen, Vojtěch Forejt12 , Petr Novotný, and Aistis Simaitis 1 2 3 4 5 6 7 8 9 10 Input: MDP M , state s, number p ∈ [0, 1], δ > 0 Output: number and strategy satisfying conditions of Theorem 12 a := L(M, s); b := U (M, s) ; // see Proposition 9 do ε := (b − a)/4; n := d(log (U (M ) − L(M )) + log ε−1 + 2)/ log %e; y := a + (b − a)/2; λ := d(64 · n · (U (M ) − L(M ))2 )/ε3 e−1 ; M 0 := Mλ,n and initial configuration t := [s, y]λ ; // see Definition 14 v := supπ PπM 0 ,t (Hit); ; // Val M (s, y) ≤ v ≤ Val M (s, y + ε) by Theorem 11 if v ≤ p then a := a + (b − a)/2 else b := a + 3(b − a)/4; while (b − a)/4 > δ; Compute σ s.t. PσM,(s,y) (Ar(n · λ · %n )) ≥ v ; // see Lemma 15 return a and the wealth-independent strategy (see p. 11) given by σ and (s, y); Algorithm 1: Algorithm approximating W(s, p) def 2. There is σ ∈ ΣM such that PσM,(s,y) (Ar(n · λ · %n )) ≥ supπ PπMλ,n ,([s,y]λ ,0) (Hit) = v, where the supremum is taken over ΣMλ,n . Moreover, the number v and a finite representation of the strategy σ can be computed in time ||Mλ,n ||O(1) . We can now finish the proof of Theorem 11. Let us put λ = d(64 · n · (U (M ) − L(M ))2 )/ε3 e−1 . An easy computation (shown in Appendix B.5) proves that n · λ · %n ≤ 2ε thanks to our assumption that log % < log(U (M ) − L(M )) + log(ε−1 ) + 2. By Proposition 13 there is a strategy σε in M with PσM,(s0 ,x0 +ε/2) (Ar(0)) ≥ Val M (s0 , x0 ), and so from Lemma 15 (1.) we get supπ PπMλ,n ,([s0 ,x0 +ε/2]λ ,0) (Hit) ≥ Val M (s0 , x0 ). By part (2.) of the same lemma we can compute, in time ||Mλ,n ||O(1) , a strategy σ in M and a number v such that PσM,(s0 ,x0 +ε/2) (Ar(ε/2)) ≥ v ≥ Val M (s0 , x0 ). In other words, from (s0 , x0 + ε/2) the strategy σ reaches with probability at least v a configuration that is only ε/2 units of wealth away from being rentier. Note that once an initial configuration is fixed, any strategy can be viewed as being wealth-independent, i.e. being only a function of a sequence of states and actions in the history, since the current wealth can be inferred from this sequence and the initial wealth. Suppose now that we fix the initial configuration (s0 , x0 + ε) instead of (s0 , x0 + ε/2), keeping the same strategy σ (i.e., we use a strategy that selects the same action as σ after observing the same sequence of states and actions). It is then obvious that we reach a rentier configuration with probability at least v, i.e., Pσ(s,x+ε) (Win) ≥ v as required. It remains to analyse the complexity of the construction. The analysis is merely technical and is postponed to Appendix B.6. J(Thm. 11) The results described in this section are summarised in a form of pseudocode in Algorithm 1. 4.2 Lower Bounds Now we complement the positive results given above with lower complexity bounds. I Theorem 16. The problem of deciding whether W(s, p) ≤ x for a given x is NP-hard. Furthermore, existence of any of the following algorithms is not possible unless P=NP: 1. An algorithm approximating W(s, p) up to the absolute error δ in time polynomial in  |S| · |A| · log p−1 and log(|r max |/(% − 1)) and exponential in log(1/δ). min 2. An algorithm approximating W(s, p) up to the absolute error δ in time polynomial in  |S| · |A| · log p−1 min and log(1/δ) and exponential in log(|rmax |/(% − 1)). Above, the numbers rmax and pmin are as in Theorem 11. Proof sketch. We show how to construct, for a given instance of the Knapsack problem, a solvency MDP M in which the item values are suitably encoded into probabilities of certain 11 12 Solvency Markov Decision Processes with Interest transitions, while the item weights are encoded as rewards associated to some actions. We then show that the instance of Knapsack has a solution if and only if for a certain state s of M and a certain number p (which can be computed from the instance) it holds that W(s, p) ≤ 0. We also show that in order to decide this inequality it suffices (for the constructed MDP M ) to approximate W(s, p) up to the absolute error 14 . (Intuitively, this corresponds to the well-known fact that no polynomial approximation algorithm for Knapsack can achieve a constant absolute error.) To get part (2.) we use a slight modification of the same approach. Let us note that a crucial component of the aforementioned reductions is that Val M (t, ·) may not be a continuous function (see example 3). Intuitively, this allows us to recognise whether the current wealth, which in M always encodes weight of some set of items, surpasses some threshold. The proof can be found in Appendix B.7. J Note that thanks to the interreducibility from Proposition 4, the (suitably rephrased) results of Theorems 12 and 16 hold also for the value-at-risk approximation in discounted MDPs. 5 Conclusions We have introduced solvency MDPs, a model apt for analysis of systems where interest is paid or received for the accumulated wealth. We have analysed the complexity of fundamental problems, and proposed algorithms that approximate the minimum wealth needed to win with a given probability and compute a strategy that achieves the goal. As a by-product, we obtained new results for the value-at-risk problem in discounted MDPs. There are several important directions of future study. One question deserving attention is to find an algorithm computing or approximating Val(s, x). The usual approaches of discretising the state space do not work in this case since the function Val(s, ·) is not continuous and thus it is difficult to bound the error introduced by the discretisation. Another direction is the implementation of the algorithms and their evaluation on case-studies. References 1 2 3 4 5 6 7 8 9 10 D. Andersson and P. B. Miltersen. The complexity of solving stochastic games on graphs. In Proceedings of the ISAAC ’09, pages 112–121, Berlin, Heidelberg, 2009. Springer-Verlag. N. Bäuerle and U. Rieder. Markov Decision Processes with Applications to Finance. Springer, 2011. N. Berger, N. Kapur, L. Schulman, and V. Vazirani. Solvency games. In Proceedings of FST&TCS 2008, volume 2 of LIPIcs, pages 61–72. Schloss Dagstuhl, 2008. K. Boda and J. A. Filar. Time consistent dynamic risk measures. Math. Meth. of OR, 63(1):169–186, 2006. K. Boda, J. A. Filar, Y. Lin, and L. Spanjers. Stochastic target hitting time and the problem of early retirement. IEEE Trans. Automat. Contr., 49(3):409–419, 2004. T. Brázdil, V. Brožek, K. Etessami, and A. Kučera. Approximating the termination value of one-counter mdps and stochastic games. Inf. Comput., 222:121–138, 2013. A. Chakrabarti, L. de Alfaro, T. A. Henzinger, and M. Stoelinga. Resource interfaces. In Proc. of EMSOFT 2003, volume 2855 of LNCS, pages 117–133, Heidelberg, 2003. Springer. K. Chatterjee and L. Doyen. Energy parity games. In Proceedings of ICALP 2010, Part II, volume 6199 of LNCS, pages 599–610. Springer, 2010. K. Chatterjee and L. Doyen. Energy and mean-payoff parity Markov decision processes. In Proceedings of MFCS 2011, volume 6907 of LNCS, pages 206–218. Springer, 2011. K. Chung and M. J. Sobel. Discounted mdps: Distribution functions and exponential utility maximization. SIAM J. Contr. Optim., 25:49–62, 1987. Tomáš Brázdil13 , Taolue Chen, Vojtěch Forejt14 , Petr Novotný, and Aistis Simaitis 11 12 13 14 15 16 17 18 19 J. Filar, D. Krass, and K. Ross. Percentile performance criteria for limiting average markov decision processes. IEEE Trans. Automat. Contr., 40(1):2–10, 1995. J. D. Hamilton. Time series analysis, volume 2. Cambridge Univ Press, 1994. J. Hull. Options, futures, and other derivatives. Pearson, 2009. D. Martin. The determinacy of Blackwell games. J. of Symb. Logic, 63(4):1565–1581, 1998. M. Schäl. Markov decision processes in finance and dynamic options. International Series in Operations Research & Management Science, 40:461–487, 2002. M. J. Sobel. The variance of discounted markov decision processes. J. Appl. Probab., 19:794–802, 1982. D. J. White. Minimizing a threshold probability in discounted markov decision processes. J. Math. Anal. Appl., 173:634–646, 1993. C. Wu and Y. Lin. Minimizing risk models in markov decision processes with policies depending on target values. J. Math. Anal. Appl., 231(1):47–67, 1999. U. Zwick and M. Paterson. The complexity of mean payoff games on graphs. TCS, 158(1– 2):343–359, 1996. 13 14 Solvency Markov Decision Processes with Interest Technical Appendix A Proofs for Section 3 A.1 Proof of Proposition 4 We show the missing part of the proof of Proposition 4. We need to show that the infimum wealth xn along ω is finite. This follows from the fact that for every n ≥ 0 we have xn = %n · (disc n (ω) − disc(ω)) = −%n · ( ≥− A.2 ∞ X 1 · F (si−1 , ai )) i % i=n+1 max(s,a)∈S×A |F (s, a)| max(s,a)∈S×A |F (s, a)| %n · =− . %n+1 %−1 1 − %1 Proof of Lemma 6 Lemma 6. Let σ be a strategy in D such that PσD,s (T hr(x)) = 1. Then all runs realisable under σ are in T hr(x). Proof. Suppose the lemma does not hold, and let ω = s0 a0 s1 . . . be a run realisable unP∞ der σ such that disc(ω) = x − ε for some ε > 0. Let M := i=0 β i maxs,a |F (s, a)| = maxs,a |F (s,a)| and let k be such that β k+1 · 2 · M < ε. Let ω 0 be any run of the form 1−β s0 a1 . . . ak sk bk+1 tk+1 bk+2 . . . (i.e. ωk = ωk0 ). Then, denoting tk :=sk we have disc(ω 0 ) = disc(ω)− ∞ X i=k+1  β i ·F (si−1 , ai ) + ∞ X  β i ·F (ti−1 , bi ) ≤ x−ε+β k+1 ·2·M < x. i=k+1 However, the probability of such runs is nonzero, a contradiction with the assumption that PσD,s (T hr(x)) = 1. J A.3 Interreducibility of discounted MDPs and discounted games Let us first fix a discounted MDP D = (S, A, T, F, β) We define a game G = (S, (S × √ A), s0 , TG , RG , β) with (s, (s, a)) ∈ TG whenever T (s, a) is defined; ((s, a), s0 ) ∈ TG whenever T (s, a)(s0 ) > 0; and RG (s) = 0 for all s ∈ S, and RG ((s, a)) = F (s, a) √ For the clarity of presentation we first assume that β is a rational number of polynomial encoding size. Then we will show how to get rid of this assumption. Let σ be a strategy in D such that PσD,s (T hr(x)) = 1. We define a strategy σ G for the player 1 in G by σ G (s0 (s0 , a1 )s1 . . . sn ) = (sn , an+1 ) where an ∈ A is an arbitrary action satisfying σ(s0 a1 . . . sn )(an+1 ) > 0. For all player 2 strategies ζ2 we have that to run(σ G , ζ2 ) = s0 (s0 , a1 )s1 . . . corresponds the run ω = s0 a1 s1 . . . in D which is realisable under σ, and disc(run(σ G , ζ2 )) = disc(ω). Because every run ω realisable under σ is in T hr(x), we have that disc(run(σ G , ζ2 )) ≥ x. For the other direction, let ζ1 be a winning player 1 strategy, by [19] we can assume that it is is memoryless. We define a strategy σ for D by σ(s) = ζ1 (s) for all s ∈ S. Assume PσD,s (T hr(x) < 1), and let ω = s0 a1 s1 . . . be a run realisable under σ such that disc(ω) < x. Then we can fix a strategy ζ2 for player Tomáš Brázdil15 , Taolue Chen, Vojtěch Forejt16 , Petr Novotný, and Aistis Simaitis 2 in G defined by ζ2 (s0 (s0 , a1 ) . . . sn ) = an+1 . We can easily show that disc(run(ζ1 , ζ2 )) = disc(ω) < x, which contradicts that ζ1 is winning. √ Now we drop the assumption that β is a rational number of polynomial encoding size. √ In such a case we represent the number β symbolically, as a triplet (P (x), 0, 1), where √ P (x) = x2 − β is the minimal polynomial of β over Q and the numbers 0, 1 represent the fact that we are interested in the positive (i.e., the one lying in the interval [0, 1]) root √ of P (x). Now consider again the aforementioned game G with β represented as above. Surely, determining the winner in such a game is at least as hard as determining the winner in “standard” discounted games, since all rational numbers can be also represented in the triplet form. It thus remains to show that the problem of determining the winner is in NP ∩ coNP. Let us recall how the NP-algorithm for standard games (see [19]) works: first, it guesses a winning memoryless deterministic strategy of player 1 and then it verifies, using linear programming techniques, that against this strategy the player 2 cannot decrease the discounted reward below x. Now linear programs with coefficients represented in the triplet form can be solved on a Turing machine in time polynomial in the encoding size of the triplets and in the degree of the algebraic extension defined by adjoining all the coefficients in the program to Q (see [?, Theorem 21]). The linear program obtained by guessing the strategy √ in G contains only one coefficient which may be irrational, namely β, which generates an extension of degree at most 2. Thus, we can again verify that the guessed strategy is winning in polynomial time. For the coNP upper bound we proceed similarly. For the other direction of interreducibility, for a discount game G = (S1 , S2 , s0 , TG , R, β) we define a discounted MDP D = (S1 , S2 , T, F, β 2 ) where T is an arbitrary function satisfying that T (s, t)(s0 ) > 0 iff (s, t) ∈ T and (t, s0 ) ∈ T ; F (s, t) = R(s)/β + R(t) The rest of the proof proceeds in the same way as above. √ I Remark. If β is a rational number, then the pseudopolynomial algorithm for the qualitative problem in solvency MDPs can be immediately obtained from the pseudopolynomial algorithm for discounted games in [19]. The algorithm in that paper iterates, for a pseudopolynomial number of steps, a suitable Bellman functional, where each iteration performs a polynomial number of additions, multiplications, divisions and comparisons, which involve the discount √ (i.e., in our reduction, the number β). Since all of these operations can be computed in polynomial time for algebraic numbers in the triplet form [?, Proposition 16], and all √ the intermediate results lie in the extension generated by β over Q, the algorithm is pseudopolynomial even for games with symbolically represented discounts. We note that √ in our game G, the optimal value resulting from this algorithm is rational even if β is irrational, because it corresponds to the minimal threshold achievable with probability 1 in a discounted MDP with rational discount β. Rationality of this minimal threshold can be shown by devising a suitable Bellman functional (we omit this argument, because it is not essential for our paper). B B.1 Proofs for Section 4 Proof of Proposition 9 Here we present an extended version of Proposition 9. I Proposition 17. For every state s of the solvency MDP M there are rational numbers 15 16 Solvency Markov Decision Processes with Interest U (M, s) and L(M, s), such that def U (M, s) = arg inf ∀σ . PσM,(s,x) (Win) = 1, x∈R def L(M, s) = arg sup ∀σ . PσM,(s,x) (Win) = 0, x∈R of encoding size polynomial in ||M ||, and they are solutions of the following linear programs: P max s.t. L(M, s) L(M, s) ≤ %1 (L(M, t) − F (s, a)) (for all s ∈ S, a ∈ A(s), and t ∈ Succ(s, a)) min s.t. P s∈S and U (M, s) s∈S U (M, s) ≥ %1 (U (M, t) − F (s, a)) (for all s ∈ S, a ∈ A(s), and t ∈ Succ(s, a)). Moreover, we have PσM,(s,U (M,s)) (Win) = 1 for every strategy σ. Proof. First we show that these are actually real numbers and not ±∞. Let gmax = max(s,a)∈S×A F (s, a) be the maximal gain that occurs in the solvency MDP, and fix arbitrary x such that gmax + % · x < 0, denoting τ := gmax + % · x. Then any run starting in (s, x) is of the form (s0 , x0 ) · a1 · (s1 , x1 ) · a2 · · · where xi ≤ x + i · τ . Hence we get that L(M, s) > x. For U (M, s) we take the minimal gain gmin = min(s,a)∈S×A F (s, a) and proceed similarly. We proceed by proving that the above values satisfy the optimality conditions. We first present the proof for value U (M, s). Assume that the initial wealth is x0 ≥ U (M, s). From LP it follows that for any action a for all t ∈ Succ(s, a) we have % · x0 + F (s, a) ≥ U (M, t). So no matter how the strategy picks actions, in the following states the accumulated wealth never falls below mins∈S U (M, s), and because we know that U (M, s) ∈ R, this ensures that any strategy wins almost surely. For the other direction assume that x0 < U (M, s) and let δ = U (M, s) − x0 . We construct a strategy σ which loses with positive probability. Let σ pick an action a = arg maxa∈A(s) maxt∈Succ(s,a) %1 (U (M, t) − F (s, a)), and let t = arg maxt∈Succ(s,a) %1 (U (M, t) − F (s, a)), i.e., such that action a and state t is a bounding constraint in the LP. It follows that U (M, t) − (% · x0 + F (s, a)) = % · δ. The strategy continues by picking actions the same way as in s and ensures that after k steps, there exists a run ending in some state t which has a nonzero measure and the difference between U (M, t) and wealth is equal to %k · δ, and so for any value X > −∞ we can find a k such that the wealth < X will be accumulated on some finite path having nonzero probability. This implies that wealth < mins∈S L(M, s) will be eventually reached and thus the strategy will lose with positive probability. Now we prove that the values L(M, s) satisfy the optimality conditions. First, assume that the initial wealth x0 satisfies x0 < L(M, s0 ) and let δ = L(M, s0 ) − x0 . From the linear program we know that for all actions a and successors t ∈ Succ(s0 , a) we have that L(M, t) − (% · x0 + F (s0 , a)) ≥ % · δ. Hence, no matter what is the choice of the strategy, in the next step the difference between wealth and L(M, t) will be at least % · δ for any successor t. We can show by induction that after k steps the difference between the wealth and L(M, t) is at least %k · δ; and because % > 1 we have that as k → ∞ we have wealth going to −∞. Now let the initial wealth be x0 > L(M, s0 ) and let δ = x0 − L(M, s0 ). We construct a strategy, which is winning with positive probability. Consider the strategy σ which picks an action a = arg mina∈A(s0 ) mint∈Succ(s0 ,a) %1 (L(M, t) − F (s0 , a)), and let Tomáš Brázdil17 , Taolue Chen, Vojtěch Forejt18 , Petr Novotný, and Aistis Simaitis t = arg mint∈Succ(s0 ,a) %1 (L(M, t) − F (s0 , a)), i.e., such that action a and state t is a bounding constraint in the LP. Hence, it follows that (% · x0 + F (s0 , a)) − L(M, t) = % · δ. The strategy continues by picking actions the same way as in s0 and ensures that after k steps, there exists a run ending in some state t which has a nonzero measure and the difference between wealth and the L(M, t) is equal to %k · δ, and so for any value X < ∞ we can find a k such that the wealth > X will be accumulated on some finite path having nonzero probability. This implies that wealth > maxs∈S U (M, s) will be eventually reached and thus the strategy will win with positive probability. The bound on the encoding size of the numbers follows from the standard results on linear programming. J B.2 Supplement to Example 10 We distinguish two cases. Firstly, if 3k + 2n < 2n+1 , we put xn = 3k + 2n . Secondly, if 3k + 2n ≥ 2n+1 , we have 3k − 2n = 3k + 2n − 2n+1 ≥ 0. We argue that 3k − 2n < 2n+1 , which allows us to put xn+1 = 3k − 2n . Suppose the opposite, i.e. 3k − 2n ≥ 2n+1 . This gives us 3k ≥ 2n+1 + 2n = 3 · 2n and thus k ≥ 2n , again a contradiction. B.3 Proof of Proposition 13 Let us recall the fact that thanks to the Proposition 9 we are now restricted to deterministic strategies. Proposition 13. For every initial configuration (s, x) and every ε > 0 there is a strategy σε such that starting in (s, x + ε/2), σε ensures hitting of a rentier configuration in at most  ))+log ε−1 +2  n = log (U (M )−L(M steps with probability at least Val M (s, x). In particular, log % ε Pσ(s,x+ε/2) (Win) ≥ Val M (s, x). In the proof of Proposition 13 we proceed by a series of lemmas. First we show that the S×[0,1] vector W = (W(s, p))s∈S is a unique fixed point of a suitable Bellman operator p∈[0,1] ∈ R L. Let s be any state of M . For an action a ∈ A(s) and number p ∈ [0, 1] we denote by P B(s, a, p) the set of all vectors q ∈ [0, 1]Succ(s,a) that satisfy s0 ∈Succ(s,a) q(s0 )·(T (s, a)(s0 )) ≥ p. The intuition behind the B(s, a, p) vectors is that if a strategy σ is p-winning in (s, x) and it picks an action a, then there must be a vector q ∈ B(s, a, p) such that for all s0 ∈ Succ(s, a), the probability of winning from the successor of (s, x) that is of the form (s0 , x0 ) for some x0 must be at least q(s0 ). Consider now the Bellman operator L defined on the uncountably-dimensional space RS×[0,1] as follows: L(V)(s, p) = min inf max a∈A(s) q∈B(s,a,p) s0 ∈Succ(s,a) 1 · (V(s0 , q(s0 )) − F (s, a)), % for all vectors V ∈ RS×[0,1] and all (s, p) ∈ S × [0, 1]. I Lemma 18. The vector W is a fixed point of the operator L. Proof. Assume, for the sake of contradiction, that there are s ∈ S, p ∈ [0, 1] such that L(W)(s, p) < W(s, p). Pick an arbitrary δ > 0 such that L(W)(s, p) + δ < W(s, p), and denote by x the left-hand side of this inequality. From the definition of L it follows, that there are a∗ ∈ A(s) and q∗ ∈ B(s, a∗ , p) such that for all s0 ∈ Succ(s, a∗ ) we have 1 0 ∗ 0 ∗ % · (W(s , q (s )) − F (s, a )) ≤ L(W)(s, p) + δ = x, or in other words, % · x + F (s, a∗ ) > W(s0 , q∗ (s0 )). (1) 17 18 Solvency Markov Decision Processes with Interest Now, starting in (s, x) the strategy can choose the action a∗ in the first step. If in the second step the current vertex is s0 (where s0 ∈ Succ(s, a∗ )), we switch to a strategy that ensures winning from (s0 , % · x + F (s, a∗ )) with probability at least q∗ (s0 ) (such a strategy must exist, due to (1)). Using this approach, the probability of winning from (s, x) is P 0 ∗ 0 at least s0 ∈Succ(s,a∗ ) q(s ) · (T (s, a )(s )) ≥ p, where the last inequality holds because ∗ ∗ q ∈ B(s, a , p). Since x < W(s, p), we get a contradiction with the definition of W. It remains to show that L(W)(s, p) ≤ W(s, p), for an arbitrary fixed (s, p) ∈ S × [0, 1]. It suffices to show that for every ε > 0 there is a strategy σ such that Pσ(s,L(W)(s,p)+ε) ≥ p. Similarly to the previous paragraph, there must be a∗ ∈ A(s) and q∗ ∈ B(s, a∗ , p) such that % · (L(W)(s, p) + ε) + F (s, a∗ ) ≥ W(s0 , q∗ (s0 )), for all s0 ∈ Succ(s, a∗ ). So if the strategy σ chooses a∗ in the first step, then in the second step the play will be in some configuration (s0 , % · (L(W)(s, p) + ε) + F (s, a∗ )), from which a strategy winning with probability at least q∗ (s0 ) exists, and σ will behave as this strategy from the second step onwards. Since q∗ ∈ B(s, a∗ , p), it follows that indeed Pσ(s,L(W)(s,p)+ε) (Win) ≥ p. J We denote by LU the set of all vectors V ∈ RS×[0,1] that satisfy L(M, s) ≤ V(s, p) ≤ U (M, s), for all (s, p) ∈ S × [0, 1]. We also denote ||V||∞ = sup(s,p)∈S×[0,1] |V(i)|. I Lemma 19. If V ∈ LU , then also L(V) ∈ LU . Moreover, for every pair of vectors V, V0 we have ||L(V) − L(V0 )||∞ ≤ %1 ||V − V0 ||∞ . Proof. Let V ∈ LU , s ∈ S and p ∈ [0, 1] be arbitrary. Assume, for the sake of contradiction, that L(V)(s, p) > U (M, s). By definition, any strategy wins from (s, L(V)(s, p)) with probability 1. Thus, for every a ∈ A(s) end every s0 ∈ Succ(s, a) we have %L(V)(s, p) + F (s, a) ≥ U (M, s0 ). But at the same time, by definition of L we have L(V)(s, p) ≤ %−1 (V(s0 , p0 ) − F (s, a)) for suitable p0 ∈ [0, 1]. Combining these two inequalities we get V(s0 , p0 ) ≥ U (M, s0 ), a contradiction with V ∈ LU . The inequality L(V)(s, p) ≥ L(M, s) can be established in a similar way. For the second part, fix arbitrary vectors V, V0 ∈ RS×[0,1] and some (s, p) ∈ S × [0, 1]. We have to show that |V(s, p) − V0 (s, p)| ≤ %−1 ||V − V0 ||∞ . Let us choose an arbitrary ε > 0. From the definition of L it follows that there are a, b ∈ A(s), q ∈ B(s, a, p) and r ∈ B(s, b, p) such that  1 ε V(s0 , q(s0 )) − F (s, a) ≤ V(s, p) + % 2  ε 1 0 0 def V (s , r(s0 )) − F (s, b) ≤ V0 (s, p) + . y2 = 0 max 2 s ∈Succ(s,b) % def y1 = max s0 ∈Succ(s,a) (2) (3) Assume that y1 ≥ y2 , the other case can be handled in a symmetric way. We have  ε 1 V(s0 , r(s0 )) − F (s, b) + − y2 % 2 1 ε 1 ε = max (V(s0 , r(s0 )) − V0 (s0 , r(s0 ))) + ≤ ||V − V0 ||∞ + , % s0 ∈Succ(s,b) 2 % 2 0 ≤ y1 − y2 ≤ max s0 ∈Succ(s,b) (4) where the second inequality follows from the facts  that V(s, p) ≤ y1 ≤ V(s, p) + ε/2 and V(s, p) ≤ maxs0 ∈Succ(s,b) %1 V(s0 , r(s0 )) − F (s, b) . Putting (2), (3) and (4) together, and using the fact that y2 ≥ V0 (s, p), we obtain |V(s, p) − V0 (s, p)| ≤ |y1 − y2 | + ε 1 ≤ ||V − V0 ||∞ + ε. 2 % Since ε > 0 was chosen arbitrarily, the result follows. J Tomáš Brázdil19 , Taolue Chen, Vojtěch Forejt20 , Petr Novotný, and Aistis Simaitis The previous lemma shows, that the operator L is a contraction mapping on LU . Now the set LU equipped with the supremum norm || · ||∞ is a Banach space. By the Banach fixed-point theorem, L has a unique fixed point in LU , which must be equal to W by Lemma 18. Moreover, for every vector V ∈ LU the sequence Ln (V) converges to this fixed point as n approaches infinity. Consider now a vector V0 ∈ LU such that V0 (s, p) = U (M, s) for every (s, p). I Lemma 20. Consider any (s, p) ∈ S × [0, 1] and any y > Ln (V0 )(s, p). Then there is a strategy σ such that starting in (s, y), the strategy σ ensures hitting a rentier configuration in at most n steps with probability at least p. Proof. We proceed by induction on n. The case n = 0 is trivial. So assume that and that the lemma holds for some n ∈ N0 . Consider any (s, p) ∈ S × [0, 1]. Then there must be an action a ∈ A(s) and vector r ∈ B(s, a, p) such that y> max s0 ∈Succ(s,a)  1 n 0 0 L (V )(s , r(s0 )) − F (s, a) . % (5) Then, in order to reach a rentier configuration in at most n + 1 steps with probability at least p, the strategy can proceed as follows: in the first step, it chooses the aforementioned action a. In the second step, the play is in some state s0 with probability T (s, a)(s0 ) and the current wealth is greater than Ln (V0 )(s0 , r(s0 )) (by (5)). By induction, the strategy can then switch to a strategy that reaches a rentier configuration in at most n steps with probability at least r(s0 ). Because r ∈ B(s, a, p), it follows that this strategy ensures reaching a rentier configuration from (s, y) in at most n + 1 steps with probability at least p. J We can now finish the proof of Proposition 13. We have ||W − Ln (V0 )||∞ ≤ %1n · ||W − V ||∞ ≤ %1n · (U (M ) − L(M )) (where the first inequality follows from Lemmas 18 and 19).  ))+log ε−1 +2  It follows that for n = log (U (M )−L(M it holds ||W − Ln (V0 )||∞ ≤ ε/4. In log % n particular, x + ε/2 ≥ W(s, Val M (s, x)) + ε/2 > L (V0 )(s, Val M (s, x)). Thus, the strategy σε can be chosen to be the strategy σ from Lemma 20 for p = Val(s, x), n and y = x + ε/2. 0 B.4 Proof of Lemma 15 Lemma 15. Let (s, y) be an arbitrary configuration of M . Then the following holds: 1. For every σ ∈ ΣM there is π ∈ ΣMλ,n such that PπMλ,n ,([s,y]λ ,0) (Hit) ≥ PσM,(s,y) (Ar(0)). 2. There is σ ∈ ΣM such that def PσM,(s,y) (Ar(n · λ · %n )) ≥ sup PπMλ,n ,([s,y]λ ,0) (Hit) = v, π where the supremum is taken over ΣMλ,n . Moreover, the number v and a finite representation of the strategy σ can be computed in time ||Mλ,n ||O(1) . Proof. Again, we remind the reader that we are now restricted to deterministic strategies (because of Proposition 9). For the purpose of this proof, let us define the absorbing vertices of Mλ,n to be all vertices of this MDP that are not of the form (s, D, i) with D bounded interval and i < n − 1. Moreover, we denote by B the set of all histories in which the last 19 20 Solvency Markov Decision Processes with Interest vertex is of the form (t, (U (M, t), ∞), i) while all the previous vertices are non-absorbing. We also denote by C the set of all histories in M that contain exactly one rentier configuration (and thus, their every proper prefix does not contain any such configuration). Note that S S Hit = u∈B Cone(u) and Ar(0) = v∈C Cone(v). In the following we assume that the initial configuration (t0 , x0 ) of all runs in M is equal to (s, y) and that the initial vertex (s0 , D0 , 0) of all runs in Mλ,n is equal to ([s, y]λ , 0). First we describe certain natural correspondence between runs in M and Mλ,n , which will be used throughout the proof. Let X be a set of all histories in Mλ,n that do contain at most one absorbing vertex. For any history X 3 u = (s0 , D0 , 0)a1 · · · ak (sk , Dk , k) in Mλ,n there is exactly one history f (u) = (t0 , x0 )b1 · · · bk (tk , xk ) in M such that, si = ti for all 0 ≤ i ≤ k and ai = bi for all 1 ≤ i ≤ k. Note that f , viewed as a function from X to the histories of M , is injective. On the other hand, for every history v = (t0 , x0 )b1 · · · bk (tk , xk ) in M there is a unique history g(v) = (s0 , D0 , 0)a1 · · · ak (sk , Dk , k) in Mλ,n such that for all 0 ≤ i ≤ k the vertex (si , Di , i) is either absorbing, or si = ti and ai+1 = bi+1 .21 A straightforward induction reveals, that for all 0 ≤ i ≤ k we have wDi ≥ xi (we always round the numbers up to the S nearest multiple of λ). It follows that Hit ⊇ v∈C Cone(g(v)). The function g viewed as a mapping from C to histories in Mλ , n, may not be injective. Below, we use ker g to denote the kernel of g, and [v]g to denote the equivalence class of v in C/ker g. (1.) Fix some strategy σ in M . We define strategy π as follows: for every history u that does not contain an absorbing vertex we set π(u) = σ(f (u)). For other histories (i.e. those that reach an absorbing vertex from which there is no escape), π can choose any action. It is easy to verify that for every history v in M we have X   PσM,(s,y) Cone(u) = PπMλ,n ,[s,y]λ Cone(g(v)) . u∈[v]g It follows that  ! Pπ[s,y]λ (Hit) ≥ Pπ[s,y]λ [ Cone(g(v)) = Pπ[s,y]λ  v∈C = X Pπ[s,y]λ = Pσ(s,y) Cone(g(v)) [v]g ∈C/kerg  Cone(g(v)) = X X Pσ(s,y) Cone(u)  v∈C u∈[v]g [v]g ∈C/kerg X  [  Cone(v) = Pσ(s,y) (Ar(0)), v∈C where the first equality on the second line follows from the fact that Cone(h) and Cone(h0 ) are disjoint events for h 6= h0 when h is not a prefix of h0 and vice versa. (2.) By standard results on MDPs with reachability objectives there is a memoryless ∗ strategy π ∗ such that Pπ[s,y]λ (Hit) = supπ Pπ[s,y]λ (Hit), where the maximum is taken over all strategies. It thus suffices to prove that there is a strategy σ in M satisfying Pσ(s,y) (Ar(n · λ · ∗ %n+1 )) ≥ Pπ[s,y]λ (Hit). Let u = (s0 , D0 , 0)a1 · · · ak (sk , Dk , k), u ∈ B be a history in Mλ,n and let f (u) = (t0 , x0 )b1 · · · bk (tk , xk ) be the corresponding history in M . We prove by induction on i that for every 0 ≤ i < k we have wDk ≤ xk + (i + 1)λ%i . The case i = 0 is trivial, since (s0 , D0 ) = [t, y]λ and (t0 , x0 ) = (t, y), so wD0 − x0 ≤ λ. Suppose now that i > 0 and that 21 The equality of actions is considered only if i 6= k Tomáš Brázdil23 , Taolue Chen, Vojtěch Forejt24 , Petr Novotný, and Aistis Simaitis wDi−1 − xi−1 ≤ iλ%i−1 . wDi − xi ≤ %wDi−1 + F (si−1 , ai−1 ) + λ − xi = %wDi−1 + F (si−1 , ai−1 ) + λ − %xi−1 − F (ti−1 , bi−1 ) = %(wDi−1 − xi−1 ) + λ ≤ iλ%i + λ ≤ (i + 1)λ%i . (6) Here, the first inequality follows from the fact that Di is an interval of length λ containing %wDi−1 + F (si−1 , ai−1 ), the first equality on the third line follows from ti−1 = si−1 and bi−1 = ai−1 , while the next inequality follows from the induction hypothesis. As a consequence, we have xk = %xk−1 + F (tk−1 , bk ) = %xk−1 + F (sk−1 , ak−1 ) ≥ %wDk−1 + F (sk−1 , ak−1 ) − kλ%k+1 ≥ U (M, sk ) − kλ%k , where the first inequality on the second line follows from (6), while the next inequality follows from the fact that the last vertex of history u is of the form (t, (U (M, t), ∞), k). S Thus, Ar(nλ%n ) ⊇ u∈B Cone(f (u)). We now proceed similarly as in (1.). We define strategy σ as follows: for a given history v, if g(v) ∈ X, σ(v) = π ∗ (g(v)), while for the other histories, σ chooses an arbitrary action. Note that this representation of σ can be computed in time polynomial in ||Mλ,n ||, since we can use standard polynomial-time algorithm for MDPs with reachability objectives to compute π ∗ , and g(v) can be computed in time linear in length of v.22 It is easy to  verify, that for every history u ∈ X we have ∗ PπMλ,n ,[s,y]λ (Runs(u)) = PσM,(s,y) Runs(f (u)) . Combining the previous observations we get ! Pσ(s,y)  Ar(nλ%n ) ≥ Pσ(s,y) [ Cone(f (u)) u∈B = X = X Pσ(s,y) Cone(f (u))  u∈B π∗ P[s,y] (Cone(u)) λ = ∗ Pπ[s,y]λ (Hit), u∈B where in the last equality on the second line we use the fact that f is injective. B.5 Proof that n · λ · %n ≤ J ε 2 We have log (U (M )−L(M ))+log ε−1 +2 ε3 +1 log % · % 64(U (M ) − L(M ))2 −1 ε3 ≤ · 2log (U (M )−L(M ))+log ε +2 · % 64(U (M ) − L(M ))2 %·ε ε ≤ · 4(U (M ) − L(M )) 2 ε ≤ 2 n · λ · %n ≤ where the last inequality holds because we assumed that log % < log(U (M ) − L(M )) + log(ε−1 ) + 2. 22 It can be actually computed online as new configurations are visited during the play. 21 22 Solvency Markov Decision Processes with Interest B.6 Complexity Analysis for Theorem 11 Here we conclude the proof of Theorem 11. From the previous observations we have that the complexity is ||Mλ,n ||O(1) , which can be rewritten as |S| · |A| · log p−1 min  ·n·λ  −1 O(1)  = |S| · |A| · log p−1 min  U (M ) − L(M ) · ε · log % O(1) . Noting that U (M )−L(M ) ≤ 2rmax /(%−1) and 1/ log % ≤ (1+1/(%−1)), we conclude that the complexity is indeed polynomial in |S| · |A| · log p−1 min and exponential in log(|rmax |/(% − 1)) and log(1/ε). B.7 Proof of Theorem 16 Theorem 16. The problem of deciding whether W(s, p) ≤ x for a given x is NP-hard. Furthermore, existence of any of the following algorithms is not possible unless P=NP: 1. An algorithm approximating W(s, p) up to the absolute error δ in time polynomial in  |S| · |A| · log p−1 and log(|r |/(% − 1)) and exponential in log(1/δ). max min 2. An algorithm approximating W(s, p) up to the absolute error δ in time polynomial in  |S| · |A| · log p−1 and log(1/δ) and exponential in log(|rmax |/(% − 1)). min Above, the numbers rmax and pmin are as in Theorem 11. Proof. We begin with part (1.), the second part is very similar. We give the proof by reduction from the Knapsack problem. Let us have an instance of a Knapsack problem with items 1, . . . , n (we assume n ≥ 2), where the weight and value of the ith item is wi and vi , respectively, and where the bound on the weight and value of the items to be put in the P P knapsack are W and V , respectively. We denote wtot = 1≤i≤n wi and vtot = 1≤i≤n vi . Without loss of generality we assume that: all the numbers vi , wi are nonzero, and that the item weights are integers (this restriction of Knapsack is still NP-hard); and that vtot < 1/n2 (otherwise we can transform the instance by dividing all the numbers vi and number V by vtot · n2 , without influencing the existence of a solution). We show how to compute, in time polynomial in the encoding size of the Knapsack instance, a solvency MDP M = (S, A, T, F, %) with an interest rate % = 1 + 4n1 2 , and a number p such that there is a solution to the instance of Knapsack if and only if W(s1 , p) = 0 (for some distinguished state s1 of M ). The interest rate % is chosen in such a way that the 2n inequality %4 ≤ 12 holds. − + − First, we put S = {si , s+ i , si | 1 ≤ i ≤ n} ∪ {sn+1 , t1 , t2 , t3 } and A = {ai , ai | 1 ≤ i ≤ n} ∪ {b}. Next, we set α = 1/n2 and define the transitions as follows: + T (si , a+ i ) = [si 7→ 1], for all 1 ≤ i ≤ n; − T (si , ai ) = [s− i 7→ 1], for all 1 ≤ i ≤ n; vi α−vi α T (s+ , b) = [t 1 7→ 1−(i−1)α , t2 7→ 1−(i−1)α , si+1 7→ 1 − 1−(i−1)α ] for all 1 ≤ i ≤ n (note i that this indeed defines a probability distribution, since vtot ≤ α < 1 − nα); α α T (s− i , b) = [t3 7→ 1−(i−1)α , si+1 7→ 1 − 1−(i−1)α ] for all 1 ≤ i ≤ n; T (t1 , b) = [t1 7→ 1], M (t2 , b) = [t2 7→ 1], and M (t3 , b) = [t3 7→ 1]; T (sn+1 , b) = [sn+1 7→ 1]. The rewards are defined in the following way: −2(n−i) F (s− , for all 1 ≤ i ≤ n; i , b) = wi · % F (t1 , b) = 1, F (t2 , b) = F (t3 , b) = −2(wtot + 1); Tomáš Brázdil25 , Taolue Chen, Vojtěch Forejt26 , Petr Novotný, and Aistis Simaitis 1 a1− , s− 1 b, 2%−2 0 1 4 1 3 4 s1 a1+ , 0 1 s+ 1 b, 0 1 3 t3 a2− , 3 16 b, 3 1 0 2 3 s2 a2+ , 0 3 4 1 16 s− 2 1 t1 t2 s+ 2 b, 0 s3 b, − 18 2 3 1 6 1 6 Figure 1 Solvency MDP M constructed for a simple Knapsack instance with items 1, 2 such that w1 = 2, w2 = 3, v1 = 1/16, v2 = 1/8, W = 3 and V = 1/8. We have % = 1 + 1/16 and p = 7/8. To achieve greater compactness the picture omits loops under action b on states t1 , t2 and t3 . Action b is rewarded with −12 in states t2 and t3 . F (sn+1 , b) = −(wtot − W )/4n2 . This ensures that U (M, sn+1 ) = wtot − W , so a run that visits sn+1 is winning if and only if the current wealth upon entering sn+1 is at least wtot − W . All other rewards are zero. Figure 1 illustrates the construction on a simple example. Finally, we set p = 1 + V − 1/n. Clearly, the MDP M and number p can be computed in polynomial time. Note that p > 1 would imply V > vtot , so in this case the Knapsack does not admit a solution. Thus, we assume that p ∈ [0, 1]. Under any strategy the state si+1 is reached with probability (1 − iα). This can be shown by induction on i, since (1 − iα)(1 − α ) 1 − iα = = α iα2 α + iα − i2 α2 − iα2 − iα + =1− 1 − iα 1 − iα 1 − iα (i + 1)α(1 − iα) 1− = 1 − (i + 1)α 1 − iα 1− Hence we get that the state sn+1 is reached with probability (1 − 1/n). Further, the probability that a run contains both si and t1 is vi if the strategy picks a+ i in the state si , and 0 otherwise. So let us choose any (deterministic ) strategy σ and an arbitrary initial configuration (s1 , x) with x ∈ [0, 1/4]. Obviously, we interpret the choice of action a+ i by σ + in si as choosing the item i to be packed into the knapsack. Denote Iσ ⊆ {1, . . . , n} the set of all indexes i such that σ chooses action a+ i in si (i.e. the set of items chosen to be packed into the knapsack). A straightforward induction on i reveals that conditional on reaching the state si , the current wealth upon reaching this state is X wj · %−2(n−i+1) + %2(i−1) · x. + j∈{1,...,n}\Iσ j<i This has two consequences. First, until the run reaches one of the states t1 , t2 or sn+1 the current wealth is always bounded by 0 from below and by wtot + 1 from above. Thus, a run starting in (s1 , x) is winning if it reaches t1 and losing if it reaches t2 or t3 . Second, if the 23 24 Solvency Markov Decision Processes with Interest run reaches the state sn+1 (this happens with probability (1 − 1/n)), then the current wealth upon reaching this state is equal to X wi + %2n · x. (7) + i∈{1,...,n}\Iσ Thus, under σ the conditional probability of winning on condition that the play reaches sn+1 is 1 if and only if the items in {1, . . . , n} \ Iσ+ have total weight at least wtot − W − %2n · x, or in other words, if the items in Iσ+ have total weight at most W + %2n · x ≤ W + 1/2. Otherwise, this conditional probability is 0. Since we assume that the item weights are integers, the aforementioned probability is 1 iff the items contained in Iσ+ have total weight at most W . We claim that for any strategy σ the set Iσ+ is a solution of the original instance of Knapsack (i.e. set of items selected for inclusion into the knapsack, which satisfies the usual constraints on weight and value) if and only if Pσ(s1 ,x) (Win) ≥ p. First suppose that Iσ+ is a solution to the Knapsack instance. Since the total weight of items in Iσ+ is at most W , from (7) it follows that under σ, once the play reaches sn+1 (this happens with probability 1 − 1/n) the current wealth is at least wtot − W = U (M, sn+1 ), so conditional on reaching sn+1 the probability of winning is 1. Moreover, we know that every run that reaches t1 is winning as well. We know that this happens with probability P + vi ≥ V . We conclude that by using strategy σ we win from (s1 , x) with probability at i∈Iσ least 1 − 1/n + V = p. On the other hand, if Iσ+ is not a solution of the original instance, there are two cases P to consider. Either i∈{1,...,n}\Iσ+ wi < wtot − W , in which case the probability of winning under σ is at most vtot , because the conditional probability of winning upon reaching sn+1 P is 0, and the only other way to win is to reach t1 . Or i∈Iσ+ vi < V , in which case the probability of winning is strictly smaller than 1 − 1/n + V (probability of reaching sn+1 , where the conditional probability of winning can be 1, plus the probability of visiting t1 P which is i∈Iσ+ vi < V ). In either case, the probability of winning is less than p. It follows that the instance of Knapsack admits a solution if and only if there is σ such that Pσ(s1 ,x) (Win) ≥ p, or in other words, iff Val M (s1 , x) ≥ p for every x ∈ [0, 1/4]. To recognize whether this is the case, it suffices to approximate the value W(s1 , p) up to the absolute error δ = 1/8. Furthermore, for the constructed MDP M we have log(|rmax |/(% − 1)) = log(poly(wtot · n2 )) for some polynomial poly. Thus, the existence of an algorithm −1 approximating W(s1 , p) in time polynomial in |S| · |A| · log p−1 min · log(|rmax |/(% − 1)) · δ would imply the existence of an polynomial-time algorithm for Knapsack. (2.) For the second part of the theorem, the proof is almost the same, we divide all the rewards in M by some sufficiently large number, forcing rmax to be polynomial in the encoding size of the Knapsack instance. We then show that in order to decide whether W(s, p) ≤ 0 (and thus, whether the instance admits a solution), it suffices to approximate W(s, p) up to the absolute error O(1/wtot ), where wtot is the sum of weights over all items in the instance. Formally, the only difference is in the gain function F of the constructed MDP M . We put −2(n−i) /wtot , for all 1 ≤ i ≤ n; F (s− i , b) = wi · % F (t1 , b) = 1, F (t2 , b) = F (t3 , b) = −2; F (sn+1 , b) = −4(1 − W/wtot ) · n2 . This ensures that a run that hits sn+1 is winning if and only if the current wealth upon entering sn+1 is at least 1 − W/wtot . Other rewards are zero. Tomáš Brázdil27 , Taolue Chen, Vojtěch Forejt28 , Petr Novotný, and Aistis Simaitis It is again easy to verify that the states t1 and t2 are always winning and losing, respectively, and that for a given strategy σ the current wealth upon entering sn+1 is equal to P 2n + wi /wtot + % · x, where x is the initial wealth. Now let x be any number from i∈{1,...,n}\Iσ the interval [0, 1/(4wtot )] and σ be any strategy. Then the conditional probability of winning P on condition that sn+1 is reached is 1 iff i∈{1,...,n}\Iσ+ wi /wtot + %2n · x ≥ (wtot − W )/wtot , and 0 otherwise. Since %2n · x ≤ 1/(2wtot ), this conditional probability is 1 if and only if P + + wi /wtot ≥ (wtot − W − 1/2)/wtot , i.e. iff I σ contains items of weight at most i∈{1,...,n}\Iσ W (since the item weights are integers). Now we can argue in exactly the same way as in σ the previous part, that I+ is a solution to the Knapsack instance iff σ ensures winning with probability at least p = 1 − 1/n + V from (s1 , x). It follows that the Knapsack instance has a solution if and only if it is possible to win with probability at least p from s1 with any initial wealth between 0 and 1/(4wtot ). To check whether this is the case it suffices to approximate W(s1 , p) up to the absolute error δ = 1/(8wtot ). The constructed MDP M has log(|rmax |/(% − 1)) = log(poly(n)) for some polynomial poly (since rmax ≤ 4n2 ). Thus, an −1 approximation algorithm running in time polynomial in |S| · |A| · log p−1 ) and min · log(δ exponential in log(|rmax |/(% − 1)) would yield a polynomial-time algorithm for knapsack. J 25
5cs.CE
The Event-Camera Dataset and Simulator: Event-based Data for Pose Estimation, Visual Odometry, and SLAM c The Author(s) 2016 arXiv:1610.08336v4 [cs.RO] 8 Nov 2017 Elias Mueggler1 , Henri Rebecq1 , Guillermo Gallego1 , Tobi Delbruck2 and Davide Scaramuzza1 Abstract New vision sensors, such as the Dynamic and Active-pixel Vision sensor (DAVIS), incorporate a conventional globalshutter camera and an event-based sensor in the same pixel array. These sensors have great potential for high-speed robotics and computer vision because they allow us to combine the benefits of conventional cameras with those of event-based sensors: low latency, high temporal resolution, and very high dynamic range. However, new algorithms are required to exploit the sensor characteristics and cope with its unconventional output, which consists of a stream of asynchronous brightness changes (called “events”) and synchronous grayscale frames. For this purpose, we present and release a collection of datasets captured with a DAVIS in a variety of synthetic and real environments, which we hope will motivate research on new algorithms for high-speed and high-dynamic-range robotics and computer-vision applications. In addition to global-shutter intensity images and asynchronous events, we provide inertial measurements and ground-truth camera poses from a motion-capture system. The latter allows comparing the pose accuracy of egomotion estimation algorithms quantitatively. All the data are released both as standard text files and binary files (i.e., rosbag). This paper provides an overview of the available data and describes a simulator that we release open-source to create synthetic event-camera data. Keywords Event-based cameras, visual odometry, SLAM, simulation Dataset Website All datasets and the simulator can be found on the web: http://rpg.ifi.uzh.ch/davis_data.html A video containing visualizations of the datasets: https://youtu.be/bVVBTQ7l36I low-bandwidth, low-storage, and low-power requirements. All these properties enable the design of a new class of algorithms for high-speed and high-dynamic-range robotics, where standard cameras are typically not ideal because of motion blur, image saturation, and high latency. However, the way that event-based cameras convey the information is completely different from that of traditional sensors, so that a paradigm shift is needed to deal with them. Introduction Over the past fifty years, computer-vision research has been devoted to standard, frame-based cameras (i.e., rolling or global shutter cameras) and only in the last few years cameras have been successfully used in commercial autonomous mobile robots, such as cars, drones, and vacuum cleaners, just to mention a few. Despite the recent progress, we believe that the advent of event-based cameras is about to revolutionize the robot sensing landscape. Indeed, the performance of a mobile robot in tasks, such as navigation, depends on the accuracy and latency of perception. The latency depends on the frequency of the sensor data plus the time it takes to process the data. It is typical in current robot-sensing pipelines to have latencies in the order of 50– 200 ms or more, which puts a hard bound on the maximum agility of the platform. An event-based camera virtually eliminates the latency: data is transmitted using events, which have a latency in the order of micro-seconds. Another advantage of event-based cameras is their very high dynamic range (130 dB vs. 60 dB of standard cameras), which makes them ideal in scenes characterized by large illumination changes. Other key properties of event-based cameras are Related Datasets There exist two recent datasets that also use the DAVIS: (Rueckauer and Delbruck 2016) and (Barranco et al. 2016). The first work is tailored for comparison of event-based optical flow estimation algorithms (Rueckauer and Delbruck 2016). It contains both synthetic and real datasets under pure rotational (3 degrees of freedom (DOF)) motion on simple scenes with strong visual contrasts. Ground truth was acquired using the inertial measurement unit (IMU). In 1 Robotics and Perception Group, University of Zurich, Switzerland of Neuroinformatics, University of Zurich and ETH Zurich, Switzerland 2 Institute Corresponding author: Elias Mueggler, Robotics and Perception Group, University of Zurich, Switzerland. E-mail: [email protected] This work was supported by SNSF-ERC Starting Grant, the DARPA FLA Program, by the Google Faculty Research Award, by the Qualcomm Innovation Fellowship, by the National Centre of Competence in Research Robotics (NCCR), by the Swiss National Science Foundation, and by the UZH Forschungskredit (Grant No: K-34142-03-01). 2 (a) The DAVIS sensor and axes definitions. Figure adapted from (Delbruck et al. 2014) (b) Visualization of the event output of a DAVIS in space-time. Blue dots mark individual asynchronous events. The polarity of the events is not shown. Figure 1. The DAVIS camera and visualization of its output. contrast, our datasets contain arbitrary, hand-held, 6-DOF motion in a variety of artificial and natural scenes with precise ground-truth camera poses from a motion-capture system. A more similar work to ours is (Barranco et al. 2016). Their focus is to create a dataset that facilitates comparison of event-based and frame-based methods for 2D and 3D visual navigation tasks. To this end, a ground robot was equipped with a DAVIS and a Microsoft Kinect RGB-D sensor. The DAVIS was mounted on a pan-tilt unit, thus it could be excited in 5-DOF. The scene contains checkerboards, books, and a chair. Ground truth was acquired by the encoders of pan-tilt unit and the ground robot’s wheel odometry, and is therefore subject to drift. In contrast, our dataset contains hand-held, 6-DOF motion (slow- and high-speed) on a variety of scenes with precise ground-truth camera poses from a motion-capture system, which is not subject to drift. The DAVIS Sensor The Dynamic and Active-pixel Vision Sensor (DAVIS) (Brandli et al. 2014) (see Fig. 1a) is an event camera that transmits events in addition to frames. Events are pixel-level, relative-brightness changes that are detected in continuous time by specially-designed pixels∗ . The events are timestamped with micro-second resolution and transmitted asynchronously at the time they occur. Each event e is a tuple hx, y, t, pi, where x, y are the pixel coordinates of the event, t is the timestamp of the event, and p = ±1 is the polarity of the event, which is the sign of the brightness change. This representation is sometimes also referred to as Address-Event Representation (AER). The DAVIS has a spatial resolution of 240 × 180 pixels. A visualization of the event output is shown in Fig. 1b. Both the events and frames are generated by the same physical pixels, hence there is no spatial offset between the events and the frames. Due to its low latency and high temporal resolution, both in the range of micro-seconds, event-based cameras are very promising sensors for high-speed mobile robot applications. Since event cameras are data-driven (only brightness changes are transmitted), no redundant data is transmitted. The required bandwidth thus depends on the motion speed and the type of scene. An additional advantage for robotic applications is the high dynamic range of 130 dB (compared to 60 dB of expensive computer-vision cameras), which allows both indoor and outdoor operation without changing parameters. Since all pixels are independent, very large contrast changes can also take place within the same scene. Over the course of the last seven years, several groups including ours have demonstrated the use of eventbased sensors in a variety of tasks, such as SLAM in 2D (Weikersdorfer et al. 2013) and 3D (Kueng et al. 2016; Kim et al. 2016; Rebecq et al. 2016b), optical flow (Cook et al. 2011; Benosman et al. 2014; Bardow et al. 2016), visual odometry (Censi and Scaramuzza 2014), 6-DOF localization for high-speed robotics (Mueggler et al. 2014), line detection and localization (Yuan and Ramalingam 2016), 3D reconstruction (Rebecq et al. 2016a), image reconstruction and mosaicing (Kim et al. 2014; Reinbacher et al. 2016), orientation estimation (Gallego and Scaramuzza 2016), and continuous-time trajectory estimation (Mueggler et al. 2015). However, all these methods were evaluated on different, specific datasets and, therefore, cannot be compared against each other. The datasets we propose here are tailored to allow comparison of pose tracking, visual odometry, and SLAM algorithms. Since event-based cameras, such as the DAVIS, are currently still expensive (∼ 5, 000 USD), these data also allow researchers without equipment to use well-calibrated data for their research. DAVIS IMU In addition to the visual output (events and frames), the DAVIS includes an IMU that provides gyroscope and accelerometer data, thus enabling to design visual-inertial event-based algorithms. The DAVIS camera has the IMU mounted directly behind and centered under the image sensor pixel array center, at a distance of about 3 mm from it, so that the IMU shares nearly the same position as the event sensor (i.e., the photoreceptor, not the optical center of the camera, since this is lens dependent; the camera-IMU calibration is discussed on page 7). The IMU axes are aligned with the visual sensor axes (see Fig. 1a). More specifically, the IMU ∗ Video illustration: https://youtu.be/LauQ6LWTkxM The Event-Camera Dataset and Simulator log Iu (t) 3 between two samples if the corresponding intensity jump is larger than the contrast threshold. The provided events are “perfect” measurements up to sampling and quantization; under this condition, an image ˆ t) can be reconstructed from the event stream at any I(u; point in time t by accumulating events ek = huk , tk , pk i according to X ˆ t) = log I(u; 0) + log I(u; pk C δ(u − uk )δ(t − tk ), Samples of log Iu Actual Events Predicted Events C 0<tk ≤t t Figure 2. DAVIS Simulator. Per-pixel event generation using piecewise linear time interpolation of the intensities given by the rendered images. For simplicity, images were rendered at a fixed rate. is an InvenSense MPU-6150† , which integrates a three-axis gyroscope that can measure in the range ±2,000 ◦ /s and a three-axis accelerometer for the range ±16g. It integrates six 16-bit ADCs for digitizing the gyroscope and accelerometer outputs at 1 kHz sample rate. DAVIS Simulator Simulation offers a good baseline when working with new sensors, such as the DAVIS. Based on the operation principle of an ideal DAVIS pixel, we created a simulator that, given a virtual 3D scene and the trajectory of a moving DAVIS within it, generates the corresponding stream of events, intensity frames, and depth maps. We used the computer graphics software Blender‡ to generate thousands of rendered images along the specified trajectory, ensuring that the motion between consecutive images was smaller than 1/3 pixel. For each pixel, we keep track of the time of the last event triggered at that location. This map of timestamps (also called surface of active events (Benosman et al. 2014)), combined with time interpolation of the rendered image intensities, allows determining brightness changes of predefined amount (given by the contrast threshold) in the time between images, thus effectively providing continuous timestamps, as if events were generated asynchronously. Time interpolation has an additional benefit: it solves the problem of having to generate millions of images for each second of a sequence, as it would have been required to deliver microsecond-resolution timestamps in the absence of interpolation. More specifically, Fig. 2 illustrates the operation of the simulator for a single pixel u = (x, y)> . The continuous intensity signal at pixel u, log Iu (t) (black) is sampled at the times of the rendered images (blue markers). These samples are used to determine the times of the events: the data is linearly interpolated between consecutive samples and the crossings of the resulting lines (in red) with the levels given by multiples of the contrast threshold C (i.e., horizontal lines) specify the timestamps of the events (red dots). As it can be observed, this simple interpolation scheme allows for (i) higher resolution event time stamps than those of the rendered images, and (ii) the generation of multiple events where I(u; 0) is the rendered image at time t = 0 and δ selects the pixel to be updated on every event (pixel uk of Iˆ is updated at time tk ). We used this scheme to check that the reconstructed image agreed with the rendered image at several points in time; specifically, the per-pixel intensity error was confined to the quantization interval (−C, C). Event generation operates on brightness pixels, which are computed from the rendered color images using the ITU-R Recommendation BT.601§ for luma, i.e., according to formula Y = 0.299R + 0.587G + 0.114B, with RGB channels in linear color space to better resemble the operation of the DAVIS. Because realistic event noise is extremely difficult to model due to the complex behavior of event sensors with respect to their bias settings and other factors, the provided simulation datasets do not include event noise. Nevertheless, the simulator, and the datasets created with it, are a useful tool for prototyping new event-based algorithms. Our implementation is available as open-source software.¶ Datasets In this section, we describe the datasets that we provide. The datasets contain: • the asynchronous event stream, • intensity images at about 24 Hz, • inertial measurements (3-axis gyroscope and 3-axis accelerometer) at 1 kHz, • ground-truth camera poses from a motion-capture systemk with sub-millimeter precision at 200 Hz (for the indoor datasets), • the intrinsic camera matrix. All information comes with precise timestamps. For datasets that were captured outside the motion-capture system (e.g., in an office or outdoors), no ground truth is provided. Some datasets were collected using a motorized linear slider and ground truth was collected using the slider’s position. Due to vibrations induced by the slider motor, the very noisy IMU data was not recorded. Data Format The datasets are provided in standard text form that is described here. For convenience, they can also be † IMU data sheet: https://store.invensense.com/ProductDetail/MPU6150invensense/470090/ ‡ https://www.blender.org/ § https://www.itu.int/rec/R-REC-BT.601 ¶ https://github.com/uzh-rpg/rpg davis simulator k We use an OptiTrack system from NaturalPoint. 4 (a) Shapes (b) Wall Poster (c) Boxes (d) Outdoors (e) Dynamic (f) Calibration (g) Office (h) Urban (i) Motorized linear slider (j) Motorized slider (HDR) (k) Motorized slider with objects (l) Synthetic: 3 planes (m) Synthetic: 3 walls Figure 3. Dataset scenes The Event-Camera Dataset and Simulator File events.txt images.txt images/00000000.png imu.txt groundtruth.txt calib.txt 5 Description One event per line One image reference per line Images referenced from images.txt One measurement per line One ground-truth measurement per line Camera parameters Line Content timestamp x y polarity timestamp filename timestamp ax ay az gx gy gz timestamp px py pz qx qy qz qw fx fy cx cy k1 k2 p1 p2 k3 Table 1. Description of Dataset Format downloaded as binary rosbag files (the details are on the website). The format of the text files is described in Table 1. The ground-truth pose is with respect to the (arbitrary) motion-capture origin that has the z-axis gravity-aligned (pointing upwards). The orientation is provided as a unit quaternion q = (qx , qy , qz , qw )> , where qw and qv = (qx , qy , qz )> are the scalar and vector components, respectively. This convention was proposed as a standard by JPL (Breckenridge 1979). All values are reported in SI units. While the timestamps were originally recorded as POSIX, we subtracted the lowest timestamp as offset such that all datasets start at zero. This helps to avoid numerical difficulties when dealing with microsecond resolution timestamps of the events. Images are provided as PNG files. The list of all images and their timestamps is provided in a separate file. The typical framerate is 24 Hz, but it varies with the exposure time. The IMU axes have the same orientation as those of the optical coordinate frame (i.e., the positive z-axis is aligned with the optical axis and so are the x- and y-axes). List of Datasets The provided datasets are summarized in Table 2 and Fig. 3. All the datasets contain increasing speeds, different scenes, and varying degrees of freedom∗∗ : for the shapes, poster, and boxes datasets, the motion first starts with excitation of each single degree of freedom separately; then combined and faster excitations are performed. This leads to increasing difficulty and a higher event rate over time. In the high-dynamic-range (HDR) sequences (hdr poster, hdr boxes, and slider hdr), a spotlight was used to create large intrascene contrasts. For hdr poster, we measured 80 lx and 2,400 lx in the dark and bright areas, respectively. The outdoors datasets were acquired in an urban environment both walking and running. While no ground truth is available, we returned precisely to the same location after a large loop. The dynamic datasets were collected in a mock-up office environment viewed by the motion-capture system, with a moving person first sitting at a desk, then moving around. A calibration dataset is also available, for instance in case the user wishes to use a different camera model or different methods for hand-eye calibration. The dimensions of the calibration pattern (a checkerboard) are 6 × 7 tiles of 70 mm. For the lower half of the table, different settings (lenses, focus, etc.) were used. Thus, while we provide the intrinsic calibration, no calibration datasets are available. The slider close, slider far, slider hdr close, and slider hdr far datasets Hj Ai = THk Hj A0k = TW Hk Hk X = THE X = THE Ej A0j Ek = TW Hj Bi = TEk Ej W Z = TW C B0k = TCEk B0j = TCEj C Standard notation: T21 notation: Ai X = XBi A0j X = ZB0j THk Hj THE = THE TEk Ej TW Hj THE = TW C TCEj Figure 4. Hand-eye calibration. Coordinate frames and transformations involved in case of the hand-eye device at two different positions (j and k ). The red loop between two stations of the hand-eye device is used in the first type of hand-eye calibration problems, of the form Ai X = XBi , and the blue loop is used in the second type of hand-eye calibration problems, of the form A0j X = ZB0j . We use a combination of both approaches to solve for the constant, hand-eye calibration transform X. were recorded with a motorized linear slider parallel to a textured wall at 23.1 cm, 58.4 cm, 23.2 cm, and 58.4 cm, respectively. For the datasets, we applied two different sets of biases (parameters) for the DAVIS, as listed in Table 3. The first set, labeled “indoors”, was used in all datasets but outdoors walking, outdoors running, and urban, where the set “outdoors” was applied. For the simulated datasets, we used a contrast threshold of ±15 % and ±20 % for the simulation 3planes and simulation 3walls, respectively. For the simulated scenes, we also provide the 3D world model in Blender (cf. Fig. 3l and 3m). In addition to the intensity images and events, these datasets include a depth map for each image frame at 40 Hz, encoded as 32-bit floating-point values (in the OpenEXR data format). Calibration First, we calibrated the DAVIS intrinsically using a checkerboard pattern. Then, we computed the hand-eye calibration that we applied to the subsequent dataset recordings so that the ground-truth poses that we provide are those of the event camera (i.e., the “eye”), not those of ∗∗ The DAVIS was moved by hand, the dominant motion is described. 6 Name shapes rotation shapes translation shapes 6dof poster rotation poster translation poster 6dof boxes rotation boxes translation boxes 6dof hdr poster hdr boxes outdoors walking outdoors running dynamic rotation dynamic translation dynamic 6dof calibration office zigzag office spiral urban slider close slider far slider hdr close slider hdr far slider depth simulation 3planes simulation 3walls Motion Rotation, incr. speed Translation, incr. speed 6 DOF, incr. speed Rotation, incr. speed Translation, incr. speed 6 DOF, incr. speed Rotation, incr. speed Translation, incr. speed 6 DOF, incr. speed 6 DOF, incr. speed 6 DOF, incr. speed 6 DOF, walking 6 DOF, running Rotation, incr. speed Translation, incr. speed 6 DOF, incr. speed 6 DOF, slow 6-DOF, zigzag, slow 6-DOF, spiral, slow Linear, slow Linear, const, speed Linear, const, speed Linear, const. speed Linear, const. speed Linear, const. speed Translation, circle 6 DOF Scene Fig. 3a Fig. 3a Fig. 3a Fig. 3b Fig. 3b Fig. 3b Fig. 3c Fig. 3c Fig. 3c Fig. 3b Fig. 3c Fig. 3d Fig. 3d Fig. 3e Fig. 3e Fig. 3e Fig. 3f Fig. 3g Fig. 3g Fig. 3h Fig. 3i Fig. 3i Fig. 3j Fig. 3j Fig. 3k Fig. 3l Fig. 3m GT yes yes yes yes yes yes yes yes yes yes yes no† no† yes yes yes yes no no no yes* yes* yes* yes* yes* yes# yes# T [s] 59.8 59.7 59.7 59.8 59.8 59.8 59.8 59.8 59.8 59.8 59.8 133.4 87.6 59.8 59.8 59.7 59.8 10.9 11.2 10.7 6.5 6.4 6.5 6.5 3.4 2.0 2.0 TS [m/s] 0.83 2.60 2.35 0.84 2.58 2.51 0.85 3.43 3.84 2.28 2.94 n/a n/a 0.45 1.86 2.91 0.32 n/a n/a n/a 0.16 0.16 0.16 0.16 0.32 0.63 5.31 RS [◦ /s] 730 271 715 884 240 937 669 319 509 597 592 n/a n/a 542 227 627 67 n/a n/a n/a 0 0 0 0 0 0 109 NE [-] 23,126,288 17,363,976 17,962,477 169,350,136 100,033,286 133,464,530 185,688,947 112,388,307 133,085,511 102,910,720 118,499,744 64,517,638 98,572,164 71,324,510 35,809,924 57,174,637 21,340,629 7,735,308 6,254,774 5,359,539 4,032,668 3,442,683 3,337,787 2,509,582 1,078,541 6,870,278 4,104,833 Table 2. List of Datasets. Note that the calibration dataset only applies to the upper half of the table. The other datasets use different lenses and calibrations. GT: Ground truth. T: Duration. TS: Maximum translation speed. RS: Maximum rotational speed. NE: Number of events. † Same start and end pose after a large loop. * Ground truth from motorized linear slider. No IMU data due to vibrations. # Simulated DAVIS using Blender. No IMU data included. Bias DiffBn OFFBn ONBn PrBp PrSFBp RefrBp Indoors Coarse Fine 2 39 1 62 4 200 3 72 3 96 3 52 Outdoors Coarse Fine 4 39 4 0 6 200 2 58 1 33 4 25 Table 3. List of biases applied to the DAVIS. The DAVIS uses two stages of biases, coarse and fine, which we report here. the motion-capture trackable (i.e., the “hand”) attached to the camera. We also included a calibration dataset in case a different camera model or improved hand-eye calibration method is required. Intrinsic Camera Calibration We used the standard pinhole camera model with radialtangential distortion using the implementation of ROS and OpenCV†† . We used three radial distortion coefficients (k1 , k2 , and k3 = 0) and two for tangential distortion (p1 and p2 ). The distortion coefficients are listed in calib.txt in the same order as in OpenCV. We provide a dataset for postcalibration in case that another method is preferred. Hand-Eye Calibration For the indoor datasets, we provide accurate and highfrequency (200 Hz) pose data from a motion-capture system. However, the coordinate frame used by the motion-capture system is different from the optical coordinate frame of the DAVIS. Thus, we performed a hand-eye calibration before acquiring the datasets. Fig. 4 shows the coordinate frames and transformations used to solve the hand-eye calibration problem. The frames are those of the world W , the hand H, the camera E (Fig. 1a), and the checkerboard C. For the transformations, Fig. 4 shows both the compact standard notation of hand-eye calibration problems and a more explicit one: the Euclidean transformation Tba (4 × 4 homogeneous matrix representation) maps points from frame a to frame b according to Pb = Tba Pa . More specifically, we first use a linear algorithm (Tsai and Lenz 1989) to provide an initial solution of the handeye calibration problem {Ai X = XBi }N i=1 , where Ai ↔ Bi are N correspondences of relative hand-hand (Ai := THk Hj ) and eye-eye (Bi := TEk Ej ) poses at different times (j and k), respectively, and X := THE is the unknown eye-to-hand transformation. Then, using the second formulation of hand+1 eye calibration problems, of the form {A0j X = ZB0j }N j=1 , †† http://wiki.ros.org/camera_calibration/ Tutorials/MonocularCalibration The Event-Camera Dataset and Simulator where A0j := TW Hj and B0j := TCEj are the hand-to-motioncapture and eye-to-checkerboard transformations for the j-th pose, respectively, we refined THE by jointly estimating the hand-eye X and robot-world Z := TW C (i.e., motioncapture–checkerboard) transformations that minimize the reprojection error in the image plane: X  min d2 xmn , x̂mn (X, Z; A0m , Pn , K) , X,Z mn 2 where d (xmn , x̂mn ) is the squared Euclidean distance between the measured projection xmn of the n-th checkerboard corner Pn on the m-th camera and the predicted corner x̂mn = f (B̂0m ; Pn , K), which is a function of the intrinsic camera parameters K and the extrinsic parameters B̂0m := Z−1 A0m X predicted using the motioncapture data. This non-linear least-squares problem is solved iteratively using the Gauss-Newton method. The initial value of Z is given by Z = A01 XB0−1 1 , with X provided by the abovementioned linear algorithm. We included a dataset for postcalibration in case another method is preferred. The ground-truth pose gives the position and orientation of the event camera with respect to the world (i.e., the motioncapture system). Hence, it already incorporates the computed hand-eye transformation. That is, while the motion-capture system outputs TW Hj , we apply the hand-eye calibration THE ≡ THj Ej ∀j and directly report TW Ej = TW Hj THj Ej as ground-truth pose. Camera-IMU Calibration The calibration dataset can be used to compute the Euclidean transformation between the camera and IMU reference frames. Running the publicly available software Kalibr (Furgale et al. 2013) on the calibration dataset provides such a transformation, from the camera (i.e., the “eye” E) to the IMU, given by   0.9999 −0.0122 0.0063 0.0067  0.0121 0.9998 0.0093 0.0007  TIMU,E ≈  −0.0064 −0.0092 0.9999 0.0342 , 0 0 0 1 that is, the rotation matrix is approximately the identity (i.e., camera and IMU axes have the same orientation) and the translation is dominantly along the optical axis ≈3.42 cm (the IMU is a couple of cm behind the camera’s optical center for the used lens). Additionally, due to the IMU’s built-in low-pass filter, the IMU measurements lag ≈2.4 ms behind the images (and the events). This temporal shift is also reported by Kalibr. Known Issues Clock Drift and Offset The clocks from motion-capture system and the DAVIS are not hardware-synchronized. We observed clock drift of about 2 ms/min. To counteract the clock drift, we reset the clocks before each dataset recording. Since all datasets are rather short (in the order of 1 min), the effect of drift is negligible. A small, dataset-dependent offset between the DAVIS and motion-capture timestamps is present since the timestamps were reset in software. 7 References Bardow P, Davison AJ and Leutenegger S (2016) Simultaneous Optical Flow and Intensity Estimation From an Event Camera. In: IEEE Int. Conf. Computer Vision and Pattern Recognition (CVPR). Barranco F, Fermuller C, Aloimonos Y and Delbruck T (2016) A Dataset for Visual Navigation with Neuromorphic Methods. Frontiers in Neuroscience 10(49). Benosman R, Clercq C, Lagorce X, Ieng SH and Bartolozzi C (2014) Event-Based Visual Flow. IEEE Trans. Neural Netw. Learn. Syst. 25(2): 407–417. Brandli C, Berner R, Yang M, Liu SC and Delbruck T (2014) A 240x180 130dB 3us Latency Global Shutter Spatiotemporal Vision Sensor. IEEE J. of Solid-State Circuits 49(10): 2333– 2341. Breckenridge WG (1979) Quaternions proposed standard conventions. Technical report, NASA Jet Propulsion Laboratory. Censi A and Scaramuzza D (2014) Low-Latency Event-Based Visual Odometry. In: IEEE Int. Conf. on Robotics and Automation (ICRA). Cook M, Gugelmann L, Jug F, Krautz C and Steger A (2011) Interacting Maps for Fast Visual Interpretation. In: Int. Joint Conf. on Neural Networks (IJCNN). pp. 770–776. Delbruck T, Villanueva V and Longinotti L (2014) Integration of Dynamic Vision Sensor with Inertial Measurement Unit for Electronically Stabilized Event-Based Vision. In: Int. Conf. on Circuits and Systems (ISCAS). pp. 2636–2639. Furgale P, Rehder J and Siegwart R (2013) Unified temporal and spatial calibration for multi-sensor systems. In: IEEE/RSJ Int. Conf. on Intelligent Robots and Systems (IROS). Gallego G and Scaramuzza D (2016) Accurate Angular Velocity Estimation with an Event Camera. IEEE Robotics and Automation Letters . Kim H, Handa A, Benosman R, Ieng SH and Davison AJ (2014) Simultaneous Mosaicing and Tracking with an Event Camera. In: British Machine Vision Conf. (BMVC). Kim H, Leutenegger S and Davison A (2016) Real-Time 3D Reconstruction and 6-DoF Tracking with an Event Camera. In: Eur. Conf. on Computer Vision (ECCV). Kueng B, Mueggler E, Gallego G and Scaramuzza D (2016) LowLatency Visual Odometry using Event-based Feature Tracks. In: IEEE/RSJ Int. Conf. on Intelligent Robots and Systems (IROS). Mueggler E, Gallego G and Scaramuzza D (2015) ContinuousTime Trajectory Estimation for Event-based Vision Sensors. In: Robotics: Science and Systems (RSS). Mueggler E, Huber B and Scaramuzza D (2014) Event-based, 6DOF Pose Tracking for High-Speed Maneuvers. In: IEEE/RSJ Int. Conf. on Intelligent Robots and Systems (IROS). Rebecq H, Gallego G and Scaramuzza D (2016a) EMVS: Eventbased Multi-View Stereo. In: British Machine Vision Conf. (BMVC). Rebecq H, Horstschäfer T, Gallego G and Scaramuzza D (2016b) EVO: A Geometric Approach to Event-based 6-DOF Parallel Tracking and Mapping in Real-Time. IEEE Robotics and Automation Letters . 8 Reinbacher C, Graber G and Pock T (2016) Real-Time IntensityImage Reconstruction for Event Cameras Using Manifold Regularisation. In: British Machine Vision Conf. (BMVC). Rueckauer B and Delbruck T (2016) Evaluation of Event-Based Algorithms for Optical Flow with Ground-Truth from Inertial Measurement Sensor. Frontiers in Neuroscience 10(176). Tsai RY and Lenz RK (1989) A New Technique for Fully Autonomous and Efficient 3D Robotics Hand/Eye Calibration. IEEE Trans. Robotics 5(3): 345–358. Weikersdorfer D, Hoffmann R and Conradt J (2013) Simultaneous Localization and Mapping for event-based Vision Systems. In: Int. Conf. on Computer Vision Systems (ICVS). Yuan W and Ramalingam S (2016) Fast Localization and Tracking using Event Sensors. In: IEEE Int. Conf. on Robotics and Automation (ICRA).
1cs.CV
Deep Health Care Text Classification Vinayakumar R, Barathi Ganesh HB, Anand Kumar M, Soman KP Center for Computational Engineering and Networking (CEN), Amrita School of Engineering Coimbatore, Amrita Vishwa Vidyapeetham, Amrita University, India, [email protected],[email protected], m [email protected], kp [email protected] arXiv:1710.08396v1 [cs.CL] 23 Oct 2017 Abstract Health related social media mining is a valuable apparatus for the early recognition of the diverse antagonistic medicinal conditions. Mostly, the existing methods are based on machine learning with knowledge-based learning. This working note presents the Recurrent neural network (RNN) and Long short-term memory (LSTM) based embedding for automatic health text classification in the social media mining. For each task, two systems are built and that classify the tweet at the tweet level. RNN and LSTM are used for extracting features and non-linear activation function at the last layer facilitates to distinguish the tweets of different categories. The experiments are conducted on 2nd Social Media Mining for Health Applications Shared Task at AMIA 2017. The experiment results are considerable; however the proposed method is appropriate for the health text classification. This is primarily due to the reason that, it doesn’t rely on any feature engineering mechanisms. Introduction With the expansion of micro blogging platforms such as Twitter, the Internet is progressively being utilized to spread health information instead of similarly as a wellspring of data1, 2 . Twitter allows users to share their status messages typically called as tweets, restricted to 140 characters. Most of the time, these tweets expresses the opinions about the topics. Thus analysis of tweets has been considered as a significant task in many of the applications, here for health related applications. Health text classification is taken into account a special case of text classification. The existing methods have used machine learning methods with feature engineering. Most commonly used features are n-grams, parts-of-speech tags, term frequency-inverse document frequency, semantic features such as mentions of chemical substance and disease, WordNet synsets, adverse drug reaction lexicon, etc3–6, 16 . In6, 7 proposed ensemble based approach for classifying the adverse drug reactions tweets. Recently, the deep learning methods have performed well8 and used in many tasks mainly due to that it doesn’t rely on any feature engineering mechanism. However, the performance of deep learning methods implicitly relies on the large amount of raw data sets. To make use of unlabeled data,9 proposed semi-supervised approach based on Convolutional neural network for adverse drug event detection. Though the data sets of task 1 and task 2 are limited, this paper proposes RNN and LSTM based embedding method. Background and hyper parameter selection This section discusses the concepts of tweet representation and deep learning algorithms particularly recurrent neural network (RNN) and long short-term memory (LSTM) in a mathematical way. Tweet representation Representation of tweets typically called as tweet encoding. This contains two steps. The tweets are tokenized to words during the first step. Moreover, all words are transformed to lower-case. In second step, a dictionary is formed by assigning a unique key for each word in a tweet. The unknown words in a tweet are assigned to default key 0. To retain the word order in a tweet, each word is replaced by a unique number according to a dictionary. Each tweet vector sequence is made to same length by choosing the particular length. The tweet sequences that are too long than the particular length are discarded and too short are padded by zeros. This type of word vector representation is passed as input to the word embedding layer. For task 1, the maximum tweet sequence length is 35. Thus the train matrix of shape 6725*35, valid matrix of shape 3535*35 is passed as input to an embedding layer. For task 2, the maximum tweet sequence length is 34. Thus the train matrix of shape 1065*34, valid matrix of shape 712*34 is passed as input to an embedding layer. Word embedding layer transforms the word vector to the word embedding by using the following mathematical operation. Input − shape ∗ weights − of − word − embedding = (nb − words, word − embedding − dimension) (1) where input-shape = (nb-words, vocabulary-size), nb-words denotes the number of top words, vocabulary-size denotes the number of unique words, weights-of-word-embedding = (vocabulary-size, word-embedding-dimension), wordembedding-dimension denotes the size of word embedding vector. This kind of mathematical operation transforms the discrete number to its vectors of continuous numbers. This word embedding layer captures the semantic meaning of the tweet sequence by mapping them in to a high dimensional geometric space. This high dimensional geometric space is called as an embedding space. If an embedding is properly learnt the semantics of the tweet by encoding as a real valued vectors, then the similar tweets appear in a same cluster with close to each other in a high dimensional geometric space. To select optimal parameter for the embedding size, two trails of experiments are run with embedding size 128, 256 and 512. For each experiment, learning rate is set to 0.01. An experiment with embedding size 512 performed well in both the RNN and LSTM networks. Thus for the rest of the experiments embedding size is set to 512. The embedding layer output vector is further passed to RNN and its variant LSTM layer. RNN and LSTM obtain the optimal feature representation and those feature representation are passed to the dropout layer. Dropout layer contains 0.1 which removes the neurons and its connections randomly. This acts as a regularization parameter. In task 1 the output layer contains sigmoid activation function and sof tmax activation function for task 2. Recurrent neural network (RNN) and its variant Recurrent neural network (RNN) was an enhanced model of feed forward network (FFN) introduced in 199010. The input sequences xT of arbitrary length are passed to RNN and a transition function tf maps them into hidden state vector hit−1 recursively. The hidden state vector hit−1 are calculated based on the transition function tf of present input sequence xT and previous hidden state vector hit−1 . This can be mathematically formulated as follows hit =  0 t=0 tf (hit−1 , xt ) otherwise  (2) This kind of transition function results in vanishing and exploding gradient issue while training11. To alleviate, LSTM was introduced11–13 . LSTM network contains a special unit typically called as a memory block. A memory block composed of a memory cell m and set of gating functions such as input gate (ig), forget gate (f r) and output gate (og) to control the states of a memory cell. The transition function tf for each LSTM units is defined below igt = σ(wig xt + Pig hit−1 + Qig mt−1 + big ) (3) f gt = σ(wf g xt + Pf g hit−1 + Qf g mt−1 + bf g ) (4) ogt = σ(wog xt + Pog hit−1 + Qog mt−1 + bog ) (5) m1t = tanh(wm xt + Pm hit−1 + bm ) (6) mt = f gti ⊙ mt−1 + igt ⊙ m1 (7) hit = ogt ⊙ tanh(mt ) (8) where xt is the input at time step t, P and Q are weight parameters, σ is sigmoid activation function,⊙ denotes element-wise multiplication. Experiments This section discusses the data set details of task 1 and task 2 and followed by experiments related to parameter tuning. Task 1 is aims at classifying the twitter posts to either the existence of adverse drug reaction (ADR) or not. Task 2 aims at classifying the twitter posts to personal medication intake, possible medication intake or non-intake. The data sets for all two tasks are provided by shared task committee and the detailed statistics of them are reported in Table 1 and Table 2. Each task data set is composed of train, validation and test data sets. Table 1: Task 1 Data Statistics Data Training Validation Testing Total # Tweets 6725 3535 9961 Total # Classes 2 2 2 # ADR Mentioned Tweets 721 240 9190 # ADR not Mentioned Tweets 6004 3295 771 Table 2: Task 2 Data Statistics Data Training Validation Testing Total # Tweets 1065 712 7513 Total # Classes 3 3 3 Personal Medicine Intake 192 125 1731 Possible Medicine Intake 373 230 2697 Non Intake 500 357 3085 Results All experiments are trained using backpropogation through time (BPTT)14 on Graphics processing unit (GPU) enabled TensorFlow16 computational framework in conjunction with Keras framework in Ubuntu 14.04. We have submitted one run based on LSTM for task 1 and two runs composed of one run based on RNN and other one based on LSTM for task 2. The evaluation results is given by shared task committee are reported in Table 3 and 4. Table 3: Task 1 Results Run 1 ADR Precision 0.078 ADR Recall 0.17 ADR F-score 0.107 Table 4: Task 2 Results Run 1 2 Micro-averaged precision for classes 1 and 2 0.414 0.843 Micro-averaged recall for classes 1 and 2 0.107 0.487 Micro-averaged F-score for classes 1 and 2 0.171 0.617 Conclusion Social media mining is considerably an important source of information in many of health applications. This working note presents RNN and LSTM based embedding system for social media health text classification. Due to limited number of tweets, the performance of the proposed method is very less. However, the obtained results are considerable and open the way in future to apply for the social media health text classification. Moreover, the performance of the LSTM based embedding for task 2 is good in comparison to the task 1. This is primarily due to the fact that the target classes of task 1 data set imbalanced. Hence, the proposed method can be applied on large number of tweets corpus in order to attain the best performance. References 1. Lee, Kathy, Ankit Agrawal, and Alok Choudhary, Real-time disease surveillance using twitter data: Demonstration on flu and cancer, In Proceedings of the 19th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD 13, pages 14741477, New York, NY, USA, 2013. ACM. 2. Lee, Kathy, Ankit Agrawal, and Alok Choudhary, Mining social media streams to improve public health allergy surveillance, In 2015 IEEE/ACM International Conference on Advances in Social Networks Analysis and Mining (ASONAM), pages 815822, Aug 2015. 3. Sarker, Abeed, and Graciela Gonzalez Portable automatic text classification for adverse drug reaction detection via multi-corpus training, Journal of Biomedical Informatics, 53:196 207, 2015. 4. Jonnagaddala, J. I. T. E. N. D. R. A., TONI ROSE Jue, and H. J. Dai Binary classification of Twitter posts for adverse drug reactions, Proceedings of the Social Media Mining Shared Task Workshop at the Pacific Symposium on Biocomputing, Big Island, HI, USA. 2016. 5. Dai, Hong-Jie, Musa Touray, Jitendra Jonnagaddala, and Shabbir Syed-Abdul Feature engineering for recognizing adverse drug reactions from twitter posts, Information 7, no. 2 (2016): 27 6. Rastegar-Mojarad, M. A. J. I. D., Ravikumar Komandur Elayavilli, Yue Yu, and Hongfang Liu Detecting signals in noisy data-can ensemble classifiers help identify adverse drug reaction in tweets In Proceedings of the Social Media Mining Shared Task Workshop at the Pacific Symposium on Biocomputing. 2016. 7. Zhang, Zhifei, J. Y. Nie, and Xuyao Zhang An ensemble method for binary classification of adverse drug reactions from social media,In Proceedings of the Social Media Mining Shared Task Workshop at the Pacific Symposium on Biocomputing. 2016. 8. Nguyen, Huy, and Minh-Le Nguyen A Deep Neural Architecture for Sentence-level Sentiment Classification in Twitter Social Networking,arXiv preprint arXiv:1706.08032 (2017). 9. Lee, Kathy, Ashequl Qadir, Sadid A. Hasan, Vivek Datla, Aaditya Prakash, Joey Liu, and Oladimeji Farri Adverse Drug Event Detection in Tweets with Semi-Supervised Convolutional Neural Networks, In Proceedings of the 26th International Conference on World Wide Web, pp. 705-714. International World Wide Web Conferences Steering Committee, 2017. 10. Elman, Jeffrey LFinding structure in time, Cognitive science 14.2 (1990): 179-211. 11. Hochreiter, Sepp, and J´’urgen Schmidhuber Long short-term memory, Neural computation 9, no. 8 (1997): 17351780. 12. Gers, Felix A., Jrgen Schmidhuber, and Fred Cummins Learning to forget: Continual prediction with LSTM,(1999): 850-855. 13. Gers, Felix A., Nicol N. Schraudolph, and Jrgen Schmidhuber Learning precise timing with LSTM recurrent networks, Journal of machine learning research 3.Aug (2002): 115-143. 14. Werbos, Paul J Backpropagation through time: what it does and how to do it, Proceedings of the IEEE 78.10 (1990): 1550-1560. 15. Abadi, M., Barham, P., Chen, J., Chen, Z., Davis, A., Dean, J., Devin, M., Ghemawat, S., Irving, G., Isard, M. and Kudlur, M. TensorFlow: A System for Large-Scale Machine Learning, In OSDI, vol. 16, pp. 265-283. 2016. 16. Barathi Ganesh HB, Anand Kumar M and Soman KP. ”Distributional Semantic Representation in Health Care Text Classification.” (2016).
2cs.AI
CROSS-DOMAIN CNN FOR HYPERSPECTRAL IMAGE CLASSIFICATION Hyungtae Lee†‡ , Sungmin Eum†‡ , Heesung Kwon‡ † ‡ Booz Allen Hamilton Inc., McLean, Virginia, U.S.A. U.S. Army Research Laboratory, Adelphi, Maryland, U.S.A. arXiv:1802.00093v1 [cs.CV] 31 Jan 2018 lee [email protected], eum [email protected], [email protected] ABSTRACT In this paper, we address the dataset scarcity issue with the hyperspectral image classification. As only a few thousands of pixels are available for training, it is difficult to effectively learn high-capacity Convolutional Neural Networks (CNNs). To cope with this problem, we propose a novel cross-domain CNN containing the shared parameters which can co-learn across multiple hyperspectral datasets. The network also contains the non-shared portions designed to handle the datasetspecific spectral characteristics and the associated classification tasks. Our approach is the first attempt to learn a CNN for multiple hyperspectral datasets, in an end-to-end fashion. Moreover, we have experimentally shown that the proposed network trained on three of the widely used datasets outperform all the baseline networks which are trained on single dataset. Index Terms— Hyperspectral image classification, Convolutional Neural Network (CNN), shared network, cross domain, domain adaptation 1. INTRODUCTION The introduction of convolutional neural network (CNN) has brought forth unprecedented performance increase for classification problems in many different domains including RGB, RGBD, and hyperspectral images. [1, 2, 3, 4] Such performance increase was made possible due to the ability of CNN being able to learn and express the deep and wide connection between the input and the output using a huge number of parameters. In order to learn such a huge set of parameters, having a large scale dataset has become a significant requirement. When the size of the given dataset is insufficient to learn a network, one may consider using a larger external dataset to better learn the large set of parameters. For instance, Girshick et al. [2] introduced a domain adaptation approach where the network is trained on a large scale source domain (ImageNet dataset) and then finetuned on a target domain (object detection dataset). When applying CNN to hyperspectral image classification problem, we also face the similar issue as there are no Hyperspectral Datasets Classification Results Dataset-specific Classification Layers Dataset-specific Hyperspectral Analysis Layers Dataset-specific Hyperspectral Analysis Layers Dataset-specific Hyperspectral Analysis Layers Shared Convolutional Layers Dataset-specific Classification Layers Dataset-specific Classification Layers Hyperspectral Classification CNN optimized in an end-to-end fashion Fig. 1: Cross-Domain CNN. While the non-shared portions of the CNN (“dataset-specific hyperspectral analysis layers” and “dataset-specific classification layers”) are handling the dataset-specific classification tasks, the “shared convolutional layers” generate common information which applies to all the datasets. Note that both shared and non-shared portions of the CNN are optimized in an end-to-end fashion. large scale hyperspectral dataset available. A typical hyperspectral image classification data only contains between 10k and 100k pixels where very small portion of those pixels are being used for training. In order to tackle such data scarcity issue, we need a way to make use of multiple hyperspectral dataset (domain). There are several challenges that arise when devising an approach which can be applied to multiple hyperspectral domains. First of all, all the hyperspectral datasets contain different wavelength range and spectral reflectance bands. Furthermore, applying a domain adaptation approach [2] is infeasible as a large scale auxiliary dataset for the hyperspectral image classification is not available. Therefore, we have developed a novel cross-domain CNN architecture which simultaneously performs network learning and classification on multiple hyperspectral datasets. The architecture consists of three components: dataset-specific hyperspectral analysis layers, shared convolutional layers, and dataset-specific classification layers. In the front-end portion, “dataset-specific hyperspectral analysis layers” are present to analyze the spatial-spectral information. The back- Dataset-specific Hyperspectral Analysis Layers end is built with the “dataset-specific classification layers” which performs the classification for different dataset. These two components are connected by the “shared convolutional layers” which learns the common information across the domains. All three components are being optimized in an end-to-end fashion. The information acquired from multiple datasets is fed through the layers concurrently during training, which leads to the better learning of the shared convolutional layers via dataset augmentation. The overall CNN architecture is depicted in Figure 1. In this paper, we have used the three mostly used hyperspectral datasets (Indian Pines, Salinas, and University of Pavia) to demonstrate the effectiveness of having a crossdomain CNN. The experimental results show that our novel architecture outperforms the baseline networks (i.e., only one dataset used to train the network) by about 1.5% to 3% consistently in terms of classification accuracy. The contributions of our approach are listed as below. Dataset-specific Classification layers Shared Convolutional Layers + + + + 1. First attempt to learn a CNN with multiple hyperspectral datasets. 2. A novel cross-domain CNN optimized in an end-to-end fashion. 5x5 Conv BN Conv Conv Conv BN BN BN 3x3 Conv BN 5 1 3x3 Max Pool ReLU ReLU ReLU 5 2. THE PROPOSED METHOD B 1x1 Conv BN 5x5 Max Pool Figure 2 shows the proposed cross-domain CNN architecture. Backbone CNN architecture. For each dataset-specific stream in the proposed architecture, we have used the modified version of the 9-layered hyperspectral image classification CNN introduced by Lee and Kwon [4]. The modification has been carried out by adding a batch normalization (BN) layer after each convolutional layer while removing all the local response normalization layers. By introducing the BN layers, we can bypass the process of data normalization for both training and testing. The backbone CNN contains the sequentially connected multi-scale filter bank, one convolutional layer, two residual modules and three convolutional layers. Each multi-scale filter bank [5] consists of 1×1, 3×3, and 5×5 filters to analyze the spatial-spectral characteristics. Each residual module [3] includes two convolutional layers. Cross-domain CNN architecture. The multi-scale filter bank in each dataset-specific stream, which is responsible for analyzing the spatial-spectral characteristics, is assigned as the “dataset-specific hyperspectral analysis layers”. The last three convolutional layers function as the “dataset-specific classification layers”. The remaining layers in the middle of the architecture which consist of the second convolutional layer and two residual modules are assigned as the crossdomain “shared convolution layers”. Softmax Loss + 1 3. Consistent classification accuracy increase on all datasets. Conv Conv Conv BN BN BN Conv Conv BN BN + ReLU ReLU C ReLU ReLU ReLU DO DO Conv: Convolution layer BN: Batch Normalization layer Max Pool: Max polling layer ReLU: Rectified Linear Unit layer DO: DropOut layer Softmax Loss: Softmax Loss layer : Shared layers Fig. 2: Architecture. Red, blue, green blocks indicate the non-shared portion of the CNN while the black ones are shared across all the streams for different datasets. Detailed specifications on the architecture are denoted on the last (green) stream. B and C indicate the number of spectral bands and the number of classes, respectively, which are different for all the datasets. 3. EVALUATION Evaluation Settings. We have used three hyperspectral datasets (Indian Pines, Salinas, and University of Pavia) for the experiments. The Indian Pines dataset includes 145×145 pixels and 220 spectral reflectance bands which cover the range from 0.4 to 2.5 µm with a spatial resolution of 20 m. The Indian Pines dataset has 16 classes but only 8 classes with relatively large numbers of samples are used. The Salinas dataset contains 16 classes with 512×217 pixels and 224 spectral bands and a high spatial resolution of 3.7 m. Salinas dataset shares the frequency characteristics with the Indian Pines dataset as the same sensor (AVIRIS) was used for the data acquisition. The University of Pavia dataset provides 9 classes and 610×340 pixels with 103 spectral bands which cover the spectral range from 0.43 to 0.86 µm with a spatial Table 1: Selected classes for evaluation and the numbers of training and test samples. (a) Indian Pines Class Corn-notill Corn-mintill Grass-pasture Hay-windrowed Soybean-notill Soybean-mintill Soybean-clean Woods Total Training 200 200 200 200 200 200 200 200 1600 Test 1228 630 283 278 772 2255 393 1065 6904 Class Brocooli green weeds 1 Brocooli green weeds 2 Fallow Fallow rough plow Fallow smooth Stubble Celery Grapes untrained Soil vineyard develop Corn senesced green weeds Lettuce romaines, 4 wk Lettuce romaines, 5 wk Lettuce romaines, 6 wk Lettuce romaines, 7 wk Vineyard untrained Vineyard vertical trellis Total Table 2: Classification accuracy. Dataset (c) University of Pavia (b) Salinas Training 200 200 200 200 200 200 200 200 200 200 200 200 200 200 200 200 3200 Test 1809 3526 1776 1194 2478 3759 3379 11071 6003 3078 868 1727 716 870 7068 1607 50929 Class Asphalt Meadows Gravel Trees Sheets Bare soils Bitumen Bricks Shadows Total Training 200 200 200 200 200 200 200 200 200 1800 Test 6431 18449 1899 2864 1145 4829 1130 2482 747 40976 domains brings notable classification accuracy improvements when compared to the individually trained cases. Individual CNN Cross-Domain CNN Gain Indian Pines .907 .922 +.015 Salinas .893 .908 +.015 University of Pavia .921 .953 +.032 5. REFERENCES [1] Saurabh Gupta, Ross Girshick, Pablo Arbeláez, and Jitendra Malik, “Learning rich features from RGB-D images for object detection and segmentation,” in ECCV, 2014. resolution of 1.3 m. For the Salinas dataset and the University of Pavia dataset, we use all classes because both datasets do not contain classes with a relatively small number of samples. Each dataset has been randomly partitioned into train and test sets according to Table 1. [2] Ross Girshick, Jeff Donahue, Trevor Darrell, and Jitendra Malik, “Region-based convolutional networks for accurate object detection and segmentation,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 38, no. 1, pp. 142–158, 2016. Classification Accuracy. As shown in Table 2, the proposed cross-domain CNN outperforms the individual networks on the Indian Pines, Salinas, and University of Pavia by 1.5%, 1.5%, and 3.2%, respectively. Note that the individual networks have been trained without the shared portion of the network. [3] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun, “Deep residual learning for image recognition,” in CVPR, 2016. 4. CONCLUSION In this paper, we have introduced a novel cross-domain CNN which can concurrently learn and perform the hyperspectral image classification for multiple datasets. As the shared portion of our network is being trained using multiple hyperspectral datasets, the proposed approach is more effective in optimizing the high capacity CNN than the cases where only a single dataset (domain) is being used. Our approach is the first attempt to exploit multiple hyperspectral datasets for training a CNN in an end-to-end fashion. We have experimentally demonstrated that using the shared layers across the [4] Hyungtae Lee and Heesung Kwon, “Contextual deep CNN based hyperspectral classification,” in IGARSS, 2016. [5] Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich, “Going deeper with convolutions,” in CVPR, 2015.
1cs.CV
Published as a conference paper at ICLR 2018 L EARNING TO R EPRESENT P ROGRAMS WITH G RAPHS Marc Brockschmidt Microsoft Research Cambridge, UK [email protected] arXiv:1711.00740v2 [cs.LG] 22 Feb 2018 Miltiadis Allamanis Microsoft Research Cambridge, UK [email protected] Mahmoud Khademi∗ Simon Fraser University Vancouver, Canada [email protected] A BSTRACT Learning tasks on source code (i.e., formal languages) have been considered recently, but most work has tried to transfer natural language methods and does not capitalize on the unique opportunities offered by code’s known sematics. For example, long-range dependencies induced by using the same variable or function in distant locations are often not considered. We propose to use graphs to represent both the syntactic and semantic structure of code and use graph-based deep learning methods to learn to reason over program structures. In this work, we present how to construct graphs from source code and how to scale Gated Graph Neural Networks training to such large graphs. We evaluate our method on two tasks: VAR NAMING, in which a network attempts to predict the name of a variable given its usage, and VAR M ISUSE, in which the network learns to reason about selecting the correct variable that should be used at a given program location. Our comparison to methods that use less structured program representations shows the advantages of modeling known structure, and suggests that our models learn to infer meaningful names and to solve the VAR M ISUSE task in many cases. Additionally, our testing showed that VAR M ISUSE identifies a number of bugs in mature open-source projects. 1 I NTRODUCTION The advent of large repositories of source code as well as scalable machine learning methods naturally leads to the idea of “big code”, i.e., largely unsupervised methods that support software engineers by generalizing from existing source code (Allamanis et al., 2017). Currently, existing deep learning models of source code capture its shallow, textual structure, e.g. as a sequence of tokens (Hindle et al., 2012; Raychev et al., 2014; Allamanis et al., 2016), as parse trees (Maddison & Tarlow, 2014; Bielik et al., 2016), or as a flat dependency networks of variables (Raychev et al., 2015). Such models miss out on the opportunity to capitalize on the rich and well-defined semantics of source code. In this work, we take a step to alleviate this by including two additional signal sources in source code: data flow and type hierarchies. We do this by encoding programs as graphs, in which edges represent syntactic relationships (e.g. “token before/after”) as well as semantic relationships (“variable last used/written here”, “formal parameter for argument is called stream”, etc.). Our key insight is that exposing these semantics explicitly as structured input to a machine learning model lessens the requirements on amounts of training data, model capacity and training regime and allows us to solve tasks that are beyond the current state of the art. We explore two tasks to illustrate the advantages of exposing more semantic structure of programs. First, we consider the VAR NAMING task (Allamanis et al., 2014; Raychev et al., 2015), in which given some source code, the “correct” variable name is inferred as a sequence of subtokens. This requires some understanding of how a variable is used, i.e., requires reasoning about lines of code far ∗ Work done as an intern in Microsoft Research, Cambridge, UK. 1 Published as a conference paper at ICLR 2018 var clazz=classTypes["Root"].Single() as JsonCodeGenerator.ClassType; Assert.NotNull(clazz); var first=classTypes["RecClass"].Single() as JsonCodeGenerator.ClassType; Assert.NotNull( clazz ); Assert.Equal("string", first.Properties["Name"].Name); Assert.False(clazz.Properties["Name"].IsArray); Figure 1: A snippet of a detected bug in RavenDB an open-source C# project. The code has been slightly simplified. Our model detects correctly that the variable used in the highlighted (yellow) slot is incorrect. Instead, first should have been placed at the slot. We reported this problem which was fixed in PR 4138. apart in the source file. Secondly, we introduce the variable misuse prediction task (VAR M ISUSE), in which the network aims to infer which variable should be used in a program location. To illustrate the task, Figure 1 shows a slightly simplified snippet of a bug our model detected in a popular open-source project. Specifically, instead of the variable clazz, variable first should have been used in the yellow highlighted slot. Existing static analysis methods cannot detect such issues, even though a software engineer would easily identify this as an error from experience. To achieve high accuracy on these tasks, we need to learn representations of program semantics. For both tasks, we need to learn the semantic role of a variable (e.g., “is it a counter?”, “is it a filename?”). Additionally, for VAR M ISUSE, learning variable usage semantics (e.g., “a filename is needed here”) is required. This “fill the blank element” task is related to methods for learning distributed representations of natural language words, such as Word2Vec (Mikolov et al., 2013) and GLoVe (Pennington et al., 2014). However, we can learn from a much richer structure such as data flow information. This work is a step towards learning program representations, and we expect them to be valuable in a wide range of other tasks, such as code completion (“this is the variable you are looking for”) and more advanced bug finding (“you should lock before using this object”). To summarize, our contributions are: (i) We define the VAR M ISUSE task as a challenge for machine learning modeling of source code, that requires to learn (some) semantics of programs (cf. section 3). (ii) We present deep learning models for solving the VAR NAMING and VAR M ISUSE tasks by modeling the code’s graph structure and learning program representations over those graphs (cf. section 4). (iii) We evaluate our models on a large dataset of 2.9 million lines of real-world source code, showing that our best model achieves 32.9% accuracy on the VAR NAMING task and 85.5% accuracy on the VAR M ISUSE task, beating simpler baselines (cf. section 5). (iv) We document practical relevance of VAR M ISUSE by summarizing some bugs that we found in mature open-source software projects (cf. subsection 5.3). Our implementation of graph neural networks (on a simpler task) can be found at https://github.com/Microsoft/gated-graph-neural-network-samples. 2 R ELATED W ORK Our work builds upon the recent field of using machine learning for source code artifacts (Allamanis et al., 2017). For example, Hindle et al. (2012); Bhoopchand et al. (2016) model the code as a sequence of tokens, while Maddison & Tarlow (2014); Raychev et al. (2016) model the syntax tree structure of code. All works on language models of code find that predicting variable and method identifiers is one of biggest challenges in the task. Closest to our work is the work of Allamanis et al. (2015) who learn distributed representations of variables using all their usages to predict their names. However, they do not use data flow information and we are not aware of any model that does so. Raychev et al. (2015) and Bichsel et al. (2016) use conditional random fields to model a variety of relationships between variables, AST elements and types to predict variable names and types (resp. to deobfuscate Android apps), but without considering the flow of data explicitly. In these works, all variable usages are deterministically known beforehand (as the code is complete and remains unmodified), as in Allamanis et al. (2014; 2015). Our work is remotely related to work on program synthesis using sketches (Solar-Lezama, 2008) and automated code transplantation (Barr et al., 2015). However, these approaches require a set of 2 Published as a conference paper at ICLR 2018 specifications (e.g. input-output examples, test suites) to complete the gaps, rather than statistics learned from big code. These approaches can be thought as complementary to ours, since we learn to statistically complete the gaps without any need for specifications, by learning common variable usage patterns from code. Neural networks on graphs (Gori et al., 2005; Li et al., 2015; Defferrard et al., 2016; Kipf & Welling, 2016; Gilmer et al., 2017) adapt a variety of deep learning methods to graph-structured input. They have been used in a series of applications, such as link prediction and classification (Grover & Leskovec, 2016) and semantic role labeling in NLP (Marcheggiani & Titov, 2017). Somewhat related to source code is the work of Wang et al. (2017) who learn graph-based representations of mathematical formulas for premise selection in theorem proving. 3 T HE VAR M ISUSE TASK Detecting variable misuses in code is a task that requires understanding and reasoning about program semantics. To successfully tackle the task one needs to infer the role and function of the program elements and understand how they relate. For example, given a program such as Fig. 1, the task is to automatically detect that the marked use of clazz is a mistake and that first should be used instead. While this task resembles standard code completion, it differs significantly in its scope and purpose, by considering only variable identifiers and a mostly complete program. Task Description We view a source code file as a sequence of tokens t0 . . . tN = T , in which some tokens tλ0 , tλ1 . . . are variables. Furthermore, let Vt ⊂ V refer to the set of all type-correct variables in scope at the location of t, i.e., those variables that can be used at t without raising a compiler error. We call a token tokλ where we want to predict the correct variable usage a slot. We define a separate task for each slot tλ : Given t0 . . . tλ−1 and tλ+1 , . . . , tN , correctly select tλ from Vtλ . For training and evaluation purposes, a correct solution is one that simply matches the ground truth, but note that in practice, several possible assignments could be considered correct (i.e., when several variables refer to the same value in memory). 4 M ODEL : P ROGRAMS AS G RAPHS In this section, we discuss how to transform program source code into program graphs and learn representations over them. These program graphs not only encode the program text but also the semantic information that can be obtained using standard compiler tools. Gated Graph Neural Networks Our work builds on Gated Graph Neural Networks (Li et al., 2015) (GGNN) and we summarize them here. A graph G = (V, E, X) is composed of a set of nodes V, node features X, and a list of directed edge sets E = (E1 , . . . , EK ) where K is the number of edge types. We annotate each v ∈ V with a real-valued vector x(v) ∈ RD representing the features of the node (e.g., the embedding of a string label of that node). We associate every node v with a state vector h(v) , initialized from the node label x(v) . The sizes of the state vector and feature vector are typically the same, but we can use larger state vectors through padding of node features. To propagate information throughout the graph, “messages” of type k are sent from each v to its neighbors, where each message is computed from its current state vector (v) as mk = fk (h(v) ). Here, fk can be an arbitrary function; we choose a linear layer in our case. By computing messages for all graph edges at the same time, all states can be updated at the same time. In particular, a new state for a node v is computed by aggregating all incoming messages as (u) m̃(v) = g({mk | there is an edge of type k from u to v}). g is an aggregation function, which we implement as elementwise summation. Given the aggregated message m̃(v) and the current state vector h(v) of node v, the state of the next time step h0(v) is computed as h0(v) = GRU(m̃(v) , h(v) ), where GRU is the recurrent cell function of gated recurrent unit (GRU) (Cho et al., 2014). The dynamics defined by the above equations are repeated for a fixed number of time steps. Then, we use the state vectors from the last time step as the node representations.1 1 Graph Convolutional Networks (GCN) (Kipf & Welling, 2016; Schlichtkrull et al., 2017) would be a simpler replacement for GGNNs. They correspond to the special case of GGNNs in which no gated recurrent units are 3 Published as a conference paper at ICLR 2018 x 1 y 2 ExpressionStatement x InvocationExpression MemberAccessExpression Assert . NotNull ArgumentList ( x ... 3 4 x 5 y 6 (b) Data flow edges for (x 1 ,y 2 ) = Foo(); while (x 3 > 0) x 4 = x 5 + y 6 (indices added for clarity), with red dotted LastUse edges, green dashed LastWrite edges and dashdotted purple ComputedFrom edges. (a) Simplified syntax graph for line 2 of Fig. 1, where blue rounded boxes are syntax nodes, black rectangular boxes syntax tokens, blue edges Child edges and double black edges NextToken edges. Figure 2: Examples of graph edges used in program representation. Program Graphs We represent program source code as graphs and use different edge types to model syntactic and semantic relationships between different tokens. The backbone of a program graph is the program’s abstract syntax tree (AST), consisting of syntax nodes (corresponding to nonterminals in the programming language’s grammar) and syntax tokens (corresponding to terminals). We label syntax nodes with the name of the nonterminal from the program’s grammar, whereas syntax tokens are labeled with the string that they represent. We use Child edges to connect nodes according to the AST. As this does not induce an order on children of a syntax node, we additionally add NextToken edges connecting each syntax token to its successor. An example of this is shown in Fig. 2a. To capture the flow of control and data through a program, we add additional edges connecting different uses and updates of syntax tokens corresponding to variables. For such a token v, let DR (v) be the set of syntax tokens at which the variable could have been used last. This set may contain several nodes (for example, when using a variable after a conditional in which it was used in both branches), and even syntax tokens that follow in the program code (in the case of loops). Similarly, let DW (v) be the set of syntax tokens at which the variable was last written to. Using these, we add LastRead (resp. LastWrite) edges connecting v to all elements of DR (v) (resp. DW (v)). Additionally, whenever we observe an assignment v = expr , we connect v to all variable tokens occurring in expr using ComputedFrom edges. An example of such semantic edges is shown in Fig. 2b. We extend the graph to chain all uses of the same variable using LastLexicalUse edges (independent of data flow, i.e., in if (...) { ... v ...} else { ... v ...}, we link the two occurrences of v). We also connect return tokens to the method declaration using ReturnsTo edges (this creates a “shortcut” to its name and type). Inspired by Rice et al. (2017), we connect arguments in method calls to the formal parameters that they are matched to with FormalArgName edges, i.e., if we observe a call Foo(bar) and a method declaration Foo(InputStream stream), we connect the bar token to the stream token. Finally, we connect every token corresponding to a variable to enclosing guard expressions that use the variable with GuardedBy and GuardedByNegation edges. For example, in if (x > y) { ... x ...} else { ... y ...}, we add a GuardedBy edge from x (resp. a GuardedByNegation edge from y) to the AST node corresponding to x > y. Finally, for all types of edges we introduce their respective backwards edges (transposing the adjacency matrix), doubling the number of edges and edge types. Backwards edges help with propagating information faster across the GGNN and make the model more expressive. Leveraging Variable Type Information We assume a statically typed language and that the source code can be compiled, and thus each variable has a (known) type τ (v). To use it, we define a learnable embedding function r(τ ) for known types and additionally define an “U NK T YPE” for all unknown/unrepresented types. We also leverage the rich type hierarchy that is available in many object-oriented languages. For this, we map a variable’s type τ (v) to the set of its supertypes, i.e. τ ∗ (v) = {τ : τ (v) implements type τ } ∪ {τ (v)}. We then compute the type representation r∗ (v) used for state updates and the number of propagation steps per GGNN layer is fixed to 1. Instead, several layers are used. In our experiments, GCNs generalized less well than GGNNs. 4 Published as a conference paper at ICLR 2018 of a variable v as the element-wise maximum of {r(τ ) : τ ∈ τ ∗ (v)}. We chose the maximum here, as it is a natural pooling operation for representing partial ordering relations (such as type lattices). Using all types in τ ∗ (v) allows us to generalize to unseen types that implement common supertypes or interfaces. For example, List<K> has multiple concrete types (e.g. List<int>, List<string>). Nevertheless, these types implement a common interface (IList) and share common characteristics. During training, we randomly select a non-empty subset of τ ∗ (v) which ensures training of all known types in the lattice. This acts both like a dropout mechanism and allows us to learn a good representation for all types in the type lattice. Initial Node Representation To compute the initial node state, we combine information from the textual representation of the token and its type. Concretely, we split the name of a node representing a token into subtokens (e.g. classTypes will be split into two subtokens class and types) on camelCase and pascal_case. We then average the embeddings of all subtokens to retrieve an embedding for the node name. Finally, we concatenate the learned type representation r∗ (v), computed as discussed earlier, with the node name representation, and pass it through a linear layer to obtain the initial representations for each node in the graph. Programs Graphs for VAR N AMING Given a program and an existing variable v, we build a program graph as discussed above and then replace the variable name in all corresponding variable tokens by a special <SLOT> token. To predict a name, we use the initial node labels computed as the concatenation of learnable token embeddings and type embeddings as discussed above, run GGNN propagation for 8 time steps2 and then compute a variable usage representation by averaging the representations for all <SLOT> tokens. This representation is then used as the initial state of a one-layer GRU, which predicts the target name as a sequence of subtokens (e.g., the name inputStreamBuffer is treated as the sequence [input, stream, buffer]). We train this graph2seq architecture using a maximum likelihood objective. In section 5, we report the accuracy for predicting the exact name and the F1 score for predicting its subtokens. Program Graphs for VAR M ISUSE To model VAR M ISUSE with program graphs we need to modify the graph. First, to compute a context representation c(t) for a slot t where we want to predict the used variable, we insert a new node v<SLOT> at the position of t, corresponding to a “hole” at this point, and connect it to the remaining graph using all applicable edges that do not depend on the chosen variable at the slot (i.e., everything but LastUse, LastWrite, LastLexicalUse, and GuardedBy edges). Then, to compute the usage representation u(t, v) of each candidate variable v at the target slot, we insert a “candidate” node vt,v for all v in Vt , and connect it to the graph by inserting the LastUse, LastWrite and LastLexicalUse edges that would be used if the variable were to be used at this slot. Each of these candidate nodes represents the speculative placement of the variable within the scope. Using the initial node representations, concatenated with an extra bit that is set to one for the candidate nodes vt,v , we run GGNN propagation for 8 time steps.2 The context and usage representation are then the final node states of the nodes, i.e., c(t) = h(v<SLOT> ) and u(t, v) = h(vt,v ) . Finally, the correct variable usage at the location is computed as arg maxv W [c(t), u(t, v)] where W is a linear layer that uses the concatenation of c(t) and u(t, v). We train using a max-margin objective. 4.1 I MPLEMENTATION Using GGNNs for sets of large, diverse graphs requires some engineering effort, as efficient batching is hard in the presence of diverse shapes. An important observation is that large graphs are normally very sparse, and thus a representation of edges as an adjacency list would usually be advantageous to reduce memory consumption. In our case, this can be easily implemented using a sparse tensor representation, allowing large batch sizes that exploit the parallelism of modern GPUs efficiently. A second key insight is to represent a batch of graphs as one large graph with many disconnected components. This just requires appropriate pre-processing to make node identities unique. As this makes batch construction somewhat CPU-intensive, we found it useful to prepare minibatches on a separate thread. Our TensorFlow (Abadi et al., 2016) implementation scales to 55 graphs per second during training and 219 graphs per second during test-time using a single NVidia GeForce 2 We found fewer steps to be insufficient for good results and more propagation steps to not help substantially. 5 Published as a conference paper at ICLR 2018 GTX Titan X with graphs having on average 2,228 (median 936) nodes and 8,350 (median 3,274) edges and 8 GGNN unrolling iterations, all 20 edge types (forward and backward edges for 10 original edge types) and the size of the hidden layer set to 64. The number of types of edges in the GGNN contribute proportionally to the running time. For example, a GGNN run for our ablation study using only the two most common edge types (NextToken, Child) achieves 105 graphs/second during training and 419 graphs/second at test time with the same hyperparameters. Our (generic) implementation of GGNNs is available at https://github.com/Microsoft/ gated-graph-neural-network-samples, using a simpler demonstration task. 5 E VALUATION Dataset We collected a dataset for the VAR M ISUSE task from open source C# projects on GitHub. To select projects, we picked the top-starred (non-fork) projects in GitHub. We then filtered out projects that we could not (easily) compile in full using Roslyn3 , as we require a compilation to extract precise type information for the code (including those types present in external libraries). Our final dataset contains 29 projects from a diverse set of domains (compilers, databases, . . . ) with about 2.9 million non-empty lines of code. A full table is shown in Appendix D. For the task of detecting variable misuses, we collect data from all projects by selecting all variable usage locations, filtering out variable declarations, where at least one other type-compatible replacement variable is in scope. The task is then to infer the correct variable that originally existed in that location. Thus, by construction there is at least one type-correct replacement variable, i.e. picking it would not raise an error during type checking. In our test datasets, at each slot there are on average 3.8 type-correct alternative variables (median 3, σ = 2.6). From our dataset, we selected two projects as our development set. From the rest of the projects, we selected three projects for U NSEEN P ROJ T EST to allow testing on projects with completely unknown structure and types. We split the remaining 23 projects into train/validation/test sets in the proportion 60-10-30, splitting along files (i.e., all examples from one source file are in the same set). We call the test set obtained like this S EEN P ROJ T EST. Baselines For VAR M ISUSE, we consider two bidirectional RNN-based baselines. The local model (L OC) is a simple two-layer bidirectional GRU run over the tokens before and after the target location. For this baseline, c(t) is set to the slot representation computed by the RNN, and the usage context of each variable u(t, v) is the embedding of the name and type of the variable, computed in the same way as the initial node labels in the GGNN. This baseline allows us to evaluate how important the usage context information is for this task. The flat dataflow model (AVG B I RNN) is an extension to L OC, where the usage representation u(t, v) is computed using another two-layer bidirectional RNN run over the tokens before/after each usage, and then averaging over the computed representations at the variable token v. The local context, c(t), is identical to L OC. AVG B I RNN is a significantly stronger baseline that already takes some structural information into account, as the averaging over all variables usages helps with long-range dependencies. Both models pick the variable that maximizes c(t)T u(t, v). For VAR NAMING, we replace L OC by AVG LBL, which uses a log-bilinear model for 4 left and 4 right context tokens of each variable usage, and then averages over these context representations (this corresponds to the model in Allamanis et al. (2015)). We also test AVG B I RNN on VAR NAMING, which essentially replaces the log-bilinear context model by a bidirectional RNN. 5.1 Q UANTITATIVE E VALUATION Table 1 shows the evaluation results of the models for both tasks.4 As L OC captures very little information, it performs relatively badly. AVG LBL and AVG B I RNN, which capture information from many variable usage sites, but do not explicitly encode the rich structure of the problem, still lag behind the GGNN by a wide margin. The performance difference is larger for VAR M ISUSE, since the structure and the semantics of code are far more important within this setting. 3 4 http://roslyn.io Sect. A additionally shows ROC and precision-recall curves for the GGNN model on the VAR M ISUSE task. 6 Published as a conference paper at ICLR 2018 Table 1: Evaluation of models. S EEN P ROJ T EST refers to the test set containing projects that have files in the training set, U NSEEN P ROJ T EST refers to projects that have no files in the training data. Results averaged over two runs. L OC VAR M ISUSE Accuracy (%) PR AUC VAR N AMING Accuracy (%) F1 (%) S EEN P ROJ T EST AVG LBL AVG B I RNN GGNN L OC U NSEEN P ROJ T EST AVG LBL AVG B I RNN GGNN 50.0 0.788 — — 73.7 0.941 85.5 0.980 28.9 0.611 — — 60.2 0.895 78.2 0.958 — — 36.1 44.0 42.9 50.1 53.6 65.8 — — 22.7 30.6 23.4 32.0 44.0 62.0 Table 2: Ablation study for the GGNN model on S EEN P ROJ T EST for the two tasks. Accuracy (%) VAR M ISUSE VAR NAMING Ablation Description Standard Model (reported in Table 1) 85.5 53.6 Only NextToken, Child, LastUse, LastWrite edges Only semantic edges (all but NextToken, Child) Only syntax edges (NextToken, Child) 80.6 78.4 55.3 31.2 52.9 34.3 Node Labels: Tokens instead of subtokens Node Labels: Disabled 85.6 84.3 34.5 31.8 Generalization to new projects Generalizing across a diverse set of source code projects with different domains is an important challenge in machine learning. We repeat the evaluation using the U NSEEN P ROJ T EST set stemming from projects that have no files in the training set. The right side of Table 1 shows that our models still achieve good performance, although it is slightly lower compared to S EEN P ROJ T EST. This is expected since the type lattice is mostly unknown in U NSEEN P ROJ T EST. We believe that the dominant problem in applying a trained model to an unknown project (i.e., domain) is the fact that its type hierarchy is unknown and the used vocabulary (e.g. in variables, method and class names, etc.) can differ substantially. Ablation Study To study the effect of some of the design choices for our models, we have run some additional experiments and show their results in Table 2. First, we varied the edges used in the program graph. We find that restricting the model to syntactic information has a large impact on performance on both tasks, whereas restricting it to semantic edges seems to mostly impact performance on VAR M ISUSE. Similarly, the ComputedFrom, FormalArgName and ReturnsTo edges give a small boost on VAR M ISUSE, but greatly improve performance on VAR NAMING. As evidenced by the experiments with the node label representation, syntax node and token names seem to matter little for VAR M ISUSE, but naturally have a great impact on VAR NAMING. 5.2 Q UALITATIVE E VALUATION Figure 3 illustrates the predictions that GGNN makes on a sample test snippet. The snippet recursively searches for the global directives file by gradually descending into the root folder. Reasoning about the correct variable usages is hard, even for humans, but the GGNN correctly predicts the variable usages an all locations except two (slot 1 and 8). As a software engineer is writing the code it is imaginable that she may make a mistake misusing one variable in the place of another. Since all variables are string variables, no type errors will be raised. As the probabilities in Fig. 3 suggest most potential variable misuses can be flagged by the model yielding valuable warnings to software engineers. Additional samples with comments can be found in Appendix B. Furthermore, Appendix C shows samples of pairs of code snippets that share similar representations as computed by the cosine similarity of the usage representation u(t, v) of GGNN. The reader can notice that the network learns to group variable usages that share semantic similarities together. For example, checking for null before the use of a variable yields similar distributed representations across code segments (Sample 1 in Appendix C). 7 Published as a conference paper at ICLR 2018 bool TryFindGlobalDirectivesFile(string baseDirectory, string fullPath, out string path){ baseDirectory1 = baseDirectory2 .TrimEnd(Path.DirectorySeparatorChar); var directivesDirectory = Path.GetDirectoryName(fullPath3 ) .TrimEnd(Path.DirectorySeparatorChar); while(directivesDirectory4 != null && directivesDirectory5 .Length >= baseDirectory6 .Length){ path7 = Path.Combine(directivesDirectory8 , GlobalDirectivesFileName9 ); if (File.Exists(path10 )) return true; directivesDirectory11 =Path.GetDirectoryName(directivesDirectory12 ) .TrimEnd(Path.DirectorySeparatorChar); } 13 path = null; return false; } 1: path:59%, baseDirectory:35%, fullPath:6%, GlobalDirectivesFileName:1% 2: baseDirectory:92%, fullPath:5%, GlobalDirectivesFileName:2%, path:0.4% 3: fullPath:88%, baseDirectory:9%, GlobalDirectivesFileName:2%, path:1% 4: directivesDirectory:86%, path:8%, baseDirectory:2%, GlobalDirectivesFileName:1%, fullPath:0.1% 5: directivesDirectory:46%, path:24%, baseDirectory:16%, GlobalDirectivesFileName:10%, fullPath:3% 6: baseDirectory:64%, path:26%, directivesDirectory:5%, fullPath:2%, GlobalDirectivesFileName:2% 7: path:99%, directivesDirectory:1%, GlobalDirectivesFileName:0.5%, baseDirectory:7e-5, fullPath:4e-7 8: fullPath:60%, directivesDirectory:21%, baseDirectory:18%, path:1%, GlobalDirectivesFileName:4e-4 9: GlobalDirectivesFileName:61%, baseDirectory:26%, fullPath:8%, path:4%, directivesDirectory:0.5% 10: path:70%, directivesDirectory:17%, baseDirectory:10%, GlobalDirectivesFileName:1%, fullPath:0.6% 11: directivesDirectory:93%, path:5%, GlobalDirectivesFileName:1%, baseDirectory:0.1%, fullPath:4e-5% 12: directivesDirectory:65%, path:16%, baseDirectory:12%, fullPath:5%, GlobalDirectivesFileName:3% 13: path:97%, baseDirectory:2%, directivesDirectory:0.4%, fullPath:0.3%, GlobalDirectivesFileName:4e-4 Figure 3: VAR M ISUSE predictions on slots within a snippet of the S EEN P ROJ T EST set for the ServiceStack project. Additional visualizations are available in Appendix B. The underlined tokens are the correct tokens. The model has to select among a number of string variables at each slot, where all of them represent some kind of path. The GGNN accurately predicts the correct variable usage in 11 out of the 13 slots reasoning about the complex ways the variables interact among them. public int var var ArraySegment<byte> ReadBytes(int length){ size = Math.Min(length, _len - _pos); buffer = EnsureTempBuffer( length ); used = Read(buffer, 0, size); Figure 4: A bug found (yellow) in RavenDB open-source project. The code unnecessarily ensures that the buffer is of size length rather than size (which our model predicts as the correct variable here). 5.3 D ISCOVERED VARIABLE M ISUSE B UGS We have used our VAR M ISUSE model to identify likely locations of bugs in RavenDB (a document database) and Roslyn (Microsoft’s C# compiler framework). For this, we manually reviewed a sample of the top 500 locations in both projects where our model was most confident about a choosing a variable differing from the ground truth, and found three bugs in each of the projects. Figs. 1,4,5 show the issues discovered in RavenDB. The bug in Fig. 1 was possibly caused by copy-pasting, and cannot be easily caught by traditional methods. A compiler will not warn about unused variables (since first is used) and virtually nobody would write a test testing another if (IsValidBackup(backupFilename) == false) { output("Error:"+ backupLocation +" doesn’t look like a valid backup"); throw new InvalidOperationException( backupLocation + " doesn’t look like a valid backup"); Figure 5: A bug found (yellow) in the RavenDB open-source project. Although backupFilename is found to be invalid by IsValidBackup, the user is notified that backupLocation is invalid instead. 8 Published as a conference paper at ICLR 2018 test. Fig. 4 shows an issue that, although not critical, can lead to increased memory consumption. Fig. 5 shows another issue arising from a non-informative error message. We privately reported three additional bugs to the Roslyn developers, who have fixed the issues in the meantime (cf. https://github.com/dotnet/roslyn/pull/23437). One of the reported bugs could cause a crash in Visual Studio when using certain Roslyn features. Finding these issues in widely released and tested code suggests that our model can be useful during the software development process, complementing classic program analysis tools. For example, one usage scenario would be to guide the code reviewing process to locations a VAR M ISUSE model has identified as unusual, or use it as a prior to focus testing or expensive code analysis efforts. 6 D ISCUSSION & C ONCLUSIONS Although source code is well understood and studied within other disciplines such as programming language research, it is a relatively new domain for deep learning. It presents novel opportunities compared to textual or perceptual data, as its (local) semantics are well-defined and rich additional information can be extracted using well-known, efficient program analyses. On the other hand, integrating this wealth of structured information poses an interesting challenge. Our VAR M ISUSE task exposes these opportunities, going beyond simpler tasks such as code completion. We consider it as a first proxy for the core challenge of learning the meaning of source code, as it requires to probabilistically refine standard information included in type systems. R EFERENCES Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, et al. Tensorflow: Large-scale machine learning on heterogeneous distributed systems. arXiv preprint arXiv:1603.04467, 2016. Miltiadis Allamanis, Earl T Barr, Christian Bird, and Charles Sutton. Learning natural coding conventions. In Foundations of Software Engineering (FSE), 2014. Miltiadis Allamanis, Earl T Barr, Christian Bird, and Charles Sutton. Suggesting accurate method and class names. In Foundations of Software Engineering (FSE), 2015. Miltiadis Allamanis, Hao Peng, and Charles Sutton. A convolutional attention network for extreme summarization of source code. In International Conference on Machine Learning (ICML), pp. 2091–2100, 2016. Miltiadis Allamanis, Earl T Barr, Premkumar Devanbu, and Charles Sutton. A survey of machine learning for big code and naturalness. arXiv preprint arXiv:1709.06182, 2017. Earl T Barr, Mark Harman, Yue Jia, Alexandru Marginean, and Justyna Petke. Automated software transplantation. In International Symposium on Software Testing and Analysis (ISSTA), 2015. Al Bessey, Ken Block, Ben Chelf, Andy Chou, Bryan Fulton, Seth Hallem, Charles Henri-Gros, Asya Kamsky, Scott McPeak, and Dawson Engler. A few billion lines of code later: using static analysis to find bugs in the real world. Communications of the ACM, 53(2):66–75, 2010. Avishkar Bhoopchand, Tim Rocktäschel, Earl Barr, and Sebastian Riedel. Learning Python code suggestion with a sparse pointer network. arXiv preprint arXiv:1611.08307, 2016. Benjamin Bichsel, Veselin Raychev, Petar Tsankov, and Martin Vechev. Statistical deobfuscation of android applications. In Conference on Computer and Communications Security (CCS), 2016. Pavol Bielik, Veselin Raychev, and Martin Vechev. PHOG: probabilistic model for code. In International Conference on Machine Learning (ICML), 2016. Kyunghyun Cho, Bart van Merriënboer, Dzmitry Bahdanau, and Yoshua Bengio. On the properties of neural machine translation: Encoder–decoder approaches. Syntax, Semantics and Structure in Statistical Translation, 2014. 9 Published as a conference paper at ICLR 2018 Michaël Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. In Neural Information Processing Systems (NIPS), pp. 3844–3852, 2016. Justin Gilmer, Samuel S. Schoenholz, Patrick F. Riley, Oriol Vinyals, and George E. Dahl. Neural message passing for quantum chemistry. arXiv preprint arXiv:1704.01212, 2017. Marco Gori, Gabriele Monfardini, and Franco Scarselli. A new model for learning in graph domains. In IEEE International Joint Conference Neural Networks (IJCNN). IEEE, 2005. Aditya Grover and Jure Leskovec. node2vec: Scalable feature learning for networks. In International Conference on Knowledge Discovery and Data Mining (SIGKDD), pp. 855–864. ACM, 2016. Abram Hindle, Earl T Barr, Zhendong Su, Mark Gabel, and Premkumar Devanbu. On the naturalness of software. In International Conference on Software Engineering (ICSE), 2012. Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016. Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard Zemel. Gated graph sequence neural networks. In International Conference on Learning Representations (ICLR), 2015. Chris J Maddison and Daniel Tarlow. Structured generative models of natural source code. In International Conference on Machine Learning (ICML), 2014. Diego Marcheggiani and Ivan Titov. Encoding sentences with graph convolutional networks for semantic role labeling. In ACL, 2017. Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In Neural Information Processing Systems (NIPS), 2013. Jeffrey Pennington, Richard Socher, and Christopher D Manning. GloVe: Global vectors for word representation. In EMNLP, 2014. Veselin Raychev, Martin Vechev, and Eran Yahav. Code completion with statistical language models. In Programming Languages Design and Implementation (PLDI), pp. 419–428, 2014. Veselin Raychev, Martin Vechev, and Andreas Krause. Predicting program properties from Big Code. In Principles of Programming Languages (POPL), 2015. Veselin Raychev, Pavol Bielik, and Martin Vechev. Probabilistic model for code with decision trees. In Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), 2016. Andrew Rice, Edward Aftandilian, Ciera Jaspan, Emily Johnston, Michael Pradel, and Yulissa Arroyo-Paredes. Detecting argument selection defects. Proceedings of the ACM on Programming Languages, 1(OOPSLA):104, 2017. Michael Schlichtkrull, Thomas N. Kipf, Peter Bloem, Rianne van den Berg, Ivan Titov, and Max Welling. Modeling relational data with graph convolutional network. arXiv preprint arXiv:1703.06103, 2017. Armando Solar-Lezama. Program synthesis by sketching. University of California, Berkeley, 2008. Mingzhe Wang, Yihe Tang, Jian Wang, and Jia Deng. Premise selection for theorem proving by deep graph embedding. In Advances in Neural Information Processing Systems, pp. 2783–2793, 2017. 10 1.0 0.9 0.8 0.7 0.6 0.5 0.0 Precision True Positive Rate Published as a conference paper at ICLR 2018 SeenProjTest UnseenProjTest 0.2 0.4 0.6 0.8 False Positive Rate 1.0 (a) Precision-Recall Curve 1.0 0.9 0.8 0.7 0.6 0.5 0.0 SeenProjTest UnseenProjTest 0.2 0.4 0.6 Recall 0.8 1.0 (b) Receiver Operating Characteristic (ROC) Curve Figure 6: Precision-Recall and ROC curves for the GGNN model on VAR M ISUSE. Note that the y axis starts from 50%. Table 3: Performance of GGNN model on VAR M ISUSE per number of type-correct, in-scope candidate variables. Here we compute the performance of the full GGNN model that uses subtokens. # of candidates Accuracy on S EEN P ROJ T EST (%) Accuracy on U NSEEN P ROJ T EST (%) A 2 3 4 5 6 or 7 8+ 91.6 85.7 84.5 77.1 81.8 75.7 78.6 69.0 75.1 71.5 77.5 62.4 P ERFORMANCE C URVES Figure 6 show the ROC and precision-recall curves for the GGNN model. As the reader may observe, setting a false positive rate to 10% we get a true positive rate5 of 73% for the S EEN P ROJ T EST and 69% for the unseen test. This suggests that this model can be practically used at a high precision setting with acceptable performance. B VAR M ISUSE P REDICTION S AMPLES Below we list a set of samples from our S EEN P ROJ T EST projects with comments about the model performance. Code comments and formatting may have been altered for typesetting reasons. The ground truth choice is underlined. Sample 1 for (var port = #1 ; #2 < #3 ; { if (!activePorts.Contains( #5 )) return #6 ; } #1 #2 #3 #4 #5 #6 #4 ++) startingFrom: 97%, endingAt: 3% port: 100%, startingFrom: 0%, endingAt: endingAt: 100%, startingFrom: 0%, port: port: 100%, startingFrom: 0%, endingAt: port: 100%, startingFrom: 0%, endingAt: port: 100%, startingFrom: 0%, endingAt: 0% 0% 0% 0% 0% . The model correctly predicts all variables in the loop. 5 A 10% false positive rate is widely accepted in industry, with 30% as a maximum acceptable limit (Bessey et al., 2010). 11 Published as a conference paper at ICLR 2018 Sample 2 var path = CreateFileName( #1 ); bitmap.Save( #2 , ImageFormat.Png); return #3 ; #1 #2 #3 name: 86%, DIR_PATH: 14% path: 90%, name: 8%, DIR_PATH: 2% path: 76%, name: 16%, DIR_PATH: 8% . String variables are not confused their semantic role is inferred correctly. Sample 3 [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: input.SkipLastField(); break; case 10: { #1 .AddEntriesFrom(input, _repeated_payload_codec); break; } } } } #1 Payload: 66%, payload_: 44% . The model is commonly confused by aliases, i.e. variables that point to the same location in memory. In this sample, either choice would have yielded identical behavior. Sample 4 public override bool IsDisposed { get { lock ( #1 ) { return #2 ; } } } #1 #2 _gate: 99%, _observers: 1% _isDisposed: 90%, _isStopped: 8%, HasObservers: 2% . The ReturnsTo edge can help predict variables that otherwise would have been impossible. 12 Published as a conference paper at ICLR 2018 Sample 5 /// <summary> /// Notifies all subscribed observers about the exception. /// </summary> /// <param name="error">The exception to send to all observers.</param> public override void OnError(Exception error) { if ( #1 == null) throw new ArgumentNullException(nameof( #2 )); var os = default(IObserver<T>[]); lock ( #3 ) { CheckDisposed(); if (! #4 ) { os = _observers.Data; _observers = ImmutableList<IObserver<T>>.Empty; #5 = true; #6 = #7 ; } } if (os != null) { foreach (var o in os) { o.OnError( #8 ); } } } #1 #2 #3 #4 #5 #6 #7 #8 error: 93%, _exception: 7% error: 98%, _exception: 2% _gate: 100%, _observers: 0% _isStopped: 86%, _isDisposed: 13%, HasObservers: 1% _isStopped: 91%, _isDisposed: 9%, HasObservers: 0% _exception: 100%, error: 0% error: 98%, _exception: 2% _exception: 99%, error: 1% . The model predicts the correct variables from all slots apart from the last. Reasoning about the last one, requires interprocedural understanding of the code across the class file. 13 Published as a conference paper at ICLR 2018 Sample 6 private bool BecomingCommand(object message) { if (ReceiveCommand( #1 ) return true; if ( #2 .ToString() == #3 ) #4 .Tell( #5 ); else return false; return true; } #1 #2 #3 #4 #5 message: 100%, Response: 0%, Message: 0% message: 100%, Response: 0%, Message: 0% Response: 91%, Message: 9% Probe: 98%, AskedForDelete: 2% Response: 98%, Message: 2% . The model predicts correctly all usages except from the one in slot #3. Reasoning about this snippet requires additional semantic information about the intent of the code. Sample 7 var response = ResultsFilter(typeof(TResponse), #1 #2 #1 , #2 , request); httpMethod: 99%, absoluteUrl: 1%, UserName: 0%, UserAgent: 0% absoluteUrl: 99%, httpMethod: 1%, UserName: 0%, UserAgent: 0% . The model knows about selecting the correct string parameters because it matches them to the formal parameter names. Sample 8 if ( #1 >= #2 ) throw new InvalidOperationException(Strings_Core.FAILED_CLOCK_MONITORING); #1 #2 n: 100%, MAXERROR: 0%, SYNC_MAXRETRIES: 0% MAXERROR: 62%, SYNC_MAXRETRIES: 22%, n: 16% . It is hard for the model to reason about conditionals, especially with rare constants as in slot #2. 14 Published as a conference paper at ICLR 2018 C N EAREST N EIGHBOR OF GGNN U SAGE R EPRESENTATIONS Here we show pairs of nearest neighbors based on the cosine similarity of the learned representations u(t, v). Each slot t is marked in dark blue and all usages of v are marked in yellow (i.e. variableName ). This is a set of hand-picked examples showing good and bad examples. A brief description follows after each pair. Sample 1 ... public void MoveShapeUp(BaseShape shape ) { if ( shape != null) { for(int i=0; i < Shapes.Count -1; i++){ if (Shapes[i] == shape ){ Shapes.Move(i, ++i); return; } } } } ... ... lock(lockObject) { if ( unobservableExceptionHanler != null) return false; unobservableExceptionHanler = handler; } ... . Slots that are checked for null-ness have similar representations. Sample 2 ... public IActorRef ResolveActorRef(ActorPath actorPath ){ if(HasAddress( actorPath .Address)) return _local.ResolveActorRef(RootGuardian, actorPath .ElementsWithUid); ... ... ... ActorPath actorPath ; if (TryParseCachedPath(path, out actorPath)) { if (HasAddress( actorPath .Address)){ if ( actorPath .ToStringWithoutAddress().Equals("/")) return RootGuarding; ... } ... } ... . Slots that follow similar API protocols have similar representations. Note that the function HasAddress is a local function, seen only in the testset. 15 Published as a conference paper at ICLR 2018 Sample 3 ... foreach(var filter in configuration.Filters){ GlobalJobFilter.Filters.Add( filter ); } ... ... public void Count_ReturnsNumberOfElements(){ _collection.Add( _filterInstance ); Assert.Equal(1, _collection.Count); } ... . Adding elements to a collection-like object yields similar representations. D DATASET The collected dataset and its characteristics are listed in Table 4. The full dataset as a set of projects and its parsed JSON will become available online. Table 4: Projects in our dataset. Ordered alphabetically. kLOC measures the number of non-empty lines of C# code. Projects marked with Dev were used as a development set. Projects marked with † were in the test-only dataset. The rest of the projects were split into train-validation-test. The dataset contains in total about 2.9MLOC. Name Git SHA kLOCs Slots Vars Akka.NET 719335a1 240 51.3k 51.2k AutoMapper BenchmarkDotNet BotBuilder choco commandline† CommonMark.NETDev Dapper EntityFramework Hangfire Humanizer† Lean† Nancy Newtonsoft.Json Ninject NLog Opserver OptiKey orleans Polly 2ca7c2b5 1670ca34 190117c3 93985688 09677b16 f3d54530 931c700d fa0b7ec8 ffc4912f cc11a77e f574bfd7 72e1f614 6057d9b8 7006297f 643e326a 51b032e7 7d35c718 e0d6a150 0afdbc32 46 28 44 36 11 14 18 263 33 27 190 70 123 13 75 24 34 300 32 3.7k 5.1k 6.4k 3.8k 1.1k 2.6k 3.3k 33.4k 3.6k 2.4k 26.4k 7.5k 14.9k 0.7k 8.3k 3.7k 6.1k 30.7k 3.8k 10.7k 6.1k 8.7k 5.2k 2.3k 1.4k 4.7k 39.3k 6.1k 4.4k 28.3k 15.7 16.1k 2.1k 11.0k 4.5k 3.9k 35.6k 9.1k quartznet ravendbDev RestSharp Rx.NET scriptcs ServiceStack ShareX SignalR Wox b33e6f86 55230922 70de357b 2d146fe5 f3cc8bcb 6d59da75 718dd711 fa88089e cdaf6272 49 647 20 180 18 231 125 53 13 9.6k 78.0k 4.0k 14.0k 2.7k 38.0k 22.3k 6.5k 2.0k 9.8k 82.7k 4.5k 21.9k 4.3k 46.2k 18.1k 10.5k 2.1k 16 Description Actor-based Concurrent & Distributed Framework Object-to-Object Mapping Library Benchmarking Library SDK for Building Bots Windows Package Manager Command Line Parser Markdown Parser Object Mapper Library Object-Relational Mapper Background Job Processing Library String Manipulation and Formatting Algorithmic Trading Engine HTTP Service Framework JSON Library Code Injection Library Logging Library Monitoring System Assistive On-Screen Keyboard Distributed Virtual Actor Model Resilience & Transient Fault Handling Library Scheduler Document Database REST and HTTP API Client Library Reactive Language Extensions C# Text Editor Web Framework Sharing Application Push Notification Framework Application Launcher
2cs.AI
Queueing Analysis for Block Fading Rayleigh Channels in the Low SNR Regime arXiv:1712.05136v1 [cs.IT] 14 Dec 2017 Yunquan Dong∗ and Pingyi Fan∗† {dongyq08@mails, fpy@mail}.tsinghua.edu.cn ∗ Department of Electronic Engineering, Tsinghua University, Beijing, 100084, China; † National Mobile Communication Research Laboratory, Southeast University, China, 210096. Abstract—Wireless fading channels suffer from both channel fadings and Additive White Gaussian Noise (AWGN). As a result, it is impossible for fading channels to support a constant rate data stream without using buffers. In this paper, we consider information transmission over an infinite-buffer-aided block Rayleigh fading channel in the low signal-to-noise ratio (SNR) regime. We characterize the transmission capability of the channel in terms of stationary queue length distribution, packet delay, as well as data rate. Based on the memoryless property of the service provided by the channel in each block, we formulate the transmission process as a discrete time discrete state D/G/1 queueing problem. The obtained results provide a full characterization of block Rayleigh fading channels and can be extended to the finite-buffer-aided transmissions. Index Terms—block Rayleigh fading channel, buffer-aided communication, queueing analysis, queue length distribution, packet delay. I. I NTRODUCTION Wireless communication have found more and more applications in recent years, such as 4G cellular network, WLANs, satellite communication and high speed railway communications. Unlike the traditional wireline communications, wireless communications suffer from channel fading besides the Gaussian noise, which leads to the fluctuation of instantaneous channel capacity and brings great difficulty to the evaluation and utilization of wireless channels. Therefore, characterizing what kind of service a fading channel can provide is a key challenge in wireless communications. The transmission capability of a fading channel is often characterized by ergodic capacity [1] or outage capacity [2–4]. In particular, ergodic capacity is the statistical average value of the instantaneous capacity, which specifies the maximum transmission rate over a fading channel in a large time scale; ǫ-outage capacity is the maximum achievable transmission rate under some outage probability constraint. It is clear that ǫ-outage capacity focuses on the worst case and the reliability of communications. A part of channel service would be wasted during periods when channel condition is very good. Therefore, it is not enough to describe capability of channels only using data rate. To this end, the authors in [5] proposed a link layer channel model termed effective capacity to jointly consider parameters such as traffic rate, queue length/packet delay violations. Note that effective capacity is proposed based on large deviation theory and is accurate for some large buffers and delays. In fact, wireless communications and queueing theory are connected with each other naturally. First, due to the fluctuation of the instantaneous channel capacity, a buffer must be used at the transmitter to match the source traffic with the channel transmission capability, which is a typical queueing problem. Second, buffers are commonly used in engineering practice. Recently, Gallager and Berry discussed the optimal power allocation policy under some delay constraints in a finite-buffer aided point-to-point wireless communication system [6]. In this paper, we will consider the buffer aided communication over a block rayleigh fading channels in the low SNR (signal-to-noise) regime, using tools from queueing theory. In a nutshell, to characterize what kind of service the fading channels can provide, we examine the channel with a constant rate data input to the buffer, and describe the channel transmission capability from aspects such as queue length distribution and packet delay. Although we have assumed that the buffer is infinitely long, the results can readily be extended to the finite-buffer case. However, there are some challenges in applying queueing theory to this problem. Note that the channel gain varies block by block for fading channels. Thus, the time is discrete for fading communications. Moreover, the channel gain is a positive real number ranging from zero to infinity. Therefore, the input and output process of fading channels would be a discrete time continuous state Markov process, for which little references exists. To this end, one has to resort to other techniques such as the stochastic process method [7], transforming the continuous state space to discrete state space using quantization [8]. In this paper, we developed another method to transform the discrete time continuous states Markov process into a discrete time discrete state Markov chain. The key idea behind the formulation is the memoryless property of exponential distributions. To be specific, in one block, the service provided by a low-SNR Rayleigh fading channel follows negative exponentially distribution. Although a part of the service ability of the block has been consumed by a previous packet, the remaining service capability of this block follows the same distribution as itself, which can be seen as the service ability provided by a new block. Based on this observation, we denote the service time of a packet as the integer part of its actual service time. Thus, the state space of the queue length at discrete epochs (the beginning of blocks) will also be discrete. That is, the original discrete time continuous state queueing process is transformed in to a discrete time discrete state Markov chain. Based on this model, we investigate the stationary distribution of queue length and packet delay in closed forms in this paper. The rest of this paper is organized as follows. The channel model and the queueing model formulation is presented in Section II. The stationary queue length distribution is investigated in III, where the it is proved that the stationary distribution of the queueing process at the departure epochs and at the arbitrary epochs are the same. Average packet delay is obtained in Section IV. The obtained result is also be presented via numerical results in Section V. Finally, we concluded our work in section VI. II. S YSTEM M ODEL AND Q UEUEING F ORMULATION A. The Block Fading Channel Model Consider a point-to-point communication over a blockfading Rayleigh channel with additive white Gaussian noise (AWGN). For such a channel, the channel gain stays fixed over each block and varies independently in different blocks. Let TB be the block length, gn be the time varying channel gain during the n-th block and γn = gn2 be the corresponding power gain. Then their probability density functions (p.d.f.) are given by, respectively, 1 −x 1 −x2 pg (x) = 2 e 2σ2 , pγ (x) = 2 e 2σ2 . σ 2σ Let P denote the transmit power, W is the limited transmit bandwidth and N0 is the noise power spectral density. Let α and d denote the path loss exponent and the distance between the transmitter and receiver respectively. Then the instantaneous capacity of the block Rayleigh fading channel in nats is   γn P d−α cn = W ln 1 + W N0 and the service provided by the fading channel in one block is sn = cn TB . Then the amount of service provided by the fading P channel in k successive blocks can be expressed by k we also Sk = m=1 sm . For the convenience of notation, 2 define the average received SNR as ρ = W2σN0Pdα . By some culculation, we can get the cumulative distribution function(CDF)of the instantaneous capacity cn as Fc (x) = 1−e −1 ρ x e W −1 , which will reduce to −x Fc (x) = 1 − e W ρ in the low SNR scenario considered in this paper. Then the CDF of the service in one block (sn ) is given by Fs (x) = 1 − e −x ν , (1) where ν = W TB ρ. It can be seen that sn follows the negative exponential distribution and Sk follows the Gamma distribution, whose p.d.f. is given by −x 1 xk−1 e ν , fS (x) = Γ(k)ν k R∞ where Γ(k) = 0 e−t tk−1 dt is the Gamma function. B. The Markov Chain Model The transmission capability of the time varying fading channel is examined by a constant rate (R) data stream. An infinite length First In First Out (FIFO) buffer is used at the transmitter side to match the source traffic stream with the time varying channel service in each block. Let Q(n) be the length of the queue in the buffer in nats at the start of block n. Assume that the data are served by packets and the packet size equals to the traffic arriving at the buffer in each block, i.e., Lp = RTB . We use D(n) to denote the time that the packet arriving in block n will spend in the queue. It is seen that the queueing process Q(n) is a discrete time continuous state Markov process. Unfortunately, few results are available for such processes. Thus, some transformations are needed to construct a discrete time discrete state D/G/1 queue. Define the service time of a packet Tn as the integer part of its actual service time, i.e., the number of complete blocks of the period in which the packet is served. Firstly, the probability that a packet is served within one block can be derived as follows, p0 = Pr{Tn = 0} = Pr{sn > Lp } = e−θ , L where θ = νp . Similarly, with Fs (x), and fSk (x), the probability that a packet will be served in k (k ≥ 1) blocks can be obtained as (a) pk = Pr{T = k} = Pr{Sk ≤ Lp , Sk+1 > Lp } Z ∞ Z Lp (b) fSk (xk )dxk fs (xk+1 )dxk+1 = 0 Lp −xk (2) 1 −θ k e θ , k! where (b) holds because Sk and sk+1 are independent from each other. Most importantly, (a) is assumed to hold in the sense of the memoryless property of negative exponential distributions, which is given by the following Lemma. Lemma 1: [9] If X is an negative exponential distributed random variable, then X is memoryless, namely, = Pr{X ≤ s + t|X > s} = Pr{X ≤ t}. Therefore, when we say that the service time of a packet is Tn = k, the packet is actually completed in k + 1 blocks,as shown in (2.a). In this case, only a part of the service capability of block n + 1 is consumed. So it can continue the service for the next packet in the queue. As is shown by (1), the channel service of each block in the low SNR region follows the negative exponential distribution, which is memoryless by Lemma 1. Therefore, the remaining service capability of the n+1-th block can be seen as the service that can be provided by a new block. In this sense, the packet consumes only k blocks. Similarly, if a packet is completed within one block, it is defined that its service time is zero, i.e., Tn = 0. In this way, the problem of information transmission over a block fading Rayleigh channel is transformed into a classical discrete time D/G/1 queueing problem. Its arrival process is {An = 1, n ≥ 1} (unit: Lp ) and its service time Tn (unite: block) is a Poisson distributed random variable, whose probability generating function (PGF) is given by ∞ X pk z k = eθ(z−1) (3) G(z) = E[z Tn ] = k=0 and we have E[Tn ] = G′ (t)|t=0 = θ. Throughout the paper, it is assumed that θ < 1 so that the queue is stable. Up to now, the information transmission over the channel is formulated as an late arrival system queueing model with immediate access, in which each packet arrives at the end of a block (k − ) and leaves at the beginning of the block (k + ). The service of each packet is also assumed to start at the beginning of a block. If the service time of a packet is zero, i.e., Tn = 0, it is assumed to leave the queue immediately at the beginning of the block following its arrival. Let Q+ n be the number of packets in the queue at the arbitrary time of n+ . Usually, it is not a Markov chain. Define τn be the departure epoch of packet k and τk+1 = τk if the service time of the k+1-th packet is zero, i.e. Tk+1 = 0. Then τn+ must see either an empty buffer or the start of the service of a new packet. So τn+ is the aftereffectless point of + the queue length process. Let L+ n = Q(τn ) be the number of packets in the buffer after the departure of the n-th packet. Then {L+ n , n ≥ 1} is a Markov chain. Since the arrival process is {An = 1, n ≥ 1}, we have ( L+ L+ n − 1 + Tn+1 , n ≥ 1 + Ln+1 = Tn+1 L+ n = 0. and the transition probability matrix  p0 p1 p2  p0 p1 p2  P =  0 p0 p1  .. .. .. . . . of {L+ n , n ≥ 1} is  ··· ···   ···   .. . L j+1 X i=1 πi pj+1−i , j ≥ 0. j pj z + j=0 ∞ X z j j=0 j+1 X πi pj−i+1 i=1 1 =π0 G(z) + [L+ (z) − π0 ]G(z), z where G(z) is the PGF of the service time Tn given by (3). Solving L+ (z) from above equation, one can get L+ (z) = π0 (1 − z) π0 (1 − z)G(z) = . G(z) − z 1 − zeθ(1−z) (5) By the property of PGF, we have 1 = lim L+ (z) = z→1 π0 . 1−θ Thus, π0 = 1 − θ. With π0 and (5), Theorem 1 is proved. B. The Stationary Queue Length at the Arbitrary Epochs This subsection deals with the stationary queue length at the arbitrary epochs. Firstly, let’s introduce two Lemmas that will be used. Lemma 2: X is a discrete random variable of non-negative integers and Pr{X = k} = pk , then E[X] = E[X] = ∞ X l X l=1 k=1 (4) where θ = νp . Proof: When θ < 1, the queue is stable. According to the → → classical queueing theory, − πP=− π holds. So we have πj = π0 pj + L (z) =π0 ∞ X ∞ X Pr{X > k}. The proof of this lemma is as follows A. The Stationary Queue Length at the Departure Epochs Let L+ = limn→∞ L+ n be the limitation of the queue length process and πj = Pr{L+ = j}, j ≥ 0, then the vector ~π = {π0 , π1 , · · · } is the stationary queue length at the departure epochs. Theorem 1: If θ < 1, the PGF of the stationary queue length at the departure epochs is given by: (1 − θ)(1 − z) , 1 − zeθ(1−z) + k=0 III. Q UEUE L ENGTH D ISTRIBUTION In this section, we will perform a detailed investigation on the queue length process in terms of stationary queue length distribution. L+ (z) = Multiplying z j on the both sides of the equation and take the sum, one has pl = ∞ X ∞ X pl = k=1 l=k ∞ X Pr{X > k}. k=0 Lemma 3: X is a discrete random variable of non-negative integers and G(z) is its PGF, then ∞ X z k Pr{X > k} = k=0 Proof: ∞ X z k Pr{X > k} = j−1 ∞ X X j=1 k=0 zk k=0 k=0 = ∞ X zk 1 − G(z) . 1−z k X Pr{X = j} j=k+1 z−1 Pr{X = j} z−1 ∞ X zk − 1 1 − G(z) = Pr{X = j} = . z − 1 1−z j=1 Next, the stationary queue length at the arbitrary epochs is specified by the following theorem. Theorem 2: The stationary queue length distribution at the departure epochs and arbitrary epochs are the same. Proof: Denote the limit distribution of the queue length process at arbitrary epochs as vi = limn→∞ Pr{Q+ n = i} for i ≥ 0. Then Theorem 2 will be proved if vi = πi or V (z) = L+ (z). b n be the number of packets in the buffer at the Let L last departure epoch before n+ . It stays unchanged at every boundary points of blocks between two adjacent departure epochs, no matter how much packets arrives during this period. e n = i}. Define ui = limn→∞ Pr{L e n stays at state i and Let ∆τi be the sojourn time that L mi = E[∆τi ]. When the buffer is non-empty, the sojourn time equals to the service time of the head of line packet in the buffer. However, when the buffer is empty, it must wait one block for the arrival of the next packet first. So we have ∆τi =  1+T T i=0 and mi = i≥1  1+θ θ i=0 i ≥ 1. e n , n ≥ 0} Then P the average stationary sojourn time of {L ∞ π i mi is m = j=0 πj mj = 1. In this sense, m is a probability distribution and ui = πimmi = πi mi holds according to the theory of renewal process. Define ηk as the elapsed sojourn time at state k until n+ . P∞ Since mk = E[∆τk ] = l=0 Pr{∆τk > l}, we know that Pr{ηk = l} = m1k Pr{∆τk > l} is a distribution law, which 1 Pr{T > l − 1} for k = 0 and θ1 Pr{T > equals to 1+θ l} for k ≥ 1 Assume there are k packets left in the buffer after the e n = k. Recall departure of the last packet before n+ , i.e., L + + that Q+ n is the queue length at time n . Then Qn = j means that there are j − k packets arrived during ηk . We have j vj = X uk Pr{ηk = j − k} k=0 =π0 Pr{T > j − 1} + j X interior of C and every natural number n, we have that f (n) (z) is n-times differentiable at z0 and its derivative is f (n) (z0 ) = πk = πk = = (b) −θ 2πi I I =(1 − θ) I L+ (z) C dz z k+1 = θ(z−1) (z − 1) e z eθ(z−1) − 1 z θ(z−1) C′ (z − 1) C′ ∞  X j=1 e z j=1 zj j X 1 − G(z) 1 − G(z) + [L+ (z) − π0 ] 1−z 1−z π0 G(z)(1 − z) + = = L (z), G(z) − z (a) = π0 + π0 z where (a) follows Lemma 3. This completes the proof. C. Stationary Queue Length Distribution The stationary distribution of the queue length process can be obtained from its PGF (4), Theorem 1. For k = 0, we know that π0 = 1 − θ. Before the following discussion, let’s introduce one lemma that will be used. Lemma 4: Cauchy Integral Formula (extended) [10]. Let C be a simple closed positively oriented piecewise smooth curve on a domain D, and let the function f (z) be analytic in a neighborhood of C and its interior. Then for every z0 in the I C 1−z dz . 1 − zeθ(1−z) z k+1 dz z k+1 ∞  X eθ(z−1) z j dz z k+1  1 1 (jθ)k+j−1 − (jθ)k+j e−jθ (k + j − 1)! (k + j)! ϕk = (1 − θ) ∞ X 1 (jθ)k+j e−jθ , (k + j)! for k ≥ 0, the stationary queue length distribution turns to be πk = ϕk−1 − ϕk . πk Pr{T > j − k} k=1 1−θ 2πi j=0 j=1 ∞ X (6) P∞ θ(z−1) 1 = j=0 z j for |z| < 1 and e z <1 where (a) follows 1−z on circle C ′ , (b) follows Lemma 4 and ejθ(z−1) is analytic. Define ϕ−1 = 1 and Pr{∆τ0 > 0} = π0 . Particularly, v0 = Multiplying z j on the both sides and taking the sum, one can get j=1 1 2πi 1−θ 2πi (a) 1 πk Pr{T > j − k}. π0 Pr{T > j − 1}z j + C f (z) dz, n = 1, 2, · · · . (z − z0 )n+1 1 1−z It can be seen that function g(z) = 1−ze θ(1−z) z k+1 has two −1 singular points, namely z = 1 and z = θ W−1 (−θe−θ ), where W−1 (z) is the lower branch Lambert W function. Particularly, z = 1 is one movable singularity since limz→1 g(z) = 1 is finite. Therefore, within circle C ′ , g(z) can be considered as analytic. According to Cauchy-Goursat’s theory, the integral of g(z) along any closed curve in C ′ is a invariable. Then we have k=1 ∞ X I Let C and C ′ are both circles centered on the origin with −θ ). their radiuses r < 1 and 1 < r′ < −1 θ W−1 (−θe Since L+ (z) is convergent within the unit circle, for k ≥ 1, the stationary can be expressed by u0 m0 V (z) = π0 + n! 2πi IV. PACKET D ELAY The packet delay D is defined as the time interval between the arrival of a packet and its departure. Firstly, the packet delay consists of a service time T . If the packet arrives seeing a non-empty buffer, it must wait for a waiting time W for its service. Finally, for the formulation in this paper, there is another piece of time that the packet spends in the system, i.e., the vestige time V . In this paper, T = k means that the service of a packet is not finished until the k + 1-th block. According to the memoryless property of negative exponential distribution, although part of the service ability of the k + 1th block has been consumed, it is considered as a brand new block. However, the packet still has to spend a part of that block in the system, which is called the vestige time. Thus, we know that D = T + W + V. (7) Next, the CDF of Vk− is Theorem 3: In the FIFO discipline, the average packet delay is given by Z 1 −θ θ2 1 + (x − 1)e x dx. E[D] = + θ + 2 2(1 − θ) 0 Proof: Since there is only one packet arrives in each block, the average time that a packet stays in the system (S + W ) equals to the average queue length by the Little’s law. So we have E[S + W ] = E[L+ ] = lim L+ (z) = z→1 θ(2 − θ) . 2(1 − θ) (8) To investigate the vestige time V , we have to define some new random variables. Firstly, for k ≥ 1, define U k = L p − Sk , Vk = Uk+ , sn FV − (x) = Pr{Vk− ≤ x|Vk < 1} = k = where sn is the service provided by the channel in one block and Sk is the total amount of service provided by k successive blocks. By the definition, Uk is the remaining part of packet after k blocks of transmission, if it is positive. Using a positive condition, we get Uk+ . Assuming the channel service of the next block is sn , the remaining amount of data Uk+ needs Vk blocks to be transmitted. However, Vk is the vestige time only if the remaining data can be transmitted within this block, which turns to Vk+ . As we can see, Uk ∈ (−∞, Lp ), Uk+ ∈ (0, Lp ), Vk ∈ (0, ∞) and Vk+ ∈ (0, 1). Particularly, the CDF of Uk is FUk (x) = Pr{Uk ≤ x} = Pr{Sk ≥ Lp − x} Z ∞ 1 = tk−1 e−t dt, Γ(k) Lpν−x R ∞ k−1 −t 1 e dt is the upper Gamma where Γ(k, x) = Γ(k) x t function and ν = W TB ρ. Therefore, the CDF of U + is FU + (x) = Pr{Uk+ ≤ x|Uk+ > 0} k R∞ k−1 −t Lp −x t e dt − Γ(k, θ) = ν , γ(k, θ) R x k−1 −t 1 t e dt is the lower Gamma where γ(k, x) = Γ(k) 0 function. Since Uk+ and the channel service of the next block (sn ) are random variables independent from each other, the CDF of Vk can be derived as follows. FVk (x) = Pr{Vk ≤ x} = Pr{Uk+ ≤ xsn } ZZ = dFU + (u)dFs (s) k D Z Lp 1 u 1 (Lp − u)k−1 e− ν (Lp −u+ x ) du. = k ν γ(k, θ) 0 Z Lp 0  Lp − u Lp k−1 u 1 e ν (1− x ) du, for x ∈ (0, 1) and the average of Vk− will be k−1 Z 1 Z Lp  k 1 Lp − u u E[Vk− ] = 1 − e ν (1− x ) dxdu, Lp 0 0 Lp L For the case of k = 0, define V0 = snp and V0− = V0 |V0 <1 . Specifically, if one packet is completed within one block, the vestige time equals to its actual service time. The CDF of V0 and V0− are, respectively Uk+ = Uk |Uk >0 , Vk− = Vk |Vk <1 , k Lp Pr{Vk < x} Pr{Vk < 1} θ = Pr{V0 ≤ x} = e− x , x ∈ (0, +∞) 1 = Pr{V ≤ x|V < 1} = eθ(1− x ) , x ∈ (0, 1). FV0 (x) FV − (x) 0 0 0 Then we can get the expected value of V0− Z 1 θ E[V0− ] = 1 − eθ e− x dx. 0 Finally, by the whole probability formula, the expected value of vestige time V is E[V ] = E[V0− ] Pr{T = 0} + ∞ X E[Vk− ] Pr{T = k}, k=1 where ∞ X E[Vk− ] Pr{Tn = k} k=1 k−1 Z 1 Z Lp X ∞  u 1 k Lp − u 1 θ e−θ e ν (1− x ) dxdu θ Lp 0 0 k=1 Lp k! Z 1 −θ + xe x dx. =1 − e−θ − = 1 − e−θ 2 0 With this result, we have E[V ] = 1 + 2 Z 1 (x − 1)e −θ x dx 0 and will complete the proof by combing (7) and (8). V. N UMERICAL R ESULTS In this section, we provide some numerical results to illustrate the stationary distribution and packet delay for the infinite buffer model. The component variance is assumed as σ 2 = 1, the system bandwidth is 5 KHz and transmitting power is −10 dBW. Suppose that the distance between the transmitter and the receiver is 1000 m and the pathloss exponent is 4. The block length is chosen as TB = 10−4 s. According to the L definition, we have θ = W TpB ρ . Besides, we have Lp = RT B and the equivalent AWGN capacity of the channel is Ca = W ρ in the low SNR region. 0.45 E[D] 0.4 E[V] 0.3 0.2 0.1 0 0.2 0.4 θ 0.6 0.8 1 The stationary distribution of the infinite−buffer model 10 0.5 The Vestige time The average packet delay, unit:blocks 60 50 40 30 20 0 10 −10 10 0.8 −20 10 0.6 −30 10 0.4 θ=0.2 θ=0.5 θ=0.8 0.2 0 0 −40 10 −50 10 −60 10 20 30 40 10 50 k Fig. 1. The average packet delay of the infinite-buffer model. E[D] corresponds to the log-scale y-axis on the left while E[V] corresponds to the linear y-axis on the right. Fig. 2. The stationary queue length distribution of the infinite-buffer model. Each curve is presented both in linear y-axis on the left and log-scale y-axis on the right. Therefore, θ can also be seen as the ratio between traffic rate and AWGN capacity. It is seen in Fig. 1 that the average delay grows quickly with θ. Particularly, the average delay corresponds to the log-scale y-axis on the left and the average vestige time corresponds to the linear y-axis on the right, both in blocks. It is seen that the average vestige time E[V ] is also increasing with θ but never exceeds 0.5. The stationary queue length distribution of the infinitebuffer model is shown in Fig. 2 for θ = 0.2, 0.5, 0.8, where they are presented in both linear and log-scale y-axis. It is clear that the larger θ is, the slower πk decreases. This is easy to understand because heavier traffic leads to longer queues. Most importantly, as the queue length grows, the probability that it occurs decreases approximately exponentially. [2] G. Caire and S. Shamai(Shitz), “On the achievable throughput of a multiple- antenna Gaussian broadcast channel,” IEEE Trans. Inf. Theory, vol. 49, no. 7, pp. 1691-1706, Jul. 2003. [3] A. S. Avestimehr and D. N. C. Tse, “Outage capacity of the fading relay channel in the low SNR regime”, IEEE Trans. Inf. Theory, vol. 53, no. 4, pp. 1401-1415, Apr, 2007. [4] L. Li and A. J. Goldsmith, “Capacity and optimal resource allocation for fading broadcast channels: Part II: Outage capacity,” IEEE Trans. Inf. Theory, vol. 47, no. 3, pp. 1103-1127, Mar. 2001. [5] D. Wu and R. Negi, “Effective capacity: a wireless link model for support of quality of service,” IEEE Trans. Wireless Commun., vol. 2, no. 4, pp. 630-643, July 2003. [6] R.A. Berry and R.G. Gallager, “Communication over fading channels with delay constraints,” IEEE Trans. Inf. Theory, vol. 48, no. 5, pp. 1135-1149, May. 2002. [7] Y. Dong, P. Fan, K. B. Letaief, and R. D. Murch, “ǫOverflow Rate: Buffer-aided Information Transmission over Nakagami-m Fading Channels,” in IEEE 8th International Wireless Commun. & Mobile Comput. Conf. Limassol, CyprusAugust, 2012, pp.19-23. [8] Y. Dong, P. Fan, K. B. Letaief and R. D. Murch, ”Performance Analysis for Buffer-Aided Communication over Block Rayleigh Fading Channels: Queue Length Distribution, Overflow Probability and epsilon-Overflow Rate”, Wireless Commun. and Mobile Conput., 2012, 11, 20, online published. [9] P. Fan, Stochastic Process: Theory and Applications, Press of Tsinghua University, pp. 84, April. 2006. [10] Xi’an Jiaotong University Advanced Mathimatics Lab, Complex Variable Functions, Press of Advanced Education, pp. 87, Aug. 2002. VI. C ONCLUSION Modern communications requires wireless channels to provide QoS guaranteed services. How to characterize and make full use of the service capability of fading channels is an urgent problem. In this paper, we studied the problem for low-SNR block Rayleigh fading channels by using the memoryless property of block services. However, for general fading channels, the answers are quite unclear, which needs a lot of further efforts. ACKNOWLEDGEMENT This work was supported by the China Major State Basic Research Development Program (973 Program) No. 2012CB316100(2), National Natural Science Foundation of China (NSFC) No. 61171064, NSFC No. 61021001 and the open research fund of National Mobile Communication Research Laboratory, Southeast University, China. R EFERENCES [1] R. McEliece and W. Stark, “Channels with block interference,” IEEE Trans. Inf. Theory, vol. 30, no. 1, pp. 44-53, Jan, 1984.
7cs.IT
1 Interference Mitigation Techniques for Coexistence of 5G mmWave Users with Incumbents at 70 and 80 GHz arXiv:1801.05405v1 [cs.IT] 16 Jan 2018 Ghaith Hattab, Student Member, IEEE, Eugene Visotsky, Member, IEEE, Mark Cudak, Member, IEEE, and Amitava Ghosh, Fellow, IEEE Abstract The millimeter wave spectra at 71-76GHz (70GHz) and 81-86GHz (80GHz) have the potential to endow fifth-generation new radio (5G-NR) with mobile connectivity at gigabit rates. However, a pressing issue is the presence of incumbent systems in these bands, which are primarily point-topoint fixed stations (FSs). In this paper, we first identify the key properties of incumbents by parsing databases of existing stations in major cities to devise several modeling guidelines and characterize their deployment geometry and antenna specifications. Second, we develop a detailed interference framework to compute the aggregate interference from outdoor 5G-NR users into FSs. We then present several case studies in dense populated areas, using actual incumbent databases and building layouts. Our simulation results demonstrate promising 5G coexistence at 70GHz and 80GHz as the majority of FSs experience interference well below the noise floor thanks to the propagation losses in these bands and the deployment geometry of the incumbent and 5G systems. For the few FSs that may incur higher interference, we propose several passive interference mitigation techniques such as angular-based exclusion zones and spatial power control. Simulations results show that the techniques can effectively protect FSs, without tangible degradation of the 5G coverage. Index Terms This paper will be presented in part at the IEEE Global communications Conference (Globecom), Singapore, December 2017 [1]. G. Hattab was with Nokia Bell Labs. He is currently with the Department of Electrical Engineering, University of California, CA, USA. E. Visotsky, M. Cudak, and A. Ghosh are with Nokia Bell Labs in Arlington Heights, IL, USA. (email: [email protected],{eugene.visotsky, mark.cudak, amitava.ghosh}@nokia-bell-labs.com). 2 5G, coexistence, interference management, spectrum sharing, mmWave, wireless backhaul. I. I NTRODUCTION Fifth-generation new radio (5G-NR) is envisioned to be the first cellular standard with millimeter wave (mmWave) spectrum access [2], [3]. Such paradigm shift towards mmWave access is necessary to scale with the explosive growth of mobile traffic and to provide unparalleled network capacity, with peak data rates reaching tens of Gbps [4]. Indeed, the mmWave spectrum has attracted significant attention from standard bodies, industry, and the academic community, culminating recently when the Federal Communications Commission (FCC) has opened up 3.85GHz of licensed spectrum for cellular services, and specifically at 28GHz (27.5-28.35GHz) and 39GHz (37-40GHz) [5]. Nevertheless, there is still an additional 10GHz of licensed spectra at 70GHz (71-76GHz) and 80GHz (81-86GHz) that are left for future consideration as candidate bands for mmWave mobile networks [5], [6]. The advantages of using 70GHz and 80GHz bands, also known as the e-band, are twofold. First, each band can easily provide a contiguous high bandwidth, e.g., 2GHz, in contrast to 28GHz and 39GHz, where each provides a maximum of 850MHz and 1.6GHz, respectively. Second, the e-band is available worldwide, enabling economies of scale through universal adoption of common mmWave devices. Equally important, operating at the higher end of the mmWave spectrum is not significantly different from operating at 28GHz as the channel models are the same [7], and the increase in path loss can be compensated by using an array with a larger number of antenna elements. In addition, several prototypes have shown the feasibility of mmWave systems over 70GHz. For instance, Nokia and Huawei have already demonstrated experimental 5G systems designed to operate at 73.5 GHz [8]–[10]. One key challenge of using the 70GHz and 80GHz bands is the presence of existing incumbents, which are primarily fixed stations (FSs) that provide point-to-point services such as wireless backhaul. Per FCC regulations, these incumbents must be protected from harmful interference. Thus, our objective is to study the feasibility of the coexistence of 5G systems with existing FSs and to develop interference mitigation techniques that ensure harmonious spectrum sharing. 3 A. Related work Several works have studied spectrum sharing paradigms for mmWave networks [11]–[13]. However, these works have solely focused on sharing among different mobile operators, e.g., sharing frequency channels, infrastructure, etc. Spectrum sharing of 5G systems and other services has recently attracted attention. For instance, the work in [14]–[16] focus on the 5G coexistence with radar systems, whereas the work in [17] studies the coexistence with WiFi. While these aforementioned works are limited to sub-6GHz, the mmWave access paradigm has also spurred interest in coexistence studies. For example, the work in [18] and [19] study the feasibility of 5G coexistence with incumbents at 28GHz, which are satellite systems, and the coexistence with fixed service at 39GHz. A more relevant work to this paper is the one in [20], which studies the coexistence of 5G with FSs at 70GHz. However, the work makes several modeling assumptions, e.g., only a single FS is assumed to exist at a fixed distance from the 5G system and only a fixed portion of links are assumed to be non-line-of-sight (NLOS). In addition, the work in [20] focuses on the 5G downlink (DL) interference. To mitigate the uplink (UL) interference, a probing device is proposed to be installed on the FS to report excessive interference to the 5G system. In this work, however, we focus on UL passive interference mitigation techniques, i.e., we propose techniques that do no require any coordination between the 5G system and the incumbents or require probing devices. B. Contributions The main contributions of this paper are summarized as follows. • Characterizing the incumbent FS: We analyze databases of exiting FSs in four major areas in the United States to characterize the deployment geometry of FSs and their key antenna specifications. Such analysis provides key insights on the feasibility of 5G coexistence as well as provide benchmarks for accurate modeling of FSs, which can be of interest to the academic community. • 5G Uplink Interference Analysis: We present a detailed interference analysis framework to compute the aggregate uplink (UL) interference from 5G users into FSs. We also present random models for user’s azimuth and elevation antenna directions to help reduce the simulator complexity without degrading the simulation’s accuracy. • Passive interference mitigation: We propose several passive interference techniques that do not require any coordination between the 5G system and the incumbent systems. Specifically, 4 we propose sector-based and beam-based exclusion zones where 5G base stations (gNBs) switch off certain beams to protect victim FS receivers. While these techniques are shown to be effective, they can affect the 5G downlink (DL) coverage. Thus, we propose spatial power control, defining quiet beams where associated users transmit at lower power. We discuss the implementation of such techniques for 5G-NR. The coexistence feasibility and the effectiveness of the proposed mitigation techniques are validated via three case studies, where we deploy 5G systems in dense urban and suburban areas. The studies use the databases of existing FSs and actual building layouts for accurate interference analysis. Our results have shown that the majority of FSs are protected from harmful interference due to the high propagation losses at 70GHz and 80GHz, the high attenuation due to the misalignment between the user and the FS’s antenna boresight, and the deployment geometry of FSs and 5G systems. For the few FSs that experience higher interference, the proposed mitigation techniques provide significant protection, and they are more effective than switching off gNBs that are in vicinity of FSs. Finally, as a by-product of the simulation set-up, we validate the performance of 5G networks in 70GHz and 80GHz and show the distribution of the beams used by the gNB and the user, making design insights for mobile operators and vendors. C. Paper Organization The rest of the paper is organized as follows. The system model is presented in Section II. The study of FSs’ deployment and the interference analysis framework are presented in Section III and Section IV, respectively. The proposed mitigation techniques are discussed in Section V. Simulation results are presented in Section VI, and the conclusions are drawn in Section VII. II. S YSTEM M ODEL A. 5G base stations (gNBs) We consider a street-level deployment of gNBs such that each one is deployed at a street corner at height hg and the inter-site distance (ISD) between every site is approximately dISD .1 Each site consists of four sectors, i.e., each sector covers an area of 90◦ . 1 In the simulation set-up, gNBs are initialized in a grid with a fixed ISD of dISD , and then the location of each gNB in the grid is moved in the vicinity of its initial location to ensure it lies on a street corner, resembling an actual deployment of gNBs. 5 ܰ୥ǡ୴ 2 TxRUs ܰ୥ǡ୦ Covers a sector Fig. 1: An illustrative example of a 5G gNB site. Each sector is equipped with a large-scale cross-polarized antenna array of size Ng,h ×Ng,v ×2. The antenna array is assumed to be tilted downward at angle φg . Each antenna element has a gain of Gg and a transmit power of Pg and is half-wavelength apart from the nearest antenna element. The gNB site is illustrated in Fig. 1. B. 5G Users We only consider outdoors user equipment terminals (UEs), that are randomly deployed over space, as FSs are outdoors and the attenuation due to penetration losses for indoor UEs is very high at 70GHz and 80GHz. Each UE is equipped with a cross-polarized antenna array of size Nu,h × Nu,v × 2, where each antenna element has a gain and a transmit power of Gu and Pu , respectively. The UE array height is assumed to be hu , and it is titled upward at angle φu . The UE is also assumed to have two panels, i.e., two sectors, with each one covering 180◦ . Thus, the user can sense beams in all directions, but only one panel will be active after user and beam association. During cell selection and association, the UE measures the received power of reference signals sent over different beams from gNBs in vicinity of the UE. Then, the UE connects to the beam with the highest received power.2 C. Incumbent Fixed Stations We consider FSs that operate in the 71-76GHz and 81-86GHz bands, and they are currently registered in the FCC’s database as incumbents are required to be in the database for operating 2 Other beam association algorithms or criteria can be considered, e.g., iterative beam association [21]–[23]. 6 gNB Antenna Pattern (Steering orientation=45 °) -10 -20 -30 -40 -20 20 40 60 80 100 -20 -40 -60 -90 120 Azimuth angles (degrees) gNB Antenna Pattern (Steering orientation=-6 °) -45 -10 -20 -30 -40 0 45 90 135 180 225 270 Azimuith angles (degrees) UE Antenna Pattern (Steering orientation=6 °) 0 Antenna gain (dBi) 0 Antenna gain (dBi) 0 UE Antenna Pattern (Steering orientation=90 °) 0 Antenna gain (dBi) Antenna gain (dBi) 0 -20 -40 -60 -60 -40 -20 0 20 Elevation angles (degrees) (a) gNB beams 40 60 -60 -40 -20 0 20 40 60 80 Elevation angles (degrees) (b) UE beams Fig. 2: The different beams that can be used in each dimension. in these bands. Thus, their exact three-dimensional locations are used. Similarly, we extract their antenna specifications, e.g., beamwidth, gain, azimuth orientation, and tilt. While different FSs may operate at different center frequencies in the aforementioned bands, we assume in this paper that all of them share the same spectrum with the 5G system, as a worst case scenario. D. Antenna Patterns For beam association and data communications, the gNB can use one of the 4Ng,h Ng,v available beams, where we assume the number of beams per dimension is twice the number of antennas BW ≈ in that dimension. The azimuth (or elevation) beam pattern beamwidth is approximately θg,BP 102/Ng,h (or φBW g,BP ≈ 102/Ng,v ) [24]. We further assume a parabolic element pattern such that the normalized azimuth and elevation attenuations are, in dB, [25] !2 !2 θ φ Ag,EP (θ) = 12 and Ag,EP (φ) = 12 , BW θg,EP φBW g,EP (1) BW where θg,EP and φBW g,EP are the element pattern 3dB beamwidths in azimuth and elevation, respectively. The same definitions are applied for the UE side, replacing the subscript g with u. Fig. 2 shows one example of the antenna patterns of 5G gNBs and UEs. It is assumed that the gNB and UE arrays are, respectively, of size 16 × 8 × 2 and 4 × 4 × 2. For the incumbent system, we assume all FSs have antenna patterns that, at least, meet the FCC’s regulation as specified in [26]. Essentially, the regulation specifies the minimum radiation suppression for a given angle from the centerline of the main beam. Fig. 3 shows the normalized antenna gain for a given off-axis angle. Due to the high directivity of the FS’s antenna, it is 7 0 Normalized Antenna Gain (dBi) -10 -20 -30 -40 -50 -60 0 10 20 30 40 50 60 70 80 90 Off-axis elevation/azimuth angles (degrees) Fig. 3: The FS antenna pattern in one dimension per FCC regulations [26]. TABLE I: Main parameters and their values if applicable Symbol h(·) dISD N(·),h N(·),v φ(·) G(·) P(·) BW θ(·),(·) φBW (·),(·) A(·),FTBR F(·) B fc xa da→b PLa→b X (·) β G(·),max Description Height of gNB or UE Inter-site distance Number of columns in an array Number of rows in an array Antenna tilt Antenna gain Antenna transmit power 3dB beamwidth of beam/element patterns in azimuth 3dB beamwidth of beam/element patterns in elevation Front-to-back ratio loss Noise figure Channel bandwidth Carrier frequency (x, y)-coordinates of a 2D distance from a to b (m) Path loss from a to b (dB) Log-normal shadowing with standard deviation of σ(·) Indicator variable that denotes a blockage event Maximum antenna gain (dBi) Value(s) if applicable hg = 6m; hu = 1.5m dISD = 200m Ng,h = 16; Nu,h = 4 Ng,v = 8; Nu,v = 4 φg = −6◦ ; φu = 6◦ Gg = Gu = 5dBi Pg = 7dBm; Pu = 1dBm BW = 6◦ ; θ BW = 25◦ ; θ BW = θ BW = 65◦ θg,BP u,BP g,EP u,EP ◦ BW ◦ BW BW ◦ φBW g,BP = 12 ; φu,BP = 65 ; φg,EP = φu,EP = 65 Af,FTBR = 55dB; Ag,FTBR = Au,FTBR = 30dB Fu = 9dB B = 1GHz fc = {73.5, 83.5}GHz σLOS = 4dB; σNLOS = 7.82dB Blockage: β = 1; No blockage: β = 0 shown that a slight misalignment with the main boresight is enough to incur significant signal attenuation. A summary of the main parameters used is provided in Table I. III. A NALYSIS OF FS S D EPLOYMENT In this section, we study the deployment of FSs to get some guidelines on their deployment geometry and features. The insights help understand how the deployment of FSs affects the coexistence with 5G systems. Equally important, they can be also used as a benchmark for modeling FSs using stochastic-based approaches [27]. We parse the databases of FSs deployed in four major metropolitan areas: Chicago, New York, Los Angeles, and San Fransisco. Each database covers an area of radius 300km. Table 8 TABLE II: Current number of links and pairs in each database Database Chicago New York Los Angeles San Francisco No. of links 1743 5303 1013 1892 No. of pairs 512 1685 911 1801 II summarizes the analyzed databases. A link is defined as a two-way communication between two FSs, whereas a pair is defined as a link with unique spatial coordinates of the FSs. Thus, the same pair could have multiple links, each over a different channel in 70GHz and/or 80GHz. A. Spatial Distribution We first analyze the spatial distribution of these FSs. Fig. 4a shows their density with variations of the region’s radius, where the center of the region is a city center (e.g., Willis Tower for Chicago, the Empire State Building for New York, and the financial districts of Los Angeles and San Fransisco). It is evident that FSs are non-uniformly distributed over space, and specifically they tend to have higher density near city centers while they become very sparsely deployed in suburban areas. Overall, FSs have low density relative to existing cellular networks. Fig. 4b shows the average height of FS deployment for a given density. It is shown that, except for San Francisco, the average height generally increases in denser areas compared to lightly dense areas, showing that the deployment height appears to be correlated with the average building heights in these areas. From the 5G coexistence perspective, this implies that the density of FSs in urban areas should not be worrisome as these stations tend to be deployed at altitudes that are above 5G cell sites. In contrast, FSs are likely to be deployed at relatively low heights in suburban areas, yet their density is very low in such regions. Fig. 4c and Fig. 4d show the cumulative density function (CDF) and the probability density function (PDF) of the FSs’ deployment height. The average and median heights are at least 34m and 19m, respectively. More importantly, 95% of FSs are deployed above 12m for most metropolitan areas. Note that for LA, the fifth percentile is 2m, but this is relative to ground, i.e., many of FSs in LA are actually deployed on hills. Since 5G sites are expected to be deployed at heights of four to six meters, gNBs will be below the majority of FSs, limiting the 5G interference on FSs and vice versa. 9 102 10 70 Chicago New York Los Angeles San Francisco 1 Chicago New York Los Angeles San Francisco 65 Average height (m) Density (per km 2 ) 60 100 10-1 10 -2 55 50 45 40 35 0 50 100 150 200 250 10-3 300 Radius (km) Chicago 0.02 Avg.= 63.3m median=43.5m 5th=12.4m 95th=179.3m 0.5 Avg.= 34.1m median=19.2m 5th=2m 95th=121.8m 0.4 0.3 0.1 0.01 0.005 Avg.= 48.7m median=31.7m 5th=13.5m 95th=133.5m 0 Chicago New York Los Angeles San Francisco 200 400 20 40 60 80 100 120 140 160 180 200 (c) CDF of FSs’ height 0.01 0 0.02 0.01 200 400 600 Height (m) San Francisco 0.03 0.03 0.02 0.01 0 0 100 200 300 Height (m) Height (m) 0.02 600 Height (m) Los Angeles 0 0 0 102 0 0 0.04 Avg.= 34.6m median=22.6m 5th=17.3m 95th=110.4m 0.2 0.015 Histogram 0.6 101 New York 0.03 Histogram Histogram 0.9 0.7 100 (b) Average height for a given density 1 0.8 10-1 Density (per km 2 ) (a) Density with variations of region’s radius CDF 10-2 Histogram 10-3 400 0 100 200 300 Height (m) (d) PDF of FSs’ height Fig. 4: FSs’ spatial deployment. B. Antenna Specifications Another critical aspect of FSs’ deployment is their physical antenna orientation. Fig. 5b shows the histogram of the antenna’s tilt, verifying that the vast majority of FSs have their tilt angles pointing horizontally. For instance, more than 93% of FSs have their tilt angles within [−10, 10] degrees. There are only few FSs with high negative tilts, i.e., they point to the street level. These FSs, however, are typically deployed on top of high-rise buildings as verified in Fig. 5b. In other words, there is a correlation between the deployment height and the negative tilt. Thus, although these FSs will have a higher chance to experience UE interference, as they point to the ground, 5G signals will typically experience a larger path loss given the height of these FSs. Another key feature of FSs is their high antenna gain. Indeed, as shown in Fig. 5c, the antenna gain is typically from 40dBi to 55dBi. Such high gains are necessary for long-range coverage at millimeter wave frequencies, but can be troublesome for other transmitter-receiver pairs in vicinity. For this reason, the maximum 3dB beamwidth, per FCC regulations, should be less than or equal to 1.2◦ [26]. This is verified in Fig. 5d, where the vast majority of FSs have beamwidths 10 0 -40 40 Tilt (degrees) Los Angeles 0.25 0.2 0.1 0 20 Tilt (degrees) San Francisco 0 20 0.1 0 -40 40 -20 0 20 0.1 0.04 50 Max Antenna Gain (dBi) Los Angeles 0.04 0.2 0.05 40 50 Max Antenna Gain (dBi) 60 50 0 100 50 0 -60 Height (m) 0 -40 -20 0 Tilt (degrees) Chicago 4 2 1 0.05 50 60 2 0 0.5 1 1.5 0 Beamwidth (degrees) Los Angeles 4 2 0.5 1 1.5 Beamwidth (degrees) San Francisco 8 0 Max Antenna Gain (dBi) 3 1 0 6 0.1 New York 5 3 60 Max Antenna Gain (dBi) San Francisco 40 -20 150 0 40 0.15 0 30 -20 Tilt (degrees) 4 0.06 0 30 60 Histogram Histogram 40 -40 -40 Tilt (degrees) San Francisco Tilt (degrees) (b) Average height for a given tilt New York 0.02 0.1 0 30 0 -60 Histogram 0.02 0.15 100 Histogram 0.06 150 200 200 0.08 Histogram Histogram 0.08 200 50 -60 0 Tilt (degrees) Los Angeles Tilt (degrees) Chicago -20 300 40 (a) Tilt histograms 0 30 -40 400 0.15 Tilt (degrees) 0.1 0 -60 40 0.05 -20 200 100 -20 0.2 0.3 0 -40 0.1 400 Histogram 20 0.2 Histogram 0 New York 300 250 Height (m) Histogram 0.4 -20 Chicago 600 0.3 Height (m) Histogram 0.05 Histogram Histogram 0.1 0 -40 New York 0.4 Height (m) Chicago 0.2 0.15 6 4 2 0 0 0.5 1 Beamwidth (degrees) (c) Beamwidth histograms 1.5 0 0.5 1 1.5 Beamwidth (degrees) (d) PDF of FSs’ height Fig. 5: FSs’ antenna information. at 1◦ . From a 5G coexistence perspective, the UE must be tightly aligned with the FS for it to cause tangible interference. Otherwise, most 5G signals will be highly attenuated, falling outside the FS receiver’s beam (cf. Fig. 3). C. Comments on incumbent modeling and 5G coexistence The aforementioned analysis of the different incumbents’ databases helps provide several modeling guidelines of incumbent FSs. For instance, using the popular homogeneous Poisson Point Process (HPPP) [27] to model the locations of FSs may not be practical if the region of interest is large, as FSs tend to be non-uniformly distributed over space. In addition, due to the disparities between the height of FS deployment and the 5G mmWave deployment, it is more meaningful to consider three-dimensional stochastic processes (or two-dimensional processes with the third dimension being a constant that reflects the mean height of the buildings in a given area). For antenna parameters, it is observed the majority of FSs have similar characteristics, and thus it suffices to assume all of them have the same antenna gain and beamwidth, and further assume they point horizontally in elevation. 11 From a coexistence perspective, the deployment strategy of FSs is favorable for future 5G deployment over 70GHz and 80GHz for the following reasons: • FSs are generally deployed above 12m, whereas 5G cell sites will be only at 4 to 6 meters above the ground for street level deployment, and hence they will be well below FSs. • The vast majority of FSs are oriented horizontally, i.e., they are directed above 5G deployments. For the few FSs that point to the street level, these are typically at high altitudes, increasing the path loss between the UE and the FS. • The ultra-narrow beamwidths of FSs can help significantly attenuate UE interfering signals when they fall outside the main lobe. IV. A NALYSIS OF UE I NTERFERENCE ON FS S In this section, we present our framework to compute the aggregate interference from the 5G system into incumbent systems. The approach used is applicable to the coexistence of any two wireless communication systems that rely on directional beams, and it is summarized in Fig. 6. We focus on the 5G system operating in the uplink mode, i.e., we study the UE interference into FSs, for the following reasons. First, UEs typically have positive tilt angles compared to 5G gNBs, and thus the former are more likely to interfere with FSs. Second, the mobility of UEs makes their locations appear random, while gNBs’ deployment can be optimized to ensure minimal interference on FSs. The interference seen at a victim FS is an aggregation of all UEs in vicinity transmitting in the UL to their respective gNBs. Such aggregated interference depends mainly on three components: (i) The path loss between the UE and the FS, (ii) the attenuation due to the FS’s antenna pattern, and (iii) the attenuation due to the UE’s antenna pattern. We describe each one in details next. In what follows, xu , xf , and xf,tx denote the (x, y)-coordinates of the interfering UE, the victim FS receiver, and the corresponding FS transmitter, respectively. In addition, da→b denotes the 2D distance between a and b while a • b denotes the dot product between two vectors a and b, i.e., aT b. A. Path Loss between a User and a Fixed Station Signals can be significantly attenuated if they are blocked by objects at mmWave frequencies, i.e., it is critical to consider whether the link is LOS or NLOS for path loss computations at 12 Compute path loss (LOS/NLOS) between victim and interferer Compute attenuation at victim antenna in azimuth and elevation Compute Interferer’s effective EIRP in azimuth and elevation Compute aggregate interference from all interferers into the victim Fig. 6: A general framework of computing the aggregate interference from an interfering transmitter into a victim receiver, where both rely on directional data communications. such high frequencies. To this end, we use the 3GPP path loss model [25], which is expressed, in dB, as3 PLu→f = 1(β=0) PLLOS (xu , xf , hu , hf , fc ) + 1(β=1) PLNLOS (xu , xf , hu , hf , fc ) + X (β), (2) where PLLOS (·) is the line-of-sight (LOS) path loss, PLNLOS (·) is the non-LOS (NLOS) path loss, X is the log-normal shadow fading, β ∈ {0, 1} is a binary variable that indicates whether the UE-FS is blocked by a building or not, and 1(·) is the indicator function. We note that PLLOS and PLNLOS are functions of the distance between the UE and the FS, their heights, and the center frequency fc , as given in [25]. Essentially, the path loss is a multi-slope model with different path loss exponents depending on the distance between the UE and the FS. Also, the standard deviation of the log-normal shadow fading depends on whether the link is LOS or NLOS [25]. In the 3GPP model [25], a probability function, that depends on the distance, is used to determine whether the link is LOS or NLOS. In this work, we rely on actual building layouts to determine such events. We define a blockage event as having the UE-FS blocked by a building. This is computed as follows. Assuming the xy-plan represents the ground, we first check whether the line that connects between the UE and the FS is blocked by a building, which is defined as a 2D polygon. 3 The model can be generalized to include indoor losses and indoor-to-outdoor penetration losses, when UEs are located indoors, as shown in [25]. 13 ݄୤ ݄෨ ݄୆୐ ݄୳ ݀୳՜୤ ݀୳՜୆୐ Fig. 7: A blockage event in 3D occurs when h̃ + hu ≤ hBL . If the polygon does intersect with the line, we then check whether it blocks the line with the 3D version of the polygon, where the third dimension is the building’s height, hBL . Specifically, let du→BL be the distance between the UE and the building and du→f be the distance between the UE and the FS. Then, a blockage event occurs if h̃ + hu ≤ hBL , where    hf − hu −1 h̃ = du→BL × tan tan . du→f (3) This is visualized in Fig. 7. B. Attenuation due to FS Antenna Pattern As illustrated in Fig. 3, a small misalignment between the received signal and the FS’s antenna boresight results in significant attenuation. Thus, it is critical to accurately compute the interfering signal angle-of-arrival at the FS antenna. Define the line connecting the UE to the FS as the off interference axis. Let the off-axis azimuth angle θf→u be the angle between the FS’s antenna boresight and the interference axis, then we have off θf→u = cos−1 (uf→f,tx • uf→u ) , (4) xf,tx −xf is the unit vector in the azimuth direction of the FS’s antenna boresight, kxf,tx −xf k xu −xf is the unit vector from the FS’s antenna towards the UE. Similarly, let φoff f→u kxu −xf k where uf→f,tx = and uf→u = be the off-axis elevation angle, then it can be shown that   hf − hu off −1 φf→u = tan + φf , df→u (5) where φf is the FS’s antenna tilt. Both off-axis angles are shown in Fig. 8a. Finally, the combined azimuth and elevation attenuation at the FS victim receiver is expressed as  off Gf→u = Gf,max − min Af (θf→u ) + Af (φoff f→u ), Af,FTBR , (6) 14 where Gf,max is the maximum antenna gain in dBi, Af,FTBR is the front-to-back ratio loss (FTBR) in dB, and Af (·) is the attenuation for a given off-axis angle, and it corresponds to the antenna pattern that matches the FCC regulations (cf. Fig. 3) [26]. C. UE Radiated Power (EIRP) Into FS Antenna 1) Actual directions: The directions of the UE’s two opposite panels are defined by unit vectors in the direction of the panels’ boresight. We assume that these directions are random in azimuth such that the boresight of the first one is distributed uniformly as U(0, 180) while the other one is pointing in the opposite direction, i.e., 180◦ from the first one. Only one of the UE antenna panels is active during data communications. Let ustr u denote the unit vector in the denote the unit vector in the azimuth direction of the UE’s panel that is active. Also, let ubeam u azimuth direction of the main lobe of the UE’s beam used in the UL, which corresponds to the beam with the maximum received power during user and beam association. We similarly define vustr and vubeam for the elevation directions. Then, the total radiated power from the UE into the direction of the victim FS is expressed, in dBm, as beam Eu→f = Pu + 10 log10 (2Nu,h Nu,v ) + Gu,max − (Au,BP (θu→f ) + Au,BP (φbeam u→f )) − str min{Au,EP (θu→f ) + (7) Au,EP (φstr u→f ), Au,FTBR }, where Gu,max is the maximum antenna gain and Au,FTBR is the FTBR loss. The azimuth off-axis angles are computed as  beam θu→f = cos−1 uu→f • ubeam , u (8)  str θu→f = cos−1 uu→f • ustr , u (9) and where uu→f = −uf→u . The elevation off-axis angles are computed as   hf − hu beam −1 φu→f = tan − ∠vubeam , df→u (10) and φstr u→f −1 = tan  hf − hu df→u  − ∠vustr , where ∠· denotes the angle of the vector. All off-axis angles are illustrated in Fig. 8b. (11) 15 ߶୤ ‫ܝ‬୤՜୤ǡ୲୶ ୭୤୤ ߠ୤՜୳ ‫ܠ‬୤ǡ୲୶ Interference axis ୭୤୤ ߶୤՜୳ ‫ܠ‬୤ ‫ܝ‬୤՜୳ Interference axis ݄୤ ‫୳ܝ‬՜୤ ୱ୲୰ ߠ୳՜୤ ୱ୲୰ ߶୳՜୤ ‫ܝ‬ୱ୲୰ ୳ ‫ܝ‬ୠୣୟ୫ ୳ ୠୣୟ୫ ߠ୳՜୤ ݄୳ ‫୳ܠ‬ ‫ܠ‬୤ ݄୳ ‫୳ܠ‬ ݀୤՜୳ ‫୳ܞ‬ୱ୲୰ୠୣୟ୫ ‫୳ܞ‬ ݄୤ ୠୣୟ୫ ߶୳՜୤ ݀୤՜୳ (a) With respect to the FS (b) With respect to the UE Fig. 8: Off-axis azimuth and elevation angles 2) Random directions: We also present a random model for the UE’s azimuth and elevation directions. This model does not require the deployment of gNBs, and hence ignores the computational complexity in simulating user and beam association. The model assumes that the UE uses beam the beam in the direction of the antenna’s main boresight, i.e., ubeam = ustr = vustr . To u u and vu this end, we model the azimuth direction as a uniform random variable θ̃u ∼ U(0, 360), whereas the elevation direction is modeled as −1  φ̃u = tan hg − hu dg→u  , (12) where dg→u ∼ U(d0 , dISD /2), where d0 > 0 is some constant, e.g., in this work we consider d0 = 10m. These angles are used to compute the unit vectors needed for azimuth and elevation off-axis angles. D. UE Aggregate Interference The interference caused by the i-th UE on the FS is given as Ii,dBm = Ei→f + Gf→i − PLi→f . (13) Similarly, the INR at the FS is expressed as INRdB = 10 log10 (Iagg ) − (10 log10 (N0 B) + Ff ) , where Iagg = P i (14) 10Ii,dBm /10 , N0 is the noise power spectral density (mW/Hz), B is the bandwidth (Hz), and Ff is the noise figure of the FS (dB). 16 V. PASSIVE I NTERFERENCE M ITIGATION T ECHNIQUES In this section, we propose several interference mitigation techniques to protect the incumbent FSs. We focus on two critical aspects. First, the techniques should be passive, i.e., they do not require any coordination with FSs, and second they should be practical to implement to appeal for mobile operators and vendors. A. Sector-based Mitigation In this technique, we propose to switch off sectors, creating sector-based exclusion zones. The key idea is that the 5G UE beam directions are typically reciprocal to those of 5G gNBs. Thus, if such reciprocal directions point to FSs, then the UE must be discouraged from using them, i.e., the sector with a reciprocal direction pointing towards the FSs should be switched off. More formally, let ustr,i be the unit vector in the direction of the i-th sector boresight and −ustr,i is g g its reciprocal direction. Then, the i-th sector is switched off if   1, cos−1 −ustr,i • u  ≤ ψ g→f s g sl,i = ,  0, otherwise (15) where ψs is a predetermined decision threshold. A more relaxed sector exclusion criterion is to switch sectors off if they are aligned with the FS’s antenna orientation rather than the FS’s location. Such criterion can still reduce the interference experienced at FSs as a slight misalignment with FS’s antenna incurs significant signal attenuation. More formally, the i-th sector can be switched off if so,i = 1(sl,i =1) × 1(cos−1 (ustr,i •uf→f,tx )≤ψs ) . g (16) We refer to (15) as location-based mitigation and (16) as orientation-based mitigation. Both techniques are demonstrated in Fig. 9a. B. Beam-based Mitigation In the sector-based mitigation, only four decisions need to be made a priori for each gNB, making the approach simple to implement. This, however, may result in tangible coverage holes, affecting the performance of the 5G system. To this end, we can make exclusion zones at a finer scale, where decisions are made on a beam-by-beam basis instead. Specifically, the i-th beam is switched off if   1, cos−1 −ubeam,i • u  ≤ ψ g→f b g bl,i = ,  0, otherwise (17) 17 ‫ܠ‬୤ ‫ܠ‬୤ ‫ܝ‬୤՜୤ǡ୲୶ ‫ܝ‬ୱ୲୰ǡ௜ ୥ ‫ܝ‬୥՜୤ UEs should not connect to this sector ‫ܝ‬ୱ୲୰ǡ௜ ൈ ‫ܝ‬୥՜୤ െ‫ܝ‬ୱ୲୰ǡ௜ ୥ UEs can connect to this sector ‫ܠ‬୥ ୥ Location-based െ‫ܝ‬ୱ୲୰ǡ௜ ୥ ‫ܠ‬୥ ‫ܝ‬ୱ୲୰ǡ௜ ୥ Orientation-based (a) Sector based ‫ܠ‬୤ ‫ܠ‬୤ ‫ܝ‬୤՜୤ǡ୲୶ ‫ܝ‬ୠୣୟ୫ǡ௜ ୥ ‫ܝ‬୥՜୤ ‫ܝ‬୥՜୤ െ‫ܝ‬ୠୣୟ୫ǡ௜ ୥ െ‫ܝ‬ୠୣୟ୫ǡ௜ ୥ ‫ܠ‬୥ ൈ ‫ܠ‬୥ ‫ܝ‬ୠୣୟ୫ǡ௜ ୥ ‫ܝ‬ୠୣୟ୫ǡ௜ ୥ Location-based Orientation-based (b) Beam-based Fig. 9: Illustration of passive mitigation techniques is a unit vector in the direction where ψb is a predetermined beam decision threshold and ubeam,i g of the i-th beam. In other words, the same sector could have beams switched on and beams switched off, depending on whether the beam meets the criterion in (17) or not. We can also make decisions based on the orientation of the FS’s instead of its location, i.e., bo,i = 1(bl,i =1) × 1(cos−1 (ubeam,i •uf→f,tx )≤ψb ) . g (18) Beam-based exclusion zone is shown in Fig. 9b. C. Spatial Power Control The aforementioned techniques can be classified as angular exclusion zones, leading inevitably to lower downlink coverage with higher degradation if sector-based zones are used instead of beam-based. Alternative to switching beams (or sectors) off, we can implement almost blank or quiet angular zones, where power control is used over these beams. Thus, the UE would still connect to a gNB beam that has a reciprocal direction aligned with the FS’s receiver, yet the 18 UL transmit power should be reduced over that beam. In essence, this emulates a water-filling like approach over the angular domain, with water levels proportional to the beam’s alignment with the FS’s receiver. While power control can be formulated as an optimization problem with optimizing variables being the maximum power levels assigned to each beam and an objective function that captures the potential interference from each beam into the FS receiver, we seek a more simple power control, i.e., we leave more sophisticated algorithms as a future research direction. To this end, we merely consider a binary power control algorithm such that the total uplink transmit power of the UE is PUL,u,i?   P , cos−1 −ubeam,i? • u  ≤ ψ lo g→f b g = ,  Pup , otherwise (19) where i? is the index of the gNB beam that the UE connects to. In other words, beams are classified as regular beams and quiet beams. Note that it is natural to extend this approach to sectors or make it with respect to the orientation of the FS instead of its location. D. Implementation Implementation of angular exclusion zones should be straightforward. Indeed, upon the deployment of the gNBs in a given region, the mobile operator must identify the FSs in vicinity using the FCC’s database, where the operator can extract their locations and azimuth directions, which will be used to compute the necessary unit vectors. The operator then switch sectors (or beams) depending on the protection criterion used. Thus, UEs cannot find any reference signals from those sectors (or beams), and hence they do not connect to them during user and beam association. Clearly, the operator may need to update the sector-based (or beam-based) decisions if the FS’s databased is changed, e.g., switch back sectors if an incumbent license is expiring, etc., which typically happens at a long-time scale. To implement spatial binary power control, the operator must tag the DL beam with an indicator variable and embed its value in the reference signal sent over the beam. This is done over the physical broadcast channel (xPBCH or ePBCH), and thus during synchronization, the UE can decode the master and system information blocks (MIB and SIB), identifying the UL transmit power limit over that beam. 19 106 106 4.5126 106 4.6455 4.5124 4.645 4.638 4.6445 4.5122 4.644 4.643 4.6425 4.512 y-coord y-coord y-coord 4.6375 4.6435 4.637 4.5118 4.5116 4.642 4.6365 4.6415 4.5114 4.641 4.5112 4.6405 4.41 4.636 4.42 4.43 4.44 4.45 4.46 x-coord 4.47 4.48 105 (a) Lincoln Park 4.474 4.476 4.478 4.48 4.482 4.484 4.486 x-coord 5.852 4.488 105 (b) Chicago Loop 5.854 5.856 5.858 x-coord 5.86 5.862 5.864 105 (c) Lower (Downtown) Manhatta Fig. 10: Simulation scenarios. Here ‘◦’ denotes the FS, ‘♦’ denotes the gNB, and ‘×’ denotes the UE. VI. S IMULATION R ESULTS We study the aggregate UE interference on FSs deployed in Lincoln Park, Chicago Loop, and Lower Manhattan, which are shown in Fig. 10. The channel model is assumed to follow the 3GPP NR-UMi model [25]. The main simulation parameters are listed in Table I. We assume a 25% instantaneous load in the available UL slots. We consider the center frequencies: 73.5GHz and 83.5GHz, and assume that the UE maximum radiated power, without any attenuation, is 33dBm or 43dBm. Per FCC regulations, we consider Af,FTBR = 55dB [26]. For noise power, we assume B = 1GHz and N0 is computed at temperature 290K. Finally, the FS’s location, height, maximum antenna gain, antenna tilt, and noise figure, are all extracted from the database. The subsequent results are averaged out over 1000 spatial realizations. A. Validation of the 5G System We first verify that deployment of gNBs lead to reliable coverage for UEs. Fig. 11a shows the CDF of the signal-to-noise ratio (SNR) at the UE side after beam association, whereas Fig. 11b shows the main SNR statistics. Overall, it is shown that the deployment provides reliable coverage with positive cell-edge SNR values. Operating at 83.5GHz has slight SNR degradation due to higher path loss compared to operating at 73.5GHz. We also show the distribution of used gNB beams, gNB sectors, and UE beams in Fig. 12. It is shown that, overall, each azimuth gNB beam is equally likely to be used, with a similar observation regarding the gNB sectors. More importantly, only few elevation beams are active. This suggests that mobile operators should implement only a couple of elevation beams to serve 20 Lincoln Park 73.5GHz 83.5GHz 0.5 0 -5 0 5 10 15 30 35 40 45 50 0 5 10 15 20 25 Mean 30 35 40 45 50 5 10 15 20 25 30 UE SNR (dB) 40 45 50 Median Cell-edge Median Cell-edge 10 Mean 35 Cell-edge 0 SNR (dB 0 Median Chicago Loop 20 30 0.5 0 -5 10 0 UE SNR (dB) Lower Manhattan 1 73.5GHz 83.5GHz 20 30 SNR (dB CDF 25 0.5 0 -5 CDF 20 UE SNR (dB) Chicago Loop 1 Lincoln Park 30 SNR (dB CDF 1 Lower Manhattan 20 10 0 Mean (a) SNR CDF (b) SNR statistics Fig. 11: SNR at 5G UE outdoor users, which reduces the complexity of user association and codebook design. Similar conclusion is drawn at the UE side as only few elevation beams are used as well, with the majority of them being less than 10◦ . Thus, UEs are likely to be out-of-sight of nearby FSs that are deployed at high altitudes. Finally, the UE is more likely to use azimuth beams near its boresight as they have higher gain compared to the other beams. B. Distribution of INR Fig. 13 shows the CDF of INR for the different case studies. We also show a reference INR threshold of −6dB, which corresponds to SINR degradation of 1dB, meeting the FCC’s interference protection criterion [26]. We have the following observations. First, using the random model, i.e., random UE azimuth and elevation directions, provides accurate results that match well with computing the actual pointing directions of the UE in the presence of gNBs. This follows because the deployment of gNBs is agnostic to the locations of FSs, and the distribution of used elevation directions (cf. Fig. 12e) has a similar PDF to the one used in the random model (cf. (12) and Fig. 12f). Second, the CDFs show that the INR is overall low, with the majority of FSs experiencing INR levels well below the noise floor. This follows due to the high attenuation at millimeter wave frequencies, i.e., the networks operate in a noise-limited regime, the stark height difference in deploying FSs and 5G systems, and the very low likelihood of UEs being aligned within 1◦ of the FS’s beam. It is also shown that dense urban areas, e.g., downtown Manhattan, has lower INR due to the increased blockage resulted from the presence of high-rise buildings. Finally, the INR is slightly lower at 83.5GHz compared to 73.5GHz due to the higher path loss in the former. 0.05 0 0 10 20 30 40 50 60 70 80 90 Lincoln Park 0.5 Histogram Lincoln Park 0.1 Histogram Histogram 21 0 -25 -20 -15 0 10 20 30 40 50 60 70 80 90 Azimuth Beam Angle/sector (degrees) Lower Manhattan 0.1 Histogram Histogram 0 0.05 0 0 10 20 30 40 50 60 70 80 90 0.5 0 -25 -20 -15 0 -25 -20 -15 Histogram Histogram 0 100 120 140 160 80 100 120 140 160 0 0 -5 180 Histogram Histogram 0 20 40 60 80 100 120 2 140 160 3 4 Sector Index (c) gNB sectors 0.12 5 10 15 20 25 30 35 0.08 0 5 10 15 20 25 30 0.06 35 0.04 Elevation Beam Angle (degrees) Lower Manhattan 0.1 0 0 0.5 Azimuth Beam Angle (degrees) Lower Manhattan 0.2 4 0.2 1 PDF Histogram Histogram 0 60 2 Sector Index Lower Manhattan 5 Elevation Beam Angle (degrees) Chicago Loop 0.1 40 1 0.4 0.1 0 -5 Azimuth Beam Angle (degrees) 20 0 3 0 0.5 180 0.2 0 -5 4 0.2 5 Lincoln Park 0.1 80 -10 3 Sector Index Chicag Loop (b) gNB elevation beams Lincoln Park 60 0 2 0.4 Elevation Beam Angle (degrees) 0.2 40 -5 0 1 Elevation Beam Angle (degrees) Lower Manhattan 0.5 (a) gNB azimuth beams 20 -10 0.2 5 Elevation Beam Angle (degrees) Chicago Loop Azimuth Beam Angle/sector (degrees) 0 0 Histogram 0.05 -5 Histogram 0.1 Histogram Histogram Azimuth Beam Angle/sector (degrees) -10 Lincoln Park 0.4 0.5 180 0.02 0 -5 0 Azimuth Beam Angle (degrees) 5 10 15 20 25 30 35 0 0 Elevation Beam Angle (degrees) 5 10 15 20 25 30 35 Elevation Angle (degrees) (d) UE azimuth beams (e) UE elevation beams (f) PDF of UE elevation angle under the random model Fig. 12: Distribution of used beams and sectors Lincoln Park 1 0.8 0.9 0.8 0.7 0.7 UE EIRP=33dbm 0.9 0.8 0.5 0.6 0.5 0.5 0.4 0.4 0.4 0.3 0.3 0.3 UE EIRP=43dBm UE EIRP=43dBm 0.2 73.5GHz: Actual 73.5GHz: Random 83.5GHz: Actual 83.5GHz:Random UE EIRP=33dbm 0.7 UE EIRP=33dbm 0.6 CDF CDF 0.6 Lower Manhattan 1 73.5GHz: Actual 73.5GHz: Random 83.5GHz: Actual 83.5GHz:Random CDF 0.9 Chicago Loop 1 73.5GHz: Actual 73.5GHz: Random 83.5GHz: Actual 83.5GHz:Random 0.2 0.2 UE EIRP=43dBm 0.1 0.1 0.1 -6dB threshold 0 -80 -70 -60 -50 -40 -30 -20 Interference-to-noise ratio (dB) (a) Lincoln Park -10 -6dB threshold 0 10 0 -80 -70 -60 -50 -40 -30 -20 -10 Interference-to-noise ratio (dB) (b) Chicago Loop -6dB threshold 0 10 0 -80 -70 -60 -50 -40 -30 -20 -10 0 10 Interference-to-noise ratio (dB) (c) Lower Manhattan Fig. 13: CDF of INR Fig. 14 shows the PDF of INR for the different case studies and Fig. 15 shows the main INR statistics, i.e., the mean, the median, and the 95th percentile. As it can be seen, only very few FSs may experience high INR values, i.e., above the −6dB protection threshold, in Lincoln Park, whereas the rest are well protected. This motivates implementing the proposed mitigation 22 73.5GHz 0.02 0.01 -60 -40 -30 -20 -10 0 0.03 0.02 0 -80 10 Interference-to-noise ratio (dB) 83.5GHz 0.05 0.03 0.02 0.01 -70 -60 -50 -40 -30 -20 -10 0 0 -80 10 Interference-to-noise ratio (dB) 83.5GHz 0.05 0.04 0.03 0.03 0.01 0 -80 PDF 0.04 0.03 0.02 0.02 0.01 -70 -60 -50 -40 -30 -20 -10 0 0 -80 10 -60 -50 -40 -30 -20 -10 0 10 -10 0 10 Interference-to-noise ratio (dB) 83.5GHz 0.02 0.01 -70 -60 Interference-to-noise ratio (dB) -50 -40 -30 -20 -10 0 0 -80 10 Interference-to-noise ratio (dB) (a) Lincoln Park -70 0.05 0.04 PDF PDF -50 UE EIRP= 33dBm UE EIRP= 43dBm 0.04 0.01 -70 73.5GHz 0.05 UE EIRP= 33dBm UE EIRP= 43dBm 0.04 0.03 0 -80 73.5GHz 0.05 UE EIRP= 33dBm UE EIRP= 43dBm PDF PDF 0.04 PDF 0.05 -70 -60 -50 -40 -30 -20 Interference-to-noise ratio (dB) (b) Chicago Loop (c) Lower Manhattan Fig. 14: PDF of INR INR (dB) -40 43dBm INR (dB) INR (dB) INR (dB) 33dBm -20 -40 43dBm INR (dB) -20 (a) Lincoln Park 43dBm 33dBm -10 -20 43dBm 95th percentile 0 -30 33dBm -40 43dBm 95th percentile 0 -10 -20 -60 33dBm 95th percentile 0 43dBm Median 0 -60 33dBm -40 43dBm Median 0 -20 73.5GHz 83.5GHz -20 -60 33dBm Median -40 INR (dB) -40 -60 33dBm 0 Mean 0 73.5GHz 83.5GHz -20 INR (dB) INR (dB) -20 Mean 0 73.5GHz 83.5GHz INR (dB) Mean 0 -20 -40 33dBm 43dBm (b) Chicago Loop 33dBm 43dBm (c) Lower Manhattan Fig. 15: INR statistics techniques only to improve INR protection at those few FSs, simplifying the 5G coexistence. Fig. 16 provides additional insightful details regarding the different components of the interference framework. Specifically, Fig. 16a illustrates the distribution of the different antenna attenuations due to the UE patterns, whereas Fig. 16b illustrates the distribution of the attenuations and the total gain at the FS side. In general, the azimuth attenuation is more significant than the elevation attenuation as the UE’s direction, with respect to FS’s boresight, appear to point randomly in azimuth, whereas in elevation, UE’s are pointing upwards. It is also clear that the elevation attenuation is the lowest in Lincoln Park as FSs are deployed at relatively lower altitudes compared to the two dense urban areas, explaining why the INR is the highest in Lincoln Park. In Fig. 16c, we compare the theoretical LOS of probability in the 3GPP NR-UMi model [25] and the simulated one resulted from using the different building layouts. The 3GPP LOS 23 Azimuth: A u,BP Azimuth: A f u 1 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.6 0.6 0.6 0.6 0.6 0.6 0.5 0.5 0.5 Probability of LOS 0.9 CDF 0.9 CDF 0.9 0.5 1 Gain: G f 1 0.9 0.5 1 Elevation: A f 1 CDF CDF Total: Beam+Element 0.9 CDF 1 Elevation: A u,BP 0.9 CDF 1 Lincoln Park Chicago Loop 0.9 Lower Manhattan 0.5 0.6 0.5 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.1 0.1 0.1 0.1 0 -80 -60 -40 -20 0 0 -80 -60 -40 -20 0 0 -80 -60 -40 -20 0 Attenuation (dB) Attenuation (dB) Attenuation (dB) (a) Lincoln Park 0.1 Chicago Loop Lower Manhattan 0 -50 0 Attenuation (dB) 0 -100 0.1 0.1 -50 0 Attenuation (dB) (b) 0 -20 3GPP probability model Lincoln Park Chicago Loop Lower Manhattan 0 0 20 Gain (dB) 40 0 200 400 600 800 1000 1200 2D distance, d u f 1400 1600 1800 2000 (m) (c) Fig. 16: (a) Distribution of different attenuations at the UE side; (b) Distribution of different attenuations at the FS side; (c) Comparison between the 3GPP model and the actual layouts in terms of LOS probability. probability is expressed as [25]        du→f du→f 18 , 1 × 1 − exp − + exp − . PLOS (du→f ) = min du→f 36 36 (20) Overall, the 3GPP model underestimates the LOS probability for larger distances in Lincoln Park and Chicago Loop. This is not the case for Lower Manhattan due to the dense deployment of high-rise buildings. We remark that we expect the LOS probability to be lower when blockage due to other objects is included, e.g., foliage, cars, etc., making FSs even better protected. C. Impact of Sector-based and Beam-based Mitigation We focus on a particular FS in Lincoln Park, which has relatively high INR in comparison with other FSs. The FS of interest is deployed at height of 34m with a wide open-space in its vicinity, making it more susceptible to interference from the 5G system. Here, we only consider operating at 73.5GHz with UE maximum radiated power of 43dBm, as this set-up leads to the highest interference. Fig. 17 shows the average INR on the FS in the presence of sector-based and beam-based mitigation. We have the following observations. First, using low protection thresholds, i.e., ψs and ψb , does not result in tangible reduction in the 95th percentile of the INR. This follows because UEs tend to point randomly over space and even if the main lobe is not aligned, there is still a chance to have high interference from the side lobes. For this reason, larger thresholds provide much better protection. Second, it is shown that location-based protection is more reliable than 24 1 1 0.9 0.9 0.8 0.8 0.7 0.7 0.6 -6dB threshold 0.5 0.4 0.2 0.1 -60 -50 -40 -30 -20 -10 0 INR (dB) (a) Sector-based 10 -6dB threshold 0.5 No mitigation 22.5deg: Location 22.5deg: Orientation 45.0deg: Location 45.0deg: Orientation 90.0deg: Location 90.0deg: Orientation 0.4 No mitigation 22.5deg: Location 22.5deg: Orientation 45.0deg: Location 45.0deg: Orientation 90.0deg: Location 90.0deg: Orientation 0.3 0 -70 CDF CDF 0.6 0.3 0.2 0.1 20 0 -70 -60 -50 -40 -30 -20 -10 0 10 20 INR (dB) (b) Beam-based Fig. 17: INR CD in the presence and absence of passive mitigation orientation-based. This implies that to get very low INR, it is not enough to protect the boresight of the FS, i.e., signal attenuation due to FS pattern may not be sufficient if the UE effective radiated power is very high. Third, beam-based mitigation slightly outperforms sector-based mitigation, particularly for high thresholds. Equally important, the former also enables better 5G DL coverage, as it makes decisions at higher angular resolution compared to sector-based. The cost of using beam-based mitigation is the increased number of decisions needed to be made for each gNB in vicinity of the FS. Fig. 18 shows the main INR statistics with variations of the angular protection threshold. We show the INR performance in the absence of mitigation for reference. We also show the INR in the presence of spatial exclusion zones with radii 200m and 500, i.e., no gNBs are deployed inside these zones. As expected, the INR is significantly deceased for high protection thresholds. For instance, the 95th percentile decreases by approximately -5.5dB and -13dB when locationbased beam mitigation is used with ψb = 45◦ and ψb = 90◦ , respectively. Angular exclusion zones are more effective than spatial exclusions as the latter leads to coverage holes in the 5G system. This also emphasizes that the interference is not dominated by UEs that are close to the FS but rather by UEs that have beams directed towards the FS’s boresight. Fig. 19 shows one snapshot of the FS of interest and the 5G system in vicinity of the FS with and without the mitigation techniques. In the snapshot, we show the UE’s beam used for data communication with its associated gNB as well as the interference generated from the UE into the FS (in dBm). In Fig. 19a, the INR is high as it is dominated by a UE with an interference of −62dBm (the noise floor at the FS is approximately −77dBm). By using the location-based 25 Mean Median -28 -10 -30 -32 -12 -34 -36 Beam-based Sector-based -38 INR (dB) -30 -32 -34 -36 -38 50 100 Threshold (degrees) -16 -20 -42 0 No mitigation Exc. zone (200m) Exc. zone (500m) S: Location-based S: Orientation-based B: Location-based B: Orientation-based -14 -18 -40 -40 95% Percentile -8 -28 INR (dB) INR (dB) -26 -22 0 50 Threshold (degrees) 100 0 50 100 Threshold (degrees) Fig. 18: INR statistics with variations of the angular protection threshold. sector mitigation with ψs = 45◦ , it is shown in Fig. 19b that this particular UE switches to a different gNB, reducing its interference by 66dB! A similar observation is made for the beambased approach, illustrated in Fig. 19c, where we use ψb = 22.5◦ , showing that angular exclusion zones at a finer scale are sufficient to protect the FS without compromising the 5G DL coverage. D. Impact of spatial power control We set Plo and Pup such that the maximum radiated power is 33dBm and 43dBm, respectively. Fig. 20 shows the INR’s CDF at the FS when the power control (PC) in (19) is used. It is evident that for higher protection thresholds, ψb , power control can be effective to reduce the INR. For instance, the 95th percentile reduces from -8dB to -15dB when ψb = 45◦ . Finally, Fig. 21 shows the main INR statistics with variations of the protection threshold. It is shown that the 95th percentile can be reduced by approximately 10dB without the need to shut off any beams. E. Comparison of Mitigation Techniques The aforementioned techniques have shown the effectiveness in mitigating interference at the FS. In this section, we compare them in terms of their impact on the DL coverage of the 5G system. Using the gNB antenna parameters, it can be shown that the maximum radiated power is 57dBm. Fig. 22 shows a comparison between the different techniques in terms of the DL coverage. We only consider location-based protection. Due to the angular exclusion zones created, using larger thresholds, i.e., ψs and ψb , inevitably affect the DL coverage. This is not the case in spatial power control as all beams and sectors are active. Fig. 23 shows the SNR-INR curves of the different mitigation techniques. The curves highlight the different possible operating points of the coexisting 5G and incumbent systems, i.e., the interference level expected on the incumbent for a target 5G DL coverage. We have the following 26 106 106 4.6431 -62 4.6431 4.643 -109 4.643 -469 4.6428 -129 -497 4.6429 -174 y-coord y-coord 4.6429 -128 -147 4.6427 4.6426 4.6428 -149 -149 4.6427 4.6426 -235 4.6425 4.6425 4.6424 4.6424 -211 -220 4.6423 -203 4.6423 4.4565 4.457 4.4575 4.458 4.4585 4.459 x-coord 4.4595 105 4.4565 4.457 4.4575 4.458 x-coord (a) No mitigation 4.4585 4.459 4.4595 105 (b) Sector-based 106 4.6431 -128 -129 4.643 -476 y-coord 4.6429 4.6428 -149 -149 4.6427 4.6426 -211 4.6425 4.6424 -203 4.6423 4.4565 4.457 4.4575 4.458 x-coord 4.4585 4.459 4.4595 105 (c) Beam-based Fig. 19: One simulation snapshot of an FS that experiences high INR in the absence of mitigation. The beams used by UEs are shown, and the interference generated by each one into the FS is given in dBm: (a) No mitigation; (b) Using sector-based exclusion zone; (c) Using beam-based exclusion zone. observations. Comparing location-based beam angular zones with sector angular zones, it is evident that the former presents more operating points, making it more flexible and effective. However, both have an inevitable trade-off: higher INR protection incurs 5G coverage degradation. In addition, spatial exclusion zones are not as effective as angular exclusion zones. For instance, using a first-order approximation of the simulated curves, it can be shown that slopes 27 1 0.9 0.8 0.7 CDF 0.6 0.5 0.4 0.3 No mitigation PC: 22.5deg PC: 90.0deg 0.2 0.1 0 -60 -50 -40 -30 -20 -10 0 10 20 INR (dB) Fig. 20: INR CDF in the presence and absence of power control Mean -27 Median -28 -31 -32 No mitigation Exc.-33 zone (200m) Exc. zone (500m) -34 PC INR (dB) -10 -30 INR (dB) INR (dB) -8 -30 -29 95% Percentile -6 -28 -32 -34 -14 -16 -36 -35 -18 -38 0 -12 50 100 Threshold (degrees) -20 0 50 100 0 Threshold (degrees) 50 100 Threshold (degrees) Fig. 21: INR statistics when spatial power control is used Mean 21 19 20 19 17 16 17 15 50 Threshold (degrees) 100 6 18 18 Cell-edge 8 SNR (dB) 20 0 Median 21 22 SNR (dB) SNR (dB) 23 No Mitigation Exc. zone (500m) Sector-based Beam-based PC 4 2 0 -2 0 50 Threshold (degrees) 100 0 50 100 Threshold (degrees) Fig. 22: INR statistics when spatial power control is used for the beam-based and spatial exclusion zone techniques are approximately 3 and 1. In other words, by reducing the median SNR by 1dB, the INR reduces by 3dB when using beam-based angular exclusion zones and by 1dB when using spatial exclusion zones. Finally. spatial power control enables the reduction of INR with negligible coverage loss. VII. C ONCLUSION The 10GHz of spectrum in the 70GHz and 80GHz bands have the potential to enable true mobile connectivity at gigabit speeds. A key obstacle to the 5G deployment of these bands is the presence of incumbent FS systems that require protection from harmful interference. To this end, 28 -6 95th Percentile INR (dB) -10 -6 No mitigation Exclusion Zone Sector-based Beam-based PC -10 -12 -14 -16 -18 -20 -22 15 No mitigation Exclusion Zone Sector-based Beam-based PC -8 95th Percentile INR (dB) -8 -12 -14 -16 -18 -20 16 17 18 19 20 -22 -2 21 Median DL SNR (dB) -1 0 1 2 3 4 5 6 7 Cell-edge SNR (dB) (a) Median SNR vs 95th percentile INR (b) Cell-edge SNR vs 95th percentile INR Fig. 23: Comparison of SNR-INR curves of different mitigation techniques we have thoroughly analyzed existing databases to understand the key features and properties of the incumbent system, including the spatial distribution and the antenna specifications. In addition, we have analyzed the aggregate interference from 5G UEs using realistic channel models and actual building layouts for accurate results. Our analysis and results have revealed that 5G coexistence beyond 70GHz is feasible thanks to the high propagation losses at millimeter wave frequencies, the high attenuation due misalignment with the FS antenna boresight, and the deployment geometry of FSs as they tend to be above 5G systems. For FSs that are deployed at relatively low altitudes, we have proposed several passive mitigation techniques, including angular exclusion zones and spatial power control. Such techniques require minimal effort from mobile operators and do not require any coordination with the incumbents. We have shown that exclusion zones in the angular domain are more effective than spatial exclusion zones. However, the 5G DL coverage can degrade due to the coverage holes introduced by exclusion zones. This can be overcome via power control, where the transmit power of the UE depends on the beam’s direction with respect to the victim FS. R EFERENCES [1] G. Hattab, E. Visotsky et al., “Coexistence of 5G mmwave users with incumbent fixed stations over 70 and 80 GHz,” in IEEE GLOBECOM, Dec. 2017. [2] M. Xiao, S. Mumtaz et al., “Millimeter wave communications for future mobile networks,” IEEE J. Sel. Areas Commun., vol. 35, no. 9, pp. 1909–1935, Sep. 2017. [3] “IMT vision- framework and overall objectives of the future development of IMT for 2020 and beyond,” ITU-R, M.2083-0, Sep. 2015. 29 [4] J. G. Andrews, S. Buzzi et al., “What will 5G be?” IEEE J. Sel. Areas Commun., vol. 32, no. 6, pp. 1065–1082, Jun. 2014. [5] “Use of spectrum bands above 24 GHz for mobile radio services,” Federal Communications Commission (FCC), Tech. Rep. GN Docket No. 14-177, July 2016. [6] ITU, “World radiocommunication conference 2015,” Geneva Switzerland, Nov. 2015. [7] S. Rangan, T. S. Rappaport et al., “Millimeter-wave cellular wireless networks: Potentials and challenges,” Proceedings of the IEEE, vol. 102, no. 3, pp. 366–385, Mar. 2014. [8] M. Cudak, T. Kovarik et al., “Experimental mm wave 5G cellular system,” in Proc. IEEE Globecom Workshops, Dec. 2014, pp. 377–381. [9] Y. Inoue, S. Yoshioka et al., “Field experimental trials for 5G mobile communication system using 70 GHz-band,” in Proc. IEEE Wireless Communications and Networking Conf. Workshops (WCNCW), Mar. 2017, pp. 1–6. [10] L. Huawei Technologies Co. (2016, Feb.) Huawei to bring 73GHz mmWave Mu-MIMO live demo to Deutsche Telekom. [Online]. Available: http://www.huawei.com/en/news/2016/2/73GHzmm-Wave-Mu-MIM-live-demo [11] A. K. Gupta, A. Alkhateeb et al., “Gains of restricted secondary licensing in millimeter wave cellular systems,” IEEE Journal on Selected Areas in Communications, vol. 34, no. 11, pp. 2935–2950, Nov. 2016. [12] M. Rebato, F. Boccardi et al., “Hybrid spectrum sharing in mmWave cellular networks,” IEEE Transactions on Cognitive Communications and Networking, vol. 3, no. 2, pp. 155–168, Jun. 2017. [13] F. Boccardi, H. Shokri-Ghadikolaei et al., “Spectrum pooling in MmWave networks: Opportunities, challenges, and enablers,” IEEE Communications Magazine, vol. 54, no. 11, pp. 33–39, Nov. 2016. [14] M. Ghorbanzadeh, E. Visotsky et al., “Radar inband and out-of-band interference into LTE macro and small cell uplinks in the 3.5 GHz band,” in Proc. IEEE Wireless Communications and Networking Conf. (WCNC), Mar. 2015, pp. 1829–1834. [15] ——, “Radar interference into LTE base stations in the 3.5 GHz band,” Physical Communication, vol. 20, pp. 33 – 47, 2016. [Online]. Available: http://www.sciencedirect.com/science/article/pii/S1874490716300088 [16] A. Khawar, A. Abdelhadi et al., “Coexistence analysis between radar and cellular system in LoS channel,” IEEE Antennas Wireless Propag. Lett., vol. 15, pp. 972–975, 2016. [17] F. Beltran, S. K. Ray et al., “Understanding the current operation and future roles of wireless networks: Co-existence, competition and co-operation in the unlicensed spectrum bands,” IEEE Journal on Selected Areas in Communications, vol. 34, no. 11, pp. 2829–2837, Nov. 2016. [18] J. Kim, L. Xian et al., “Study of coexistence between 5G small-cell systems and systems of the fixed service at 39 GHz band,” in Proc. IEEE MTT-S Int. Microwave Symp, May 2015, pp. 1–3. [19] ——, “Numerical simulation study for frequency sharing between micro-cellular systems and fixed service systems in millimeter-wave bands,” IEEE Access, vol. 4, pp. 9847–9859, 2016. [20] S. Kim, E. Visotsky et al., “Coexistence of 5G with the incumbents in the 28 and 70 GHz bands,” IEEE J. Sel. Areas Commun., vol. 35, no. 6, pp. 1254–1268, Jun. 2017. [21] A. Alkhateeb, Y. H. Nam et al., “Initial beam association in millimeter wave cellular systems: Analysis and design insights,” IEEE Trans. Wireless Commun., vol. 16, no. 5, pp. 2807–2821, May 2017. [22] M. Giordani, M. Mezzavilla et al., “Initial access in 5G mmwave cellular networks,” IEEE Communications Magazine, vol. 54, no. 11, pp. 40–47, Nov. 2016. [23] C. N. Barati, S. A. Hosseini et al., “Initial access in millimeter wave cellular systems,” IEEE Transactions on Wireless Communications, vol. 15, no. 12, pp. 7926–7940, Dec. 2016. [24] M. I. Skolnik, Introduction to Radar Systems. McGraw-Hill, 2001, vol. 3. 30 [25] 3GPP, “Study on channel model for frequency spectrum above 6GHz,” 3rd Generation Partnership Project (3GPP), Tech. Rep., 2017. [26] “Title 47 of the code of federal regulations,” Federal Communications Commission (FCC), Tech. Rep. Section 101.115, July 2017. [27] M. Haenggi, Stochastic Geometry for Wireless Networks. Cambridge University Press, 2012.
7cs.IT
Quantum ensembles of quantum classifiers Maria Schuld Quantum Research Group, School of Chemistry and Physics, University of KwaZulu-Natal, Durban 4000, South Africa arXiv:1704.02146v1 [quant-ph] 7 Apr 2017 E-mail: [email protected] Francesco Petruccione1,2 1 Quantum Research Group, School of Chemistry and Physics, University of KwaZulu-Natal, Durban 4000, South Africa 2 National Institute for Theoretical Physics E-mail: [email protected] Abstract. Quantum machine learning witnesses an increasing amount of quantum algorithms for data-driven decision making, a problem with potential applications ranging from automated image recognition to medical diagnosis. Many of those algorithms are implementations of quantum classifiers, or models for the classification of data inputs with a quantum computer. Following the success of collective decision making with ensembles in classical machine learning, this paper introduces the concept of quantum ensembles of quantum classifiers. Creating the ensemble corresponds to a state preparation routine, after which the quantum classifiers are evaluated in parallel and their combined decision is accessed by a single-qubit measurement. This framework naturally allows for exponentially large ensembles in which – similar to Bayesian learning – the individual classifiers do not have to be trained. As an example, we analyse an exponentially large quantum ensemble in which each classifier is weighed according to its performance in classifying the training data, leading to new results for quantum as well as classical machine learning. PACS numbers: 03.67.Ac,03.67.Lx Keywords: quantum machine learning, quantum algorithms, ensemble methods, committee decisions 1. Introduction In machine learning, a classifier can be understood as a mathematical model or computer algorithm that takes input vectors of features and assigns them to classes or ‘labels’. For example, the features could be derived from an image and the label assigns the image to the classes “shows a cat” or “shows no cat”. Such a classifier can be written as a function f : X → Y mapping from an input space X to the space of possible labels Quantum ensembles of quantum classifiers 2 Y. The function can depend on a set of parameters θ, and training the classifier refers to fitting the parameters to sample data of input-label pairs in order to get a model f (x; θ), x ∈ X that generalises from the data how to classify future inputs. It is by now common practise to consult not only one trained model but to train an ensemble of models f (x; θi ), i = 1, ..., E and derive a collective prediction that supersedes the predictive power of a single classifier [1]. In the emerging discipline of quantum machine learning, a number of quantum algorithms for classification have been proposed [2, 3, 4] and demonstrate how to train and use models for classification on a quantum computer. It is an open question how to cast such quantum classifiers into an ensemble framework that likewise harvests the strengths of quantum computing, and this article is a first step to answering this question. We will focus on a special type of quantum classifier here, namely a model where a set of parameters θ can be expressed by a n-qubit state |θi, and the classification result is encoded in a separate register of qubits. This format allows us to create a ‘superposition of P quantum models’ θ |θi and evaluate them in parallel. A state preparation scheme can be used to weigh each classifier, thereby creating the ensemble. This allows for the instantaneous evaluation of exponentially large quantum ensembles of quantum classifiers. Exponentially large ensembles do not only have the potential to increase the predictive power of single quantum classifiers, they also offer an interesting perspective on how to circumvent the training problem in quantum machine learning. Training in the quantum regime relies on methods that range from sampling from quantum states [4] to quantum matrix inversion [2] and Grover search [5]. However, for complex optimisation problems where little mathematical structure is given (an important example being feed-forward neural networks), the translation of iterative methods such as backpropagation to efficient quantum algorithms is less straight forward (see Ref. [6]). It is known from classical machine learning that one can avoid optimisation by exchanging it for integration: In Bayesian learning one has to solve an integral over all possible parameters instead of searching for a single optimal candidate. The idea of integrating over parameters can be understood as forming a collective decision by consulting all possible models from a certain family and weigh them according to their desired influence – which is the approach of the ensemble framework. In other words, quantum ensembles of quantum classifiers offer an interesting perspective to optimisation-free learning with quantum computers. In order to illustrate the concept of quantum ensembles of quantum classifiers, we investigate an exponentially large ensemble inspired by Bayesian learning, in which every ensemble member is weighed according to its accuracy on the data set. We give a quantum circuit to prepare such a quantum ensemble for general quantum classifiers, from which the collective decision can be computed in parallel and evaluated from a single qubit measurement. It turns out that for certain models this procedure effec- Quantum ensembles of quantum classifiers 3 tively constructs an ensemble of accurate classifiers (those that perform on the training set better than random guessing). It has been shown that in some cases, accurate but weak classifiers can build a strong classifier, and analytical and numerical investigations show that this may work. To our knowledge, this result has not been established in the classical machine learning literature and shows how quantum machine learning can stimulate new approaches for traditional machine learning as well. This article is structured as follows. Section 2 provides definitions and summarises research relevant to our work, while Section 3 introuduces the formalism of quantum ensembles of quantum classifiers. Section 4 presents the example of an accuracyweighted ensemble, and 5 shows that for some cases this is an effective ensemble of accurate members. Section 6 analyses the example analytically and leads to the conclusion in Section 7. 2. Classification with asymptotically large ensembles of accurate models Before introducing the quantum ensemble framework as well as the example of an accuracy-weighed ensemble, we provide a review of classical results on ensemble methods. An emphasis lies on studies that analyse asymptotically large ensembles of accurate classifiers, and although no rigorous proofs are available, we find strong arguments for the high predictive power of large collections of weak learners. The problem we will focus on here is a supervised binary pattern classification task. Given a dataset D = {(x(1) , y (1) ), ..., (x(M ) , y (M ) )} with inputs x(m) ∈ RN and outputs or labels y (m) ∈ {−1, 1} for m = 1, ..., M , as well as a new input x̃. The goal is to predict the unknown label ỹ. Consider a classifier y = f (x; θ), (1) with input x ∈ X and parameters θ. As mentioned above, the common approach in machine learning is to choose a model by fitting the parameters to the data D. Ensemble methods are based on the notion that allowing only one final model θ for prediction, whatever intricate the training procedure is, will neglect the strengths of other candidates even if they have an overall worse performance. For example, one model might have learned how to deal with outliers very well, but at the expense of being slightly worse in predicting the rest of the inputs. This ‘expert knowledge’ is lost if only one winner is selected. The idea is to allow for an ensemble or committee E of trained models (sometimes called ‘experts’ or ‘members’) that take the decision for a new prediction together. Considering how familiar this principle is in our societies, it is surprising that this thought only gained widespread attention as late as the 1990s. Many different proposals have been put forward of how to use more than one model for prediction. The proposals can be categorised along two dimensions [7], first the selection procedure they apply to obtain the ensemble members, and second the Quantum ensembles of quantum classifiers 4 decision procedure defined to compute the final output (see Figure 1). Note that here we will not discuss ensembles built from different machine learning methods but consider a parametrised model family as given by Eq. (1) with fixed hyperparameters. An example is a neural network with a fixed architecture and adjustable weight parameters. A very straight-forward strategy of constructing an ensemble is to train several models and decide according to their majority rule. More intricate variations are popular in practice and have interesting theoretical foundations. Bagging [8] trains classifiers on different subsamples of the training set, thereby reducing the variance of the prediction. AdaBoost [9, 10] trains subsequent models on the part of the training set that was misclassified previously and applies a given weighing scheme, which can be understood to reduce the bias of the prediction. Mixtures of experts [11] train a number of classifiers using a specific error function and in a second step train a ‘gating network’ that defines the weighing scheme. For all these methods, the ensemble classifier can be written as ! X ỹ = sgn wθ f (x̃; θ) . (2) θ∈E The coefficients wθ weigh the decision f (x̃; θ) ∈ {−1, 1} of each model in the ensemble E specified by θ, while the sign function assigns class 1 to the new input if the weighed sum is positive and −1 otherwise. It is important for the following to rewrite this as a sum over all E possible parameters. Here we will use a finite number representation and limit the parameters to a certain interval to get the discrete sum ! E−1 X ỹ = sgn wθ f (x̃; θ) . (3) θ=0 In the continuous limit, the sum has to be replaced by an integral. In order to obtain the ensemble classifier of Eq. (2), the weights wθ which correspond to models that are not part of the ensemble E are set to zero. Given a model family f , an interval for the parameters as well as a precision to which they are represented, an ensemble is therefore fully defined by the set of weights {w0 ...wE−1 }. Writing a sum over all possible models provides a framework to think about asymptotically large ensembles which can be realised by quantum parallelism. Interesting enough, this formulation is also very close to another paradigm of classification, the Bayesian learning approach [12, 13]. Given a training dataset D as before and understanding x as well as y as random variables, the goal of classification in the Bayesian setting is to find the conditional probability distribution Z p(x, y|D) = p(x, y|θ)p(θ|D)dθ, (4) from which the prediction can be derived, for example by a Maximum A Posteriori estimate. The first part of the integrand, p(x, y|θ), is the probability of an input-label pair to be observed given the set of parameters for the chosen model. The correspondence of Eq. (3) and Eq. (4) becomes apparent if one associates f (x; θ) with p(x, y|θ) 5 Quantum ensembles of quantum classifiers D selection procedure f (x; θ1 ) f (x; θ2 ) .. . f (x; θN ) D decision procedure ỹ x̃ Figure 1. The principle of ensemble methods is to select a set of classifiers and combine their predictions to obtain a better performance in generalising from the data. Here, the N classifiers are considered to be parametrised functions from a family {f (x; θ)}, where the set of parameters θ solely defines the individual model. The dataset D is consulted in the selection procedure and sometimes also plays a role in the decision procedure where a label ỹ for a new input x̃ is chosen. and interprets wθ as an estimator for the posterior p(θ|D) of θ being the true model given the observed data. If we also consider different model families specified by the hyperparameters, this method turns into Bayesian Model Averaging which is sometimes included in the canon of ensemble method (although being based on a rather different theoretical foundation [14]). Beyond the transition to a Bayesian framework, increasing the size of the ensemble to include all possible parameters has been studied in different contexts. In some cases adding accurate classifiers has been shown to increase the performance of the ensemble decision. Accurate classifiers have an accuracy a (estimated by the number of correctly classified test samples divided by the total samples of the validation set) of more than 0.5, and are thus better than random guessing, which means that they have ‘learned’ the pattern of the training set to at least a small extend. The most well-known case has been developed by Schapire [9] leading to the aforementioned AdaBoost algorithm where a collection of weak classifiers with accuracy slightly better than 0.5 can be turned into a strong classifier that is expected to have a high predictive power. The advantage here is that weak classifiers are comparably easy to train and combine. But people thought about the power of weak learners long before AdaBoost. The Cordocet Jury Theorem from 1758 states that considering a committee of judges where each judge has a probability p with p > 0.5 to reach a correct decision, the probability of a correct collective decision by majority vote will converge to 1 as the number of judges approaches infinity. This idea has been applied to ensembles of neural networks by Hansen and Salamon [15]. If all ensemble members have a likelihood of p to classify a new instance correctly, and their errors are uncorrelated, the probability that the majority rule classifies the new instance incorrectly is given by E X k>E/2 ( E ) kpE−k (1 − p)k , 6 Quantum ensembles of quantum classifiers 1.0 error p = 0.49 p = 0.51 5 p = 0.7 p = 0.9 0 0.5 0.0 50 ensemble size 100 −5 0.0 p 2 (1−p) p (1−p) 0.5 1.0 p Figure 2. Left: Prediction error when increasing the size of an ensemble of classifiers each of which has an accuracy p. Asymptotically, the error converges to zero if p > 0.5. Right: For p > 0.5, the odds ratio p/(1 − p) grows slower than its square. Together with the results from Lam et al described in the text, this is an indication that adding accurate classifiers to an ensemble has a high chance to increase its predictive power. where E is again the ensemble size. The convergence behaviour is plotted in Figure 2 (left) for different values of p. The assumption of uncorrelated errors is idealistic, since some data points will be more difficult to classify than others and therefore tend to be misclassified by a large proportion of the ensemble members. Hansen and Salamon argue that for the highly overparametrised neural network models they consider as base classifiers, training will get stuck in different local minima, so that the ensemble members will be sufficiently diverse in their errors. A more realistic setting would also assume that each model has a different prediction probability p (that we can measure by the accuracy a), which has been investigated by Lam and Suen [16]. The change in prediction power with the growth of the ensemble obviously depends on the predictive power of the new ensemble member, but its sign can be determined. Roughly stated, adding two classifiers with accuracies a1 , a2 to an a2 is not ensemble of size 2n will increase the prediction power if the value of (1−aa11)(1−a 2) ai less than the odds ratio (1−ai ) of any ensemble member, i = 1, ..., E. When plotting the odds ratio and its square in Figure 2 (right), it becomes apparent that for all ai > 0.5 chances are high to increase the predictive power of the ensemble by adding a new weak learner. Together, the results from the literature results suggest that constructing large ensembles of accurate classifiers can lead to a strong combined classifier. Before proceeding to quantum models, another result is important to mention. If we consider all possible parameters θ in the sum of Equation (3) and assume that the model defined by θ has an accuracy aθ on the training set, the optimal weighing scheme [17] is given by aθ . (5) w(θ) = log 1 − aθ It is interesting to note that this weighing scheme corresponds to the weights chosen in AdaBoost for each trained model, where they are derived from what seems to be a different theoretical objective. 7 Quantum ensembles of quantum classifiers −1 0 1 000 001 010 011 100 101 110 111 Figure 3. Example for the representation of parameters in a uniform quantum superposition of three qubits. Each computational basis state |000i, |001i, ..., |111i corresponds to a parameter in the interval [−1, 1]. 3. Quantum ensembles of quantum classifiers The idea of this section is to cast the notion of ensembles into a quantum algorithmic framework, based on the idea that quantum parallelism can be used to evaluate ensemble members of an exponentially large ensemble in one step. Consider a quantum routine A which ‘computes’ a model function f (x; θ), A |xi|θi|0i → |xi|θi|f (x; θ)i, which we will call a quantum classifier in the following. The last qubit |f (x; θ)i thereby encodes class f (x; θ) = −1 in state |0i and class 1 in state |1i. Note that it is not important whether the registers |xi, |θi encode the classical vectors x, θ in the amplitudes or qubits of the quantum state. If encoding classical information into the binary sequence of computational basis states (i.e. x = 2 → 010 → |010i ), every function f (x; θ) a classical computer can compute efficiently could in principle be translated into a quantum circuit A. This means that every classifier leads to an efficient quantum classifier (possibly with large polynomial overhead). An example for a quantum perceptron classifier can be found in Ref. [18], while feed-forward neural networks have been considered in [19]. With this definition of a quantum classifier, A can be implemented in parallel to a superposition of parameter states. 1 X 1 X A |xi √ |θi |0i → |xi √ |θi |f (x; θ)i. E θ E θ P For example, given θ ∈ [a, b], the expression √1E θ |θi could be a uniform superposition, τ 2 −1 1 X √ |ii, E i=0 where each computational basis state |ii corresponds to a τ -bit length binary representations of the parameter, dividing the interval that limits the parameter values into 2τ candidates (see Figure 3). As explained before, an ensemble method can be understood as a weighing rule for each model in the sum of Eq. (3). We will therefore require a second quantum routine, W, which turns the uniform superposition into a non-uniform one, 1 X√ 1 X W |xi √ |θi|0i → |xi √ wθ |θi|0i, Eχ θ E θ Quantum ensembles of quantum classifiers 8 weighing each model θ by a classical probability wθ . We call this routine a quantum ensemble since the weights define which model contributes to what extend to the comP wθ = 1. Note that this bined decision. The normalisation factor χ ensures that θ Eχ routine can be understood as a state preparation protocol of a qsample. Together, the quantum routines A and W define the quantum ensemble of quantum classifiers, by first weighing the superposition of models (in other words the basis states in the parameter register) and then computing the model predictions for the new input x̃ in parallel. The final quantum state is given by 1 X√ wθ |θi|f (x̃; θ)i. |x̃i √ Eχ θ The measurement statistics of the last qubit contain the ensemble prediction: The chance of measuring the qubit in state 0 is the probability of the ensemble deciding for class −1 and is given by X wθ , p(ỹ = −1) = Eχ + θ∈E while the chance of measuring the qubit in state 1 reveals p(ỹ = 1) and is given by X wθ p(ỹ = 1) = , Eχ − θ∈E where E ± is the subset of E containing only models with f (x̃; θ) = ±1. After describing the general template, we will now look at how to implement a specific weighing scheme with a quantum routine W for general models A and analyse the resulting classifier in more detail. 4. Choosing the weights proportional to the accuracy As an illustrative case study, we choose weights that are proportional to the accuracy aθ of each model, as measured on the training set. More precisely, this is the proportion of correct classifications over the number of data points M 1 X1 aθ = |f (xm ; θi ) + y m |. M m=1 2 Note that while usually an estimate for the accuracy of a trained model is measured on a separate test or validation set, we require the accuracy here to build the classifier in the first place and therefore have to measure it on the training set. The goal of the quantum algorithm is to prepare a quantum state where each model represented by state |θi has a probability to be measured that is proportional to its accuracy, wθ ∝ aθ . Quantum ensembles of quantum classifiers 9 The weighing routine W can be constructed as follows. Required for computation is a system of (δ + 1) + τ + 1 + 1 qubits divided into four registers: the data register, the parameter register, the output register and the accuracy register, |0...0; 0i ⊗ |0...0i ⊗ |0i ⊗ |0i. | {z } | {z } δ+1 qubits (6) τ qubits Assume a quantum classification routine A is given. As a first step, τ Hadamards bring the parameter register into a uniform superposition, and a Hadamard is applied to the accuracy qubit: τ 2 −1 1 X 1 √ |0...; 0i|ii|0i √ (|0i + |1i). 2 E i=0 Each |ii thereby encodes a set of parameters θ. We now ‘load’ the training pairs successively into the data register, compute the outputs in superposition by applying the core routine A and rotate the accuracy qubit by a small amount towards |0i or |1i depending on whether target output and actual output have the same value (i.e. by a XOR gate on the respective qubits together with a conditional rotation of the last qubit). The core routine and loading step are then uncomputed by applying the inverse operations. ‡ After all training points have been processed, the accuracy qubit is entangled √ √ with the parameter register and in state |qθ i = aθ |0i + 1 − aθ |1i. A postselective measurement on the accuracy qubit only accepts when it is in in state |0i and repeats the routine otherwise. This selects the |0i-branch of the superposition and leaves us with the state 1 X√ √ aθ |0...; 0i|θi|0i, Eχ θ P where the normalisation factor χ is equal to the acceptance probability pacc = E1 θ aθ . The probability of acceptance influences the runtime of the algorithm, since a measurement of the ancilla in 1 means we have to abandon the result and start the routine from scratch. We expect that choices of the parameter intervals and data pre-processing allows us to keep the acceptance probability sufficiently high for many machine learning applications, as most of the aθ can be expected to be distributed around 0.5. This hints towards rejection sampling as a promising tool to translate the accuracy-weighted quantum ensemble into a classical method. Now load the new input into the first δ qubits of the data register, apply the routine A once more and uncompute (and disregard) the data register to obtain 1 X√ |ψi = √ aθ |θi|f (x̃, θ)i. Eχ θ P ‡ One could alternatively prepare a training superposition √1M m |xm i and trace the training register out in the end. The costs remain linear in the number of training vectors times the bit-depth for each training vector for both strategies. 10 Quantum ensembles of quantum classifiers x1 1 o * −θ * −1 * −1 1 x2 * * * * * * θ * * aθ = 0.84 a−θ = 0.16 class −1 * class 1 o new input Figure 4. Illustration of the decision boundary of a perceptron model for twodimensional inputs. The parameter vector defines a hyperplane dividing input space into regions of class −1 and 1. A change of sign of the parameters swaps the decision regions and leads to an accuracy of a−θ = 1 − aθ , . The measurement statistics of the last qubit now contain the desired value. More precisely, the expectation value of I ⊗ σz is given by 1 X aθ (f (x̃; θ) + 1)/2, hψ|I ⊗ σz |ψi = Eχ θ and corresponds to the classifier in Eq. (3). Repeated measurements reveal this expectation value to the desired precision. 5. Why accuracies may be good weights We will now turn to the question why the accuracies might be a good weighing scheme. Recall that there is a lot of evidence that ensembles of weak but accurate classifiers (meaning that aθ > 0.5 for all θ) can lead to a strong classifier. The ensemble constructed in the last section however contains all sorts of models which did not undergo a selection procedure, and it may therefore contain a large –or even exponential– share of models with low accuracy or random guessing. It turns out that for a large class of model families, the ensemble effectively only contains accurate models. This to our knowledge is a new result also interesting for classical ensemble methods. Assume the core machine learning model has the property to be point symmetric in the parameters θ, f (x; −θ) = −f (x; θ). This is true for linear models and neural networks with an odd number of layers such as a simple perceptron or an architecture with 2 hidden layers. Let us furthermore assume that the parameter space Θ is symmetric around zero, meaning that for each 11 Quantum ensembles of quantum classifiers 5 weight p ) log( (1−p) 2p − 1 0 −5 0.0 0.5 1.0 accuracy Figure 5. Comparison of the effective weight transformation described in the text and the optimal weight rule [17]. Both flip the prediction of a classifier that has an accuracy of less than 0.5. θ ∈ Θ there is also −θ ∈ Θ. These pairs are denoted by θ+ ∈ Θ+ , θ− ∈ Θ− . With this notation one can write f (x; θ+ ) = −f (x; θ− ). R From there it follows that θ∈Θ f (x; θ) = 0 and a(θ+ ) = 1 − a(θ− ). To get an intuition, consider a linear model imposing a linear decision boundary in the input space. The parameters define the vector orthogonal to the decision boundary (in addition to a bias term that defines where the boundary intersects with the y-axis which we ignore for the moment). A sign change of all parameters flips the vector around; the linear decision boundary remains at exactly the same position, meanwhile all decisions are turned around (see Figure 4). For point symmetric models the expectation can be expressed as a sum over one half of the parameter space:   1 X 1 X 1 + aθ f (x̃, θ) = a(θ ) − f (x̃, θ+ ). (7) Eχ θ Eχ + 2 θ The result of this ‘effective transformation’ is to shift the weights from the interval [0, 1] to [−0.5, 0.5], with profound consequences. The transformation is plotted in Figure 5. One can see that accurate models get a positive weight, while non-accurate models get a negative weight and random guessers vanish from the sum. The negative weight consequently flips the decision f (x; θ) of the ‘bad’ models and turns them into accurate classifiers. This is a linearisation of the rule mentioned in Eq. (5) as the optimal weight distribution for large ensembles (plotted in black for comparison). With this in mind we can rewrite the expectation value as 1 X ã(θ)f (x̃, θ), E[f (x̃; θ)] = E θ|a(θ)>0.5 (8) 12 Quantum ensembles of quantum classifiers with the new weights 1 ã(θ) = a(θ) − , 2 + for parameters θ as well as θ− . (9) If one cannot assume a point-symmetric parameter space but still wants to construct an ensemble of all accurate models (i.e., aθ > 0.5), an alternative to the above sketched routine W could be to construct an oracle that marks such models and then use amplitude amplification to create the desired distribution. A way to mark the models is to load every training vector into a predefined register and compute |f (xm ; θ)i as before, but perform a binary addition on a separate register that “counts” the number of correctly classified training inputs. The register would be a binary encoding of the count, and hence require dlog M e qubits (as well as garbage qubits for the addition operation). If log M = µ for an integer µ, then the first qubit would be one if the number of correct classifications is larger than M/2 and zero otherwise. In other words, this qubit would flag the accurate models and can be used as an oracle for amplitude amplification. The optimal number of Grover iterations depends on the number of flagged models. In the best case, around 41 th of all models are accurate so that the q optimal number of iterations is of the order of E/ 14 E = 2. Of course, this number has to be estimated before performing the Grover iterations.§ 6. Analytical investigation of the accuracy-weighted ensemble In order to explore the accuracy-weighted ensemble classifier further, we conduct some analytical and numerical investigations for the remainder of the article. It is convenient to assume that we know the probability distribution p(x, y) from which the data is picked (that is either the ‘true’ probability distribution with which data is generated, or the approximate distribution inferred by some data mining technique). Furthermore, R P we consider the continuous limit → . Each parameter θ defines decision regions in the input space, Rθ−1 for class −1 and Rθ1 for class 1 (i.e. regions of inputs that are mapped to the respective classes). The accuracy can then be expressed as Z Z 1 1 a(θ) = p(x, y = -1) dx + p(x, y = 1) dx. (10) 2 2 Rθ-1 Rθ1 In words, this expression measures how much of the density of a class falls into the decision region proposed by the model for that class. Good parameters will propose decision regions that contain the high-density areas of a class distribution. The factor of 1/2 is necessary to ensure that the accuracy is always in the interval [0, 1] since the § If one can analytically prove that 21 E of all possible models will be accurate as in the case of pointsymmetric functions, one can artificially extend the superposition to twice the size, prevent half of the subspace from being flagged and thereby achieve the optimal amplitude amplification scheme. 13 Quantum ensembles of quantum classifiers class −1 class 1 class 1 class −1 x x ((w0 )1 , o = 1) ((w0 )2 , o = −1) Figure 6. Very simple model of a 1-dimensional classifier analysed in the text: The parameter w0 denotes the position of the decision boundary while parameter o determines its orientation. two probability densities are each normalised to 1. The probability distributions we consider here will be of the form p(x, y = R∞ ±1) = g(x; µ± , σ± ) = g± (x). They are normalised, −∞ g± (x)dx = 1, and vanish asymptotically, g± (x) → 0 for x → −∞ and x → +∞. The hyperparameters µ− , σ− and µ+ , σ+ define the mean or ‘position’ and the variance or ‘width’ of the distribution for the two classes −1 and 1. Prominent examples are Gaussians or box functions. Let G(x; µ± , σ± ) = G± (x) be the integral of g(x; µ± , σ± ), which fulfils G± (x) → 0 for x → −∞ and G± (x) → 1 for x → +∞. Two expressions following from this property which will become important later are Za g± (x)dx = G± (a) − G± (−∞) = G± (a), −∞ and Z∞ g± (x)dx = G± (∞) − G± (a) = 1 − G± (a). a We consider a minimal toy example for a classifier, namely a perceptron model on a one-dimensional input space, f (x; w, w0 ) = sgn(wx + w0 ) with x, w, w0 ∈ R. While one parameter would be sufficient to mark the position of the point-like ‘decision boundary’, a second one is required to define its orientation. One can simplify the model even further by letting the bias w0 define the position of the decision boundary and introducing a binary ‘orientation’ parameter o ∈ {−1, 1} (as illustrated in Figure 6), f (x; o, w0 ) = sgn(o(x − w0 )). For this simplified perceptron model the decision regions are given by R−1 = [−∞, w0 ], R1 = [w0 , ∞], for the orientation o = 1 and R−1 = [w0 , ∞], R1 = [−∞, w0 ], for o = −1. Our goal is to compute the expectation value Z E[f (x̃; w0 , o)] ∝ dθ a(θ)f (x̃; o, w0 ), (11) 14 Quantum ensembles of quantum classifiers x2 Figure 7. The black line plots the expectation value of the accuracy-weighed ensemble decision discussed in the text for the two class densities and for different new inputs x. A positive expectation value yields the prediction 1 while a negative expectation value predicts class −1. At E[f (x; w0 , o)] = 0 lies the decision boundary. The plot shows that the model predicts the decision boundary where we would expect it, namely exactly between the two distributions. 2.0 1.5 1.0 0.5 0.0 0.5 1.0 1.5 2.0 class -1 class 1 2.0 1.5 1.0 0.5 0.0 0.5 1.0 1.5 2.0 x1 Figure 8. Perceptron classifier with 2-dimensional inputs and a bias. The ensemble consist of 8000 models, each of the three parameters taking 20 equally distributed values from [−1, 1]. The resolution to compute the decision regions was ∆x1 = ∆x2 = 0.05. The dataset was generated with python scikit-learn’s blob function and both classes have the same variance parameter. One can see that in two dimensions, the decision boundary still lies in between the two means of µ−1 = [−1, 1] and µ1 = [1, −1]. of which the sign function evaluates the desired prediction ỹ. Inserting the definitions from above, as well as some calculus using the properties of p(x) brings this expression to Z∞ dw0 (G− (w0 ) − G+ (w0 )) sgn(x̃ − w0 ), −∞ and evaluating the sign function for the two cases x̃ > w0 , x̃ < w0 leads to Zx̃ n o Z∞ n o dw0 G+ (w0 ) − G− (w0 ) − dw0 G+ (w0 ) − G− (w0 ) . −∞ (12) x̃ To analyse this expression further, consider the two class densities to be Gaussian probability distributions p(x, y = ±1) = 1 √ σ± 2π − exp (x−µ± )2 2 2σ± . 15 Quantum ensembles of quantum classifiers The indefinite integral over the Gaussian distributions is given by x − µ± 1 ]. G± (x) = [1 + erf √ 2 2σ± Inserting this into Eq (12) we get an expectation value of Zx̃ −∞ Z∞ n w −µ n w −µ w 0 − µ− o w 0 − µ− o 0 + 0 + − dw0 erf √ .(13) dw0 erf √ −erf √ −erf √ 2σ+ 2σ− 2σ+ 2σ− x̃ Figure 7 plots the expectation value for different inputs x̃ for the case of two Gaussians with σ− = σ+ = 0.5, and µ− = −1, µ+ = 1. The decision boundary is at the point where the expectation value changes from a negative to a positive value, E[f (x̂; w0 , o)] = 0. One can see that for this simple case, the decision boundary will be in between the two means, which we would naturally expect. This is an important finding, since it implies that the accuracy-weighted ensemble classifier works - arguably only for a very simple model and dataset. A quick calculation shows that we can always find the decision boundary midway between the two means if σ− = σ+ . In this case the integrals in Eq. (13) evaluate to Zx̃ −∞ w 0 − µ± = γ± (x̃) − lim γ± (R), dw0 erf √ R→−∞ 2σ± and Z∞ x̃ w 0 − µ± dw0 erf √ = lim γ± (R) − γ± (x̃), R→∞ 2σ± with the integral over the error function   r x−µ x − µ± 2 −( √ ± )2 γ± (x) = (x − µ± ) erf √ + σ± e 2σ± . π 2σ± Assuming that the mean and variance of the two class distributions are of reasonable (i.e. finite) value, the error function evaluates to 0 or 1 before the limit process becomes important, and one can therefore write r R−µ 2 −( √ ± )2 2σ± lim γ± (R) = lim σ± e , (14) R→−∞ R→−∞ π r R−µ 2 −( √ ± )2 2σ± − µ. (15) lim γ± (R) = lim R + lim σ± e R→∞ R→∞ R→∞ π The expectation value for the case of equal variances therefore becomes E[f (x̃; w0 , o)] = 2γ− (x̃) − 2γ+ (x̃). (16) Setting x̃ = µ̂ = µ− + 0.5(µ+ + µ− ) turns the expectation value to zero; the point µ̂ between the two variances is shown to be the decision boundary. Simulations confirm that this is also true for other distributions, such as a square, exponential or Lorentz distribution, as well as for two-dimensional data (see Figure 8). 16 Quantum ensembles of quantum classifiers Example 1 prediction f (x =1; w0 , o) class distributions 1.0 1.2 1.0 0.8 0.6 0.4 0.2 0.0 p(x, y = −1) 0.5 p(x, y = 1) o=1 o = −1 0.0 −0.5 −6 −4 −2 0 2 4 6 −1.0 x accuracy a(w0 , o) 1.0 0.8 0.6 0.4 0.2 0.0 −6 −4 0 2 4 6 4 6 w0 resulting function 1.5 o=1 o = −1 −2 1.0 0.5 0.0 −0.5 −6 −4 −2 0 2 4 6 −1.0 w0 −6 −4 −2 0 2 w0 Example 2 prediction f (x =1; w0 , o) class distributions 1.0 1.2 1.0 0.8 0.6 0.4 0.2 0.0 p(x, y = −1) 0.5 p(x, y = 1) o=1 o = −1 0.0 −0.5 −6 −4 −2 0 2 4 6 x accuracy a(w0 , o) 1.0 0.8 0.6 0.4 0.2 0.0 −1.0 −6 −4 0 2 4 6 4 6 w0 resulting function 1.5 o=1 o = −1 −2 1.0 0.5 0.0 −0.5 −6 −4 −2 0 w0 2 4 6 −1.0 −6 −4 −2 0 2 w0 Figure 9. Detailed analysis of the classification of x̃ = 1 for two examples of normal data distributions. The upper Example 1 shows p(x, y = −1) = N (−1, 0.5) and p(x, y = 1) = N (1, 0.5) while the lower Example 2 shows p(x, y = −1) = N (−1, 0.5) and p(x, y = 1) = N (1, 2) (plotted each in the top left figure of the four). The top right figure in each block shows the classification of a given new input x̃ for varying parameters b, plotted for o = 1 and o = −1 respectively. The bottom left shows the accuracy or classification performance a(w0 , o = 1) and a(w0 , o = −1) on the data distribution. The bottom right plots the product of the previous two for o = 1 and o = −1, as well as the resulting function under the integral. The prediction outcome is the integral over the black curve, or the total of the gray shaded areas. One can see that for models with different variances, the accuracies loose their symmetry and the decision boundary will therefore not lie in the middle between the two means. The simplicity of the core model allows us to have a look into the structure of the expectation value. Figure 9 shows the components of the integrand in Eq. (11) for Quantum ensembles of quantum classifiers 17 the expectation value, namely the accuracy, the core model function as well as their product. Example 1 shows the same variances σ+ = σ− , while Example 2 plots different variances. The plots show that for equal variances, the accuracy is a symmetric function centred between the two means, while for different variances, the function is highly asymmetric. In case the two distributions are sufficiently close to each other, this has a sensitive impact on the position of the decision boundary, which will be shifted towards the flatter distribution. This might be a desired behaviour in some contexts, but is first and foremost an interesting result of the analytical investigation. As a summary, analysing a very simple classifier in relation to one-dimensional Gaussian data distributions gives evidence that the weighted average ensemble classifier can lead to meaningful predictions for separated data, but there seems to be a sensitive dependency on the shape of the distributions. Further investigations would have to show how the accuracy-weighted ensemble classifier behaves with more complex base classifiers and/or realistic datasets. Low resolution simulations with one-dimensional inputs confirm that nonlinear decision boundaries can in fact be learnt. However, computing the exact expectation value is a huge computational effort. For example, the next more complex neural network model requires two hidden layers to be point symmetric, and with one bias neuron and for two-dimensional inputs the architecture has already seven or more weights. If each weight is encoded in three qubits only (including one qubit for the sign), we get an ensemble of 221 members whose collective decision needs to be computed for an entire input space in order to determine the decision boundaries. Sampling methods could help to obtain approximations to this result, and would open these methods to classical applications as well. 7. Conclusion This article proposed a framework to construct quantum ensembles of quantum classifiers which use parallelism in order to evaluate the predictions of exponentially large ensembles. The proposal leaves a lot of space for further research. First, as mentioned above, the quantum ensemble has interesting extensions to classical methods when considering approximations to compute the weighted sum over all its members’ predictions. Recent results on the quantum supremacy of Boson sampling show that the distributions of some state preparation routines (and therefore some quantum ensembles), cannot be computed efficiently on classical computers. Are there meaningful quantum ensembles for which a speedup can be proven? Are the rules of combining weak learners to a strong learner different in the quantum regime? Which types of ensembles can generically prepared by quantum devices? Second, an important issue that we did not touch upon is overfitting. In AdaBoost, regularisation is equivalent to early stopping [20], while Bayesian learning has inbuilt regularisation mechanisms. How does the accuracy-based ensemble relate to these cases? Is it likely to overfit when considering more flexible models? A third question is whether there are other (coherent) Quantum ensembles of quantum classifiers 18 ways of defining a quantum ensemble for quantum machine learning algorithms that do not have the format of a quantum classifier as defined above. Can mixed states be used in this context? In summary, this article provided a first step to think about ensemble methods in quantum machine learning and is an example for the mutual enrichment that classical and quantum machine learning can provide for each other. Acknowledgments This work was supported by the South African Research Chair Initiative of the Department of Science and Technology and the National Research Foundation. We thank Ludmila Kuncheva and Thomas Dietterich for their helpful comments. References [1] Thomas G Dietterich. Ensemble methods in machine learning. In International Workshop on Multiple Classifier Systems, pages 1–15. Springer, 2000. [2] Patrick Rebentrost, Masoud Mohseni, and Seth Lloyd. Quantum support vector machine for big data classification. Physcial Review Letters, 113:130503, Sep 2014. [3] Seth Lloyd, Masoud Mohseni, and Patrick Rebentrost. Quantum algorithms for supervised and unsupervised machine learning. arXiv preprint arXiv:1307.0411, 2013. [4] Mohammad H Amin, Evgeny Andriyash, Jason Rolfe, Bohdan Kulchytskyy, and Roger Melko. Quantum Boltzmann machine. arXiv preprint arXiv:1601.02036, 2016. [5] Ashish Kapoor, Nathan Wiebe, and Krysta Svore. Quantum perceptron models. In Advances In Neural Information Processing Systems, pages 3999–4007, 2016. [6] Patrick Rebentrost, Maria Schuld, Francesco Petruccione, and Seth Lloyd. Quantum gradient descent and Newton’s method for constrained polynomial optimization. arXiv preprint quantph/1612.01789, 2016. [7] Ludmila I Kuncheva. Combining pattern classifiers: Methods and algorithms. John Wiley & Sons, 2004. [8] Leo Breiman. Random forests. Machine Learning, 45(1):5–32, 2001. [9] Robert E Schapire. The strength of weak learnability. Machine Learning, 5(2):197–227, 1990. [10] Yoav Freund and Robert E Schapire. A desicion-theoretic generalization of on-line learning and an application to boosting. In European Conference on Computational Learning Theory, pages 23–37. Springer, 1995. [11] Robert A Jacobs, Michael I Jordan, Steven J Nowlan, and Geoffrey E Hinton. Adaptive mixtures of local experts. Neural computation, 3(1):79–87, 1991. [12] Zoubin Ghahramani. Probabilistic machine learning and artificial intelligence. Nature, 521(7553):452–459, 2015. [13] Richard O Duda, Peter E Hart, and David G Stork. Pattern classification. John Wiley & Sons, New York, 2012. [14] Thomas P Minka. Bayesian model averaging is not model combination, 2000. Comment available electronically at http://www.stat.cmu.edu/minka/papers/bma. html. [15] Lars Kai Hansen and Peter Salamon. Neural network ensembles. IEEE transactions on Pattern Analysis and Machine Intelligence, 12(10):993–1001, 1990. [16] Louisa Lam and SY Suen. Application of majority voting to pattern recognition: An analysis of its behavior and performance. IEEE Transactions on Systems, Man, and Cybernetics-Part A: Systems and Humans, 27(5):553–568, 1997. Quantum ensembles of quantum classifiers 19 [17] Lloyd Shapley and Bernard Grofman. Optimizing group judgmental accuracy in the presence of interdependencies. Public Choice, 43(3):329–343, 1984. [18] Maria Schuld, Ilya Sinayskiy, and Francesco Petruccione. How to simulate a perceptron using quantum circuits. In Physics Letters A, volume 379, pages 660–663, 2015. [19] Kwok Ho Wan, Oscar Dahlsten, Hlér Kristjánsson, Robert Gardner, and MS Kim. Quantum generalisation of feedforward neural networks. arXiv preprint arXiv:1612.01045, 2016. [20] Robert E Schapire. Explaining Adaboost. In Empirical inference, pages 37–52. Springer, 2013.
10math.ST
Learning Deep Object Detectors from 3D Models Xingchao Peng, Baochen Sun, Karim Ali, Kate Saenko University of Massachusetts Lowell arXiv:1412.7122v4 [cs.CV] 12 Oct 2015 {xpeng,bsun,karim,saenko}@cs.uml.edu Abstract Crowdsourced 3D CAD models are becoming easily accessible online, and can potentially generate an infinite number of training images for almost any object category. We show that augmenting the training data of contemporary Deep Convolutional Neural Net (DCNN) models with such synthetic data can be effective, especially when real training data is limited or not well matched to the target domain. Most freely available CAD models capture 3D shape but are often missing other low level cues, such as realistic object texture, pose, or background. In a detailed analysis, we use synthetic CAD-rendered images to probe the ability of DCNN to learn without these cues, with surprising findings. In particular, we show that when the DCNN is fine-tuned on the target detection task, it exhibits a large degree of invariance to missing low-level cues, but, when pretrained on generic ImageNet classification, it learns better when the low-level cues are simulated. We show that our synthetic DCNN training approach significantly outperforms previous methods on the PASCAL VOC2007 dataset when learning in the few-shot scenario and improves performance in a domain shift scenario on the Office benchmark. Figure 1. We propose to train few-shot object detectors for real images by augmenting the training data with synthetic images generated from freely available non-photorealistic 3D CAD models of objects collected from 3dwarehouse.sketchup.com. used successfully in the past to add 2D affine transformations to training images [7], recognize text [6], and even train detectors for a handful of categories such as cars [21]. However it has not yet been demonstrated for detection of many categories with modern DCNNs. [22] trained object detectors for 31 categories on synthetic CAD images, but used a histogram-of-oriented (HOG) gradient model (DPM [4]), which is significantly less powerful than DCNNs on object classification [7] and detection [19, 5, 20]. The main challenge in training with freely available CAD models is that they capture the 3D shape of the object, but frequently lack other low-level cues, such as object texture, background, realistic pose, lighting, etc. [22] used a simple rendering of objects with uniform gray texture and a white background, and showed that HOG-based models learn well from such data, as they are invariant to color and texture and mostly retain the overall shape of the object. However, DCNN visualizations have shown that they retain color, texture and mid-level patterns. It is therefore unknown if they would tolerate the lack of such low-level cues in training images, or if a more sophisticated rendering process that simulates these cues is needed. To investigate how missing low-level cues affect DCNNs’ ability to learn object detectors, we study the precise nature of their “cue invariances”. For a given object category, a DCNN maps the low-level cues contained in the image (shape, texture) to high-level category information (cat, car) represented by top layer activations (e.g. fc7 in AlexNet [7]). We define “cue invariance” to be the ability of the network to extract the equivalent high-level category 1. Introduction Deep CNN models achieve state-of-the-art performance on object detection, but are heavily dependent on largescale training data. Unfortunately, labeling images for detection is extremely time-consuming, as every instance of every object must be marked with a bounding box. Even the largest challenge datasets provide a limited number of annotated categories, e.g., 20 categories in PASCAL VOC [3]), 80 in COCO [12], and 200 in ImageNet [2]. But what if we wanted to train a detector for a novel category? It may not be feasible to compile and annotate an extensive training set covering all possible intra-category variations. We propose to bypass the expensive collection and annotation of real images by using freely available 3D CAD models to automatically generate synthetic 2D training images (see Figure 2). Synthetic data augmentation has been 1 Figure 2. Can we learn deep detectors for real images from non-photorealistic 3D CAD models? We explore the invariance of deep features to missing low-level cues such as shape, pose, texture and context, and propose an improved method for learning from synthetic CAD data that simulates these cues. information despite missing low-level cues. We expect the network to learn different invariances depending on the task it was trained on. Quantifying such invariances could help better understand DCNN models and impove transfer to new domains, e.g., to non-photorealistic data. A small number of papers have started looking at this problem [9, 26, 13], but many open questions remain, such as: are DCNNs invariant to object color? Texture? Context? 3D pose? Is the invariance transferable to new tasks? With the help of images synthetically rendered from 3D models, we design a series of experiments to “peer into the depths” of DCNNs and analyse their invariance to cues, including ones that are difficult to isolate using real 2D image data. We make surprising discoveries regarding the representational power of deep features. In particular, we show that they encode far more complex invariances to cues such as 3D pose, color, texture and context than previously accounted for. We also quantify the degree to which the learned invariances are specific to the training task. Based on our analysis, we propose a method for zeroor few-shot learning of novel object categories that generates synthetic 2D data using 3D models and a few texture and scene images related to the category. An advantage of our approach is that it drastically reduces the amount of human supervision over traditional bounding-box labeling methods. This could greatly expand available sources of visual knowledge and allow learning 2D detectors from the millions of CAD models available on the web. We present experiments on the PASCAL VOC 2007 detection task and show that when training data is missing or limited for a novel category, our method outperforms both training on real data and the synthetic method of [22]. We also demonstrate the advantage of our approach in the setting when the real training data comes from a different domain than target data using the Office [18] benchmark. To summarize, our contributions are three-fold: • we gain new and important insights into the cue invariance of DCNNs through the use of synthetic data, • we show that synthetic training of modern large-scale DCNNs improves detection performance in the fewshot and dataset-bias scenarios, • we present the largest-scale evaluation of synthetic CAD training of object detectors to date. 2. Related Work Object Detection. “Flat” hand-designed representations (HOG, SIFT, etc.) have dominated the object detection literature due to their considerable invariance to factors such as illumination, contrast and small translations. In combination with discriminative classifiers such as linear SVM, exemplar-based [14] or latent SVM [4], they had proved powerful for learning to localize the global outline of an object. More recently, convolutional neural networks [8] have overtaken flat features as clear front-runners in many image understanding tasks, including object detection. DCNNs learn layered features starting with familiar pooled edges in the first layer, and progressing to more and more complex patterns with increasing spatial support. Extensions to detection have included sliding-window CNN [19] and Regions-CNN (RCNN) [5]. Understanding Deep CNNs. There has been increasing interest in understanding the information encoded by the highly nonlinear deep layers. [27] reversed the computation to find image patches that most highly activate an isolated neuron. A detailed study of what happens when one transfers network layers from one dataset to another was presented by [26]. [13] reconstruct an image from one layer’s activations, using image priors to recover the natural statistics removed by the network filters. Their visualizations confirm that a progressively more invariant and abstract representation of the image is formed by successive layers, but they do not analyse the nature of the invariances. Invariance to simple 2D transformations (reflection, in-plane rotation) was explored by [9]. In this paper, we study more complex invariances by “deconstructing” the image into 3D shape, texture, and other factors, and seeing which specific combinations result in high-layer representations discriminant of object categories. Use of Synthetic Data. The use of synthetic data has a longstanding history in computer vision. Among the earliest attempts, [15] used 3D models as the primary source of information to build object models. More recently, [21, 10, 23] used 3D CAD models as their only source of labeled data, but limited their work to a few categories like cars and motorcycles. [16] utilized synthetic data to probe invariances for features like SIFT, SLF, etc. In this paper, we generate training data from crowdsourced 3D CAD models, which can be noisy and low-quality, but are free and available for many categories. We evaluate our approach on all 20 categories in the PASCAL VOC2007 dataset, which is much larger and more realistic than previous benchmarks. Previous works designed special features for matching synthetic 3D object models to real image data ([11]), or used HOG features and linear SVMs ([22]). We employ more powerful deep convolutional images features and demonstrate their advantage by directy comparing to [22]. The authors of [25] use CAD models and show results of both 2D detection and pose estimation, but train multi-view detectors on real images labeled with pose. We avoid expensive manual bounding box and pose annotation, and show results with minimum or no real image labels. Finally, several approaches had used synthetic training data for tasks other than object detection. For example, [6] recently proposed a synthetic text generation engine to perform text recognition in natural scenes while [17] proposed a technique to improve novel-view synthesis for images using the structural information from 3D models. 3. Approach Our approach learns detectors for objects with no or few training examples by augmenting the training data with synthetic 3D CAD images. An overview of the approach is shown in Figure 2. Given a set of 3D CAD models for each object, it generates a synthetic 2D image training dataset by simulating various low-level cues (Section 3.1). It then extracts positive and negative patches for each object from the synthetic images (and an optional small number of real images). Each patch is fed into a deep neural network that computes feature activations, which are used to train the final classifier, as in the deep detection method of RCNN [5] (Section 3.2). We explore the cue invariance of networks trained in different ways, as described in Section 3.3. 3.1. Synthetic Generation of Low-Level Cues Realistic object appearance depends on many low-level cues, including object shape, pose, surface color, reflectance, location and spectral distributions of illumination sources, properties of the background scene, camera characteristics, and others. We choose a subset of factors that can easily be modeled using computer graphics techniques, namely, object texture, color, 3D pose and 3D shape, as well as background scene texture and color. When learning a detection model for a new category with limited labeled real data, the choice of whether or not to simulate these cues in the synthetic data depends on the invariance of the representation. For example, if the representation is invariant to color, grayscale images can be rendered. We study the invariance of the DCNN representation to these parameters using synthetic data generated as follows. 3D Models and Viewpoints Crowdsourced CAD models of thousands of objects are becoming freely available online. We start by downloading models from 3D Warehouse by searching for the name of the desired object categories. For each category, around 5 − 25 models were obtained for our experiments, and we explore the effect of varying intra-class shape by restricting the number of models in our experiments. The original poses of the CAD models can be arbitrary (e.g., upside-down chairs, or tilted cars). We therefore adjust the CAD models’s viewpoint manually to 3 or 4 “views” (as shown in Figure 2) that best represent intraclass pose variance for real objects. Next, for each manually specified model view, we generate several small perturbations by adding a random rotation. Finally, for each pose perturbation, we select the texture, color and background image and render a virtual image to include in our virtual training dataset. Next, we describe the detailed process for each of these factors. Object/Background Color and Texture We investigate various combinations of color and texture cues for both the object and the background image. Previous work by [22] has shown that when learning detectors from virtual data using HOG features, rendering natural backgrounds and texture was not helpful, and equally good results were obtained by white background with uniform gray object texture. They explain this by the fact that a HOG-based classifier is focused on learning the “outlines” of the object shape, and is invariant to color and texture. We hypothesise that the case is different for DCNN representations, where neurons have been shown to respond to detailed textures, colors and mid-level patterns, and explore the invariance of DCNNs to such factors. Specifially, we examine the invariance of the DCNN representation to two types of object textures: realistic color textures and uniform grayscale textures (i.e., no texture at all). In the case of background scenes, we examine invariance to three types of scenes, namely real-image color scenes, real-image grayscale scenes, and a plain white background. Examples of our texture and background generation settings are shown in Table 1. In order to simulate realistic object textures, we use a small number (5 to 8 per category) of real images containing real objects and extract the textures therein by annotating a bounding box. These texture images are then stretched to fit the CAD models. Likewise, in order to simulate realistic background scenes, we gathered about 40 (per category) real images of scenes where each category is likely to appear (e.g blue sky images for aeroplane, images of a lake or ocean for boat, etc.) When generating a virtual image, we first randomly select a background image from the available background pool, and project it onto the image plane. Then, we select a random texture image from the texture pool and map it onto the CAD model before rendering the object. To obtain a deep feature representation of the images, we use the eight-layer “AlexNet” architecture with over 60 million parameters [7]. This network had first achieved breakthrough results on the ILSVRC-2012 [1] image classification, and remains the most studied and widely used visual convnet. The network is trained by fully supervised backpropagation (as in [8]) and takes raw RGB image pixels of a fixed size of 224 × 224 and outputs object category labels. Each layer consists of a set of neurons, each with linear weights on the input followed by a nonlinearity. The first five layers of the network have local spatial support and are convolutional, while the final three layers are fullyconnected to each neuron from the previous layer, and thus include inputs from the entire image. This network, originally designed for classification, was applied and fine-tuned to detection in RCNN [5] with impressive gains on the popular object detection benchmarks. To adapt AlexNet for detection, the RCNN applied the network to each image sub-region proposed by the Selective Search method ([24]), adding a background label, and applied non-maximal suppression to the outputs. Fine-tuning all hidden layers resulted in performance improvements. We refer the reader to [5] for more details. AlexNet) as the feature representation, since it has learned the most class-specific cue invariance. As an example, consider the “cat” object class. If the network is invariant to cat texture, then it will produce similar activations on cats with and without texture, i.e. it will “hallucinate” the right texture when given a texureless cat shape. Then the detector will learn cats equally well from both sets of training data. If, on the other hand, the network is not invariant to cat texture, then the feature distributions will differ, and the classifier trained on textureless cat data will perform worse. We expect that the network will learn different cue invariances depending on the task and categories it is trained on. For example, it may choose to focus on just the texture cue when detecting leopards, and not their shape or context, as their texture is unique. To evaluate the effect of task-specific pre-training, we compare three different variants of the network: 1) one pre-trained on the generic ImageNet [2] ILSVRC 1000-way classification task (IMGNET); 2) the same network additionally fine-tuned on the PASCAL 20-category detection task (PASC-FT); and 3) for the case when a category has no or few labels, we fine-tune the IMGNET network on synthetic CAD data (VCNN). To obtain the VCNN network, we fine-tune the entire network on the synthetic data by backpropagating the gradients with a lower learning rate. This has the effect of adapting the hidden layer parameters to the synthetic data. It also allows the network to learn new information about object categories from the synthetic data, and thus gain new objectclass invariances. We show that this is essential for good performance in the few-shot scenario. Treating the network activations as fixed features is inferior as most of the learning capacity is in the hidden layers, not the final classifier. We investigate the degree to which the presence of different low-level cues affects how well the network can learn from the synthetic data. 3.3. Analysing Cue Invariance of DCNN Features 4. Experiments Recall that we define “cue invariance” to be the ability of the network to extract the same high-level category information from training images despite missing low-level cues such as object texture. To test for this invariance, we create two synthetic training sets, one with and one without a particular cue. We then extract deep features from both sets, train two object detectors, and compare their performance on real test data. Our hypothesis is that, if the representation is invariant to the cue, then similar high-level neurons will activate whether or not that cue is present in the input image, leading to similar category-level information at training and thus similar performance. On the other hand, if the features are not invariant, then the missing cue will result in missing category information and poorer performance. In this work, we extract the last hidden layer (fc7 of 4.1. Cue Invariance Results 3.2. Deep Convolutional Neural Network Features We first evaluate how variations in low-level cues affect the features generated by the IMGNET and PASC-FT networks on the PASCAL VOC2007 dataset. For each experiment, we follow these steps (see Figure 2): 1) select cues, 2) generate a batch of synthetic 2D images with those cues, 3) sample positive and negative patches for each class, 4) extract hidden DCNN layer activations from the patches as features, 5) train a classifier for each object category, 6) test the classifiers on real PASCAL images and report mean Average Precision (mAP). To determine the optimal number of synthetic training images, we computed mAP as a function of the size of the training set, using the RR-RR image generation setting (Table 1). Results, shown in Figure 4.1, in- Figure 3. Relationship between mAP and the number of training images for the RR-RR generation setting. dicate that the classifier achieves peak performance around 2000 training images, with 100 positive instances for each of the 20 categories, which is the number used for all subsequent experiments. Object Color, Texture and Context For this experiment, we used 1-2 pose perturbations per view and all views per category. We trained a series of detectors on several background and object texture cue configurations, with results shown in Table 1. First, as expected, we see that training with synthetic data obtains lower mean AP than training with real data (around 58% with bounding box regression). Also, the IMGNET network representation achieves lower performance than the PASC-FT network, as was the case for real data in [5]. However, the somewhat unexpected result is that the generation settings RR-RR, W-RR, W-UG, RGRR with PASC-FT all achieve comparable performance, despite the fact that W-UG has no texture and no context. Results with real texture but no color in the background (RGRR, W-RR) are the best. Thus, the PASC-FT network has learned to be invariant to the color and texture of the object and its background. Also, we note that settings RR-UG and RG-UG achieve much lower performance (6-9 points lower), potentially because the uniform object texture is not well distinguished from the non-white backgrounds. For the IMGNET network, the trend is similar, but with the best performing methods being RR-RR and RG-RR. This means that adding realistic context and texture statistics helps the classifier, and thus the IMGNET network is less invariant to these factors, at least for the categories in our dataset. We note that the IMGNET network has seen these categories in training, as they are part of the ILSVRC 1000-way classification task, which explains why it is still fairly insensitive. Combinations of uniform texture with a real background also do not perform well here. Interestingly, RG-RR does very well with both networks, leading to the conclusion that both networks have learned to associate the right context colors with objects. We also see some variations across categories, e.g., categories like cat and sheep benefit most from adding the object texture cue. To explore the lower layers’ invariance to color, texture and background, we visualize the patches which have the strongest activations for pool5 units, as shown in Figure 4. The value in the receptive field’s upper-left corner is normalized by dividing by max activation value over all units in a channel. The results are very interesting. The unit in the left subfigure fires on patches resembling tv-monitors in real images; when using our synthetic data, the unit still fires on tv-monitors even though the background and texture are removed. The unit on the right fires on white animals on green backgrounds in real and RR-RR images, and continues to fire on synthetic sheep with simulated texture, despite lack of green background. However, it fails on W-UG images, demonstrating its specificity to object color and texture. Synthetic Pose We also analyse the invariance of CNN features to 3D object pose. Through the successive operations of convolution and max-pooling, CNNs have a built-in invariance to translations and scale. Likewise, visualizations of learned filters at the early layers indicate a built-in invariance to local rotations. Thus while the CNN representation is invariant to slight translation, rotations and deformations, it remains unclear to what extent are CNN representation to large 3D rotations. For this experiment, we fix the CAD models to three dominant poses: front-view, side-view and intra-view, as shown in Table 2. We change the number of views used in each experiment, but keep the total number of synthetic training images (RR-RR) exactly the same, by generating random small perturbations (-15 to 15 degree) around the main view. Results indicate that for both networks adding side view to front view gives a boost, but improvement from adding the third view is marginal. We note that adding some views may even hurt performance (e.g., TV) as the PASCAL test set may not have objects in those views. Real Image Pose We also test view invariance on real images. We are interested here in objects whose frontal view presentation differs significantly (ex: the side-view of a horse vs a frontal view). To this end, we selected 12 categories from the PASCAL VOC training set which match this criteria. Held out categories included rotationally invariant objects such as bottles or tables. Next, we split the training data for these 12 categories to prominent side-view and front-view, as shown in Table 3. We train classifiers exclusively by removing one view (say front-view) and test the resulting detector on the PASCAL VOC test set containing both side and front-views.We also compare with random view sampling. Results, shown in Table 3, point to important and surprising conclusions regarding the representational power of the CNN features. Note that mAP drops by less than 2% when detectors exclusively trained by removing either view are tested on the PASCAL VOC test set. Not only are those detectors never presented with the second view, but they are also trained with approximately half the data. While this invariance to large and complex pose changes may be explained by the fact the CNN model was itself trained with both views of the object present, and subsequently fine-tuned with both views RR-RR Real RGB Real RGB PASC-FT aero bike RR-RR 50.9 57.5 W-RR 46.5 55.8 W-UG 54.4 49.6 RR-UG 55.2 57.8 49.8 56.9 RG-UG RG-RR 46.5 55.8 IMGNET aero bike RR-RR 34.3 34.6 W-RR 35.9 23.3 W-UG 38.6 32.5 26.4 36.3 RR-UG RG-UG 32.7 34.5 RG-RR 26.4 38.2 BG TX bird 28.3 28.6 31.5 24.8 20.9 28.6 bird 19.9 16.9 18.7 9.5 20.2 21.0 W-RR White Real RGB boat botl 20.3 17.8 21.7 21.3 24.8 27.0 17.1 11.5 15.6 10.8 21.7 21.3 boat botl 17.1 10.8 15.0 11.8 14.1 9.7 9.6 9.4 14.6 9.4 15.4 12.1 bus 50.1 50.6 42.3 29.9 25.6 50.6 bus 30.0 24.9 21.2 5.8 7.5 26.7 W-UG White Unif. Gray car cat chr 37.7 26.1 11.5 46.6 28.9 14.9 62.9 6.6 21.2 39.3 16.9 9.9 42.1 14.7 4.1 46.6 28.9 14.9 car cat chr 33.0 18.4 9.7 35.2 20.9 11.2 36.0 9.9 11.3 24.9 0.4 1.2 30.1 12.1 2.3 34.5 18.0 8.8 cow 27.1 38.1 34.6 35.1 32.4 38.1 cow 13.7 15.5 13.6 12.8 14.6 16.4 RR-UG Real RGB Unif. Gray tab dog hse 2.4 25.3 40.2 0.7 27.3 42.5 0.3 18.2 35.4 4.7 30.1 37.5 9.3 20.4 28.0 0.7 27.3 42.5 tab dog hse 1.4 17.6 17.7 0.1 15.9 15.6 0.9 15.7 15.5 4.7 14.4 9.2 9.3 15.2 11.2 0.4 17.0 20.9 RG-UG Real Gray Unif. Gray mbik pers plt shp 52.2 14.3 11.9 40.4 53.0 17.4 22.8 30.4 51.3 33.9 15.0 8.3 53.1 18.1 9.5 12.4 51.2 14.7 10.3 12.6 53.0 17.4 22.8 30.4 mbik pers plt shp 34.7 13.9 11.8 15.2 28.7 13.4 8.9 3.7 32.3 15.9 9.9 9.7 28.8 11.7 9.6 0.7 30.2 12.3 11.4 2.2 32.1 11.0 14.7 18.4 sofa 16.3 16.4 33.9 18.2 14.2 16.4 sofa 12.7 10.3 19.9 4.9 9.9 14.8 RG-RR Real Gray Real RGB trn tv mAP 15.2 32.2 28.9 16.7 43.5 31.2 2.6 49.0 30.1 2.1 21.1 25.2 9.5 28.0 23.6 16.7 43.5 31.2 trn tv mAP 6.3 26.0 18.9 0.6 28.8 16.8 0.1 17.4 17.1 0.1 12.2 11.6 0.5 13.1 14.7 6.7 32.0 19.3 Table 1. Detection results on the PASCAL VOC2007 test dataset. Each row is trained on different background and texture configuration of virtual data shown in the top table. In the middle table, the DCNN is trained on ImageNet ILSVRC 1K classification data and finetuned on the PASCAL training data; in the bottom table, the network is not fine-tuned on PASCAL. Figure 4. Top 10 regions with strongest activations for 2 pool5 units using the method of [5]. Overlay of the unit’s receptive field is drawn in white and normalized activation value is shown in the upper-left corner. For each unit we show results on (top to bottom): real PASCAL images, RR-RR, W-RR, W-UG. See text for further explanation. again present, the level of invariance is nevertheless remarkable. In the last experiment, we reduce the fine-tuning training set by removing front-view objects, and note a larger mAP drop of 5 points (8%), but much less than one may expect. We conclude that, for both networks, the representation groups together multiple views of an object. 3D Shape Finally, we experiment with reducing intraclass shape variation by using fewer CAD models per category. We otherwise use the same settings as in the RR-RR condition with PASC-FT. From our experiments, we find that the mAP decreases by about 5.5 points from 28.9% to 23.53% when using only a half of the 3D models. This shows a significant boost from adding more shape variation to the training data, indicating less invariance to this factor. 4.2. Few-Shot Learning Results on PASCAL To summarize the conclusions from the previous section, we found that DCNNs learn a significant amount of invariance to texture, color and pose, and less invariance to 3D shape, if trained (or fine-tuned) on the same task. If not trained on the task, the degree of invariance is lower. Therefore, when learning a detection model for a new category with no or limited labeled real data available, it is advantageous to simulate these factors in the synthetic data. In this section, we experiment with adapting the deep representation to the synthetic data. We use all available 3D models and views, and compare the two generation settings that produced the best results (RR-RR, RG-RR in Table 1). Both of these settings use realistic backgrounds, which may have some advantages for detection. In particular, visualizations of the positive training data show that a white background around the objects makes it harder to sample negative training data via selective search, as most of the interesting regions are on the object. As before, we simulate the zero-shot learning situation where the number of labeled real images for a novel category is zero, however, here we also experiment with having a small number of labeled real images. For every category, we randomly select 20 (10, 5) positive training images to form datasets R20 (R10 , R5 ). The sizes of final datasets are 276 (120, 73); note that there are some images which contain two or more positive bounding boxes. The size of the virtual dataset (noted as V2k ) is always 2000 images. We pre-train on Imagenet ILSVRC (IMAGENET network) and IMGNET front front,side front,side,intra PASC-FT front front,side front,side,intra areo 24.9 24.3 33.1 aero 41.8 45.6 54.2 bike 38.7 36.8 40.2 bike 53.7 50.2 55.5 bird 12.5 19.0 19.4 bird 14.5 24.4 22.7 boat 9.3 17.7 19.6 boat 19.1 28.8 27.0 botl 9.4 11.9 12.4 botl 11.6 17.4 20.5 bus 18.8 26.6 29.8 bus 42.5 51.9 52.6 car 33.6 36.0 35.3 car 40.4 41.8 40.1 cat 13.8 10.8 16.1 cat 25.5 24.5 26.8 chr 9.7 9.7 5.2 chr 9.9 7.2 8.1 cow 12.5 15.5 16.5 cow 24.5 27.9 27.3 tab 2.1 0.9 0.9 tab 0.2 9.2 2.3 dog 18.0 21.6 19.7 dog 29.4 23.1 30.6 hse 19.6 21.1 19.0 hse 37.4 37.0 36.6 mbik pers 27.8 13.3 32.8 14.2 34.9 15.8 mbik pers 47.1 14.0 51.3 17.8 53.3 17.8 plt 7.5 12.0 11.8 plt 11.9 13.2 14.2 shp 10.2 14.3 19.7 shp 18.9 28.6 34.1 sofa 9.6 12.7 16.6 sofa 12.7 18.9 26.4 trn 13.8 10.1 14.3 trn 22.6 9.3 19.3 tv 28.8 32.6 29.8 tv 38.8 37.8 37.5 mAP 16.7 19.0 20.5 mAP 25.8 28.3 30.3 Table 2. Results of training on different synthetic views. The CNN used in the top table is trained on ImageNet-1K classification, the CNN in the bottom table is also finetuned on PASCAL 2007 detection. Net PASC-FT PASC-FT PASC-FT PASC-FT PASC-FT(-front) Views all -random -front -side -front aero 64.2 62.1 61.7 62.0 59.7 bike 69.7 70.3 67.3 70.2 63.1 bird 50 49.7 45.1 48.9 42.7 bus 62.6 61.1 58.6 61.2 55.3 car 71 70.2 70.9 70.8 64.9 cow 58.5 54.7 56.1 57.0 54.4 dog 56.1 55.4 55.1 53.6 54.0 hrs 60.6 61.7 59.0 59.9 56.1 mbik 66.8 67.4 66.1 65.7 64.2 shp 52.8 55.7 54.2 53.7 55.1 trn 57.9 57.9 53.3 58.1 47.4 tv 64.7 64.2 61.6 64.2 60.1 mAP 61.2 60.9 59.1 60.4 56.4 Table 3. Results of training on different real image views. ’-’ represent removing a certain view. Note that the mAP is only for a subset of Pascal Dataset. Figure 6. Detections on the Amazon domain in Office, showing examples where our synthetic model (second row, green bounding box) improves localization compared to the model trained on real Webcam images (first row, red bounding box). Figure 5. Detection results of the proposed VCNN on PASCAL. When the real annotated images are limited or not available, eg. for a novel category, VCNN performs much better than RCNN and the Fast Adaptation method. fine-tune on V2k to get the VCNN network, then train SVM classifiers on both Rx +V2k . Baselines. We use datasets Rx (x = 20, 10, 5) to train the RCNN model, and Rx +V2k to train the Fast Adaptation method described in [22]. The RCNN is pre-trained on Imagenet ILSVRC, however it is not fine-tuned on detection on R5 and R10 as data is very limited. Results. The results in Figure 5 show that when the number of real training images is limited, our method (VCNN) performs better than traditional RCNN. The VCNN also significantly outperfoms the Fast-Adapt method, which is based on HOG features. We also confirm that our proposed RRRR data synthesis methodology is better than not simulating background or texture. In partcular, fine-tuning on virtual RR-RR data boosts mAP from 18.9% (Table 1) to 22% without using any real training examples, and to 28% with 5 real images per category, a 10% absolute improvement over RCNN. We also notice that the results for RG-RR are much lower than RR-RR, unlike the results in the fixed-feature experiment. This may be explained by the fact that RG-RR with selective search generates many sub-regions without color, and using these regions to do fine-tuning probably decreases the CNN’s ability to recognize realistic color objects. Note that the VCNN trained with 10 real images per category (200 total) is also using the approximately 900 real images of texture and background. However, this is still Training WEBCAM V-GRAY V-TX bp 81 81 89 bk 91 93 94 bh 65 65 40 bc 35 35 32 bt 9 30 20 ca 52 17 81 dc 84 84 83 dl 30 30 48 dp 2 2 15 fc 33 33 19 hp 67 67 72 kb 37 37 66 lc 71 71 78 lt 14 14 18 mp 21 21 77 mt 54 17 49 ms 71 24 75 mg 38 9 73 pn 26 26 26 pe 19 9 17 ph 41 4 41 pr 58 58 64 pj 64 54 77 pn 16 16 15 rb 10 10 10 rl 11 11 15 sc 32 32 29 sp 1 1 29 st 18 18 29 td 29 29 24 tc 26 26 31 mAP 39 33 46 Table 4. Detection results of the proposed VCNN on the 31 object categories in the Office dataset. The test data in these experiments are (real) images from the Amazon domain. We compare to training on the real training images from the Webcam domain (top row). Our model was trained on V-GRAY and V-TX, representing virtual images with uniform gray texture and real texture, respectively. The results clearly demonstrate that when the real training data is mismatched from the target domain, synthetic training can provide a significant performance boost for real-image detection. much fewer than the 15588 annotated bounding boxes in the PASCAL training set, and much easier to collect as only the texture images (about 130) need bounding box annotation. Yet the obtained 31% mAP is comparable to the 33% mAP achieved by the DPM (without context rescoring) trained on the full dataset. This speaks to the power of transferring deep representations and suggests that synthetic CAD data is a promising way to avoid tedious annotation for novel categories. We emphasize that there is a significant boost due to adapting the features on synthetic data via fine-tuning, showing that adapted features are better than fixed features, but only for the RR-RR generation settings. 4.3. Results on Novel Domains When the test images come from a different visual domain (or dataset) than the training images, we expect the performance of the detector to degrade due to dataset bias [18]. In this experiment, we evaluate the benefit of using synthetic CAD data to improve performance on novel real-image domains. We use part of the Office dataset [18], which has the same 31 categories of common objects (cups, keyboards, etc.) in each domain, with Amazon images as the target testing domain (downloaded from amazon.com) and Webcam images as the training domain (collected an office environment). To generate synthetic data for the categories in the Office Dataset, we downloaded roughly five 3D models for each category. The data generation method is the same as the experiments for PASCAL, expcept that we use the original texture on the 3D models for this experiment, considering that the texture of the objects in Office dataset is simpler. We compare two generation settings, V-GRAY and V-TX, representing virtual images with uniform gray texture and real texture, respectively. The background for both settings is white, to match the majority of Amazon domain backgrounds. We generate 5 images for each model, producing 775 images in total. We use the synthetic images to train our VCNN deep detector and test it on the Amazon domain (2817 images). Baseline We train a baseline real-image deep detector on the Webcam domain (total of 795 images) and also test it on images in the Amazon domain. Results The results are shown in Table 4. The mean AP for VCNN with V-TX is 46.25% versus 38.91% for the deep detector trained on the Webcam domain, a significant boost in performance. The V-GRAY setting does considerably worse. This shows the potential of synthetic CAD training in dataset bias scenarios. In Figure 6, we show some examples where the object is not detected by the detector trained on Webcam, but detected perfectly by the our VCNN model. To obtain these results we selected the bounding box with the highest score from about 2000 region proposals in each image. 5. Conclusion This paper demonstrated that synthetic CAD training of modern deep CNNs object detectors can be successful when real-image training data for novel objects or domains is limited. We investigated the sensitivity of convnets to various low-level cues in the training data: 3D pose, foreground texture and color, background image and color. To simulate these factors we used synthetic data generated from 3D CAD models. Our results demonstrated that the popular deep convnet of [7], fine-tuned for the detection task, is indeed largely invariant to these cues. Training on synthetic images with simulated cues lead to similar performance as training on synthetic images without these cues. However, if the network is not fine-tuned for the task, its invariance is diminished. Thus, for novel categories, adding synthetic variance along these dimensions and fine-tuning the layers proved useful. Based on these findings, we proposed a new method for learning object detectors for new categories that avoids the need for costly large-scale image annotation. This can be advantageous when one needs to learn a detector for a novel object category or instance, beyond those available in labeled datasets. We also showed that our method outperforms detectors trained on real images when the real training data comes from a different domain, for one such case of domain shift. These findings are preliminary, and further experiments with other domains are necessary. 6. Acknowledgements We thank Trevor Darrell, Judy Hoffman and anonymous reviewers for their suggestions. This work was supported by the NSF Award No. 1451244. References [1] A. Berg, J. Deng, and L. Fei-Fei. ImageNet large scale visual recognition challenge 2012. 2012. 4 [2] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. FeiFei. Imagenet: A large-scale hierarchical image database. In Computer Vision and Pattern Recognition, 2009. CVPR 2009. IEEE Conference on, pages 248–255. IEEE, 2009. 1, 4 [3] M. Everingham, L. Van Gool, C. K. I. Williams, J. Winn, and A. Zisserman. The pascal visual object classes (voc) challenge. International Journal of Computer Vision, 88(2):303– 338, June 2010. 1 [4] P. F. Felzenszwalb, R. B. Girshick, D. McAllester, and D. Ramanan. Object detection with discriminatively trained partbased models. Pattern Analysis and Machine Intelligence, IEEE Transactions on, 32(9):1627–1645, 2010. 1, 2 [5] R. Girshick, J. Donahue, T. Darrell, and J. Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. arXiv preprint arXiv:1311.2524, 2013. 1, 2, 3, 4, 5, 6 [6] M. Jaderberg, K. Simonyan, A. Vedaldi, and A. Zisserman. Synthetic data and artificial neural networks for natural scene text recognition. In Workshop on Deep Learning, NIPS, 2014. 1, 3 [7] A. Krizhevsky, I. Sutskever, and G. E. Hinton. ImageNet classification with deep convolutional neural networks. In NIPS, 2012. 1, 4, 8 [8] Y. LeCun, B. Boser, J. Denker, D. Henderson, R. Howard, W. Hubbard, and L. Jackel. Backpropagation applied to handwritten zip code recognition. Neural Computation, 1989. 2, 4 [9] K. Lenc and A. Vedaldi. Understanding image representations by measuring their equivariance and equivalence. CoRR, abs/1411.5908, 2014. 2 [10] J. Liebelt and C. Schmid. Multi-view object class detection with a 3d geometric model. In Computer Vision and Pattern Recognition (CVPR), 2010 IEEE Conference on, 2010. 3 [11] J. Liebelt, C. Schmid, and K. Schertler. Viewpointindependent object class detection using 3d feature maps. In Computer Vision and Pattern Recognition, 2008. CVPR 2008. IEEE Conference on, 2008. 3 [12] T. 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 [13] A. Mahendran and A. Vedaldi. Understanding Deep Image Representations by Inverting Them. ArXiv e-prints, Nov. 2014. 2 [14] T. Malisiewicz, A. Gupta, and A. A. Efros. Ensemble of exemplar-svms for object detection and beyond. In Computer Vision (ICCV), 2011 IEEE International Conference on, pages 89–96. IEEE, 2011. 2 [15] R. Nevatia and T. O. Binford. Description and recognition of curved objects. Artificial Intelligence, 8(1):77 – 98, 1977. 3 [16] N. Pinto, Y. Barhomi, D. D. Cox, and J. J. DiCarlo. Comparing state-of-the-art visual features on invariant object recognition tasks. In Applications of computer vision (WACV), 2011 IEEE workshop on, pages 463–470. IEEE, 2011. 3 [17] K. Rematas, T. Ritschel, M. Fritz, and T. Tuytelaars. Imagebased synthesis and re-synthesis of viewpoints guided by 3d models. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2014. oral. 3 [18] K. Saenko, B. Kulis, M. Fritz, and T. Darrell. Adapting visual category models to new domains. In Computer Vision– ECCV 2010, pages 213–226. Springer, 2010. 2, 8 [19] P. Sermanet, D. Eigen, X. Zhang, M. Mathieu, R. Fergus, and Y. LeCun. Overfeat: Integrated recognition, localization and detection using convolutional networks. CoRR, abs/1312.6229, 2013. 1, 2 [20] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. CoRR, abs/1409.1556, 2014. 1 [21] M. Stark, M. Goesele, and B. Schiele. Back to the future: Learning shape models from 3d cad data. In Proc. BMVC, pages 106.1–11, 2010. doi:10.5244/C.24.106. 1, 3 [22] B. Sun and K. Saenko. From virtual to reality: Fast adaptation of virtual object detectors to real domains. BMVC, 2014. 1, 2, 3, 7 [23] M. Sun, H. Su, S. Savarese, and L. Fei-Fei. A multi-view probabilistic model for 3d object classes. In Computer Vision and Pattern Recognition, 2009. CVPR 2009. IEEE Conference on, 2009. 3 [24] J. U. K. van de Sande, T. Gevers, and A. Smeulders. Selective search for object recognition. IJCV, 2013. 4 [25] Y. Xiang, R. Mottaghi, and S. Savarese. Beyond pascal: A benchmark for 3d object detection in the wild. In IEEE Winter Conference on Applications of Computer Vision (WACV), 2014. 3 [26] J. Yosinski, J. Clune, Y. Bengio, and H. Lipson. How transferable are features in deep neural networks? In Z. Ghahramani, M. Welling, C. Cortes, N. Lawrence, and K. Weinberger, editors, Advances in Neural Information Processing Systems 27, pages 3320–3328. 2014. 2 [27] M. Zeiler and R. Fergus. Visualizing and Understanding Convolutional Networks. ArXiv e-prints, 2013. 2
9cs.NE
A COHOMOLOGICAL CHARACTERIZATION OF LOCALLY VIRTUALLY CYCLIC GROUPS arXiv:1506.06260v2 [math.GR] 24 Sep 2016 DIETER DEGRIJSE Abstract. We show that a countable group is locally virtually cyclic if and only if its Bredon cohomological dimension for the family of virtually cyclic subgroups is at most one. 1. Introduction Let G be a discrete group and recall that the geometric dimension gd(G) of G is the smallest possible dimension of a free contractible G-CW-complex EG. The cohomological dimension cd(G) of G is by definition the shortest length of a projective resolution of Z over the group ring Z[G]. The cohomological dimension is the algebraic counterpart of the geometric dimension and satisfies cd(G) ≤ gd(G) ≤ max{3, cd(G)} by a classic construction of Eilenberg and Ganea ([9]). One clearly has gd(G) = 0 if and only if G is trivial and it is a standard exercise to check that this is equivalent with cd(G) = 0. An important and well-known result by Stallings-Swan ([25],[26]) says that cd(G) = 1 ⇐⇒ gd(G) = 1, which is equivalent with G being a non-trivial free group. Hence, the only possible difference between cd(G) and gd(G) is that there might exist a group with cd(G) = 2 but gd(G) = 3. It is a long-standing open question, known as the Eilenberg-Ganea problem, whether or not such a group exists. One can generalize the setup above from free actions to actions with stabilizers lying in a certain family of subgroups F of G, i.e. a collection of subgroups that is closed under conjugation and taking subgroups. A classifying G-CW-complex for the family F, or model for EF G, is a G-CW -complex X with stabilizers in F such that the fixed point sets X H are contractible for all H ∈ F. The geometric dimension of G for the family F, denoted by gdF (G), is by definition the smallest possible dimension of a model for EF G. This geometric dimension also has an algebraic counterpart: the Bredon cohomological dimension for the family F, denoted by cdF (G). The Bredon cohomology of G for the family F is a generalization of the ordinary group cohomology of G, where the category of Z[G]-modules is replaced by the category Mod−OF G of contravariant functors from the orbit category OF G to the category of abelian groups. The algebraic invariant cdF (G) is defined as the shortest length of a projective resolution of the constant functor Z in the category Mod−OF G. It is easy to check that if one lets F be the family containing only the trivial subgroup of G, then this setup coincides with the free case described in the first paragraph. In [18, Th. 0.1.] it is shown that cdF (G) ≤ gdF (G) ≤ max{3, cdF (G)}. Date: February 26, 2018. 1 2 DIETER DEGRIJSE Moreover, it is easy to see that gdF (G) = 0 if and only if G ∈ F, and the fact that this is equivalent with cdF (G) = 0 follows from a result of Symonds ([27, Lemma 2.5]). It seems out of reach at the moment to say anything more about the relationship between cdF (G) and gdF (G) for a general family F. But one can say more when one considers either the family of finite subgroups FIN or the family of virtually cyclic subgroup VC. Besides the trivial family, the family of finite subgroups and the family of virtually cyclic subgroups have been studied extensively over the last years. This is partially due to their appearance in the Baum-Connes and Farrell-Jones isomorphism conjectures. These conjectures predict isomorphisms between certain equivariant cohomology theories of classifying spaces for families of G and K- and L-theories of reduced group C ∗ -algebras and group rings of G (e.g. see [19]). When F = FIN , the numbers cdF (G) and gdF (G) are denoted by cd(G) and gd(G), respectively. Note that cdQ (G) ≤ cd(G), since evaluating a projective OF IN G-resolution of Z at G/e and tensoring the result with Q yields a projective Q[G]-resolution of Q. If follows from the work of Dunwoody in [8] that cd(G) = 1 ⇐⇒ gd(G) = 1 and that all finitely generated groups with cd(G) ≤ 1 are virtually free. In this context the answer to the Eilenberg-Ganea problem is also known. Indeed, in [1] Brady, Leary and Nucinkis construct certain right angled Coxeter groups G with cd(G) = 2 but gd(G) = 3. Finally, we turn to the family of virtually cyclic subgroups F = VC. In this case cdF (G) and gdF (G) are denoted by cd(G) and gd(G), respectively. Here the answer to the EilenbergGanea problem is also known: in [11] Fluch and Leary show that certain right angled Coxeter groups G satisfy cd(G) = 2 but gd(G) = 3. In the same paper, Fluch and Leary also ask if cd(G) = 1 if and only if gd(G) = 1. We prove the following. Main Theorem. If a group G satisfies cd(G) ≤ 1, then it is locally virtually cyclic. The proof of the Main theorem will be finalized in Section 5. By a result of Serre [24, Cor. 2 p 64], gd(G) ≤ 1 implies that G is locally virtually cyclic. On the other hand, all countable locally virtually cyclic groups G satisfy gd(G) ≤ 1 by [20, Th. 5.33]. Hence, our Main Theorem implies the following. Corollary 1. For any countable group G, one has cd(G) = 1 ⇐⇒ gd(G) = 1. Recall that a right OVC (G)-module M is called flat if the categorical tensor product M ⊗OVC G − is an exact functor from the category of left OVC (G)-module to abelian groups. By definition, the constant functor Z is flat if and only if the Bredon homological dimension for the family of virtually cyclic subgroups hd(G) equals zero. Since hd(G) ≤ cd(G) ≤ hd(G) + 1, when G is countable (see [23, Prop. 3.5] and [10, Section 3.4]) and locally virtually cyclic groups G satisfy hd(G) = 0 by [12, Prop 3.1(i)], the Main Theorem implies the following. Corollary 2. A countable group G is locally virtually cyclic if and only if the constant functor Z is a flat OVC (G)-module. In light of Corollary 2, we cannot resist mentioning a conjecture of Lück ([17, 6.49]) saying that a countable group G is locally virtually cyclic if and only if the group von Neumann algebra N (G) is a flat C[G]-module. A COHOMOLOGICAL CHARACTERIZATION OF LOCALLY VIRTUALLY CYCLIC GROUPS 3 Let F2 be the free group on 2 generators and recall that a group is said to be coherent if all its finitely generated subgroups are finitely presented. As a by-product of our proof of the Main Theorem, we can also show that certain groups with cd(G) = 2 admit a three dimensional model for EG. Corollary 3. Let G be a countable group satisfying cd(G) = 2. If one of the following hold (a) G is coherent (b) G is torsion-free (c) G does not contain F2 , then 1 ≤ cd(G) ≤ 3. Moreover, every one-relator group has a three dimensional model for its classifying space with virtually cyclic stabilizers. The proof of this corollary will be given at the end of Section 4. Note that it follows from [4, Prop. 5.1] and [5, Corollary 4] that the bounds for cd(G) given above are optimal and that all intermediate values can occur. Motivated by Remark 4.5, we conjecture that gd(G) ≤ 3 for all countable groups with cd(G) = 2. 2. Preliminaries We start by recalling some basic notions in Bredon cohomology. This cohomology theory was introduced by Bredon in [2] for finite groups as a mean to develop an obstruction theory for equivariant extension of maps. It was later generalized to arbitrary groups by Lück with applications to finiteness conditions (see [16, section 9]). We refer the reader to [10] and [16] for further details. Let G be a discrete group and let F be a family of subgroups of G. The orbit category OF G is a category whose objects that are the left cosets G/H for all H ∈ F and whose morphisms are all G-equivariant maps between the objects. A (right) OF G-module is a contravariant functor M : OF G → Z-mod. The category of OF G-modules is denoted by Mod-OF G and is defined by the objects that are all the OF G-modules and the morphisms are all the natural transformations between the objects. This category is abelian and has free objects. More precisely, its free objects are isomorphic to direct sums of modules of the form Z[−, G/K] where K ∈ F and Z[G/H, G/K] is the free Z-module with basis the set of G-maps from G/H to G/K. A sequence of modules in Mod-OF G is said to be exact if it is exact when evaluated at every object. There is also a Yoneda lemma that allows one to construct free (projective) resolutions in a similar way as in the case of ordinary cohomology. It follows that Mod-OF G contains enough projectives to construct projective resolutions. Hence, one can construct Ext-functors ExtnOF G (−, M ) that have all the usual properties. If V is a G-module, we denote by V : OF G → Z-mod the contravariant functor that maps G/H to the fixed points V H and maps morphisms to the obvious restriction maps. The n-th Bredon cohomology of G with coefficients M ∈ Mod-OF G is by definition HnF (G, M ) = ExtnOF G (Z, M ) where Z is a trivial G-module. Low-dimensional Bredon cohomology with fixed point functor coefficients can be understood in terms of ordinary group cohomology. Lemma 2.1. [6, Cor. 5.6, 5.14] For any G-module V one has H0F (G, V ) = V G 4 DIETER DEGRIJSE and H1F (G, V ) = \ ker : H1 (G, V ) → H1 (K, V ). K∈F Moreover, if H1 (K, V ) = 0 for all K ∈ F, then \ ker : H2 (G, V ) → H2 (K, V ). H2F (G, V ) = K∈F The Bredon cohomological dimension of G for the family F, denoted by cdF (G), is defined as cdF (G) = sup{n ∈ N | ∃M ∈ Mod-OF G : HnF (G, M ) 6= 0}. By standard methods in homological algebra one shows that this number coincides with the length of the shortest projective (or free) resolution of Z in Mod-OF G. Using a version of Shapiro’s lemma for Bredon cohomology, one can show that cdF ∩S (S) ≤ cdF (G) for any subgroup S of G. For the remainder of this paper, F will always denote the family of finite subgroups. A key ingredient in the proof of the Main Theorem is the following construction of Lück and Weiermann (see [20]) which relates Bredon cohomology for the family of virtually cyclic subgroups VC to Bredon cohomology for the family of finite subgroups F. Let S denote the set of infinite virtually cyclic subgroups of G. As in [20, 2.2], two infinite virtually cyclic subgroups H and K of G are said to be equivalent, denoted H ∼ K, if |H ∩ K| = ∞ i.e. if H and K are commensurable, meaning that their intersection has finite index in both H and K. Using the fact that any two infinite virtually cyclic subgroups of a virtually cyclic group are equivalent (e.g. see Lemma 3.1. in [3]), it is easily seen that this indeed defines an equivalence relation on S. One can also verify that this equivalence relation satisfies the following two properties - ∀H, K ∈ S : H ⊆ K ⇒ H ∼ K; - ∀H, K ∈ S, ∀g ∈ G : H ∼ K ⇔ H g ∼ K g . Let H ∈ S and define the group NG [H] = {g ∈ G | H g ∼ H}. The group NG [H] is called the commensurator of H in G. It is sometimes denoted by CommG (H) and should not be confused with the normalizer of H in G. Note that NG [H] depends only on the equivalence class [H] of H and contains H as a subgroup. Define for H ∈ S the following family of subgroups of NG [H]   F[H] = {K ⊆ NG [H] |K ∈ S, K ∼ H} ∪ NG [H] ∩ F . In other words, F[H] contains all finite subgroups of NG [H] and all infinite virtually cyclic subgroups of G that are equivalent to H. The pushout diagram in Theorem 2.3 of [20] now yields the following (see also [4, §7]). A COHOMOLOGICAL CHARACTERIZATION OF LOCALLY VIRTUALLY CYCLIC GROUPS 5 Proposition 2.2 (Lück-Weiermann, [20]). With the notation above, let [S] denote the set of equivalence classes of S and let I be a complete set of representatives [H] of the orbits of the conjugation action of G on [S]. For every M ∈ Mod-OVC G, there exists a long exact sequence  Y  Y . . . → HiVC (G, M ) → HiF [H] (NG [H], M ) ⊕ HiF (G, M ) → HiF (NG [H], M ) [H]∈I [H]∈I → Hi+1 VC (G, M ) → . . . . We end this section with some simple observations about groups with cd(G) = 1. Recall that the Baumslag-Solitar group BS(1, m), with m ∈ Z \ {0}, is the group with presentation BS(1, m) = ht, x | txt−1 = xm i. This group is solvable and is by definition and ascending HNN-extension of Z. Lemma 2.3. If G is a group with cd(G) ≤ 1, then the following hold. (1) The group G does not contain a copy of a Baumslag-Solitar group BS(1, m) for any m ∈ Z \ {0}. (2) The group G does not contain a copy of the free group on two generators F2 . (3) For every right OVC (G)-module M , there is an isomorphism Y ∼ = H2F [H] (NG [H], M ) ⊕ H2F (G, M ) − → [H]∈I Y H2F (NG [H], M ). [H]∈I Proof. Since cd(BS(1, m)) ≥ 2 by [5, Corollary 3] and cd(F2 ) = 2 by [5, Lemma 5.2], it follows that G cannot contain copies of these groups. This proves (1) and (2). Part (3) is immediate from Proposition 2.2.  Lemma 2.4. If G is a finitely generated group with cd(G) = 1, then cdQ (G) = 2 and H1 (G, F ) = 0. for any free Q[G]-module F . Proof. It follows from [7, Cor. 4.2] that cdQ (G) ≤ cd(G) ≤ 2. If cdQ (G) ≤ 1, then G is virtually free by Dunwoody’s result mentioned in the introduction. However, since G cannot contain F2 by Lemma 2.3(2), we conclude that G is virtually cyclic, implying that cd(G) = 0. This is impossible so we conclude that cdQ (G) = 2. Since G cannot contain F2 and is not virtually cyclic, it follows from Stalling’s theorem about ends of groups that G is one-ended, i.e. H1 (G, Q[G]) = 0. Because G is finitely generated, this implies that H1 (G, F ) = 0 for any free Q[G]-module F .  3. relative ends Let G be a finitely generated group and let H be an infinite index finitely generated subgroup of G. For any commutative ring R with unit, one defines EG H (R) to be the G-fixed points of the cokernel of the natural inclusion of right G-modules G H G G H FH (R) = indG H (coinde (R)) → coindH (coinde (R)) = coinde (R). 6 DIETER DEGRIJSE By considering the long exact cohomology sequence associated to the short exact sequence of right G-modules G G G 0 → FH (R) → coindG e (R) → coinde (R)/FH (R) → 0, an application of Shapiro’s lemma yields the exact sequence δ G G 0 → R → EH (R) − → H1 (G, FH (R)) → 0. (1) In [14], Kropholler and Roller define the number of ends of the pairs (G, H) to be the number   G (F2 ) . ẽ(G, H) = dimF2 EH where F2 is the field with two elements. Note that if H equals the trivial subgroup of G, then ẽ(G, H) coincides with the number of ends of G, mentioned in the previous section. A subset A of G is said be H-finite (resp. H-cofinite) if it (resp. its complement) can be covered by finitely many right cosets of H. The subset A is said to be proper if it is neither Hfinite nor H-cofinite. A subset B of G is called H-almost invariant if the symmetric difference B∆(Bg) is H-finite for all g ∈ G. As we shall see later on, the importance of proper H-almost invariant subsets of G is contained in the fact that under certain additional hypotheses they can be used to construct non-trivial G-actions on trees. Note that coindG e (F2 ) corresponds to the set of subsets of G equipped with symmetric difference as group-law. One easily checks that the H-finite subsets of G are exactly the G (F ), while the H-cofinite subsets of G correspond to elements A of coindG (F ) elements of FH 2 2 e G (F ). Finally, one verifies that the proper H-almost invariant subsets such that G + A ∈ FH 2 G (F ) that map to a non-zero element under the map B of G correspond to the elements of EH 2 δ appearing in (1). These observations lead to the following lemma. Lemma 3.1. [14, Lemma 3.1] If ẽ(G, H) ≥ 2 and G = NG [H], then G has a proper H-almost invariant subset B such that BH = B. Proof. Consider the commutative diagram with exact rows  H (coindG H (F2 )) δ / E G (F2 ) H F2  α  H / coindG (F2 )/F G (F2 ) e H / H1 (G, F G (F2 )) H  / H1 (H, F G (F2 )) H where the vertical maps are restriction maps induced by the inclusion H ⊆ G. The double G (F ) restricted to H is isomorphic to coset formula says that FH 2  M  gHg −1 H indH H∩gHg −1 resH∩gHg −1 g · coinde (F2 ) . g∈[H\G/H] Since NG [H] = G, H ∩ gHg−1 has finite index in H and gHg−1 for all g ∈ G. If follows G (F ) is isomorphic to a direct sum of modules coinduced up from that, as a H-module, FH 2 G (F )) = 0. As the trivial group. Since H is finitely generated, this implies that H1 (H, FH 2 G (F ) such that δ(B) 6= 0, i.e. B is a proper Hẽ(G, H) ≥ 2, there exist an element B of EH 2 almost invariant subset of G. By the diagram above, we conclude that B must be contained in the image of α, which means that BH = B.  A COHOMOLOGICAL CHARACTERIZATION OF LOCALLY VIRTUALLY CYCLIC GROUPS 7 In the next section, we will apply this lemma. However, due to the presence of torsion in our groups, we will be forced to consider cohomology with coefficient over the rationals. We therefore need to argue that one can also compute ẽ(G, H) over Q instead of over F2 . To show this we follow the approach of Swan in [26, Lemma 3.6] where this is proven for H = {e}. Fix a commutative ring R with unit 1 6= 0 and a finite generating set {σ1 , . . . , σd } for G. Lemma 3.2. Let F be the R-module of set maps f from G to R turned into a right G-module via (f · g)(x) = f (x · g −1 ). Let Ψ be the subspace of F consisting of those maps from G to R that take non-zero values in at most finitely many right cosets Hg of H in G and S let Θ be the subspace of F consisting of all maps for which there exists a finite union S = m j=1 Hgj such that f (xσi ) = f (x) for all x ∈ G \ S and all i ∈ {1, . . . , d}. Then E G (R) ∼ = Θ/Ψ H as R-modules. Proof. Take f ∈ Ψ and let S be a finite union of right cosets of H such that f (x) = 0 for all S x ∈ G \ S. Letting S ′ = S ∪ di=1 Sσi−1 , one sees that f (x) = f (xσi ) = 0 for all x ∈ G \ S ′ and all i ∈ {1, . . . , d}. Indeed, if f (xσi ) 6= 0 then xσi ∈ S and hence x ∈ Sσi−1 . This proves G (R) into coindG (R) is that Ψ ⊆ Θ. Explicitly, the natural inclusion of right G-modules of FH e given by HomR (R[H], R) ⊗R[H] R[G] → HomR (R[G], R) : f ⊗ g 7→ f˜ where f˜(x) = f (gx) if x ∈ g −1 H and f˜(x) = 0 otherwise. Composing this inclusion with the isomorphism of right G-modules ∼ = → F : f 7→ fˆ HomR (R[G], R) − where fˆ(g) = f (g−1 ) for g ∈ G, gives the inclusion HomR (R[H], R) ⊗R[H] R[G] → F : f ⊗ g 7→ f G (R) ∼ Ψ and where f (x) = f (gx−1 ) if x ∈ Hg and f (x) = 0 otherwise. This shows that FH = G G ∼ hence EH (R) = (F/Ψ) . Using the fact that {σ1 , . . . , σd } is a set of generators for G, one verifies that Θ coincides with the subspace of F consisting of all maps such that for each S g ∈ G there exists a finite union S = m Hg j such that f (xg) = f (x) for all x ∈ G \ S. The j=1 lemma now follows easily.  Recall that the rank rk(M ) of R-module M is the smallest positive integer n such that Rn admits a surjection onto M . If no such integer exists then the rank is infinite. Proposition 3.3. For any commutative ring R with unit 1 6= 0, one has   G ẽ(G, H) = rk EH (R) . Proof. Let Γ be the Cayley graph of G for the generating set {σ1 , . . . , σd } such that G acts on Γ from the left, i.e. the vertices of Γ are the elements of G and g1 , g2 ∈ G are connected by an edge iff g1 σi±1 = g2 forSsome i ∈ {1, . . . , d}. Since {σ1 , . . . , σd } generates G, it follows that Γ is connected. Let S = ni=1 Hgi be a union of finitely many right cosets of H in G. By Γ \ S we mean the subgraph of Γ spanned by the vertices G \ S. Since S is H-invariant, H 8 DIETER DEGRIJSE acts on Γ \ S . We will be interested in the connected components of Γ \ S . Fix a vertex x0 of Γ \ S. Given x ∈ Γ \ S, there exists a path γ in Γ from x0 to x. If γ does not cross S then x and x0 are in the same connected component of Γ \ S. If γ does cross S then there exists a vertex s ∈ S and a generator σi such that sσi±1 is vertex of γ and the subpath of γ going from sσi±1 to x does not cross S. Hence sσi±1 and x are contained in the same connected component of Γ \ S. It follows that every connected component of Γ \ S contains either x0 or an element of the form hgj σi±1 for some j ∈ {1, . . . , m} and some i ∈ {1 . . . , d}. We conclude that there are only finitely many H-orbits of connected components of Γ \ S. Enumerate the elements of G = {e = g1 , g2 , g3 , . . .} and let S0 = ∅. If Sn is defined, then ′ ′ with all the connected = Sn ∪ {Hgn+1 } and define Sn+1 to be the union of Sn+1 let Sn+1 ′ components of Γ \ Sn+1 that can be covered by finitely many right cosets of H in S G. Note that every Sn is a finite union of right cosets of H in G, that Sn ⊂ Sn+1 and G = n≥1 Sn . Now let Cn be the set of components of Γ \ Sn . Since each component of Γ \ Sn+1 is contained in a unique component of G \ Sn , we obtain a map αn+1 : Cn+1 → Cn . By construction, no component of Γ \ Sn can be covered by finitely many right cosets of H in G, so it follows that the map αn+1 : Cn+1 → Cn is surjective. Indeed, let X be a component of Γ \ Sn . We know that X cannot be covered by finitely many right cosets of H in G. If Hgn+1 does not intersect ′ X, then X is a connected component of Γ\Sn+1 that cannot be covered by finitely many right cosets of H in G. Therefore X ∈ Cn+1 and αn+1 (X) = X. Now suppose that X intersects with Hgn+1 and consider the connected components of X \ (Hgn+1 ∩ X). Suppose all these connected components could be covered by finitely many right cosets of H in G. Since there ′ are only finitely many H-orbits of connected components in Γ \ Sn+1 , it follows that X can by covered by finitely many right cosets of H in G, which is a contradiction. Hence there must exist a connected component X0 that cannot be finitely covered. By construction, X0 will be a subset of an element of Cn+1 that maps to X under αn+1 . G (R) be the R-module of set maps from C to R. The surjection C Now let EH n n n+1 → Cn defines a monomorphism G G EH (R)n → EH (R)n+1 . G (R) onto a direct summand of EH n+1 . Define for each n ≥ 1 the map G ϕn : EH (R)n → Θ/Ψ : f 7→ f˜ + Ψ where f˜(x) = f (c) if x lies in the component c of Γ \ Sn and f˜(x) = 0 if x ∈ Sn . To see that S f˜ ∈ Θ, set S = Sn ∪ di=1 Sn σi−1 and pick x ∈ G \ S. Since x and xσi are connected by an edge in Γ, the only way x and xσi can not be in the same component of Γ \ Sn is if xσi ∈ Sn , but then x ∈ Sn σi−1 , which is not possible. We conclude that f˜(xσi ) = f˜(x) for all x ∈ S and all i ∈ {1, . . . , d}. One checks that the maps ϕn assemble to form an R-module map G ϕ : lim EH (R)n → Θ/Ψ. → We claim that ϕ is an isomorphism. Indeed, take f ∈ Θ and let S be a finite union of right cosets of H in G such that f (xσi ) = f (x) for all x ∈ G \ S and all i ∈ {1, . . . , d}. Then S ⊆ Sn for n large enough, implying that f is constant on the connected components of G (R) , proving that ϕ is surjective. Now suppose that f ∈ E G (R) and Γ \ Sn . Hence f ∈ EH n n H that ϕn (f ) = 0. Then f˜(x) = 0 for all x ∈ G \ S, where S is a finite union of right cosets of G (R) , proving that ϕ is H in G. Since S ⊆ Sm for some m ≥ n, it follows that f → 0 in EH m injective. This proves our claim. A COHOMOLOGICAL CHARACTERIZATION OF LOCALLY VIRTUALLY CYCLIC GROUPS 9 We now consider two cases. First suppose there there exists a k ≥ 0 such that Ck is infinite. In this case Y G rkR (EH (R)k ) = rkR ( R) c∈Ck is infinite. Since G (R) EH k is a direct summand of lim E G (R)n ∼ = Θ/Ψ ∼ = E G (R) H → H G (R)) = ∞ for any commutative ring by the above and Lemma 3.2, we conclude that rkR (EH R with unit 1 6= 0. This holds in particular for R = F2 , so ẽ(G, H) = ∞. Secondly, assume that Cn is finite for all n ≥ 0. In this case one has E G (R)n ∼ = R ⊗Z E G (Z)n . H H G (R) EH G (Z). Since E G (Z) ∼ We conclude by taking limits and Lemma 3.2 that = R ⊗Z EH n+1 = H G G EH (Z)n ⊕ Xn+1 where Xn+1 is a finitely generated free abelian group, it follows that EH (Z) is a free abelian group of countable rank. We conclude that G G rkR (EH (R)) = rkZ (EH (Z)) for any commutative ring R with unit 1 6= 0. This holds in particular for R = F2 , so G ẽ(G, H) = rkR (EH (R)) as desired.  Corollary 3.4. One has   G (Q)) + 1. ẽ(G, H) = dimQ H1 (G, FH Proof. This follows immediately from the proposition and (1).  4. Structure of commensurators A crucial ingredient for proving our main theorem is the following variation on a result due to Kropholler. Theorem 4.1. If a finitely generated group G has rational cohomological dimension two and has an infinite virtually cyclic subgroup H such that G = NG [H], then G splits over a virtually cyclic subgroup commensurable with H. In particular, G contains F2 or a Baumslag-Solitar group BS(1, m) with m ∈ Z \ {0}. This theorem allows us to determine the structure of commensurators of infinite virtually cyclic groups in a group G with cd(G) ≤ 1. Corollary 4.2. If G is a group with cd(G) ≤ 1, then the commensurator NG [H] of any infinite virtually cyclic subgroup H of G is locally virtually cyclic. Proof. Let H be an infinite virtually cyclic subgroup of G and let Γ be a finitely generated subgroup of NG [H] that contains H. Then Γ is a finitely generated group with NΓ [H] = Γ and cd(Γ) ≤ 1. Our aim is to show that Γ is virtually cyclic. Assume that Γ is not virtually cyclic. Then cd(Γ) = 1, in which case cdQ (Γ) = 2 by Lemma 2.4. But then it follows from Theorem 4.1 that Γ contains F2 or BS(1, m) which implies that cd(Γ) ≥ 2 by Lemma 2.3(2). This is a contradiction, so we conclude that Γ is virtually cyclic.  10 DIETER DEGRIJSE We now turn to the proof of Theorem 4.1. In [13], Kropholler proves that if a torsion-free finitely generated group G has cohomological dimension two and has a infinite cyclic subgroup H such that G = NG [H], then G splits over an infinite cyclic subgroup commensurable with H. Below we will show that Kropholler’s arguments remain valid for non-torsion-free groups with rational cohomological dimension equal to two. Let G be a finitely generated group that has rational cohomological dimension equal to two and has an infinite cyclic subgroup H such that G = NG [H]. Lemma 4.3. [13, Lemma 2.2] The group G is a 2-dimensional duality group over Q. Proof. Strebel’s criterion mentioned in the beginning of [13, Section 2] and [13, Lemma 2.1] are valid over any field k. So even though [13, Lemma 2.2] is formulated over Z, one easily verifies that the proof carries through over any field, in particular over Q. It follows that G is a group with cdQ (G) = 2 that is of type F P2 over Q and satisfies H1 (G, Q[G]) = 0. This implies that G is a 2-dimensional duality group over Q with dualising module H2 (G, Q[G]) 6= 0.  Recall that an R-module M is called torsion-free if r · m = 0 for some m ∈ M and some non-zero r ∈ R implies that m = 0. Note that Q[H] is an integral domain and that Q[G] is a torsion-free Q[H]-module. Lemma 4.4. [13, Lemma 2.3] One has ẽ(G, H) ≥ 2. Proof. In the proof of [13, Lemma 2.2], it is shown that the set of non-zero elements of Q[H] form a right Ore set in Q[G]. Meaning that for every a ∈ Q[G] and b ∈ Q[H], there exists an a′ ∈ Q[G] and b′ ∈ Q[H] such that ab′ = ba′ . Using the anti-homomorphism X X ng g−1 ng g 7→ s : Q[G] → Q[G] : g∈G g∈G one easily checks that the set of non-zero elements of Q[H] also form a left Ore set in Q[G]. Meaning that for every a ∈ Q[G] and b ∈ Q[H], there exists an a′ ∈ Q[G] and b′ ∈ Q[H] such that b′ a = a′ b. Let K be the field of fractions of Q[H] and consider the right Q[G]-module K ⊗Q[H] Q[G]. Using the left Ore condition, one checks that K ⊗Q[H] Q[G] is divisible as a right H-module. Since K ⊗Q[H] Q[G] is also torsion-free as a right H-module it follows from [13, Lemma 1.2] that H2 (G, K ⊗Q[H] Q[G]) = 0. Since G is of type F P2 over Q, this implies that K ⊗Q[H] H2 (G, Q[G]) = 0. Let d be a non-zero element of H2 (G, Q[G]) and let M be the left Q[H]-submodule of H2 (G, Q[G]) generated by d. Let t be a generator of H. Since K ⊗Q[H] M = 0, there exists P an element a = ki=0 qi ti ∈ Q[H] such that a · d = 0. This implies that {d, t · d, . . . , tk−1 · d} is a generating set for M as a Q-vector space. In particular M a non-zero Q[H]-submodule of H2 (G, Q[G]) that is finite dimensional as a Q-vector space. G (Q)) + 1. Hence, to prove the By Corollary 3.4, we know that ẽ(G, H) = dimQ H1 (G, FH 1 G lemma we need to show that H (G, FH (Q)) 6= 0. Since G is a 2-dimensional duality group over Q, we have G G H1 (G, FH (Q)) ∼ (Q) ⊗Q DG ) = H1 (G, FH H 2 G ∼ where DG = H (G, Q[G]). Since FH (Q) ⊗Q DG = indG H (coinde (Q) ⊗Q DG ), it follows from Shapiro’s lemma and Poincaré duality for H that G H H H1 (G, FH (Q)) = H1 (H, coindH e (Q) ⊗Q DG ) = (coinde (Q) ⊗Q DG ) . A COHOMOLOGICAL CHARACTERIZATION OF LOCALLY VIRTUALLY CYCLIC GROUPS 11 H It follows that in order to prove the lemma, it suffices to shows that (coindH e (Q) ⊗Q M ) 6= 0, where M is the module constructed above. Since M is finite dimensional as a Q-vector space, there is an isomorphism of left Q[H]-modules (2) ∼ = → HomQ (Q[H], M ) : f ⊗ m 7→ f˜ HomQ (Q[H], Q) ⊗Q M − where f˜(x) = f (x)m for all x ∈ Q[H]. Here, the action of h ∈ H on an element ϕ ∈ HomQ (Q[H], M ) is given by (h · ϕ)(x) = hϕ(xh) for all x ∈ Q[H]. There is also an isomorphism of left H-modules ∼ = → HomQ (Q[H], M ) : f 7→ f˜ HomQ (Q[H], M ) − where f˜(h) = hf (h) for every h ∈ H. Here the H-action on the left hand side is the one appearing on the right hand side of (2), while on the right hand side M has the trivial H H-action. So the right hand side is coindH e (rese (M )). It follows that (coindH (Q) ⊗Q M )H ∼ = (coindH (resH (M )))H ∼ = M 6= 0. e e e  We can now prove Theorem 4.1. Proof. Since ẽ(G, H) ≥ 2 by the lemma above, it follows from Lemma 3.1 that G has a proper H-almost invariant subset B such that BH = B. The proof of [13, Lemma 3.2] now carries through verbatim showing that G splits over a virtually cyclic subgroup C commensurable to H. This means that G is either equal to a non-trivial amalgamated free product K∗C L or an HNN-extension G = K∗C for some subgroups K, L of G. First suppose that G = K∗C L. Note that C cannot equal K or L, since the amalgamated free product is non-trivial. If C has index two in both K and L, then G fits into a short exact sequence 1 → C → G → K/C ∗ L/C → 1. Since K/C ∗ L/C is isomorphic to the infinite dihedral group and C is infinite virtually cyclic, it is a standard exercise in group theory to check that G contains Z2 = BS(1, 1). If C has index at least three in either K or L then it follows from the Normal Form Theorem for free amalgamated products that G contains F2 . Secondly, suppose that G = K∗C . Again there are two cases two consider. If K = C then the HNN extension is ascending and determined by an injective homomorphism ϕ : K → K. Since in this case K is infinite virtually cyclic, it is not hard to see that one can find an infinite cyclic subgroup hxi of K such that ϕ restricts to hxi. Britton’s lemma now shows that the subgroup of the ascending HNN extension G generated by x and the stable letter t is isomorphic to a Baumslag-Solitar group BS(1, m), for some m ∈ Z \ {0}. On other hand, if K 6= C then it follows from Britton’s Lemma that G contains F2 . This finishes the proof.  We now turn to the proof of Corollary 3 from the introduction. Proof. Let G be a group satisfying cd(G) = 2. It follows from Proposition 2.2 that in order to prove that cd(G) ≤ 3, if suffices to prove that cdF [H] (NG [H]) ≤ 3, where H is any infinite cyclic subgroup of G. By [5, Lemma 3.1], it suffices to show that cdF [H]∩K (K) ≤ 2, where K is any finitely generated subgroup of NG [H] containing H. First suppose that G does not contain F2 . In this case it follows from the proof of Theorem 4.1 that K is either an amalgam or an HNN extension where all edge and vertex groups are 12 DIETER DEGRIJSE infinite virtually cyclic subgroups commensurable to H. In any case, all the point stabilizers of the action of K on the associated Bass-Serre tree T are commensurable to H, implying that T is a 1-dimensional model for EF [H]∩K K. We conclude that cdF [H]∩K (K) ≤ 1 ≤ 2, as desired. Next assume that G is coherent, implying that K is finitely presented (actually we only need K to be F P2 over Z). In this case the arguments of the proof of [13, Theorem C] carry through completely: using the finite presentability ([13, Th. 4.1 and below]) one shows that iterating Theorem 4.1 must eventually produce as splitting over virtually cyclic subgroups, proving that K acts simplicially on a tree T with infinite virtually cyclic vertex groups such that each edge stabilizer is commensurable to H. Again, we conclude that T is a model for EF [H]∩K K and hence cdF [H]∩K (K) ≤ 1 ≤ 2, as desired. Finally, suppose that G is torsion-free. It this case it follows from [13, Lemma 2.2] that K is of type F P2 over Z, so the argument of the previous case applies. Now suppose G is a one-relator group. Then cd(G) ≤ 2 by [16, 4.12]. If G is torsion-free, then cd(G) ≤ 3 by the above. If G has torsion, then G is word-hyperbolic (e.g. see [21, p. 205]) and [15, Prop. 9] implies that cd(G) ≤ 2.  Remark 4.5. It follows from the proof above that in order to show that every countable group with cd(G) = 2 satisfies cd(G) ≤ 3, it suffices to show that if Γ is a finitely generated group with cd(Γ) = 2 that has an infinite virtually cyclic subgroup H such that CommΓ (H) = Γ, then Γ is of type F P2 over Z. If Γ is not torsion-free, we are only able to prove that Γ is of type F P2 over Q. 5. Proof of the Main Theorem Let G be a finitely generated group with cd(G) ≤ 1. Our aim is to show that G is virtually cyclic, i.e. cd(G) = 0. We will argue by contradiction. To this end, assume that cd(G) = 1. It follows from Lemma 2.4 that cdQ (G) = 2 and H1 (G, F ) = 0 for any free Q[G]-module F . Moreover, by Corollary 4.2 the commensurator NG [H] of any infinite virtually cyclic subgroup H of G is locally virtually cyclic. This implies that the family F[H] of NG [H] coincides with the family VC, hence cdF [H] (NG [H]) ≤ 1. It follows from Lemma 2.3(3) that Y ∼ = → H2F (NG [H], M ). H2F (G, M ) − [H]∈I for any right OVC G-module M . This holds in particular for every fixed point functor V , where V is a Q[G]-module. Let I0 be the subset of I containing those [H] ∈ I for which NG [H] is not virtually cyclic. Since finite groups have rational cohomological dimension zero, we conclude from the above and Lemma 2.1 that (3) ∼ = → H2 (G, V ) − Y H2 (NG [H], V ). [H]∈I0 for every Q[G]-module V . Since cdQ (G) = 2, we deduce that I0 is non-empty. Fix [H] ∈ I0 , denote NG [H0 ] = N and recall that H1 (NG [H], F ) = 0 for any free Q[NG [H]]-module F (e.g. see [13, Lemma 1.1]) and any [H] ∈ I0 . Now consider the short exact sequence of N -modules (4) ε 0 → I → Q[N ] − → Q → 0, A COHOMOLOGICAL CHARACTERIZATION OF LOCALLY VIRTUALLY CYCLIC GROUPS 13 where ε is the augmentation map. Since Q[N ]N = H1 (N, Q[N ]) = 0, the long exact cohomology sequence associated to this short exact sequence implies that H1 (N, I) ∼ = Q. Inducting (4) from N to G, we obtain a short exact sequence of G-modules ε G 0 → IN → Q[G] − → Q[G/N ] → 0. (5) Since Q[G]G = H1 (G, Q[G]) = 0, the long exact cohomology sequence associated to this short G ) = Q[G/N ]G . Since cd (N ) ≤ 2, there exists a short exact sequence implies that H1 (G, IN Q exact sequence of N -modules 0 → F̃2 → F̃1 → I → 0, (6) where F̃1 and F̃2 are free Q[N ]-modules. Inducting (6) from N to G, we obtain a short exact sequence of G-modules G 0 → F2 → F1 → IN → 0, (7) where F1 and F2 are free Q[G]-modules. Since H1 (NG [H], F1 ) = H1 (G, F1 ) = 0 for every [H] ∈ I0 , the long exact cohomology sequence associated to (7) yields the exact sequences G 0 → H1 (G, IN ) → H2 (G, F2 ) → H2 (G, F1 ) and G 0 → H1 (NG [H], IN ) → H2 (NG [H], F2 ) → H2 (NG [H], F1 ) for every [H] ∈ I0 . By (3), we obtain a commutative diagram with exact rows. 0 / H1 (G, I G ) N / H2 (G, F2 )   / H2 (G, F1 ) ∼ = ∼ = 0 / Q [H]∈I0 G) H1 (NG [H], IN / Q [H]∈I0  H2 (NG [H], F2 ) / Q [H]∈I0 H2 (NG [H], F1 ). We conclude that G ∼ )= Q[G/N ]G ∼ = H1 (G, IN Y G H1 (NG [H], IN ). [H]∈I0 Since I is a direct summand of summand. We conclude that G, IN G ) has H1 (N, I) ∼ Q as a direct as N -modules, H1 (N, IN = Q[G/N ]G 6= 0, which implies that N has finite index in G. Since G is finitely generated but N is not, this is a contradiction. We conclude that cd(G) = 0, i.e G is virtually cyclic. The Main Theorem now follows easily: if G is a group with cd(G) ≤ 1, then every finitely generated subgroup K of G also satisfies cd(K) ≤ 1 and is therefore virtually cyclic by the above. This proves that G is locally virtually cyclic.  Acknowledgment The author was partially supported by the Danish National Research Foundation through the Centre for Symmetry and Deformation (DNRF92). The author is also grateful to the Centro de Ciencias Matemáticas, UNAM, Morelia, and in particular to Noé Bárcenas, for their hospitality during a visit when part of this work was completed. 14 DIETER DEGRIJSE References [1] Brady, N., Leary I. , and Nucinkis, B.. On algebraic and geometric dimensions for groups with torsion, J. Lond. Math. Soc. Vol 64(2) (2001), 489–500 [2] Bredon, G.E., Equivalent cohomology theories, Lecture Notes in Mathematics 34, Springer (1967) [3] Degrijse, D. and Petrosyan, N., Commensurators and classifying spaces with virtually cyclic stabilizers, Groups, Geometry, and Dynamics Vol. 7(3) (2013), 543–555 [4] Degrijse, D. and Petrosyan, N., Geometric dimension of groups for the family of virtually cyclic subgroups, Journal of Topology (2014) 7(3) 697–726 [5] Degrijse, D. and Petrosyan, N., Bredon cohomological dimensions for groups acting on CAT(0)-spaces, Groups, Geometry and Dynamics, 9(4) (2015), 1231–1265 [6] Degrijse, D. and Petrosyan, N., F-structures and Bredon-Galois cohomology, Appl. Categor. Struct. 21 (2013), 545–586 [7] Dembegioti, F., Petrosyan, N. and Talelli, O., Intermediaries in Bredon (Co)homology and Classifying Spaces, Publicacions Matemàtiques 56 (2) (2012), 393–412 [8] Dunwoody, M.J., Accessibility and groups of cohomological dimension one, London Math. Soc. (3) 38 (1979), 193–215 [9] Eilenberg S. and Ganea, T. On the Lusternik-Schnirelmann category of abstract groups, Ann. of Math. (2) 65 (1957), 517–518 [10] Fluch M., On Bredon (co-)homological dimensions of groups, Ph.D. Thesis, University of Southampton, arXiv:1009.4633 [11] Fluch, M. and Leary, I.J., An Eilenberg-Ganea Phenomenon for Actions with Virtually Cyclic Stabilizers, Groups, Geometry, and Dynamics 8(1) (2014), 135–142 [12] Fluch, M., and Nucinkis, B. E. A, On the classifying space for the family of virtually cyclic subgroups for elementary amenable groups, Proc. Amer. Math. Soc. 141(11) (2013), 3755–3769 [13] Kropholler, P.H., Baumslag-Solitar groups and some other groups of cohomological dimension two, Commentarii Mathematici Helvetici, Vol. 65(1) (1990), 547–558 [14] Kropholler P.H., and Roller M.A., Relative ends and duality groups, Journal of Pure and Applied Algebra Vol. 61 (1989), 197–210 [15] Juan-Pineda, D., and Leary, I. J., On classifying spaces for the family of virtually cyclic subgroups, Recent developments in alg. top., Vol. 407 Contemp. Math., Am. Math. Soc. (2006), 135–145 [16] Lück, W., Survey on classifying spaces for families of subgroups, Infinite Groups: Geometric, Combinatorial and Dynamical Aspects, Springer (2005), 269–322 [17] Lück, W., L2-invariants: theory and applications to geometry and K-theory, Vol 44 , A Series of Modern Surveys in Mathematics. Springer-Verlag, Berlin, 2002 [18] Lück, W. and Meintrup, D., On the universal space for group actions with compact isotropy, Proc. of the conference “Geometry and Topology” in Aarhus, (1998), 293–305 [19] Lück, W. and Reich H., The Baum-Connes and the Farrell-Jones conjectures in K- and L-theory, Handbook of K-theory. Vol. 2, Springer, Berlin (2005), 703–842 [20] Lück, W., and Weiermann, M., On the classifying space of the family of virtually cyclic subgroups, Pure and Applied Mathematics Quarterly, Vol. 8(2) (2012), 497-555 [21] Lyndon, R. and Schupp, P., Combinatorial group theory, Springer (1977) [22] Martı́nez-Pérez, C., A spectral sequence in Bredon (co)homology, J. Pure Appl. Algebra 176 (2002), 161–173. [23] Nucinkis, B., On dimensions in Bredon homology, Homology, Homotopy and Applications Vol. 6(1) (2004), 33–47 [24] Serre, J.-P., Trees, Springer (1980). [25] Stallings J.R, Groups of dimension 1 are locally free, Bull. Amer. Math. Soc. 74 (1968), 361–364 [26] Swan, R.G, Groups of cohomological dimension one, J. Algebra 12 (1969), 585–610 [27] Symonds, P., The Bredon cohomology of subgroup complexes, J. Pure Appl. Algebra 199 (2005), 261– 298 School of Mathematics, Statistics and Applied Mathematics, NUI Galway, Ireland E-mail address: [email protected]
4math.GR
arXiv:1702.07241v3 [math.OC] 21 Dec 2017 Kalman Filter and its Modern Extensions for the Continuous-time Nonlinear Filtering Problem Amirhossein Taghvaei, Department of Mechanical Science and Engineering University of Illinois at Urbana-Champaign Email: [email protected] Jana de Wiljes, Institut für Mathematik Universität Potsdam Email: [email protected] Prashant G. Mehta, Department of Mechanical Science and Engineering University of Illinois at Urbana-Champaign Email: [email protected] Sebastian Reich, Institut für Mathematik Universität Potsdam and Department of Mathematics and Statistics University of Reading Email: [email protected] This paper is concerned with the filtering problem in continuous-time. Three algorithmic solution approaches for this problem are reviewed: (i) the classical Kalman-Bucy filter which provides an exact solution for the linear Gaussian problem, (ii) the ensemble Kalman-Bucy filter (EnKBF) which is an approximate filter and represents an extension of the Kalman-Bucy filter to nonlinear problems, and (iii) the feedback particle filter (FPF) which represents an extension of the EnKBF and furthermore provides for an consistent solution in the general nonlinear, non-Gaussian case. The common feature of the three algorithms is the gain times error formula to implement the update step (to account for conditioning due to the observations) in the filter. In contrast to the commonly used sequential Monte Carlo methods, the EnKBF and FPF avoid the resampling of the particles in the importance sampling update step. Moreover, the feedback control structure provides for error correction potentially leading to smaller simulation variance and improved stability properties. The paper also discusses the issue of non-uniqueness of the filter update formula and formulates a novel approximation algorithm based on ideas from optimal transport and coupling of measures. Performance of this and other algorithms is illustrated for a numerical example. 1 Introduction Since the pioneering work of Kalman from the 1960s, sequential state estimation has been extended to application areas far beyond its original aims such as numerical weather prediction [1] and oil reservoir exploration (history matching) [2]. These developments have been made possible by clever combination of Monte Carlo techniques with Kalmanlike techniques for assimilating observations into the underlying dynamical models. The most prominent of these algorithms are the ensemble Kalman filter (EnKF), the randomized maximum likelihood (RML) method and the unscented Kalman filter (UKF) invented independently by several research groups [3–6] in the 1990s. The EnKF in particular can be viewed as a cleverly designed random dynamical system of interacting particles which is able to approximate the exact solution with a relative small number of particles. This interacting particle perspective has led to many new filter algorithms in recent years which go beyond the inherent Gaussian approximation of an EnKF during the data assimilation (update) step [7]. In this paper, we review the interacting particle perspective in the context of the continuous-time filtering problems and demonstrate its close relation to Kalman’s and Bucy’s KBF Kalman-Bucy Filter Equations (3a)-(3b) EKBF Extended Kalman-Bucy Filter Equations (5a)-(5b) (Stochastic) Ensemble Kalman-Bucy Filter Equation (7) (Deterministic) Ensemble Kalman-Bucy Filter Equation (8) Feedback Particle Filter Equation (9) EnKBF FPF Table 1: Nomenclature for the continuous-time filtering algorithms original feedback control structure of the data assimilation step. More specifically, we highlight the feedback control structure of three classes of algorithms for approximating the posterior distribution: (i) the classical Kalman-Bucy filter which provides an exact solution for the linear Gaussian problem, (ii) the ensemble Kalman-Bucy filter (EnKBF) which is an approximate filter and represents an extension of the Kalman-Bucy filter to nonlinear problems, and (iii) the feedback particle filter (FPF) which represents an extension of the EnKBF and furthermore provides for a consistent solution of the general nonlinear, non-Gaussian problem. A closely related goal is to provide comparison between these algorithms. A common feature of the three algorithms is the gain times error formula to implement the update step in the filter. The difference is that while the Kalman-Bucy filter is an exact algorithm, the two particle-based algorithms are approximate with error decreasing to zero as the number of particles N increases to infinity. Algorithms with this property are said to be consistent. In the class of interacting particle algorithms discussed, the FPF represents the most general solution to the nonlinear non-Gaussian filtering problem. The challenge with implementing the FPF lie in approximation of the “gain function” used in the update step. The gain function equals the Kalman gain in the linear Gaussian setting and must be numerically approximated in the general setting. One particular closed-form approximation is the constant gain approximation. In this case, the FPF is shown to reduce to the EnKBF algorithm. The EnKBF naturally extends to nonlinear dynamical systems and its discrete-time versions have become very popular in recent years with applications to, for example, atmosphere-ocean dynamics and oil reservoir exploration. In the discrete-time setting, development and application of closely related particle flow algorithms has also been a subject of recent interest, e.g., [8–13]. The outline of the remainder of this paper is as follows: The continuous-time filtering problem and the classic Kalman-Bucy filter are summarized in Sections 2 and 3, respectively. The Kalman-Bucy filter is then put into the context of interacting particle systems in the form of the EnKBF in Section 4. Section 5 together with Appendices A and B provides a consistent definition of the FPF and a discussion of alternative approximation techniques which lead to consistent approximations to the filtering problem as the number of particles, N, goes to infinity. It is shown that the EnKBF can be viewed as an approximation to the FPF. Four algorith- mic approaches to gain function approximation are described and their relationship discussed. The performance of the four algorithms is numerically studied and compared for an example problem in Section 6. The paper concludes with discussion of some open problems in Section 7. The nomenclature for the filtering algorithms described in this paper appears in Table 1. 2 Problem Statement In the continuous-time setting, the model for nonlinear filtering problem is described by the nonlinear stochastic differential equations (sdes): Signal: Observation: dXt = a(Xt ) dt + σ (Xt ) dBt , dZt = h(Xt ) dt + dWt X0 ∼ p∗0 (1a) (1b) where Xt ∈ Rd is the (hidden) state at time t, the initial condition X0 is sampled from a given prior density p∗0 , Zt ∈ Rm is the observation or the measurement vector, and {Bt }, {Wt } are two mutually independent Wiener processes taking values in Rd and Rm . The mappings a(·) : Rd → Rd , h(·) : Rd → Rm and σ (·) : Rd → Rd×d are known C1 functions. The covariance matrix of the observation noise {Wt } is assumed to be positive definite. The function h is a column vector whose j-th coordinate is denoted as h j (i.e., h = (h1 , h2 , . . . , hm )T ). By scaling, it is assumed without loss of generality that the covariance matrices associated with {Bt }, {Wt } are identity matrices. Unless otherwise noted, the stochastic differential equations (sde) are expressed in Itô form. Table 2 includes a list of symbols used in the continuous-time filtering problem. In applications, the continuous time filtering models are often expressed as: dXt = a(Xt ) + σ (Xt )Ḃt dt dZt = h(Xt ) + Ẇt Yt := dt (2a) (2b) where Ḃt and Ẇt are mutually independent white noise processes (Gaussian noise) and Yt ∈ Rm is the vector valued observation at time t. The sde-based model is preferred here because of its mathematical rigor. Any sde involving Zt is Variable Notation Model Variable Notn. & Defn. State Xt Eq. (1a) Cond. mean X̂t = E[Xt |Zt ] Process noise Bt Wiener process Cond. var. Measurement Zt Eq. (1b) Kalman gain Measurement noise Wt Wiener process Table 2: Symbols for the continuous-time filtering problem converted into an ODE involving Yt by formally dividing the t sde by dt and replacing dZ dt by Yt (See also Remark 1). The objective of filtering is to estimate the posterior distribution of Xt given the time history of observations Zt := σ (Zs : 0 ≤ s ≤ t). The density of the posterior distribution is denoted by p∗ , so that for any measurable set A ⊂ Rd , Z x∈A p∗ (x,t) dx = P{Xt ∈ A | Zt } One example of particular interest is when the mappings a(x) and h(x) are linear, σ (x) is a constant matrix that does not depend upon x, and the prior density p∗0 is Gaussian. The associated problem is referred to as the linear Gaussian filtering problem. For this problem, the posterior density is known to be Gaussian. The resulting filter is said to be finitedimensional because the posterior is completely described by finitely many statistics – conditional mean and variance in the linear Gaussian case. For the general nonlinear non-Gaussian case, however, the filter is infinite-dimensional because it defines the evolution, in the space of probability measures, of {p∗ ( · ,t) : t ≥ 0}. The particle filter is a simulation-based algorithm to approximate the posterior: The key step is the construction of N interacting stochastic processes {Xti : 1 ≤ i ≤ N}: The value Xti ∈ Rd is the state for the i-th particle at time t. For each time t, the empirical distribution formed by the particle population is used to approximate the posterior distribution. Recall that this is defined for any measurable set A ⊂ Rd by, p(N) (A,t) = 1 N ∑ 1{Xti ∈ A} . N i=1 where 1{x ∈ A} is the indicator function (equal to 1 if x ∈ A and 0 otherwise). The first interacting particle representation of the continuous-time filtering problem can be found in [14, 15]. The close connection of such interacting particle formulations to the gain factor and innovation structure of the classic Kalman filter has been made explicit starting with [16, 17] and has led to the FPF formulation considered in this paper. Notation: The density for a Gaussian random variable with mean m and variance Σ is denoted as N (m, Σ). For vectors Model Eq. (3a) T Σt = E[(Xt − X̂t )(Xt − X̂t ) |Zt ] Kt = Σt HtT Eq. (3b) Eq. (4) Table 3: Symbols for the Kalman filter √ x, y ∈ Rd , the dot product is denoted as x · y and |x| := x · x; xT denotes the transpose of the vector. Similarly, for a matrix K, KT denotes the matrix transpose. For two sequence ∞ {an }∞ n=1 and {bn }n=1 , the big O notation an = O(bn ) means ∃ n0 ∈ N and c > 0 such that |an | ≤ c|bn | for n > n0 . 3 Kalman-Bucy Filter Consider the linear Gaussian problem: The mappings a(x) = A x and h(x) = H x where A and H are d × d and m × d matrices; the process noise covariance σ (x) = σ , a constant d × d matrix; and the prior density is Gaussian, denoted as N (X̂0 , Σ0 ). For this problem, the posterior density is known to be Gaussian, denoted as N (X̂t , Σt ), where X̂t and Σt are the conditional mean and variance, i.e X̂t := E[Xt |Zt ] and Σt := E[(Xt − X̂t )(Xt − X̂t )T |Zt ]. Their evolution is described by the finite-dimensional Kalman-Bucy filter:   dX̂t = AX̂t dt + Kt dZt − Ht X̂t dt (3a) dΣt = AΣt + Σt AT + σ σ T − Σt H T HΣt dt (3b) Kt := Σt HtT (4) where is referred to as the Kalman gain and the filter is initialized with the initial conditions X̂0 and Σ0 of the prior density. Table 3 includes a list of symbols used for the Kalman filter. The evolution equation for the mean is a sde because of the presence of stochastic forcing term Zt on the right-hand side. The evolution equation for the variance Σt is an ode that does not depend upon the observation process. The Kalman filter is one of the most widely used algorithm in engineering. Although the filter describes the posterior only in linear Gaussian settings, it is often used as an approximate algorithm even in more general settings, e.g., by defining the matrices A and H according to the Jacobians of the mappings a and h: A := ∂a (X̂t ), ∂x H := ∂h (X̂t ) ∂x The resulting algorithm is referred to as the extended Kalman filter:   dX̂t = a(X̂t ) dt + Kt dZt − h(X̂t ) dt dΣt = AΣt + Σt AT + σ (X̂t )σ T (X̂t ) − Σt H T HΣt dt (5a) (5b) T where Kt = Σt H is used as the formula for the gain. The Kalman filter and its extensions are recursive algorithms that process measurements in a sequential (online) fashion. At each time t, the filter computes an error dZt − H X̂t dt (called the innovation error) which reflects the new information contained in the most recent measurement. The filter state X̂t is corrected at each time step via a (gain × error) update formula. The error correction feedback structure (see Fig. 1) is important on account of robustness. A filter is based on an idealized model of an underlying stochastic dynamic process. The self-correcting property of the feedback provides robustness, allowing one to tolerate a degree of uncertainty inherent in any model. The simple intuitive nature of the update formula is invaluable in design, testing and operation of the filter. For example, the Kalman gain is proportional to H which scales with the signal-to-noise ratio of the measurement model. In practice, the gain may be ‘tuned’ to optimize the filter performance. To minimize online computations, an offline solution of the algebraic Ricatti equation (obtained after equating the right-hand side of the variance ode (3b) to zero) may be used to obtain a constant value for the gain. The basic Kalman filter has also been extended to handle filtering problems involving additional uncertainties in the signal model and the observation model. The resulting (approximate) algorithms are referred to as the interacting multiple model (IMM) filter [18] and the probabilistic data association (PDA) filter [19], respectively. In the PDA filter, the gain varies based on an estimate of the instantaneous uncertainty in the measurements. In the IMM filter, multiple Kalman filters are run in parallel and their outputs combined to obtain an estimate. One explanation of the feedback control structure of the Kalman filter is based on duality between estimation and control [20]. Although limited to linear Gaussian problems, these considerations also help explain the differential Ricatti equation structure for the variance ode (3b). Although widely used, the extended Kalman filter can suffer from stability issues because of the very crude approximation of the nonlinear model. The observed divergence arises on account of two inter-related reasons: (i) Even with Gaussian process and measurement noise, the nonlinearity of the mappings a(·), σ (·) and h(·) can lead to non-Gaussian forms of the posterior density p∗ ; and (ii) the Jacobians A and H used in propagating the covariance can lead to large errors in approximation of the gain particularly if the Hessian of these mappings is large. These issues have necessitated development of particle based algorithms described in the following sections. Variable Notation Particle state Xti Empirical variance (N) Σt Model Stoch. EnKBF Eq. (7) Deter. EnKBF Eq. (8) Eq. (6) Particle process noise Bti Wiener process Particle meas. noise Wti Wiener process Table 4: Symbols for the ensemble Kalman-Bucy filter 4 Ensemble Kalman-Bucy Filter For pedagogical reasons, the ensemble Kalman-Bucy filter (EnKBF) is best described for the linear Gaussian problem – also the approach taken in this section. The extension to the nonlinear non-Gaussian problem is then immediate, similar to the extension from the Kalman filter to the extended Kalman filter. Even in linear Gaussian settings, a particle filter may be a computationally efficient option for problems with very large state dimension d (e.g., weather models in meteorology). For large d, the computational bottleneck in simulating a Kalman filter arises due to propagation of the covariance matrix according to the differential Riccati equation (3b). This computation scales as O(d 2 ) in memory. In an EnKBF implementation, one replaces the exact propagation of the covariance matrix by an empirical approximation with N particles (N) Σt = 1 N i (N) (N) ∑ (Xt − X̂t )(Xti − X̂t )T N − 1 i=1 (6) This computation scales as O(Nd). The same reduction in computational cost can be achieved by a reduced rank Kalman filter. However, the connection to empirical measures (3) is crucial to the application of the EnKBF to nonlinear dynamical systems. The EnKF algorithm was first developed in a discretetime setting [4]. Since then various formulations of the EnKF have been proposed [7, 21]. Below we state two continuoustime formulations of the EnKBF. Table 4 includes a list of symbols used for these formulations. 4.1 Stochastic EnKBF The conceptual idea of the stochastic EnKBF algorithm is to introduce a zero mean perturbation (noise term) in the innovation error to achieve consistency for the variance update. In the continuous-time stochastic EnKBF algorithm, the particles evolve according to   (N) dXti = AXti dt + σ dBti + Σt H T dZti − HXti dt + dWti (7) for i = 1, . . . , N, where Xti ∈ Rd is the state of the ith particle at time t, the initial condition X0i ∼ p∗0 , Bti is a standard Wiener process, and Wti is a standard Wiener process assumed to be (N) independent of X0i , Bti , Xt , Zt [21]. The variance Σt is obtained empirically using (6). Note that the N particles only (N) interact through the common covariance matrix Σt . The idea of introducing a noise process first appeared for the discrete-time EnKF. The derivation of the continuoustime stochastic EnKBF can be found in [21] or [22]. It is based on a limiting argument whereby the discrete-time update step is formally viewed as an Euler-Maruyama discretization of a stochastic SDE. For the linear Gaussian problem, the stochastic EnKBF algorithm is consistent in the limit as N → ∞. This means that the conditional distribution of Xti is Gaussian whose mean and variance evolve according the Kalman filter, equations (3a) and (3b), respectively. The update formula used in (7) is not unique. A deterministic analogue is described next. 4.2 Deterministic EnKBF A deterministic variant of the EnKBF (first proposed in [23]) is given by: dXti = (N) AXti dt + σ dBti + Σt H T (N) HXti + H X̂t dZt − 2 dt ! (8) for i = 1, . . . , N. A proof of the consistency of this deterministic variant of the EnKBF for linear systems can be found in [24]. There are close parallels between the deterministic EnKBF and the FPF which is explored further in Section 5. In the deterministic formulation of the EnKBF the interaction between the N particles arises through the covariance (N) (N) matrix Σt and the mean X̂t . Although the stochastic and the deterministic EnKBF algorithms are consistent for the linear Gaussian problem, they can be easily extended to the nonlinear non-Gaussian settings. However, the resulting algorithm will in general not be consistent. 4.3 Well-posedness and accuracy of the EnKBF Recent research on EnKF has focussed on the long term behavior and accuracy of filters applicable for nonlinear data assimilation [24–27]. In particular the mathematical justification for the feasibility of the EnKF and its continuous counterpart in the small ensemble limit are of interest. These studies of the accuracy for a finite ensemble are of exceptional importance due to the fact that a large number of ensemble members is not an option from a computational point of view in many applicational areas. The authors of [26] show mean-squared asymptotic accuracy in the large-time limit where a particular type of variance inflation is deployed for the stochastic EnKBF. Well-posedness of the discrete and continuous formulation of the EnKF is also shown. Similar results concerning the well-posedness and accuracy for the deterministic variant (8) of the EnKBF are derived in [24]. A fully observed system is assumed in deriving these accuracy and well-posedness results. An investigation of the well-posedness for partially observed systems is particularly relevant as the update step in such cases can cause a divergence of the estimate in the sense that the signal is lost or the values of the estimate reach machine infinity [28]. 5 Feedback Particle Filter The FPF is a controlled sde: dXti =a(Xti ) dt + σ (Xti ) dBti + Kt (Xti ) ◦ ( dZt − | {z h(Xti ) + ĥt dt), 2 } X0i ∼ p∗0 (9) update where (similar to EnKBF) Xti ∈ Rd is the state of the ith particle at time t, the initial condition X0i ∼ p∗0 , Bti is a standard Wiener process, and ĥt := E[h(Xti )|Zt ]. Both Bti and X0i are mutually independent and also independent of Xt , Zt . The ◦ in the update term indicates that the sde is expressed in its Stratonovich form. The gain function Kt is vector-valued (with dimension d × m) and it needs to be obtained for each fixed time t. The gain function is defined as a solution of a pde introduced in the following subsection. For the linear Gaussian problem, Kt is the Kalman gain. For the general nonlinear non-Gaussian, the gain function needs to be numerically approximated. Algorithms for this are also summarized in the following subsection. Remark 1. Given that the Stratonovich form provides a mathematical interpretation of the (formal) ode model [29, see Section 3.3 of the sde textbook by Øksendal], we also ob. t tain the (formal) ode model of the filter. Denoting Yt = dZ dt i . t , the ODE model of the filter and white noise process Ḃti = dB dt is given by,   dXti 1 i i i i i = a(Xt ) + σ (Xt )Ḃt + K(X ,t) Yt − (h(Xt ) + ĥ) , dt 2 for i = 1, . . . , N. The feedback particle filter thus provides a generalization of the Kalman filter to nonlinear systems, where the innovation error-based feedback structure of the control is preserved (see Fig. 1). For the linear Gaussian case, the gain function is the Kalman gain. For the nonlinear case, the Kalman gain is replaced by a nonlinear function of the state (See Fig. 3). Remark 2. It is shown in Appendix A that, under the condition that the gain function can be computed exactly, FPF is an exact algorithm. That is, if the initial condition X0i is sampled from the prior p∗0 then P[Xt ∈ A | Zt ] = P[Xti ∈ A | Zt ], ∀ A ⊂ Rd , t > 0. Fig. 1: Innovation error-based feedback structure for the (a) Kalman filter and (b) nonlinear feedback particle filter. Variable Notation Model Particle state Xti FPF Eq. (9) Gain function Kt (x) = ∇φ (x) Poisson Eq. (10) φ (x) of (10), the gain function at time t is given by Kt (x) = ∇φ (x) . Constant gain (14) Particle gain Ki = K(Xti ) Galerkin (17) Kernel-based (22) Optimal coupling (25) (11) Remark 3. The gain function Kt (x) is not uniquely defined through the filtering problem. Formula (11) represents one choice of the gain function. More generally, it is sufficient to require that Kt = K is a solution of − ∇ · (ρ (x)K(x)) = (h(x) − ĥ)ρ (x), x ∈ Rd (12) Table 5: Symbols for feedback particle filter In a numerical implementation, a finite number, N, of particles is simulated and P[Xti ∈ A | Zt ] ≈ N1 ∑Ni=1 1[Xti ∈ A] by the Law of Large Numbers (LLN). The considerations in the Appendix are described in a more general setting, e.g., applicable to stochastic processes Xt and Xti evolving on manifolds. This also explains why the update formula has a Stratonovich form. For sdes on a manifold, it is well known that the Stratonovich form is invariant to coordinate transformations (i.e., intrinsic) while the Ito form is not. A more in-depth discussion of the FPF for Lie groups appears in [30]. Table 5 includes a list of symbols used for the FPF. 5.1 Gain function For pedagogical reasons primarily to do with notational convenience, the gain function is defined here for the case of scalar-valued observation1. In this case, the gain function Kt is defined in terms of the solution of the weighted Poisson equation: −∇ · (ρ (x)∇φ (x)) = (h(x) − ĥ)ρ (x), Z φ (x)ρ (x) dx = 0 x ∈ Rd (10) R where ĥ := h(x)ρ (x) dx, ∇ and ∇· denote the gradient and the divergence operators, respectively, and at time t, ρ (x) = p(x,t) denotes the density of Xti 2 . In terms of the solution 1 The extension to multi-valued observation is straightforward and appears in [31]. 2 Although this paper is limited to Rd , the proposed algorithm is applicable to nonlinear filtering problems on differential manifolds, e.g., matrix Lie groups (For an intrinsic form of the Poisson equation, see [30]). For domains with boundary, the pde is accompanied by a Neumann boundary with ρ (x) = p(x,t) at time t. One justification for choosing the gradient form solution, as in (11), is its L2 optimality. The general solution of (12) is given by K = ∇φ + v where φ is the solution of (10) and v solves ∇ · (ρ v) = 0. It is easy to see that E[|K|2 ] = E[|∇φ |2 ] + E[|v|2]. Therefore, K = ∇φ is the minimum L2 -norm solution of (12). By interpreting the L2 norm as the kinetic energy, the gain function Kt = ∇φ , defined through (10), is seen to be optimal in the sense of optimal transportation [32, 33]. An alternative solution of (12) is provided through the definition Kt (x) = 1 ∇φ̃ (x) ρ (x) which leads to a standard Poisson equation in the unknown potential φ̃ for which the fundamental solution is explicitly known. This fact is exploited in the interacting particle filter representations of [14, 15]. There are two special cases of (10) – summarized as part of the following two examples – where the exact solution can be found. condition: ∇φ (x) · n(x) = 0 for all x on the boundary of the domain where n(x) is a unit normal vector at the boundary point x. Fig. 2: The exact solution to the Poisson equation using the formula (13). The density ρ is the sum of two Gaussians N(−1, σ 2 ) and N(+1, σ 2 ), and h(x) = x. The density is depicted as the shaded curve in the background. Example 1. In the scalar case (where d = 1), the Poisson equation is: − 5.2 Constant Gain Approximation The constant gain approximation is the best – in the least-square sense – constant approximation of the gain function (see Figure 3). Mathematically, it is obtained by considering the following least-square optimization problem: κ ∗ = arg min E [|K − κ |2] dφ 1 d (ρ (x) (x)) = h − ĥ. ρ (x) dx dx κ ∈Rd By using a standard sum of the squares argument, κ ∗ = E[K]. By multiplying both sides of the pde (10) by x and integrating by parts, the expected value is computed explicitly as Integrating once yields the solution explicitly, K(x) = Fig. 3: Constant gain approximation in the feedback particle filter 1 dφ (x) = − dx ρ (x) Z x −∞ ρ (z)(h(z) − ĥ) dz. (13) For the particular choice of ρ as the sum of two Gaussians N (−1, σ 2 ) and N (+1, σ 2 ) with σ 2 = 0.2 and h(x) = x, the solution obtained using (13) is depicted in Fig. 2. κ ∗ = E[K] = Problem statement: Given N samples {X 1 , . . . , X i , . . . , X N } drawn i.i.d. from ρ , approximate the vector-valued gain function{K1, . . . , Ki , . . . , KN }, where Ki := K(X i ) = ∇φ (X i ). The density ρ is not explicitly known. Four numerical algorithms for approximation of the gain function appear in the following four subsections3 . 3 These algorithms are based on the existence-uniqueness theory for solution φ of the Poisson equation pde (10), as described in [34]. Rd (h(x) − ĥ) x ρ (x) dx The integral is evaluated empirically to obtain the following approximate formula for the gain: Example 2. Suppose the density ρ is a Gaussian N (µ , Σ). The observation function h(x) = Hx, where H ∈ R1×d . Then, φ = xT ΣH T and the gain function K = Σ H T is the Kalman gain. In the general non-Gaussian case, the solution is not known in an explicit form and must be numerically approximated. Note that even in the two exact cases, one would need to numerically approximate the solution because the density ρ is not available in an explicit form. The problem statement for numerical approximation is as follows: Z Ki ≡ 1 N N ∑ (h(X j ) − ĥ(N)) X j (14) j=1 where ĥ(N) = N −1 ∑Nj=1 h(X j ). The formula (14) is referred to as the constant gain approximation of the gain function; cf., [31]. It is a popular choice in applications [31,35–37] and is equivalent to the approximation used in the deterministic and stochastic EnKBF [7, 21–24]. Example 3. Consider the linear case where h(x) = Hx. The constant gain approximation formula equals Ki = 1 N N ∑ (HX j − H X̂ (N)) X i = Σ(N) H, j=1 where X̂ (N) := N1 ∑Ni=1 X i and ΣN = N1 ∑Ni=1 (X i − X̂ (N) )(X i − X̂ (N) )T are the empirical mean and the empirical variance, respectively. That is, for the linear Gaussian case, the FPF algorithm with the constant gain approximation gives the deterministic EnKF algorithm. 5.3 Galerkin Approximation The Galerkin approximation is a generalization of the constant gain approximation where the gain function K = ∇φ is now approximated in a finite-dimensional subspace S := span{ψ1 , . . . , ψM }4 . Mathematically, the Galerkin solution ∇φ (M) is defined as the optimal least-square approximation of ∇φ in S, i.e, Algorithm 1 Constant gain approximation Input: {X i }Ni=1 , {h(X i )}Ni=1 , Output: {Ki }Ni=1 , Calculate ĥ(N) = 2: Calculate Kc = N1 ∑Ni=1 (h(X i ) − ĥ(N) ) X i K i = Kc for i = 1, . . . , N 3: φ (M) ∑Ni=1 h(X i ) 1: 1 N 2 = arg min E[|∇φ − ∇ψ | ] ψ ∈S Algorithm 2 Galerkin approximation of the gain function The least-square solution is easily obtained by applying the projection theorem which gives E[∇φ (M) · ∇ψ ] = E[(h − ĥ) ψ ], Input: {X i }Ni=1 , {h(X i )}Ni=1 , {ψ1 , . . . , ψM }, Output: {Ki }Ni=1 , 1: ∀ψ ∈S (15) By denoting (ψ1 (x), ψ2 (x), . . . , ψM (x)) =: ψ (x) and expressing φ (M) (x) = c · ψ (x), the finite dimensional system (15) is expressed as a linear matrix equation 2: (16) where A is a M × M matrix and b is a M × 1 vector whose entries are given by the respective formulae: [A]lk = E[∇ψl · ∇ψk ] [b]l = E[(h − ĥ) ψl ] Example 4. Two types of approximations follow from consideration of two types of basis functions: (i) The constant gain approximation is obtained by taking basis functions as ψl (x) = xl for l = 1, . . . , d. With this choice, A is the identity matrix and the Galerkin gain function is a constant vector: K(x) = Z x (h(x) − ĥ) ρ (x) dx It’s empirical approximation is Ki ≡ 1 N N ∑ (h(X j ) − ĥ(N)) X j j=1 (ii) With a single basis function ψ (x) = h(x), the Galerkin solution is R (h(x) − ĥ)2 ρ (x) dx K(x) = R ∇h(x) |∇h(x)|2 ρ (x) dx is a finite-dimensional subspace in the Sobolev space H01 (Rd ; ρ ) – defined as the space of functions f that are square-integrable with respect to density ρ and whose (weak) derivatives are also square-integrable with respect to density ρ . H01 is the appropriate space for the solution φ of the Poisson equation (10). ∑Ni=1 ψk (X i )(h(X i ) − ĥ(N) ), for k = 1, . . . , M 3: [b(N) ]k := 4: Calculate c(N) by solving A(N) c(N) = b(N) (N) i Ki = ∑M k=1 ck ∇ψk (X ) 5: Ac = b ĥ(N) = N1 ∑Ni=1 h(X i ) [A(N) ]lk := N1 ∑Ni=1 ∇ψl (X i ) · ∇ψk (X i ), for l, k = 1, . . . , M 1 N It’s empirical approximation is obtained as Ki = ∑Nj=1 (h(Xti ) − ĥ(N) )2 ∑Nj=1 |∇h(Xti )|2 ∇h(Xti ) In practice, the matrix A and the vector b are approximated empirically, and the equation (16) solved to obtain the empirical approximation of c, denoted as c(N) (see Table 2 for the Galerkin algorithm). In terms of this empirical approximation, the gain function is approximated as Ki = ∇φ (M,N) (X i ) := c(N) · ∇ψ (X i ) (17) The choice of basis function is problem dependent. In Euclidean settings, the linear basis functions are standard and lead to constant gain approximation as discussed in Example 4. A straightforward extension is to choose quadratic and higher order polynomials as basis functions. However, this approach does not scale well with the dimension of problem: The number of basis functions M scales at least linearly with dimension, and the Galerkin algorithm involves inverting a M × M matrix. This motivates nonparametric and data driven approaches where (a small number of) basis functions can be selected in an adaptive fashion. One such algorithm, proposed in [38], is based on the Karhunen-Loeve expansion. In the next two subsections, alternate data-driven algorithms are described. One advantage of these algorithms is that they do not require a selection of basis functions. 4S 5.4 Kernel-based Approximation The linear operator ρ1 ∇ · (ρ ∇) =: ∆ρ for the pde (10) is a generator of a Markov semigroup, denoted as eε ∆ρ for ε > 0. It follows that the solution φ of (10) is equivalently expressed as, for any fixed ε > 0, φ = eε ∆ ρ φ + Z ε es∆ρ (h − ĥ) ds. 0 (18) N (N) Ki = Then, the for- N ∑ ai j X j (22) j=1 The fixed-point representation is useful because eε ∆ρ can be approximated by a finite-rank operator (N) f (x) := ∑ kε (x, X i ) f (X i ), Tε (N) where ri := φε (X i ) + ε h(X i ) − ε ĥ(N) . mula (21) is succinctly expressed as It is easy to verify that ∑Nj=1 ai j = 0 and as ε → ∞, ai j = N −1 (h(X j ) − ĥ(N) ). Therefore, as ε → ∞, Ki equals the constant gain approximation formula (14). i=1 where the kernel gε (x − y) q 1 (N) kε (x, y) = (N) nε (x) q 1 N ∑Ni=1 gε (x − X i ) 1 N ∑Ni=1 gε (y − X i) is expressed in terms of the Gaussian kernel gε (z) := d 2 (N) d (4πε )− 2 exp (− |z| 4ε ) for z ∈ R , and nε (x) is a normaliza(N) that Tε 1 = 1. tion factor chosen such It is shown in [39,40] (N) that eε ∆ρ ≈ Tε as ε ↓ 0 and N → ∞. The approximation of the fixed-point problem (18) is obtained as (N) φε (N) (N) φε + ε (h − ĥ), = Tε Algorithm 3 Kernel-based approximation of the gain function Input: {X i }Ni=1 , {h(X i )}Ni=1 , Φprev , L Output: {Ki }Ni=1 1: Calculate gi j := exp(−|X i − X j |2 /4ε ) for i, j = 1 to N 2: Calculate ki j := 3: Calculate 4: Calculate 5: Initialize Φi = Φprev,i for i = 1 to N 6: for l = 1 to L do Calculate Φi = ∑Nj=1 Ti j Φ j + ε (h(X i ) − ĥ(N) ) 7: (19) 8: 9: where 0ε es∆ρ (h − ĥ) ds ≈ ε (h − ĥ) for small ε > 0. The method of successive approximation is used to solve the (N) fixed-point equation for φε . In a recursive simulation, the algorithm is initialized with the solution from the previous time-step. The gain function is obtained by taking the gradient of the two sides of (19). For this purpose, it is useful to first define a finite-rank operator: 10: 11: R (N) ∇Tε N (N) f (x) := ∑ ∇kε (x, X i ) f (X i ) i=1 1 = 2ε " N (N) kε (x, X i ) f (X i ) ∑ i=1 i N X −∑ (N) kε (x, X j )X j j=1 !# (20) In terms of this operator, the gain function is approximated as (N) (N) (N) φε (X i ) + ε ∇Tε (h − ĥ(N) )(X i ) Ki = ∇Tε 12: gi j √ for i, j = ∑l gil ∑l g jl k Ti j := ∑ ikj for i, j = 1 to N l il ĥ(N) = N1 ∑Ni=1 h(X i ) √ Calculate Φi = Φi − N1 ∑Nj=1 Φ j end for Calculate ri = Φi + ε (h(X i ) − ĥ(N) )  Calculate ai j = 21ε Ti j r j − ∑Nl=1 Til rl Calculate Ki = ∑Nj=1 ai j X j 5.5 Optimal Coupling-based Approximation Optimal coupling-based approximation is another nonparametric approach to directly approximate the gain function Ki from the ensemble {X i }Ni=1 . The algorithm is presented here for the first time in the context of FPF. This approximation is based upon a continuous-time reformulation of the recently developed ensemble transform for optimally transporting (coupling) measures [7]. The relationship to the gain function approximation is as follows: Define an ε -parametrized family of densities by ρε (x) := ρ (x)(1+ ε (h(x)− ĥ(x))) for ε > 0 sufficiently small and consider the optimal transport problem (21) Objective: (N) where φε on the righthand-side is the solution of (19). For i, j ∈ {1, 2, . . ., N}, denote N 1 (N) (N) ai j := kε (X i , X j ) r j − ∑ kε (X i , X l )rl 2ε l=1 1 to N ! Constraints: min E [|Sε (X) − X|2] Sε X ∼ ρ, (23) Sε (X) ∼ ρε The solution to this problem, denoted as Sε , is referred to as the optimal transport map. It is shown in Appendix B that dSε dε ε =0 = K. Algorithm 4 Optimal Coupling approximation of the gain function Input: {X i }Ni=1 , {h(X i )}Ni=1 , ε Output: {Ki }Ni=1 1: Calculate di j := |X i − X j |2 for i, j = 1 to N 2: Calculate ĥ(N) = N1 ∑Ni=1 h(X i ) Calculate ti j by solving the Linear program (24). 3: 4: 5: (t −δ ) Calculate ai j = i j ε i j for i, j = 1 to N Calculate Ki = ∑Nj=1 ai j X j The ensemble transform is a non-parametric algorithm to approximate the solution Sε of the optimal transportation problem given only N samples X i drawn from ρ . For the problem of gain function approximation, the algorithm involves first solving the linear program: N N Objective: min Constraints: ∑∑ {ti j } i=1 j=1 N 1 , N ∑ ti j = j=1 ti j |X i − X j |2 N ∑ ti j = i=1 1 + ε (h(X j ) − ĥ(N) ) , N (24) The solution, denoted as ti∗j , is referred to as the optimal coupling, where the coupling constants ti∗j have the interpretation of the joint probabilities. The two equality constraints arise due to the specification of the two marginals ρ and ρε in (23) where it is noted that the particles X i are sampled i.i.d. from ρ . The optimal value is an approximation of the optimal value of the objective in (23). The latter is the celebrated Wasserstein distance between ρ and ρε . In terms of the optimal solution of the linear program (24), an approximation to the gain function at X i is obtained as N ∑ ai j X j , j=1 ai j = 1. Galerkin: Algorithm 2 with polynomial basis functions {x, x2 , . . . , xM } for M = 1, 3, 5. The case M = 1 gives the constant gain approximation (Algorithm 1). 2. Kernel: Algorithm 3 with ε = 0.05, 0.1, 0.2 and L = 1000. 3. Optimal coupling: Algorithm 4 with ε = 0.05, 0.1, 0.2. In the first numerical experiment, a fixed number of particles N = 100 is drawn i.i.d from ρ . Figures 4 (a)-(c)-(e) depicts the approximate gain function obtained using the three algorithms. For the ease of comparison, the exact solution is also depicted. In the second numerical experiment, the empirical error is evaluated as a function of the number of particles N. For a single simulation, the error is defined according to Error := ti j ≥ 0. Ki := 6 Numerics This section contains results of numerical experiments where the Algorithms 1-4 are applied on the bimodal distribution problem introduced in Example 1: The density ρ is mixture of two Gaussians N (−1, σ 2 ) and N (+1, σ 2 ) with σ 2 = 0.2 and and h(x) = x. The exact solution is obtained using the explicit formula (13) and is depicted in Fig. 2. The following parameters are used in the numerical implementation of the algorithms: ti∗j − δi j ε , (25) where δi j is the Dirac delta tensor (δi j = 1 if i = j and 0 otherwise). In practice, a finite ε > 0 is appropriately chosen. The approximation becomes exact as ε ↓ 0 and N → ∞. The approximation (25) is structurally similar to the constant gain approximation formula (14) and also the kernel-gain approximation formula (22). In all three cases, the gain Ki at the ith particle is approximated as a linear combination of the particle states {X j }Nj=1 . Such approximations are computationally attractive whenever N ≪ d, i.e., when the dimension of state space is high but the dynamics is confined to a low-dimensional subset which, however, is not a priori known. 1 N ∑ |Kalg (X i ) − Kex(X i )|2 , N i=1 (26) where {X i }Ni=1 are the particles, Kalg is the output of the algorithm and Kex is the exact gain. The Monte-Carlo estimate of the error is evaluated by averaging over 1000 simulations. In each simulation, a new set of particles is sampled which is used as an input consistently for the three algorithms. Figure 4 (b)-(d)-(f) depict the Monte-Carlo estimate of the error as a function of the number of particles. In the third numerical experiment, the effect of varying the parameter ε is investigated for the kernel-based and the optimal coupling algorithms. In this experiment, a fixed number of particles N = 200 is used. Figure 5 depict the Monte-Carlo estimate of the error as a function of the parameter ε . The following observations are made based on the results of these numerical experiments: 1. (Figure 4 (a)-(b)) The accuracy of the Galerkin algorithm improves as the number of basis function increases. For a fixed number of particles, the matrix A becomes poorly conditioned as the number of basis functions becomes large. This can lead to numerical instabilities in solving the matrix equation (16). 2. (Figure 4 (a)-(c)-(d)) The kernel-based and optimal coupling algorithms, preserve the positivity property of the exact gain. The positivity property of the gain is not necesarily preserved in the Galerkin algorithm. The correct sign of the gain is important in filtering applications as the gain determines the direction of drift of the particles. A wrong sign can lead to divergence of the particle trajectories. 8 10 1 Exact M=1 M=3 M=5 7 6 error K 5 M=1 M=3 M=5 4 10 0 3 2 1 0 -4 -3 -2 -1 0 1 2 3 10 -1 4 10 2 x N (a) Galerkin gain approxmiation for N = 100 (b) Galerkin gain approx. error as a function of N 10 1 error ǫ=0.2 ǫ=0.1 ǫ=0.05 10 0 10 -1 (c) Kernel-based gain approximation for N = 100 10 2 N (d) Kernel-based gain approx. error as a function of N 10 1 error ǫ=0.2 ǫ=0.1 ǫ=0.05 10 0 10 -1 (e) Optimal Coupling gain approximation for N = 100 10 2 N (f) Optimal Coupling gain approx. error as a function of N Fig. 4: Comparison of the gain function approximations obtained using Galerkin (part (a)), kernel (part (c)), and the optimal coupling (part (e)) algorithms. The exact gain function is depicted as a solid line and the density ρ is depicted as a shaded region in the background. The parts (b)-(d)-(e) depict the Monte-Carlo estimate of the empirical error (26) as a function of the number of particles N. The Monte-Carlo estimate is obtained by averaging the empirical error over 100 simulations. 3. (Figure 5) For a fixed number of particles, there is an optimal value of ε that minimizes the error for the kernelbased and the optimal coupling algorithms. For the kernel-based algorithm, it is shown in [41] that, for small 1 √ ε and large N, the error scales as O(ε ) + O( ε d/2+1 ). N As ε → ∞, the approximate gain converges to the constant gain approximation. In particular, the error remains bounded even for large values of ε . 4. The optimal coupling algorithm leads to spatially more irregular approximations which nevertheless converge as the number of particles increases. The optimal choice of the parameter ε depends on the particle size. Finally, a spatially more regular approximation could be obtained using kernel dressing, e.g., by convoluting the particle approximation with Gaussian kernels. 7 Conclusion We have summarized an interacting particle representation of the classic Kalman-Bucy filter and its extension variance bias dominates dominates [3] [4] [5] [6] Fig. 5: Comparison of the Monte-Carlo estimate of the empirical error (26) as a function of the parameter ε . The number of particles N = 200. to nonlinear systems and non-Gaussian distributions under the general framework of FPFs. This framework is attractive since it maintains key structural elements of the classic Kalman-Bucy filter, namely, a gain factor and the innovation. In particular, the EnKF has become widely used in data assimilation for atmosphere-ocean dynamics and oil reservoir exploration. Robust extensions of the EnKF to non-Gaussian distributions are urgently needed and FPFs provide a systematic approach for such extensions in the spirit of Kalman’s original work. However, interacting particle representations come at a price; they require approximate solutions of an elliptic PDE or a coupling problem, when viewed from a probabilistic perspective. Hence, robust and efficient numerical techniques for FPF-based interacting particle systems and study of their long-time behavior will be a primary focus of future research. 8 Acknowledgement The first author AT was supported in part by the Computational Science and Engineering (CSE) Fellowship at the University of Illinois at Urbana-Champaign (UIUC). The research of AT and PGM at UIUC was additionally supported by the National Science Foundation (NSF) grants 1334987 and 1462773. This support is gratefully acknowledged. The research of JdW and SR has been partially funded by Deutsche Forschungsgemeinschaft (DFG) through the grant CRC 1114 “Scaling Cascades in Complex Systems”, Project (A02) “Multiscale data and asymptotic model assimilation for atmospheric flows” and the grant CRC 1294 “Data Assimilation”, Project (A02) “Long-time stability and accuracy of ensemble transform filter algorithms”. [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] References [1] Kalnay, E., 2002. Atmospheric Modeling, Data Assimilation and Predictability. Cambridge University Press. [2] Oliver, D., Reynolds, A., and Liu, N., 2008. Inverse theory for petroleum reservoir characterization and [18] [19] history matching. Cambridge University Press, Cambridge. Kitanidis, P., 1995. “Quasi-linear geostatistical theory for inversion”. Water Resources Research, 31, pp. 2411–2419. Burgers, G., van Leeuwen, P., and Evensen, G., 1998. “On the analysis scheme in the ensemble Kalman filter”. Mon. Wea. Rev., 126, pp. 1719–1724. Houtekamer, P., and Mitchell, H., 2001. “A sequential ensemble Kalman filter for atmospheric data assimilation”. Mon. Wea. Rev., 129, pp. 123–136. Julier, S. J., and Uhlmann, J. K., 1997. “A new extension of the Kalman filter to nonlinear systems”. In Signal processing, sensor fusion, and target recognition. Conference No. 6, Vol. 3068, pp. 182–193. Reich, S., and Cotter, C., 2015. Probabilistic Forecasting and Bayesian Data Assimilation. Cambridge University Press, Cambridge, UK. Daum, F., Huang, J., and Noushin, A., 2010. “Exact particle flow for nonlinear filters”. In SPIE Defense, Security, and Sensing, pp. 769704–769704. Daum, F., Huang, J., and Noushin, A., 2017. “Generalized gromov method for stochastic particle flow filters”. In SPIE Defense+ Security, International Society for Optics and Photonics, pp. 102000I–102000I. Ma, R., and Coleman, T. P., 2011. “Generalizing the posterior matching scheme to higher dimensions via optimal transportation”. In Communication, Control, and Computing (Allerton), 2011 49th Annual Allerton Conference on, pp. 96–102. El Moselhy, T. A., and Marzouk, Y. M., 2012. “Bayesian inference with optimal maps”. Journal of Computational Physics, 231(23), pp. 7815–7850. Heng, J., Doucet, A., and Pokern, Y., 2015. “Gibbs Flow for Approximate Transport with Applications to Bayesian Computation”. ArXiv e-prints, Sept. Yang, T., Blom, H., and Mehta, P. G., 2014. “The continuous-discrete time feedback particle filter”. In American Control Conference (ACC), 2014, IEEE, pp. 648–653. Crisan, D., and Xiong, J., 2007. “Numerical solutions for a class of SPDEs over bounded domains”. ESAIM: Proc., 19, pp. 121–125. Crisan, D., and Xiong, J., 2010. “Approximate McKean-Vlasov representations for a class of SPDEs”. Stochastics, 82(1), pp. 53–68. Yang, T., Mehta, P. G., and Meyn, S. P., 2011. “Feedback particle filter with mean-field coupling”. In Decision and Control and European Control Conference (CDC-ECC), 50th IEEE Conference on, pp. 7909– 7916. Yang, T., Mehta, P. G., and Meyn, S. P., 2013. “Feedback particle filter”. IEEE Trans. Automatic Control, 58(10), October, pp. 2465–2480. Blom, H. A. P., 2012. “The continuous time roots of the interacting multiple model filter”. In Proc. 51st IEEE Conf. on Decision and Control, pp. 6015–6021. Bar-Shalom, Y., Daum, F., and Huang, J., 2009. “The [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] probabilistic data association filter”. IEEE Control Syst. Mag., 29(6), Dec, pp. 82–100. Kalman, R. E., 1960. “A new approach to linear filtering and prediction problems”. Journal of basic Engineering, 82(1), pp. 35–45. Law, K., Stuart, A., and Zygalakis, K., 2015. Data Assimilation: A Mathematical Introduction. SpringerVerlag, New York. Reich, S., 2011. “A dynamical systems framework for intermittent data assimilation”. BIT Numerical Analysis, 51, pp. 235–249. Bergemann, K., and Reich, S., 2012. “An ensemble Kalman-Bucy filter for continuous data assimilation”. Meteorolog. Zeitschrift, 21, pp. 213–219. de Wiljes, J., Reich, S., and Stannat, W., 2016. Long-time stability and accuracy of the ensemble Kalman-Bucy filter for fully observed processes and small measurement noise. Tech. Rep. https://arxiv.org/abs/1612.06065, University Potsdam. Del Moral, P., Kurtzmann, A., and Tugaut, J., 2016. On the stability and the uniform propagation of chaos of extended ensemble Kalman-Bucy filters. Tech. Rep. arXiv:1606.08256v1, INRIA Bordeaux Research Center. Kelly, D., Law, K., and Stuart, A., 2014. “Wellposedness and accuracy of the ensemble Kalman filter in discrete and continuous time”. Nonlinearity, 27(10), p. 2579. Kelly, D., and Stuart, A. M., 2016. Ergodicity and accuracy of optimal particle filters for Bayesian data assimilation. Tech. Rep. https://arxiv.org/abs/1611.08761, Courant Institute of Mathematical Sciences. Kelly, D., Majda, A. J., and Tong, X. T., 2015. “Concrete ensemble Kalman filters with rigorous catastrophic filter divergence”. PNAS. Oksendal, B., 2013. Stochastic differential equations: an introduction with applications. Springer Science & Business Media. Zhang, C., Taghvaei, A., and Mehta, P. G., 2016. “Feedback particle filter on matrix Lie groups”. In American Control Conference (ACC), 2016, IEEE, pp. 2723–2728. Yang, T., Laugesen, R. S., Mehta, P. G., and Meyn, S. P., 2016. “Multivariable feedback particle filter”. Automatica, 71, pp. 10–23. Villani, C., 2003. Topics in Optimal Transportation. No. 58. American Mathematical Soc. Evans, L. C., 1997. “Partial differential equations and Monge-Kantorovich mass transfer”. Current developments in mathematics, pp. 65–126. Laugesen, R. S., Mehta, P. G., Meyn, S. P., and Raginsky, M., 2015. “Poisson’s equation in nonlinear filtering”. SIAM J. Control Optim., 53(1), pp. 501–525. Stano, P. M., Tilton, A. K., and Babuška, R., 2014. “Estimation of the soil-dependent time-varying parameters of the hopper sedimentation model: The FPF versus the BPF”. Control Engineering Practice, 24, pp. 67–78. Tilton, A. K., Ghiotto, S., and Mehta, P. G., 2013. “A [37] [38] [39] [40] [41] [42] comparative study of nonlinear filtering techniques”. In Information Fusion (FUSION), 2013 16th International Conference on, pp. 1827–1834. Berntorp, K., 2015. “Feedback particle filter: Application and evaluation”. In 18th Int. Conf. Information Fusion, Washington, DC. Berntorp, K., and Grover, P., 2016. “Data-driven gain computation in the feedback particle filter”. In 2016 American Control Conference (ACC), IEEE, pp. 2711– 2716. Coifman, R. R., and Lafon, S., 2006. “Diffusion maps”. Appl. Comput. Harmon. A., 21(1), pp. 5–30. Hein, M., Audibert, J., and Luxburg, U., 2007. “Graph Laplacians and their convergence on random neighborhood graphs”. J. Mach. Learn. Res., 8(Jun), pp. 1325– 1368. Taghvaei, A., Mehta, P. G., and Meyn, S. P., 2017. “Error estimates for the kernel gain function approximation in the feedback particle filter”. In American Control Conference (ACC), 2017, IEEE, pp. 4576–4582. Xiong, J., 2008. An introduction to stochastic filtering theory, Vol. 18 of Oxford Graduate Texts in Mathematics. Oxford University Press. A Exactness of the Feedback Particle Filter The objective of this section is to describe the consistency result for the feedback particle algorithm (9), in the sense that the posterior distribution of the particle exactly matches the posterior distribution in the mean-field limit as N → ∞. To put this in a mathematical framework, let πt∗ denote the conditional distribution of Xt ∈ X given history (filtration) of observations Zt := σ {Zs , s ≤ t}5 . For a realvalued function f : X → R define the action of πt∗ on f according to: πt∗ ( f ) := E[ f (Xt )|Zt ] The time evolution of πt∗ ( f ) is described by KushnerStratonovich pde (see Theorem 5.7 in [42]), πt∗ ( f ) =π0∗ ( f ) + + Z t 0 Z t 0 πs∗ (L f ) ds (πs∗ ( f h) − πs∗( f )πs∗ ( f )) ( dZs − πs∗ (h) ds) (27) where f ∈ Cc∞ (X ) (smooth functions with compact support), and L f := a(x) · ∇ f (x) + 1 d ∂2 f (x) σk (x)σl (x) ∑ 2 k,l=1 ∂ xk ∂ xl Next define πt to be the conditional distribution of Xti ∈ X given Zt . It’s action on real-valued function is defined 5 The state space X is Rd in this paper but the considerations of this section also apply when X is a differential manifold. Proof. Using (27) and (28) it is sufficient to show the following two identities: according to: πt ( f ) := E[ f (Xti )|Zt ] The time evolution of πt ( f ) is described by the FokkerPlanck equation (see Proposition 1 in [31]): πt ( f ) =π0 ( f ) + + Z t 0 Z t 0 πs (L f ) ds + πs (u · ∇ f ) ds + 1 2 Z t Z t 0 0 πs (K · ∇ f ) dZs πs (K · ∇(K · ∇ f )) ds (28) where K is the gain function and u is the control function as follows: 1) Gain function: Let φ ∈ H 1 (X ; πt )6 be the solution of a (weak form of the) Poisson equation:   πt ∇φ · ∇ψ = πt (h − πt (h))ψ πt (φ ) = 0 (mean-zero) 2) Control function: The function u(x,t) =  − 12 K(x,t) h(x) + πt (h) . The existence-uniqueness of the gain function K requires additional assumptions on the distribution πt and the function h. (i) Assumption A1: The probability distribution πt admits a spectral gap. That is , ∃ λ > 0 such that for all functions f ∈ H01 (X , πt ), πs (u · ∇ f ) = −πs ( where in the last step the weak form of the Poisson equation (29) is used for the ψ = K · ∇ f and ψ = f . This concludes the second identity and hence the Theorem. B Relationship of gain function to the optimal transport map Let Sε be the optimal transport map, solution of the problem (23). It is known that this map is of a gradient form [32]. In the following we furthermore assume that the map Sε =: ∇Φε is C1 in the parameter ε . For any test function ψ Cε = Under the Assumptions (A1) and (A2) the Poisson equation (29) has a unique solution φ ∈ H01 (X , πt ) and the resulting control and gain function will be admissible [31]. The consistency of the feedback particle filter is stated in the following Theorem. Theorem 1. Let πt∗ and πt satisfy the forward equations (27) and (28), respectively. Then assuming π0∗ = π0 , we have: πt∗ ( f ) = πt ( f ) (30) for all t ∈ [0, T ] and all functions f ∈ Cc∞ (Rd ). ; ρ ) is the Sobolev space of functions on X that are squareintegrable with respect to density ρ and whose (weak) derivatives are also square-integrable with respect to density ρ . h + πs(h) K·∇f) 2 1 = − πs ((h − πs (h))K · ∇ f ) − πs(h)πs (K · ∇ f ) 2 1 = − (K · ∇(K · ∇ f )) − πs(h)πs ((h − πs(h)) f ) 2 1 πt (|∇ f |2 ) λ for t ∈ [0, T ]. (ii) Assumption A2: The function h ∈ L2 (X ; πt ), the space of square-integrable functions with respect to πt . 6 H 1 (X The first identity is obtained by using K = ∇φ and the weak form of the Poisson equation (29) with ψ = f . The second identity is obtained similarly. Use the expression for the control function u to obtain, (29) for all ψ ∈ H 1 (X ; πt ). The gain function K(x,t) = ∇φ (x). πt (| f |2 ) ≤ πs (K · ∇ f ) = πs ( f h) − πs ( f )πs (h) 1 πs (u · ∇ f ) + πs (K · ∇(K · ∇ f )) = − (πs ( f h) − πs ( f )πs (h)) πs (h) 2 Z ψ (∇Φε (x))ρ (x) dx − Z ψ (x)ρε (x) dx ≡ 0 Therefore, dCε dε = ε =0 Z Z ∇φ (x)·∇ψ (x)ρ (x) dx− (h(x)− ĥ)ψ (x)ρ (x) dx = 0 ε where φ := dΦ dε ε =0 . This is the weak form of the Poisson equation (10). Therefore, K = ∇φ = dSε dε ε =0
3cs.SY
IEEE Transactions on Ultrasonics, Ferroelectrics, and Frequency Control, vol. 59, no. 12, December 2012 Adaptive vibration suppression system: An iterative control law for a piezoelectric actuator shunted by a negative capacitor Miloš Kodejška,1 Pavel Mokrý,1, 2, ∗ Václav Linhart,1 Jan Václavı́k,1, 2 and Tomáš Sluka3 1 Institute of Mechatronics and Computer Engineering, Technical University of Liberec, CZ-46117 Liberec, Czech Republic 2 Research Centre for Special Optics and Optoelectronic Systems (TOPTEC), Sobotecká 1660, CZ-51101 Turnov, Czech Republic arXiv:1206.3806v2 [cs.CE] 18 Feb 2014 3 Ceramics Laboratory, Swiss Federal Institute of Technology (EPFL), CH-1015 Lausanne, Switzerland (Dated: January 23, 2018) Abstract An adaptive system for the suppression of vibration transmission using a single piezoelectric actuator shunted by a negative capacitance circuit is presented. It is known that using negative capacitance shunt, the spring constant of piezoelectric actuator can be controlled to extreme values of zero or infinity. Since the value of spring constant controls a force transmitted through an elastic element, it is possible to achieve a reduction of transmissibility of vibrations through a piezoelectric actuator by reducing its effective spring constant. The narrow frequency range and broad frequency range vibration isolation systems are analyzed, modeled, and experimentally investigated. The problem of high sensitivity of the vibration control system to varying operational conditions is resolved by applying an adaptive control to the circuit parameters of the negative capacitor. A control law that is based on the estimation of the value of effective spring constant of shunted piezoelectric actuator is presented. An adaptive system, which achieves a self-adjustment of the negative capacitor parameters is presented. It is shown that such an arrangement allows a design of a simple electronic system, which, however, offers a great vibration isolation efficiency in variable vibration conditions. Keywords: Piezoelectric actuator, Vibration transmission suppression, Piezoelectric shunt damping, Negative capacitor, Elastic stiffness control, Adaptive device ∗ Electronic address: [email protected] 1 I. INTRODUCTION Vibration suppression is nowadays regarded as an important issue in many technical fields ranging from robust aerospace industry to delicate nanotechnology. Unsuppressed vibrations are traditionally the key source of noise pollution, aging of mechanical components or even life-threatening fatal failures of transport vehicles, machining instruments, etc. Also in micro- and nanotechnology, the progress relies on high precision devices, which essentially require efficient vibration control. Contemporary vibration control techniques are based mostly on (i) passive methods using elements such as viscoelastic dampers and springs, or (ii) conventional active feedback and feed-forward control principles. The passive methods are rather inexpensive and do not require an external source of energy, but they are bulky and inefficient at low frequencies. On the other hand the conventional active methods can achieve an excellent efficiency with a subtle device, but on the expense of high technical complexity, high costs, and lower reliability. There is necessarily a gap between the conventional passive and active vibration control methods, which would balance advantages of both approaches: especially a high efficiency (also at low frequencies) and a low cost. A promising new approach has emerged with so called semi-active methods, which have been heralded as the dawn of a new era in vibration control methods. However, it did not happen and yet most suggested semi-active methods remain confined in research laboratories. In this article, we present a study of the semi-active vibration suppression method, which uses a piezoelectric bulk actuator. The vibration suppression effect is achieved: first, by inserting a piezoelectric actuator between vibrating structure and an object that is being isolated from vibrations, and, second, by connecting the piezoelectric actuator to an active external shunt circuit that controls the effective elastic stiffness of the actuator. The aforementioned method for a suppression of vibration transmission was introduced by Hagood and von Flotow [1] and, later [2], it was named as Piezoelectric Shunt Damping (PSD). During last two decades, extensive amount of work have been published on PSD method. Examples to be mentioned here are passive[3, 4] and active [5–7], broadband multi-mode [4, 8, 9], and, adaptive [9–11] noise and vibration control devices. In a vast majority of the mentioned publications and many others, the classical control theory is used for a description 2 and analysis of noise and vibration suppression systems. An alternative approach was offered by Date et al. [12], who discovered that the effect of the shunt circuit on the mechanical response of the piezoelectric actuator can be explained through the change of effective elastic properties of a piezoelectric actuator. When an actuator is inserted between a source of vibrations and an object that is being isolated from vibrations, the resonant frequency and the transmissibility of vibrations through a resulting spring-mass system depends on the spring constant of the actuator and the mass of the object. The reduction of the piezoelectric actuator spring constant results in the reduction of resonant frequency and transmissibility of vibrations at super-resonant frequencies. Therefore, the physics lying behind the vibration suppression effect in PSD method is in principle the same as in the passive methods. On top of that, PSD method enables the efficient vibration suppression at low frequencies, too. Such a principal change in the concept offers a use of alternative and simpler design tools in the development of noise and vibration suppression devices. The design of vibration control systems can be reduced to, first, the study of elasticity effect on the noise or vibration transmission and, second, to the realization of Active Elasticity Control. Early applications that followed this simple approach [13–17] demonstrated the great potential of this method, which stems from (i) the simplicity of the noise control system, which consists of a selfsensing piezoelectric actuator connected to an active shunt circuit, (ii) an implementation of active shunt circuit electronics using a simple analog circuit with a single linear power amplifier that allows a significant reduction of the electric power consumption, and (iii) the broad frequency range (e.g. from 10 Hz to 100 kHz) where the system can efficiently suppress vibrations. Despite the potential advantages of the PSD method, high sensitivity and low stability of real systems currently prevents their industrial exploitation, which often requires a system robustness under varying operational conditions. It was actually shown by Sluka et al. [18] that the optimal working point of the PDS system lies just on the edge of the system stability. Later, the stability of several PSD method implementations has been compared in the work by Preumont et al. [19]. A partial elimination of the drawbacks was achieved by adaptive PSD vibration control systems reported in Refs. [18, 20], however, with a strong limitation that the stable vibration isolation efficiency could be achieved only in a narrow frequency range. 3 The aforementioned issues have motivated the work presented below, where we will address the design of an adaptive broad-band vibration control device. The principle of our vibration suppression device will be presented in Sec. II. In Sec. III we will demonstrate advantages and drawbacks of a narrow and broad frequency range vibration isolation device with manually adjusted negative capacitor. Design of the adaptive broad-band vibration isolation device will be presented in Sec. IV. There, in addition, we will present previously unpublished details of control law, which was used to obtain results presented in Refs. [18, 20]. Conclusions of our experiments will be presented in Sec. V. II. PRINCIPLE OF THE VIBRATION SUPPRESSION It is known that the vibration transmission through an interface between two solid objects is mainly controlled by the ratio of their mechanical impedances. Since the mechanical impedance is proportional to the material stiffness, extremely soft element placed between two other objects works as an interface with high transmission loss of vibrations. In the following Subsection, we present a simple theoretical model that explains the effect of the elasticity in a mechanical system on the transmission of vibrations through the system. Later, we present a method to control the elastic properties of the piezoelectric actuator using a shunt electric circuit that can be profitably used in the vibration isolation system. A. Effect of the spring constant on the transmissibility of vibrations Scheme of the vibration isolation measurement system is shown in Fig. 1(a). The vibration damping element with a spring constant K and a damping coefficient B is placed between the shaker and the object of a mass M that is going to be isolated from vibrations. The incident and transmitted vibrations of a displacement amplitudes u1 and u2 , respectively, are measured using accelerometers. The transmissibility of vibrations T R through the considered vibration isolation system is defined as a ratio of the transmitted over the incident displacement amplitudes at the reference source point: TR = |u2 /u1 | (1) The transmissibility of vibration is a function of material parameters that control the dynamic response of the mechanical system. The dynamic response of the system is governed 4 ACCELEROMETER PIEZOELECTRIC ACTUATOR MASS M u2 DAMPING ELEMENT Zs u1 B K KEFF ACCELEROMETER NEGATIVE CAPACITOR ZNC SHAKER a) b) FIG. 1: Scheme of the vibration isolation measurement system. The vibration damping element with a spring constant K and a damping coefficient B are placed between the shaker and a mass M that is going to be isolated from vibrations. The incident vibrations of a displacement amplitude u1 and the transmitted vibrations of a displacement amplitude u2 are measured using accelerometers (a). The vibration damping element used in this work is the piezoelectric actuator of the impedance ZS shunted by a negative capacitor of the impedance ZNC . (b) by the following equation of motion: M d2 u 2 du1 du2 + Ku2 = B + Ku1 . 2 +B dt dt dt (2) Considering the simplest case of the transmission of harmonic vibrations of an angular frequency ω, the solution of Eq. (2) yields the formula: s ω 2 + Q2 ω 20 TR = ω 0 2, ω 2 ω 20 + Q2 (ω 20 − ω 2 ) (3) √ where the symbols Q and ω 0 stand for the mechanical quality factor Q = KM /B and p the resonance frequency ω 0 = K/M. It is seen that the smaller the value of spring constant K, the smaller the value of the resonant frequency ω 0 , and the smaller the value of transmissibility T R of harmonic vibrations of angular frequency ω > ω 0 . B. Method of the active control of piezoelectric actuator elasticity Figure 1(b) shows the vibration damping element used in this work, which is a piezoelectric actuator of capacitance CS shunted by a negative capacitor of capacitance C. This 5 system is an example of so called Active Elasticity Control method introduced in 2000 by Date et al. [12]. The effective spring constant of a piezoelectric actuator Keff can be derived from the constitutive equations for charge Q and change of length ∆l = u2 − u1 of a piezoelectric actuator: Q = dF + CS V, (4) ∆l = (1/KS )F + dV, (5) which are appended by the formula for a voltage V applied back to the piezoelectric actuator from a shunt circuit of capacitance C: V = −Q/C, (6) where symbols d, CS , and KS stand for the piezoelectric coefficient, capacitance, and spring constant of a mechanically free piezoelectric actuator, respectively. Combining Eqs. (4), (5), and (6) and with the use of relationship between the capacitance and impedance of a capacitor, Z = 1/(jω C), one can readily obtain the formula for the effective spring constant of a piezoelectric actuator connected to an external shunt circuit with an electric impedance Z:   F 1 + ZS /Z Keff = , = KS ∆l 1 − k 2 + ZS /Z (7) where k 2 = d2 KS /CS is the electromechanical coupling factor of the piezoelectric element (0 < k < 1) and ZS is the electric impedance of a mechanically free piezoelectric actuator. It follows from Eq. (7) that, when the complex impedance of the shunt circuit Z approaches the value of −ZS , the effective spring constant Keff of the piezoelectric element reaches zero. Figure 2 shows the electrical scheme of the piezoelectric actuator shunted by the active circuit that effectively works as with a negative capacitance. It will be further referenced as a negative capacitor. Effective impedance of the negative capacitor shown in Fig. 2 is equal to Z(ω ) = R1 + R2 R0 + R2 + Au (ω )R2 Z1 (ω ) ≈ R1 − Z1 (ω ), R0 + R2 − Au (ω )R0 R0 (8) where Au is the output voltage gain of the operational amplifier and R3 − jω C0 R32 R3 = Z1 (ω ) = 1 + jω C0 R3 1 + ω 2 C02 R32 6 (9) NEGATIVE CAPACITOR R3 Z1 PIEZOELECTRIC ACTUATOR C0 R1 R0 ADJUSTABLE RESISTORS FIG. 2: R2 Electrical scheme of the piezoelectric actuator shunted by a negative capacitor. The negative capacitor is designed using a simple circuit with an operational amplifier in a feedback loop. By use of adjustable resistors R0 and R1 , it is possible to adjust the real and imaginary part of its capacitance, so that it matches the capacitance of the piezoelectric actuator (except the sign). is the impedance of so called reference capacitance of the negative capacitor. The approximate formula on the right-hand side of Eq. (8) stands for the ideal operational amplifier, i.e. Au goes to infinity. It is known that real and imaginary parts of the piezoelectric actuator capacitance practically do not depend on frequency in the frequency range below its resonance frequency. In this situation, the capacitance of the piezoelectric actuator can be approximated with a high accuracy by the formula CS′ (1 − j tan δS ), where CS′ and tan δS are the real part and loss tangent of the piezoelectric actuator capacitance. Then, the impedance of the piezoelectric actuator is equal to ZS (ω ) = jω CS′ (1 tan δS − j 1 = . − j tan δS ) ω CS (1 + tan2 δS ) (10) It is convenient to approximate the frequency dependence of the piezoelectric actuator impedance by the frequency dependence of the in-series connection of the capacitor and resistor of capacitance CS and resistance RS , respectively. ZS (ω ) ≈ RS + 1 . jω CS (11) At given critical frequency ω 0 , it is possible to adjust the negative capacitor in such a 7 way that: |Z| (ω 0 ) = |ZS | (ω 0 ), (12a) arg[Z(ω 0 )] = arg[ZS (ω 0 )] + π. (12b) Such a situation is characterized by the relation ZS (ω 0 )/Z(ω 0 ) = −1 and, according to Eq. (7), it yields Keff that is effectively reaching zero value and the transmission of vibrations reaches minimum. C. Role of impedance matching In this subsection, we analyze to what extent the condition given by Eqs. (12) must be satisfied, in order to achieve required suppression of vibration transmission. Such an analysis can be split into two steps. First, we analyze the sensitivity of transmissibility T R to the value of spring constant of the actuator K, and, second, we analyze the sensitivity of the effective spring constant of the actuator Keff to the capacitance C of the negative capacitor. In order to perform the first step of the analysis, it is convenient to express the suppression level of the transmissibility of vibrations ∆LTR , which is produced by the active elasticity control using the negative capacitor: ∆LTR = 20 (log T RN C − log T RS ) , (13) where T RN C and T RS are the transmissibility of vibrations given by Eq. (3) in situations, where the shunt circuit is connected and disconnected from the piezoelectric actuator, respectively. For small values of spring constant K and for frequencies above the resonant frequency of the system ω0 , it is possible to express the suppression level of the transmissibility of vibrations in the form: ∆LTR ≈ 10 log |Keff /KS | , (14) where the Keff is the effective spring constant of the actuator, which is controlled by the negative capacitor. In the second step, it is convenient to denote ∆Z = Z − (−ZS ) as a deviation of the impedance Z of the negative capacitor from the required value −ZS . Then for small deviations ∆Z, it is possible to approximate Eq. (7) by a formula: Keff ≈ KS ∆Z/ k 2 Zs  (15) 8 40 Impedance phase (rad) Transmissibility (dB) 0.00 Negative capacitor: Off: Model Experiment On: Model Experiment Model (Adjustment 2) Model (Adjustment 3) 20 0 -20 Piezoelectric actuator Negative capacitor (Adjustment 1) Negative capacitor (Adjustment 2) Negative capacitor (Adjustment 3) -0.79 -1.57 -2.36 a) c) 1.2 Piezoelectric actuator Negative capacitor adjustments: 0=2.43kΩ, 1=6.86Ω, 0=2 kHz (1) 0=2.19kΩ, 1=9.86Ω, 0=1.7 kHz (2) 0=2.69kΩ, 1=4.36Ω, 0=2.46 kHz (3) 40 35 30 1.0 0.8 Keff/KS (1) Impedance abs. value (Ω) 45 25 20 0.4 0.0 10 -0.2 6 7 8 9 2 3 -0.4 6 7 1000 b) Imaginary part 0.2 15 5 Real part Adjustment 1 Adjustment 2 Adjustment 3 0.6 8 9 2 3 1000 d) Frequency (Hz) Frequency (Hz) FIG. 3: Frequency dependences of the physical quantities that controls the value of transmissibility of vibrations through the piezoelectric actuator shunted by the negative capacitor shown in Fig. 2: a) shows the comparison of the measured values of the transmissibility of vibrations through the electrically free piezoelectric actuator (filled circles) and the piezoelectric actuator shunted by the negative capacitor adjusted at the frequency f0 = 2 kHz (empty circles); the measured values of the transmissibility of vibrations are compared with the calculated ones from the theoretical model; b) absolute value of the electric impedance of the piezoelectric actuator (measured) and the negative capacitor for three different adjustments of resistors R0 and R1 (calculated); c) phase of the electric impedance of the piezoelectric actuator (measured) and of the negative capacitor (calculated and subtracted by π); d) calculated real and imaginary parts of the effective spring constant of the piezoelectric actuator shunted by the negative capacitor. From Eq. (14), it can be estimated that a decrease in the level of transmissibility of vibrations ∆LTR by about 20 dB requires a decrease in the effective value of the spring constant K by a factor of 1/100. Then, considering the values of the electromechanical coupling factor of conventional piezoelectric ceramics, i.e. k 2 = 0.1, one can conclude from Eq. (15) that the relative deviation of the negative capacitor impedance δZ = ∆Z/ZS from its required value −ZS must be smaller than 0.1%. This very narrow region of capacitances of the negative capacitor, in which the required values of the spring constant are achieved, imposes high 9 requirements on the negative capacitor adjustment. It is clear that required adjustment of the negative capacitor cannot be achieved with fixed values of resistors R0 and R1 due to limited number of commercially available values and the continuously adjustable trimmers must be used. In the next two Sections, there are presented experimental results acquired on the vibration isolation systems with manual and adaptive adjustment of the negative capacitor III. MANUAL ADJUSTMENT OF THE NEGATIVE CAPACITOR In the next subsection, we will present and discuss the experimental data measured on the vibration isolation device with the negative capacitor shown in Fig. 2. A. Narrow frequency range vibration isolation First, the frequency dependence of the transmissibility of vibrations through the electrically free piezoelectric actuator, i.e. the actuator, which was disconnected from the negative capacitor, was measured in the frequency range from 550 Hz to 3 kHz and the result is indicated by filled circles in Fig. 3(a). The measured frequency dependences of the transmissibility of vibrations were compared with predictions of the theoretical formula given by Eq. (3). Values of spring constant KS = 7.11 · 107 Nm−1 , mass M = 1.67 kg and the mechanical quality factor of the piezoelectric actuator Q = 11.3 were obtained using the method of least squares. In the next step, the negative capacitor was assembled using LF 356N operational amplifier according to scheme shown in Fig. 2. The output voltage gain of LF 356N was approximated by the function Au (ω0 ) = A0 /(1 + jω/(2πf1)), where A0 = 105 dB and f1 = 100 Hz. The condition given by Eqs. (12) is achieved by setting the values of resistances R1 and R0 according to following formulae: ω 20 C0 CS R2 R32 , R0 = 1 + ω 2 C02 R32 1 − RS . R1 = 2 ω C0 CS R3 (16a) (16b) In order to find the proper adjustment of the negative capacitor, the frequency dependence of the electric impedances of the piezoelectric actuator and the reference capacitance Z1 10 R3 R3 C0 CX RX C0 (a) FIG. 4: (b) Electrical scheme of the reference impedance Z1 inside the negative capacitor, which is shown in Fig. 2, for a narrow frequency range (a) and a broad frequency range vibration isolation system (b). were measured using HP 4195A spectrum analyzer and shown in Figs. 3(b) and (c). Using the least squares method, following values were obtained: RS = 1.150 Ω, CS = 6.602 µF, R3 = 27.84 Ω, and C0 = 4.686 µF. These values were cross-checked by direct measurements on ESCORT ELS-3133A LRC-meter at 1 kHz: RS = 0.87 Ω, CS = 6.94 µF, R3 = 24.5 Ω, and C0 = 5.16 µF. Then, resistance R2 = 2.40 kΩ was measured and the negative capacitor resistors were pre-adjusted to values R0 = 2.41 kΩ and R1 = 6.93 Ω according to Eqs. (16). Afterwards, the trimmers R0 and R1 in the negative capacitor were finely tuned in order to achieve 20 dB decrease in the transmissibility of vibration at 2 kHz, as indicated by empty circles in Fig. 3(a). The measured transmissibility of vibrations was fitted to the theoretical model given by Eqs. (3), (8), (9), and (11). Following values were obtained using the method of least squares: k 2 = 0.064, R0 = 2.43 kΩ, and R1 = 6.86 Ω. The direct measurement, using the LRC-meter, resulted in following values: R0 = 2.32 kΩ and R1 = 6.20 Ω, respectively. Here, it should be noted that the relative difference between fitted and measured values of resistances varies from 5% to 11%. This relative difference is much larger than 0.1% allowed relative difference between the negative capacitor and piezoelectric actuator capacitances. The reason for such a difference is the presence of parasitic capacitances in the system, which makes theoretical modeling of piezoelectric shunt damping systems difficult and adjustment of negative capacitors from such theoretical models practically impossible. The physics standing behind the decrease in the transmissibility of vibrations in a narrow frequency range can be easily understood by looking at Fig. 3. Figures 3(b) and (c) show the comparison of the measured electric impedance absolute value and phase of the piezoelectric actuator with the calculated values of the electric impedance absolute value and phase of the negative capacitor for three adjustments that differ in values of resistances R0 , R1 , and 11 40 Experiment Experiment Experiment Impedance phase (rad) Transmissibility (dB) 0.00 Negative capacitor: Off: Model Narrow: Model Broad: Model 20 0 -20 Piezoelectric actuator Negative Capacitor (broad band) Negative Capacitor (narrow band) -0.79 -1.57 -2.36 a) c) 1.5 Piezoelectric actuator Negative Capacitor (broad band) Negative Capacitor (narrow band) 40 35 1.0 0.5 30 Keff/KS (1) Impedance abs. value (Ω) 45 25 20 Real part Narrow band Broad band -1.0 15 Imaginary part -1.5 10 5 0.0 -0.5 6 7 8 9 2 3 -2.0 6 7 1000 b) 8 9 2 3 1000 d) Frequency (Hz) Frequency (Hz) FIG. 5: Frequency dependences of the physical quantities that control the value of transmissibility of vibrations through the piezoelectric actuator shunted by the negative capacitor shown in Fig. 2: a) shows the comparison of the measured values of the transmissibility of vibrations through the electrically free piezoelectric actuator (filled circles), through the piezoelectric actuator shunted by the narrow frequency range negative capacitor adjusted at f0 = 2 kHz (empty circles), and the broad frequency range negative capacitor adjusted at f0 = 2 kHz (empty triangles). The measured values of the transmissibility of vibrations are compared with the theoretical model; b) absolute value of the electric impedance of the piezoelectric actuator (measured) and the negative capacitor for the narrow frequency range (see Fig. 4a) and broad frequency range (see Fig. 4b) reference impedance Z1 ; c) phase of the electric impedance of the piezoelectric actuator (measured) and the negative capacitor (calculated and subtracted by π); d) calculated real and imaginary parts of the effective spring constant of the piezoelectric actuator shunted by the negative capacitor. the critical frequency f0 . Figures 3(b) and (c) indicate that conditions given by Eqs. (12) are satisfied only in narrow frequency ranges around particular critical frequencies f0 . This is a reason for narrow frequency ranges, where a decrease in the real part of the effective spring constant Keff of the piezoelectric actuator can be achieved as indicated in Fig. 3(d). The next Subsection discusses the problem of broadening the frequency range where the vibration isolation device can efficiently suppress the vibration transmission. 12 Transmissibility suppr. (dB) 5 Manual adjustment Adaptive adjustment 0 -5 -10 -15 -20 -25 0 1 2 3 4 5 6 Time (min.) FIG. 6: Comparison of the time dependences of the vibration isolation efficiency in changing operational conditions in the system with manually adjusted negative capacitor (solid line) and in the system with adaptively controlled negative capacitor (dashed line), respectively. The vibration isolation system was turned on at the time 1 min. Then, the ambient temperature of the system was changed. There is seen approximately 15 dB decrease in the suppression level of the transmissibility of vibrations [see Eq. (13)] after 5 minutes in the system with manually adjusted negative capacitor, while the suppression level of the transmissibility of vibrations remains constant in the adaptive vibration isolation system. B. Broad frequency range vibration isolation In order to broaden the frequency range of the efficiently suppressed vibration transmission, it is necessary to achieve a precise matching the electrical impedances of the piezoelectric actuator and the negative capacitor. Since the frequency dependence of the piezoelectric actuator is controlled by its material and its construction, it is necessary to modify the frequency dependence of the negative capacitor. The frequency dependence of the negative capacitor impedance is determined by the reference impedance Z1 . The trivial parallel connection of the capacitor C0 and the resistor R3 , which is shown in Fig. 4(a), was replaced by a more complicated RC network shown in Fig. 4(b). Values of capacitances and resistances in the reference impedance Z1 were adjusted to minimize the mismatch between values of Z1 and ZS in the frequency range from 0.5 kHz to 3 kHz. The frequency dependence of the electric impedance of the modified reference capacitance Z1 was measured and the method of least squares yields the values: R3 = 15.09 kΩ, C0 = 480 nF, RX = 44.6 Ω, and CX = 807 nF. The fitted values were cross-checked by a 13 0 2.91 -p p R1/R1,min R1/R1,min j1 j0 R0/R0,min R0/R0,min ′ ′′ (a)|Keff + iKeff | FIG. 7: ′ ′′ (b)arg (Keff + iKeff ) Contour plots of absolute value (a) and argument (b) of the effective spring constant Keff of piezoelectric actuator shunted by the negative capacitor shown in Fig. 2 as functions of the resistances R0 and R1 . The values of R0 and R1 are normalized by values R0,min and R1,min , ′ + iK ′′ . respectively, which yield the zero absolute value of the effective spring constant Keff = Keff eff direct measurements using LRC-meter at 1 kHz giving values: R3 = 15 kΩ, C0 = 470 nF, RX = 44 Ω, and CX = 813 nF. Then, the trimmers R0 and R1 in the negative capacitor were finely tuned in order to achieve the maximum decrease in the transmissibility of vibrations at the frequency 2 kHz. Then the transmissibility of vibration through the piezoelectric actuator shunted by a broadfrequency-range-optimized negative capacitor was measured and the result is indicated by empty triangles in Fig. 5(a). It can be seen that a 20 dB decrease in the transmissibility of vibration was achieved in the broad frequency range from 1 kHz to 2 kHz. The measured values of the frequency dependence of the transmissibility of vibrations were compared with the theoretical model given by Eqs. (3), (8), (9) and (11), and the values of k 2 = 0.067, R0 = 12.6 kΩ, and R1 = 2.6 Ω using the method of least squares. The reason for broadening the frequency range can be seen in Fig. 5. Figures 5(b) and (c) show the comparison of the measured frequency dependence of the electric impedance absolute value and phase of the piezoelectric actuator with the calculated values of the electric impedance of the negative capacitor with the narrow and broad frequency range reference capacitances Z1 shown in Fig. 4(a) and (b). In Figs. 5(b) and (c), it is seen that the electric impedances of the piezoelectric actuator and the negative capacitor reference capacitance are close to each other in the broad frequency range. Figure 5(d) shows the 14 frequency dependence of the real and imaginary parts of the effective Young’s modulus. It should be noted that the decrease in the Young’s modulus in broad frequency range results in a decrease in the resonant frequency of the system by approximately 400 Hz. This yields an increase in the transmissibility of vibrations in sub-resonant frequencies. IV. ADAPTIVE SYSTEM FOR THE VIBRATION ISOLATION An important issue accompanied with the vibration isolation system with manually adjusted negative capacitor is shown in Fig. 6. The solid line shows the time dependence of the vibration isolation efficiency in changed operational conditions in the system with manually adjusted negative capacitor. The vibration isolation system was turned on at a time “1 minute” and the decrease in the transmissibility of vibrations by the 20 dB was achieved. Then, the piezoelectric actuator was exposed to a slight heat irradiation from 100 W bulb (tungsten lamp), which was placed in a distance of 25 cm. There is seen approximately 15 dB decrease in the suppression level of the transmissibility of vibrations [see Eq. (13)] after 5 minutes. To avoid the severe deteriorative effect of changing operational conditions on the vibration isolation efficiency, the adaptive vibration isolation system has been implemented. The next Subsection describes the principle of the control algorithm. A. Iterative control law A simple control algorithm can be formulated using the analysis of contour plots of the absolute value and argument of, in general complex, effective spring constant Keff of the piezoelectric actuator that is shunted by the negative capacitor. The negative capacitor is shown in Fig. 2 as functions of resistances R0 and R1 . Such plots with values R0 and R1 normalized by values R0,min and R1,min , respectively, are shown in Fig. 7. The values R0,min and R1,min represent the optimal values of resistances in the negative capacitor that yield the zero absolute value of the effective spring constant. One can see that the absolute value of Keff reaches zero for R0 /R0,min = 1 and R1 /R1,min = 1. A more interesting graph is shown ′ ′′ in Fig. 7(b) for the argument of the effective spring constant Keff = Keff + iKeff . One can see that the value of arg(Keff ) monotonically increases as the point (R0 , R1 ) goes around 15 the optimal adjustment (R0,min , R1,min ) in the counter-clockwise direction, as indicated by the arrow. Thus, one can immediately determine in which “direction” is the optimal adjustment (R0,min , R1,min ) with respect to its immediate value (R0 , R1 ) by measuring the argument of Keff , i.e. ϕ = arg(Keff ). Using this principle, it is possible to formulate the iterative control algorithm as follows:    R + ∆R0   0,n R0,n+1 = R0,n − ∆R0     R0,n + ∆R0   R + ∆R 1,n 1 R1,n+1 =  R1,n − ∆R1 for ϕ < ϕ0 , for ϕ0 < ϕ < ϕ0 + π, (17a) for ϕ0 + π < ϕ, for ϕ < ϕ1 , for ϕ > ϕ1 . (17b) Symbols R0,n+1 , R0,n and R1,n+1 , R1,n are the “new” and “old” values of resistances R0 and R0 , respectively. Values ∆R0 and ∆R1 are the resistance increments achievable in the negative capacitor. Symbols ϕ0 and ϕ1 stand for the critical values of arg(Keff ) indicated in Fig. 7(b). The particular values of ϕ0 and ϕ1 should be usually determined experimentally. In the next Subsection, the simple way for the estimation of the complex value of effective spring constant is presented. B. Estimation of the effective spring constant The effective value of the spring constant is given by the ratio of the transmitted force F through the piezoelectric actuator over it elongation ∆l, see Eq. (7). The transmitted force can be easily measured using a piezoelectric force sensor. The actuator elongation can be estimated using the following idea. When the negative capacitor is close to its required optimal adjustment, the transmitted force through the piezoelectric actuator is very small. When the transmitted force F is small, it follows from Eq. (5) that first term on the right-hand-side of Eq. (5), i.e. (1/KS ) F , is much smaller than the second term, i.e. dV . In this situation, the elongation of the piezoelectric actuator is dominated by the inverse piezoelectric effect and, thus, it is proportional to the voltage applied from the negative capacitor, i.e. ∆l ∝ V . In order to estimate the argument of the effective spring constant, it is sufficient to calculate the phase difference between the signal from the force sensor F and the voltage V 16 ACCELEROMETER 2 u2 MASS M FORCE SENSOR NEGATIVE CAPACITOR FORCE SENSOR ACCELEROMETER 2 ACCELEROMETER 1 PC PIEZOELECTRIC ACTUATOR 1 2 3 4 NI-DAQ PIEZOELECTRIC ACTUATOR DAC-OUT Z1 R1 R2 POWER AMP. R0 u1 ACCELEROMETER 1 SHAKER SHAKER FIG. 8: Combined system for the measurement of transmissibility of vibration through the adaptive vibration isolation system is shown on the right-hand side. The measurement part of the system consists of two accelerometers. The vibration isolation part of the system consists of a piezoelectric actuator shunted by an electronically adjustable negative capacitor. Electronic scheme of the combined system is shown on the left-hand side. Signals from accelerometers are used to calculate the transmissibility of vibrations. A signal from the force sensor and applied voltage from the negative capacitor are used for the estimation of the effective spring constant Keff of the shunted piezoelectric actuator. The estimated value of the argument of Keff is used for calculation of corrections to the values of resistances of electronically adjustable resistors R0 and R1 . applied from the negative capacitor: arg (Keff ) ≈ arg F − arg V. C. (18) Implementation of the adaptive vibration isolation system The above described control algorithm has been implemented in the adaptive vibration isolation system, which is shown in Fig. 8. Due to implementation convenience, the dataacquisition part of the adaptive vibration isolation system was combined with the system for the measurement of vibration transmissibility. Nevertheless, these two systems were independent. The adaptive vibration isolation system consists of a force sensor and a piezoelectric actuator shunted by an electronically controlled negative capacitor. The force sensor was realized as a piezoelectric plate with a charge amplifier Kistler 5015A. Such an arrangement 17 requires a calibration, which is done prior experiments in the setup without the damping element. The transfer function of the force sensor is determined using a mass of the object and the signal from the output accelerometer. This is simple and fast arrangement that allows precise force measurements up to high frequencies. The signal from the force sensor and applied voltage from the negative capacitor are used for the estimation of the effective spring constant Keff of the shunted piezoelectric actuator. The estimated value of the argument of Keff is used for the calculation of corrections to values of resistances of electronically adjustable resistors R0 and R1 according to Eqs. (17). In order to make the electronic control of resistances R0 and R1 in the negative capacitor possible, the manually adjusted trimmers were replaced by electronically controlled resistors, which were implemented as a pair of a light-emitting diode and a photoresistor. Example of the measured volt-ohm characteristics of the electronically adjustable resistor is shown in Fig. 9. The voltage VC controls the current through the diode and, therefore, the intensity of the emitted light, using a voltage-to-current converter. The intensity of the generated light controls the resistance Ra of the photoresistor. Instantaneous values of the incident and transmitted vibrations are measured by piezoelectric accelerometers PCB-352. These accelerometers have the resonant frequency at 40 kHz, which ensures a flat and phase correct transmission function in the frequency range of our experiments. Signals from the accelerometers are amplified by ICP amplifier. Electric signals from the accelerometers 1 and 2, force sensor, and the electric voltage applied to the piezoelectric actuator from the negative capacitor are measured and digitized by the data acquisition card NI PCI-6221. It should be stressed that accelerometers are a part of the measurement system only. They are used to measure the transmissibility of vibrations and to evaluate the efficiency of the adaptive vibration isolation system. Accelerometers are not used for the control of the vibration transmission. Signals from accelerometers do not enter the negative capacitor shunt and they are not used in the iterative control law. Personal computer (PC) is used for three independent (but simultaneous) operations: First, it is used for the generation of the signal of the incident vibrations. In the Matlab software, a pseudo-random signal with few dominant harmonic components is generated. The output signal from the PC is introduced to the high-voltage amplifier and fed to the piezoelectric shaker. Second, PC processes signals from accelerometers and calculates the frequency dependence of the transmissibility of vibrations. Third, PC processes the signals 18 (k ) 7 Voltage controlled resistor 6 Vc Resistance a " 5 Ra V/I Ω 4 3 2 1 0 2 4 Control voltage 6 C 8 10 (V) FIG. 9: Example of the measured volt-ohm characteristics of the electronically adjustable resistor, which is constructed as a pair of a light-emitting diode and a photoresistor. The voltage VC controls the current through the diode and, therefore, the intensity of the emitted light, using a voltage-to-current converter. The intensity of the generated light controls the resistance Ra of the photoresistor. from the force sensor and from the negative capacitor and generates control signals for electronically adjustable resistors in the negative capacitor according to the iterative control law. The transmissibility of vibrations with harmonic time dependence of frequency 2 kHz through the adaptive vibration isolation system is shown using dashed line in Fig. 6. It is seen that the transmissibility of vibrations remained constant even under varying operational conditions (i.e. ambient temperature). However, it should be noted that in the situation, where vibrations have harmonic time dependence, the estimation of effective spring constant argument is a straightforward and easy task. On the other hand, the consideration of harmonic vibrations greatly limits the applicability of the vibration isolation device. In order to eliminate this drawback and to broaden the applicability of the above described adaptive vibration isolation system, a modification of the control algorithm is necessary. This is described in the next Subsection. D. Suppression of vibrations with a general time dependence In real situations, the incident vibrations usually consist of the sum of several randomly changing dominant harmonic components. These harmonic components appear in the system due to the eigen-frequencies of mechanical parts or due to vibration of revolving mechan19 ical parts. In order to suppress the vibration transmission between the vibrating mechanical parts in real industrial applications, following modification to the control algorithm was implemented. First, signals from the force sensor and voltage applied from the negative capacitor are measured. If the amplitude of the signal from the force sensor exceeds some arbitrarily chosen threshold, the Fast Fourier Transformation is applied to the time dependencies of the measured signals in order to obtain their amplitude and phase frequency spectra. Then the distribution of the vibration power along the frequency axis is analyzed and the dominant harmonic component with the greatest amplitude is found. This dominant harmonic component is selected to be suppressed. At the selected frequency of the dominant harmonic component, the phase difference between the dominant harmonic components in the signals from the force sensor and from the negative capacitor output is calculated. The calculated value of the phase difference is used for the iterative corrections of the values of resistances R0 and R1 according to Eqs. (17). After application of corrections to values of resistances R0 and R1 , new time-dependences of signals from the force sensor and the negative capacitor output are measured and the above steps are periodically repeated until the dominant frequency is suppressed in the force sensor signal under a measurable level. In order to evaluate the performance of the adaptive broad band vibration suppression device, five different vibration signals were generated and applied to the vibration isolation device. The vibration signal consists of a random noise and one dominant harmonic component of given frequency. Figure 10 shows spectra of five force signals transmitted through the vibration isolation system with different frequencies of the dominant harmonic component. Solid black line indicates the force amplitude spectra transmitted through the piezoelectric actuator disconnected from the negative capacitor. The zero-filled solid blue lines indicate the amplitude spectra of the force transmitted through piezoelectric actuator shunted by the self-adjusted broad-frequency-range-matched negative capacitor. The frequency dependences of the transmissibility of vibrations through the piezoelectric actuator shunted by the adaptive broad frequency range negative capacitor, which was self-adjusted to the five aforementioned vibration signals, are shown in Fig. 11. It is seen that the adaptive control algorithm adjusts the negative capacitor in such a way that the transmissibility of vibration curve has its minimum around the frequency of the dominant harmonic component in the vibration signal. Figure 11 also indicates shifts of the mechanical 20 0.15 Dominant harmonic component frequency: = 1.20 kHz NC off NC on 0.10 0.05 0.00 0.15 Dominant harmonic component frequency: = 1.50 kHz 0.10 0.05 Force amplitude (a.u.) 0.00 0.20 Dominant harmonic component frequency: = 2.00 kHz 0.15 0.10 0.05 0.00 0.15 Dominant harmonic component frequency: = 2.25 kHz 0.10 0.05 0.00 0.15 Dominant harmonic component frequency: = 2.50 kHz 0.10 0.05 0.00 6 7 8 9 2 3 1000 Frequency (Hz) FIG. 10: Spectra of the five force signals transmitted through the vibration isolation system with different frequencies of the dominant harmonic component. Solid black line indicates the force amplitude spectra transmitted through the piezoelectric actuator disconnected from the negative capacitor. The zero-filled solid blue lines indicates the amplitude spectra of the force transmitted through piezoelectric actuator shunted by the self-adjusted broad-frequency-range-matched negative capacitor. The vibration signal consists of a random noise and one dominant harmonic component of given frequency. resonant frequency of the system by more than 300 Hz, which is due to the reduction of the effective spring constant of the piezoelectric actuator using the negative capacitor in the broad frequency range. This yields an increase in the transmissibility of vibrations in subresonant frequencies. Such an unwanted phenomenon can be easily eliminated by inserting high-pass filter in the negative capacitor. 21 Negative capacitor off Self-adjusted negative capacitor: = 1.20 kHz = 1.50 kHz = 2.00 kHz = 2.25 kHz = 2.50 kHz Transmissibility (dB) 40 20 0 -20 6 7 8 9 2 3 1000 Frequency (Hz) FIG. 11: Frequency dependences of the transmissibility of vibrations through the piezoelectric actuator shunted by the adaptive broad-frequency-range-matched negative capacitor. Each curve corresponds the transfer functions of the adaptive system adjusted to cancel the vibration signal with the force amplitude spectra shown in Fig. 10. It should be noted that the decrease in the Young’s modulus in broad frequency range results in a decrease in the resonant frequency of the system by more than 300 Hz. This yields an increase in the transmissibility of vibrations in subresonant frequencies. Finally, it should be noted that the iterative control algorithm can conveniently compensate the effects of dielectric nonlinearity of piezoelectric actuator. The point is that with an increase in the amplitude of the incident vibrations, the voltage applied from the operational amplifier is also increased (more or less proportionally to the increase in the incident vibration amplitude). Then, the permittivity (and capacitance) of the piezoelectric actuator seen from the negative capacitor is slightly changed due to a dielectric nonlinearity (usually according to the Rayleigh law). This causes maladjustment of the system and unwanted drop in the efficiency of the vibration isolation. However, if the change in the amplitude of the incident vibration is not extremely fast, so that the system remains stable, the iterative control algorithm quickly compensates the changes in the piezoelectric actuator capacitance. The same behavior is expected even at full voltage range of the actuator, which can be achieved in systems with a standard high-voltage amplifier presented e.g. in the work by Fleming and Moheimani [21]. 22 V. CONCLUSIONS The theoretical model of the vibration transmission through a piezoelectric actuator shunted by a negative capacitor is presented. The model has been verified using experiments performed on a narrow frequency (pure tone) vibration isolation. By a proper modification of the reference capacitor in the negative capacitor, it was successfully demonstrated that it is possible to achieve the vibration transmission suppression by 20 dB in the broad frequency range (from 1 kHz to 2 kHz). The iterative control law for automatic adjustment of the negative capacitor was disclosed using analyzing the absolute value and argument of the effective spring constant of the piezoelectric actuator shunted by a negative capacitor. A method for real-time estimation of the effective spring constant argument in the vibration isolation system was presented. However, the adaptive system in its basic arrangement is applicable only to the suppression of vibrations with harmonic time dependences. In order to eliminate this drawback, more evolved signal processing was implemented. It was shown that the iterative control algorithm is applicable also to vibrations with a general time dependence. The advantages of the presented system for the suppression of vibration transmission stem from its simple electronic realization using an analog circuit with an operational amplifier, broad frequency range of the efficiently suppressed vibrations from 0.5 kHz to 3 kHz, and a simple control law that allows applying the automatic corrections to the negative capacitor, so that the system can work under varying operating conditions. In addition, the presented adaptive system is an example of a general concept of adaptive piezoelectric shunt damping, which can be easily modified and applied to a variety of different types of piezoelectric actuators and other electroacoustic transducers. All in all, the presented realization of the vibration isolation device offers a solution for many real noise and vibration problems. Aknowledgments This work was supported by Czech Science Foundation Project No.: GACR 101/08/1279, co-financed from the student grant SGS 2012/7821 Interactive Mechatronics Systems Using the Cybernetics Principles, and the European Regional Development Fund and the Ministry of Education, Youth and Sports of the Czech Republic in the Project No. 23 CZ.1.05/2.1.00/03.0079: Research Center for Special Optics and Optoelectronic Systems (TOPTEC). The authors acknowledge Julie Volfová for reading the manuscript. [1] N. W. Hagood and A. von Flotow, “Damping of structural vibrations with piezoelectric materials and passive electrical networks,” Journal of Sound and Vibration, vol. 146, pp. 243–268, Apr. 1991. [2] S. O. R. Moheimani and A. J. Fleming, Piezoelectric Transducers for Vibration Control and Damping. 2006. [3] M. S. Tsai and K. W. Wang, “On the structural damping characteristics of active piezoelectric actuators with passive shunt,” Journal of Sound and Vibration, vol. 221, no. 1, pp. 1–22, 1999. [4] L. Petit, E. Lefeuvre, C. Richard, and D. Guyomar, “A broadband semi passive piezoelectric technique for structural damping,” in Smart Structures And Materials 2004: Damping And Isolation (Wang, KW, ed.), vol. 5386 of Proceedings of the Society of Photo-optical Instrumentation Engineers (SPIE), pp. 414–425, 2004. [5] R. A. Morgan and K. W. Wang, “Active-passive piezoelectric absorbers for systems under multiple non-stationary harmonic excitations,” Journal of Sound and Vibration, vol. 255, pp. 685–700, Aug. 2002. [6] R. Morgan and K. Wang, “An active-passive piezoelectric absorber for structural vibration control under harmonic excitations with time-varying frequency, part 1: Algorithm development and analysis,” Journal of Vibration And Acoustics-Transactions of the ASME, vol. 124, pp. 77–83, JAN 2002. [7] J. Q. Ming Yuan, Hongli Ji and T. Ma, “Active control of sound transmission through a stiffened panel using a hybrid control strategy,” Journal of Intelligent Material Systems and Structures, vol. 23, pp. 791–803, 2012. [8] S. Behrens, A. Fleming, and S. Moheimani, “A broadband controller for shunt piezoelectric damping of structural vibration,” Smart Materials & Structures, vol. 12, pp. 18–28, FEB 2003. [9] D. Niederberger, A. Fleming, S. Moheimani, and M. Morari, “Adaptive multi-mode resonant piezoelectric shunt damping,” Smart Materials & Structures, vol. 13, pp. 1025–1035, OCT 2004. [10] A. Fleming and S. Moheimani, “Adaptive piezoelectric shunt damping,” Smart Materials & 24 Structures, vol. 12, pp. 36–48, FEB 2003. [11] A. Badel, G. Sebald, D. Guyomar, M. Lallart, E. Lefeuvre, C. Richard, and J. Qiu, “Piezoelectric vibration control by synchronized switching on adaptive voltage sources: Towards wideband semi-active damping,” Journal of the Acoustical Society Of America, vol. 119, pp. 2815– 2825, MAY 2006. [12] M. Date, M. Kutani, and S. Sakai, “Electrically controlled elasticity utilizing piezoelectric coupling,” Journal of Applied Physics, vol. 87, no. 2, pp. 863–868, 2000. NIC. [13] P. Mokrý, E. Fukada, and K. Yamamoto, “Noise shielding system utilizing a thin piezoelectric membrane and elasticity control,” Journal of Applied Physics, vol. 94, no. 1, pp. 789–796, 2003. [14] P. Mokrý, P., E. Fukada, and K. Yamamoto, “Sound absorbing system as an application of the active elasticity control technique,” Journal of Applied Physics, vol. 94, no. 11, pp. 7356–7362, 2003. [15] K. Imoto, M. Nishiura, K. Yamamoto, M. Date, E. Fukada, and Y. Tajitsu, “Elasticity control of piezoelectric lead zirconate titanate (pzt) materials using negative-capacitance circuits,” Japanese Journal of Applied Physics, vol. 44, no. 9B, pp. 7019–7023, 2005. [16] K. Tahara, H. Ueda, J. Takarada, K. Imoto, K. Yamamoto, M. Date, E. Fukada, and Y. Tajitsu, “Basic study of application for elasticity control of piezoelectric lead zirconate titanate materials using negative-capacitance circuits to sound shielding technology,” Japanese Journal of Applied Physics, vol. 45, no. 9B, pp. 7422–7425, 2006. [17] H. Kodama, M. Date, K. Yamamoto, and E. Fukada, “A study of sound shielding control of curved piezoelectric sheets connected to negative capacitance circuits,” Journal of Sound and Vibration, vol. 311, pp. 898–911, APR 8 2008. [18] T. Sluka and P. Mokrý, “Feedback control of piezoelectric actuator elastic properties in a vibration isolation system,” Ferroelectrics, vol. 351, pp. 51–61, 2007. 8th European Conference on Applications of Polar Dielectrics (ECAPD-8), Metz, FRANCE, SEP 05-08, 2006. [19] A. Preumont, B. de Marneffe, A. Deraemaeker, and F. Bossens, “The damping of a truss structure with a piezoelectric transducer,” Computers & Structures, vol. 86, pp. 227–239, FEB 2008. II ECCOMAS Thematic Conference on Smart Structures and Materials, Lisbon, PORTUGAL, JUL 18-21, 2005. [20] T. S. Sluka, H. Kodama, E. Fukada, and P. Mokrý, “Sound shielding by a piezoelectric 25 membrane and a negative capacitor with feedback control,” IEEE Transactions on Ultrasonics, Ferroelectrics, and Frequency Control, vol. 55, pp. 1859–1866, AUG 2008. [21] A. J. Fleming and S. O. R. Moheimani, “Improved current and charge amplifiers for driving piezoelectric loads, and issues in signal processing design for synthesis of shunt damping circuits,” Journal of Intelligent Material Systems and Structures, vol. 15, no. 2, pp. 77–92, 2004. 26
5cs.CE
Transfer Learning for Deep Learning on Graph-Structured Data Jaekoo Lee, Hyunjae Kim, Jongsun Lee, Sungroh Yoon arXiv:1611.04687v2 [cs.NE] 5 Dec 2016 Electrical and Computer Engineering Seoul National University Seoul 08826, Republic of Korea [email protected] Abstract Graphs provide a powerful means for representing complex interactions between entities. Recently, new deep learning approaches have emerged for representing and modeling graphstructured data while the conventional deep learning methods, such as convolutional neural networks and recurrent neural networks, have mainly focused on the grid-structured inputs of image and audio. Leveraged by representation learning capabilities, deep learning-based techniques can detect structural characteristics of graphs, giving promising results for graph applications. In this paper, we attempt to advance deep learning for graph-structured data by incorporating another component: transfer learning. By transferring the intrinsic geometric information learned in the source domain, our approach can construct a model for a new but related task in the target domain without collecting new data and without training a new model from scratch. We thoroughly tested our approach with large-scale real-world text data and confirmed the effectiveness of the proposed transfer learning framework for deep learning on graphs. According to our experiments, transfer learning is most effective when the source and target domains bear a high level of structural similarity in their graph representations. Introduction Recently, many deep neural network models have been adopted successfully in various fields (LeCun, Bengio, and Hinton 2015; Schmidhuber 2015). In particular, convolutional neural networks (CNN) (Krizhevsky, Sutskever, and Hinton 2012) for image and video recognition and recurrent neural networks (RNN) (Sutskever, Vinyals, and Le 2014) for speech and natural language processing (NLP) often deliver unprecedented levels of performance. Deep learning has also triggered advances in implementing human-level intelligence (e.g., in the game of Go (Silver et al. 2016)). CNN and RNN extract data-driven features from input data (e.g., image, video, and audio data) structured in typically low-dimensional regular grids (see Fig. 1, top). Such grid structures are often assumed to have statistical characteristics (e.g., stationarity and locality) to facilitate the modeling process. Learning algorithms then take advantage of this assumption and boost performance by reCopyright c 2017, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. ducing the complexity of parameters (Schmidhuber 2015; Bruna et al. 2013; Henaff, Bruna, and LeCun 2015). In reality, there exist a wide variety of data types in which we need more general non-grid structures to represent and model complex interactions among entities. Examples include social media mining and protein interaction studies. For such applications, a graph can provide a natural way of representing entities and their interactions (Deo 2016). For graph-structured input, it is more challenging to find the statistical characteristics that can be assumed for gridstructured input (Bruna et al. 2013; Henaff, Bruna, and LeCun 2015). Theoretical challenges including the above and practical limitations, such as data quantity/quality and training efficiency, make it difficult to apply conventional deep learning approaches directly, igniting research on adapting deep learning to graph-structured data (Bruna et al. 2013; Henaff, Bruna, and LeCun 2015; Jain et al. 2015; Li et al. 2015). In many graph analysis methods, the structural properties derived from input graphs play a crucial role in uncovering hidden patterns (Koutra, Vogelstein, and Faloutsos 2013; Lee, Kim, and Yoon 2015). The representation learning capability of deep networks is useful for automatically detecting data-driven structural features, and deep learning approaches have reported promising results. In this paper, we attempt to advance deep learning for graph-structured data by incorporating another key component: transfer learning (Pan and Yang 2010). By overcoming the common assumption that training and test data should be drawn from the same feature space and distribution, transfer learning between task domains can alleviate the burden of collecting data and training models for a new task. Given the importance of structural characteristics in graph analysis, the core of our proposal is to transfer the data-driven structural features learned by deep networks from a source domain to a target domain, as informally shown in Fig. 1 (bottom). In the context of graphs, we call the transferred information the intrinsic geometric information. Starting from this intuitive baseline, we need to fill in many details to implement transfer learning for deep learning on graph data. In particular, we need to answer two important questions: (Q1) under what condition can we expect a successful knowledge transfer between task domains and (Q2) how do we actually perform the transfer most effec- Domain Input Hidden layers High-dimensional graph structure space Low-dimensional grid structure space Convolution Output Fully connected Pooling … … Convolution on graphs ≈ f Pooling Fully connected … F … Graph spectrum transform by graph Laplacian By transfer learning of intrinsic geometric information Figure 1: Conventional CNN works on a regular grid domain (top); proposed transfer learning framework for CNN, which can transfer intrinsic geometric information obtained from a source graph domain to a target graph domain (bottom). tively? This paper tries to address these questions. To demonstrate the effectiveness of our approach, we tested it with large-scale public NLP datasets for text classification (Zhang, Zhao, and LeCun 2015). Each dataset contained a corpus of news articles, Internet reviews, or ontology entries. We represented a dataset (e.g., Amazon reviews) with a graph to capture the interactions among the words in the dataset. We then used the spectral CNN (SCNN) (Bruna et al. 2013; Henaff, Bruna, and LeCun 2015) to model the graph using neural networks. The learned model can be used for classifying unseen texts from the same data source (Amazon). Furthermore, our experimental results confirmed that our transfer learning methodology allows us to implicitly derive a model for classifying texts from another source (e.g., Yelp reviews) without collecting new data and without repeating all the learning procedures from scratch. Our specific contributions can be summarized as follows: • We proposed a new transfer learning framework for deep learning on input data in non-grid structure such as graphs. To the best of the authors’ knowledge, this work is the first attempt of its kind. Adopting our approach will relieve the burden of re-collecting data and re-training models for related tasks. • To address Q1, we investigated the conditions for successful knowledge transfers between graph domains. We conjectured that two graphs with similar structural characteristics would give better results and confirmed it by comparing graph similarity and transfer learning accuracy. • To answer Q2, we tested diverse alternatives to the components of the proposed framework: graph generation, input representation, and deep network construction. In particular, to improve the SCNN model for extracting datadriven structural features from graphs, we analyzed and optimized the key factors that affect the performance of SCNN (e.g., the method to quantify spectral features of a graph). • We performed an extensive set of experiments, using both synthetic and real-world data, to show the effectiveness of our approach. Related Work Graphs can provide a general way of representing the diverse interactions of entities and have been studied extensively (Sonawane and Kulkarni 2014). In addition to studies on representation and quantification of relations and similarities (Koutra, Vogelstein, and Faloutsos 2013), various studies focused on large-scale graph data and use of structural information. Recently, deep learning methods to automatically extract structural characteristics from graphs have been proposed (Duvenaud et al. 2015; Li et al. 2015). Examples of deep learning applied to non-grid, nonEuclidean space include graph wavelets from applying deep auto-encoders to graphs and using the properties of automatically extracted features (Rustamov and Guibas 2013), analysis of molecular fingerprints of proteins saved as graphs (Duvenaud et al. 2015), and a CNN-based model for handling tree structures in the context of programming language processing (Mou et al. 2016). Particularly relevant to our approach is the localized SCNN model (Boscaini et al. 2015), which is a deep learning approach that can extract the properties of deformable shapes. The generalized SCNN model (Bruna et al. 2013; Henaff, Bruna, and LeCun 2015), a key component of our framework, borrowed the Fourier transform concept from the signal processing field in order to apply CNNs in a grid domain to a graph-structured domain. In this model, the convolutional operation was re-defined for graphs. More recently, the restricted Boltzmann machine (LeCun, Bengio, and Hinton 2015) was used to learn structural features from graphs in an unsupervised manner for classification (Niepert, Ahmed, and Kutzkov 2016). For efficient and scalable semi-supervised classification of graph-structured data, the first-order approximation of spectral graph convolutions was utilized (Kipf and Welling 2016). Our method could adopt these approaches as its base learning model to improve the effectiveness of transfer learning. Proposed Method Fig. 2 presents a diagram illustrating the overall flow of the proposed method, which consists of five steps, A–E. The first three steps are to produce a graph from input and to identify unique structural features from the graph. The last two steps are to apply transfer learning based on the learned features and graph similarity to carry out inference. Step A: Graph Production We represent data elements of input data and their interactions and relations as nodes and edges, respectively, in a graph. From an input dataset, we construct an undirected, connected, and weighted graph G = (V, E, A), where V and E represent the sets of vertices and edges, respectively, and A denotes the weighted adjacency matrix. Assume that |V | = N and |E| = M . We utilize two recent techniques to derive a graph (more specifically, the edge set E) from input data: co-occurrence graph estimation (CoGE) (Sonawane and Kulkarni 2014) and supervised graph estimation (SGE) (Henaff, Bruna, and LeCun 2015). CoGE directly quantifies the closeness of data elements based on the frequency of co-occurrence, while SGE automatically learns a similarity features among elements through a fully connected network model. B: Representation of Graphs in Spectral Domain We extract the intrinsic geometric characteristics of the entire graph by deriving (non-)normalized Laplacian matrix L of the graph constructed in step A. For a graph domain, L provides the values for graph spectral bases in the convolution operation of SCNN (Mohar 1997; Koutra, Vogelstein, and Faloutsos 2013). We consider three types of L: the non-normalized Laplacian (Lbasic ), the random walk-based normalized Laplacian (Lrw ), and the random walk with restart based normalized Laplacian (Lrwr ) given by (Tong, Faloutsos, and Pan 2006): Lbasic = D − A (1) Lrw = D−1 (D − A) = I − D−1 A rwr L −1 2 = [I +  D − A] 2 2 ≈ [I − A] ≈ I + A +  A + · · · (2) −1 (3) (4) where D represents the degree matrix1 of the graph, and  represents the probability of restart. Note that the approximation in Eq. (3) is attained by attenuating neighboring influence, while the approximation in Eq. (4) is attained by belief propagation and its fast approximation. L is a symmetric matrix that can be decomposed through the diagonalization by combining eigenvalues λl and the 1 A diagonal matrix that shows the degree (i.e., the number of edges attached) of each node. corresponding orthogonal eigenvectors ul (n), where l is the order of an eigenvalue, and n ∈ [1, N ] is the index of a node (Mohar 1997). Recall that a function f : V 7→ R defined on the nodes of graph G can be represented by a vector f ∈ RN with the n-th dimension of f indicating the value at the n-th vertex in V (Shuman et al. 2013; Shuman, Ricaud, and Vandergheynst 2016). As in the Fourier transform, the eigenfunctions of L represent the function f defined by the nodes PN −1 ˆ ˆ in the graph: fG (n) = l=0 fG (λl )ul (n) ↔ fG (λl ) = PN ˆ n=1 fG (n)ul (n), where f , the transformed function of f , is represented by a set of basis eigenvectors. The Parseval’s theorem also holds (i.e., the energy of the transformed function is the same as that of the original function), and hf, gi = hfˆ, ĝi for two functions f and g, verifying the consistency between the two domains (Chung 1997; Shuman, Ricaud, and Vandergheynst 2016). This indicates that an input function defined on the vertex domain of a graph can be converted into the corresponding graph spectral domain by using the concept of Fourier analysis on graphs. The generalized convolutional operation (denoted by ∗G ) of functions f and g can be defined by the diagonalized linear multiplication in the spectral domain as follows (Bruna et al. 2013; Henaff, Bruna, and LeCun 2015; Shuman, Ricaud, and Vandergheynst 2016): (f ∗G g)(n) = N −1 X fˆ(λl )ĝ(λl )ul (n) l=0 which can also be expressed as  ĝ(λ0 ) . . .  .. .. f ∗G g = ĝ(L)f = U  . . 0 ... 0 .. .   T U f ĝ(λN −1 ) (5) where U is a matrix having the eigenvectors of the graph Laplacian in its columns that quantify the intrinsic structural geometry of the entire graph domain and serve as the spectral bases of a graph. This matrix functions as the Fourier transform into the graph spectral domain. In this regard, a receptive filter learned through the convolution operation in a convolution layer of a CNN in a regular grid domain can be regarded as a matrix on g, which is diagonalized by ĝ(λi ) (0 ≤ i ≤ N − 1) elements on input f defined in the graph domain provided by Eq. (5). For conventional CNNs, the j-th output xk+1,j from the k-th layer is defined as   φk−1 X Fk,i,j ∗ xk,i  , j = 1, . . . , φk (6) xk+1,j = h  i=1 where φk is the number of feature maps, xk is the input of k-th layer, h is a nonlinear function, and Fk,i,j is the filter matrix from the i-th feature map to the j-th feature map. For the SCNN, the transform of input xk of size n × φk−1 n n n CoGE /SGE Input in source domain (Data set A) n n n n n n n n n n n n n n n n CoGE /SGE Input in target domain (Data set B) … Layers on model n n n n n n … Output n n n n n Fully connected n n n Pooling n n n (D) Learning transferable features Convolution on Graph n n n Graph Laplacian n n (C) Applying convolution networks to graph n (A) Producing graph Solid line: training process Dotted line: transfer learning process (B) Representation of graphs in spectral domain (E) Transfer learning in spectral domain Figure 2: Overview of the proposed method. into output xk+1 of size n × φk is given by   φk−1 X xk+1,j = h U Fk,i,j U T xk,i  , j = 1, . . . , φk (7) i=1 where h is a nonlinear function, and Fk,i,j is a diagonal matrix. This implies that training the weights of learnable filters are the same as training the multipliers on the eigenvalues of the Laplacian (Bruna et al. 2013; Henaff, Bruna, and LeCun 2015). This characterizes the SCNN, a generalized CNN model that has several filter banks through generalized convolutional operations on a graph. We augment the SCNN model so that it can support spatial locality, which is made independent of input size by using windowed smoothing filters. They are defined as PK k P̂k (l) = k=0 ak λl for K < N , based on the polynomial kernel ak with degree K (Shuman, Ricaud, and Vandergheynst 2016). This is based on the fact (originally observed in signal processing) that the smoothness in the spectral domain can have spatial decay or local features in the original domain. We implement this idea using the eigenvectors of the subsampled Laplacian as the low-frequency eigenvectors of the Laplacian (Boscaini et al. 2015). C: Applying Convolutional Networks to Graphs We train the SCNN model by using the information obtained through the previous steps to represent the geometric information of local behaviors from the surface of a structural graph domain. The model has a hierarchical structure consisting of layers for convolutional and pooling, and a fully connected layer as shown in Fig. 2. The training determines the weights of each layer by minimizing the task-specific cost (loss) function. The model can learn various data-driven features by re-defining the convolution operation with the spectral information of the structural graph domain (Bruna et al. 2013; Henaff, Bruna, and LeCun 2015). D: Learning Transferable Features Once the model training is completed, it contains datadriven features for the graph-structured data derived from the input in steps A and B. As stated in Introduction, the core of our proposal is to transfer the information on structural characteristics of a graph learned by deep learning. The features learned in step C provide this information. E: Transfer Learning in Spectral Domain According to (Pan and Yang 2010), a domain in the context of transfer learning consists of a feature space X and a probability distribution P (X), where X ∈ X . Given a domain D = {X , P (X)}, we can denote a task by T = {Y, f (·)} with a label space Y and a predictive function f (·) that is learned from training data {x, y} where x ∈ X and y ∈ Y. The objective of general transfer learning is then to improve learning fT (·) in the target domain DT by exploiting the knowledge in the source domain DS and task TS . In the present context, we transfer the intrinsic geometric information learned from the graph GS encoding the knowledge in DS and TS in steps A–D. We skip the steps to generate GT for TT in DT as well as the steps to extract the structural characteristics therefrom. Under the condition that GS and GT bear structural similarities, we can directly build a model for TT by (1) copying the convolutional and pooling layers that contain the features trained for TS in DS , and by (2) training the fully connected layer of the model for fine tuning weights for TT in DT . This way of transfer learning provides efficiency in learning and also helps to minimize the problems resulting from lack of data and imperfect structural information for the new task. Note that the proposed method guarantees the spectral homogeneity of graphs by using the union of node sets on the heterogeneous source and target datasets. In our method, it is possible to utilize the spectral features of graphs from heterogeneous datasets. Table 1: Details of the real-world datasets used Train Test #class Name AG DBP YELP AMAZ AG DBP YELP AMAZ 120, 000 7, 600 4 560, 000 70, 000 14 580, 000 38, 000 2 3, 600, 000 400, 000 2 ∗ † sim(G1 , G2 ) [corr(wv1 , wv2 ) ] 0.37[0.45] 0.37[0.45] 0.28[0.36] 0.35[0.42] 0.23[0.29] 0.33[0.40] 0.28[0.36] 0.23[0.29] 0.35[0.42] 0.33[0.40] 0.50[0.58] 0.50[0.58] AG: a corpus of news articles on the web; DBP: ontology data from DBpedia; YELP: reviews from Yelp; AMAZ: reviews from Amazon. ∗ sim(G1 , G2 ) = 0 indicates that two graphs G1 and G2 are structurally complementary, whereas the value of 1 means that they are identical. † corr(wv1 , wv2 ) represents the correlation between the log-normalized bag of words extracted from each of the text corpora. Results and Discussion We tested the proposed method by performing topic classification of text documents. Text data carry information on not only individual words but also on their relationships, and graph-based methods are widely used for text mining. We utilized large-scale public NLP data (Zhang, Zhao, and LeCun 2015), which contained multiple corpora of news articles, Internet reviews, or ontology entries (Table 1). For controlled experiments, we also generated two pairs of synthetic datasets by random sampling of the real corpora. One pair consisted of two corpora with high similarity, and the other pair consisted of two corpora with low similarity. For measuring the structural similarity between graphs, as shown in Table 1 and Fig. 3, we used the methods reported by existing studies (Koutra, Vogelstein, and Faloutsos 2013; Lee, Kim, and Yoon 2015); refer to the note below Table 1 for more details. Note that YELP and AMAZ bear the highest similarity in terms of the metrics used. We implemented the deep networks with Torch and Cuda using AdaGrad as the optimizer and ReLU as the activation. We carried out 10-fold cross validation. Note that the proposed method can offer an efficient training scheme with relatively low computation cost of O(n2.376 ) by leaving out the eigenvalue decomposition on the SCNN and re-using the model trained by the data in the source domain. In our experiments, the proposed method provided more than 10% reduction in the average training time. Using the above setting, we first carried out comprehensive experiments to determine what factors affected the performance of the SCNN model for graph modeling. Table 2 lists part of the results we obtained by varying the net architecture, the method to generate graphs, and the type of Laplacian matrix along with the resulting classification accuracy for each combination. We can observe from Table 2 that the Laplacian methods do not significantly affect the performance, but Lrwr had the benefit in terms of computational complexity. SGE tended to give more accurate results than CoGE, which implies that the initial graph generation affected the model training more critically than structural Table 2: Performance of SCNN model with various hyperparameters for text topic classification task Model ∗ architecture Graph gener. L type AG GC8-FC500 GC8-FC500 GC8-FC500 GC8-FC500 GC8-FC500 GC8-FC500 GC8-FC1K GC8-FC1K GC8-FC1K GC8-FC1K GC8-FC1K GC8-FC1K GC8-GC8-FC1K GC8-GC8-FC1K GC8-GC8-FC1K GC8-GC8-FC1K GC8-GC8-FC1K GC8-GC8-FC1K CoGE CoGE CoGE SGE SGE SGE CoGE CoGE CoGE SGE SGE SGE CoGE CoGE CoGE SGE SGE SGE Lbasic Lrw Lrwr Lbasic Lrw Lrwr Lbasic Lrw Lrwr Lbasic Lrw Lrwr Lbasic Lrw Lrwr Lbasic Lrw Lrwr 0.89 0.89 0.89 0.91 0.91 0.89 0.90 0.90 0.89 0.91 0.91 0.89 0.89 0.89 0.89 0.91 0.91 0.89 ∗ Classification accuracy DBP YELP AMAZ 0.95 0.95 0.93 0.97 0.97 0.95 0.95 0.97 0.96 0.97 0.97 0.96 0.96 0.97 0.97 0.97 0.97 0.97 0.91 0.91 0.90 0.91 0.91 0.91 0.93 0.92 0.92 0.92 0.92 0.91 0.92 0.92 0.92 0.92 0.92 0.92 0.88 0.88 0.88 0.89 0.88 0.89 0.88 0.89 0.89 0.88 0.88 0.88 0.89 0.89 0.88 0.88 0.88 0.89 For training, we set the kernel degree K = 60, learning rate to 0.01 and used cross-entropy cost function with AdaGrad optimizer. GC8 means the use of graph convolutional layers with 8 feature maps, and FC500/FC1K means the use of fully connected layer with 500/1000 hidden units. feature extraction. For the experiments shown in Table 2, the GC8-GC8-FC1K model (refer to the note below Table 2 for notation) gave the best results, and we used this model as our main learning model in the following experiments. We then performed experiments to determine the effectiveness of transfer learning using the synthetic datasets. The results are shown in Fig. 3; the plots in the top row are from the pair of synthetic corpora with high similarity [sim(G1 , G2 ) = 0.75 and corr(wv1 , wv2 ) = 0.95] for varying quantities of fine-tuning data for training the transferred model in the target domain (1%, 3%, 5%, and 10% of the entire target data). The plots in the bottom row of Fig. 3 correspond to the results from the pair of synthetic corpora with low similarity [sim(G1 , G2 ) = 0.30 and corr(wv1 , wv2 ) = 0.50]. We can observe that transfer learning is more effective for the higher similarity case, in which the test accuracy of the transferred model increased significantly faster than that of the source domain model. Using only 1% of the target domain data was sufficient for training, and using more data did not provide a noticeable difference. For the lower similarity case, the training in the target domain was limited and could not deliver the same level of accuracy in the source domain due to discrepancies in the underlying structure between the source and target domains. Finally, we tested our approach with four corpora (AG, DBP, YELP, and AMAZ) as shown in Fig. 4. The plots in the top row represent the test accuracy of the model trained with the original data (solid line) and those of the transferred model trained with each of the other data (dotted line). The bottom plots represent the test loss. For the two corpora with the highest level of similarity (YELP and AMAZ), the effect Percentage of the target dataset used for training the transferred model 3% 5% 10% source target Test accuracy Sim(G1,G2)=0.30 [Corr(WS1, WS2)=0.50] Sim(G1,G2)=0.75 [Corr(WS1, WS2)=0.95] 1% source target Epochs Figure 3: Results of intrinsic geometric information transfer learning for synthetic datasets (best viewed in color). Top: source and target datasets have high similarity in graph representations. Bottom: source and target datasets have low similarity. Each column: the percentage (1%, 3%, 5% and 10%) of the target dataset used for training the transferred model (fine tuning the fully connected layer). We repeated every experiment 10 times, and each data point shows a boxplot; red (source domain) and blue (target domain) lines connect the median locations of the boxplots. of transfer learning was most salient. The test accuracy of the transferred model was comparable to that of the source model (for YELP) or was only 5–8% lower (for AMAZ). For the other cases with lower similarity than YELP and AMAZ, transfer learning was less effective. These results again confirmed our observation that the knowledge transfer is most successful when the source and target domains have high level of structural similarity between underlying graph representations. Conclusion We have proposed a new transfer learning framework for deep learning on graph-structured data. Our approach can transfer the intrinsic geometric information learned from the graph representation of the source domain to the target domain. We observed that the knowledge transfer between tasks domains is most effective when the source and target domains possess high similarity in their graph representations. We anticipate that adoption of our methodology will help extend the territory of deep learning to data in non-grid structure as well as to cases with limited quantity and quality of data. To prove this, we are planning to apply our approach to diverse datasets in different domains. Acknowledgments This work was supported by Ministry of Science, ICT & Future Planning [No.2016M3A7B4911115, No.PA-C000001], the Institute for Information Communications Technology Promotion [No.B0101-16-0307], the Brain Korea 21 Plus Project in 2016 grant funded by the Korea government, and Samsung Research Funding Center of Samsung Electronics [No.SRFC-IT1601-05]. References [Boscaini et al. 2015] Boscaini, D.; Masci, J.; Melzi, S.; Bronstein, M. M.; Castellani, U.; and Vandergheynst, P. 2015. Learning class-specific descriptors for deformable shapes using localized spectral convolutional networks. In Computer Graphics Forum, volume 34, 13–23. Wiley Online Library. [Bruna et al. 2013] Bruna, J.; Zaremba, W.; Szlam, A.; and LeCun, Y. 2013. Spectral networks and locally connected networks on graphs. arXiv preprint arXiv:1312.6203. [Chung 1997] Chung, F. R. 1997. Spectral graph theory, volume 92. American Mathematical Soc. [Deo 2016] Deo, N. 2016. Graph theory with applications to engineering and computer science. Courier Dover Publications. [Duvenaud et al. 2015] Duvenaud, D. K.; Maclaurin, D.; Iparraguirre, J.; Bombarell, R.; Hirzel, T.; Aspuru-Guzik, A.; and Adams, R. P. 2015. Convolutional networks on graphs for learning molecular fingerprints. In Advances in Neural Information Processing Systems, 2215–2223. [Henaff, Bruna, and LeCun 2015] Henaff, M.; Bruna, J.; and LeCun, Y. 2015. Deep convolutional networks on graphstructured data. arXiv preprint arXiv:1506.05163. [Jain et al. 2015] Jain, A.; Zamir, A. R.; Savarese, S.; and Saxena, A. 2015. Structural-RNN: Deep learning on spatiotemporal graphs. arXiv preprint arXiv:1511.05298. AG DBP YELP AMAZ Test loss Test accuracy Target domain Epochs Figure 4: Results of the proposed method on real-world datasets (best viewed in color). Each plot in the top row: test accuracy of the model trained with the original data (solid lines) and those of the models trained with the other data sources and transferred (dotted lines). Each plot in the bottom row: test loss. For YELP and AMAZ, transfer learning was most effective, given that they have the highest level of structural similarity of all the cases (see Table 1). [Kipf and Welling 2016] Kipf, T. N., and Welling, M. 2016. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907. [Koutra, Vogelstein, and Faloutsos 2013] Koutra, D.; Vogelstein, J. T.; and Faloutsos, C. 2013. DeltaCon: A principled massive-graph similarity function. SIAM. [Krizhevsky, Sutskever, and Hinton 2012] Krizhevsky, A.; Sutskever, I.; and Hinton, G. E. 2012. Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems, 1097–1105. [LeCun, Bengio, and Hinton 2015] LeCun, Y.; Bengio, Y.; and Hinton, G. 2015. Deep learning. Nature 521(7553):436–444. [Lee, Kim, and Yoon 2015] Lee, J.; Kim, G.; and Yoon, S. 2015. Measuring large-scale dynamic graph similarity by RICom: RWR with intergraph compression. In IEEE International Conference on Data Mining, 829–834. [Li et al. 2015] Li, Y.; Tarlow, D.; Brockschmidt, M.; and Zemel, R. 2015. Gated graph sequence neural networks. arXiv preprint arXiv:1511.05493. [Mohar 1997] Mohar, B. 1997. Some applications of Laplace eigenvalues of graphs. Springer. [Mou et al. 2016] Mou, L.; Li, G.; Zhang, L.; Wang, T.; and Jin, Z. 2016. Convolutional neural networks over tree structures for programming language processing. In AAAI Conference on Artificial Intelligence. [Niepert, Ahmed, and Kutzkov 2016] Niepert, M.; Ahmed, M.; and Kutzkov, K. 2016. Learning convolutional neural networks for graphs. arXiv preprint arXiv:1605.05273. [Pan and Yang 2010] Pan, S. J., and Yang, Q. 2010. A survey on transfer learning. IEEE Transactions on Knowledge and Data Engineering 22(10):1345–1359. [Rustamov and Guibas 2013] Rustamov, R., and Guibas, L. J. 2013. Wavelets on graphs via deep learning. In Advances in Neural Information Processing Systems, 998– 1006. [Schmidhuber 2015] Schmidhuber, J. 2015. Deep learning in neural networks: An overview. Neural Networks 61:85–117. [Shuman et al. 2013] Shuman, D. I.; Narang, S. K.; Frossard, P.; Ortega, A.; and Vandergheynst, P. 2013. The emerging field of signal processing on graphs: Extending highdimensional data analysis to networks and other irregular domains. IEEE Signal Processing Magazine 30(3):83–98. [Shuman, Ricaud, and Vandergheynst 2016] Shuman, D. I.; Ricaud, B.; and Vandergheynst, P. 2016. Vertex-frequency analysis on graphs. Applied and Computational Harmonic Analysis 40(2):260–291. [Silver et al. 2016] Silver, D.; Huang, A.; Maddison, C. J.; Guez, A.; Sifre, L.; Van Den Driessche, G.; Schrittwieser, J.; Antonoglou, I.; Panneershelvam, V.; Lanctot, M.; et al. 2016. Mastering the game of Go with deep neural networks and tree search. Nature 529(7587):484–489. [Sonawane and Kulkarni 2014] Sonawane, S., and Kulkarni, P. 2014. Graph based representation and analysis of text document: A survey of techniques. International Journal of Computer Applications 96(19). [Sutskever, Vinyals, and Le 2014] Sutskever, I.; Vinyals, O.; and Le, Q. V. 2014. Sequence to sequence learning with neural networks. In Advances in Neural Information Processing Systems, 3104–3112. [Tong, Faloutsos, and Pan 2006] Tong, H.; Faloutsos, C.; and Pan, J.-Y. 2006. Fast random walk with restart and its applications. In IEEE International Conference on Data Mining, 613–622. [Zhang, Zhao, and LeCun 2015] Zhang, X.; Zhao, J.; and LeCun, Y. 2015. Character-level convolutional networks for text classification. In Advances in Neural Information Processing Systems, 649–657.
9cs.NE
arXiv:1701.03769v1 [math.ST] 13 Jan 2017 A General Approach for Cure Models in Survival Analysis Valentin Patilea ∗ Ingrid Van Keilegom § January 16, 2017 Abstract In survival analysis it often happens that some subjects under study do not experience the event of interest; they are considered to be ‘cured’. The population is thus a mixture of two subpopulations : the one of cured subjects, and the one of ‘susceptible’ subjects. When covariates are present, a so-called mixture cure model can be used to model the conditional survival function of the population. It depends on two components : the probability of being cured and the conditional survival function of the susceptible subjects. In this paper we propose a novel approach to estimate a mixture cure model when the data are subject to random right censoring. We work with a parametric model for the cure proportion (like e.g. a logistic model), while the conditional survival function of the uncured subjects is unspecified. The approach is based on an inversion which allows to write the survival function as a function of the distribution of the observable random variables. This leads to a very general class of models, which allows a flexible and rich modeling of the conditional survival function. We show the identifiability of the proposed model, as well as the weak consistency and the asymptotic normality of the model parameters. We also consider in more detail the case where kernel estimators are used for the nonparametric part of the model. The new estimators are compared with the estimators from a Cox mixture cure model via finite sample simulations. Finally, we apply the new model and estimation procedure on two medical data sets. Key Words: Asymptotic normality; bootstrap; kernel smoothing; logistic regression; mixture cure model; semiparametric model. MSC2010: 62N01, 62N02, 62E20, 62F12, 62G05. ∗ CREST (Ensai), France. V. Patilea acknowledges support from the research program New Challenges for New Data of LCL and Genes. Email address: [email protected]. § ORSTAT, Katholieke Universiteit Leuven, Belgium. I. Van Keilegom acknowledges support from the European Research Council (2016-2021, Horizon 2020 / ERC grant agreement No. 694409), and from IAP Research Network P7/06 of the Belgian State. Email address: [email protected]. 1 1 Introduction Driven by emerging applications, over the last two decades there has been an increasing interest for time-to-event analysis models allowing the situation where a fraction of the right censored observed lifetimes corresponds to subjects who will never experience the event. In biostatistics such models including covariates are usually called cure models and they allow for a positive cure fraction that corresponds to the proportion of patients cured of their disease. For a review of these models in survival analysis, see for instance Maller & Zhou (2001) or Peng & Taylor (2014). Economists sometimes call such models split population models (see Schmidt & Witte 1989), while the reliability engineers refer to them as limitedfailure population life models (Meeker 1987). At first sight, a cure regression model is nothing but a binary outcome, cured versus uncured, regression problem. The difficulty comes from the fact that the cured subjects are unlabeled observations among the censored data. Then one has to use all the observations, censored and uncensored, to complete the missing information and thus to identify, estimate and make inference on the cure fraction regression function. We propose a general approach for this task, a tool that provides a general ground for cure regression models. The idea is to start from the laws of the observed variables and to express the quantities of interest, such as the cure rate and the conditional survival of the uncured subjects, as functionals of these laws. These general expressions, that we call inversion formulae and we derive with no particular constraint on the space of the covariates, are the vehicles that allow for a wide modeling choice, parametric, semiparametric and nonparametric, for both the law of the lifetime of interest and the cure rate. Indeed, the inversion formulae allow to express the likelihood of the binary outcome model as a function of the laws of the observed variables. The likelihood estimator of the parameter vector of the cure fraction function is then simply the maximizer of the likelihood obtained by replacing the laws of the observations by some estimators. With at hand the estimate of the parameter of the cure fraction, the inversion formulae will provide an estimate for the conditional survival of the uncured subjects. For the sake of clarity, we focus on the so-called mixture cure models with a parametric cure fraction function, the type of model that is most popular among practitioners. Meanwhile, the lifetime of interest is left unspecified. The paper is organized as follows. In Section 2 we provide a general description of the mixture cure models and next we introduce the needed notation and present the inversion formulae on which our approach is built. We finish Section 2 by a discussion of the identification issue and some new insight on the existing approaches in the literature on cure models. Section 3 introduces the general maximum likelihood estimator, while in Section 4 we derive the general asymptotic results. A simple bootstrap procedure for making feasible inference is proposed. Section 4 ends with an illustration of the general approach in the case where the conditional law of the observations is estimated by kernel smoothing. In Sections 2 5 and 6 we report some empirical results obtained with simulated and two real data sets. Our estimator performs well in simulations and provides similar or more interpretable results in applications compared with a competing logistic/proportional hazards mixture approach. The technical proofs are relegated to the Appendix. 2 2.1 The model A general class of mixture cure models Let T denote (a possible monotone transformation of) the lifetime of interest that takes values in (−∞, ∞]. A cured observation corresponds to the event {T = ∞}, and in the following this event is allowed to have a positive probability. Let X be a covariate vector with support X belonging to a general covariate space. The covariate vector could include discrete and continuous components. The survival function FT ((t, ∞] | x) = P(T > t | X = x) for t ∈ R and x ∈ X can be written as FT ((t, ∞] | x) = 1 − φ(x) + φ(x)FT,0 ((t, ∞) | x), where φ(x) = P(T < ∞ | X = x) and FT,0 ((t, ∞) | x) = P(T > t | X = x, T < ∞). Depending on which model is used for φ(x) and FT,0 (· | x), one obtains a parametric, semiparametric or nonparametric model, called a ‘mixture cure model’. In the literature, one often assumes that φ(x) follows a logistic model, i.e. φ(x) = exp(a + x⊤ b)/[1 + exp(a + x⊤ b)] for some (a, b⊤ )⊤ ∈ Rd+1 . Recently, semiparametric models (like a single-index model as in Amico et al. 2017) or nonparametric models (as in Xu & Peng 2014 or López-Cheda et al. 2017) have been proposed. As for the survival function FT,0 (· | x) of the susceptible subjects, a variety of models have been proposed, including parametric models (see e.g. Boag 1949, Farewell 1982), semiparametric models based on a proportional hazards assumption (see e.g. Kuk & Chen 1992, Sy & Taylor 2000, Fang et al. 2005, Lu 2008; see also Othus et al. 2009) or nonparametric models (see e.g. Taylor 1995, Xu & Peng 2014). In this paper we propose to model φ(x) parametrically, i.e. we assume that φ(·) belongs to the family of conditional probability functions {φ(·, β) : β ∈ B}, where φ(·, β) takes values in the interval (0, 1), β is the parameter vector of the model and B is the parameter set. This family could be the logistic family or any other parametric family. For the survival function FT,0 (· | x) we do not impose any assumptions in order to have a flexible and rich class of models for FT (· | x) to choose from. Later on we will see that for the estimation of FT,0 (· | x) any estimator that satisfies certain minimal conditions can be used, and hence we allow for a large variety of parametric, semiparametric and nonparametric estimation methods. 3 As is often the case with time-to-event data, we assume that the lifetime T is subject to random right censoring, i.e. instead of observing T , we only observe the pair (Y, δ), where Y = T ∧ C, δ = 1{T ≤ C} and C is a non-negative random variable, called the censoring time. Some identification assumptions are required to be able to identify the conditional law of T from the observed variables Y and δ. Let us assume that C⊥T |X P(C < ∞) = 1. and (2.1) The conditional independence between T and C is an usual identification assumption in survival analysis in the presence of covariates. The zero probability at infinity condition for C implies that P(C < ∞ | X) = 1 almost surely (a.s.). This latter mild condition is required if we admit that the observations Y are finite, which is the case in the common applications. For the sake of simplicity, let us also consider the condition P(T = C) = 0, (2.2) which is commonly used in survival analysis, and which implies that P(T = C | X) = 0 a.s. 2.2 Some notations and preliminaries We start with some preliminary arguments, which are valid in general without assuming any model on the functions φ, FT and FC . The observations are characterized by the conditional sub-probabilities H1 ((−∞, t] | x) = P(Y ≤ t, δ = 1 | X = x) H0 ((−∞, t] | x) = P(Y ≤ t, δ = 0 | X = x), t ∈ R, x ∈ X . def Then H((−∞, t] | x) = P(Y ≤ t | X = x) = H0 ((−∞, t] | x) + H1 ((−∞, t] | x). Since we assume that Y is finite, we have H((−∞, ∞) | x) = 1, ∀x ∈ X . (2.3) For j ∈ {0, 1} and x ∈ X , let τHj (x) = sup{t : Hj ([t, ∞) | x) > 0} denote the right endpoint of the support of the conditional sub-probability Hj . Let us define τH (x) in a similar way and note that τH (x) = max{τH0 (x), τH1 (x)}. Note that τH0 (x), τH1 (x) and τH (x) can equal infinity, even though Y only takes finite values. For −∞ < t ≤ ∞, let us define the conditional probabilities FC ((−∞, t] | x) = P(C ≤ t | X = x) and FT ((−∞, t] | x) = P(T ≤ t | X = x), x ∈ X. Let us show how the probability of being cured could be identified from the observations without any reference to a model for this probability. Under conditions (2.1)-(2.2) we can write H1 (dt | x) = FC ([t, ∞) | x)FT (dt | x), H0 (dt | x) = FT ([t, ∞] | x)FC (dt | x), 4 and H([t, ∞) | x) = FT ([t, ∞] | x)FC ([t, ∞) | x). These equations could be solved and thus they allow to express the functions FT (· | x) and FC (· | x) in an unique way as explicit transformations of the functions H0 (· | x) and H1 (· | x). For this purpose, let us consider the conditional cumulative hazard measures ΛT (dt | x) = FT (dt | x) FT ([t, ∞] | x) ΛC (dt | x) = and FC (dt | x) , FC ([t, ∞) | x) x ∈ X. The model equations yield ΛT (dt | x) = H1 (dt | x) H([t, ∞) | x) and ΛC (dt | x) = H0 (dt | x) . H([t, ∞) | x) Then, we can write the following functionals of H0 (· | x) and H1 (· | x) : Y FT ((t, ∞] | x) = {1 − ΛT (ds | x)}, (2.4) −∞<s≤t FC ((t, ∞) | x) = Y {1 − ΛC (ds | x)}, t ∈ R, (2.5) −∞<s≤t Q where s∈A stands for the product-integral over the set A (see Gill and Johansen 1990). Moreover, if τH1 (x) < ∞, then Y P(T > τH1 (x) | x) = {1 − ΛT (dt | x)}, t∈(−∞,τH1 (x)] but there is no way to identify the conditional law of T beyond τH1 (x). Therefore, we will impose P(T > τH1 (x) | x) = P(T = ∞ | x), (2.6) Q Q i.e. t∈R {1 − ΛT (dt | x)} = −∞<t≤τH (x) {1 − ΛT (dt | x)}. Note that if τH1 (x) = ∞, 1 condition (2.6) is no longer an identification restriction, but just a simple consequence of the definition of ΛT (· | x). Finally, the condition that P(C < ∞) = 1 in (2.1) can be re-expressed by saying that we assume that H0 (· | x) and H1 (· | x) are such that Y P(C = ∞ | x) = {1 − ΛC (dt | x)} = 0, ∀x ∈ X . (2.7) t∈R Let us point out that this condition is satisfied only if τH1 (x) ≤ τH0 (x). Indeed, if τH1 (x) > τH0 (x) then necessarily τH0 (x) < τH (x) and so H([τH0 (x), ∞) | x) > 0. Hence, ΛC (R | x) = ΛC ((−∞, τH0 (x)] | x) < ∞, and thus P(C = ∞ | x) > 0, which contradicts (2.7). It is important to understand that any two conditional sub-probabilities H0 (· | x) and H1 (· | x) satisfying conditions (2.1) and (2.2) define uniquely FT (· | x) and FC (· | x). Indeed, FT (· | x) is precisely the probability distribution of T given X = x with all the mass beyond τH1 (x) concentrated at infinity. In general, FT (· | x) and FC (· | x) are only functionals of H0 (· | x) and H1 (· | x). We will assume conditions (2.1), (2.2) and (2.6) throughout the paper. 5 2.3 A key point for the new approach: the inversion formulae Write H([t, ∞) | x) = FT ([t, ∞] | x)FC ([t, ∞) | x) = FT ([t, ∞) | x)FC ([t, ∞) | x) + P(T = ∞ | x)FC ([t, ∞) | x), and thus FT ([t, ∞) | x) = H([t, ∞) | x) − P(T = ∞ | x)FC ([t, ∞) | x) . FC ([t, ∞) | x) (2.8) Consider the conditional cumulative hazard measure for the finite values of the lifetime of interest: FT (dt | x) FT,0 (dt | x) def = ΛT,0 (dt | x) = FT,0 ([t, ∞) | x) FT ([t, ∞) | x) for t ∈ R. Since H1 (dt | x) = FC ([t, ∞) | x)FT (dt | x), using relationship (2.8) we obtain ΛT,0(dt | x) = H1 (dt | x) . H([t, ∞) | x) − P(T = ∞ | x)FC ([t, ∞) | x) Next, using the product-integral we can write Y FT,0 ((t, ∞) | x) = {1 − ΛT,0 (ds | x)}, t ∈ R, x ∈ X . (2.9) (2.10) −∞<s≤t Let us recall that FC (· | x) can be written as a transformation of H0 (· | x) and H1 (· | x), see equations (2.4) and (2.5). This representation is not surprising since we can consider C as a lifetime of interest and hence T plays the role of a censoring variable. Hence, estimating the conditional distribution function FC (· | x) should not be more complicated than in a classical conditional Kaplan-Meier setup, since the fact that T could be equal to infinity with positive conditional probability is irrelevant when estimating FC (· | x). Finally, the representation of FC (· | x) given in equation (2.5), plugged into equation (2.9), allows to express ΛT,0 (· | x), and thus FT,0 (· | x), as maps of P(T = ∞ | x) and the measures H0 (· | x) and H1 (· | x). This will be the key element for providing more insight in the existing approaches and the starting point of our new approach. 2.4 Model identification issues Let us now investigate the identification issue. Recall that our model involves the functions FT (· | x), FC (· | x) and φ(·, β), and the assumptions (2.1), (2.2) and (2.6). For a fixed value of the parameter β, and for t ∈ R and x ∈ X , let ΛβT,0 (dt | x) = H1 (dt | x) , H([t, ∞) | x) − [1 − φ(x, β)]FC ([t, ∞) | x) 6 (2.11) and β FT,0 ((t, ∞) | x) = Y n −∞<s≤t o 1 − ΛβT,0 (ds | x) . (2.12) Let FY,δ (·, · | x) denote the conditional law of (Y, δ) given X = x. Moreover, let β β FY,δ (dt, 1 | x) = φ(x, β)FC ((t, ∞) | x)FT,0 (dt | x) and β β FY,δ (dt, 0 | x) = [FT,0 ((t, ∞) | x)φ(x, β) + 1 − φ(x, β)]FC (dt | x). These equations define a conditional law for the observations (Y, δ) based on the model. More precisely, for a choice of FT (· | x), FC (· | x) and β, the model yields a conditional law for (Y, δ) given X = x. If the model is correctly specified, there exists a value β0 such that β0 FY,δ (·, · | x) = FY,δ (·, · | x), ∀x ∈ X . (2.13) The remaining question is whether the true value of the parameter is identifiable. In other words, one should check if, given the conditional subdistributions H0 (· | x) and H1 (· | x), x ∈ X , there exists a unique β0 satisfying condition (2.13). For this purpose we impose the following mild condition: and we show that e almost surely φ(X, β) = φ(X, β), e ⇒ β = β, (2.14) βe β0 e ∀x ∈ X . (·, · | x), ∀x ∈ X ⇒ φ(x, β0 ) = φ(x, β), FY,δ (·, · | x) = FY,δ e β0 β Indeed, if FY,δ (·, · | x) = FY,δ (·, · | x), then for any x, β0 e C ((t, ∞) | x)F βe (dt | x), φ(x, β0 )FC ((t, ∞) | x)FT,0 (dt | x) = φ(x, β)F T,0 for all t ∈ (−∞, τH (x)] ∩ R. Our condition (2.7) guarantees that τH (x) = τH0 (x) so that FC ((t, ∞) | x) should be necessarily positive for t ∈ (−∞, τH (x)), and thus could be simplified in the last display. Deduce that β0 e βe (dt | x), φ(x, β0 )FT,0 (dt | x) = φ(x, β)F T,0 for all t ∈ (−∞, τH (x)). Finally, recall that by construction, in the model we consider, β β FT,0 ((−∞, ∞) | x) = 1 for any β such that FY,δ (·, · | x) coincides with the conditional law of (Y, δ) given X = x, for any x. Thus taking integrals on (−∞, ∞) on both sides of the last e Let us gather these facts in the following statement. display we obtain φ(·, β0 ) = φ(·, β). Theorem 2.1. Under conditions (2.1), (2.2), (2.6) and (2.14) the model is identifiable. 7 2.5 Interpreting the previous modeling approaches We suppose here that the function φ(x) follows a logistic model, and comment on several models for FT,0 that have been considered in the literature. 2.5.1 Parametric and proportional hazards mixture model In a parametric modeling, one usually supposes that τH0 (x) = τH1 (x) = ∞ and that ΛT,0 (· | x) belongs to a parametric family of cumulative hazard functions, like for instance the Weibull model; see Farewell (1982). Several contributions proposed a more flexible semiparametric proportional hazards (PH) approach; see Fang et al. (2005), Lu (2008) and the references therein. In such a model one imposes a PH structure for the ΛT,0 (· | x) measure. More precisely, it is supposed that ΛT,0(dt | x) = H1 (dt | x) = exp(x⊤ γ)Λ0 (dt), H([t, ∞) | x) − [1 − φ(x, β)]FC ([t, ∞) | x) where γ is some parameter to be estimated and Λ0 (·) is an unknown baseline cumulative hazard function. Our inversion formulae reveal that in this approach the parameters γ and Λ0 depend on the observed conditional measures H0 (· | x) and H1 (· | x), but also on the parameter β. The same is true for the parametric models. 2.5.2 Kaplan-Meier mixture cure model Taylor (1995) suggested to estimate FT,0 using a Kaplan-Meier type estimator. With such an approach one implicitly assumes that the law of T given X and given that T < ∞ does not depend on X. This is equivalent to supposing that ΛT,0(· | x) = ΛT,0(·). Next, to estimate ΛT,0 (·) one has to modify the unconditional version of the usual inversion formulae (2.4) to take into account the conditional probability of the event {T = ∞}. Following Taylor’s approach we rewrite (2.9) as ΛT,0(dt) = H1 (dt | x) o n . 1−φ(x,β) H1 ([t, ∞) | x)+ [t,∞) 1 − φ(x,β)FT,0 ([s,∞))+1−φ(x,β) H0 (ds | x) R Next, assume that the last equality remains true if H0 (dt | x) and H1 (dt | x) are replaced by their unconditional versions, that is assume that ΛT,0(dt) = n H1 ([t, ∞)) + [t,∞) 1 − R H1 (dt) 1−φ(x,β) φ(x,β)FT,0 ([s,∞))+1−φ(x,β) o . (2.15) H0 (ds) See equations (2) and (3) in Taylor (1995). The equation above could be solved iteratively (m) (m+1) by a EM-type procedure: for a given β and an iteration FT,0 (·), build ΛT,0 (dt) and the (m+1) updated estimate FT,0 (·); see Taylor (1995) for the details. Let us point out that even if 8 (T, C) is independent of X and thus H1 (· | x) does not depend on x, the subdistribution H0 (· | x) still depends on x, since H0 (dt | x) = FT ((t, ∞] | x)FC (dt | x) = [FT ((t, ∞) | x) + P(T = ∞ | x)]FC (dt | x). Hence, a more natural form of equation (2.15) is ΛT,0 (dt) = n H1 ([t, ∞)) + [t,∞) 1 − R H1 (dt) 1−φ(x,β) φ(x,β)FT,0 ([s,∞))+(1−φ(x,β)) o . H0 (ds | x) The investigation of a EM-type procedure based on the latter equation will be considered elsewhere. 3 Maximum likelihood estimation Let (Yi , δi , Xi ) (i = 1, . . . , n) be a sample of n i.i.d. copies of the vector (Y, δ, X). We use a likelihood approach based on formulae (2.9) and (2.5) to build an estimator of β b k (· | x) of the subdistriφ(·, β) and FT,0 (· | x). To build the likelihood we use estimates H butions Hk (· | x), k ∈ {0, 1}. These estimates are constructed with the sample of (Y, δ, X), without reference to any model for the conditional probability P(T < ∞ | x). At this stage b k (· | x). To derive the asymptotic results it is not necessary to impose a particular form for H β we will only impose that these estimators satisfy some mild conditions. Let FbT,0 (· | x) be b 0 (· | x) and H b 1 (· | x) instead of H0 (· | x) defined as in equations (2.11) and (2.12) with H and H1 (· | x), that is ) ( Y b H (ds | x) 1 β , FbT,0 ((t, ∞) | x) = 1− b bC ([s, ∞) | x) H([s, ∞) | x) − [1 − φ(x, β)] F −∞<s≤t b 0 (· | x) where FbC (· | x) is the estimator obtained from equations (2.4) and (2.5) but with H b 1 (· | x), i.e. and H ( ) Y b 0 (ds | x) H FbC ((t, ∞) | x) = 1− . b H([s, ∞) | x) −∞<s≤t Let fX denote the density of the covariate vector with respect to some dominating measure. The contribution of the observation (Yi , δi , Xi ) to the likelihood when δi = 1 is then β φ(Xi , β)FbT,0 ({Yi } | Xi )fX (Xi )FbC ((Yi , ∞) | Xi ), while the contribution when δi = 0 is β FbC ({Yi } | Xi )fX (Xi )[φ(Xi , β)FbT,0 ((Yi , ∞) | Xi ) + 1 − φ(Xi , β)]. 9 Since the laws of the censoring variable and of the covariate vector do not carry information of the parameter β, we can drop the factors FbC ((Yi , ∞) | Xi )fX (Xi ) and FbC ({Yi } | Xi )fX (Xi ). bn (β) where Hence the criterion to be maximized with respect to β ∈ B is L bn (β) = L n n oδi n o1−δi Y β β φ(Xi , β)FbT,0 ({Yi } | Xi ) φ(Xi , β)FbT,0 ((Yi , ∞) | Xi ) + 1 − φ(Xi , β) . i=1 The estimator we propose is bn (β). βb = arg max log L β∈B (3.1) Let us review the identification issue in the context of the likelihood estimation approach. If conditions (2.1), (2.2) and (2.6) hold true and the parametric model for the conditional probability of the event {T = ∞} is correct and identifiable in the sense of condition (2.14), the true parameter β0 is the value identified by condition (2.13). This is the conclusion of Theorem 2.1 above. It remains to check that the proposed likelihood approach allows to consistently estimate β0 . Let log p(t, δ, x; β) = δ log p1 (t, x; β) + (1 − δ) log p0 (t, x; β), (3.2) with p1 (t, x; β) = β φ(x, β)FT,0 (dt | x)FC ((t, ∞) | x) , H1 (dt | x) β FC (dt | x)[φ(x, β)FT,0 ((t, ∞) | x) + 1 − φ(x, β)] p0 (t, x; β) = . H0 (dt | x) (3.3) (3.4) Following a common notational convention, see for instance Gill (1994), here we treat dt not just as the length of a small time interval [t, t + dt) but also as the name of the interval itself. Moreover, we use the convention 0/0 = 1. Let us notice that, up to additive terms not containing β, the function β 7→ E[log p(Y, δ, X; β)] is expected to be the limit of the bn (·). Hence, a minimal condition for guaranteeing the consistency random function log L of the likelihood estimation approach is that β0 is the maximizer of the limit likelihood criterion E[log p(Y, δ, X; ·)]. This is proved in the following proposition using a Bernoulli sample likelihood inequality. The proof is given in the Appendix. Proposition 3.1. Suppose that conditions (2.1), (2.2), (2.6) and (2.14) hold true. If β0 is the value of the parameter defined by equation (2.13), then for any β 6= β0 , E [log p(Y, δ, X; β)] < E [log p(Y, δ, X; β0 )] . 4 General asymptotic results Little assumptions were needed for our analysis so far. To proceed further with the asymptotic results we need to be more specific with respect to several aspects. In order to prove 10 bn (β) along sequences of values consistency, we have to control the asymptotic behavior of L of the parameter β. Such a control requires a control of denominators like b H([t, ∞) | x) − (1 − φ(x, β))FbC ([t, ∞) | x) on the support of H1 (· | x), uniformly with respect to x. A usual way to deal with this technical difficulty is to consider a finite threshold τ beyond which no uncensored lifetime is observed, i.e. inf H1 ((−∞, τ ] | x) = 1. (4.1) x Moreover, to be able to keep denominators away from zero, we require the condition inf H1 ({τ } | x)H0 ((τ, ∞) | x) > 0. x∈X (4.2) In particular, this condition implies τH0 (x) > τH1 (x) = τ, x ∈ X. Moreover, given condition (2.2), necessarily H0 ({τ } | x) = 0, ∀x. This means that FC ({τ } | x) = 0, ∀x. This constraint on H0 ({τ } | x) could be relaxed at the expense of suitable adjustments of the inversion formulae. For simplicity, we keep condition (2.2). Let us also β notice that condition (4.2) implies inf x FC ((τ, ∞) | x) > 0, and inf x FT,0 ({τ } | x) > 0, ∀β. Conditions like in equations (4.1)-(4.2) are more or less explicitly used in the literature of cure models. Sometimes τ is justified as representing a total follow-up of the study. For instance, Lu (2008) supposes that Y = min{T, min(C, τ )} and δ = 1{T ≤ min(C, τ )}, where T = ηT ∗ +(1−η)∞, with T ∗ < ∞ and η ∈ {0, 1}. The conditional probability of being cured is precisely the conditional probability of the event {η = 0}. Next, Lu (2008) supposes that inf x P(τ ≤ T ≤ C | x) > 0, and Λ0 (τ ) < ∞, where Λ0 (·) is the cumulative hazard function of T ∗ . All these conditions together clearly imply our conditions (4.1)-(4.2). Fang et al. (2005) implicitly restrict the uncensored lifetimes to some compact interval [0, τ ] and suppose E(δ1{Y ≥ τ }) > 0. This could be possible only if H1 ({τ } | x) > 0 for a set of values x with positive probability. In a proportional hazards context with the covariates taking values in a bounded set, as assumed by Fang et al. (2005), this is equivalent to H1 ({τ } | x) ≥ c > 0 for almost all x, for some constant c. The fact that technical conditions similar to our conditions (4.1)-(4.2) could be traced in the cure models literature is not unexpected in view of our Section 2.5. Indeed, the existing approaches could be interpreted through our inversion formulae and thus the technical problems we face in the asymptotic investigation are expected to be also present in the alternative approaches. 11 4.1 Consistency Let us sketch the arguments we use in the proof of Theorem 4.1 below for deriving the b On one hand, if the conditional subdistributions Hk (· | x) are given, one consistency of β. can build the purely parametric likelihood Ln (β) = n n Y β φ(Xi , β)FT,0 ({Yi } | Xi ) i=1 oδin o1−δi β φ(Xi , β)FT,0 ((Yi , ∞) | Xi )+1−φ(Xi , β) . (4.3) bn (β) By construction, Ln (β) is a functional of H0 (· | x) and H1 (· | x), x ∈ X , while L is a functional of the estimated versions of H0 (· | x) and H1 (· | x). Hence, a prerequisite condition for deriving the consistency of our semiparametric estimator βb is the consistency of the infeasible maximum likelihood estimator βe = arg max log Ln (β). β∈B A necessary condition for the consistency of βb is bn (β) − log Ln (β)| = oP (1). sup | log L (4.4) β∈B We then have that b ≥ log Ln (β) e − oP (1). log Ln (β) From this we will derive the consistency of βb using Section 5.2 in van der Vaart (1998). See the proof in the Appendix for details. b k − Hk as To prove condition (4.4), we have to guarantee the uniform convergence of H stated in Assumption (AC1) below. Indeed, this uniform convergence will imply sup sup |FbC ([t, ∞) | x) − FC ([t, ∞) | x)| = oP (1), (4.5) x∈X t∈(−∞,τ ] and sup sup β β sup |FbT,0 ([t, ∞) | x) − FT,0 ([t, ∞) | x)| = oP (1). (4.6) β∈B x∈X t∈(−∞,τ ] See Lemma 7.1 in the Appendix. The uniform convergence in equation (4.4) then follows. b we need the following assumptions : To prove the consistency of β, (AC1) For τ appearing in conditions (4.1)-(4.2), b k ([t, ∞) | x) − Hk ([t, ∞) | x)| = oP (1), sup sup |H x∈X t∈(−∞,τ ] (AC2) The parameter set B ⊂ Rp is compact. 12 k ∈ {0, 1}. (AC3) There exist some constants a > 0 and c1 > 0 such that |φ(x, β) − φ(x, β ′ )| ≤ c1 kβ − β ′ ka , ∀β, β ′ ∈ B, ∀x, x′ ∈ X . (AC4) inf β∈B inf x∈X φ(x, β) > 0. Now we can state our consistency result. Theorem 4.1. Assume that (AC1)-(AC4) and (2.1), (2.2), (2.6), (2.14), (4.1) and (4.2) hold true. Moreover, assume that there exists a unique value β0 in the parameter space B such that (2.13) is true. Then, βb − β0 = oP (1). Let us point out that the consistency result is stated in terms of the subdistributions of the observations and the conditional probability model {φ(x, ·) : β ∈ B}. If the identification b x) assumptions used in Proposition 3.1 hold true and the model is correctly specified, φ(β, consistently estimates the cure probability P(T = ∞ | x) for all x in the support of X. Let us also notice that condition (AC3) guarantees the Glivenko-Cantelli property for certain classes of functions. It could be significantly weakened, but in the applications our condition (AC3) will cover the common modeling situations. Condition (AC4) is a weak condition on the model φ(x, β) and is e.g. satisfied for the logistic model if X and B are compact. 4.2 Asymptotic normality For the asymptotic normality we will use the approach in Chen et al. (2003). For this bn (β) with respect to β. purpose we use the derivative of log L bn (β) with respect First note that the vector of partial derivatives of the log-likelihood log L to the components of β equals 1X n b 1 ({Yi } | Xi )] b ∇β δi log φ(Xi , β) + δi log[H ∇β log Ln (β) = n i=1 h i b b −δi log H([Yi , ∞) | Xi ) − (1 − φ(Xi , β))FC ([Yi , ∞) | Xi ) n (1) +δi log FbT,β ([Yi , ∞) | Xi ) h io (1) +(1 − δi ) log φ(Xi , β)Fb ([Yi , ∞) | Xi ) + 1 − φ(Xi , β) . T,β = 1 n n X i=1 b0, H b 1 ), ∇β qi (β, H where qi is defined in the proof of Theorem 4.1. b we embed the nuisance functions To develop the asymptotic normality of our estimator β, Hk ([·, ∞) | ·) (k = 0, 1) in a functional space H, which is equipped with a pseudo-norm k·kH . Both the space H and its pseudo-norm k · kH will be chosen depending on the estimators 13 b k ([·, ∞) | ·), k = 0, 1, and have to satisfy certain conditions, which we give below. The H true vector of nuisance functions is η0 (t, x) = (η01 (t, x), η02 (t, x)) = (H0 ([t, ∞) | x), H1 ([t, ∞) | x)). For each x ∈ X and for each η ∈ H, let η(dt, x) = (η1 (dt, x), η2 (dt, x)) be the measures associated to the non-increasing functions η(·, x) = (η1 (·, x), η2 (·, x)), and define n 1X m(Yi , δi , Xi ; β, η) Mn (β, η) = n i=1 (4.7) M(β, η) = E[m(Y, δ, X; β, η)], (4.8) and where δ∇β φ(x, β) δ∇β φ(x, β)T2 (η)(t, x) − + δT4 (β, η)(t, x) φ(x, β) T1 (β, η)(t, x) ∇β φ(x, β)T3(β, η)(t, x) + φ(x, β)(T3 T4 )(β, η)(t, x) − ∇β φ(x, β) , + (1 − δ) φ(x, β)T3 (β, η)(t, x) + 1 − φ(x, β) m(t, δ, x; β, η) = where T1 (β, η)(t, x) = [η1 (t, x) + η2 (t, x)] − (1 − φ(x, β))T2 (β, η)(t, x)  Y  η1 (ds, x) T2 (β, η)(t, x) ≡ T2 (η)(t, x) = 1− (η1 + η2 )(s, x) −∞<s<t   Y η2 (ds, x) T3 (β, η)(t, x) = 1− T1 (β, η)(s, x) −∞<s<t T4 (β, η)(t, x) = ∇β log T3 (β, η)(t, x) Z = −∇β φ(x, β) (−∞,t) T2 (η)(s, x)η2 (ds, x) . T1 (β, η)(s, x)[T1(β, η)(s, x) − η2 ({s}, x)] Note that for η = η0 , we have T1 (β, η0 )(t, x) = H([t, ∞) | x) − (1 − φ(x, β))FC ([t, ∞) | x), β T2 (η0 )(t, x) = FC ([t, ∞) | x) and T3 (β, η0)(t, x) = FT,0 ([t, ∞) | x). Hence, we have that M(β0 , η0 ) = 0 and b ηb)k = infβ∈B kMn (β, ηb)k, kMn (β, b 0 ([t, ∞) | x), H b 1 ([t, ∞) | x)). where ηb(t, x) = (b η1 (t, x), ηb2 (t, x)) = (H If in addition β = β0 , β0 T1 (β0 , η0 )(t, x) = FT,0 ([t, ∞) | x)FC ([t, ∞) | x), 14 t ∈ (−∞, τ ], (4.9) and thus for any x, the map t 7→ T1 (β0 , η0 )(t, x) is decreasing on (−∞, τ ]. Moreover, by condition (4.2), inf T1 (β0 , η0 )(τ, x) > 0. x∈X We need this lower bound to be valid on a neighborhood around β0 . Hence, let us consider B0 a neighborhood of β0 such that inf inf T1 (β, η0 )(τ, x) > 0. β∈B0 x∈X (4.10) The existence of B0 is guaranteed by condition (4.2) and the regularity of the function φ(·, ·); see assumption (AN3) below that strengthens assumption (AC3). Finally, let us note that by construction for any t ∈ (−∞, τ ), H({t} | x) = H0 ({t} | x) + H1 ({t} | x) ≥ (1 − φ(x, β))FC ({t} | x) + H1 ({t} | x) and thus H([t, ∞) | x) − (1 − φ(x, β))FC ([t, ∞) | x) − H1 ({t} | x) ≥ H((t, ∞) | x) − (1 − φ(x, β))FC ((t, ∞) | x). Then, by the arguments guaranteeing the existence of a set B0 as in equation (4.10), inf inf inf [T1 (β, η0 )(t, x) − H1 ({t} | x)] > 0. β∈B0 x∈X t∈(−∞,τ ) (4.11) Further, define the Gâteaux derivative of M(β, η0 ) in the direction [η − η0 ] by h i −1 ∇η M(β, η0 )[η − η0 ] = lim τ M(β, η0 + τ (η − η0 )) − M(β, η0 ) , τ →0 and in a similar way the Gâteaux derivatives ∇η Tj (β, η0)[η − η0 ] are defined. We need the following assumptions : (AN1) The matrix ∇β M(β, η) exists for β in a neighborhood B0 of β0 and is continuous in β for β = β0 . Moreover, ∇β M(β0 , η0 ) is non-singular. (AN2) Hk ([·, ∞) | ·) ∈ H for k = 0, 1. (AN3) The function β → φ(x, β) is continuously differentiable for all x ∈ X , and the derivative is bounded uniformly in x ∈ X and β ∈ B0 . Moreover, B0 is compact and β0 belongs to the interior of B0 . b k ([·, ∞) | ·) satisfies the following : (AN4) For k = 0, 1, the estimator H b k ([·, ∞) | ·) ∈ H) → 1 (i) P(H b k − Hk )([·, ∞) | ·)kH = oP (n−1/4 ) (ii) k(H 15 (iii) There exist functions Ψ1 and Ψ2 , such that 1 X k=0  Z E ψ1k (Y, X) ∗ −∞<u<Y = 1 n n X   b k − Hk )([u, ∞) | X) ψ2k (u, X)d (H Ψ1 (Yi , δi , Xi ) + R1n , i=1 and 1 X k,ℓ=0 ∗ E  ψ3k (Y, X) Z ψ4k (u, X)ψ5k −∞<u<Y n =    b (Hk − Hk )([u, ∞) | X), X dHℓ (u | X) 1X Ψ2 (Yi , δi , Xi ) + R2n , n i=1 where E∗ denotes conditional expectation given the data (Yi , δi , Xi ), 1 ≤ i ≤ n, the functions ψjk are defined in (7.13) in the Appendix, and where E[Ψℓ (Y, δ, X)] = 0, Rℓn = oP (n−1/2 ) (j = 1, . . . , 5; k = 0, 1; ℓ = 1, 2). Note that the above expectations are conditionally on the sample and are taken with respect to the generic variables Y, δ, X which have the same law as the sample. R∞p log N(ε, H, k · kH )dε < ∞, where N(ε, H, k · kH ) is the (AN5) The class H satisfies 0 ε-covering number of the space H with respect to the norm k · kH , i.e. the smallest number of balls of k · kH -radius ε needed to cover the space H. Theorem 4.2. Assume that βb − β0 = oP (1) and that (AN1)-(AN5) and (2.1), (2.2), (2.6), (2.14), (4.1) and (4.2) hold true. Then,  n1/2 βb − β0 ⇒ N (0, Ω), where  Ω = ∇β M(β0 , η0 )  V ∇β M(β0 , η0 )  and V = Var m(Y, δ, X; β0 , η0 ) + Ψ1 (Y, δ, X) + Ψ2 (Y, δ, X) . 4.3 −1 −1 Bootstrap consistency Although in principle one can use Theorem 4.2 above for making inference, the asymptotic variance Ω has a complicated structure, and the estimation of Ω would not only be cumbersome, but its precision for small samples could moreover be rather poor. We continue 16 this section by showing that a bootstrap procedure can be used to estimate the asymptotic b to approximate the whole distribution of βb or to construct confidence intervals variance of β, or test hypotheses regarding β0 . Here, we propose to use a naive bootstrap procedure, consisting in drawing triplets ∗ ∗ (Yi , δi , Xi∗ ), 1 ≤ i ≤ n, randomly with replacement from the data (Yi , δi , Xi ), 1 ≤ i ≤ n. b ∗ be the same estimator as H b k (k = 0, 1) but based on the bootstrap data, and for Let H k P each (β, η) let Mn∗ (β, η) = n−1 ni=1 m(Yi∗ , δi∗ , Xi∗ ; β, η). Define the bootstrap estimator βb∗ to be any sequence that satisfies b ηb)k = infβ∈B kM ∗ (β, ηb∗) − Mn (β, b ηb)k, kMn∗ (βb∗ , ηb∗ ) − Mn (β, n b ∗ ([t, ∞) | x), H b ∗ ([t, ∞) | x)). where ηb∗ (t, x) = (b η1∗ (t, x), ηb2∗ (t, x)) = (H 0 1 The following result shows that the bootstrap works, in the sense that it allows to recover correctly the distribution of n1/2 (βb − β0 ). Theorem 4.3. Assume that βb − β0 = oP (1) and that (AN1)-(AN5) hold true. Moreover, assume that ∇β M(β, η) is continuous in η (with respect to k · kH ) at (β, η) = (β0 , η0 ), and b k − Hk replaced by H b∗ − H b k (k = 0, 1) in P∗ -probability. Then, that (AN4) holds true with H k   b ≤ u − P n1/2 (βb − β0 ) ≤ u = oP (1), sup P∗ n1/2 (βb∗ − β) u∈Rp where P∗ denotes probability conditionally on the data (Yi , δi , Xi ), i = 1, . . . , n, and where the inequality sign means the component-wise inequality for vectors. 4.4 Verification of the assumptions for kernel estimators We finish this section with an illustration of the verification of the assumptions of our asymptotic results when the conditional subdistributions Hk are estimated by means of kernel smoothing. Consider the case where X is composed of continuous and discrete components, that is X = (Xc , Xd ) ∈ Xc × Xd ⊂ Rdc × Rdd , with dc + dd = d ≥ 1. For simplicity, assume that the support Xd of the discrete subvector Xd is finite. We also assume that the life time T has not been transformed by a logarithmic or other transformation, so that its support is [0, ∞]. The subdistributions Hk ([t, ∞) | x) could be estimated by means of a kernel estimator : b k ([t, ∞) | x) = H where for any (xc , xd ) ∈ Xc × Xd , n X i=1 e hn (Xi − x) K I(Yi ≥ t, δi = k), Pn e j=1 Khn (Xj − x) e hn (Xi − x) = Khn (Xc,i − xc )I(Xd,i = xd ), K 17 hn is a bandwidth sequence, Kh (·) = K(·/h)/hdc , K(u) = k(u1 ) · . . . · k(udc ) and k is a probability density function. Nonparametric smoothing of continuous covariates is possible for dimensions dc larger than 1. However, the technical arguments necessary to verify the assumptions used for the asymptotic results are tedious. Therefore, in the following we consider dc = 1. The discrete covariates do not contribute to the curse of dimensionality, and therefore dd could be larger than 1. However, for simplicity, below we do not consider discrete covariates. To satisfy assumption (AN4), we need to impose the following conditions : −1 (C1) The sequence hn satisfies nh4n → 0 and nh3+ζ → ∞ for some ζ > 0. n (log n) (C2) The support X of X is a compact subset of R. (C3) The probability density function K has compact support, twice continuously differentiable. R uK(u)du = 0 and K is Further, let F1 be the space of functions from [0, τ ] to [0, 1] with variation bounded by M, and let F2 be the space of continuously differentiable functions f from X to [−M, M] that satisfy supx∈X |f ′(x)| ≤ M and supx1 ,x2 ∈X |f ′(x1 ) − f ′ (x2 )|/|x1 − x2 |ǫ ≤ M for some M < ∞ and 0 < ǫ < 1. Let n ∂ η(·, x) ∈ F1 for all x ∈ X , H = (t, x) → η(t, x) : η(·, x) ∈ F1 , ∂x o and η(t, ·) ∈ F2 for all 0 ≤ t ≤ τ . We define the following norm associated with the space H : for η ∈ H, let kηkH = sup sup |η(t, x)|. 0≤t≤τ x∈X Then, it follows from Propositions 1 and 2 in Akritas and Van Keilegom (2001) that −1 b P(Hk ∈ H) → 1 provided nh3+ζ → ∞, with ζ > 0 as in condition (C1). Moreover, n (log n) b supx,t |Hk ([t, ∞) | x)−Hk ([t, ∞) | x)| = OP ((nhn )−1/2 (log n)1/2 ) = oP (n−1/4 ) (see Proposition 1 in Akritas and Van Keilegom 2001). The class H satisfies assumption (AN5) thanks to Lemma 6.1 in Lopez (2011). It remains to show the validity of assumption (AN4)(iii). We will show the first statement, the second one can be shown in a similar way. Note that the 18 left hand side equals Z 1 h X E ψ1k (Y, X)  X 1 ψ2k (u, X) fX−1 (X) Kh (Xi − X) d I(Yi ≥ u, δi = k) nh 0<u<Y i=1  i −1/2 −Hk ([u, ∞) | X) Yi , δi , Xi + oP (n ) k=0 n n 1 n h X X 1 −1 Kh (Xi − X) − ψ2k (Yi , X)I(Yi ≤ Y, δi = k) = E ψ1k (Y, X) fX (X) nh i=1 k=0 Z o i − ψ2k (u, X) dHk ([u, ∞) | X) Yi , δi , Xi + oP (n−1/2 ) =− 1 X k=0 0<u<Y n X −1 n − Z i=1 h n E ψ1k (Y, Xi ) ψ2k (Yi , Xi )I(Yi ≤ Y, δi = k) ψ2k (u, Xi ) dHk ((−∞, u] | Xi ) 0<u<Y o i Yi , δi , Xi , X = Xi + oP (n−1/2 + h2 ), which is of the required form. 5 Simulations In this section we will investigate the small sample performance of our estimation method. We consider the following model. The covariate X is generated from a uniform distribution on [−1, 1], and the conditional probability φ(x, β) of not being cured follows a logistic model : φ(x, β) = exp(β1 + β2 x) , 1 + exp(β1 + β2 x) for any −1 ≤ x ≤ 1. We will work with β0 = (β01 , β02 ) = (1.75, 2) and (1.1, 2), corresponding to an average cure rate of 20% respectively 30%. The conditional distribution function FT,0 (·|x) of the uncured individuals is constructed as follows. For a given X, we draw T from an exponential distribution with mean equal to exp[−(γ0 + γ1 x + γ2 /(1 + 2x2 ))], where γ0 = γ1 = 0.5 and γ2 ∈ {0, 1, 2}. Next, in order to respect condition (4.2), we truncate this distribution at τ , which is the quantile of order 0.97 of an exponential distribution with mean E{exp[−(γ0 + γ1 X + γ2 /(1 + 2X 2 ))]}, i.e. FT,0 ([0, t]|x) = 1 − exp[− exp(γ0 + γ1 x + γ2 /(1 + 2x2 ))t]I(0 ≤ t ≤ τ ). Note that this is the distribution function corresponding to a Cox model with baseline hazard equal to I(0 ≤ t ≤ τ ), and exponential factor equal to exp(γ0 + γ1 x + γ2 /(1 + 2x2 )). Next, we generate the censoring variable C independently of X from an exponential distribution with mean equal to 1.65 when β0 = (1.75, 2), and with mean 1.45 when β0 = (1.1, 2). In this way we have respectively 40% and 50% of censoring when γ2 = 0. 19 In what follows we will compare our estimator of β with the estimator proposed by Lu (2008) which assumes a Cox model for the uncured individuals. The exponential factor in the Cox model is assumed to be linear in the covariate X, and hence the Cox model will only be verified when γ2 = 0. The estimated β coefficients under the Cox model are obtained using the R package smcure. For our estimation procedure we used the kernel estimators given in Section 4.4, and we programmed βb using the optimization procedure optim in R. As starting values we used the estimator obtained from a logistic model based on the censoring indicator (as a surrogate for the unobserved cure indicator). However, due to the non-concavity of our likelihood function and due to the inconsistency of this vector of starting values, the procedure optim often ends up in a local maximum instead of the global maximum. To circumvent this problem, we added the following intermediate step to the estimation procedure. Based on the initial starting values, we estimate β from a logistic model based on the nonparametric estimator P FbT ([0, ∞)|x), so we maximize the log-likelihood ni=1 {(1 − FbT ([0, ∞)|Xi )) log(φ(Xi , β)) + FbT ([0, ∞)|Xi ) log(1 − φ(Xi , β))}. Since this log-likelihood is concave it has a unique local and global maximum, expected to be close to the maximizer of our likelihood. We now use this intermediate estimate as starting value for our likelihood maximization. The results of this two-step maximization procedure are given in Table 1 for the case where β0 = (1.75, 2), and in Table 2 for the case where β0 = (1.1, 2). A total of 500 samples of size n = 150 and n = 300 are generated, and the tables show the bias and mean squared error (MSE) of the estimators βb1 and βb2 obtained under the Cox model and from our procedure. The kernel function K is taken equal to the Epanechnikov kernel : b k (·|Xi ) (k = 0, 1) K(u) = (3/4)(1−u2)I(|u| ≤ 1). The bandwidth h of the kernel estimators H is taken proportional to n−2/7 so as to verify regularity condition (C1), i.e. h = cn−2/7 for several values of c, namely c = 2, 3 and 4. In addition, we also used the cross-validation (CV) procedure proposed by Li, Lin and Racine (2013) for kernel estimators of conditional distribution functions. The CV procedure is implemented in the package np in R. For each b 0 and H b 1 and used the average sample in our simulation, we calculated these bandwidths for H of these two bandwidths. The tables show that our estimator outperforms the one that is based on the Cox model, even when the Cox model is correct. They also show that our estimator is only mildly sensitive to the bandwidth, which could be explained by the fact that we average out the effect of the bandwidth. We also see that the CV selection of the bandwidth is working rather well, in the sense that the MSE is close to the smallest value among the MSE’s corresponding to the three fixed bandwidths. Next, we look at the estimation of the quartiles of the distribution FT,0 (·|x) when x = βb 0.25. We estimate these quartiles by means of our nonparametric estimator FbT,0 (·|x) and by means of the Cox model studied in Lu (2008). The results given in Tables 3 and 4 show that, as could be expected, when the Cox model is not satisfied (i.e. when γ2 = 1 or 2), the 20 n γ2 150 0 1 2 300 0 1 2 Par. β1 β2 β1 β2 β1 β2 β1 β2 β1 β2 β1 β2 c=2 Bias MSE .092 .230 .002 .540 .063 .123 -.099 .340 .045 .100 -.109 .242 .021 .100 -.081 .266 -.004 .060 -.107 .181 -.015 .050 -.124 .157 c=3 Bias MSE .012 .183 -.231 .438 -.021 .101 -.334 .331 -.029 .086 -.356 .277 -.029 .088 -.252 .268 -.048 .055 -.278 .208 -.059 .046 -.295 .198 c=4 Bias MSE -.075 .162 -.506 .510 -.094 .094 -.605 .505 -.099 .083 -.632 .497 -.081 .081 -.461 .363 -.097 .055 -.482 .328 -.107 .049 -.498 .329 hCV Bias MSE .044 .224 -.158 .536 .017 .120 -.246 .397 -.005 .101 -.302 .382 .004 .099 -.148 .288 -.013 .061 -.150 .201 -.030 .052 -.197 .217 Cox Bias MSE .216 .523 .291 1.15 .147 .191 .278 .635 .124 .145 .263 .476 .099 .139 .135 .365 .097 .092 .215 .302 .077 .074 .181 .247 Table 1: Bias and MSE of βb1 and βb2 for two sample sizes, three values of γ2 , three bandwidths of the form h = cn−2/7 and the bandwidth hCV obtained from cross-validation. Here, P (cured) = 0.2 and P (censoring) = 0.4 for γ2 = 0. The Cox model is satisfied for γ2 = 0. n γ2 150 0 1 2 300 0 1 2 Par. β1 β2 β1 β2 β1 β2 β1 β2 β1 β2 β1 β2 c=2 Bias MSE .082 .139 -.017 .418 .057 .076 -.107 .253 .049 .065 -.129 .202 .059 .074 -.068 .216 -.013 .036 -.117 .135 -.049 .028 -.295 .168 c=3 Bias MSE .003 .116 -.244 .365 -.011 .063 -.328 .277 -.016 .056 -.361 .260 -.010 .060 -.237 .226 -.043 .034 -.282 .175 -.080 .030 -.496 .306 c=4 Bias MSE -.060 .105 -.525 .477 -.068 .059 -.608 .478 -.071 .054 -.640 .493 -.058 .056 -.453 .326 -.074 .035 -.486 .306 -.037 .030 -.244 .194 hCV Bias MSE .031 .130 -.217 .419 .010 .071 -.294 .352 .006 .066 -.329 .358 .031 .073 -.153 .241 -.024 .035 -.187 .160 -.034 .030 -.217 .182 Cox Bias MSE .116 .189 .215 .618 .086 .099 .227 .434 .065 .078 .196 .329 .060 .083 .103 .257 .050 .047 .159 .197 .035 .037 .128 .156 Table 2: Bias and MSE of βb1 and βb2 for two sample sizes, three values of γ2 , three bandwidths of the form h = cn−2/7 and the bandwidth hCV obtained from cross-validation. Here, P (cured) = 0.3 and P (censoring) = 0.5 for γ2 = 0. The Cox model is satisfied for γ2 = 0. MSE of the quartiles obtained under the Cox model is much higher than the corresponding MSE obtained from our procedure. This shows the importance of having a model that does 21 n γ2 150 0 1 2 300 0 1 2 p .25 .50 .75 .25 .50 .75 .25 .50 .75 .25 .50 .75 .25 .50 .75 .25 .50 .75 c=2 Bias MSE .044 .061 .022 .049 .024 .083 .083 .053 .060 .051 .072 .089 .126 .060 .098 .058 .112 .107 .007 .032 -.001 .034 -.003 .053 .027 .026 .028 .031 .031 .055 .063 .031 .055 .033 .055 .058 c=3 Bias MSE .025 .035 .003 .031 .006 .055 .102 .039 .092 .041 .114 .075 .218 .082 .189 .073 .210 .120 -.007 .023 -.013 .023 -.019 .034 .049 .021 .054 .025 .053 .040 .129 .037 .121 .040 .109 .056 c=4 Bias MSE .030 .032 .003 .025 .001 .045 .155 .053 .144 .049 .154 .077 .325 .139 .291 .121 .296 .156 -.018 .018 -.026 .018 -.030 .026 .081 .021 .086 .025 .086 .038 .216 .065 .200 .062 .191 .074 hCV Bias MSE .033 .049 .011 .043 .011 .071 .096 .049 .073 .048 .091 .085 .202 .085 .172 .081 .187 .124 .002 .030 -.006 .031 -.009 .046 .033 .026 .034 .030 .033 .052 .096 .039 .086 .038 .084 .061 Cox Bias MSE .031 .027 .028 .023 .032 .038 .267 .104 .251 .093 .254 .117 .592 .401 .513 .308 .492 .322 .010 .013 .008 .013 .010 .023 .252 .081 .240 .076 .235 .086 .580 .366 .498 .274 .452 .248 Table 3: Bias and MSE of the conditional quantiles of order p = 0.25, 0.50 and 0.75 at x = 0.25 for two sample sizes, three bandwidths of the form h = cn−2/7 and the bandwidth hCV obtained from cross-validation. Here, P (cured) = 0.2 and P (censoring) = 0.4 for γ2 = 0. The Cox model is satisfied for γ2 = 0. not impose any assumptions on the distribution of the uncured individuals and which still provides very accurate estimators for the logistic part of the model. We also verify how close the distributions of βb1 and βb2 are to a normal distribution. We know thanks to Theorem 4.2 that the estimators converge to a normal limit when n tends to infinity. Figure 1 shows that for n = 150 the distribution is rather close to a normal limit, especially for βb1 . The figure is based on 1000 samples generated from the above model with P (cured) = 0.2 and P (censoring) = 0.4. The results for n = 300 (not shown here for space constraints) are close to a straight line, showing that the results improve when n increases. Finally, we verify the accuracy of the naive bootstrap proposed in Section 4.3. We consider the above model, but restrict attention to n = 150 and to the case where P (cured) = 0.2 and P (censoring) = 0.4. Figure 2 shows boxplots of the variance of βb1 and βb2 obtained from 250 bootstrap resamples for each of 500 samples. The bandwidth is h = 3n−2/7 . The empirical variance of the 500 estimators of β1 and β2 is also added, and shows that the bootstrap variance is well centered around the corresponding empirical variance. 22 n γ2 150 0 1 2 300 0 1 2 p .25 .50 .75 .25 .50 .75 .25 .50 .75 .25 .50 .75 .25 .50 .75 .25 .50 .75 c=2 Bias MSE .074 .095 .049 .069 .042 .098 .107 .072 .076 .060 .099 .113 .159 .085 .120 .066 .143 .135 .032 .042 .018 .039 .015 .060 .026 .033 .030 .036 .033 .060 .070 .040 .060 .038 .062 .066 c=3 Bias MSE .020 .049 .005 .041 .007 .063 .116 .053 .103 .049 .118 .083 .232 .097 .211 .089 .228 .142 -.005 .029 -.011 .026 -.018 .037 .046 .025 .052 .027 .050 .042 .132 .042 .125 .044 .115 .061 c=4 Bias MSE .021 .044 -.003 .031 -.005 .050 .151 .059 .142 .054 .154 .086 .322 .144 .296 .131 .308 .178 -.029 .023 -.035 .021 -.037 .028 .071 .023 .080 .026 .081 .040 .212 .064 .201 .064 .193 .078 hCV Bias MSE .046 .071 .023 .057 .024 .084 .119 .066 .088 .057 .109 .102 .233 .109 .195 .092 .219 .153 .016 .038 .007 .034 -.001 .054 .034 .031 .037 .034 .038 .055 .103 .046 .089 .043 .090 .070 Cox Bias MSE .039 .038 .031 .029 .034 .046 .274 .116 .255 .100 .257 .126 .586 .402 .508 .307 .489 .325 .018 .017 .013 .016 .016 .022 .252 .083 .234 .074 .232 .087 .570 .357 .492 .269 .451 .251 Table 4: Bias and MSE of the conditional quantiles of order p = 0.25, 0.50 and 0.75 at x = 0.25 for two sample sizes, three bandwidths of the form h = cn−2/7 and the bandwidth hCV obtained from cross-validation. Here, P (cured) = 0.3 and P (censoring) = 0.5 for γ2 = 0. The Cox model is satisfied for γ2 = 0. 6 Data analysis Let us now apply our estimation procedure on two medical data sets. The first one is about 286 breast cancer patients with lymph-node-negative breast cancer treated between 1980 and 1995 (Wang et al. (2005)). The event of interest is distant-metastasis, and the associated survival time is the distant metastasis-free survival time (defined as the time to first distant progression or death, whichever comes first). 107 of the 286 patients experience a relapse from breast cancer. The plot of the Kaplan-Meier estimator of the data is given in Figure 3(a) and shows a large plateau at about 0.60. Furthermore, a large proportion of the censored observations is in the plateau, which suggests that a cure model is appropriate for these data. As a covariate we use the age of the patients, which ranges from 26 to 83 years and the average age is about 54 years. We estimate β using our estimator and using the estimator based on the Cox model. The bandwidth h is selected using cross-validation, as in the simulation section. The estimated 23 0 1 2 3 1 2 2.5 3 −3 −2 −1 Theoretical Quantiles 0 1 2 3 Theoretical Quantiles −3 −2 −1 0 1 2 Theoretical Quantiles 3 −3 −2 −1 0 1 2 Theoretical Quantiles 3 4 3 2 1 Sample Quantiles 5 4 3 2 1 Sample Quantiles 8 6 4 2 0 Sample Quantiles 5 Theoretical Quantiles 0 1.5 Sample Quantiles −3 −2 −1 0.5 2.5 1.5 0.5 Sample Quantiles 4 3 2 1 Sample Quantiles 0 −3 −2 −1 −3 −2 −1 0 1 2 3 Theoretical Quantiles Figure 1: QQ-plots of βb1 (first row) and βb2 (second row) for 1000 samples of size n = 150. The first column corresponds to γ2 = 0, the second to γ2 = 1 and the third to γ2 = 2. The bandwidth is h = 3n−2/7 . intercept is -0.224 (with standard deviation equal to 0.447 obtained using a naive bootstrap procedure), and the estimated slope parameter is -0.005 (with standard deviation equal to 0.008). Under the Cox model the estimated intercept and slope are respectively 0.063 and -0.010. A 95% confidence interval is given by (−1.100, 0.653) for the intercept and (−0.021, 0.011) for the slope, where the variance is again based on the naive bootstrap procedure. The graph of the two estimators of the function φ(x) is given in Figure 3(b). The estimated coefficients and curves are quite close to each other, suggesting that the Cox model might be valid. This is also confirmed by Figure 3(c)-(d), which shows the estimation of the survival function 1 − FT,0 (·|x) of the uncured patients for x = 48 and x = 60 based on our estimation procedure and the procedure based on the Cox model. The figure shows that the two estimators are close for both values of x. Next, we analyse data provided by the Medical Birth Registry of Norway (see http://folk.uio.no/borgan/abg-2008/data/data.html). The data set contains information on births in Norway since 1967, related to a total of 53,558 women. We are interested in the time between the birth of the first and the second child, for those mothers whose first child died within the first year (n = 262). The covariate of interest is age (X), which is the age of the mother at the birth of the first child. The age ranges from 16.8 to 29.8 years, with an average of 23.2 years. The cure rate is the fraction of women who gave birth only once. 24 0.12 0.18 0.08 0.14 0.10 0.40 0.04 0.06 0.4 0.3 0.2 0.1 0.04 0.10 0.08 0.20 0.30 0.12 0.7 0.5 0.3 0.1 Figure 2: Boxplots of the variance of βb1 (first row) and βb2 (second row) obtained from 250 bootstrap resamples for each of 500 samples of size n = 150. The first column corresponds to γ2 = 0, the second to γ2 = 1 and the third to γ2 = 2. The bandwidth is h = 3n−2/7 . The empirical variance of the 500 estimators of β1 and β2 is also added (dashed line). Figure 4(a) shows the Kaplan-Meier estimator, and suggests that a cure fraction is present. As we did for the first data set, we analyse these data using the approach proposed in this paper, and also using the Cox mixture cure model. The estimated intercept equals 1.952 using our model and 0.034 using the Cox model. The bootstrap confidence interval for the intercept is (−1.577, 5.481) (the estimated standard deviation equals 1.801). The estimated slope equals -0.041 respectively 0.052 using the two models. For our estimation procedure the confidence interval is given by (−0.193, 0.111) (with estimated standard deviation equal to 0.078). Figure 4(b) shows that the two estimators of the function φ(x) are quite different, and have opposite slopes. Moreover, the survival function 1−FT,0 (·|x) of the uncured patients is given in Figure 4(c)-(d) for x = 21 and x = 25. We see that the estimator based on the Cox model is quite different from ours, suggesting that the Cox model might not be valid for these data, although a formal test would need to confirm this. This is however beyond the scope of this paper. Also note that the estimator of the cure proportion 1−φ(x) is increasing under our model and decreasing under the Cox model. It seems however natural to believe that the probability of having no second child (so the cure proportion) is increasing with age, which is again an indication that the Cox model is not valid for these data. 25 0.0 0.25 0.35 1−P(cured|X) 0.4 0.45 (b) 0.8 (a) 1000 2000 3000 4000 5000 30 40 50 60 t X (c) (d) 70 80 4000 5000 0.0 0.0 0.4 0.4 0.8 0.8 0 0 1000 2000 3000 4000 5000 0 t 1000 2000 3000 t Figure 3: Analysis of the breast cancer data : (a) Kaplan-Meier estimator; (b) Graph of the proposed estimator of φ(x) (solid curve) and of the estimator based on the Cox model (dashed curve); (c) Estimation of 1 − FT,0 (·|x) using the proposed estimator (solid curve) and using the estimator based on the Cox model (dashed curve) when x = 48; (d) Idem when x = 60. 7 Appendix : Proofs Proof of Proposition 3.1. By the properties of the likelihood of a Bernoulli random variable given that Y ∈ dt and X = x, we have " β φ(x, β)FT,0 (dt | x)FC ((t, ∞) | x) E δ log H1 (dt | x) h i  β FC (dt | x) φ(x, β)FT,0 ((t, ∞) | x) + 1 − φ(x, β) +(1 − δ) log Y ∈ dt, X = x ≤ 0. H0 (dt | x) Integrate with respect to Y and X and deduce that E [log p(Y, δ, X; β)] ≤ E [log p(Y, δ, X; β0 )] . 26 If there exists some β 6= β0 such that the last inequality becomes an equality, then necessarily p1 (Y, X; β) = 1 almost surely. Then β β0 FC ((t, ∞) | x)φ(x, β)FT,0 (dt | x) = FC ((t, ∞) | x)φ(x, β0 )FT,0 (dt | x), ∀ − ∞ < t ≤ τH (x), for almost all x ∈ X . By Theorem 2.1, we deduce that necessarily β = β0 . Lemma 7.1. Let conditions (4.2), (AC1) and (AC4) hold true. Then, sup sup |FbC ([t, ∞) | x) − FC ([t, ∞) | x)| = oP (1), x∈X t∈(−∞,τ ] sup sup b0, H b 1 )(t, x) − T1 (β, H0 , H1 )(t, x)| = oP (1), sup |T1 (β, H β∈B x∈X t∈(−∞,τ ] where T1 (β, H0, H1 )(t, x) = H([t, ∞) | x) − (1 − φ(x, β))FC ([t, ∞) | x), (b) 0.0 0.75 0.65 0.4 1−P(cured|X) 0.8 0.85 (a) 1000 2000 3000 4000 18 20 22 24 t X (c) (d) 26 28 30 0.0 0.0 0.4 0.4 0.8 0.8 0 0 1000 2000 3000 4000 0 t 1000 2000 3000 4000 t Figure 4: Analysis of the second birth data : (a) Kaplan-Meier estimator; (b) Graph of the proposed estimator of φ(x) (solid curve) and of the estimator based on the Cox model (dashed curve); (c) Estimation of 1 − FT,0 (·|x) using the proposed estimator (solid curve) and using the estimator based on the Cox model (dashed curve) when x = 21; (d) Idem when x = 25. 27 b 0, H b 1 ) is defined similarly, but with H0 , H1 and FC replaced by H b0, H b 1 and FbC , and T1 (β, H respectively. Moreover, β β sup |FbT,0 ([t, ∞) | x) − FT,0 ([t, ∞) | x)| = oP (1). sup sup β∈B x∈X t∈(−∞,τ ] Proof of Lemma 7.1. Let us first investigate the uniform convergence of the estimated cub C (· | x). For any t ∈ (−∞, τ ] let us write mulative hazard measure Λ Z Z b 0 (ds | x) H0 (ds | x) H b − ΛC ((−∞, t] | x) − ΛC ((−∞, t] | x) = b (−∞,t] H([s, ∞) | x) (−∞,t] H([s, ∞) | x) # " Z Z b 0 (ds | x) − H0 (ds | x) 1 H 1 b 0 (ds | x) + − H . = b H([s, ∞) | x) ∞) | x) H([s, ∞) | x) (−∞,t] (−∞,t] H([s, b 0 (ds | x) are well defined, since, with probability tending to The integrals with respect to H b 0 ((−∞, s] | x), s ∈ (−∞, τ ], is a function of bounded 1, for each x ∈ X , the map s 7→ H variation. The uniform convergence Assumption (AC1) implies that sup sup x∈X t∈(−∞,τ ] b C ((−∞, t] | x) − ΛC ((−∞, t] | x) Λ ≤ c sup sup x∈X t∈(−∞,τ ] n b 0 ([t, ∞) | x)−H0 ([t, ∞) | x) + H([t, b H ∞) | x)−H([t, ∞) | x) H([τ, ∞) | x)2 o , for some constant c > 0. Next, by Duhamel’s identity (see Gill and Johansen 1990), FbC ((t, ∞) | x) − FC ((t, ∞) | x) = −FC ((t, ∞) | x) Z  FbC ([s, ∞) | x)  b ΛC (ds | x) − ΛC (ds | x) . × (−∞,t] FC ((s, ∞) | x) b C (· | x) Then, the uniform convergence of FbC (· | x) follows from the uniform convergence of Λ b0, H b 1), and hence we omit and condition (4.2). The same type of arguments apply for T1 (β, H the details. Next, since by conditions (4.2) and (AC4) we have inf inf inf β∈B x∈X t∈(−∞,τ ] [H([t, ∞) | x) − (1 − φ(x, β))FC ([t, ∞) | x)] > 0, there exists some constant c > 0 with the property that   h i b P inf inf inf H([t, ∞) | x) − (1 − φ(x, β))FbC ([t, ∞) | x) ≥ c > 0 → 1. β∈B x∈X t∈(−∞,τ ] β Hence, the uniform convergence of FbT,0 (· | x) follows. 28 Proof of Theorem 4.1. Let us write β FT,0 ({Yi } | Xi ) = ΛβT,0 ({Yi } | β Xi )FT,0 ([Yi , ∞) β FT,0 ([Yi , ∞) | Xi ) | Xi ) = H1 ({Yi } | Xi ) , T1 (β, H0 , H1 )(Yi , Xi ) where T1 (β, H0, H1 )(t, x) = H([t, ∞) | x) − (1 − φ(x, β))FC ([t, ∞) | x). Moreover, let qi (β, H0 , H1 ) = q(β, H0, H1 )(Yi , δi , Xi ), where, for t ∈ R, d ∈ {0, 1}, x ∈ X , β q(β, H0, H1 )(t, d, x) = d{log φ(x, β) + log FT,0 ([t, ∞) | x) − log T1 (β, H0 , H1 )(t, x)} β + (1 − d) log{φ(x, β)FT,0 ([t, ∞) | x) + 1 − φ(x, β)}. Let n 1X Qn (β, H0 , H1) = qi (β, H0 , H1 ). n i=1 b0, H b 1 ) that is defined as Qn (β, H0, H1 ), but with H0 , H1 , Similarly, let us consider Qn (β, H β b0, H b 1 , FbC and Fbβ , respectively. Then the estimator βb in equation FC and FT,0 replaced by H T,0 (3.1) becomes b 0, H b 1 ). βb = arg max Qn (β, H β∈B The first step is to check that b0, H b 1 ) − Qn (β, H0, H1 ) = oP (1). sup Qn (β, H (7.12) β∈B This follows directly from Lemma 7.1. Next, given our assumptions, it is easy to check that for any t ∈ (−∞, τ ], d ∈ {0, 1}, x ∈ X , |q(β, H0 , H1 )(t, d, x) − q(β ′ , H0 , H1 )(t, d, x)| ≤ Ckβ − β ′ ka , ∀β, β ′ ∈ B, with a > 0 from Assumption (AC3) and some constant C depending only on c1 from Assumption (AC3) and the positive values inf x∈X H1 ({τ } | x) and inf x∈X H0 ((τ, ∞) | x). It follows that the class {(t, d, x) → q(β, H0, H1 )(t, d, x) : β ∈ B} is Glivenko-Cantelli. Hence, sup |Qn (β, H0 , H1 ) − Q(β, H0, H1 )| = oP (1), β∈B where Q = E(Qn ). Finally, Proposition 3.1 guarantees that β0 = arg max Q(β, H0 , H1 ). β∈B Gathering the facts, we deduce that βb − β0 = oP (1). 29 Proof of Theorem 4.2. We show the asymptotic normality of our estimator by verifying the high-level conditions in Theorem 2 in Chen et al. (2003). First of all, for the consistency we refer to Section 4.1, whereas conditions (2.1) and (2.2) in Chen et al. (2003) are satisfied by construction and thanks to assumption (AN1), respectively. Concerning (2.3), first note that the expression inside the expected value in ∇η M(β, η0 )[η − η0 ] is linear in ∇η Tj (β, η0 )[η − η0 ] (j = 1, 2, 3, 4). Hence, we will focus attention on the latter Gâteaux derivatives. First, ∇η T1 (β, η0)[η − η0 ](t, x) = (η1 − η01 + η2 − η02 )(t, x) − (1 − φ(x, β))∇η T2 (η0 )[η − η0 ](t, x). Using Duhamel’s formula (see Gill and Johansen 1990), we can write Z 1 ∇η T2 (η0 )[η − η0 ](t, x) = −T2 (η0 )(t, x) −∞<u<t (η01 + η02 )(u, x) − η01 ({u}, x) n η01 (du, x)(η1 + η2 − η01 − η02 )(u, x) o . × (η1 − η01 )(du, x) − (η01 + η02 )(u, x) In a similar way, we find that Z 1 −∞<u<t T1 (β, η0 )(u, x) − η02 ({u}, x)   n η02 (du, x) T1 (β, η) − T1 (β, η0 ) (u, x) o . × (η2 − η02 )(du, x) − T1 (β, η0 )(u, x) ∇η T3 (β, η0 )[η − η0 ](t, x) = −T3 (β, η0 )(t, x) Finally, ∇η T4 (β, η0 )[η − η0 ](t, x) ( Z ∇η T2 (η0 )[η − η0 ](s, x)η02 (ds, x) + T2 (η0 )(s, x)(η2 − η02 )(ds, x)   = −∇β φ(x, β) T1 (β, η0 )(s, x) T1 (β, η0 )(s, x) − η02 ({s}, x) (−∞,t) T2 (η0 )(s, x)η02 (ds, x)∇η T1 (β, η0 )[η − η0 ](s, x) − 2   T1 (β, η0 )(s, x) T1 (β, η0)(s, x) − η02 ({s}, x)  ) T2 (η0 )(s, x)η02 (ds, x) ∇η T1 (β, η0 )[η − η0 ](s, x) − (η2 − η02 )({s}, x) . −  2 T1 (β, η0 )(s, x) T1 (β, η0 )(s, x) − η02 ({s}, x) Note that all denominators in ∇η Tj (β, η0 )[η − η0 ](t, x) are bounded away from zero, thanks to (4.10) and (4.11). By tedious but rather elementary arguments, it follows from these formulae that k∇η Tj (β, η0 )[η − η0 ] − ∇η Tj (β0 , η0 )[η − η0 ]kH ≤ Ckβ − β0 kkη − η0 kH , for some constant C. Hence, it can be easily seen that ∇η Tj (β, η0)[η − η0 ] satisfies the second property in assumption (2.3) in Chen et al. (2003), and hence the same holds true for ∇η M(β, η0 )[η − η0 ]. Similarly, by decomposing Tj (β, η) − Tj (β, η0 ) − ∇η Tj (β, η0 )[η − η0 ] 30 using Taylor-type arguments (in η), the first property in assumption (2.3) is easily seen to hold true. Next, conditions (2.4) and (2.6) are satisfied thanks to Assumption (AN4) and because it follows from the above calculations of ∇η Tj (β, η0 )[η − η0 ] (j = 1, 2, 3, 4) that   Z X ∇η M(β0 , η0 )[η − η0 ] = E ψ1k (Y, X) ψ2k (u, X)d ((ηk − η0k )(u, X)) + X  E ψ3k (Y, X) k,ℓ∈{0,1} −∞<u<Y k∈{0,1} Z −∞<u<Y    ψ4k (u, X)ψ5k (ηk − η0k )(u, X) dHℓ (u | X) (7.13) for certain measurable functions ψjk (j = 1, . . . , 5; k = 0, 1). It remains to verify condition (2.5). Note that |m(t, δ, x; β2 , η2 ) − m(t, δ, x; β1 , η1 )| ≤ C1 (t, δ, x)kβ2 − β1 k + C2 (t, δ, x)kη2 − η1 kH for some functions Cj satisfying E[Cj2 (Y, δ, X)] < ∞ (j = 1, 2), and hence (2.5) follows from assumption (AN5) and Theorem 3 in Chen et al. (2003). This finishes the proof. Proof of Theorem 4.3. To prove this theorem we will check the conditions of Theorem B in Chen et al. (2003), which gives high level conditions under which the naive bootstrap is consistent. The only difference between their setting and our setting is that we are proving bootstrap consistency in P-probability, whereas their result holds true a.s. [P]. As a consequence, in their high level conditions we can replace all a.s. [P] statements by the corresponding statements in P-probability. First of all, it follows from assumption (AN1) that condition (2.2) in Chen et al. (2003) holds with η0 replaced by any η in a neighborhood of η0 , and from the proof of Theorem 4.2 it follows that the same holds true for condition (2.3). Next, conditions (2.4B) and (2.6B) in Chen et al. follow from the fact that we assume that assumption (AN4) continues to hold b k − Hk by H b∗ − H b k (k = 0, 1). It remains to verify condition (2.5’B) in true if we replace H k Chen et al. This follows from Theorem 3 in Chen et al., whose conditions have been verified already for our Theorem 4.2. References [1] Akritas, M.G. & Van Keilegom, I. (2001). Nonparametric estimation of the residual distribution. Scand. J. Statist. 28, 549–568. [2] Amico, M., Legrand, C. & Van Keilegom, I. (2017). The single-index/Cox mixture cure model (submitted). [3] Boag, J.W. (1949). Maximum likelihood estimates of the proportion of patients cured by cancer therapy. J. Roy. Statist. Soc. - Series B 11, 15–53. 31 [4] Chen, X., Linton, O. & Van Keilegom, I. (2003). Estimation of semiparametric models when the criterion function is not smooth. Econometrica 71, 1591–1608. [5] Fang, H.B., Li, G. & Sun, J. (2005). Maximum likelihood estimation in a semiparametric logistic/proportional-hazards mixture model. Scand. J. Statist. 32, 59–75. [6] Farewell, V.T. (1982). The use of mixture models for the analysis of survival data with long-term survivors. Biometrics 38, 1041–1046. [7] Gill, R.D. (1994). Lectures on survival analysis. Lectures on probability theory: Ecole d’été de probabilités de Saint-Flour XXII. Lecture notes in mathematics 1581. Springer. [8] Gill, R.D. & Johansen, S. (1990). A survey of product-integration with a view toward application in survival analysis. Ann. Statist. 18, 1501–1555. [9] Kuk, A.Y.C. & Chen, C.-H. (1992). A mixture model combining logistic regression with proportional hazards regression. Biometrika 79, 531–541. [10] Li, Q., Lin, J. & Racine, J.S. (2013). Optimal bandwidth selection for nonparametric conditional distribution and quantile functions. J. Buss. Econ. Statist. 31, 57–65. [11] López-Cheda, A., Cao, R., Jácome M.A. & Van Keilegom, I. (2017). Nonparametric incidence estimation and bootstrap bandwidth selection in mixture cure models. Comput. Statist. Data Anal. 105, 144–165. [12] Lopez, O. (2011). Nonparametric estimation of the multivariate distribution function in a censored regression model with applications. Commun. Stat. - Theory Meth. 40, 2639–2660. [13] Lu, W. (2008). Maximum likelihood estimation in the proportional hazards cure model. Ann. Inst. Stat. Math. 60, 545–574. [14] Maller, R.A. & Zhou, S. (1996). Survival Analysis with Long Term Survivors. Wiley, New York. [15] Meeker, W.Q. (1987). Limited failure population life tests: Application to integrated circuit reliability. Technometrics 29, 51–65. [16] Othus, M., Li, Y. & Tiwari, R.C. (2009). A class of semiparametric mixture cure survival models with dependent censoring. J. Amer. Statist. Assoc. 104, 1241–1250. [17] Peng, Y. & Taylor, J.M.G. (2014). Cure models. In: Klein, J., van Houwelingen, H., Ibrahim, J. G., and Scheike, T. H., editors, Handbook of Survival Analysis, Handbooks of Modern Statistical Methods series, chapter 6, pages 113-134. Chapman & Hall, Boca Raton, FL, USA. 32 [18] Schmidt, P. & Witte, A.D. (1989). Predicting criminal recidivism using split population survival time models. J. Econometrics 40, 141–159. [19] Sy, J.P. & Taylor, J.M.G. (2000). Estimation in a Cox proportional hazards cure model. Biometrics 56, 227–236. [20] Taylor, J.M.G. (1995). Semi-parametric estimation in failure time mixture models. Biometrics 51, 899–907. [21] van der Vaart, A.D. (1998). Asymptotic Statistics. Cambridge University Press. [22] Wang, Y., Klijn, J.G.M., Sieuwerts, A.M., Look, M.P., Yang, F., Talantov, D., Timmermans, M., Meijet-van Gelder, M.E.M., Yu, J., Jatkoe, T., Berns, E.M.J.J., Atkins, D. & Foekens, J.A. (2005). Gene-expression profiles to predict distant metastasis of lymph-node-negative primary breast cancer. The Lancet 365, 671–679. [23] Xu, J. & Peng, Y. (2014). Nonparametric cure rate estimation with covariates. Canad. J. Statist. 42, 1–17. 33
10math.ST
Time-Frequency Representation of Microseismic Signals using the Synchrosqueezing Transform Roberto H. Herrera∗ , Jean-Baptiste Tary and Mirko van der Baan. University of Alberta, Edmonton, Canada. [email protected] arXiv:1301.1295v1 [physics.geo-ph] 7 Jan 2013 Summary Resonance frequencies can provide useful information on the deformation occurring during fracturing experiments or CO2 management, complementary to the microseismic event distribution. An accurate time-frequency representation is of crucial importance prior to interpreting the cause of resonance frequencies during microseismic experiments. The popular methods of Short-Time Fourier Transform (STFT) and wavelet analysis have limitations in representing close frequencies and dealing with fast varying instantaneous frequencies and this is often the nature of microseismic signals. The synchrosqueezing transform (SST) is a promising tool to track these resonant frequencies and provide a detailed time-frequency representation. Here we apply the synchrosqueezing transform to microseismic signals and also show its potential to general seismic signal processing applications. Introduction Traditional time frequency representations, such as the Short-Time Fourier Transform (STFT) and the Wavelet Transform (WT) and special representations like Empirical Mode Decomposition (EMD), have limitations when signal components are not well separated in the time-frequency plane (Wu et al., 2011). Synchrosqueezing, first introduced in the context of speech signals (Daubechies and Maes, 1996) has shown to be an alternative to the EMD method (Daubechies et al., 2011), improving spectral resolution. On the other hand, these improvements in time-frequency representation can be applied to microseismic signals to increase the readability of the frequency spectrum (Auger and Flandrin, 1995) and identify independent components (Thakur et al., 2012). An accurate representation of resonance frequencies could help gain a better understanding of the fracturing process, as it is challenging to determine what is exactly beneath the Earth’s surface during the hydraulic fracturing process. In this paper we demonstrate the potentiality of the SST in time frequency representation of microseismic signals. First we describe the underlying modulation model for microseismic signals and then we validate the method with synthetic examples. Finally we apply SST to a real data sample with high amplitude noise. Theory Coherent signals in microseismic recordings can have both anthropogenic and natural sources. In both cases the signal has similar oscillatory characteristics and could be represented as the sum of individual time-varying harmonic components: K s(t) = ∑ Ak (t)cos(θk (t)) + η(t), (1) k=1 1 d where Ak (t) is the instantaneous amplitude and fk (t) = 2π dt θk is the instantaneous frequency (IF) of the resonator k. η(t) represents the additive noise, including the contribution of environmental and acquisition sources. K stands for the maximum number of components in one signal. GeoConvention 2013: Integration 1 Thus, microseismic signals show some similarities with the time-frequency representation (TFR) of speech signals (Daubechies and Maes, 1996). The number of harmonics or components in the signal (K) is random. They can appear at different time slot, with different amplitude (Ak (t)) and instantaneous frequency ( fk (t)). From CWT to SST The CWT of a signal s(t) is (Daubechies, 1992): 1 Ws (a, b) = √ a Z s(t)ψ ∗ ( t −b )dt, a (2) where ψ ∗ is the complex conjugate of the mother wavelet, b is the time shift applied to the mother wavelet which is also scaled by a. The CWT is simply the cross-correlation of the signal s(t) with a number of wavelets that are scaled and translated versions of the original mother wavelet. Ws (a, b) are the coefficients representing a concentrated time-frequency picture, which is used to extract the instantaneous frequencies (Daubechies et al., 2011). The wavelet coefficients Ws (a, b), often spreads out around the scale dimension a, leading to a blurred projection in time-scale representation. Daubechies and Maes (1996) show that if the smear in the b-dimension can be neglected, then the instantaneous frequency ωs (a, b) can be computed as the derivative of the wavelet transform at any point (a, b) for which Ws (a, b) 6= 0: ωs (a, b) = − j ∂Ws (a, b) . Ws (a, b) ∂b (3) The final step in the new time-frequency representation is to map the information from the timescale plane to the time-frequency plane. Every point (b, a) is converted to (b, ωs (a, b)), this operation is called synchrosqueezing (Daubechies et al., 2011). Since a and b are discrete values we can have a scaling step ∆ak = ak−1 − ak for any ak where Ws (a, b) is computed. Likewise, when mapping from the time-scale plane to the time-frequency plane (b, a) → (b, winst (a, b)), the synchrosqueezing transform Ts (w, b) is determined only at the centers ωl of the frequency range [ωl − ∆ω/2, ωl + ∆ω/2], with ∆ω = ωl − ωl−1 : 1 Ts (ωl , b) = Ws (ak , b)a−3/2 ∆ak . (4) ∑ ∆ω a :|ω(a ,b)−ω |≤∆ω/2 k k l The above equation shows that the time-frequency representation of the signal s(t) is synchrosqueezed along the frequency (or scale) axis only (Li and Liang, 2012). The synchrosqueezing transform reallocates the coefficients of the continuous wavelet transform to get a concentrated image over the timefrequency plane, from which the instantaneous frequencies are then extracted (Wu et al., 2011). This is an ultimate goal in microseismic signal analysis. The identified frequencies are used to describe their source mechanisms and eventually gain a better understanding of the reservoir deformation. Synthetic example Following the modulation model in Equation 1 we create a noiseless synthetic signal as the sum of the following components (the IF is in brackets): s1 (t) = 0.3 cos(10πt); [IF = 5]; s2 (t) = 0.8 cos(30πt); [IF = 15] s3 (t) = 0.7 cos(20πt + sin(πt)); [IF = 10 + cos(πt)/2]; s4 (t) = 0.4 cos(66πt + sin(4πt)); [IF = 33 + 2 cos(4πt)]; GeoConvention 2013: Integration 2 The synthetic signal s(t) (Figure 1a) has two constant harmonics of 5 Hz (s1 (t)) and 15 Hz (s2 (t)) from time 0 to 6 s, the 10 Hz component (s3 (t)) is modulated by a 0.5 Hz sinusoid from 6 to 10 s and a 2nd modulated signal with a central frequency of 33 Hz (s4 (t)) appears at time 4 s and vanishes at 7.8 s. Figure 1b) shows the instantaneous frequencies for each component. The STFT is able to identify the four components but with a low resolution (see Figure 1c), especially when they overlap at 6 s. On the other hand, the SST (Figure 1d) is able to perfectly delineate each individual component and to resolve the instantaneous frequencies close to the theoretical value, including s3 (t) and s4 (t) which are amplitude modulated. Figure 1 Synthetic Example. a) Synthetic signal with four sinusoidal components, b) the instantaneous frequencies obtained as the derivative of each one of the independent components. c) The STFT of the synthetic signal. A Hanning window of 321 samples and 50 % overlap was used. Note the smearing effect in the bandwidth. In d) the SST shows a sharper representation of the instantaneous frequencies. Application to real microseismic signals In this section we apply the SST to a real dataset. A two-stage microseismic experiment was recorded by twelve 3C geophones deployed in a vertical well. In both stages the sampling frequency was 4000 Hz. The receivers and fluid injection are located approximately at the same depth. The SST will be challenged by typical problems encountered in microseismic experiments analysis, i.e, time and frequency resolutions, noise stability and capability to identify localized frequency variations. A segment of 5 minutes of data, presenting clear resonance frequencies as well as sharp and smooth changes in frequency content, was chosen to challenge the performance of the SST representation. The STFT will be used as a reference, see Figure 2 upper plot. The STFT was calculated using a window length of 2 s with 50 % overlap, involving a time resolution of the same order. Four main resonance frequencies are clearly visible at approximately 18, 31, 35 and 52 Hz (Figure 2 top). Two additional lines of lower amplitude are also visible at 60 Hz and between the lines at 31 and 35 Hz. At approximately 90 s, the amplitude of all lines becomes weaker, the one at 52 Hz almost vanishes. The line at 31 Hz abruptly drops down to 27 Hz while smooth changes are barely discernible on the 18 Hz line. The fuzzy background is not only due to the high amplitude noise present in the data but also to spectral leakage introduced by the Fourier transform. Despite the high-amplitude noise, the resonance frequencies as well as their variations are all clearly visible on the SST representation (Figure 2 bottom). The SST is able to map smooth and sharp changes in the frequency lines. Compared with the STFT, the SST brings out the resonance frequencies more sharply, improving significantly the frequency resolution. The SST is then able to GeoConvention 2013: Integration 3 distinguish between the different lines constituting the resonance frequency at 18 Hz while the STFT cannot. Last but not least, the SST determines the IFs at all times. Therefore, the time resolution of this method is not limited by the size of any window. For the SST we use a bump wavelet with a ratio central frequency to bandwidth of 50. The discretization of the scales of CWT was 64. The SST produces a sharper time-frequency representation showing frequency components that were hidden in the STFT representation. Figure 2 Real example. Upper plot shows the STFT and the lower plot the SST. The SST is able to delineate the spectral components some of them were missing in the STFT representation. Conclusions We have introduced the Synchrosqueezing transform with application to microseismic signal analysis. This new transform shows promising results in the identification of resonant components and hence in the explanation of microseismic phenomena. The enhancement in spectral resolution allows the separation of close spectral bands while the short-time Fourier transform smears out these frequency components. SST is therefore attractive for high-resolution time-frequency analysis of microseismic signals. Acknowledgements The authors thank the sponsors of the BLind Identification of Seismic Signals (BLISS) Project and the Microseismic Industry Consortium for their financial support. The authors gratefully acknowledge an anonymous company for permission to show and use their data. References Auger, F. and P. Flandrin, 1995, Improving the readability of time-frequency and time-scale representations by the reassignment method: IEEE Trans. Signal Process., 43, 1068–1089. Daubechies, I., 1992, Ten lectures on wavelets: Society for Industrial and Applied Mathematics.: Presented at the CBMS-NSF regional conference series in applied mathematics. Daubechies, I., J. Lu, and H.-T. Wu, 2011, Synchrosqueezed wavelet transforms: An empirical mode decomposition-like tool: Applied and Computational Harmonic Analysis, 30, 243–261. Daubechies, I. and S. Maes, 1996, A nonlinear squeezing of the continuous wavelet transform based on auditory nerve models: Wavelets in Medicine and Biology, 527–546, CRC Press. Li, C. and M. Liang, 2012, A generalized synchrosqueezing transform for enhancing signal time-frequency representation: Signal Processing, 92, 2264–2274. Thakur, G., E. Brevdo, N. Fuc̆kar, and H. Wu, 2012, The Synchrosqueezing algorithm for time-varying spectral analysis: robustness properties and new paleoclimate applications: MITRE Technical paper, http://arxiv.org/abs/1105.0010, 1–29. Wu, H.-T., P. Flandrin, and I. Daubechies, 2011, One or Two Frequencies? the Synchrosqueezing Answers: Advances in Adaptive Data Analysis (AADA), 03, 29–39. GeoConvention 2013: Integration 4
5cs.CE
On Constructor Rewrite Systems and the Lambda-Calculus Ugo Dal Lago∗ Simone Martini† arXiv:0904.4120v4 [cs.PL] 2 Aug 2012 January 15, 2018 Abstract We prove that orthogonal constructor term rewrite systems and lambda-calculus with weak (i.e., no reduction is allowed under the scope of a lambda-abstraction) call-by-value reduction can simulate each other with a linear overhead. In particular, weak call-by-value betareduction can be simulated by an orthogonal constructor term rewrite system in the same number of reduction steps. Conversely, each reduction in an term rewrite system can be simulated by a constant number of beta-reduction steps. This is relevant to implicit computational complexity, because the number of beta steps to normal form is polynomially related to the actual cost (that is, as performed on a Turing machine) of normalization, under weak call-by-value reduction. Orthogonal constructor term rewrite systems and lambda-calculus are thus both polynomially related to Turing machines, taking as notion of cost their natural parameters. 1 Motivations Implicit computational complexity is a young research area, whose main aim is the description of complexity phenomena based on language restrictions, and not on external measure conditions or on explicit machine models. It borrows techniques and results from mathematical logic (model theory, recursion theory, and proof theory) and in doing so it has allowed the incorporation of aspects of computational complexity into areas such as formal methods in software development and programming language design. The most developed area of implicit computational complexity is probably the model theoretic one – finite model theory being a very successful way to describe complexity classes. In the design of programming language tools (e.g., type systems), however, syntactical techniques prove more useful. In the last years we have seen much work restricting recursive schemata and developing general proof theoretical techniques to enforce resource bounds on programs. Important achievements have been the characterizations of several complexity classes by means of limitations of recursive definitions (e.g., [3, 10]) and, more recently, by using the “light ” fragments of linear logic [7]. Moreover, rewriting techniques such as recursive path orderings and the interpretation method have recently been proved useful in the field [11]. By borrowing the terminology from software design technology, we may dub this area as implicit computational complexity in the large, aiming at a broad, global view on complexity classes. We may have also an implicit computational complexity in the small — using logic to study single machine-free models of computation. Indeed, many models of computations do not come with a natural cost model — a definition of cost which is both intrinsically rooted in the model of computation, and, at the same time, it is polynomially related to the cost of implementing that model of computation on a standard Turing machine. The main example is the λ-calculus: The most natural intrinsic parameter of a computation is its number of beta-reductions, but this very parameter bears no relation, in general, with the actual cost of performing that computation, since ∗ Dipartimento di Scienze dell’Informazione, Università di Bologna, Mura Anteo Zamboni 7, 40127 Bologna, Italy. [email protected] † Dipartimento di Scienze dell’Informazione, Università di Bologna, Mura Anteo Zamboni 7, 40127 Bologna, Italy. [email protected] 1 a beta-reduction may involve the duplication of arbitrarily big subterms1 . What we call implicit computational complexity in the small, therefore, gives complexity significance to notions and results for computation models where such natural cost measures do not exist, or are not obvious. In particular, it looks for cost-explicit simulations between such computational models. The present paper applies this viewpoint to the relation between λ-calculus and orthogonal (constructor) term rewrite systems. We will prove that these two machine models simulate each other with a linear overhead. That each constructor term rewrite system could be simulated by λ-terms and beta-reduction is well known, in view of the availability, in λ-calculus, of fixed-point operators, which may be used to solve the mutual recursion expressed by first-order rewrite rules. Here (Section 4) we make explicit the complexity content of this simulation, by showing that any first-order rewriting of n steps can be simulated by kn beta steps, where k depends on the specific rewrite system but not on the size of the involved terms. Crucial to this result is the encoding of constructor terms using Scott’s schema for numerals [19]. Indeed, Parigot [12] (see also [13]) shows that in the pure λ-calculus Church numerals do not admit a predecessor working in a constant number of beta steps. Moreover, Splawski and Urzyczyn [17] show that it is unlikely that our encoding could work in the typed context of System F. Section 3 studies the converse – the simulation of (weak) λ-calculus reduction by means of orthogonal constructor term rewrite systems. We give an encoding of λ-terms into a (first-order) constructor term rewrite system. We write [·]Φ for the map returning a first-order term, given a λterm; [M ]Φ is, in a sense, a complete defunctionalization of the λ-term M , where any λ-abstraction is represented by an atomic constructor. This is similar, although not technically the same, to the use of supercombinators (e.g., [9]). We show that λ-reduction is simulated step by step by first-order rewriting (Theorem 1). As a consequence, taking the number of beta steps as a cost model for weak λ-calculus is equivalent (up to a linear function) to taking the number of rewritings in orthogonal constructor term rewrite systems. This is relevant to implicit computational complexity “in the small”, because the number of beta steps to normal form is polynomially related to the actual cost (that is, as performed on a Turing machine) of normalization, under weak call-by-value reduction. This has been established by Sands, Gustavsson, and Moran [16], by a fine analysis of a λ-calculus implementation based on a stack machine. Constructor term rewrite systems and λ-calculus are thus both reasonable machines (see the “invariance thesis” in [18]), taking as notion of cost their natural, intrinsic parameters. As a byproduct, in Section 5 we sketch a different proof of the cited result in [16]. Instead of using a stack machine, we show how we could encode constructor term rewriting in term graph rewriting. In term graph rewriting we avoid the explicit duplication and substitution inherent to rewriting (and thus also to beta-reduction) and, moreover, we exploit the possible sharing of subterms. A more in-depth study of the complexity of (constructor) graph rewriting and its relations with (constructor) term rewriting can be found in our [5]. In Section 6, we show how to obtain the same results of the previous sections when call-by-name replaces call-by-value as the underlying strategy in the lambda-calculus. This paper is an extended version of the one with the same title appeared in the proceedings of ICALP 2009 [6]. Besides including full proofs, it has an extended Section 5 and the new material of Section 6. 2 Preliminaries The language we study is the pure untyped λ-calculus endowed with weak (that is, we never reduce under an abstraction) call-by-value reduction. Definition 1 The following definitions are standard: 1 In full beta-reduction, the size of the duplicated term is indeed arbitrary and does not depend on the size of the original term the reduction started from. The situation is much different with weak reduction, as we will see. 2 • Terms are defined as follows: M ::= x | λx.M | M M, where x ranges a denumerable set Υ. Λ denotes the set of all λ-terms. We assume the existence of a fixed, total, order on Υ; this way FV(M ) will be a sequence (without repetitions) of variables, not a set. A term M is said to be closed if FV(M ) = ε, where ε is the empty sequence. • Values are defined as follows: V ::= x | λx.M. • Weak call-by-value reduction is denoted by →v and is obtained by closing call-by-value reduction under any applicative context: M →v N M L →v N L (λx.M )V →v M {V /x} M →v N LM →v LN Here M ranges over terms, while V ranges over values. • The length |M | of M is defined as follows, by induction on M : |x| = 1, |λx.M | = |M | + 1 and |M N | = |M | + |N | + 1. Weak call-by-value reduction enjoys many nice properties. In particular, the one-step diamond property holds and, as a consequence, the number of beta steps to normal form (if any) is invariant on the reduction order [4] (this justifies the way we defined reduction, which is slightly more general than Plotkin’s one [14]). It is then meaningful to define Time v (M ) as the number of beta steps to normal form (or ω if such a normal form does not exist). This cost model will be referred to as the unitary cost model, since each beta (weak call-by-value) reduction step counts for 1 in the global cost of normalization. Moreover, notice that α-conversion is not needed during reduction of closed terms: if M →v N and M is closed, then the reduced redex will be in the form (λx.L)V , where V is a closed value. As a consequence, arguments are always closed and open variables cannot be captured. The following lemma gives us a generalization of the fixed-point (call-by-value) combinator (but observe the explicit limit k on the reduction length, in the spirit of implicit computational complexity in the small): Lemma 1 For every natural number n, there are terms H1 , . . . , Hn and a natural number m such that for any sequence of values V1 , . . . , Vn and for any 1 ≤ i ≤ n: Hi V1 . . . Vn →kv Vi (λx.H1 V1 . . . Vn x) . . . (λx.Hn V1 . . . Vn x), where k ≤ m. Proof. The terms we are looking for are simply the following: Hi ≡ M i M 1 . . . M n where, for every 1 ≤ j ≤ n, Mj ≡ λx1 . . . . .λxn .λy1 . . . . .yn .yj (λz.x1 x1 . . . xn y1 . . . yn z) . . . (λz.xn x1 . . . xn y1 . . . yn z). The natural number m is simply 2n. ✷ We will consider in this paper orthogonal constructor (term) rewrite systems (CRS, see [2]). A constructor (term) rewrite system is a pair Ξ = (ΣΞ , RΞ ) where: • Symbols in the signature ΣΞ can be either constructors or function symbols, each with its arity. • Terms in C(Ξ) are those built from constructors and are called constructor terms. • Terms in P(Ξ, Υ) are those built from constructors and variables and are called patterns. • Terms in T (Ξ) are those built from constructor and function symbols and are called closed terms. 3 • Terms in V(Ξ, Υ) are those built from constructors, functions symbols and variables in Υ and are dubbed terms. • Rules in RΞ are in the form f (p1 , . . . , pn ) →Ξ t where f is a function symbol, p1 , . . . , pn ∈ P(Ξ, Υ) and t ∈ V(Ξ, Υ). We here consider orthogonal rewrite systems only, i.e. we assume that no distinct two rules in RΞ are overlapping and that every variable appears at most once in the lhs of any rule in RΞ . Moreover, we assume that reduction is call-by-value, i.e. the substitution triggering any reduction must assign constructor terms to variables. This restriction is anyway natural in constructor rewriting. For any term t in a CRS, |t| denotes the number of symbol occurrences, while |t|f denotes the number of occurrences of the symbol f in t. 3 From Lambda-Calculus to Constructor Term Rewriting Definition 2 (The CRS Φ) The constructor rewrite system Φ is defined as a set of rules RΦ over an infinite signature ΣΦ . In particular: • The signature ΣΦ includes the binary function symbol app and constructor symbols cx,M for every M ∈ Λ and every x ∈ Υ. The arity of cx,M is the length of FV(λx.M ). To every term M ∈ Λ we can associate a term [M ]Φ ∈ V(Φ, Υ) as follows: [x]Φ [λx.M ]Φ = = x; cx,M (x1 , . . . , xn ), where FV(λx.M ) = x1 , . . . , xn ; [M N ]Φ = app([M ]Φ , [N ]Φ ). Observe that if M is closed, then [M ]Φ ∈ T (Φ). • The rewrite rules in RΦ are all the rules in the following form: app(cx,M (x1 , . . . , xn ), x) → [M ]Φ , where FV(λx.M ) = x1 , . . . , xn . • A term t ∈ T (Φ) is canonical if either t ∈ C(Φ) or t = app(u, v) where u and v are themselves canonical. Notice that the signature ΣΦ contains an infinite amount of constructors. Example 1 Consider the λ-term M = (λx.xx)(λy.yy). [M ]Φ is t ≡ app(cx,xx , cy,yy ). Moreover, t → app(cy,yy , cy,yy ) ≡ u, as expected. Finally, we have u → u. To any term in V(Φ, Υ) corresponds a λ-term in Λ: Definition 3 To every term t ∈ V(Φ, Υ) we can associate a term htiΛ ∈ Λ as follows: hxiΛ = x happ(u, v)iΛ hcx,M (t1 , . . . tn )iΛ = = huiΛ hviΛ (λx.M ){ht1 iΛ /x1 , . . . , htn iΛ /xn } where FV(λx.M ) = x1 , . . . , xn . Canonicity holds for terms in Φ obtained as images of (closed) λ-terms via [·]Φ . Moreover, canonicity is preserved by reduction in Φ: Lemma 2 For every closed M ∈ Λ, [M ]Φ is canonical. Moreover, if t is canonical and t → u, then u is canonical. Proof. [M ]Φ is canonical for any M ∈ Λ by induction on the structure of M (which, by hypothesis, is either an abstraction or an application N L where both N and L are closed). We can further prove that v = [M ]Φ {t1 /x1 , . . . tn /xn } is canonical whenever t1 , . . . , tn ∈ C(Φ) and x1 , . . . , xn includes all the variables in FV(M ): 4 • If M = xi , then v = ti , which is clearly canonical. • If M = N L, then v = = [N L]Φ {t1 /x1 , . . . tn /xn } app ([N ]Φ {t1 /x1 , . . . tn /xn }, [L]Φ {t1 /x1 , . . . tn /xn }) which is canonical, by IH. • If M = λy.N , then v = [λy.N ]Φ {t1 /x1 , . . . tn /xn } = cy,N (xi1 , . . . , xim ){t1 /x1 , . . . tn /xn } = cy,N (ti1 , . . . , tim ) which is canonical, because each ti is in C(Φ). This implies the rhs of any instance of a rule in RΦ is canonical. As a consequence, u is canonical whenever t → u and t is canonical. This concludes the proof. ✷ For canonical terms, being a normal form is equivalent of being mapped to a normal form via h·iΛ . This is not true, in general: take as a counterexample cx,y (app(cz,z , cz,z )), which corresponds to λx.(λz.z)(λz.z) via h·iΛ . Lemma 3 A canonical term t is a normal form iff htiΛ is a normal form. Proof. If a canonical t is a normal form, then t does not contain the function symbol app and, as a consequence, htiΛ is an abstraction, which is always a normal form. Conversely, if htiΛ is a normal form, then t is not in the form app(u, v), because otherwise htiΛ will be a (closed) application, which cannot be a normal form. But since t is canonical, t ∈ C(Φ), which only contains terms in normal form. ✷ The following substitution lemma will be useful later. Lemma 4 For every term t ∈ V(Φ, Υ) and every t1 , . . . , tn ∈ C(Φ), ht{t1 /x1 , . . . , tn /xn }iΛ = htiΛ {ht1 iΛ /x1 , . . . , htn iΛ /xn } whenever x1 , . . . , xn includes all the variables in t. Proof. By induction on t: • If t = xi , then ht{t1 /x1 , . . . , tn /xn }iΛ = hxi {t1 /x1 , . . . , tn /xn }iΛ = hti iΛ = xi {ht1 iΛ /x1 , . . . , htn iΛ /xn } = t{ht1 iΛ /x1 , . . . , htn iΛ /xn }. • If t = app(u, v), then ht{t1 /x1 , . . . , tn /xn }iΛ = happ(u, v){t1 /x1 , . . . , tn /xn }iΛ = happ(u{t1 /x1 , . . . , tn /xn }, v{t1 /x1 , . . . , tn /xn })iΛ = hu{t1 /x1 , . . . , tn /xn }iΛ hv{t1 /x1 , . . . , tn /xn }iΛ = huiΛ {ht1 iΛ /x1 , . . . , htn iΛ /xn }hviΛ {ht1 iΛ /x1 , . . . , htn iΛ /xn } = huiΛ hviΛ {ht1 iΛ /x1 , . . . , htn iΛ /xn } = happ(u, v)iΛ {ht1 iΛ /x1 , . . . , htn iΛ /xn } = htiΛ {ht1 iΛ /x1 , . . . , htn iΛ /xn }. 5 • If t = cy,N (u1 , . . . , um ), then ht{t1 /x1 , . . . , tn /xn }iΛ = hcy,N (u1 , . . . , um ){t1 /x1 , . . . , tn /xn }iΛ = = hcy,N (u1 {t1 /x1 , . . . , tn /xn }, . . . , um {t1 /x1 , . . . , tn /xn })iΛ (λy.N ){hu1 {t1 /x1 , . . . , tn /xn }iΛ /xi1 ,..., hum {t1 /x1 , . . . , tn /xn }iΛ /xim } = (λy.N ){hu1 iΛ {ht1 iΛ /x1 , . . . , htn iΛ /xn }/xi1 ,..., = hum iΛ {ht1 iΛ /x1 , . . . , htn iΛ /xn }/xim } ((λy.N ){hu1 iΛ /x1 , . . . , um /xi1 }){ht1 iΛ /x1 , . . . , htn iΛ /xn } = = hcy,N (u1 , . . . , um )iΛ {ht1 iΛ /x1 , . . . , htn iΛ /xn } htiΛ {ht1 iΛ /x1 , . . . , htn iΛ /xn }. This concludes the proof. ✷ Lemma 5 For every λ-term M ∈ Λ, h[M ]Φ iΛ = M . Proof. By induction on M : • If M = x, then h[M ]Φ iΛ = h[x]Φ iΛ = hxiΛ = x. • If M = N L, then h[M ]Φ iΛ = happ([N ]Φ , [L]Φ )iΛ = h[N ]Φ iΛ h[L]Φ iΛ = N L. • If M = λy.N , then h[M ]Φ iΛ = hcy,N (x1 , . . . , xn )iΛ = (λy.N ){x1 /x1 , . . . , xn /xn } = λy.N = M. This concludes the proof. ✷ The previous two lemmas implies that if M ∈ Λ, t1 , . . . , tn ∈ C(Φ) and x1 , . . . , xn includes all the variables in FV(M ), then: h[M ]Φ {t1 /x1 , . . . , tn /xn }iΛ = M {ht1 iΛ /x1 , . . . , htn iΛ /xn }. (1) Reduction in Φ can be simulated by reduction in the λ-calculus, provided the starting term is canonical. Lemma 6 If t is canonical and t → u, then htiΛ →v huiΛ . Proof. Consider the (instance of the) rewriting rule which turns t into u. Let it be app(cy,M (t1 , . . . , tn ), v) → [M ]Φ {t1 /x1 , . . . , tn /xn , v/y}. Clearly, happ(cy,M (t1 , . . . , tn ), v)iΛ = ((λy.M ){t1 /x1 , . . . , tn /xn })hviΛ while, by (1): h[M ]Φ {t1 /x1 , . . . , tn /xn , v/y}iΛ = M {ht1 iΛ /x1 , . . . , htn iΛ /xn , hviΛ /y} which implies the thesis. ✷ Conversely, call-by-value reduction in the λ-calculus can be simulated in Φ: 6 Lemma 7 If M →v N , t is canonical and htiΛ = M , then t → u, where huiΛ = N . Proof. Let (λx.L)V be the redex fired in M when rewriting it to N . There must be a corresponding subterm v of t such that hviΛ = (λx.L)V . Then v = app(cx,P (t1 , . . . , tn ), w), where hcx,P (t1 , . . . , tn )iΛ = λx.L. and hwiΛ = V . Observe that, by definition, hcx,P (t1 , . . . , tn )iΛ = (λx.P ){ht1 iΛ /x1 , . . . , htn iΛ /xn } where FV(P ) = x1 , . . . , xn . Since t is canonical, t1 , . . . , tn ∈ C(Φ). Moreover, since V is a value, w itself is in C(Φ).This implies app(cx,P (t1 , . . . , tn ), w) → [P ]Φ {t1 /x1 , . . . , tn /xn , w/x}. By (1): h[P ]Φ {t1 /x1 , . . . , tn /xn , w/x}iΛ = P {ht1 iΛ /x1 , . . . , htn iΛ /xn , hwiΛ /x} = (P {ht1 iΛ /x1 , . . . , htn iΛ /xn }){hwiΛ /x} = (λx.L){V /x}. This concludes the proof. ✷ The previous lemmas altogether imply the following theorem, by which λ-calculus normalization can be mimicked (step-by-step) by reduction in Φ: Theorem 1 (Term Reducibility) Let M ∈ Λ be a closed term. The following two conditions are equivalent: 1. M →nv N where N is in normal form; 2. [M ]Φ →n t where htiΛ = N and t is in normal form. Proof. Suppose M →nv N , where N is in normal form. Then, by applying Lemma 7, we obtain a term t such that [M ]Φ →n t and htiΛ = N . By Lemma 2, t is canonical and, by Lemma 3, it is in normal form. Now, suppose [M ]Φ →n t where htiΛ = N and t is in normal form. By applying n times Lemma 6, we obtain h[M ]Φ iΛ →nv htiΛ = N . But h[M ]Φ iΛ = M by Lemma 5 and N is a normal form by Lemma 3, since [M ]Φ and t are canonical by Lemma 2. ✷ There is another nice property of Φ, that will be crucial in proving the main result of this paper: Proposition 1 For every M ∈ Λ, for every t with [M ]Φ →∗ t and for every occurrence of a constructor cx,N in t, N is a subterm of M . Proof. Assume [M ]Φ →n t and proceed by induction on n. ✷ Example 2 Let us consider the λ-term M = (λx.(λy.x)x)(λz.z). Notice that M →v (λy.(λz.z))(λz.z) →v λz.z. Clearly [M ]Φ = app(cx,(λy.x)x , cz,z ). Moreover: app(cx,(λy.x)x , cz,z ) → app(cy,x (cz,z ), cz,z ) → cz,z . For every constructor cw,N occurring in any term in the previous reduction sequence, N is a subterm of M . 7 A remark on Φ is now in order. Φ is an infinite CRS, since ΣΦ contains an infinite amount of constructor symbols and, moreover, there are infinitely many rules in RΦ . As a consequence, what we have presented here is an embedding of the (weak, call-by-value) λ-calculus into an infinite (orthogonal) CRS. Consider, now, the following scenario: suppose the λ-calculus is used to write a program M , and suppose that inputs to M form an infinite set of λ-terms Θ which can anyway be represented by a finite set of constructors in Φ. In this scenario, Proposition 1 allows to conclude the existence of finite subsets of ΣΦ and RΦ such that every M N (where N ∈ Θ) can be reduced via Φ by using only constructors and rules in those finite subsets. As a consequence, we can see the above schema as one that puts any program M in correspondence to a finite CRS. Finally, observe that assuming data to be representable by a finite number of constructors in Φ is reasonable. Scott’s scheme [19], for example, allows to represent any term in a given free algebra in a finitary way, e.g. the natural number 0 becomes ⌈0⌉ ≡ cy,λz.z while n + 1 becomes ⌈n + 1⌉ ≡ cy,λz.yx (⌈n⌉). Church’s scheme, on the other hand, does not have this property. 4 From Constructor Term Rewriting to Lambda-Calculus In this Section, we will show that any rewriting step of a constructor rewrite system can be simulated by a fixed number of weak call-by-value beta-reductions. Let Ξ be an orthogonal constructor rewrite system over a finite signature ΣΞ . Let c1 , . . . , cg be the constructors of Ξ and let f1 , . . . , fh be the function symbols of Ξ. The following constructions work independently of Ξ. We will first concentrate on constructor terms, encoding them as λ-terms using Scott’s schema [19]. Constructor terms can be easily put in correspondence with λ-terms by way of a map hh·iiΛ defined by induction as follows: hhci (t1 . . . , tn )iiΛ ≡ λx1 . . . . .λxg .λy.xi hht1 iiΛ . . . hhtn iiΛ . This way constructors become functions: hhci iiΛ ≡ λx1 . . . . .λxar (ci ) .λy1 . . . . .λyg .λz.yi x1 . . . xar (ci ) . Trivially, hhci iiΛ hht1 iiΛ . . . hhtn iiΛ rewrites to hhci (t1 . . . tn )iiΛ in ar (ci ) steps. To represent an error value, we use the λ-term ⊥ ≡ λx1 . . . . .λxg .λy.y. A λ-term built in this way, i.e. a λ-term which is either ⊥ or in the form hhtiiΛ is denoted with metavariables like X or Y . The map hh·iiΛ defines encodings of constructor terms. But what about terms containing function symbols? The goal is defining another map [·]Λ returning a λ-term given any term t in T (Ξ), in such a way that t →∗ u and u ∈ C(Ξ) implies [t]Λ →∗v hhuiiΛ . Moreover, [t]Λ should rewrite to ⊥ whenever the rewriting of t causes an error (i.e. whenever t has a normal form containing a function symbol). First of all, we can define the λ-term [ci ]Λ corresponding to any constructor ci . To do that, define a λ-term Mxi 1 ,...,xm for every 1 ≤ i ≤ g, for every 0 ≤ m ≤ ar (ci ) and for every variables x1 , . . . , xm by induction on ar (ci ) − m: Mxi 1 ,...,xar (c i) ∀m : 0 ≤ m < ar (ci ) Mxi 1 ,...,xm ≡ λy1 . . . . .λyg .yi x1 . . . xar (ci ) ; m m m ≡ λy.yN1,i . . . Ng,i Li ; where: m Nj,i Lm i (cj ) ; ≡ λz1 . . . . .λzar (cj ) .(λxm+1 .Mxi 1 ,...,xm+1 )Mzar1 ,...,z ar(c ) j ≡ λzm+2 . . . . .λzar (ci ) .⊥. Lemma 8 There is a constant n ∈ N such that for every i and for every m: Mxi 1 ,...,xm {hht1 iiΛ /x1 , . . . , hhtm iiΛ /xm }hhtm+1 iiΛ . . . hhtar (ci ) iiΛ →k hhci (t1 . . . tar (ci ) )iiΛ 8 (where k ≤ n) and Mxi 1 ,...,xm {hht1 iiΛ /x1 , . . . , hhtm iiΛ /xm }Xm+1 . . . Xar (ci ) →l ⊥ (where l ≤ n) whenever Xj is either hhtj iiΛ or ⊥ but at least one among Xm+1 . . . Xar (ci ) is ⊥. Proof. We proceed by induction on ar (ci ) − m: • If m = ar (ci ), then Mxi 1 ,...,xar (c ) {hht1 iiΛ /x1 , . . . , hhtar (ci ) iiΛ /xar (ci ) } i ≡ ≡ (λy1 . . . . .λyg yi x1 . . . xar (ci ) ){hht1 iiΛ /x1 , . . . , hhtar (ci ) iiΛ /xar (ci ) } λy1 . . . . .λyg .yi hht1 iiΛ . . . hhtar (ci ) iiΛ ≡ hhci (t1 , . . . , tar (ci ) )iiΛ . • If m < ar (ci ), we use the following abbreviations: m Pj,i m ≡ Nj,i {hht1 iiΛ /x1 , . . . , hhtm iiΛ /xm }; Qm j ≡ Lm j {hht1 iiΛ /x1 , . . . , hhtm iiΛ /xm }. Let’s distinguish two cases: • If Xm+1 ≡ ⊥, then: Mxi 1 ,...,xm {hht1 iiΛ /x1 , . . . , hhtm iiΛ /xm }Xm+1 . . . Xar (ci ) →v →∗v m m m (⊥P1,i . . . Pg,i Qi )Xm+2 . . . Xar (ci ) m Qi Xm+2 . . . Xar (ci ) →∗v ⊥ • Let Xm+1 be hhtm+1 iiΛ , where tm+1 ≡ cj (u1 , . . . , uar (cj ) ). Then: Mxi 1 ,...,xm {hht1 iiΛ /x1 , . . . , hhtm iiΛ /xm }Xm+1 . . . Xar (ci ) →v →∗v m m m (hhcj (u1 , . . . , uar(cj ) )iiΛ P1,i . . . Pg,i Qi )Xm+2 . . . Xar (ci ) m Pj,i hhu1 iiΛ . . . hhuar (cj ) iiΛ Xm+2 . . . Xar (ci ) →∗v (λxm+1 .Mxi 1 ,...,xm+1 {hht1 iiΛ /x1 , . . . , hhtm iiΛ /xm }) (Mzj1 ,...,zar (c ) {hhu1 iiΛ /y1 , . . . , hhtar (cj ) iiΛ /yar(cj ) })Xm+2 . . . Xar (ci ) j →∗v (λxm+1 .Mxi 1 ,...,xm+1 {hht1 iiΛ /x1 , . . . , hhtm iiΛ /xm }) (hhcj (u1 , . . . , uar(cj ) )iiΛ )Xm+2 . . . Xar (ci ) →∗v Mxi 1 ,...,xm+1 {hht1 iiΛ /x1 , . . . , hhtm+1 iiΛ /xm+1 }Xm+2 . . . Xar (ci ) and, by the inductive hypothesis, the last term in the reduction sequence reduces to the correct normal form. The existence of a natural number n with the prescribed properties can be proved by observing that none of the reductions above have a length which depends on the parameters hht1 iiΛ , . . . , hhtm iiΛ and Xm+1 . . . Xar (ci ) . This concludes the proof. ✷ So, the required lambda term [ci ]Λ is simply Mεi . Interpreting function symbols is more difficult, since we have to “embed” the reduction rules into the λ-term interpreting the function symbol. To do that, we need a preliminary result to encode pattern matching. Lemma 9 (Pattern matching) Let α1 , . . . , αn be non-overlapping sequences of patterns of the same length m. Then there are a term Mαm1 ,...,αn and an integer l such that for every sequence of values V1 , . . . , Vn , if αi = p1 , . . . , pm then Mαm1 ,...,αn hhp1 (t11 , . . . , tk11 )iiΛ . . . hhpm (t1m , . . . , tkmm )iiΛ V1 . . . Vn →kv Vi hht11 iiΛ . . . hhtk11 iiΛ . . . hht1m iiΛ . . . hhtkmm iiΛ , 9 where k ≤ l, whenever the tji are constructor terms. Moreover, Mαm1 ,...,αn X1 , . . . , Xm V1 . . . Vn →kv ⊥, where k ≤ l, whenever X1 , . . . , Xm do not unify with any of the sequences α1 , . . . , αn or any of the X1 , . . . , Xm is itself ⊥. Pn Proof. We go by induction on p = i=1 ||αi ||, where ||αi || is the number of constructors occurrences in patterns inside αi : • If p = 0 and n = 0, then we should always return ⊥: Mεm ≡ λx1 . . . . .λxm .⊥. • If p = 0 and n = 1 and α1 is simply a sequence of variables x1 , . . . , xm (because the αi are assuming to be non-overlapping). Then Mxm1 ,...,xm is a term defined by induction on m which returns ⊥ only if one of its first m arguments is ⊥ and otherwise returns its m + 1-th argument applied to its first m arguments. • If p ≥ 1, then there must be integers i and j with 1 ≤ i ≤ m and 1 ≤ j ≤ n such that αj = p1 , . . . , pi−1 , ck (r1 , . . . , rar (ck ) ), pi+1 , . . . , pm for a constructor ck and for some patterns pp and some rq . Now, for every 1 ≤ p ≤ n and for every 1 ≤ j ≤ g we define sequences of patterns βpj and values Wpj as follows: • If αp = p1 , . . . , pi−1 , cj (r1 , . . . , rar (cj ) ), pi+1 . . . pm then βpj is defined to be the sequence p1 , . . . , pi−1 , r1 , . . . , rar (ck ) , pi+1 , . . . , pm . Moreover, Wp is simply the indentity λx.x. • If αp = p1 , . . . , pi−1 , cs (r1 , . . . , rar (cs ) ), pi+1 . . . pm where s 6= j then βpj and Wpj are both undefined. • Finally, if αp = p1 , . . . , pi−1 , x, pi+1 . . . pm then βpj is defined to be the sequence p1 , . . . , pi−1 , x1 , . . . , xar (cj ) , pi+1 , . . . , pm . and Wpj is the following λ-term λx.λy1 . . . . .λyt .x1 . . . . .λxar (ck ) .λz1 . . . . .λzu .xy1 . . . yt (hhcj iiΛ x1 . . . xar (cj ) )z1 . . . zu where t is the number of variables in p1 , . . . , pi−1 and u is the number of variables in pi+1 , . . . , pm . As a consequence, for every 1 ≤ j ≤ g, we can find a natural number tj and a sequence of pairwise distinct natural numbers i1 , . . . , itj such that βij1 , . . . , βijt are exactly the sequences j which can be defined by the above construction. We are now able to formally define Mαm1 ,...,αn ; it is the term λx1 . . . . .λxm .λy1 . . . . .λyn .((xi V1 . . . Vg V⊥ )x1 . . . xi−1 xi+1 . . . xm )y1 . . . yn where ∀1 ≤ j ≤ g.Vj ≡ λz1 . . . . .λzar (cj ) .λx1 . . . . .λxi−1 .λxi+1 . . . . .λxm .λy1 . . . . .λyn . m−1+ar (cj ) x1 j i ,...,βi Mβ j 1 V⊥ tj . . . xi−1 z1 . . . zar (cj ) xi+1 . . . xm (Wij1 yi1 ) . . . (Wijt yitj ) j ≡ λx1 . . . . .λxi−1 .λxi+1 . . . . .λxm .λy1 . . . . .λyn .⊥ Ptj Notice that, for every j, p > v=1 ||βvj ||. Moreover, for every j any βvj has the same length m − 1 + ar (cj ). This justifies the application of the induction hypothesis above. 10 This concludes the proof. ✷ For every function symbol fi , let fi (α1i ) → t1i , . . . , fi (αni i ) → tni i be the rules for fi . Moreover, suppose that the variables appearing in the patterns in αji are j,m zij,1 , . . . , zi i,j . Recall that we have a signature with f1 , . . . , fh function symbols. For any 1 ≤ i ≤ h the lambda term interepreting fi is defined to be: [fi ]Λ ≡ Hi V1 . . . Vh where Vi Wij ≡ λx1 . . . . .λxh .λy1 . . . . .λyar (fi ) .Mα1i ,...,αni y1 . . . yar (fi ) Wi1 . . . Wini ≡ λz1 . . . . .λzmi,j .h|tji |iΛ whenever 1 ≤ i ≤ h and 1 ≤ j ≤ ni . Moreover h| · |iΛ is defined by induction as follows: h|x|iΛ h|ci (t1 , . . . , tar (ci ) )|iΛ = = x [ci ]Λ h|t1 |iΛ . . . h|tar (ci ) |iΛ h|fi (t1 , . . . , tar (fi ) )|iΛ = xi h|t1 |iΛ . . . h|tar (fi ) |iΛ Now, we have all the necessary ingredients to extend the mapping [·]Λ to every term in T (Ξ): [c(t1 , . . . , tar (ci ) )]Λ = [ci ]Λ [t1 ]Λ . . . [tar (ci ) ]Λ [fi (t1 , . . . , tar (fi ) )]Λ = [fi ]Λ [t1 ]Λ . . . [tar (fi ) ]Λ Theorem 2 There is a natural number k such that for every function symbol f and for every t1 , . . . , tar (f ) ∈ C(Ξ), the following three implications hold (where u stands for f (t1 , . . . , tar (f ) ) and M stands for [f ]Λ hht1 iiΛ . . . hhtar (f ) iiΛ ): • If u rewrites to v ∈ C(Ξ) in n steps, then M rewrites to hhviiΛ in at most kn steps. • If u rewrites to a normal form v ∈ / C(Ξ), then M rewrites to ⊥. • If u diverges, then M diverges. Proof. By an easy combinatorial argument following from the definition of [·]Λ . ✷ Clearly, the constant k in Theorem 2 depends on Ξ, but is independent on the particular term u. 5 Graph Representation The previous two sections proved the main simulation result of the paper. To complete the picture, we show in this section that the unitary cost model for the (weak call-by-value) λ-calculus (and hence the number of rewriting in a constructor term rewriting system) is polynomially related to the actual cost of implementing those reductions2 . We do so by introducing term graph rewriting, following [1] but adapting the framework to call-by-value constructor rewriting. Contrarily to what we did in Section 3, we will stay abstract here: our attention will not be restricted to the particular graph rewrite system that is needed to implement reduction in the λ-calculus. We refer the reader to our [5] for more details on efficient simulations between term graph rewriting and constructor term rewriting, both under innermost (i.e., call-by-value) and outermost (i.e., call-by-name) reduction strategies. 2 As mentioned in the introduction, see [16] for another proof of this with other means. 11 Definition 4 (Labelled Graph) Given a signature Σ, a labelled graph over Σ consists of a directed acyclic graph together with an ordering on the outgoing edges of each node and a (partial) labelling of nodes with symbols from Σ such that the out-degree of each node matches the arity of the corresponding symbols (and is 0 if the labelling is undefined). Formally, a labelled graph is a triple G = (V, α, δ) where: • V is a set of vertices. • α : V → V ∗ is a (total) ordering function. • δ : V ⇀ V is a (partial) labelling function such that the length of α(v) is the arity of δ(v) if δ(v) is defined and is 0 otherwise. A labelled graph (V, α, δ) is closed iff δ is a total function. Consider the signature Σ = {a, b, c, d}, where arities of a, b, c, d are 2, 1, 0, 2 respectively, and b, c, d are constructors. Examples of labelled graphs over the signature Σ are the following ones: a a  b b  d✺ ✟✟ ✺✺✺ ✺ ✟✟ b a ✟ ✟✟   ✟ % ⊥  b ⊥ c  a ✝ ✽✽✽ ✝ ✽ ✝✝ b  ⊥  ⊥ The symbol ⊥ denotes vertices where the underlying labelling function is undefined (and, as a consequence, no edge departs from such vertices). Their role is similar to the one of variables in terms. If one of the vertices of a labelled graph is selected as the root, we obtain a term graph: Definition 5 (Term Graphs) A term graph, is a quadruple G = (V, α, δ, r), where (V, α, δ) is a labelled graph and r ∈ V is the root of the term graph. The following are graphic representations of some term graphs. '&%$ !"# a  b a b  a✻ ✝ ✝ ✻✻✻✻ ✝ ✝  '&%$ !"# a '&%$ !"# b ✟ ✟ ✟ %  ✟ ⊥  b ⊥ c  ⊥  a✽ ✽✽ ✝ ✝ ✽ ✝✝ b  ⊥ The root is the only vertex drawn inside a circle. There are some classes of paths which are particularly relevant for our purposes Definition 6 (Paths) A path v1 , . . . , vn in a labelled graph G = (V, α, δ) is said to be: • A constructor path iff for every 1 ≤ i ≤ n, the symbol δ(vi ) is a constructor; • A pattern path iff for every 1 ≤ i ≤ n, δ(vi ) is either a constructor symbol or is undefined; • A left path iff n ≥ 1, the symbol δ(v1 ) is a function symbol and v2 , . . . , vn is a pattern path. Definition 7 (Homomorphisms) An homomorphism between two labelled graphs G = (VG , αG , δG ) and H = (VH , αH , δH ) over the same signature Σ is a function ϕ from VG to VH preserving the 12 term graph structure. In particular δH (ϕ(v)) αH (ϕ(v)) = δG (v) = ϕ∗ (αG (v)) for any v ∈ dom(δ), where ϕ∗ is the obvious generalization of ϕ to sequences of vertices. An homomorphism between two term graphs G = (VG , αG , δG , rG ) and H = (VH , αH , δH , rH ) is an homomorphism between (VG , αG , δG ) and (VH , αH , δH ) such that ϕ(rG ) = rH . Two labelled graphs G and H are isomorphic iff there is a bijective homomorphism from G to H; in this case, we write G∼ = H. Similarly for term graphs. In the following, we will consider term graphs modulo isomorphism, i.e., G = H iff G ∼ = H. Observe that two isomorphic term graphs have the same graphical representation. Definition 8 (Graph Rewrite Rules) A graph rewrite rule over a signature Σ is a triple ρ = (G, r, s) such that: • G is a labelled graph; • r, s are vertices of G, called the left root and the right root of ρ, respectively. • Any path starting in r is a left path. The following are examples of graph rewriting rules, assuming a to be a function symbol and b, c, d to be constructors: '&%$ !"# a  b '&%$ !"# a b  d✺ ✟✟ ✺✺✺ ✺ ✟✟ b ✟ ✟✟ %  ✟ ⊥ b  ⊥ '&%$ !"# a ✝ ✽✽✽✽ ✝ ✝ ✽ ✝ ✝ c b  ⊥ c  ⊥ Definition 9 (Subgraphs) Given a labelled graph G = (VG , αG , δG ) and any vertex v ∈ VG , the subgraph of G rooted at v, denoted G ↓ v, is the term graph (VG↓v , αG↓v , δG↓v , rG↓v ) where • VG↓v is the subset of VG whose elements are vertices which are reachable from v in G. • αG↓v and δG↓v are the appropriate restrictions of αG and δG to VG↓v . • rG↓v is v. Definition 10 (Redexes) Given a labelled graph G, a redex for G is a pair (ρ, ϕ), where ρ is a rewrite rule (H, r, s) and ϕ is an homomorphism between H ↓ r and G such that for any vertex v ∈ VH↓r with v ∈ / dom(δH↓r ), any path starting in ϕ(v) is a constructor path. The last condition in the definition of a redex is needed to capture the call-by-value nature of the rewriting process. Given a term graph G and a redex ((H, r, s), ϕ), the result of firing the redex is another term graph obtained by successively applying the following three steps to G: 1. The build phase: create an isomorphic copy of the portion of H ↓ s not contained in H ↓ r, and add it to G, obtaining J. The underlying ordering and labelling functions are defined in the natural way. 2. The redirection phase: all edges in J pointing to ϕ(r) are replaced by edges pointing to the copy of s. If ϕ(r) is the root of G, then the root of the newly created graph will be the newly created copy of s. The graph K is obtained. 13 3. The garbage collection phase: all vertices which are not accessible from the root of K are removed. The graph I is obtained. (H,r,s) We will write G −→ I (or simply G → I, if this does not cause ambiguity) in this case. As an example, consider the term graph G and the rewriting rule ρ = (H, r, s): '&%$ !"# a ✞ ✽✽✽ ✞ ✽✽ ✞✞  o b a t tt t t  yttt c '&%$ !"# a✻ b ✻✻ ✻  ✻✻  b o ✻✻✻ a ✻✻ ✻   ⊥ c G ρ There is an homomorphism ϕ from H ↓ r to G. In particular, ϕ maps r to the rightmost vertex in G. Applying the build phase and the redirection phase we get J and K as follows: '&%$ !"# a ✠ ✻✻✻ ✠ ✻✻ ✠  zo✠ b ✉a ✉ ✉✉ ✉✉  z✉ cq '&%$ !"# a ✞ ✞ ✞ ✞y ✞ bo a sss s s  ysss cq b  a J /b  a K Finally, applying the garbage collection phase, we get the result of firing the redex (ρ, ϕ): '&%$ !"# a  b  a✻ ✟ ✟ ✻✻✻✻  ✟ ✟ /c b I Definition 11 A constructor graph rewrite system (CGRS) over a signature Σ consists of a set of graph rewrite rules G on Σ. 5.1 From Term Rewriting to Graph Rewriting Any term t over the signature Σ can be turned into a graph G in the obvious way: G will be a tree and vertices in G will be in one-to-one correspondence with symbol occurrences in t. Conversely, any term graph G over Σ can be turned into a term t over Σ (remember: we only consider acyclic graphs here). Similarly, any term rewrite rule t → u over the signature Σ can be translated into a graph rewrite rule (G, r, s) as follows: • Take the graph representing t and u. They are trees, in fact. • From the union of these two trees, share those nodes representing the same variable in t and u. This is G. • Take r to be the root of t in G and s to be the root of u in G. As an example, consider the rewriting rule a(b(x), y) → b(a(y, a(y, x))). 14 Its translation as a graph rewrite rule is the following: b '&%$ !"# a ✟ ✼✼✼ ✟ ✼✼ ✟ ✟  ✟ b ⊥Z o  ⊥g  a✺ ✺✺ ✺✺  a An arbitrary constructor rewriting system can be turned into a constructor graph rewriting system: Definition 12 Given a constructor rewriting system R over Σ, the corresponding constructor graph rewriting system G is defined as the class of graph rewrite rules corresponding to those in R. Given a term t, [t]G will be the corresponding graph, while the term graph G corresponds to the term hGiR . Let us now consider graph rewrite rules corresponding to rewrite rules in R. It is easy to realize that the following invariant is preserved while performing rewriting in [R]G : whenever any vertex v can be reached by two distinct paths starting at the root (i.e., v is shared ), any path starting at v is a constructor path. A term graph satisfying this invariant is said to be constructor-shared. Constructor-sharedness holds for term graphs coming from terms and is preserved by graph rewriting: Lemma 10 For every closed term t, [t]G is constructor-shared. Moreover, if G is closed and constructor-shared and G → I, then I is constructor-shared. Proof. The fact [t]G is constructor-shared for every t follows from the way the [·]G map is defined: it does not introduce any sharing. Now, suppose G is constructor-shared and (H,r,s) G −→ I where (H, r, s) corresponds to a term rewrite rule t → u. The term graph J obtained from G by the build phase is itself constructor-shared: it is obtained from G by adding some new nodes, namely an isomorphic copy of the portion of H ↓ s not contained in H ↓ r. Notice that J is constructor-shared in a stronger sense: any vertex which can be reached from the newly created copy of s by two distinct paths must be a constructor path. This is a consequence of (H, r, s) being a graph rewrite rule corresponding to a term rewrite rule t → u, where the only shared vertices are those where the labelling function is undefined. The redirection phase preserves itself constructor-sharedness, because only one pointer is redirected (the vertex is labelled by a function symbol) and the destination of this redirection is a vertex (the newly created copy of s) which had no edge incident to it. Clearly, the garbage collection phase preserve constructor-sharedness. ✷ Lemma 11 A closed term graph G in G is a normal form iff hGiR is a normal form. Proof. Clearly, if a closed term graph G is in normal form, then hGiR is a term in normal form, because each redex in G translates to a redex in hGiR . On the other hand, if hGiR is in normal form, then G is in normal form: each redex in hGiR translates back to a redex in G. ✷ Reduction at the level of graphs correctly simulates reduction at the level of terms, but only if the underlying graphs are constructor shared: Lemma 12 If G is closed and constructor-shared and G → I, then hGiR → hIiR . Proof. The fact each reduction step starting in G can be mimicked by n reduction steps in hGiR is known from the literature. If G is constructor-shared, then n = 1, because any redex in a constructor-shared term graph cannot be shared. ✷ 15 A counterexample, when G in not constructor-shared can be easily built: consider the term rewrite rule a(c, c) → c and the following term graph, which is not constructor-shared and correspond to a(a(c, c), a(c, c)): '&%$ !"# a c   a✼ ✼✼ ✞ ✞ ✼ ✞✞ c The term graph rewrites in one step to the following one '&%$ !"# a   c while the term a(a(c, c), a(c, c)) rewrites to a(c, c) in two steps. As can be expected, graph reduction is even complete with respect to term reduction, with the only proviso that term graphs must be constructor-shared: Lemma 13 If t → u, G is constructor-shared and hGiR = t, then G → I, where hIiR = u. Theorem 3 (Graph Reducibility) For every constructor rewrite system R over Σ and for every term t over Σ, the following two conditions are equivalent: 1. t →n u, where u is in normal form; 2. [t]G →n G, where G is in normal form and hGiR = u. Proof. Suppose t →n u, where u is in normal form. Then, by applying Lemma 13, we obtain a term graph G such that [t]G →n G and hGiR = u. By Lemma 10, G is canonical and, by Lemma 11, it is in normal form. Now, suppose [t]G →n G where hGiR = u and G is in normal form. By applying n times Lemma 12, we obtain that h[t]G iR →n hGiR = u. But h[t]G iR = t and u is a normal form by Lemma 11, since [t]G and G are constructor shared due to Lemma 10. ✷ There are term rewrite systems which are not graph reducible, i.e. for which the two conditions of Theorem 3 are not equivalent (see [1]). However, any othogonal constructor rewrite system is graph reducible, due to the strict constraints on the shape of rewrite rules [15]. This result can be considered as a by-product of our analysis, for which graph rewriting is only instrumental. 5.2 Lambda-Terms Can Be Efficiently Reduced by Graph Rewriting As a corollary of Theorem 3 and Theorem 1, we obtain the possibility of reducing λ-terms by term graphs over ΣΦ . To this purpose, we can use the CGRS Θ corresponding to Φ: Corollary 1 Let M ∈ Λ be a closed term. The following two conditions are equivalent: 1. M →nv N where N is in normal form; 2. [[M ]Φ ]Θ →n G where hhhGiΦ iiΛ = N and G is in normal form. However, there are some missing tales. Let us analyze more closely the combinatorics of graph rewriting in Θ: • Consider a closed λ-term M and a term graph G such that [[M ]Φ ]Θ →∗ G. By Proposition 1 and Lemma 12, for every constructor cx,N appearing as a label of a vertex in G, N is a subterm of M . • As a consequence, if [[M ]Φ ]Θ →∗ G → H, then the difference |H| − |G| cannot be too big: at most |M |. As a consequence, if [[M ]Φ ]Θ →n G then |G| ≤ (n + 1)|M |. Here, we exploit in an essential way the possibility of sharing constructors. • Whenever [[M ]Φ ]Θ →n G, computing a graph H such that G → H takes polynomial time in |G|, which is itself polynomially bounded by n and |M |. 16 Hence: Theorem 4 There is a polynomial p : N2 → N such that for every λ-term M , the normal form of [[M ]Φ ]Θ can be computed in time at most p(|M |, Time v (M )). As we mentioned in the introduction, this cannot be achieved when using explicit representations of λ-terms. Moreover, reading back a λ-term from a term graph can take exponential time, as we mentioned in the introduction. We can complement Theorem 4 with a completeness statement — any universal computational model with an invariant cost model can be embedded in the λ-calculus with a polynomial overhead. We can exploit for this the analogous result we proved in [4] (Theorem 1) — the unitary cost model is easily proved to be more parsimonious than the difference cost model considered in [4]. Theorem 5 Let f : Σ∗ → Σ∗ be computed by a Turing machine M in time g. Then, there are a λ-term NM and a suitable encoding p·q : Σ∗ → Λ such that NM pvq normalizes to pf (v)q in O(g(|v|)) beta steps. 6 Variations: Call-by-Name Reduction Our purpose in this last section is showing that similar techniques can be applied to call-by-name evaluation of λ-terms. In the previous sections, λ-calculus was endowed with weak call-by-value reduction. The same technique, however, can be applied to weak call-by-name reduction, as we will sketch in this section. Λ is now endowed with a relation →h defined as follows: (λx.M )N →h M {N/x} M →h N M L →h N L Similarly to the call-by-value case, Time h (M ) stands for the number of reduction steps to the normal form of M (if any). Since the relation →h is deterministic (i.e., functional), Time h (M ) is well-defined. We need another CRS, called Ψ, which is similar to Φ but designed to simulate weak call-byname reduction: • The signature ΣΨ includes the binary function symbol app and constructor symbols cx,M for every M ∈ Λ and every x ∈ Υ, exactly as ΣΦ . Moreover, there is another binary constructor symbol capp. To every term M ∈ Λ we can associate terms {M }Ψ , [M ]Ψ ∈ V(Ψ, Υ) as follows: {x}Ψ = x {λx.M }Ψ {M N }Ψ = = cx,M (x1 , . . . , xn ), where FV(λx.M ) = x1 , . . . , xn capp({M }Ψ , {N }Ψ) [x]Ψ [λx.M ]Ψ = = x cx,M (x1 , . . . , xn ), where FV(λx.M ) = x1 , . . . , xn [M N ]Ψ = app([M ]Ψ , {N }Ψ ) Notice that {·}Ψ maps lambda terms to constructor terms, while terms obtained via [·]Ψ can contain function symbols. • The rewrite rules in RΨ are all the rules in the following form: app(cz,z , capp(w, f )) → app(w, f ) app(cz,z , cx,M (x1 , . . . , xn )) → cx,M (x1 , . . . , xn ) app(cz,w (capp(f, g)), h) → app(f, g) app(cz,w (cx,M (x1 , . . . , xn )), h) → cx,M (x1 , . . . , xn ) app(cy,N (y1 , . . . , ym ), y) → [N ]Ψ 17 where M ranges over λ-terms, N ranges over abstractions and applications, FV(λx.M ) = x1 , . . . , xn and FV(λy.N ) = y1 , . . . , ym . These rewrite rules are said to be ordinary rules. We also need the following administrative rule: app(capp(x, y), z) → app(app(x, y), z) The CTRS Ψ is slightly more complicated than Φ: some additional overhead is needed to force reduction to happen only in head position. As usual, to every term t ∈ V(Ψ, Υ) we can associate a term htiΛ : hxiΛ happ(u, v)iΛ = hcapp(u, v)iΛ hcx,M (t1 , . . . tn )iΛ = x = huiΛ hviΛ = (λx.M ){ht1 iΛ /x1 , . . . , htn iΛ /xn } where FV(λx.M ) = x1 , . . . , xn . A term t ∈ T (Ψ) is canonical if either t = cx,M (t1 . . . , tn ) ∈ C(Ψ) or t = app(u, v) where u is canonical and v ∈ C(Ψ). Lemma 14 For every closed M ∈ Λ, [M ]Ψ is canonical. Proof. By a straightforward induction on M . ✷ The obvious variation on Equation 1 holds here: h[M ]Ψ {t1 /x1 , . . . , tn /xn }iΛ = M {ht1 iΛ /x1 , . . . , htn iΛ /xn }. (2) Ψ mimics call-by-name reduction in much the same way Φ mimics call-by-value reduction. However, one reduction step in the λ-calculus corresponds to n ≥ 1 steps in Ψ, although n is kept under control: Lemma 15 Suppose that t ∈ T (Ψ) is canonical and that t → u. Then there is a natural number n such that: 1. htiΛ →h huiΛ ; 2. There is a canonical term v ∈ T (Ψ) such that u →n v; 3. |w|app = |u|app + m whenever u →m w and m ≤ n; 4. hwiΛ = huiΛ whenever u →m w and m ≤ n. Proof. A term t is said to be semi-canonical iff t = app(u, v), where v ∈ C(Ψ) and u is either semi-canonical or is itself an element of C(Ψ). We now prove that if t is semi-canonical, there there are a natural number n and a canonical term u such that: • t →n u; • |v|app = |t|app + m whenever t →m v and m ≤ n; • hviΛ = htiΛ whenever t →m v and m ≤ n. We can proceed by induction on |t|. By definition t is always in the form app(w, d). We distinguish three cases: • w is semi-canonical. Then, we get what we want by induction hypothesis. • w is in C(Ψ) and has the form cx,M (t1 , . . . , tm ). Then, n = 0 and t is itself canonical. • w is in C(Ψ) and has the form capp(e, f ). Then t = app(capp(e, f ), d) → app(app(e, f ), d) We can apply the induction hypothesis to app(e, f ) (since its length is strictly smaller than |t|). We can now proceed as in Lemma 6, since whenever t rewrites to u by one of the ordinary rules, u is semi-canonical. ✷ Lemma 16 A canonical term t ∈ T (Ψ) is in normal form iff htiΛ is in normal form. 18 Proof. We first prove that any canonical normal form t can be written as cx,M (t1 , . . . , tn ), where t1 , . . . , tn ∈ C(Ψ). We proceed by induction on t: • If t = cx,M (t1 , . . . , tn ), then the thesis holds. • If t = app(u, v), then u is canonical and in normal form, hence in the form cx,M (t1 , . . . , tn ) by induction hypothesis. As a consequence, t is not a normal form, which is a contraddiction. We can now prove the statement of the lemma, by distinguishing two cases: • If t = cx,M (t1 , . . . , tn ), where t1 , . . . , tn ∈ C(Ψ), then t is in normal form and htiΛ is an abstraction, hence a normal form. • If t = app(u, v), then t cannot be a normal form, since u is canonical and in normal form and, as a consequence, it can be written as cx,M (t1 , . . . , tn ). This concludes the proof. ✷ Observe that this property holds only if t is canonical: a non-canonical term can reduce to another one (canonical or not) even if the underlying λ-term is a normal form. Lemma 17 If M →h N , t is canonical and htiΛ = M , then t → u, where huiΛ = N and |u|app + 1 ≥ |t|app . Proof. Similar to the one of Lemma 17. ✷ The slight mismatch between call-by-name reduction in Λ and reduction in Ψ is anyway harmless globally: the total number of reduction step in Ψ is at most two times as large as the total number of call-by-name reduction steps in Λ. Theorem 6 (Term Reducibility) Let M ∈ Λ be a closed term. The following two conditions are equivalent: 1. M →nh N where N is in normal form; 2. [M ]Ψ →m t where hhtiiΛ = N and t is in normal form. Moreover n ≤ m ≤ 2n. Proof. Suppose M →nh N , where N is in normal form. M is closed and, by Lemma 14, [M ]Ψ is canonical. By iterating over Lemma 15 and Lemma 17, we obtain the existence of a term t such that htiΛ = u, t is in normal form and [M ]Ψ →m t, where m ≥ n and |t|app − |[M ]Ψ |app ≥ (m − n) − n. Since |t|app = 0 (t is in normal form), m ≤ 2n. If [M ]Ψ →m t where hhtiiΛ = N and t is in normal form, then by iterating over Lemma 15 we obtain that M →nh N where n ≤ m ≤ 2n and N is in normal form. ✷ Ξ is the graph rewrite system corresponding to Ψ, in the sense of Section 5. Exactly as for the call-by-value case, computing the normal form of (the graph representation of) any term takes time polynomial in the number of reduction steps to normal form: Theorem 7 There is a polynomial p : N2 → N such that for every λ-term M , the normal form of [[M ]Ψ ]Ξ can be computed in time at most p(|M |, Time h (M )). On the other hand, we cannot hope to directly reuse the results in Section 4 when proving the existence of an embedding of CRSs into weak call-by-name λ-calculus: the same λ-term can have distinct normal forms in the two cases. It is widely known, however, that a continuation-passing translation can be used to simulate call-by-value reduction by call-by-name reduction [14]. The only missing tale is about the relative performances: do terms obtained via the CPS translation reduce (in call-by-name) to their normal forms in a number of steps which is comparable to the number of (call-by-value) steps to normal form for the original terms? We conjecture the answer is “yes”, but we leave the task of proving that to a future work. 19 7 Conclusions We have shown that the most naı̈ve cost models for weak call-by-value and call-by-name λ-calculus (each beta-reduction step has unitary cost) and orthogonal constructor term rewriting (each rule application has unitary cost) are linearly related. Since, in turn, this cost model for λ-calculus is polynomially related to the actual cost of reducing a λ-term on a Turing machine, the two machine models we considered are both reasonable machines, when endowed with their natural, intrinsic cost models (see also Gurevich’s opus on Abstract State Machine simulation “at the same level of abstraction”, e.g. [8]). This strong (the embeddings we consider are compositional), complexity-preserving equivalence between a first-order and a higher-order model is the most important technical result of the paper. Ongoing and future work includes the investigation of how much of this simulation could be recovered either in a typed setting (see [17] for some of the difficulties), or in the case of λcalculus with strong reduction, where we reduce under an abstraction. Novel techniques have to be developed, since the analysis we performed in the present paper cannot be easily extended to these cases. Acknowledgments The authors wish to thank Kazushige Terui for stimulating discussions on the topics of this paper. References [1] H. Barendregt, M. Eekelen, J. Glauert, J. Kennaway, M. Plasmeijer, and M. Sleep. Term graph rewriting. In J. de Bakker, A. Nijman, and P. Treleaven, editors, Volume II: Parallel Languages on PARLE: Parallel Architectures and Languages Europe, pages 141–158. SpringerVerlag, 1986. [2] Erik Barendsen. Term graph rewriting. In Terese (M. Bezem, J.W. Klop, and R. de Vrijer), editors, Term Rewriting Systems, chapter 13, pages 712–743. Cambridge Univ. Press, 2003. [3] Stephen Bellantoni and Stephen Cook. A new recursion-theoretic characterization of the polytime functions. Computational Complexity, 2:97–110, 1992. [4] Ugo Dal Lago and Simone Martini. An invariant cost model for the lambda-calculus. In Computability in Europe 2006, volume 3988 of LNCS, pages 105–114. Springer, 2006. [5] Ugo Dal Lago and Simone Martini. Derivational complexity is an invariant cost model. Int. Work. on Foundational and Practical Aspects of Resource Analysis, FOPARA, Eindhoven, 2009. [6] Ugo Dal Lago and Simone Martini. On constructor rewrite systems and the lambda-calculus. In ICALP 2009, Part II, volume 5556 of LNCS, pages 163–174. Springer, 2009. [7] J.-Y. Girard. Light linear logic. Inform. and Comp., 143(2):175–204, 1998. [8] Yuri Gurevich. The sequential ASM thesis. In Current trends in theoretical computer science, pages 363–392. World Scientific, 2001. [9] Simon Peyton Jones. The Implementation of Functional Programming Languages. Prentice Hall, 1987. [10] Daniel Leivant. Ramified recurrence and computational complexity I: word recurrence and poly-time. In Feasible Mathematics II, pages 320–343. Birkhäuser, 1995. [11] Jean-Yves Marion and Jean-Yves Moyen. Efficient first order functional program interpreter with time bound certifications. In Logic for Programming and Automated Reasoning, 7th International Conference, Proceedings, volume 1955 of LNCS, pages 25–42. Springer, 2000. 20 [12] Michel Parigot. On the representation of data in lambda-calculus. In 3rd Workshop on Computer Science Logic, Proceedings, volume 440 of LNCS, pages 309–321. Springer, 1990. [13] Michel Parigot and Paul Rozière. Constant time reductions in lambda-caculus. In Mathematical Foundations of Computer Science 1993, 18th International Symposium, Proceedings, volume 711 of LNCS, pages 608–617. Springer, 1993. [14] Gordon D. Plotkin. Call-by-name, call-by-value and the lambda-calculus. Theoretical Computer Science, 1(2):125–159, 1975. [15] Detlef Plump. Graph-reducible term rewriting systems. In Graph-Grammars and Their Application to Computer Science, pages 622–636, 1990. [16] D. Sands, J. Gustavsson, and A. Moran. Lambda calculi and linear speedups. In The Essence of Computation: Complexity, Analysis, Transformation. Essays Dedicated to Neil D. Jones, number 2566 in LNCS, pages 60–82. Springer Verlag, 2002. [17] Zdzislaw Splawski and Pawel Urzyczyn. Type fixpoints: Iteration vs. recursion. In 4th International Conference on Functional Programming, Proceedings, pages 102–113. ACM, 1999. [18] Peter van Emde Boas. Machine models and simulation. In Handbook of Theoretical Computer Science, Volume A: Algorithms and Complexity (A), pages 1–66. MIT Press, 1990. [19] Christopher Wadsworth. Some unusual λ-calculus numeral systems. In J.P. Seldin and J.R. Hindley, editors, To H.B. Curry: Essays on Combinatory Logic, Lambda Calculus and Formalism. Academic Press, 1980. 21
6cs.PL
arXiv:1603.08184v1 [math.GR] 27 Mar 2016 Permutation-like Matrix Groups with a Maximal Cycle of Length Power of Two Guodong Deng, Yun Fan School of Mathematics and Statistics Central China Normal University, Wuhan 430079, China Abstract If every element of a matrix group is similar to a permutation matrix, then it is called a permutation-like matrix group. References [4], [5] and [6] showed that, if a permutation-like matrix group contains a maximal cycle such that the maximal cycle generates a normal subgroup and the length of the maximal cycle equals to a prime, or a square of a prime, or a power of an odd prime, then the permutation-like matrix group is similar to a permutation matrix group. In this paper, we prove that if a permutation-like matrix group contains a maximal cycle such that the maximal cycle generates a normal subgroup and the length of the maximal cycle equals to any power of 2, then it is similar to a permutation matrix group. Key words: permutation-like matrix group, permutation matrix group, maximal cycle. MSC2010: 15A18, 15A30, 20H20. 1 Introduction By GLd (C) we denote the complex general linear group of dimension (degree) d consisting of invertible d × d complex matrices. Any subgroup G of GLd (C) is said to be a matrix group of dimension d. If there is a T ∈ GLd (C) such that for every A ∈ G the conjugation T −1 AT is a permutation matrix, then we say that G is a permutation matrix group. If for any A ∈ G there is a T ∈ GLd (C) such that T −1 AT is a permutation matrix, then G is called a permutation-like matrix group. Cigler [3, 4] showed that a permutation-like matrix group is not a permutation matrix group in general. A d × d matrix is called a maximal cycle if it Email address: [email protected] (Yun Fan). 1 is similar to a permutation matrix corresponding to the cycle permutation of length d. Cigler conjectured that: Conjecture: If a permutation-like matrix group contains a maximal cycle, then it is a permutation matrix group. Let G be a permutation-like matrix group containing a maximal cycle which generates a normal cyclic subgroup. Cigler [3, 4] proved that if the dimension of G is a prime then G is a permutation matrix group. In [5, 6], we further proved that the G is a permutation matrix group if the dimension is a square of a prime, or any power of an odd prime. In this paper we prove: Theorem 1.1. Let G be a permutation-like matrix group of dimension 2n where n is any positive integer. If G contains a maximal cycle which generates a normal cyclic subgroup, then G is a permutation matrix group. Necessary preparations for the proof of the theorem are made in Section 2. For fundamentals of the group theory, please refer to [1, 7]. In Section 3 we prove the theorem in the case when the quotient group of G over the cyclic subgroup generated by the maximal cycle is a cyclic group, see Theorem 3.9 below. In Section 4 we prove the theorem for the case when the quotient group is not cyclic, see Theorem 4.3 below. 2 Preparations We sketch necessary fundamentals from group theory, number theory and matrix theory, and formulate them in a way suitable to our later quotations. The order of an element C of a group G is denoted by ordG (C), or ord(C) in short if the group is known from context. By hCi we denote the cyclic group generated by C. Assume that ord(C) = d. Then hCi is isomorphic to the additive group of the residue ring Zd of the integer ring Z modulo d by mapping j ∈ Zd to C j ∈ hCi. In this way, the properties of the cyclic group hCi are exactly corresponding to the properties of the additive group Zd , some of which are listed as follows. • hC r i = hCi if and only if r ∈ Z∗d , where Z∗d denotes the multiplicative group consisting of the reduced residue classes in Zd ; in that case C r is said to be a generator of the cyclic group hCi. • Each automorphism α of hCi is corresponding to exactly one r ∈ Z∗d such that α(C j ) = C rj for any C j ∈ hCi, and µr is an automorphism of the additive group Zd , where µr (j) = rj for any j ∈ Zd . • If hCi is normal in G, then G/CentG (hCi) is homomorphic to a subgroup of Z∗d , where CentG (hCi) = {A ∈ G | A−1 CA = C}, called the centralizer of hCi in G. If CentG (hCi) ⊆ hCi, then hCi is said to be self-centralized in G. 2 In this paper we are concerned with the cyclic group of order 2n (with Z2n correspondingly). The next lemma has appeared in [6]. Lemma 2.1. Assume that G = hCi is a cyclic group of order |G| = 2n and a a 0 ≤ a < n. Let G 2 = {C 2 t | 0 ≤ t < 2n−a }. Then: a a a (i) G 2 = hC 2 i is a cyclic subgroup of G of order 2n−a generated by C 2 . a a (ii) The mapping C j 7→ C 2 j is a homomorphism of G onto G 2 with kernel n−a a G 2 . Hence, for any generator G of the cyclic group G 2 there are exactly a 2 generators of G which are mapped to G. Q By Φm (x) we denote the cyclotomic polynomial of degree m, i.e., Φm (x) = θ (x − θ) with θ running over the primitive m-th roots of unity. Note that Lemma 2.1 (ii) (with k = n − a) implies that Y a (2.1) (x2 − ω) = Φ2k+a (x) ω Q where the subscript ω of runs over the primitive 2k -th roots of unity. In the specific case when k = 1, since −1 is the unique primitive 2-th root of unity, we a get a known formula: Φ2a+1 (x) = x2 + 1. Remark 2.2. The structure of the multiplicative group Z∗2n is known (e.g., see [2, Remark 9]). If n ≥ 3 then the following hold: (i) Z∗2n = h5i × h−1i with ordZ∗2n (5) = 2n−2 and ordZ∗2n (−1) = 2. (ii) h5i = {1} ∪ {1 + 2b v | b = 2, 3, · · · , n − 1, v = 1, 3, · · · , 2n−b − 1}, and ordZ∗2n (1 + 2b v) = 2n−b . (iii) −h5i = {−1} ∪ {−1 + 2b v | b = 2, 3, · · · , n − 1, v = 1, 3, · · · , 2n−b − 1}, and ordZ∗2n (−1 + 2b v) = 2n−b . In our study, the behaviors of the elements −1, 1 + 2b v and −1 + 2b v are quite different. But note that (−1 + 2b v)ℓ ∈ h5i provided ℓ is even. For the subgroups of Z∗2n , we have the following result. Lemma 2.3. If H is a subgroup of the multiplicative group Z∗2n where n ≥ 3, then one of the following holds: (i) H is a cyclic group, and, if the order |H| = 2a , then 0 ≤ a ≤ n − 2 and H = h1 + 2n−a i, or H = h−1 + 2n−a i, or H = h−1i (hence a = 1). (ii) H = h−1i × h1 + 2n−a i with 1 ≤ a ≤ n − 2. 3 Proof. By Remark 2.2, we have a surjective homomorphism ρ : Z∗2n → h5i such that ρ(−1) = 1, ρ(1 + 2b v) = 1 + 2b v and ρ(−1 + 2b v) = 1 + 2b (2n−b − v). Then ρ(H) is a subgroup of h5i, hence ρ(H) is a cyclic group of order 2a with 0 ≤ a ≤ n − 2. If a = 0, then H = 1 or H = h−1i. Assume that a ≥ 1 in the following. Take a k ∈ H such that ρ(k) is a generator of ρ(H). Then H = hki × (H ∩ h−1i), and k = 1 + 2n−a or k = −1 + 2n−a. If H ∩ h−1i = 1, then (i) holds. Otherwise, H ∩ h−1i = h−1i, hence H = hki × h−1i; if k = −1 + 2n−a, we can replace k by −k. In a word, (ii) holds. For any non-zero integer k, by ν2 (k) we denote the 2-adic valuation of k, i.e., k = 2ν2 (k) u for an odd integer u. Lemma 2.4. Let r ∈ Z∗2n such that ordZ∗2n (r) = 2a with 1 ≤ a ≤ n − 2. a (i) If r = −1, then a = 1 and r2 −1 a + r2 −2 + · · · + r + 1 = 0. (ii) If r = 1 + 2n−a v with v being odd, then a ν2 (r2 −1 a + r2 −2 + · · · + r + 1) = a. (iii) If r = −1 + 2n−a v with v being odd, then a ν2 (r2 −1 a + r2 −2 + · · · + r + 1) = n − 1. Proof. (i) is obvious. a a (ii). Since ν2 (2 − j) = ν2 (j) for 0 < j < 2 , for the binomial coefficients 2a k we get that  a  2a − (k − 1) 1  2a − 1 2 = a − ν2 (k). (2.2) ···· · = ν2 2 a · ν2 1 k−1 k k So a a a r2 −1 + ···+ r + 1 = (1 + 2n−a v)2 − 1 r2 − 1 = ≡ 2a r−1 2n−a v (mod 2a+1 ). (iii). Noting that r − 1 = 2u with u being odd, by Eqn (2.2) we obtain that a a a r2 −1 + ···+ r + 1 = (−1 + 2n−a v)2 − 1 r2 − 1 = ≡ 2n−1 v ′ r−1 2u (mod 2n ); where v ′ ≡ −vu−1 (mod 2n ). Lemma 2.5. Let G = hA, Ci be a finite group generated by A and C. If hCi is a self-centralized normal cyclic subgroup of order 2n and A−1 CA = C r for an r ∈ Z2n with ordZ∗2n (r) = 2a , then |G| = 2n+a and: (i) If r 6≡ −1 (mod 2n ), then there is an A′ ∈ G such that G = hA′ , Ci with a A′−1 CA′ = C r and A′2 = 1. 4 (ii) If r ≡ −1 (mod 2n ) (hence a = 1), then one of the following two holds: (ii.1) A2 = 1; in that case (AC k )2 = 1 for any C k ∈ hCi (i.e., G is the dihedral group of order 2n+1 ). n−1 n−1 (ii.2) A2 = C 2 ; in that case (AC k )2 = C 2 for any C k ∈ hCi (i.e., G is the generalized quaternion group of order 2n+1 ). Proof. Since hCi is self-centralized, the quotient group G/hCi ∼ = hAi/hAi∩hCi is isomorphic to a cyclic subgroup hri of the group Z∗2n . So |hAi/hAi ∩ hCi| = 2a , a |G| = 2n+a and A2 ∈ hCi. Let hCiA = {C t | A−1 C t A = C t }, i.e., the a centralizer in hCi of A. Then A2 ∈ hCiA . Since A−1 C t A = C tr , A−1 C t A = C t iff C tr−t = 1 iff t(r − 1) ≡ 0 (mod 2n ). (2.3) Suppose that r = −1 + 2n−a v where v is zero (i.e., r = −1) or odd. Since n − a ≥ 2, we have r − 1 = −2 + v2n−a = 2u with u being odd. A−1 C t A = C t n−1 Thus hCiA = hC 2 n−1 {1, C 2 }. So iff 2ut ≡ 0 (mod 2n ) iff t ≡ 0 (mod 2n−1 ). i which is a group of order 2 consisting of two elements a n−1 A2 ∈ hC 2 n−1 i = {1, C 2 }. In particular, if v = 0, i.e., r = −1, then we obtain the conclusion (ii). a Next, we assume that r = −1 + 2n−a v with v being odd. Then A2 = 1 or a n−1 a a n−1 A2 = C 2 . If A2 = 1 then we are done. Suppose that A2 = C 2 . Note that for any integer k and any positive integer j, by a direct computation we have the following formula: (AC k )j = (AC k ) · · · (AC k )(AC k ) = Aj C k(r j−1 +···+r+1) . (2.4) a By Lemma 2.4(iii), r2 −1 + · · · + r + 1 = 2n−1 u with u being odd. We have an integer u′ such that u′ u ≡ 1 (mod 2n ). Taking j = 2a and k = u′ in Eqn (2.4), we obtain ′ a a ′ (AC u )2 = A2 C u (r 2a −1 a +···+r+1) n−1 = A2 C 2 u′ u n−1 = C2 n−1 C2 = 1. ′ Replacing A by A′ = AC u , we get that G = hA′ , Ci, A′−1 CA′ = C r and a A′2 = 1. So (i) holds. Finally, assume that r = 1 + 2n−a v with v being odd. Then t(r − 1) ≡ 0 (mod 2n ) iff 2n−a vt ≡ 0 (mod 2n ) iff a a t ≡ 0 (mod 2a ). a By Eqn (2.3), hCiA = hC 2 i; hence A2 ∈ hCiA = hC 2 i. So, we can find a a an integer h such that A2 C 2 h = 1. By Lemma 2.4(ii) we can assume that a r2 −1 + · · · + r + 1 = 2a u with u being odd. We have an integer u′ such that u′ u ≡ 1 (mod 2n ), Taking j = 2a and k = u′ h in Eqn (2.4), we obtain ′ a a ′ (AC u h )2 = A2 C u h(r 2a −1 +···+r+1) 5 a a = A2 C 2 uu′ h = 1. ′ Replacing A by A′ = AC u h , we get the conclusion (i). The next lemma shows that the condition “self-centralized” is usually satisfied in our study. Lemma 2.6 ([4, Proposition 4.2]). If G is a permutation-like matrix group and C ∈ G is a maximal cycle, then hCi is self-centralized in G. There is also a proof of this lemma in [6, Lemma 2.7]. For any complex matrix A, by charA (x) we denote the characteristic polynomial of A, i.e., charA (x) = det(xI − A), where I denotes the identity matrix. Lemma 2.7 ([5, Lemma 2.1], [6, Lemma 2.3]). The following two are equivalent to each other: (i) A is similar to a permutation matrix. Q (ii) A is diagonalizable and charA (x) = i (xℓi − 1). If it is the case, then each factor xℓi − 1 of charA (x) corresponds to exactly one ℓi -cycle of the cycle decomposition of the permutation of the permutation matrix. Q Note that xn − 1 = k|n Φk (x), where Φk (x) is the cyclotomic polynomial of degree k, and “k|n” stands for that k divides n. We get an immediate consequence of the above lemma as follows. Corollary 2.8. Let A be a matrix similar to a permutation matrix, and m, n be positive integers. If Φn (x)m charA (x), then Φk (x)m charA (x) for any k | n. 3 The quotient G/hCi is cyclic In this section we always assume: • A, C ∈ GL2n (C); • C is a maximal cycle; • A−1 CA = C r , where r ∈ Z∗2n and ordZ∗2n (r) = 2a with 0 ≤ a ≤ n − 2. Let λ be a primitive 2n -th root of unity. Then n {λj | j ∈ Z2n } = {1 = λ0 , λ, λ2 , · · · , λ2 −1 } (3.1) is the spectrum (i.e., the set of eigenvalues) of C. The eigen-subspace of each eigenvalue λj of C, denoted by E(λj ), has dimension 1; and the complex space n C2 is decomposed into a direct sum of the eigen-subspaces: M n n C2 = E(λj ) = E(λ0 ) ⊕ E(λ) ⊕ E(λ2 ) ⊕ · · · ⊕ E(λ2 −1 ). (3.2) j∈Z2n 6 Taking any non-zero vector ej ∈ E(λj ) for every index j ∈ Z2n , we get a basis n of C2 : (3.3) E = {ej | j ∈ Z2n } = {e0 , e1 , e2 , · · · , e2n −1 }, which will play a key For convenience we denote the diago  role in our study. B1   .. nal blocked matrix   by B1 ⊕ · · · ⊕ Bm . With the basis E in . Bm n Eqn (3.3), the transformation C on C2 has the diagonal matrix n C|E = 1 ⊕ λ ⊕ λ2 ⊕ · · · ⊕ λ2 −1 . For the above, please see [6, Lemma 2.4]. Consider the matrix A|E with respect to the basis E in Eqn (3.3). Recall that A−1 CA = C r where r ∈ Z∗2n with ordZ∗2n (r) = 2a . It is easy to see that AE(λj ) = E(λrj ), ∀ j ∈ Z2n ; (3.4) i.e., A permutes the eigen-subspaces E(λj ) for j ∈ Z2n the same as µr permutes b Z2n , cf. [6, Lemma 2.5]. For any µr -orbit Γk = {jk , rjk , · · · , r2 −1 jk } on Z2n of length 2b (b ≤ a of course), the subset Ek = {ejk , erjk , · · · , er2b −1 jk } of E is L2b −1 i a basis of the subspace Vk = i=0 E(λr jk ). And there are α1 , · · · , α2b ∈ C such that Aejk = α1 erjk , Aerjk = α2 er2 jk , · · · , Aer2b −1 jk = α2b ejk . That is, Vk is invariant by A, and the matrix of A with respect to the basis Ek is   0 ··· 0 α2b   .. α1 . . . . 0   . (3.5) A|Ek =   . ..  .. ..   .. . . . 0 · · · α2b −1 0 2b ×2b ′ ′ If ord(A) = 2a (a′ ≥ a of course), then ω2b = α1 · · · α2b being a 2a −b -th root of unity. Replacing Ek by b Ek = {ejk , Aejk , · · · , A2 we get A|Ek  0  1 = .  .. 0 ··· .. . .. . ··· 0 .. . .. 1 . −1 ω2b 0 .. . 0 ejk },       (3.6) . (3.7) 2b ×2b In particular, A|Ek is a permutation matrix once a′ = b (because ω2b = 1 once a′ = b); in that case, A permutes the set Ek cyclically. Similarly to hCi, by hA, Ci we denote the group generated by A and C. 7 Lemma 3.1 ([5, Proposition 2.3], [6, Proposition 2.6]). Let notations be as above. If there is a choice of the basis E in Eqn (3.3) such that the matrix A|E is a permutation matrix, then the matrix group hA, Ci is a permutation matrix group. The statement “the matrix A|E is a permutation matrix” is equivalent to saying that “the set E is A-stable”, i.e., A permutes the elements of the set E. In that case we call E an A-permutation basis. The rest of this section contributes mainly to finding such a basis E. S We partition Z2n into a disjoint union Z2n = 2Z2n Z∗2n , where 2Z2n = {2k (mod 2n ) | k ∈ Z2n } = {0, 2, · · · , 2(2n−1 − 1)}, Z∗2n = 1 + 2Z2n = {1 + 2k (mod 2n ) | k ∈ Z2n } = {1, 3, · · · , 2n − 1}. Correspondingly, the basis E in Eqn (3.3) is partitioned into E = E 2 ∪ E ∗ where n E 2 = {ej | j ∈ 2Z2n } and E ∗ = {ej | j ∈ Z∗2n }. And by Eqn (3.2), C2 is n decomposed into a direct sum of two subspaces: C2 = V 2 ⊕ V ∗ where L L E(λj ) = Ce, V2 = e∈E 2 j∈2Z2n V∗ = L E(λj ) = j∈Z∗ 2n L Ce. (3.8) e∈E ∗ Both 2Z2n and Z∗2n are µr -invariant. So, for any k with 0 ≤ k < 2n , both n V 2 and V ∗ are AC k -invariant subspaces of C2 . By AC k |V 2 and AC k |V ∗ we denote the linear transformations of AC k restricted to V 2 and V ∗ respectively. Correspondingly, AC k |E 2 and AC k |E ∗ are matrices of AC k |V 2 and AC k |V ∗ respectively. Remark 3.2. The two elements 0, 2n−1 ∈ Z2n are always fixed by µr for any n−1 r ∈ Z∗2n . So, the two eigen-subspaces E(λ0 ) = E(1) and E(λ2 ) = E(−1) are always A-invariant subspaces. (i). Note that: if hA, Ci is a permutation-like matrix group, then Ae0 = e0 P for any e0 ∈ E(λ0 ). Because: in that case G∈hA,Ci G 6= 0 (since the traces of permutation matrices are non-negative integers, and the trace of I is 2n > 0), P 2n there is a vector f ∈ C such that f0 = G∈hA,Ci Gf 6= 0; it is easy to see that Cf0 = f0 and Af0 = f0 ; hence f0 ∈ E(λ0 ), and Ae0 = e0 for any e0 ∈ E(λ0 ). (ii). It is obvious that, if A|E is a permutation matrix, then Ae2n−1 = e2n−1 . Lemma 3.3. Assume that A, C ∈ GL2n (C), C is a maximal cycle and A−1 CA = a C r where r ∈ Z∗2n with ordZ∗2n (r) = 2a . If A2 = I, then there is a choice of the basis E ∗ of V ∗ in Eqn (3.8) such that A|E ∗ is a permutation matrix. Proof. Since ordZ∗2n (r) = 2a , the length of any µr -orbit on Z∗2n equals to 2a . Note that ord(A) = 2a . The conclusion follows from Eqn (3.7). The following lemma exhibits the information for the case when r = −1, which is enough for our later quotations. 8 Lemma 3.4. Assume that A, C ∈ GL2n (C), C is a maximal cycle and A−1 CA = C −1 . If G = hA, Ci is a permutation-like matrix group, then A2 = I (i.e., G is a dihedral group of order 2n+1 ) and one of the following two holds: n−1 (i) Ae2n−1 = e2n−1 for e2n−1 ∈ E(λ2 ), and ( n−1 (x − 1)2 (x2 − 1)2 −1 , charAC k (x) = n−1 (x2 − 1)2 , k is even; k is odd. In that case, there is a choice of the basis E in Eqn (3.3) such that A|E is a permutation matrix. n−1 (ii) Ae2n−1 = −e2n−1 for e2n−1 ∈ E(λ2 ), and ( n−1 (x2 − 1)2 , charAC k (x) = n−1 (x − 1)2 (x2 − 1)2 −1 , k is even; k is odd. Proof. It is easy to see that Z2n is partitioned in to µ−1 -orbits as follows: 2Z2n = {0} ∪ {2n−1 } ∪ {2, −2} ∪ · · · ∪ {2n−1 − 2, −2n−1 + 2}, Z∗2n = {1, −1} ∪ {3, −3} ∪ · · · ∪ {2n−1 − 1, −2n−1 + 1}. Correspondingly, C is diagonally blocked as follows: C|E = C|E 2 ⊕ C|E ∗ = (1 ⊕ −1 ⊕ λ2 ⊕ λ−2 ⊕ · · · ) ⊕ (λ1 ⊕ λ−1 ⊕ λ3 ⊕ λ−3 ⊕ · · · ). n−1 n−1 By Lemma 2.5, either A2 = I or A2 = C 2 . We prove that A2 6= C 2 n−1 by contradiction. Suppose that A2 = C 2 , i.e., A|E = A|E ∗ ⊕ A|E 2 with A2 |E 2 = I2n−1 , A2 |E ∗ = −I2n−1 . By Eqn (3.7), After a suitable choice of the basis E we can assume that 2n−2 −1 A|E 2 z }| { = 1 ⊕ ±1 ⊕ P ⊕ P ⊕ · · · ⊕ P and 2n−2 A|E ∗ where P =   0 1 , 1 0   0 −1 where Q = . 1 0 z }| { = Q ⊕ Q ⊕ ···⊕ Q n−2 n−2 So, charA|E 2 (x) = (x − 1)(x ∓ 1)(x2 − 1)2 −1 and charA|E ∗ (x) = (x2 + 1)2 We get n−2 charA (x) = (x − 1)(x ∓ 1)(x2 + 1)(x4 − 1)2 −1 . 9 . By Lemma 2.7, the second factor of the right hand side has to be x + 1. Hence A|E = A|E 2 ⊕ A|E ∗ = (1 ⊕ −1 ⊕ P ⊕ P ⊕ · · · ) ⊕ (Q ⊕ Q ⊕ · · · ). Then we get the matrix of AC as follows: !      λ2 −λ−1 AC = 1 ⊕ 1 ⊕ ⊕ · · · ⊕ ⊕ λ−2 λ λ3 −λ−3  ⊕ ··· ! and the characteristic polynomial as follows: n−2 = (x − 1)2 (x2 − 1)2 charAC (x) −1 n−2 (x2 + 1)2 n−2 = (x − 1)2 (x2 + 1)(x4 − 1)2 −1 . By Lemma 2.7, AC is not similar to a permutation matrix. However, the assumption of the lemma says that AC is similar to a permutation matrix. The n−1 contradiction forces that A2 6= C 2 . Thus, we obtain that A2 = I and 2n−2 A|E ∗ z }| { = P ⊕ P ⊕ ··· ⊕ P, It is easy to check that: 2n−2 −1 z }| { A|E = 1 ⊕ ±1 ⊕ P ⊕ P ⊕ · · · ⊕ P . 2n−1 −1 z }| { • if A|E = 1 ⊕ 1 ⊕ P ⊕ · · · ⊕ P , then (i) holds; 2n−1 −1 z }| { • otherwise, A|E = 1 ⊕ −1 ⊕ P ⊕ · · · ⊕ P and (ii) holds. In the following we consider the case when r 6≡ −1 (mod 2n ) and find a basis E in Eqn (3.3) such that A|E is a permutation matrix. We start it with an investigation of the characteristic polynomial of AC k . Lemma 3.5. Let A, C ∈ GL2n (C). Assume that C is a maximal cycle, A−1 CA = a C r where −1 6= r ∈ Z∗2n with ordZ∗2n (r) = 2a , and A2 = I. Let V 2 and V ∗ be the subspaces in Eqn (3.8). (i) If r = 1 + 2n−a v where 0 ≤ a ≤ n − 2 and v is odd, then  ν2 (k)  Φ2n−ν2 (k) (x)2 , 0 ≤ ν2 (k) < n − a; char(AC k )|V ∗ (x) = n−a−1  (x2a − 1)2 , ν2 (k) ≥ n − a, or k = 0. (ii) If r = −1 + 2n−a v where 1 ≤ a ≤ n − 2 and v is odd, then  a 2n−a−1 2n−a−1  (x2 + 1) = Φ2a+1 (x) , k is odd; char(AC k )|V ∗ (x) = n−a−1  (x2a − 1)2 , k is even. 10 Proof. By the assumption, Z∗2n is partitioned into µr -orbits Γ1 , · · · , Γh with the lengths all being 2a and the number h = 2n−a−1 : a Γ1 = {j1 , rj1 , · · · , r2 −1 a j1 }, · · · , Γh = {jh , rjh , · · · , r2 ∗ −1 jh }. E1∗ By Eqn (3.3) and Eqn (3.6), we can assume that E = ∪ · · · ∪ Eh∗ with  2a −1 eji , Ei∗ = eji , Aeji , · · · , Ar i = 1, · · · , h. (3.9) Denote the matrices of A and C restricted to Ei∗ by Ai = A|Ei∗ and Ci = C|Ei∗ a for i = 1, · · · , h. Since A2i = I, by Lemma 3.3 we have     kji 0 ··· 0 1 λ     λkji r 1 . . . . . . 0   k  Ai =  . = , C   .. i . . ..  .   . . . . . . . . 2a −1 λkji r 0 ··· 1 0 2a ×2a 2a ×2a Lh a 2a −1 ) . The Thus AC k |E ∗ = i=1 Ai Cik , and charAi Cik (x) = x2 − λji k(1+r+···+r conclusion is obviously true if k = 0. So we further assume that k 6= 0. a ′′ Writing k = k ′ 2ν2 (k) with k ′ being odd, and writing 1+r+· · ·+r2 −1 = a′ 2a a with a′ being odd and a′′ = ν2 (1 + r + · · · + r2 −1 ), we have a ′ ′ a′′ +ν2 (k) charAi Cik (x) = x2 − λji a k 2 , i = 1, · · · , h. ′ ′ a′′ +ν2 (k) If a′′ + ν2 (k) ≥ n, then λji a k 2 = 1. However, if a′′ + ν2 (k) < n, then ′ ′ a′′ +ν2 (k) ′′ λji a k 2 is a primitive 2n−a −ν2 (k) -th root of unity, and, by Lemma 2.1 (ii), the collection of ′ ′ a′′ +ν2 (k) λji a k 2 , i = 1, · · · , h, ′′ is just the collection of all primitive 2n−a −ν2 (k) -th roots of unity, each of which ′′ h appears with multiplicity 2n−a′′ −ν = 2a −a+ν2 (k) . By Eqn (2.1), we obtain 2 (k)−1 that ( a (x2 − 1)n−a−1 , a′′ + ν2 (k) ≥ n; char(AC k )|V ∗ (x) = a′′ −a+ν2 (k) 2 , a′′ + ν2 (k) < n. Φ2n+a−a′′ −ν2 (k) (x) If r = 1 + 2n−a v where 0 ≤ a ≤ n − 2 and v is odd, then, by Lemma 2.4(ii), a′′ = a; hence (i) is proved. Next, assume that r = −1 + 2n−a v where 1 ≤ a ≤ n − 2 and v is odd. By Lemma 2.4(iii), a′′ = n − 1. So a′′ + ν2 (k) < n if and only if k is odd; in that a case, n + a − a′′ − ν2 (k) = a + 1. Noting that Φ2a+1 (x) = x2 + 1, we are done for the conclusion (ii). The second step is a preparation for induction. Let r ∈ Z∗2n . Then µr (the action by multiplication) acts on both Z2n−1 and 2Z2n , and the map Z2n−1 −→ 2Z2n , t 7−→ 2t, is an isomorphism between the µr -acted sets Z2n−1 and 2Z2n . 11 (3.10) Lemma 3.6. Let notation be as in Lemma 3.5. Assume further that the matrix group hA, Ci is permutation-like. Then A|V 2 , C|V 2 is a permutation-like matrix group of dimension 2n−1 with C|V 2 being a maximal cycle. L2n−1 −1 j Proof. Since C|E 2 = j=0 λ , with the isomorphism (3.10), C|V 2 is a maxin−1 mal cycle of length 2 . Note that hA, Ci = {Aℓ C k | 0 ≤ ℓ < 2a , 0 ≤ k < 2n }. To complete the proof, it is enough to show that any (Aℓ C k )|V 2 is similar to a permutation matrix. ′ Let A′ = Aℓ , a′ = a − ν2 (ℓ) and r′ = rℓ . Then A′−1 CA′ = C r and ′ ′ ′ a ord(A ) = ordZ∗2n (r ) = 2 . We compute char(Aℓ C k )|V 2 (x) = char(A′ C k )|V 2 (x) in two cases. Case 1: r ∈ h5i or ν2 (ℓ) ≥ 1 (cf. Remark 2.2). We can use Lemma 3.5(i) to A′ C k and get that  2ν2 (k)  , 0 ≤ ν2 (k) < n − a′ ; Φ2n−ν2 (k) (x) char(Aℓ C k )|V ∗ (x) = ′ 2n−a −1   2a′ (x − 1) , ν2 (k) ≥ n − a′ , or k = 0. Since Aℓ C k is similar to a permutation matrix, by Lemma 2.7 and its corollary,  2ν2 (k)  (x2n−ν2 (k)−1 − 1) , 0 ≤ ν2 (k) < n − a′ ; (3.11) char(Aℓ C k )|V 2 (x) =  Q (x2i − 1)ji , ′ ν (k) ≥ n − a , or k = 0. 2 i Case 2: r = −1 + 2n−a v with v being odd and ν2 (ℓ) = 0 (i.e. a′ = a). By Lemma 3.5(ii) (applied to A′ C k ),  n−a−1 Φ2a+1 (x)2 , k is odd; char(Aℓ C k )|V ∗ (x) =  2a 2n−a−1 , k is even. (x − 1) Since Aℓ C k is similar to a permutation matrix, by Lemma 2.7 and its corollary,  n−a−1 a  (x2 − 1)2 , k is odd; (3.12) charAℓ C k |V 2 (x) =  Q (x2i − 1)ji , k is even. i In both cases, by Lemma 2.7 again, we can conclude that Aℓ C k |V 2 is similar to a permutation matrix. Now we can get enough information for A|E when r6≡ − 1 (mod 2n ). We proceed in two cases: ordZ∗2n (r) = 2, or ordZ∗2n (r) > 2. Lemma 3.7. Let A, C ∈ GL2n (C). Assume that C is a maximal cycle, A−1 CA = C r where −1 6= r ∈ Z∗2n with ordZ∗2n (r) = 2, and A2 = I. Assume further that hA, Ci is a permutation-like matrix group. 12 (i) If r = 1 + 2n−1 , then A|V 2 = I. n−1 (ii) If r = −1 + 2n−1 , then charA|V 2 (x) = (x − 1)2 (x2 − 1)2 −1 . In the both cases there is a choice of the basis E in Eqn (3.3) such that A|E is a permutation matrix. Proof. By Lemma 3.6, A|V 2 , C|V 2 is a permutation-like matrix group of dimension 2n−1 with C|V 2 being a maximal cycle. (i). Obviously, r = 1 + 2n−1 acts by multiplication on 2Z2n trivially. So, A|E 2 is a diagonal matrix, hence A|E 2 commutes with C|E 2 which is a maximal cycle of dimension 2n−1 . By Lemma 2.6, A|E 2 ∈ C|E 2 . But (A|E 2 )2 = I and n−2 ord(C|E 2 ) = 2n−1 . Thus A|E 2 = I2n−1 ×2n−1 or = (C|E 2 )2 . Suppose that n−2 n−2 A|E 2 = (C|E 2 )2 , i.e., (A|E 2 )(C|E 2 )−2 = I2n−1 ×2n−1 . Then char(A| n−1 E 2 )(C|E 2 ) −2n−2 (x) = (x − 1)2 . However, ν2 (−2n−2 ) = n − 2, and by Eqn (3.11), char(A| 2n−2 E 2 )(C|E 2 )−2n−2 (x) = (x2 − 1) n−1 . 2n−2 We reached an impossible equality “(x − 1)2 = (x2 − 1) ”. So it is imposn−2 2 sible that A|E 2 = (C|E 2 ) , and it has to be the case that A|E 2 = I2n−1 ×2n−1 . By Lemma 3.3, we already have a basis E ∗ of V ∗ such that A|E ∗ is a permutation matrix. Thus the basis E in Eqn (3.3) can be obtained such that A|E is a permutation matrix. (ii). Note that r = −1 + 2n−1 ≡ −1 (mod 2n−1 ) (cf. Eqn (3.10)), so (A|V 2 )−1 (C|V 2 )(A|V 2 ) = (C|V 2 )−1 . From Lemma 3.6(ii) and its Eqn (3.12), we have seen that A|E 2 , C|E 2 is a permutation-like matrix group of dimension 2n−1 with C|E 2 being a maximal cycle, and ( 2n−2 (x2 − 1) , k is odd; charAC k |V 2 (x) = Q ji 2i i (x − 1) , k is even. Comparing it with Lemma 3.4, we see that (A|V 2 )e2n−1 = e2n−1 , and, with a suitable choice of the basis E 2 , A|E 2 is a permutation matrix. Lemma 3.8. Assume thar A, C ∈ GL2n (C), C is a maximal cycle and A−1 CA = a C r where r ∈ Z∗2n with ordZ∗2n (r) = 2a . If a ≥ 2 and A2 = I, then there is a choice of the basis E in Eqn (3.3) such that A|E is a permutation matrix. Proof. We prove it by induction on n. By Remark 2.2, r = ±1 + 2n−a v, with v being odd and 2 ≤ a ≤ n − 2. 13 From Lemma 3.3, we have a basis E ∗ of V ∗ in Eqn (3.8) such that A|E ∗ is a permutation matrix. By Lemma 3.6, A|V 2 , C|V 2 is a permutation-like matrix a−1 group of dimension 2n−1 with C|V 2 being a maximal cycle. Let A′ = A2 . 2a−1 a−1 Then A′2 = I and A′−1 CA′ = C r . Since 2a−1 is even, we see that r2 ∈ h5i, a−1 2a−1 hence r is the unique element of order 2 in h5i, i.e., r2 ≡ 1+2n−1 (mod 2n ); see Remark 2.2. By Lemma 3.7(i), A′ |V 2 = I; i.e., a−1 (A|V 2 )2 a−1 = A2 |V 2 = I. Note that ordZ∗n−1 (r) = 2a−1 . By induction, we have a basis E 2 of V 2 in 2 Eqn (3.8) such that A|E 2 is a permutation matrix. Then E = E ∗ ∪ E 2 is a basis n of C2 in Eqn (3.3) such that A|E is a permutation matrix. Theorem 3.9. Assume that G is a 2n -dimensional permutation-like matrix group which contains a maximal cycle C such that hCi is normal in G and the quotient group G/hCi is cyclic. Then G is a permutation matrix group. Proof. By the assumption we can assume that G = hA, Ci and A−1 CA = C r for an r ∈ Z∗2n with ordZ∗2n (r) = 2a where 0 ≤ a ≤ n − 2. By Lemma 2.6, hCi is self-centralized in G. By Lemma 2.5 and Lemma 3.4, we can further assume a that A2 = I and 1 ≤ a ≤ n − 2. By Remark 2.2, we prove the theorem in three cases. Case 1: r = −1, hence a = 1 and A2 = I. By Lemma 3.4, Ae2n−1 = ±e2n−1 . If Ae2n−1 = −e2n−1 , then we replace A by AC. So we can assume that Ae2n−1 = e2n−1 . By Lemma 3.4 (i), there is a basis E in Eqn (3.3) such that A|E is a permutation matrix. By Lemma 3.1, G is a permutation matrix group. Case 2: r = ±1 + 2n−1 (hence a = 1). By Lemma 2.5(ii), we can assume that A2 = I. By Lemma 3.7, there is a basis E in Eqn (3.3) such that A|E is a permutation matrix. By Lemma 3.1, G is a permutation matrix group. Case 3: r = ±1 + 2n−a v with v being odd and 2 ≤ a ≤ n − 2. By a Lemma 2.5(ii), we can assume that A2 = I. By Lemma 3.8, there is a basis E in Eqn (3.3) such that A|E is a permutation matrix. By Lemma 3.1, we are done. 4 The quotient G/hCi is non-cyclic In this section we consider any 2n -dimensional permutation-like matrix group G with a maximal cycle C such that hCi is normal in G and the quotient group G/hCi is not cyclic, and prove that G is in fact a permutation matrix group. It is easy to extend Lemma 3.1 as follows. Lemma 4.1. Let A, B, C ∈ GL2n (C) with C being a maximal cycle and the subgroup hCi being normal in G = hA, B, Ci. If there is a choice of the basis E in Eqn (3.3) such that both A|E and B|E are permutation matrices, then the matrix group G is a permutation matrix group. 14 P n Proof. Let f = e∈E e and F = {f, Cf, , C 2 f, · · · , C 2 −1 f }. Because the matrix to transform the basis E to the set F is a Vandemond matrix formed n n by 1, λ, · · · , λ2 −1 which is non-degenerate, F is a basis of C2 . With respect to the basis F , C|F is obviously a permutation matrix. Since A permutes the elements of E, we have Af = f . For any C j f ∈ F , A(C j f ) = (AC j A−1 )(Af ) = C r −1 j f ∈ F. Thus A|F is a permutation matrix. Similarly, B|F is a permutation matrix. So, with respect to the basis F every element of G is a permutation matrix. Lemma 4.2. Let r = 1 + 2n−a ∈ Z∗2n where 1 ≤ a ≤ n − 2. Then there are j1 , · · · , jm ∈ Z2n \{0, 2n−1} such that all the µr -orbits on Z2n \{0, 2n−1} are written as follows (note that bt = 1, 1 ≤ t ≤ m, is allowed): b1 −1 Γ1 = {j1 , j1 r, · · · , j1 r2 Γ2 = {j2 , j2 r, · · · , j2 r ··· 2b2 −1 b1 −1 µ−1 Γ1 = {−j1 , −j1 r, · · · , −j1 r2 }, }, µ−1 Γ2 = {−j2 , −j2 r, · · · , −j2 r ··· ··· Γm = {jm , jm r, · · · , jm r 2bm −1 2b2 −1 }, }, ··· bm −1 }, µ−1 Γm = {−jm , −jm r, · · · , −jm r2 }. Proof. For k ∈ Z2n , rk ≡ −k (mod 2n ) if and only if (r + 1)k ≡ 0 (mod 2n ). However, ν2 (r + 1) = 1 since r + 1 = 2 + 2n−a and n − a ≥ 2. We see that rk ≡ −k (mod 2n ) if and only if k ≡ 0 or 2n−1 (mod 2n ). So, for any µr -orbit Γ = b b {j, jr, · · · , jr2 −1 } on Z2n \{0, 2n−1}, the set µ−1 Γ = {−j, −jr, · · · , −jr2 −1 } is n−1 }, and another µr -orbit on Z2n \{0, 2 b µ−1 (µ−1 Γ) = µ−1 ({−j, −jr, · · · , −jr2 −1 }) = Γ. b1 Starting from any µr -orbit Γ1 = {j1 , j1 r, · · · , j1 r2 −1 } on Z2n \{0, 2n−1}, we get a pair Γ1 , µ−1 Γ1 of µr -orbits on Z2n \{0, 2n−1}. Taking any µr -orbit  b2 Γ2 = {j2 , j2 r, · · · , j2 r2 −1 } on Z2n \ {0, 2n−1 } ∪ Γ ∪ µ−1 Γ , we get another pair Γ2 , µ−1 Γ2 on Z2n \{0, 2n−1}. Go on in this way till to Z2n \{0, 2n−1} exhausted, we obtain all the µr -orbits on Z2n \{0, 2n−1} as listed pairwise in the lemma. Theorem 4.3. Assume that G is a 2n -dimensional permutation-like matrix group which contains a maximal cycle C such that hCi is normal and the quotient group G/hCi is not cyclic. Then G is a permutation matrix group. Proof. Since hCi is self-centralized in G (see Lemma 2.6), G/hCi is isomorphic to a subgroup H of the multiplicative group Z∗2n . By Lemma 2.3 (ii), H = hri×h−1i where r = 1 + 2n−a with 1 ≤ a ≤ n − 2. Then there are A, B ∈ G such that G = hA, B, Ci, B −1 CB = C −1 , A−1 CA = C r . a By Lemma 2.5(i) and Lemma 3.4, we further assume that A2 = I and B 2 = I. 15 First we show that there is a suitable choice of B such that AB = BA. Since the quotient group G/hCi ∼ = H is commutative, in G/hCi the image of B −1 AB coincides with the image of A itself. So there is a C k ∈ hCi such that B −1 AB = AC k . Note that ord(B −1 AB) = ord(A) = 2a , by Eqn (2.4), a a a I = (B −1 AB)2 = (AC k )2 = A2 C k(r 2a −1 +···+r+1) = C k(r 2a −1 +···+r+1) . a By Lemma 2.4(ii), ν2 (r2 −1 + · · · + r + 1) = a. So the above equality implies that ν2 (k) ≥ n − a. We can write k = 2n−a h. Noting that r − 1 = 2n−a , we obtain: (BC h )−1 A(BC h ) = C −h B −1 ABC h = C −h AC k C h = AC −rh C k C h n−a = AC k+h−rh = AC 2 h−2n−a h = A. Replacing B with BC h , we still have G = hA, B, Ci, B −1 CB = C −1 and B 2 = I (since (BC h )2 = I, see Lemma 2.5(ii.1)), and we have a further condition that AB = BA. By Lemma 3.7(i) (for a = 1) and Lemma 3.8 (for a > 1), there exists a basis E in Eqn (3.3) such that A|E is a permutation matrix. Specifically, Ae0 = e0 for n−1 any e0 ∈ E(λ0 ) and Ae2n−1 = e2n−1 for any e2n−1 ∈ E(λ2 ), see Remark 3.2. Using the notation in Lemma 4.2 and the method in Eqn (3.7), we construct the basis E precisely by choosing ej for j ∈ Z2n \{0, 2n−1} as follows. Let Γt and µ−1 Γt , for t = 1, · · · , m, be the µr -orbits in Lemma 4.2. We take bt a non-zero vector ejt ∈ E(λjt ). By Eqn (3.7), Et = {ejt , Aejt , · · · , A2 −1 ejt } is a L2bt −1 i basis of the subspace Vt = i=0 E(λr jt ) such that A|Et is a permutation matrix. Since Bejt ∈ E(λ−jt ) (see Eqn (3.4)), we can take e−jt = Bejt . Then Et′ = L2bt −1 i bt = i=0 E(λ−r jt ) {e−jt , Ae−jt , · · · , A2 −1 e−jt } is a basis of the subspace Vt′ S m such that A|Et′ is a permutation matrix. Let E = {e0 , e2n−1 } t=1 (Et ∪Et′ ). Then E is a basis in Eqn (3.3) such that A|E is a permutation matrix. On the other hand, Be−jt = B 2 ejt = ejt . i.e., B interchanges ejt and e−jt . Since B commutes with A, we get that B(Aejt ) = A(Bejt ) = Ae−jt . It is the same that BAe−jt = Aejt . So, B interchanges Aejt and Ae−jt . Similarly, B interchanges Ai ejt and Ai e−jt for i = 0, 1, · · · , 2bjt −1 . In a word, B|Et ∪Et′ is a permutation matrix. Of course, Be0 = e0 , see Remark 3.2. To complete the proof, it is enough to show that Be2n−1 = e2n−1 ; because: it implies that B|E is a permutation matrix, and by Lemma 4.1, G is a permutation matrix group. From an easy computation: n−a (AB)−1 C(AB) = B −1 (A−1 CA)B = B −1 C 1+2 n−a n−a B = C −1−2 , we have (AB)−1 C(AB) = C −1+2 v with v = −1 being odd. Obviously, a a a hAB, Ci is a permutation-like matrix group and (AB)2 = A2 B 2 = I (since AB = BA). By Lemma 3.7(ii) and Lemma 3.8, there is a basis E ′ in Eqn (3.3) such that (AB)|E ′ is a permutation matrix. In particular, (AB)e2n−1 = e2n−1 , see Remark 3.2. Note that Ae2n−1 = e2n−1 implies that A−1 e2n−1 = e2n−1 . Then Be2n−1 = A−1 (ABe2n−1 ) = A−1 e2n−1 = e2n−1 . We are done. 16 Acknowledgments The authors are supported by NSFC through the grant number 11271005. References [1] J. L. Alperin, R. B. Bell, Groups and Representations, GTM 162, SpringerVerlag, New York, 1997. [2] Bocong Chen, Hai Q. Dinh, Yun Fan, and San Ling, Polyadic constacyclic codes, IEEE Trans. Inform. Theory 61(2015), 4895-4904. [3] G. Cigler, Groups of matrices with prescribed spectrum, Doctoral dissertation, 2005, http://matknjiz.si/doktotati/2005/10921-83.pdf [4] G. Cigler, Permutation-like matrix groups, Linear Algebra and its Applications 422(2007), 486-505. [5] Guodong Deng, Yun Fan, Permutation-like matrix group with a maximal cycle of prime square length, Linear Algebra and its Applications 450(2014), 44-55. [6] Guodong Deng, Yun Fan, Permutation-like matrix groups with a maximal cycle of power of odd prime length, Linear Algebra and its Applications 480(2015), 1-10. [7] D.J.S. Robinson, A Course in Groups Theory, GTM 80, Springer-Verlag, New York, 1980. 17
4math.GR
International Journal of Software Engineering & Applications (IJSEA), Vol.5, No.4, July 2014 COMBINING THE ANALYTICAL HIERARCHY PROCESS AND THE GENETIC ALGORITHM TO SOLVE THE TIMETABLE PROBLEM Ihab Sbeity, Mohamed Dbouk and Habib Kobeissi Department of Computer Sciences, Faculty of Sciences, Section I, Lebanese University, LEBANON ABSTRACT The main problems of school course timetabling are time, curriculum, and classrooms. In addition there are other problems that vary from one institution to another. This paper is intended to solve the problem of satisfying the teachers’ preferred schedule in a way that regards the importance of the teacher to the supervising institute, i.e. his score according to some criteria. Genetic algorithm (GA) has been presented as an elegant method in solving timetable problem (TTP) in order to produce solutions with no conflict. In this paper, we consider the analytic hierarchy process (AHP) to efficiently obtain a score for each teacher, and consequently produce a GA-based TTP solution that satisfies most of the teachers’ preferences. KEYWORDS Timetable problem, Genetic algorithm, Analytic Hierarchy process, and Multi-criteria decision making. 1. INTRODUCTION The timetable problem (TTP) is the process of scheduling a sequence of courses between teachers, students and rooms, to satisfy a set of various constraints. These constraints differ based on the institutions involved, e.g. schools, universities, and so on. In some institutions, such as Lebanese elementary schools and high-schools, an important constraint to consider is the teacher preferences that may be related to some criteria, such as the teacher age, his address, his contract-type, etc. For example, a teacher with seniority should have the opportunity to choose his course schedule. Or, a part-time teacher has the priority to select his preferred schedule over a full-time teacher, and so on. Some of these criteria may be a reflection of the social life and relationships in the urban Lebanese institutions. Note that, these criteria may be conflicting so that the ranking of teachers accordingly becomes not obvious. This is, for example, the case when comparing a senior full-time teacher with a younger part-time teacher. The analytic hierarchy process (AHP), developed by Saaty [1], is an effective tool for dealing with such complex decision making processes; therefore building a ranking relationship between teachers, based on a series of pairwise comparisons. In addition, the AHP incorporates a useful technique for checking the consistency of the decision evaluation, hence reducing the bias in the decision making process. On the other hand, the manual solution of TTP is still used nowadays, for reasons related, not only to the lack of budget needed to buy a dedicated TTP solver such that aSc [2, 3] and Prime DOI : 10.5121/ijsea.2014.5403 39 International Journal of Software Engineering & Applications (IJSEA), Vol.5, No.4, July 2014 [4], but also to the inconsistency of such tools with the Lebanese teachers’ criteria. With the majority of existing tools, the person responsible in creating the schedule must manually specify the teachers’ priorities with their -inconsistent-preferences, and then the tool will generate the timetable schedule. However, the teachers’ priorities are not always evident to be significantly measured. In addition, as TTP is an NP-complete problem, its manual solution is time and effortconsuming. The problem would be presented by a great number of variables which make it intractable. That was the motivation to approach it by means of Genetic Algorithm (GA) [5]. In this paper, we present a new approach (AHP/GA) that combines AHP and GA to create a time table schedule that matches most of the teachers’ preferences along with the institution. Using AHP, we will develop a teachers ranking by providing a score for each teacher, and then, a satisfaction function will be incorporated to the GA to produce the schedule that matches as best the AHP ranking, and satisfies of most the teachers’ preferences. An informal description of the approach is presented basing on a simple example. The formal description and the implementation of the method would be our future challenge. The rest of this paper is structured as follows: Section 2 presents a background of works related to the utilization of GA to solve TTP. Section 3 describes the steps followed by AHP/GA to produce a time table schedule taking into consideration the teachers’ preferences. We also present a simple case study to be an application of the procedure. In section 3, AHP is applied to a set of teachers and their score calculation procedure is presented. Section 4 describes the result of the combination of AHP and GA to generate the time table schedule. Section 5 concludes our paper and describes our ongoing works. 2. BACKGROUND 2.1. Genetic algorithm A genetic algorithm is a type of searching algorithm. It searches a solution space for an optimal solution to a problem. The key characteristic of the genetic algorithm is how the searching is done. The algorithm creates a “population” of possible solutions to the problem and lets them “evolve” over multiple generations to find better and better solutions. The population is the collection of candidate solutions that we are considering during the course of the algorithm. Over the generations of the algorithm, new members are “born” into the population, while others “die” out of the population. A single solution in the population is referred to as an individual. A fitness function of an individual presents a measure of how “good” the solution represented by the individual is. The better the solution, the higher the fitness – obviously, this is dependent on the problem to be solved. The selection process is analogous to the survival of the fittest in the natural world. Individuals are selected for “breeding” (or cross-over) based upon their fitness values –the fitter the individual, the more likely that individual will be able to reproduce. The cross-over occurs by mingling the two solutions together to produce two new individuals. During each generation, there is a small chance for each individual to mutate, which will change the individual in some small way [6]. For further information about GA, refer to [7]. 2.2. Related works Various types of timetable problems appear with regards to educational institutions and depend on the elements to be scheduled, i.e. exams or regular courses. An excellent survey of exam timetabling techniques is presented in Qu et al. [8]. The examination timetabling is similar in 40 International Journal of Software Engineering & Applications (IJSEA), Vol.5, No.4, July 2014 most institutions and consists of scheduling the exams for a set of courses, over a limited time period, while avoiding the overlapping of the exams for each student, as well as seeking the largest spread over the examination period [9]. However, the course timetable differs regarding to the institution, i.e. universities, schools. A course timetable scheduling problem basically deals with effective distribution of five kinds of entities (or resources): Rooms, Courses, Teachers, Students, and Time (days and hours). In university timetables, the problem presents a large number of constraints to be satisfied. These constraints typically cover the time conflict, the room conflict, the course conflict, and other criteria related to teachers and students preferences. Commonly, they are divided into two types: hard constraints and soft constraints [10]. Hard constraints are those that cannot be violated, such as: “no more than one course is allowed at a timeslot in each room.” Soft constraints may be violated, but the purpose lies in minimizing their violation. An example of soft constraints in a university timetable is: “a student can only attend one course per day”. A wave of works had proposed GA-based solutions for the university timetable problem; we underline the works of [10, 11, 12]. The schools TTP may be defined as a subset of the universities TTP, as in university TTP the number of set of constraints is larger. Several works has addressed the school TTP and presented different approaches to solve the problem; we highlight the works of [8, 13, 14]. Each of these works proposes a different utilization and definition of GA parameters (chromosomes description, mutation and crossover definition, etc). Other works apply a parallel implementation of GA to solve the school TTP [15]. However, addressing the teachers’ preferences in the way presented by this paper has never been previously carried out, and it would be our contribution. 3. THE AHP/GA PROCESS AND PROBLEM DESCRIPTION A common classic definition of the GA fitness function presented by previous works [13, 14, 15, 16] takes into consideration the time conflict. Hence, our AHP/GA approach assumes that the time conflict is already solved by using one of the fitness functions previously mentioned. Our concern is to consider the teachers’ preferences such that a feasible solution is the one that satisfies the most of these preferences. The AHP/GA process is described by figure 1. First, AHP is used to calculate the score of each teacher arising from a set of information given according to the institution valuable criteria. These scores are considered as one of the GA input. The fitness function of the GA is practically composed of two functions: the conflict function and the satisfaction function. A feasible solution should be validated by both functions; however, we omit the process used by the conflict function as it may be the same as in one of previous mentioned works. The satisfaction function, having the teachers’ scores as parameters, checks if the GA produced solutions satisfy the teachers’ preferences given as input. Figure 1: the AHP/GA process 41 International Journal of Software Engineering & Applications (IJSEA), Vol.5, No.4, July 2014 In the rest of the paper, the AHP/GA process is applied on a simple case study described below. Description of a school TTP In this paper, we only present an informal description of our approach. Having a purpose to simplify the problem description and the presentation of its solution later on, we consider the following simple TTP model: • • • • The school is open only 3 days a week, e.g. D1, D2, and D3. Daily, 4 sessions are only scheduled on 4 time slots, each two are separated by a break session (BS). The school provides 2 classes: C1 and C2. Thus, each class has (3×4) 12 sessions per week, and a total of (12×2) 24 sessions are achieved weekly by all the school’s teachers. The school has 6 teachers. The distribution of the set of sessions over the teachers is given in the following table (Table 1): Table 1: Distribution of sessions over the set of teachers Teacher T1 T2 T3 T4 T5 T6 Total C1 3 2 2 2 1 2 12 C2 4 2 1 3 1 1 12 Total 7 4 3 5 2 3 24 Note that in our study, we do not take into consideration the course name (math, sciences, literature, etc..); therefore there is no need to specify the course given in each session, as each course is assigned to only one teacher. Accordingly, only the teacher’s schedule should be implemented without taking care of the course name. Recalling that our purpose is to simplify the presentation of the approach, the above model is a simple description of reality. A standard Lebanese school actually provides nine levels (classes) that may have one or more sections each depending on the number of students tolerable in the level (in case of two or more sections by level, we may consider each section as a new separate class). The school is usually open five days a week, and offers daily six sections per class. Thus, at least a total of (9×5×6) 270 sessions should be scheduled over the nine classes and the set of teachers. Back to our simple model, table 2 presents an empty time slot table that should be assigned to teachers. Table 2: Empty time table C1 D1 D2 C2 D3 D1 D2 D3 42 International Journal of Software Engineering & Applications (IJSEA), Vol.5, No.4, July 2014 As in previous related works, here again, two kinds of constraints should be respected in the time table schedule, hard and soft. We restrict our study on necessary constraints. The Other constraints (such as “for a class, two consecutive sessions of the same teacher is not acceptable) are not considered, but their integration to our approach seems to be promising. • Hard constraints: 1. There should not be time conflict in the teacher schedule, i.e. a teacher should not have two or more sessions in parallel in the same time slot. 2. Each teacher should be assigned the specified number of session by class. • Soft constraint: only one soft constraint has to be underlined, and it is related to the teacher preferences. A teacher would specify a proffered schedule. The goal is to satisfy at most the teachers’ preferences. When all the teachers’ preferences are satisfied, a perfect time table schedule is obtained. Table 3: Preferred schedule of teachers T1 D1 D2 T2 D3 D1 D2 1 1 1 1 1 1 1 1 1 1 1 1 T4 T3 D3 D1 1 D2 D3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 T6 D1 1 1 1 1 D2 D3 1 1 T5 D1 D2 1 D3 D1 D2 1 1 1 1 D3 1 1 As it is mentioned above, the described hard constraints are already addressed by previous listed works. In our paper, we suppose that the GA is able to produce a time table without time conflict, and that each teacher is assigned an exact number of sessions as required for them. Respecting the soft constraint is the key issue that we intend to solve by satisfying the teachers’ preferences. In order to do that, we assume that each teacher should provide his preferred schedule to the institution. Our combined (AHP/GA) algorithm will then generate the time table that satisfies the teachers’ preferred schedule according to a satisfaction threshold (ST) fixed by the institution. The satisfaction function (SF) will be applied to each possible solution generated by (AHP/GA). Hence, a solution is feasible when its SF is greater than ST. For our simple case, table 3 presents the preferred schedule of six teachers. The value ‘1’ means that the specified session is preferred by the teacher. For example, T1 has no problem with his schedule in D1. However, he prefers to give his sessions after the break session in D2, and before the break session in D3. In the next section, we show how to generate a score for each teacher using AHP. These scores are the crucial parameters of the satisfaction function. 43 International Journal of Software Engineering & Applications (IJSEA), Vol.5, No.4, July 2014 4. THE ANALYTICAL HIERARCHY PROCESS The AHP is a simple decision-making tool that deals with complex multi-attribute problems which has been developed by Thomas Saaty in the (1980’s). It is widely known as a method for ranking decision alternatives and selecting the best one when the decision maker has multiple objectives, or criteria. The selection process is based on the calculation of scores for alternatives. The key point in the AHP method is the pairwise comparison used to calculate the relative weights of criteria, and consequently to develop an overall ranking of alternatives. In order to help the pairwise comparison, Saaty created a nine-point scale of importance between two elements. Here, we are interested in only five scales. The suggested numbers to express degrees of preference between the two elements is shown in table 4. Table 4: Standard scale used in AHP Preference level Equally preferred Moderately preferred Strongly preferred Very Strongly preferred Extremely preferred Numerical value 1 3 5 7 9 In our approach, AHP is used in order to generate a score Si for each teacher Ti. For this goal, we present the steps followed in AHP method by applying to our simplified TTP example. In our case study, we are interested in ranking the list of teachers (alternatives) according to a list of criteria – supposed - defined by the school and that can differ from an institution to another. Once again, to simplify the presentation of the approach, we consider four criteria: the teacher’s age, the teacher’s contract-type (part/full timer), the teacher’s gender (male/female), and the teacher’s teaching load. Other criteria related to teachers such as health conditions, marital status, distance between the living address and the school, may also be significant. The teaching load Li of each teacher Ti is also an essential data needed later on in the (AHP/GA) approach, even if it is not considered as the teacher criteria. Table 5 presents the list of information about the 6 teachers of our case study, according to the 4 criteria. For the set of criteria, the school should specify the importance of a criterion compared to another criterion. The order of importance is translated to a value using the AHP scale of table 4. Table 5: Information about teachers Teacher T1 T2 T3 T4 T5 T6 Age 42 33 25 24 63 43 Gender M F F F M F Contract Full Full Part Part Full Full Load 7 4 3 5 2 3 44 International Journal of Software Engineering & Applications (IJSEA), Vol.5, No.4, July 2014 We consider that the contract type and the teacher load are the most important factors that give the teacher the superiority to choose his/her preferred schedule. A part-timer teacher has primacy over a full-timer. Also, the teacher with greater load should be prioritized over a teacher with a smaller load. The teacher’s age comes next in the importance of criteria. Ages are divided into 5 intervals: I1 = [21 - 30], I2 = [31 - 40], I3 = [41 - 50], I4 = [50 - 60] and I5 = [60 – and up]. Intervals of older ages become more important in the preference level, e.g. older teachers are given the priority to choose their course schedule over younger teachers. Teachers of the same age interval have the same preference value. The teacher’s gender has the least importance in the preference order. We assume that a “female” teacher has the priority in the preference level. According to the AHP scale of table 4, and the relative importance of criteria described above, the pairwise comparison rating for each criterion is given in table 6. Table 6: Pairwise comparison for the four criteria Age Teacher T1 T2 T3 T4 T5 T6 T1 1 3 5 5 1/5 1 T2 1/3 1 3 3 1/7 1/3 T3 1/5 1/3 1 1 1/9 1/5 T4 1/5 1/3 1 1 1/9 1/5 T5 5 7 9 9 1 5 T6 1 3 5 5 1/5 1 Teacher T1 T2 T3 T4 T5 T6 Load T1 T2 T3 T4 T5 T6 1 3 5 3 5 5 1/3 1 3 1 3 3 1/5 1/3 1 1/3 1 1 1/3 1 3 1 3 3 1/5 1/3 1 1/3 1 1 1/5 1/3 1 1/3 1 1 Gender Teacher T1 T2 T3 T4 T5 T6 T1 1 1/3 1/3 1/3 1 1/3 T2 3 1 1 1 3 1 T3 3 1 1 1 3 1 T4 3 1 1 1 3 1 T5 1 1/3 1/3 1/3 1 1/3 T6 3 1 1 1 3 1 Contract type Teacher T1 T2 T3 T4 T5 T6 T1 1 1 1/5 1/5 1 1 T2 1 1 1/5 1/5 1 1 T3 5 5 1 1 5 5 T4 5 5 1 1 5 5 T5 1 1 1/5 1/5 1 1 T6 1 1 1/5 1/5 1 1 As per the criterion “AGE”, we consider that the ascending exploration of intervals correspond to a same exploration in the preference scale. Thus, the age of the interval I3 is “strongly preferred” to the age of I2, and “moderately preferred” to the age of I1, and so on. As an example, the pairwise comparison of T1 to T3 gives the value 5 meaning that the age of T1 (42) is strongly preferred to the age of T3 (24). The pairwise comparison according to the criterion “gender” respects the fact that a female is moderately preferred to a male teacher. The pairwise comparison of the criterion “contract-type” is achieved according to the fact that a part-timer is strongly preferred to a full-timer. Finally, we applied the pairwise comparison of the “load” criteria, again, basing on a division of the load value into intervals [0-2[, [2-4[, [4-6[, [6-..[, and the same strategy used for the criterion “age” is applied. 45 International Journal of Software Engineering & Applications (IJSEA), Vol.5, No.4, July 2014 Note that for all criteria, any teacher compared to himself is equally preferred, and that if Ti is compared to Tj for a criterion and the preference value is x, then the preference value of comparing Tj to Ti is 1/x. The second step in the AHP process is the generation of the preference vectors of each criterion. In table 7, we present how to calculate the preference vector of the criterion “gender”. Table 7: Calculation of the preference vector for criterion "Gender" Gender Gender Teacher T1 T2 T3 T4 T5 T6 Teacher T1 T2 T3 T4 T5 T6 T1 1 1/3 1/3 1/3 1 1/3 T1 1/14 1/14 1/14 1/14 1/14 1/14 T2 3 1 1 1 3 1 T2 3/14 3/14 3/14 3/14 3/14 3/14 T3 3 1 1 1 3 1 T3 3/14 3/14 3/14 3/14 3/14 3/14 T4 3 1 1 1 3 1 T4 3/14 3/14 3/14 3/14 3/14 3/14 T5 1 1/3 1/3 1/3 1 1/3 T5 1/14 1/14 1/14 1/14 1/14 1/14 T6 3 1 1 1 3 1 T6 3/14 3/14 3/14 3/14 3/14 3/14 total 14 14/3 14/3 14/3 14 14/3 total 14 14/3 14/3 14/3 14 14/3 Gender Teacher T1 T2 T3 T4 T5 T6 Average T1 0.072 0.072 0.072 0.072 0.072 0.072 0.072 T2 0.214 0.214 0.214 0.214 0.214 0.214 0.214 T3 0.214 0.214 0.214 0.214 0.214 0.214 0.214 T4 0.214 0.214 0.214 0.214 0.214 0.214 0.214 T5 0.072 0.072 0.072 0.072 0.072 0.072 0.072 T6 0.214 0.214 0.214 0.214 0.214 0.214 0.214 total 14 14/3 14/3 14/3 14 14/3 1 First, the sum of each column is calculated. Then, each element of each column is divided by the corresponding sum. Finally, the preference vector is calculated such that each value corresponds to its row average. Therefore, the preference vectors of the all criteria are shown in table 8. Table 8: Preference vectors for the four criteria Teacher T1 T2 T3 T4 T5 T6 Age 0.193 0.100 0.086 0.086 0.342 0.193 Gender 0.072 0.214 0.214 0.214 0.072 0.214 Load 0.420 0.188 0.068 0.188 0.068 0.068 Contract 0.071 0.071 0.358 0.358 0.071 0.071 46 International Journal of Software Engineering & Applications (IJSEA), Vol.5, No.4, July 2014 The third step of AHP is ranking the criteria to determine their relative importance or weights. Again, the pairwise comparison is used for this purpose. Agreeing with the relative importance previously described, table 9 shows the criteria’ weights which are calculated in a similar way as the preference vectors. Table 9: Criteria's weights Criteria Age Gender Load Contract Weight Age 1 3 1/5 1/3 0.122 Gender 1/3 1 1/7 1/5 0.057 Load 5 7 1 3 0.558 0.263 Contract 3 5 1/3 1 Total 28/3 16 176/105 68/15 Now, the score of each teacher may be calculated as a vector/matrix multiplication of the weight of table 9 and the matrix of table 8. The obtained result is as follows: • • • • • • S1 = Score T1 = (0.193×0.122) + (0.072×0.057) + (0.420×0.558)+(0.071×0.263) = 0.281 S2 = Score T2 = 0.148 S3 = Score T3 = 0.158 S4 = Score T4 = 0.222 S5 = Score T5 = 0.102 S6 = Score T6 = 0.089 The set of score S = {Si, i = 1 ... 6} will be used in the next section to incorporate an overall satisfaction function to the GA in order to produce the requested time table satisfying most of the teachers’ preferences. Finally, we mention that AHP also incorporates a useful technique for checking the consistency of the decision evaluation. A consistency test may be applied to our study to verify if the considered pairwise comparisons are reliable. For further information about the consistency test, refer to [13]. 5. COMBINING AHP AND GA (AHP/GA) As it has been presented, the genetic algorithm proposes a fitness function used to test the feasibility of a produced solution. The classic fitness function of a GA applied to solve the TTP takes into consideration the time conflict. We define this function by Fconflict. Practically, Fconflict may return the number of conflicts in the generated solution and a solution if feasible when the value of Fconflict is 0 [15]. This task is implemented by several previous works. In our (AHP/GA) approach, another function Fsatisfaction – the satisfaction function- is integrated to the GA fitness function, such that Fsatisfaction =  Si×Mi. Where Si, is the score of teacher Ti generated by AHP, and Mi is the number of sessions of teacher Ti that match its preferred schedule (see table 3). Observe that the maximum value of Fsatisfaction (called MaxFsatisfaction) is  Si×Li, where Li is the load of Ti, and hence we obtain a perfect satisfaction. 47 International Journal of Software Engineering & Applications (IJSEA), Vol.5, No.4, July 2014 As a result, we say that the solution of (AHP/GA) is feasible, when the two following conditions are respected: 1. Fconflict = 0 2. Fsatosfaction ≥ ST ; where ST is a satisfaction threshold set by the TT designer. Note that, in order to obtain a perfect satisfaction, we only need to set ST to be  Si×Li. For our case study, MaxFsatisfaction = (0.281×7) + (0.148×4) + (0.158×3) + (0.222×5) + (0.102×2) + (0.089×3) = 4.614. Table 10 presents a randomly generated solution of AHP/GA with Fsatisfaction = (0.281×5) + (0.148×2) + (0.158×1) + (0.222×5) + (0.102×2) + (0.089×2) = 3.351, which is not feasible if we assume that ST = 4. Table 10: A non-feasible solution of AHP/GA D1 T1 T2 T3 T5 C1 D2 T1 T2 T4 T6 D3 T1 T3 T4 T6 D1 T4 T1 T1 T3 C2 D2 T5 T1 T2 T4 D3 T6 T1 T2 T4 Finally, note that a feasible solution with a perfect satisfaction may be generated by AHP/GA for our case study, and it is shown in table 11. Table 11: Feasible solution of AHP/GA with perfect satisfaction D1 T1 T6 T2 T2 C1 D2 T4 T4 T3 T1 D3 T1 T3 T6 T5 D1 T6 T1 T1 T5 C2 D2 T2 T2 T1 T4 D3 T4 T1 T3 T4 6. CONCLUSION This paper presents a new approach that deals with the teachers’ preferences while constructing the time table of a school schedule. Our approach consists of the integration of a satisfaction function to the genetic algorithm. The parameters of the satisfaction function are the teachers’ loads and a set of scores calculated using the analytical hierarchy process. The key point of AHP in calculating the scores is the pairwise comparison of a set of teachers’ criteria. The new approach is consequently a combination of AHP and GA, and it gives rise to a new methodology to solve the time table problem that we call AHP/GA. In this paper, we present an informal description of our AHP/GA approach. The formal description and the implementation of the procedure are in perspective. In addition, we need to verify our contribution by applying the implemented AHP/GA to different case studies in Lebanese schools. Moreover, the consideration of more sophisticated constraints related to the 48 International Journal of Software Engineering & Applications (IJSEA), Vol.5, No.4, July 2014 courses order, and their integration into AHP/GA is another important perception. The declaration of a set of rules, for the manual interception while building the time table, is also suitable. REFERENCES [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] Saaty, T.L., ‘The Analytic Hierarchy Process’, McGraw-Hill, Inc., 1980. Mockus, Jonas, and Lina Pupeikienė. "On multi-start algorithms for optimization of high school timetables." Informatica 23.3 (2012): 405-425. The aSc timetable tool official website: http://www.asctimetables.com The Prime timetable tool, official website: http://www.primetimetable.com Holland, John H. "Genetic algorithms and the optimal allocation of trials." SIAM Journal on Computing 2.2 (1973): 88-105. S. M. Thede, “An introduction to genetic algorithms,” J. Comput. Sci. Colleges, vol. 20, no. 1, pp. 115–123, Oct. 2004. Goldberg, David Edward. "Genetic algorithms in search, optimization, and machine learning". Vol. 412. Reading Menlo Park: Addison-wesley, 1989. Qu R, EK Burke, B McCollum, LTG Merlot, SY Lee. "A survey of search methodologies and automated system development for examination timetabling." Journal of scheduling 12.1 (2009): 5589. Gyori, Sándor, Zoltán Petres, and Annamária R. Várkonyi-Kóczy. "Genetic Algorithms in Timetabling. A New Approach." Budapest University of Technology and Economics, Hungary (2001). Ghaemi, Sehraneh, Mohammad Taghi Vakili, and Ali Aghagolzadeh. "Using a genetic algorithm optimizer tool to solve University timetable scheduling problem." Signal Processing and Its Applications, 2007. ISSPA 2007. 9th International Symposium on. IEEE, 2007. Abdullah, Salwani, and Hamza Turabieh. "Generating university course timetable using genetic algorithms and local search." Convergence and Hybrid Information Technology, 2008. ICCIT'08. Third International Conference on. Vol. 1. IEEE, 2008. Chaudhuri, Arindam, and Kajal De. "Fuzzy genetic heuristic for university course timetable problem." International journal of Advance Soft Computing Application 2.1 (2010). Colorni, Alberto, Marco Dorigo, and Vittorio Maniezzo. "A genetic algorithm to solve the timetable problem." Politecnico di Milano, Milan, Italy TR (1992): 90-060. Dhanabalan, K., S. Nagarajan, and S. Sakthivel. "Genetic Algorithm based Timetabling System-New Approach." International Journal of Research & Reviews in Computer Science 1.2 (2010). Abramson, David, and J. Abela. "A parallel genetic algorithm for solving the school timetabling problem". Division of Information Technology, CSIRO, 1991. Carrasco, Marco P., and Margarida V. Pato. "A multiobjective genetic algorithm for the class/teacher timetabling problem." Practice and Theory of Automated Timetabling III. Springer Berlin Heidelberg, 2001. 3-17. Authors Ihab Sbeity, the main author, is Associative Professor in Computer Science at the Faculty of Sciences in the Lebanese University. He received a Maîtrise in applied mathematics from the Lebanese university, a Master in computer science - systems and communications from Joseph Fourier University, France, and a PhD from INPG (Institut National Polytechnique de Grenoble), France. His PhD works are related to Performance Evaluation and System Design. Actually, his research interests include software performance engineering, UML modelling, and decision information system. 49 International Journal of Software Engineering & Applications (IJSEA), Vol.5, No.4, July 2014 Mohamed Dbouk, is a full time Professor at the Lebanese University (Beirut-Lebanon), he coordinates a master-2 research degree “IDSS: Information and Decision Support Systems”. He received his PhD from “Paris-Sud”, France, 1997. His research interests include software engineering and information systems related issues, geographic information systems, data-warehousing and data-mining. Habib Kobeissi, is Associate Professor of Data Structure at the Faculty of Sciences in the Lebanese University (since 1987). He holds a Bachelor of Science in Computer Science from Grenoble University, a Master of Science in Data Structure from the University of Paris VI, and a Ph.D. in Data Structure from the University of Paris V. Between 1979 and 1987, he worked as a Computer Scientist at several French companies. 50
9cs.NE
(IJCSIS) International Journal of Computer Science and Information Security, Vol. 6, No. 3, 2009 Mining Spatial Gene Expression Data Using Negative Association Rules *M.Anandhavalli, M.K.Ghose K.Gauthaman Department of Computer Science Engineering SMIT Majitar, India Department of Drug Technology Higher Institute of Medical Technology Derna, Libya . . themselves but rather based on the co-occurrence of the items within the database. The associations between items are commonly expressed in the form of association rules. In general, an association rule represents a relationship between two sets of items in the same database. It can be written in the form A → C, where A and C are item sets and A∩C=Φ. The left-hand side (LHS) of the rule is called the antecedent, while the right-hand (RHS) is called consequent. Negative association rules are complementary to the sorts of association rules and have the forms A→¬C or ¬A→C. The rule in the form of ¬A →¬C is equivalent to a positive association rule in the form of C →A. Abstract— Over the years, data mining has attracted most of the attention from the research community. The researchers attempt to develop faster, more scalable algorithms to navigate over the ever increasing volumes of spatial gene expression data in search of meaningful patterns. Association rules are a data mining technique that tries to identify intrinsic patterns in spatial gene expression data. It has been widely used in different applications, a lot of algorithms introduced to discover these rules. However Priori-like algorithms has been used to find positive association rules. In contrast to positive rules, negative rules encapsulate relationship between the occurrences of one set of items with absence of the other set of items. In this paper, an algorithm for mining negative association rules from spatial gene expression data is introduced. The algorithm intends to discover the negative association rules which are complementary to the association rules often generated by Priori like algorithm. Our study shows that negative association rules can be discovered efficiently from spatial gene expression data. In this paper, an attempt has been made to study a novel algorithm for discovering of positive association rules and generating meaningful negative association rules in effective manner from spatial gene expression data. II. Keywords- Spatial Gene expression data; Association Rule; Negative Association Rule I. → means ―implies‖ III. INTRODUCTION (HEADING 1) The main contribution here has been a great explosion of genomic data in recent years. This is due to the advances in various high-throughput biotechnologies such as spatial gene expression database. These large genomic data sets are information-rich and often contain much more information than the researchers who generated the data might have anticipated. Such an enormous data volume enables new types of analyses, but also makes it difficult to answer research questions using traditional methods. Analysis of these massive genomic data has two important goals: NOTATIONS U means Union ¬ means negation MATERIALS AND METHODS A. Spatial Gene Expression Data The Edinburgh Mouse Atlas gene expression database (EMAGE) is being developed as part of the Mouse Gene Expression Information Resource (MGEIR) [1] in collaboration with the Jackson Laboratory, USA. EMAGE (http: //genex.hgu. mrc.ac.uk/Emage/database) is a freely available, curated database of gene expression patterns generated by in situ techniques in the developing mouse embryo [9, 10]. The spatial gene expression data are presented as N×N similarity matrix. Each element in the matrix is a measure of similarity between the corresponding probe pattern and gene-expression region. The similarity is calculated as a fraction of overlap between the two and the total of both areas of the images. This measurement is intuitive, and commonly referred to as the Jaccard index [2, 6]. When a pattern is compared to itself, the Jaccard value is 1 because the two input spatial regions are identical. When it is compared to another pattern, the Jaccard Index will be less than one. If the Jaccard Index is 0, the two patterns do not intersect. If a Jaccard Index value is close to 1, then the two patterns are more similar. 1) To determine how the expression of any particular gene might affect the expression of other genes 2) To determine what genes are expressed and not expressed as a result of certain cellular conditions, e.g. what genes are expressed in diseased cells that are not expressed in healthy cells? The most popular pattern discovery method in data mining is association rule mining. Association rule mining was introduced by [4]. It aims to extract interesting correlations, frequent patterns, associations or casual structures among sets of items in transaction databases or other data repositories. The relationships are not based on inherent properties of the data However, biologists are more interested in how gene expression changes under different probe patterns. Thus, these This study has been carried out as part of Research Promotion Scheme (RPS) Project under AICTE, Govt. of India. * Corresponding author 117 http://sites.google.com/site/ijcsis/ ISSN 1947-5500 (IJCSIS) International Journal of Computer Science and Information Security, Vol. 6, No. 3, 2009 frequent itemsets these two subsets are also frequent and their support is already calculated. Now these two subsets may generate a rule A →C, if the confidence of the rule is greater than or equal to the specified minimum confidence. similarity values are discretized such that similarity measure greater than some predetermined thresholds and converted into Boolean matrix. B. Data Preprocessing Preprocessing is often required before applying any data mining algorithms to improve performance of the results. The preprocessing procedures are used to scale the data value either 0 or 1. The values contained in the spatial gene expression matrix had to be transformed into Boolean values by a socalled discretization phase. In our context, each quantitative value has given rise to the effect of discretization procedure [2]: Max minus x% method. D. Algorithm Details 1. Let I={i1, i2, …, in} be a set of items, where each item ij corresponds to a value of an attribute and is a member of some attribute domain Dh={d1, d2, …, ds}, i.e. ij Є Dh. If I is a binary attribute, then the Dom (I)={0,1}. Max minus x% procedure [7] consists of identifying the highest expression value (HV) in the data matrix, and defining a value of 1 for the expression of the gene in the given data when the expression value was above HV – x% of HV where x is an integer value. Otherwise, the expression of the gene was assigned a value of 0 (Figure 1). In the similarity matrix, the items I are genes from the data set, where a transaction T I consists of genes that all have an expression pattern intersecting with the same probe pattern. The sets of transactions are constructed by taking, for each probe pattern r, every gene g from which its associated gene expression pattern ge satisfies the minimum similarity β, i.e., similarity(r, ge) > β, to form the itemsets. a b c d e f g h α (Input) 0.096595 0.123447 0.291310 0.126024 0.155819 0.288394 0.000000 0.215049 α (after discretization) 0 0 1 0 0 1 0 1 Figure 1. Results of Max minus 25% discretization method C. Association Rule Mining The Apriori-like algorithms adopt an iterative method to discover frequent itemsets. The process of discovering frequent itemsets need multiple passes over the data. .The algorithm starts from frequent 1-itemsets until all maximum frequent itemsets are discovered. The Apriori-like algorithms consist of two major procedures: the join procedure and the prune procedure. The join procedure combines two frequent kitemsets, which have the same (k-1)-prefix, to generate a (k+1)itemset as a new preliminary candidate. Following the join procedure, the prune procedure is used to remove from the preliminary candidate set all itemsets whose k-subset is not a frequent itemsets [3]. 2. A transaction database is a database containing transactions T in the form of (d, E), where d Є Dom(D) and E Є I. 3. Let D be a transaction database, n be the number of transactions in D, and minsup be the minimum support of D. The new_support is defined as new_support = minsup × n. 4. Proposition 1: According to [8], By Boolean vector with AND operation, if the sum of ‗1‘ in a row vector Bi is smaller than k, it is not necessary for Bi to involve in the calculation of the k- supports. 5. Proposition 2: According to [5], Suppose Itemsets X is a kitemsets; |FK-1(j)| presents the number of items ‗j‘ in the frequent set FK-1. There is an item j in X. If | FK-1(j)| is smaller than k-1, itemset X is not a frequent itemsets . 6. Proposition 3: |FK| presents the number of k-itemsets in the frequent set FK. If |FK| is smaller than k+1, the maximum length frequent itemsets is k. 7. A positive association rule represents a relationship between two sets of items in the form of A →C, where A I, C I and A∩C=Φ. 8. A positive association rule represents a relationship between two sets of items in the form of A → ¬C or ¬A→C, where A I, C I and A∩C=Φ. 9. The rule A → ¬C has support s% in the data sets, if s% of transactions in T contain itemset A while do not contain item set C. The support of negative association rule supp(A → ¬C, is the frequency of occurrence of transactions with item set A in the absence of item set C. 10. Let X be the set of transactions that contain all items in A. The rule A →¬C holds in given data set with confidence c%, if c% of transactions in X do not contain item set C. Confidence of negative association rule, conf(A → ¬C), can be calculated with supp(AU¬C)/supp(A). 11. Given supp(A →C) and conf(A →C), the support and confidence of the negative rule A→¬C can be computed as follows: supp(A →¬C) = supp(A) – supp(A →C)……..…(1) conf(A →¬C) = 1 – conf(A →C) ……………........(2) 12. Given supp(A→C) and conf(A→C), the support and confidence of the negative rule ¬A→C can be computed as follows: supp(¬A→C) = supp(C) – supp(C →A)………….(3) From every frequent itemset of k>=2, two subsets A and C, are constructed in such a way that one subset C, contains exactly one item in it and remaining k-1 items will go to the other subset A. By the downward closure properties of the 118 http://sites.google.com/site/ijcsis/ ISSN 1947-5500 (IJCSIS) International Journal of Computer Science and Information Security, Vol. 6, No. 3, 2009 The part I of the algorithm given in Figure 2 is capable of discovering all possible set of frequent itemsets subject to a user specified minimum confidence. conf(¬A→C)= (supp(C)/1-supp(A)) (1–conf(C→A))….(4) The introduced algorithm for finding both RHS negative and LHS negative rules in terms of spatial gene expression data in the form of similarity matrix consists of four phases as follows: 1. 2. 3. 4. The part II of the algorithm given in Figure 2 is capable of finding all positive and negative association rules from the frequent itemsets subject to a user specified minimum confidence very quickly. The function genRule(FreqSetk) generates all positive subject to a user specified minimum confidence. The function genNegCand(r) generates all negative itemsets for the given positive association rule, using the support value calculated using the formula given in equations (1) and (3). From the generated negative item sets, the negative association rules are generated subject to the confidence calculated using the formula given in equations (2) and (4). Transforming the similarity matrix into the Boolean matrix Generating the set of frequent itemsets using Fast Mining algorithm for spatial gene expression data Generating positive rules using Apriori algorithm. Generating negative rules based on existing positive rules. A detailed description of the introduced algorithm is described as follows: IV. Part 1: Algorithm for generating frequent itemsets and positive rules. RESULTS AND DISCUSSION The introduced algorithm has been implemented in Java and tested on Linux platform. A comprehensive experiment on spatial gene expression data has been conducted to study the impact of normalization. Input: Spatial Gene Expression data in similarity matrix (M), the minimum support. Output: Set of frequent itemsets F. 1. Normalize the data matrix M and transformed into Boolean Matrix B; // Frequent 1-itemset generation 2. for each column Ci of B 3. If sum(Ci) >= new_support 4. F1 = { Ii}; 5. Else delete Ci from B; // By Proposition 1 6. for each row Rj of B 7. If sum(Rj) < 2 8. Delete Rj from B; // By Proposition 2 and 3 9. for (k=2; | Fk-1| > k-1; k++) 10. { // Join procedure 11. Produce k-vectors combination for all columns of B; 12. for each k-vectors combination { Bi1, Bi2,…Bik} 13. { E= Bi1 ∩ Bi2 ∩.…∩Bik 14. If sum(E) >= new_support 15. Fk = { Ii1, Ii2,…Iik} 16. } // Prune procedure 17. for each item Ii in Fk 18. If |Fk(Ii)| < k 19. Delete the column Bi according to item Ii from B; 20. for each row Rj of B 21. If sum(Bj) < k+1 22. Delete Bj from B; 23. k=k+1 24. } 25. Return F = F1UF2….UFk A few sample records from spatial gene expression data (EMAGE) are listed in Table I. Different support-confidence thresholds were tested. A few positive and negative rules are listed in Table I. They are generated under the support and confidence constraints of 2% to 9% and 30% and 60%, respectively. Note that rules in the right column are negative rules discovered with respect to positive rules in the left column. Table II shows the number of positive rules and negative rules vs. user-specified minimum support and minimum confidence. Thus, the algorithm can successfully generate negative rules and the number of negative rules discovered is reasonable. The number of negative rules tends to be related to the number of positive rules given in Table II. However, it is inversely proportional to the minimum support threshold. The reason is less and less high-support 1-item set survives with increases in support threshold, which reduces the number of candidate negative rules significantly. TABLE I. Spatial gene expression data from EAMGE database Uniqid EMAGE:1024 EMAGE:111 EMAGE:114 EMAGE: 117 Gene name Cer1 T Mesp1 Pou5f1 EMAGE :1024 1 0 0 0 EMAGE: 111 0 1 1 0 EMAGE: 114 0 1 1 1 EMAGE: 117 0 0 1 1 TABLE II. Positive and negative rules generated (min_support=3% and Part 2: Algorithm for generating positive and negative association rules. min_confidence = 30% and 60% ) Input: Set of Frequent (F), minimum support and minimum confidence. Output: Set of Positive and Negative Association rules. 26. postiveRule = genRule(FreqSetk); 26. Rule = postiveRule; // Generate Negative Rules 27. for all rules r Є postiveRule. 28. negativeRuleSets = genNegCand(r); 29. for all rules tr Є negaitveRuleSets 30. Rule = {Rule, Neg(tr) | Neg(tr).supp >minsup, Neg(tr).conf > minconf }; 31. endif 32. endfor. Fig. 2 Mining Negative Association Rules Positive rules T→Mesp1 T→Pou5f1 Mesp1→Pou5f1 Confidence 100% 50% 67% Negative rules Cer1→ ¬ T Cer1→ ¬Mesp1 Cer1→ ¬Pou5f1 Confidence 100% 100% 100% Given the number of positive rules P, the complexity of the algorithm is O(P). In this algorithm the complexity does not depend on the number of transactions since it is assumed that the supports of item sets have been counted and stored for use in this as well as other mining applications. However if we are considering discovering positive rules, which is necessary in 119 http://sites.google.com/site/ijcsis/ ISSN 1947-5500 (IJCSIS) International Journal of Computer Science and Information Security, Vol. 6, No. 3, 2009 generating negative rules, the algorithm must browse all combinations of items. The complexity of discovering positive rules depends on not only the number of transactions, but also the sizes of attribute domains as well as the number of attributes. The overall complexity will be proportional to that of discovering positive rules. association rule mining ensures that genomic data mining will continue to be a necessary and highly productive field for the foreseeable future. REFERENCES [1] Baldock,R.A., Bard,J.B., Burger,A., Burton,N., Christiansen,J., Feng,G., Hill,B., Houghton,D., Kaufman,M., Rao,J. et al., ―EMAP and EMAGE: a framework for understanding spatially organized data‖, Neuroinformatics, vol. 1, pp. 309–325, 2003. [2] Pang-Ning Tan, Micahel Steinbach, Vipin Kumare, Intoduction to Data Mining Pearson Education, second edition, pp.74, 2008. [3] Agrawal, R. & Srikant, R., ―Fast Algorithms for Mining Association Rules in large databases‖. In Proceedings of the 20th International Conference on Very Large Databases pp. 487-499. Santiago, Chile, 1994. [4] Agrawal, R., Imielinski, T., & Swami, A.,‖Mining association rules between sets of items in large databases‖. Proceedings of the ACM SICMOD conference on management of data‖, Washington, D.C, 1993. [5] Xu, Z. & Zhang, S., ―An Optimization Algorithm Base on Apriori for Association Rules‖. Computer Engineering vol. 29(19), pp. 83-84, 2003. [6] J. van Hemert and R. Baldock, ―Mining spatial gene expression data for association rules‖, In S. Hochreiter and R. Wagner, editors, Proceedings of the 1st International Conference on BioInformatics Research and Development, Lecture Notes in Bioinformatics, pp.66–76. SpringerVerlag, 2007. [7] Céline Becquet et al., ―Strong-association-rule mining for large-scale gene-expression data analysis: a case study on human SAGE data‖, Genome Biology vol. 3(12):research0067.1–0067.16, November 2002. [8] M.Anandhavalli, M.K.Ghose, K.Gauthaman, ―Mining Spatial Gene Expression Data Using Association Rules‖, IJCSS vol. 3(5), 2009. [9] S. Venkataraman, P. Stevenson, Y. Yang, L. Richardson, N. Burton, T. P. Perry, P. Smith, R. A. Baldock, D. R. Davidson, and J. H. Christiansen. Emage—edinburgh mouse atlas of gene expression: 2008 update. Nucleic Acids Research, 36(D):860–865, Jan 2008. [10] J. van Hemert and R. Baldock. Matching spatial regions with combinations of interacting gene expression patterns. In M. Elloumi, J. K¨ung, M. Linial, R. Murphy, K. Schneider, and C. Toma, editors, Proceedings of the 2nd International Conference on BioInformatics Research and Development, volume 13 of Communications in Computer and Information Science, pages 347–361. Springer Verlag, 2008. The performance is also affected by the choice of minimum support. A lower minimum support produces more numerous item sets and, with the same confidence constraint more positive rules will be generated, which adds to computation expense. The trend in the number of negative and the number of positive rules with different minimum support are shown in Figure 3. Figure 3. Positive and Negative Rules Discovered under Different Supports and Confidences V. CONCLUSION In this paper, a novel method of mining positive and negative association rules from the spatial gene expression data has been introduced to generate frequently occur genes very quickly. The introduced algorithm does not produce candidate itemsets, it spends less time for calculating k-supports of the itemsets with the Boolean matrix pruned, and it scans the database only once and needs less memory space when compared with Apriori algorithm. The introduced algorithm is good enough for generating positive and negative association rules from spatial gene expression data very fast and memory efficient. Finally, the large and rapidly increasing compendium of data demands data mining approaches, particularly 120 http://sites.google.com/site/ijcsis/ ISSN 1947-5500
5cs.CE
1 Signal Processing for Gigabit-Rate Wireline Communications arXiv:1706.03538v1 [cs.IT] 12 Jun 2017 S. M. Zafaruddin, Member, IEEE, Itsik Bergel, Senior Member, IEEE, Amir Leshem, Senior Member, IEEE Faculty of Engineering, Bar-Ilan University, Ramat Gan 52900, Israel Email: [email protected], [email protected], [email protected] Abstract—Signal processing played an important role in improving the quality of communications over copper cables in earlier DSL technologies. Even more powerful signal processing techniques are required to enable a gigabit per second data rate in the upcoming G.fast standard. This new standard is different from its predecessors in many respects. In particular, G.fast will use a significantly higher bandwidth. At such a high bandwidth, crosstalk between different lines in a binder will reach unprecedented levels, which are beyond the capabilities of most efficient techniques for interference mitigation. In this article, we survey the state of the art and research challenges in the design of signal processing algorithms for the G.fast system, with a focus on novel research approaches and design considerations for efficient interference mitigation in G.fast systems. We also detail relevant VDSL techniques and points out their strengths and limitations for the G.fast system. I. I NTRODUCTION Digital subscriber lines (DSL) have evolved into a viable technology for last mile access in telecommunication networks [1], [2]. This technology leverages the existing infrastructure of telephone lines to provide affordable broadband services when deployment of optical networks is unfeasible or costly. Since its inception in the 1980’s, DSL has been considered an interim technology to fill the gap until the advent of all optical access networks. However, we are far away from this horizon and the time of an all optical access network has not arrived yet. DSL thus remains a widely used broadband access technology and will play a key role in the convergence of mobile and fixed technologies for next generation networks. The upcoming G.fast (fast access to subscriber terminals) standard [3], [4] promises to achieve fiber-like data rates by exploiting the higher bandwidth of the telephone lines than the previous standards [5], [6]. G.fast is expected to deliver gigabit speeds over short loop lengths as anticipated by Cioffi et al. [7] [8] more than a decade ago. This new standard is very different from its predecessors in many respects. While fiber is deployed more and more into the network, rewiring the houses with fiber is extremely expensive. The G.fast is a fiber to the distribution point (FTTdp) technology taking fiber to a distribution point (DP) very close to the customer premise equipment (CPE). The new G.fast standard changed some very fundamental design choices used in VDSL and earlier standards. Most notably technologies such as time-division duplexing (TDD) and reverse-power-feeding (RPF) are used, and discontinuous operation is incorporated for energy efficient transmissions. The TDD scheme avoids near-end crosstalk (NEXT) and facilitates asymmetry in downstream and upstream data rates more efficiently. It also simplifies channel estimation in downstream transmissions by exploiting channel reciprocity for channel state information (CSI). The RPF technology simplifies the powering of DP using the power from the customer CPE. This eliminates the need for a power infrastructure at the DP and reduces deployment costs. Discontinuous operation optimizes energy consumption by incorporating low power modes as well as switching off the circuitry at the DP corresponding to the users in offline mode. The G.fast system requires efficient signal processing techniques to harness the benefits of these features. The G.fast also uses considerably wider bandwidth than the VDSL system which was using the spectrum up to 30 MHz. The first generation of the G.fast system uses up to 106 MHz whereas the next generation goes up to 212 MHz. At this higher bandwidth, G.fast systems suffer from significantly stronger crosstalk due to the electromagnetic coupling with different lines. With increasing frequency, the crosstalk coupling between the lines attains the same strength as the direct path and destroys the diagonal dominance of the channel. This strong crosstalk poses challenges that cannot be resolved with existing VDSL technology. Hence, the G.fast system requires newer and more powerful techniques for interference mitigation, also known as crosstalk cancellation. Signal processing techniques have played an important role in improving the quality of communications over copper cables and hold the key for future services. This article provides an overview of the current state of the art and research challenges in the design of signal processing algorithms for the G.fast system, with a focus on multi-user crosstalk cancellation schemes. Multi-user signal processing which was referred to as vectoring by Ginis and Cioffi in [9] enabled VDSL systems to exceed 100 Mbps. This multi-user signal processing takes place at a central point that concentrates copper wire pairs from many users. The processing is on both the signals transmitted from the central point to the end users and on the signal received from the users. Thus, the vectored system resembles the multi-user MIMO more than the standard MIMO. However, the vectored DSL system is different from wireless MIMO in few important respects. The DSL channel has long channel coherence and thus CSI can be estimated fairly efficiently for multi-user processing. Since users are connected with a fixed modem, channel tracking is also not difficult. Moreover, the telephone channel offers a fairly good channel, and the signal to noise ratio (SNR) can be as high 2 II. W IRELINE DMT T ECHNOLOGY Like any communication system, the performance of DSL systems is limited by several types of impairments. In the following, we discuss the main ones and describe the traditional and novel techniques implemented by DSL systems to address them. We also discuss key distinguished features of the G.fast technology and show how it is different from its predecessor technologies. A. Thermal Noise All communication systems are inherently limited by thermal noise caused by the random movement of electrons in the system. This additive noise is generally modeled as a random Gaussian signal that is independent of the transmit signal. The effect of thermal noise cannot be completely avoided, and it sets an upper limit on communication performance, which is known as the channel capacity [15]. Attaining channel capacity requires the implementation of powerful error 0.9 Frequency Selective Channel Frequency Flat Sub−Channel 0.8 0.7 0.6 Channel Gain as 60 dB at low frequencies. The fact that DSL systems are baseband eliminates the detrimental effect of phase noise, and therefore allows for very high spectral efficiency, that can reach 215 QAM. As the G.fast standard uses much higher frequencies than its predecessor VDSL standard, it can no longer rely on some of the key features of VDSL. One of these features is the well conditioning of the channel matrix. For VDSL frequencies, the DSL channel matrix is column-wise diagonal dominance (CWDD) in the upstream and row-wise diagonal dominant (RWDD) in the downstream [9]. This characteristic is very convenient for FEXT cancellation, and most techniques for multi-user interference mitigation in VDSL rely on the diagonal dominance of the channel matrix. This diagonal dominance enables efficient implementation of non-linear as well as linear crosstalk cancelers [9]–[11]. The linear zero forcing (ZF) precoder for the downstream and the linear ZF canceler in the upstream are near optimal for the VDSL channel. These schemes are simple and do not necessarily require transmit power optimization. Even the matrix inversion required for linear ZF crosstalk cancellation can be avoided through power series expansion of the MIMO channel [12]. Simple least mean square (LMS) based adaptive algorithms are very efficient and converge quite rapidly for the diagonally dominant VDSL channels [13], [14]. At high frequencies of G.fast the crosstalk is significant and the channel matrices are no longer diagonal dominant. Thus, many VDSL algorithms either fail or converge very slowly. Moreover, the adaptive schemes of the VDSL system are either not suitable or are no longer applicable in the TDD based G.fast system. This paper has a broad scope. We begin with an overview of single user signal processing and explain how this enables DSL modem to overcome channel impairment. Then we provide an overview of the G.fast channel, and explain the various alternative techniques for crosstalk cancellation. We conclude with some design considerations, which provide an insight into the techniques used. 0.5 0.15 0.4 0.1 0.3 0.05 Zoomed 0 0.2 41.6 41.7 41.8 41.9 42 0.1 0 10 20 30 40 50 60 70 80 90 100 Frequency (MHz) Fig. 1: Frequency selectivity of the DSL channel is illustrated using the channel gain of a 100 m CAD55 cable simulated for the G.fast 106a profile. The figure shows how the use of 2048 narrow-band tones of 51.75 KHz result in an almost frequency flat channel at each tone. correction codes. Legacy DSL systems employ the relatively simple Reed Somolon (RS) codes as an outer code and trellis coded modulation (TCM) as an inner code with an interleaver between them [5]. The combined RS+TCM coding scheme was also chosen for the G.fast 106 MHz standard. Capacity-approaching low-density parity-check (LDPC) codes have also been proposed for the G.fast. However, the design and implementation of a LDPC code with flexible coding and modulation that can operate at the G.fast data rates is an open research challenge. However, in most scenarios, thermal noise is not the main limiting factor, and other impairments must be considered. B. Inter-Symbol Interference and DMT Modulation Over wide-bandwidths, the telephone channel is frequency selective and exhibits frequency dependent attenuation and delay. This causes severe inter-symbol interference (ISI) where the communication symbols are prolonged and overlap each other. To overcome this problem, the recent xDSL standards use a discrete multi-tone (DMT) technique which divides the transmission frequency band into smaller sub-carriers (also known as tones or frequency bins) [16]. As a result, DMT effectively transforms a broadband frequency selective channel into many frequency-flat narrow band channels as shown in Fig. 1. The G.fast has a wider tone width (exactly 12 times wider than the ADSL/VDSL) to cover higher bandwidth without increasing the number of tones. The ADSL system has K = 256 tones (over 2.2 MHz), VDSL (over 30 MHz) contains K = 4096 tones, the G.fast 106 MHz has K = 2048 tones, and the G.fast 212 MHz profile increases the number of tones to K = 4096. The DMT symbol also contains a cyclic prefix (CP) that allows a tone separation of 1 symbol duration without any interference between tones, as long as the CP is longer than the channel memory (see for example [16]). The G.fast has a typical CP length of L = 320 samples. 3 Time Domain Samples 2𝐾 + 𝐿 = 4416 Samples 𝐾 = 2048 Tones 𝑋1 Input Bits Channel Encoder DMT Encoder IFFT (2K) 𝑋2 DAC 105.93 MHz 𝑋𝐾 1 𝑇 2𝐾+𝐿 = 48 KHZ Output Bits DMT Decoder Channel 𝑌2 Remove CP 12 MHz ADC 8.5 MHz 𝑌𝐾 5.2 MHz 3.75MHz Fig. 2: Discrete multi-tone (DMT) modulation and system parameters for G.fast system. Single-user processing External Interference (Impulse noise, RFI etc.) Upstream (MAC) External Interference (Impulse noise, RFI etc.) Port 1 CPE 1 Direct path 𝐻𝑖𝑖 CPE 𝑖 CPE 𝑗 𝐺𝑖𝑗 NEXT 𝐺𝑗𝑖 Port 𝑖 FEXT 𝐻𝑖𝑗 FEXT 𝐻𝑗𝑖 DP NEXT Port 𝑗 Direct path 𝐻𝑗𝑗 Twisted Pairs (1-20) 16 18 14 5 20 Downstream (BC) 9 19 15 13 Cable Binder US 20.8 µ𝑠 TDD: G.fast DS 138 KHz Time DS3 US2 FDD: VDSL FDD: VDSL DS2 US1 DS1 Time Fig. 4: Duplexing methods for G.fast (TDD system, 106a profile) and (FDD, 17a profile) for VDSL that separate upstream and downstream transmissions to mitigate NEXT in a DSL system. A typical TDD frame duration is 750 µs comprising 36 symbols. The number of symbols for downstream ranges from 10 to 32 and 25 to 3 symbols for upstream with a single guard symbol between them. 17 Binder Port 𝑁 CPE 𝑁 Fiber Line 𝑇𝑓 = 750 µ𝑠 62 µ𝑠 ≤ 𝑇𝑢𝑠 ≤ 521 µ𝑠 2.22 MHz 17.664 MHz FFT (2K) 208 µ𝑠 ≤ 𝑇𝑑𝑠 ≤ 667 µs DS = 212 MHZ 𝑇 𝑌1 Channel Decoder Note: Scale of Y-Axis on both figures is not the same Freqency Add CP (L = 320) 11 1 3 7 2 4 6 10 8 12 Joint Processing 20-pair Binder Section Fig. 3: FEXT and NEXT in a multi-pair DSL binder. The cross section of the cable binder is also shown to demonstrate how the twisted pairs are enclosed in the binder. In the upstream, the DSL binder acts as a multiple acces channel (MAC), whereas broadcast channel (BC) in the downstream. Note that the CPEs are generally situated at different lengths from the DP. The G.fast has a higher sampling frequency than the VDSL system which operates at 70 Msps (million samples per second). The sampling frequency of the G.fast 106 MHz profile is 212 Msps. To convert K data symbols into a real signal, 2K point IFFT is used. The resulting bandwidth is 106 MHz and the tone-width is 51.75. Considering the CP, the resulting symbol rate is 48 KHz (exactly 12 times faster than ADSL/VDSL). The G.fast 212 MHz system has the same symbol rate but a much higher sampling frequency rate (more than 400 Msps). A typical DMT block diagram with G.fast parameters is represented in Fig. 2. Another important advantage of the DMT is the ability to use a different modulation at each tone. Thus, tones with low SNR will use small constellations, such as QPSK with 2 bits per tone. Tones with high SNRs will use richer modulations with up to 12 bits per tone (i.e., 212 = 4096 points). The DMT technique allows the transmission of data symbols without any ISI and without interference between the different tones. Thus, it enables independent processing of each tone. Without loss of generality, in the following we focus on a single tone and address the other factor that limit system performance. C. Near-End Crosstalk (NEXT) and Duplexing Methods A telephone line is composed of two copper lines that are twisted around each other. This twisting reduces the electromagnetic leakage between lines. However, this is not sufficient and all DSL systems have to cope with electromagnetic coupling signals that increase continuously with frequency. This, together with large number of closely packed lines in a typical binder lead to large electromagnetic couplings, which cause significant “crosstalk”. Depending upon the position of disturbers with respect to the victim receiver, this crosstalk is classified as far-end crosstalk (FEXT) or near-end crosstalk (NEXT), as shown in Fig. 3. Near-end crosstalk (NEXT) refers to coupled signals that originate from the same end as the affected receiver. Hence, NEXT is interference between upstream signals and downstream signals from different pairs. As NEXT occurs over short loops, its effect on the receivers is significant. NEXT can be mitigated by using an echo canceler but this is considered impractical in a DSL setup. Thus, all DSL systems separate the upstream and the downstream to avoid the NEXT and echo signals. The older standards e.g., ADSL and VDSL, separate the upstream and the downstream in the frequency domain, known as the frequency domain duplex (FDD) [5], [6]. The latest G.fast standard that further extends the copper bandwidth into hundreds of MHz employs a time-division duplexing (TDD) where the upstream and downstream are transmitted at different times. The TDD scheme has access to the full operating spectrum by toggling transmission directions over a time interval, which occurs rapidly and is not visible to the user. It enables dynamic allocation of US and DS resources to efficiently support asymmetric data rates. This facilitates discontinuous operation and allows for an efficient trade off between throughput and power consumption. The TDD scheme also ensures channel reciprocity for better service provisioning and facilitates channel estimation in downstream. It also enables a simplified analog front-end (AFE) architecture and increases the efficiency of transmissions. However, successful implementation of TDD needs a very precise timing and synchronization system at both the transmitter and receiver to avoid interference between two directions. This requires all the nearby modems to be synchronized, a feasible situation at the DP but generally not at the customer premises. The TDD and FDD duplexing systems are illustrated in Fig. 4. 4 K Sub-carriers 2K Samples 2K Samples K Sub-carriers 𝑌1 𝑋1 DMT Encoder (User 1) 𝑋𝐾 IFFT (User 1) DAC ADC User 1 𝐱1 Channel Post Canc. (Tone 1) Vectored Users (Tone K) 𝐅1 𝐱K 𝑋1 DMT Encoder (User N) Post Canc. (Tone K) 𝐅𝑲 𝑌1 IFFT (User N) DAC ADC 𝑋𝐾 Per Tone FEQ 𝑌𝐾 Vectored Users (Tone 1) CPE 1 CPE N 𝑌1 FFT (User 1) 𝑌𝐾 𝑌1 FFT (User N) 𝑌𝐾 User N 𝑌𝐾 Single-user transmission from each CPE Per Tone FEQ Vectored receive processing at DP Fig. 5: Schematic diagram of vectored receive processing in the upstream. There is no signal coordination among CPEs for joint transmit processing. At the DP, received signals from CPEs at each tone are collected as a single vector on which a canceler is applied. 2K Samples K Sub-carriers 𝑌1 𝑋1 DMT Encoder (User 1) IFFT ADC DAC User 1 𝑋𝐾 Vectored Users (Tone 1) 𝐱1 Vectored Users (Tone K) 𝐱K FFT (User 1) y = Hx + w Channel CPE 1 CPE N 𝑌1 𝑋1 IFFT User N ADC DAC FFT (User 1) Per Tone FEQ 𝑌𝐾 𝑋𝐾 Vectored transmit processing at DP (2) 𝑌𝐾 Precoder 𝑋1 (Tone 1) 𝐅1 𝑋𝑁 Precoder 𝑋1 (Tone K) 𝑋𝑁 𝐅K DMT Encoder (User N) Per Tone FEQ vectored reception is shown in Fig. 5, where the k-th tone values Yk,i from all N users are collected to form the vector yk = [Yk,1 , Yk,2 , . . . , Yk,N ]T , which is used for coordinated signal processing on all components at the DP. The result of this processing can be fed to the conventional single user modem for demodulation and detection. In Fig. 6, the k-th tone values Xk,i from all N users were collected to form the vector xk = [Xk,1 , Xk,2 , . . . , Xk,N ]T , which is used for coordinated transmit signal processing on all components at the DP. In the following, we further describe vector processing, and focus on a single frequency tone at a time. Hence, without any ambiguity, we drop the tone index from all quantities until the Section V. Note that while the processing of all frequency bins is identical, the performance at the different frequency bins can be significantly different. The resulting vector channel model in the upstream is: Single-user processing at each CPE Fig. 6: Schematic diagram of vectored transmit processing in the downstream. At the DP, transmit signals for each user at each tone are collected as a single vector and a precoder is applied before transmission. There is no signal coordination among CPEs for joint receiver processing. D. Far-End Crosstalk and Vectored Processing The term FEXT refers the coupled signals that originate from the end opposite to that of the affected receiver. FEXT is thus the interference between upstream signals of different pairs or between downstream signals of different pairs [1]. The average FEXT power from the j line to the ith line can be described as E[|Hij |2 ] = χfext f 2 dij E[|Hjj |2 ] (1) where χf ext is a constant whose value depends on the physical properties of the copper cable, E[|Hjj |] denotes the attenuation of the disturber, f is the central frequency of the considered tone, and dij is the coupling length between the victim and distributer. The FEXT creates a linear dependence between the different lines in the binder and hence calls for joint (vector) processing. In the upstream, since modems are co-located at the DP, it is possible to construct a vector that contains all the received symbols over all lines (at a given tone) and then process them together to reduce the effect of FEXT. On the other hand, in the downstream, the transmitters are colocated and it is possible to pre-equalize signals and reduce the crosstalk. This coordinated processing of the signals over all lines referred to as vectoring in [9] leads to an enormous rate increase in the DSL system. A schematic diagram for where x is the vector of all transmitted symbols, H is the N ×N matrix of all (complex) channel gains at the considered frequency tone and w represents the additional noise and interference vector. Note that the diagonal elements of H correspond to the direct paths between the CPEs and the CO on, whereas the off-diagonal elements represent the FEXT. In the downstream joint processing is performed before the transmission. Thus, the channel structure remains the same as in (2), but now x is the vector of symbols for transmission over all lines (after joint processing) and y is the vector of all samples received by the different CPEs. Note that in TDD, the channel reciprocity dictates that the channel matrix in the downstream is the matrix transpose of the channel matrix in the upstream. But, in most cases, there are differences in amplitude and phase between the transmission and reception circuits and filters at each end. FEXT is currently the main limiting factor in DSL systems, and plays an even more crucial role in the upcoming G.fast technology. The various methods to cope with FEXT are further described in the following sections, after a discussion on channel model in the next section. III. DSL C HANNEL M ODELS Signal processing methods for a communication system require an accurate characterization of the underlying transmission medium. For DSL technology, modeling twisted pair channels at higher frequencies has been an active field of research for more than two decades as DSL standards have evolved [3], [5], [6]. The resulting models are based on extensive measurement campaigns carried out by different laboratories and telecommunication companies to derive parametric cable models [17]–[26]. A. Models for Direct and Crosstalk Channels The loss in signal strength transmitted over a cable depends on the physics of the cable which is implicitly captured in the propagation constant γ(f ) and the loop length l. The cable insertion loss is modeled as H(f, l) = e−lγ(f ) and most 5 0 Direct Channel (CAT5) FEXT Channel (CAT5) Direct Channel (CAD55) FEXT Channel (CAD55) Direct Channel (Measurement) FEXT Channel (Measurement) Channel Gain (dB) −5 −10 −15 −20 −25 −30 20 40 60 80 100 120 140 160 180 200 Frequency (MHz) Fig. 7: Direct and crosstalk channel gains for various cables using measurement data [27] and simulation models. Loop length is 100 m. For higher loop lengths, the crosstalk channel gain is higher than the direct channel gain. 25 Diagonal Dominance Parameter β (dB) of the measurement effort has been directed toward better characterization of γ(f ). Various empirical models are available for different cable types over VDSL frequencies [19]–[22]. However, the extrapolation of these models for G.fast frequencies deviate from the actual measurements. Moreover, the G.fast system incorporates different topologies for deployment using other cable types such as CAT5 and CAD55. In this context, the treatment of the direct path (diagonal channel matrix elements) and the crosstalk paths (off-diagonal elements) is quite different. Parametric models for the direct channel have been developed for a few cable types and made available in the latest ITU-T recommendation [3]. The ITU-T model has been validated up to hundreds of MHz using results of an extensive cable measurement campaigns on different cable types [27]. There is an ongoing effort to improve the existing models and derive models for other cable types (e.g., the authors in [26] have proposed a model for the characteristic impedance and propagation constant of the cables using fewer parameters). As long as the DSL transmission was limited to a point to point technology such as in ADSL and VDSL2, the standard model for the crosstalk was called the “1% worst-case model” which requires that there could only be a 1% chance that the total actual FEXT coupling strength in a real bundle was worse than that obtained with parametric models [1]. This model was based on a log-normal model for single line crosstalk, and evaluated the 1% worst case for the sum of 49 interferers. Using the parametric model in (1), we can see that crosstalk coupling depends on the frequency, coupling length of the disturber with the victim, and the attenuation of the interfering signal. For VDSL, the coupling was shown to be proportional to the frequency. Similar to the direct path, extrapolation of the crosstalk channel models of the VDSL shows that the FEXT signal was underestimated at the higher frequencies of the G.fast system. Extensive measurement campaigns are in progress for the standardization of the G.fast crosstalk channel model [24], [25]. Recently, an enhanced version of the 1% worst case deterministic FEXT model has been proposed for G.fast frequencies [28]. In these proposals, the crosstalk channels were shown to have a dual slope at high frequencies, resulting in a higher FEXT signal than those obtained through extrapolation of the VDSL models. This model has a lower slope FEXT below 75 MHz and higher slope FEXT above 75 MHz to be consistent with the experimental FEXT data. The 1% modeling is used because the random nature (amplitude variation) of the FEXT channel is much more significant than for the direct channel. However, as G.fast requires more sophisticated crosstalk mitigation, the 1% modeling is not sufficient and current studies aim to better characterize the randomness of the channel both in terms of amplitude and phase. Various stochastic models of VDSL [29]–[31] have adopted the log-normal distribution for the magnitude of the FEXT channel and a uniform distribution for phase coupling. The authors in [32] also suggested that the FEXT between different lines in the binder is statistically independent. Thus, while the modeling of the direct part for G.fast is quite mature, the detailed modeling of the FEXT randomness is currently 20 Measurement (100 m) Simulation (100 m) Simulation (400 m) 15 10 5 0 −5 −10 −15 −20 −25 0 20 40 60 80 100 120 140 160 180 200 Frequency (MHz) Fig. 8: Diagonal dominance measure β as a function of frequency using measurement [27] and simulation data for a binder with 10 lines of equal loop lengths of 100 m and 400 m. The VDSL frequencies show strong diagonal dominance whereas the G.fast channel at higher frequency tones is not diagonally dominant. still under study. All simulation results presented herein are based on separately modeling the direct channels [3], FEXT coupling [24], and stochastic parameters [29]. Fig. 7 presents an example of channel gain and FEXT coupling of different cables, using stochastic channel models and measurement data for a 0.5 mm cable with 10 pairs, measured by BT [27]. It can be seen that the CAD55 model has a higher attenuation than the CAT5 model and that the measured cable is closer to the CAD55 model than to the CAT5. Further, the diagonal channel dominates the FEXT channel for VDSL frequencies. However, the FEXT channel becomes very strong at higher frequencies. B. Diagonal Dominance of Channel Matrix When focusing on a single sub-carrier, the DSL channel matrix, H, contains the direct channel coefficients for each line (at the diagonal elements) and crosstalk coupling coefficients between each line at the off-diagonal elements. Each row of the channel matrix represents the crosstalk paths for 6 IV. M ULTI C HANNEL C ROSSTALK C ANCELLATION T ECHNIQUES The various crosstalk cancellation methods available in the literature can be categorized in terms of the coordination among users in the binder. If no coordination is possible, the binder behaves like an interference channel. Each receiver decodes its signal independently in the presence of the interference from other users. The advantage of these methods is that they can be applied independently on each modem (without any coordination). Unfortunately, these techniques yield a relatively low data rate for each user in the presence of crosstalk. This is shown in Fig. 9. It can be seen that data rate without crosstalk cancellation is just 20% (at 50m) of what can be achieved with full crosstalk cancellation. The effect of crosstalk can be reduced using coordinated processing on signals. In the downstream, the multi-user DSL 3000 Matched Filter Bound Single Wire Performance ZF−GDFE Canceler Linear MMSE Canceler Linear ZF Canceler Approx. First Order Canceler No Cancellation 2500 Data Rate (Mbits/Sec) multiple transmitters for a single receiver whereas each column represents the transmission path from a single transmitter to the multiple receivers. Intuitively, one would expect the signal in the desired pair to be much stronger than the signals coupled from other pairs. As shown in Fig. 7, this intuition indeed holds true for most VDSL frequencies (up to 30 MHz), as the FEXT among pairs is insignificant. Thus, for VDSL frequencies, the channel matrix is diagonal dominant, which is very convenient for multi-user communication. In the following we present a short mathematical quantification of the diagonal dominance property. This property will be further discussed in Section IV which addresses FEXT cancellation. We distinguish between two types of diagonal dominant channels. In downstream, transmitting modems are colocated at the DP and the receiving modems are situated at different lengths from the DP. The crosstalk signal from a disturber must propagate through the full length of the victim line to interfere with the victim receiver. Since the insulation between twisted pairs increases the attenuation, each diagonal element dominates its own row, and thus the downstream DSL channel is row-wise diagonal dominant PN(RWDD). The channel is said to be RWDD if βr = maxi j=1,j6=i |Hij |/|Hii | < 1. Using the reciprocity principle, the DSL channel in the upstream is column-wise diagonal dominant (CWDD), and is quantified PN by βc = maxi j=1,j6=i |Hji |/|Hii |. We further say that the channel is diagonal dominant (DD) if it is both CWDD and RWDD, i.e., if β = max{βc , βr } < 1. A diagonal dominant channel ensures well-conditioned crosstalk channel matrix. Hence, most of the DSL specific research has used this feature in some way or another. Moreover, performance analysis of various algorithms has used the above metrics to bound performance. The diagonal dominance parameter is depicted in Fig. 8 using measurement data and simulation results for the CAT5 cable at a length of 100 and 300 meters, for binders with 10 wires. Depending on the scenario, the channels are diagonal dominant (β is less than 0 dB) up to a frequency which is between 40 and 100 MHz. Thus, diagonal dominance holds at these distances for all VDSL frequencies, but does not hold for many G.fast frequencies. 2000 1500 1000 500 0 50 100 150 200 250 300 350 400 450 500 Line Length (m) Fig. 9: Average achievable user rate over the whole bandwidth of 212 MHz vs. binder length. The binder is composed of 10 users with equal line lengths.. binder behaves like a broadcast channel (BC) where a single transmitter at the DP generates signals to geographically dispersed subscribers. This only enables joint processing at the transmitter side. The coordination of received signals is possible in an upstream multiple-access channel (MAC) where a single receiver at the DP receives signals from different users, see Fig. 3. Joint processing at both the transmit and receive side of the link requires co-location of both the DP and customer premises modems, which is possible only in the case of a bonded DSL system, where a single (typically business) customer uses several twisted pairs to achieve very high rates. In most DSL configurations, each customer has a single twisted pair, and the customers are situated in different locations. Thus, the DSL system is considered a multi-user MIMO, and all the research on MU-MIMO developed for wireless systems is applicable as well (see for example [33]– [36] and references therein). However, as the rates of DSL systems, and in particular G.fast systems are very high and the number of users can be up to 100 served simultaneously by the same system, most published algorithms for wireless communication are not feasible, and the DSL community has turned to research low complexity algorithms. With the advent of vectored transmission, there has been a surge of research interest in transceiver design for crosstalk cancellation in DSL systems. Various nearoptimal receivers [9], [10], [12] have been designed to perform crosstalk cancellation with relatively low complexity. In the following subsections, we discuss various crosstalk cancellation schemes for upstream and downstream transmission. A. Crosstalk Cancellation in the Upstream Starting with the upstream, we first discuss theoretical performance bounds and then present various crosstalk cancellation schemes. 1) MAC Capacity and Performance Bounds: The capacity of the MAC channel was derived by Cover decades ago [37]. This capacity is characterized through the achievable rate region, which can be described by a set of 2N − 1 equations. 7 For example, for the 2-user case, the rate region is given by: R1 < R2 < Rmfb 1 Rmfb 2 (3) H R1 + R2 ≤ log2 det(I2 + HSH −2 σw )  where S is a diagonal power matrix, R1mfb and R2mfb are the matched filter bound, given in sub-subsection (ii) below. However, when the number of users is large, and since in practical DSL implementations the coding scheme does not achieve capacity, it is more convenient to use simple performance bounds. Leshem and Zehavi [38] presented an efficient rate control for a MAC subject to a PSD mask for the transmitters in a multi-carrier system, and showed that there is no need for upstream power control as long as the receiver can be kept sufficiently linear. Although the performance bounds presented below are not achievable, they are quite tight upper bounds in practical DSL scenarios. Hence, they allow us to quantify the sub-optimality of each algorithm, by evaluating how close it is to the bound. We demonstrate that (in DSL) better schemes are very close to the bounds, and hence close to optimal. i) Single Wire Performance (SWP): The most intuitive approach is to compare the achievable performance to the case of a single user transmission over a single wire pair. This performance will be denoted hereafter as single wire performance (SWP). In this case, the received signal for the i-th user (the tested user) is given by: Yi = Hii Xi + Wi , where the single user is only limited by the additive noise and attenuation of the channel. The additive noise is assumed to be Gaussian distributed. With the assumption of Gaussian distribution on transmit symbols, the Shannon capacity can be derived using the SNR expression. While the Shannon capacity is achievable, it requires ideal signal processing, and hence is not realizable in practical systems. For this reason, it is customary in DSL systems to model all the system imperfections by a single SNR-gap parameter which is commonly referred as the Shannon gap. The Shannon gap includes all types of imperfections, starting from amplifier noise and ending with the use of a square QAM constellation instead of the theoretical Gaussian shaping. Thus for a target probability of error 10−7 , the SNR gap Γ = 10.75 dB is taken for DSL systems. For a single tone of width ∆f , the SWP of the i−2 th user is given as Rswp = ∆f log2 (1 + Γ−1 Px,i |Hi |2 σw,i ), i 2 where Px,i is the transmit signal power and σw,i is the noise variance. However, it is worth noting that the SWP is not an upper bound on achievable performance. Although FEXT typically degrades performance, in some instances the transmission from different modems can be combined coherently through crosstalk between the wires. Hence, the following subsection presents a useful upper bound on the user rate. ii) Matched Filter Bound (MFB): The capacity achieved when a single user utilizes both direct as well as all FEXT coupling for reception is commonly termed the matched filter bound (MFB), also known as the single user bound (SUB) in DSL terminology. As such, all the modems receive from single users, and the received signal for the i-th signal becomes: y = hi Xi + w where hi is the i-th column of the channel matrix H. The optimal processing of the received signal in this case is known as a matched filter (MF) or maximal ratio combining (MRC). This receiver simply requires linear combining of the received signals using: X̂i = hH i y and thus the achievable capacity for the i-th user is −2 Rmfb = ∆f log2 (1 + Γ−1 σw,i Px,i ||hi ||2 ) i (4) Note that the power in this bound is the power allowed for a single user and not all the power allowed in the network. This is because this is not a practical scenario, and is simply used to bound the performance for the multi-user case. For VDSL system, there is a marginal difference between MFB and SWP performance since the crosstalk channels are much smaller than the direct channel gains (see subsection IIIB for more details). Since crosstalk increases with frequency, the G.fast already presents a notable gap between the SWP and MFB. 2) Non-Linear Crosstalk Cancelers: In the multi-user case, the MAC capacity can be achieved by detecting a single user at a time and then subtracting the detected signal from the received signal before continuing to detect the next user. This scheme is known as successive interference cancellation (SIC) or generalized DFE (GDFE). It should be noted that DSL systems have a 6 dB noise margin, which means that error propagation is unlikely. The optimality of SIC requires linear optimal detection at each stage (using an MMSE receiver) and subtraction of the signal only after successful decoding of the error correction code as well as proper ordering of the users. Both of these requirements incur significant complexity. In the following we present a simplified version which is nearoptimal in DSL systems [9]. Consider a decision feedback equalizer (DFE) receiver based on the QR decomposition of the channel H which can result in rates close to the MFB. The computation of the QR decomposition of matrix yields H = QR, where Q is a unitary matrix and R is an upper triangular matrix. First, the unitary nature of the matrix Q is made use of with the linear operation QH on the received vector in (2) to get a rotated version of the received vector z = QH y = Rx + QH w (5) As the noise is Gaussian, independent and identically distributed (i.i.d.) between the lines, the multiplication with the unitary structure of matrix Q does not change the statistics of the noise. Now, the upper triangular nature of the matrix R is made use of, and the symbols are estimated starting with the last row. The cancellation operation on the m-th signal is given as X̂m = Z − N X [R]m,i X̂i , m = N, N − 1 · · · 1 [R]m,m i=m+1 (6) The DFE is sensitive to error propagation: any error in the decision (based on X̂m in (6)) increases the probability of error for subsequent user detection. However, with proper matching of the modulation and the signal to noise ratio, the error probability can be made small enough so that the error 8 propagation is negligible. In this case, the spectral efficiency for the i-th user can be expressed as −2 Rdfe = log2 (1 + Γ−1 Px,i |Rii |2 σw,i ) i (7) Obviously, user performance is significantly affected by user ordering (i.e., which user is detected first and which later). For a detailed discussion of various user ordering schemes see [39]. 3) Linear Crosstalk Cancelers: To reduce complexity the straightforward approach is to use linear crosstalk cancelers. The use of linear receivers has attracted most of the research interest for FEXT cancellation. There are several variants of linear receivers, for example based on the criterion of zero forcing (ZF) and the minimum mean square error (MMSE). These structures are much simpler due to the absence of feedback operations. The zero forcing canceler, as implied by its name, attempts to cancel the self-crosstalk assuming that this is the only disturbance present (thus ignoring even the AWGN and any other kind of interference). It does this by the application of the inverse operator Fzf = H−1 at the receiver. The application of a linear ZF canceler H−1 on the received signal y in (2) cancels the crosstalk in the upstream DSL system. The i-th user receives a crosstalk-free inv signal: Yi = Xi + hinv is the i-th row of H−1 . i w, where hi It can be seen that ZF processing amplifies the power of additive noise and such that the resultant noise Pinterference 2 2 N −1 power becomes [H ] i,j σw,i . Thus, the resulting j=1 performance is strongly dependent on the condition number of the channel matrix, and becomes very poor if the matrix is close to singular. The linear MMSE canceler F minimizes the mean square error (MSE) between the output of the canceler and the true 2 value i.e., argminF E[kx − Fyk ] is given as [40] 2 Fmmse = (HH H + σw /Px I)−1 HH (8) and results in the spectral efficiency as Rmmse = log2 ( i 2 Γ−1 Px /σw ) 2 + σw /Px I)−1 ]ii [(HH H (9) The implementation complexity of MMSE is almost identical to that of ZF, and is generally better than the ZF solution. The use of MMSE requires the knowledge of the noise covariance matrix. However, any under-estimate of this matrix will still yield better performance than ZF. Nevertheless, the advantage of MMSE is negligible for DD channels as well as when the SNR is very high. Thus, the MMSE only performs significantly better than the ZF at high frequency tones. A. Linear Cancelers for Upstream DSL System To illustrate the operation of linear crosstalk cancelers, consider the simple case of 2 users. The users transmit with equal power Px over twisted pairs of equal length and experience the equal power of additive noise Pw . The direct channel gain for both the users is Hd , and the crosstalk coupling is αHd . Thus, in this simple case we have β = βr = βc = α and hence, α is a diagonal dominance parameter. The transmit and received signal vectors can be expressed as:        Y1 1 α X1 W1 = Hd + . (A1) Y2 α 1 X2 W2 Without crosstalk canceling, the crosstalk signal interferes with the reception of the desired signal, which is now received in the presence of a noise term of power Pw and an interference term of power α2 Hd Px decreases the rate. Thus, the spectral efficiency for each is: SNRawgn ) (A2) Rfext = log2 (1 + 2 2α SNRawgn + 1 where SNRawgn = Hd2 Px /Pw . For purposes of comparison, note that the single wire performance is Rswp = log2 (1 + SNRawgn ) whereas the matched filter bound is even higher: Rmfb = log2 (1 + (1 + α2 )SNRawgn ). Thus, for high SNR, even small values of α can cause significant performance degradation. The ZF crosstalk canceler uses the inverse of the channel matrix as receiver preprocessing:   1 1 −α . (A3) Fzf = H−1 = Hd (1 − α2 ) −α 1 Thus, the estimate of the symbol of user 1 is: X̂1 = X1 + α 1 W1 − W2 . Hd (1 − α2 ) Hd (1 − α2 ) (A4) It can be seen that ZF processing removes the effect of crosstalk but enhances the noise by folding noise from other users. The spectral efficiency for the ZF canceler for each user is given as   (1 − α2 )2 Rzf = log2 1 + SNRawgn . (A5) 1 + α2 In contrast to the no cancellation case, the ZF canceler performs very well whenever α  1 and approaches SWP performance. On the other hand, the ZF canceler performs very poorly when the channel matrix is close to singular α → 1. The MMSE canceler for this simple matrix results in the spectral efficiency: mmse R 1 2 SNRawgn ) − α2 + SNR1awgn (1 + α2 + = log2 SNRawgn 1+ 4α2 (A6) Comparing (A5) and (A6), the performance of both MMSE and ZF coincides at high SNR. However, if the signal experiences situations where the attenuation is large or external interference dominates the receiver noise (i.e. lower AWGN SNR), the MMSE canceler performs better than the ZF canceler with a minor increase in complexity. ! . 9 Spectral Efficiency (bits/sec/Hz) 8 7 6 5 AWGN SNR = 20 dB 4 3 2 1 0 0 Matched Filter Bound Single Wire Performance Linear MMSE Canceler Linear ZF Canceler 0.1 0.2 0.3 AWGN SNR = 10 dB 0.4 0.5 0.6 0.7 0.8 0.9 1 Diagonal Dominance Parameter (α) Fig. S1: Performance of linear cancelers versus the DD parameter (α) for two users with a AWGN SNR of 10 dB and 20 dB. For low crosstalk coupling (i.e., α  1 ), the MFB is close to the SWP and the SWP metric is sufficient. For large α, the MFB becomes more relevant as a metric for performance comparison. The figure shows that for a SNR of 20 dB (or higher) the MMSE has practically no advantage over ZF, except for the case where the channel matrix is very close to singular. For lower SNRs (e.g. 10 dB) the advantage of the MMSE is greater, and the MMSE canceler performs better than the ZF. 2) Non-Linear precoding: As stated above, optimal nonlinear processing can asymptotically achieve the sum rate capacity in the downstream, using dirty paper coding or multidimensional lattice precoding. However, both approaches require high implementation complexity, and hence are not considered for DSL. A simpler non-linear scheme which is considered for DSL is the Tomlinson-Harashima precoder [9], which can be viewed as 1-dimensional lattice precoding. Recalling that the FEXT is modeled through the channel matrix, (2), the THP cancels the interference using the the QR decomposition of the conjugate transpose of the channel matrix, given by HH = QR, where Q is an unitary matrix and R is an upper triangular matrix. The precoding operation is divided into two parts. The modulated signal x first undergoes a pre-cancelation of the interference using the elements of R and a modulo operation, and is then rotated to cancel the channel rotation using the matrix Q. To remove the interference associated with previous users from the symbol of the m-th user, the precoding operation on the m-th symbol evaluates: X̃m = Xm − m−1 X i=1 [RH ]i,m X̃i , m = 1 · · · N. [RH ]m,m (11) Then, to lower the increase in required power, the symbol undergoes a modulo operation: B. Crosstalk Cancellation in the Downstream In the downstream, crosstalk is pre-compensated for before the transmission of signals. While the downstream processing attempts to cancel the crosstalk it also has another consideration to deal with: the precoded signals at each line should operate within the assigned power spectral mask. Another important difference from the upstream is the lack of channel estimation at the central office. In this section, we assume a perfect channel for precoding and deal with the cancellation performance of various precoders. Some notes on channel estimation are given in Section V. 1) BC Capacity: The capacity region of the Gaussian BC has been derived by many authors [41]–[45]. Their work was based on the concept of dirty paper coding [37] which makes it possible to transmit data without degradation in the presence of interference that is known to the transmitter. Equivalently, this capacity can also be achieved using lattice precoding, as discussed by Erez et al. [46]. The derivation of the Gaussian BC capacity is beyond the scope of this review paper. Hence, as in the upstream we will focus on single wire performance (SWP) and the matched filter bound (MFB). The single wire performance for the downstream can be similarly derived as in the upstream. The MFB in downstream transmission is the capacity when all the modems transmit to a single user. The MFB for the i-th user −2 Rdown = ∆f log2 (1 + Γ−1 σw,i Px,i ||hi ||2 ) i (10) where hi is the i-th row of the downstream channel matrix H, and Px,i is the allowed transmission power for each line (at the considered tone). In the multi-user case the single-user bound can be achieved through non-linear dirty paper coding. X̃m = Xm mod 2A (12) where the modulo operation is defined such that its result will be within a square with an edge of 2A centered at the origin of the complex plane. After collecting all symbols, x̃ = [X̃1 , . . . , X̃N ]T , the resulting vector is rotated by applying Q. Given that the we used the QR decomposition of HH and the the matrix Q is hermitian, the resulting received signal is: y = RH x̃ + w. By comparing the effect of the channel with the pre-cancellation operation in (11), it can be seen that all interference between users is eliminated. The only step left is to normalize the signal and to reciprocate the modulo operation by an additional modulo operation at the receivers. Thus, the estimated symbol of the m-th user is   Ym Wm X̂m = mod 2A = Xm + mod 2A. Rm,m Rm,m (13) Thanks to the modulo operations, the THP can cancel all the interference at almost no cost. This contrasts with linear precoding schemes (see the next sub-subsection) that can also remove the interference, but at a power cost that can be significant. The price of the modulo operation comes from the effective change of the channel, so that the Gaussian signaling is no longer optimal. This loss is called the shaping loss, and is at most 1.5 dB. Moreover, although Gaussian signaling maximizes the achievable rate, all DSL schemes are limited to square QAM modulations, and hence lose most of this shaping loss regardless of the interference cancellation method. Thus, the actual loss of the modulo operation is negligible. 10 B. Tomlinson-Harashima Precoder (THP) 𝑊1 The THP is an efficient but simple method to remove the interference between the transmitted symbols with almost no cost. While the equations that describe the THP may be somewhat intimidating, the principle of operation is quite simple. In the following we illustrate the operation of the THP for the simple case of 2 users. Consider a downstream transmission for two users. For simplicity, we consider the real valued channel matrix   1 α H= . (B1) α 1 The QR decomposition of the transpose of H is:   1 1 −α Q= 1 + α2 α 1   1 1 + α2 2α √ R= . (B2) 0 1 − α2 1 + α2 Let us assume that the symbols for transmission for the 2 users are X1 and X2 . Using (11), the symbols are precoded as X̃1 = X1 and X̃2 = X2 − 2α/(1 − α2 )X1 = A + 2α/(1 − α2 )A. Ignoring the modulo operation for a while, the symbol vector x̃ = [X̃1 , X̃2 ] is rotated by QT and the transmitted vector is Qx̃. Recalling that the matrix Q is unitary, we have QQT = I, and thus: y = HQx̃ + w = RT QT Qx̃ + w (B3) T = R x̃ + w Thus, we get Y1 = R11 X1 + W1 and Y2 = R2,2 X2 + W2 . Hence, both symbols can be received by the two separate receivers without any interference. A schematic diagram is presented in Fig. 11. However, in the description above, we ignored the power requirement of this transmission. In particular, assuming that the symbols are statistically independent and with equal power, the transmission of X̃2 requires a power which is 1 + 4α2 /(1 − α2 )2 the power X2 . For some values of α this will result in extreme waste of power. To avoid this power loss, we use the modulo operation. Assume that the transmit symbols lie in the range of [−A, A]. Thus, instead of using X̃2 , we use X̃2 − 2An where n is an integer chosen such that the resulting processed symbol is also in the range of [−A, A]. At the receiver we again use the knowledge of the range of transmission values to reconstruct X2 . The estimate of X2 is constructed as X̂2 = Y2 /R22 + 2An and n is easily found by requiring that the symbol is inside the allowed range of [−A, A]. The cost of the modulo operation is slightly lower power efficiency, which is typically negligible compared to the reduction of the interference. 𝑸 𝒙′ 𝑋2 Modulo + 𝑌 + 1 𝑋1 𝑋1′ 𝑋1 𝑋2 𝑋2′ 𝑇 −𝑅21 𝑇 −𝑅21 𝑇 𝑋1 𝑅22 𝑋2 Detector 𝑋1 1 + 𝑌2 Modulo 𝑇 𝑅22 Detector 𝑋2 𝑊2 𝑇 𝑅22 −𝐴 1 𝑇 𝑅11 𝑯 = 𝑹𝑯 𝑸𝑯 Modulo (+2𝐴𝑛) 𝑋2 (w/o Modulo) −𝐴 𝐴 𝑌2 𝑅22 𝑋2 𝐴 𝑋2 Modulo (−2𝐴𝑛) ` Fig. S2: Succesive pre-compensation using QR factorization and the Tomlinson-Harashima modulo operation for a simple 2 × 2 channel. 3) Linear Precoders: The equivalent of the MMSE canceller for the downstream is typically termed the diagonal loading precoder or signal to leakage ratio (SLNR) precoder [47]. As in the upstream, this precoder will typically perform slightly better than the ZF precoder, using almost the same implementation complexity. However, this precoder has not been studied extensively in the context of DSL, and hence will not be discussed here in more detail. The linear ZF precoder is a simple technique which precompensates the true symbol vector x with the inverse of the channel matrix, Fzf = H−1 diag(H)G, such that the precoded signal vector becomes x̃ = Fzf x [11]. The diagonal scaling matrix G is chosen such that the total transmit power on each line satisfies the power mask constraint tightly; therefore, each element Gii can be different [48] [49]. C. Transmit Power Scaling in Linear ZF Precoder To illustrate the transmit precoding and necessity of gain scaling, we consider a downstream transmission of two users with a real-valued channel matrix:   1 α H = Hd . (C1) α 1 The ZF linear precoder without gain scaling Fzf = H−1 diag(H):   1 1 −α Fzf = . (C2) 1 − α2 −α 1 The signals after precoding becomes: 1 α X1 − X2 . 1 − α2 1 − α2 (C3) 1 α X̃2 = X − X . 2 1 1 − α2 1 − α2 If the users transmit with the maximum power P mask , the transmit powers after precoding for both 1+α2 the users are amplified by a factor of (1−α 2 )2 . It is easy to see that the precoded signals violate the PSD mask for α 6= 0. Proper scaling of the precoded signals X̃1 and X̃2 is required before transmission. The elements of diagonal scaling matrix are computed as G11 = (1−α2 ) G22 = 1/ argmaxi [H−1 diag(H)]row i 2 = √ . 1+α2 After scaling the precoded signal, the received signals are free from crosstalk but incur a power penalty: X̃1 = 11 Algorithm ZF-GDFE [39] MMSE [56] C. Legacy Techniques for Vectored VDSL System The extraordinary success of vectoring techniques for VDSL systems has proved pivotal in moving toward the next generation G.fast standard. However, most of the techniques developed for VDSL vectoring relied on the diagonal dominance of the channel to enable low enough implementation complexity [50], [51]. As discussed in Subsection III-B, diagonal dominance does not hold over the G.fast frequency range. Nevertheless, in this subsection we briefly discuss these methods to better depict the challenges of the transition from VDSL to G.fast. 1) Crosstalk Cancellation for VDSL: The works in [10], [11] showed that the ZF based linear canceler/precoder yields performance close to the single user bound. In contrast to the wireless MIMO, it is possible to bound the performance of the ZF canceler using the diagonal dominance parameter. Thus, VDSL systems were derived using analytic estimates on the vectoring gain without the needing to rely on simulation/measurement results. The analysis for the ZF based cancelers was further improved in [52] and [53]. The bounds in [10], [11], [52], [53] prove that for strongly DD matrices, the noise enhancement in the upstream or power penalty in the downstream is negligible, and performance is close to the optimal. As shown in [53], the data rate achievable by user i in the upstream of a DSL system is bounded:  −2 log2 1 + Γ−1 Px,i σw,i |Hi,i |2 f (β) ≤ Rzf i  (14) −2 ≤ log2 1 + Γ−1 Px,i |Hi,i |2 σw,i (1 + β)  where f (β) = max 0, 1 − 2β − β 2 . Thus, at lower frequencies where the DD property is significant (β is significantly smaller than 1 as depicted in Fig. 8) the ZF canceler is quite close to the upper bound, and hence near-optimal. On the other hand, these bounds are meaningless for β > 0.42, and hence, we have no guarantee for the performance of the ZF canceler in G.fast. Similar performance was found for the downstream ZF system [53]. Interestingly, as shown in Fig. 9 above, although the bounds become meaningless, ZF performs quite well for G.fast as well. Thus, in many G.fast scenarios we can still use ZF, and use simulations/measurements to check its performance. At this point, it is important to note that the complexity of ZF was too complex at the time, and the implementation of VDSL systems required another step using the DD property. Following [12] the implementation of VDSL systems relied on Performance ZF-THP [9] ZF [10] [11] AZF [12] [9] Complexity It can be seen that with negligible α, the linear precoder achieves crosstalk-free performance. However, there is a degradation in performance if the channel deviates from being diagonally dominant. TABLE I: A Summary on Crosstalk Cancellation Techniques Data Rate Y1 = G11 Hd X1 + W1 and Y2 = G22 Hd X2 + W2 . The spectral efficiency of the users:   (1 − α2 )2 zf zf R1 = R2 = log2 1 + SNRawgn (C4) 1 + α2 Comments Used in downstream. Negligible power penalty due to the modulo operation. Requires ordering to optimize performance. Used in upstream. Requires ordering to optimize performance. Problem of error propagation in the feedback loop. Performs marginally better than the ZF. Requires knowledge of noise covariance. Requires channel inversion. Near-optimal for lower frequencies. Does not require channel inversion. Near-optimal for longer loops and lower frequencies. Not suitable for typical G.fast applications. a low complexity approximation of the ZF which was shown to be good when β is small enough. Fig. 9 shows that above 250 m performance using first oder approximation is equivalent to all other techniques. This approximation is described in the following subsection. 2) Approximate ZF Canceler: We can express the channel matrix as H = D(I+D−1 E) where E is the matrix containing the off-diagonal elements of H. The power series expansion of (I + D−1 E)−1 is convergent when the eigenvalues of the matrix D−1 E are less than one. Leshem and Li [12] used the DD property of the channel to show that a first order approximation of the ZF Fazf = (I − D−1 E)D−1 achieves near-optimal capacity. The complexity reduction is significant in that the matrix inverse operation is replaced by the inverse of a diagonal matrix, which requires only N single element inversions and D−1 is computed anyhow using the FEQ (frequency domain equalizer) coefficients. This is important since ZF requires a channel matrix inversion at each tone. Such matrix inversions are frequently required due to changes in user status or variations in crosstalk characteristics, and hence cause an increase in overhead on the computational cost of the ZF receiver. Unfortunately, this approximation turned out to be useful only when β is very small, and hence does not carry over well to G.fast systems (see Fig. 9). To avoid the channel matrix inversion, iterative algorithms for crosstalk cancellation in DSL systems have been proposed [54], [55]. However, these schemes do not perform well at higher frequencies for G.fast systems and introduce latency. G.fast systems need to adopt more complicated algorithms whose design considerations are further detailed in Section V. 12 D. Crosstalk Cancellation using Approximate Inversion To illustrate the approximate inversion method, we extend the model in Box A to a three user model:        Y1 1 α α X1 W1  Y2  = Hd  α 1 α   X2  +  W2  . Y3 α α 1 X3 W3 (D1) We denote D as a diagonal matrix of H, and E as the matrix containing the off-diagonal elements of H. The first order approximation method approximates the inversion of the ZF canceler:   1 −α −α 1  −α 1 −α  . Fazf = (I−D−1 E)D−1 = Hd −α −α 1 (D2) This canceler does not remove the crosstalk completely since Fazf H is not identity. Applying the canceler Fazf on the received signal results in the signal estimate: 1 W1 − Hd α α W2 − W3 , Hd Hd (D3) X̂1 = (1 − 2α2 )X1 − α2 X2 − α2 X3 + and the spectral efficiency:  Razf = log2 1 + SNRawgn  (1 − 2α2 )2 . 2α4 SNRawgn + 2α2 + 1 (D4) Thus, the approximate ZF is close to optimal if both α  1 and α4 SNRawgn  1. This is much better than the no cancellation case, which α2 SNRawgn  1. However, if α is not very small, and the SNR is high (as in most frequencies in G.fast) the performance of the approximate ZF can be significantly lower than the exact ZF. Spectral Efficiancy (bits/sec/Hz) 14 12 AWGN SNR = 40 dB Single Wire Performance Linear ZF Canceler Approx. Inversion Method No Cancellation 10 8 6 4 AWGN SNR = 20 dB 2 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Diagonal Dominance Parameter (α) Fig. S3: Performance of linear approximate inversion canceler versus DD parameter for three users with AWGN SNR of 40 dB and 20 dB. For the DD parameter α < 0.1 (which is typical of VDSL), the linear ZF canceler performs close to AWGN performance. 3) Adaptive Crosstalk Cancellation: Adaptation in the crosstalk cancellation schemes requires an update of the canceler coefficients based on the dynamics of the channel. In the upstream VDSL, there are several adaptive algorithms that minimize the mean square error (MSE) at the output of the crosstalk canceler. Certainly, the most popular algorithm is the LMS algorithm [57]. LMS is a stochastic gradient descent method that under certain conditions converges to the MMSE solution. The popularity of the LMS algorithm is mostly due to its simplicity. The LMS crosstalk canceler (in each tone) can be described as a matrix F[t] , [f1 [t], f2 [t], · · · , fN [t]] (15) where fN [t] denotes the canceler vector for line N at time t. Hence, the output of the LMS crosstalk canceler can be written as z[t] = FH y[t]. For an error vector e[t] = x[t] − z[t], the LMS recursion can be written in a matrix form as F[t + 1] = F[t] − 2µy[t]eH [t], (16) where F(t), y(t) and x(t) denote the value at time t of the precoding matrix, the received symbol and modulated data, respectively. With an appropriate selection of step size µ, the LMS is guaranteed to converge. Nevertheless, its convergence rate depends on the eigenvalues of the input correlation matrix. Thus, LMS based adaptive algorithms are very efficient and converge quite rapidly for diagonally dominant VDSL channels. On the other hand, these algorithms become inefficient or converge very slowly at higher frequencies due to bad conditioning of the input correlation matrix. Hence, the conventional LMS algorithm is not suitable for the G.fast system and new methods are needed. For the VDSL system, the adaptation of a crosstalk canceler matrix in the downstream is more complicated because the transmitter at the optical network unit (ONU) cannot directly measure the channel matrix. Hence, the calculation of the precoding matrix must rely on feedback from the receivers. Two main types of feedback have been considered: channel estimation feedback and signal error feedback. Channel estimation feedback is based on the transmission of orthogonal (synchronized) pilot symbols from all transmitters simultaneously, and an estimation of a row of the channel matrix by each receiver. This estimated row is then transmitted (through the upstream) back to the transmitter, which uses it to construct the full channel matrix H and to calculate the precoding matrix. Signal error feedback is a more DSL-specific method, and is based on the feedback of a quantized version of the error signal measured by each receiver [58]. The ONU groups all the error signal feedback from each CPE into a vector to adapt the precoder coefficient matrix. A simpler version of an adaptive precoder was proposed independently by Louveaux and van der Veen [13] and by Bergel and Leshem [14]. The adaptive precoder was shown to be very robust, and converged in all channels with a strong RWDD property [59] [60]. However, these approaches lost their attractiveness when the new G.fast standard adopted a TDD approach. Thus, in G.fast, the ONU can directly measure the channel in the upstream phase and use its estimation in the downstream phase with no need for feedback. 13 V. D ESIGN C ONSIDERATIONS AND C HALLENGES FOR G. FAST The G.fast transmission technology is under development and has different features than the current vectored VDSL technology. The techniques developed for the VDSL system thus cannot simply be applied to the G.fast system. Yet, efficient design methodologies for the G.fast system are required to deliver data at the rate of 1 Gbps per user over short telephone lines. Recently, various novel techniques have been developed for the G.fast system. These techniques are still not sufficient to reach the desired rates with currently available hardware. In this section, we discuss various differences between G.fast and VDSL, give an overview on recent research, and highlight the design considerations for the G.fast system. We also point out some of the topics that are important for G.fast implementation, which have not been studied sufficiently and require further research. A. G.fast Characteristics We first present a concise representation of the main G.fast characteristics, as a complement to the general system model given in Section II. G.fast transmission model consists of N vectored users (typically upto 100) and operates over loop lengths shorter than 250 m. The G.fast standard targets an aggregate data rate (combined upstream and downstream) of 1 Gbps per user. The data rate performance of G.fast system is limited by the FEXT since NEXT is eliminated with the TDD scheme which provides independent transmissions on upstream and downstream directions over whole bandwidth. The transmission bandwidth starts at 2.2 MHz and ends at 106 MHz for the low bandwidth version of G.fast and 212 MHz for the upcoming version. The system employs DMT modulation of size K sub-carriers of width 51.75 KHz for each user corresponding to a total K = 2048 sub-carriers for 106 MHz G.fast and K = 4096 sub-carriers for 212 MHz G.fast system. The channel matrix is diagonally-dominant at the lower frequencies, but not at the higher frequency tones. Each user transmits a QAM symbol (with a rate of 48000 symbols per second) of unit energy with a gain scaling factor to control transmission power. The per-tone PSD mask is based on the frequency of operation: −65 dBm/Hz for f ≤ 30 MHz, −76 dBm/Hz for 30 MHz < f ≤ 106 MHz, and −79 dBm/Hz for f > 106 MHz. Each transceiver has a total maximum transmit power of 4 dBm. The additive noise is AWGN with a PSD of −140 dBm/Hz. The target bit-error-rate (BER) is set to 10−7 and an SNR gap is Γ = 9.75 dB. The specified noise margin of 6 dB and coding gain of 5 dB lead to a transmission gap of 10.75 dB. The G.fast limits bit loading to 12 bits per tone i.e. QAM constellation size of up to 4096 points. B. Channel Coherence Time The DSL channel is a slowly time-varying since it consists of twisted-pair copper wires in a static cable binder with fixed user terminals. The time variability can be attributed mainly to changes in customer wiring and temperature variations on the time scale of a few minutes or more. Therefore, the DSL channel has a long coherence time (defined as the time in which there is no effective variation in the channel impulse response). This has several advantages as regards DSL system design in contrast to wireless communication systems. Furthermore, it allows multi-user operation with as many as 100 users simultaneously, an order of magnitude larger than existing MIMO wireless systems. The long coherence time allows for almost perfect CSI acquisition. This enables the robust design of crosstalk cancellation schemes. In addition, tracking and updating of the channel matrix is less frequent, which reduces the overhead required for pilot symbols inserted between the data symbols. With large channel coherence, iterative algorithms for power allocation as well as crosstalk cancellation are feasible even with a very large number of lines. C. Channel Estimation and Calibration As discussed above, the long coherence time enables the receivers to obtain very good channel estimates, which are important for cross talk cancellation. Hence, channel matrix estimation in upstream transmission is much easier than in the downstream. In upstream transmission, users transmit known training symbols and a simple least squares technique can be used to estimate the channel matrix at the distribution point. The length of each user’s training symbols should be at least equal to the number of vectored users. In the downstream, the channel estimation is carried out at the user terminals where each row of the channel matrix is estimated. This increases the complexity of the users’ modem and power consumption. However, the main challenge is to forward the estimated channel from each user to the distribution point. In VDSL systems, which are based on the FDD scheme, the channel coefficients are quantized at each user and transmitted to the DP over the upstream channel. This increases the overhead and complicates the design with a reduction of quality of CSI for transmit precoding. The TDD duplexing scheme of G.fast makes it possible to exploit channel reciprocity to avoid the complicated feedback protocol. This also enables the DP to perform all CSI related tasks. Using channel reciprocity, the downstream channel can be estimated as H̃d = H̃Tu where H̃u is the estimated upstream channel. In practice, the transmit and receive paths at the DP are not identical; hence, the estimated downstream channel needs to be calibrated to compensate for this mismatch. This calibration process is still in development and has not yet received sufficient academic attention. D. Adaptive Crosstalk Cancellation The adaptation of a crosstalk canceler matrix to track the channel dynamics is another important design consideration for the G.fast system. In general traditional adaptive algorithms designed for the VDSL system can be applied to the G.fast system. However, these algorithms and mainly the LMS algorithm [61] become inefficient or converge very slowly at higher frequencies due to bad conditioning of the input correlation matrix. At higher frequencies the received signal’s covariance matrix is badly conditioned due to loss of diagonal 14 𝑊1 𝑋1 [𝑡] + 𝑋1 [t] 𝑌1 [𝑡] 𝑌1 [𝑡] 𝑓1𝐻 [𝑡] + 𝑓2𝐻 + 𝑊2 𝑋2 [𝑡] + - 𝑋2 [t] 𝑌2 [𝑡] 𝑌2 [𝑡] 𝐇[𝑡] 𝑋𝑁 [𝑡] 𝑋1 [𝑡] [𝑡] 𝐅𝑝 [𝑡] 𝑊𝑁 𝑌 [t] + 𝑁 𝐅 [𝑡] 𝑌𝑁 [𝑡] 𝑓𝑁𝐻 [𝑡] 𝑋2 [𝑡] 𝑋𝑁 [𝑡] 𝑋𝑁 [𝑡] + - Fig. 10: A two-stage LMS algorithm for adaptive crosstalk cancellation in upstream G.fast. dominance characteristics. There is an ongoing research on adaptive techniques for upstream transmissions. As an interesting new paper, [62] [63] presents a novel algorithm that can speed up the convergence of the LMS crosstalk canceler by preprocessing the input received signal with a judicially designed matrix preprocessing matrix, as shown in Fig. 10. The proposed two-stage LMS algorithm first preprocesses the input signal by multiplying it with a matrix Fp [t] and then applies a standard LMS on the preprocessed signal that updates another decoding matrix, F[t]. The conventional LMS is accelerated by updating (at carefully selected times) the preprocessing matrix to include also the LMS matrix: Fp [t + 1] = Fp [t]F[t + 1] and LMS F[t]= I. The paper shows that the updates of the preprocessing matrix speed-up the convergence of the LMS crosstalk canceler by reducing the condition number of the correlation matrix at the LMS input. Since, the preprocessing matrix is not frequently updated, the complexity of the algorithm is approximately twice the complexity of the conventional LMS. For the downstream, the TDD scheme in the G.fast facilitates a simpler approach to adaptive algorithms than the VDSL. Using channel reciprocity, feedback from the users is no longer necessary. Instead, the adaptive algorithm can be carried out solely in the upstream, and the resulting FEXT cancellation matrix is guaranteed to also be a good precoding matrix for the downlink. E. Optimized Crosstalk Cancellation Schemes The performance of crosstalk cancellation techniques (as described in Section IV) depends mainly on the characteristics of the DSL channel. Since the G.fast channel is not diagonally dominant at higher frequencies, the crosstalk cancellation schemes for the VDSL system are no longer optimal for most of the G.fast channel bandwidth. We overview recent research works that describe novel approaches to deal with strong crosstalk in the G.fast system [64]–[69]. 1) Power Normalization: Use of linear cancellation in the downstream transmission requires an energy normalization that can guarantee the power constraint for all lines. For the VDSL (low) frequencies, it was shown that simple power normalization results in near optimal performance [11]. But, this is not the case for G.fast frequencies, and power normalization can significantly reduce the SNR when the channel matrixP is ill-conditioned. A single normalization factor p N βmax = maxi j=1 |Fij |2 (i.e. gain scaling G/βmax ) has been shown near optimal for low frequencies [11]. A simple power normalization approach, [48] adopted a two stage normalization. In the first stage, the power of each user is normalized according to its overall line power, while the second stage is the simple overall power normalization of VDSL. A more effective approach, [64] optimizes the per-line power normalization scheme via a linear program that further improve the performance and balances the rates among the users. 2) Ordered Successive Interference Cancellation : The non-linear interference cancellation schemes for the downstream does not require power normalization as their power increase is negligible (e.g., because of the modulo operation in THP). However, the issue of user ordering for successive interference pre-coding becomes very important. As the channel gains depend on the decoding order, the users precoded earlier experience higher data rates, while the users precoded later achieves lower data rates creating undesirable rate variance among users. Several works (e.g., [65], [66]) have suggested novel approaches for user ordering that both improve the total throughput and reduce the rate variance. In the upstream, the ordering affects the performance of the ZF-GDFE, which strongly depends on the detection ordering due to the error propagation effect [39]. Comparing to wireless communications, the G.fast requires more complicated processing as it simultaneously serves more user and with higher user rates. On the other hand, the low rate of change in the channel and in the user activity allows a longer processing time for this optimization problem. The problem becomes even more complicated as we take the whole bandwidth into account, and try to jointly optimize the complete network. This is discussed in the following subsection. F. Joint Multi-User Crosstalk Cancellation and DSM Dynamic spectrum management (DSM) techniques were shown to improve the performance of DSL systems (e.g., [70]–[73]) by improving the resource allocation between all users over the system bandwidth. DSM have evolved mostly independently of multiuser crosstalk cancellation and both were considered (separately) as different level of coordination in DSL systems [9] [10]. Novel research approaches for G.fast consider a joint signal and spectrum coordination. The joint implementation of crosstalk cancellation and spectrum management can be formulated as an optimization problem that need to derive the optimal precoder and decoder and optimal power allocation subject to a given set of constraints. Practical G.fast systems typically face three power constraints: The first constraint is the PSD mask Pk,mask which represents the maximum PSD allowed at tone k. This constraint is defined by regulation and prevents G.fast from allocating too much power in certain frequency band. The second constraint is transmit power per-line 15 1400 1000 800 600 400 200 0 50 diag(Fk FH k ) ≤ pline k ψk,n (Fk , pk ) ≤ bcap , ∀k, 150 200 250 300 350 400 450 500 Fig. 11: Average achievable user rate over the whole bandwidth of 106 MHz vs. binder length. The binder is composed of 10 users with equal line lengths. 25 Spectral Efficiency (bits/sec/Hz) X 100 Line Length (m) diag(Fk FH k ) ≤ pk,mask , ∀k, s.t. Matched Filter Bound Single Wire Performance ZF−GDFE Canceler Linear MMSE Canceler Linear ZF Canceler Approx. First Order Canceler No Cancellation 1200 Data Rate (Mbits/Sec) Pline to account for the limited range of transmit amplifiers. The third constraint is the bit cap bcap for bit-loading and reflects the limited capabilities of the modulator, which does not allow constellation sizes greater than a threshold. It is noted that similar optimization problems have been studied extensively for wireless networks [74]–[77]. However, proposed algorithms from wireless systems are not directly applicable to G.fast context due to the use of large number of users in the DSL systems as well as additional constraint of per-line power Pline in addition to the PSD mask Pk,mask (i.e. existing per-antenna power constraint). The joint sum-rate optimization of the precoder and the powers can be obtained for example as [68]: XX max ψk,n (Fk , pk ), ∀k Fk , pk n k 20 Matched Filter Bound Single Wire Performance ZF−GDFE Canceler Linear MMSE Canceler Linear ZF Canceler Approx. First Order Canceler No Cancellation , k = 1, · · · K, n = 1, · · · N 15 (17) where ψk,n (Fk , pk ) is the achievable rate for the line n and 10 tone k for a given set of power allocation vectors pk ∈ R1×N and precoding matrix Fk ∈ CN ×N in the desired interfer5 ence cancellation scheme. The vectors pk,mask ∈ R1×N and 0 pline R1×N denotes the PSD masks and per-line powers for N 0 20 40 60 80 100 120 140 160 180 200 Frequency (MHz) users at tone k, respectively. The case of MMSE precoding was solved using a closed form solution for the precoders given the power allocation Fig. 12: Spectral efficiency performance using channel meaper tone per line, and using the uplink-downlink duality [68]. surement [27] for a binder with 10 lines of 100m length. Recently the MMSE precoding has been proposed in the nonlinear THP framework [69]. The algorithms to solve these optimization problems are quite complex for G.fast systems. [27] as well as stochastic MIMO channel models with CAT5 However, these techniques are useful as they provide a com- cables [3]. The measured channel contains data from a 0.5 mm putable bound to compare computationally efficient algorithms cable with 10 pairs each measuring 100 m. For the rate-reach plot, we consider a simulated channel with two scenarios: the for other optimization problems. To reduce the complexity of algorithms, the DSM algo- first scenario consists of 10 lines each of equal length that rithms can be applied with a fixed canceler structure such range from 50m to 500m, and the second scenario 15 considers that the transmit power optimization minimizes the residual lines with different line lengths uniformly spaced from 50 m crosstalk and improves the performance. It was shown [9], to 400 (intervals of 25 m). The lowest frequency was 2.2 MHz [10] that the application of ZF-GDFE or linear ZF canceler for both 106 MHz and 212 MHz G.fast systems which is decouples the power allocation problem and essentially be- defined in the standard [3] for backwards compatibility with comes independent for each user. In this scenario, an iterative legacy ADSL systems. The noise PSD was −140 dBm/Hz water filling (IWF) algorithm can be applied for each user to and the transmit PSD specification at each tone was taken maximize their own data rate selfishly. This results in sub- from [78]. A bit cap of 12 bits per tone (i.e., 4096 QAM optimal performance but gives a low complexity solution that densest constellation) was maintained and an effective SNR can be readily implemented. Current research aims to find to Shannon gap of 10.75 dB was used. The ITU-T standard [3] recommends linear crosstalk cancelbetter algorithms to fill the gap between the infeasible optimal ers for the G.fast 106 MHz since the loss of the linear scheme solution and the simplified ZF-IWF solution. is marginal up to 106 MHz (see Fig. 11). The rate-reach in Fig. 11 shows that the linear crosstalk schemes are near G. Design consideration for Crosstalk Cancellation Schemes optimal for 106 MHz. Note that at very high frequency tones The most important design issue in G.fast is the crosstalk (above 90 MHz), the diagonal dominance is not very strong, cancellation scheme. As discussed in Section IV there is a which degrades the performance of linear schemes as shown performance-complexity tradeoff, where linear cancelers are in Fig. 12. However, at such high frequencies, the spectral simpler, but lose on performance. We now discuss the choice efficiency is significantly lower due to the signal attenuation of crosstalk cancelers as regards the performance over standard and therefore, the overall loss in data rate (computed over all channels. Performance is evaluated using measured channel tones) is marginal. The performance of the linear approximate 16 Data Rate Per User (Mbits/ Sec) 3000 Matched Filter Bound Single Wire Performance ZF−GDFE Canceler Linear MMSE Canceler Linear ZF Canceler Approx. First Order Canceler No Cancellation 2500 2000 1500 1000 500 0 50 100 150 200 250 300 350 400 Line Length (m) Fig. 13: Achievable data rates of 15 users in a binder with uniformly spaced line lengths. All users use G. fast 212 MHz with various cancelers. inversion is significantly degraded and is not recommended for G.fast. It can be seen that the linear MMSE canceler performs marginally better than the ZF at higher frequencies; however, it is recommended since it provides extra protection against external noise and its complexity is almost identical to that of the ZF. Recently, an asymptotic analysis on the performance of ZF receiver using theory of large dimensional random matrices has been presented for G.fast system in [79]. The G.fast channel up to 212 MHz is not diagonally dominant and the linear ZF scheme is no longer near-optimal for crosstalk cancellation (see Fig. 13 ). Here, non-linear cancellation schemes are preferred, but the MMSE linear scheme still gives reasonable performance, with at most a 5% degradation compared to the MFB and 3% compared to ZF-GDFE. The non-linear schemes are computationally more complex than the linear techniques. However, their performance can be improved with proper ordering procedures among users [66]. Recent works [80] show that the impact of the channel estimation error on the non-linear is more crucial on the G.fast system than the VDSL system. This is also an important design consideration for the non-linear G.fast system. It is noted that the above simulation results have been obtained without optimal power control (as discussed in the subsection V-F). Algorithms for joint DSM with crosstalk cancellation in [67], [68] showed that there was a significant performance improvement for the optimized linear ZF and non-linear ZF-GDFE at higher frequencies. However, the considered algorithms have higher computational complexity due to the large-dimensional power allocation in G.fast systems. H. Implementation Complexity Crosstalk cancellation schemes require significant computational resources given various signal processing operations at a large scale. The first is the memory requirement of the processor to store N 2 channel coefficients per tone. Since the number of tones is very large, K = 4096, the memory requirement is significant. The efficient usage of memory for this task also needs further investigation. For example, the memory requirement can be reduced if the channel coefficients are stored at a few tones throughout the band and interpolated on the other tones. However, this will reduce the data rate performance because the error in channel estimates increases with the interpolation interval. These tradeoffs are standard signal processing design. The loss due to quantization and interpolation can be characterized using the techniques of [81]. Another complexity consideration is the computation of the canceler/precoder matrix. The linear ZF and MMSE canceler/precoder require inversion of many channel matrices whose complexity is very large O(KN 3 ). The QR decomposition in the ZF-GDFE canceler/ THP precoder requires similar high computational resources. The approximate inversion method [12] which avoids the matrix inversion is not recommended for the G.fast system at higher frequency tones. The adaptation of the canceler/precoder coefficients should be simple and not need costly computation. The G.fast standard provisions a single sync symbol after every 274 data symbols to track the channel. The authors in [61] have proposed a scheme to directly track the canceler matrix whose convergence depends on the diagonal dominance parameter of the channel. Further research is required to derive computationally efficient adaptive canceler schemes for the G.fast channel. However, the major complexity occurs when the N × N canceler/precoder matrix is applied on the received/transmit vector of size N . This requires KN 2 fs instructions per second which becomes prohibitively high at 1.9 GIPS (a billion instructions per second) for a N = 10 users binder operating at fs = 48 KHz for 4096 tones. I. G.Fast Deployment and Coexistence With the penetration of fibers closer to the end users, various deployment scenarios have been considered for the G.fast fiber to the distribution point (FTTdp) system. The FTTdp consists scenarios where the DP is either mounted on a pole or placed underground at the curb, building, basement, etc. The G.fast FTTdp fiber node can be as far as 250 m to serve dozen of users and as close as 50 m to serve a single user. Since such a scenario requires the deployment of many new DPs, the G.fast also considers the possibility that the DP will be powered from the customer’s CPE. This technology known as reverse powering eliminates the need for a power infrastructure for the DP and hence lowers the deployment cost. This technology also introduces new challenges such as use of a single wire for both broadband and power transmissions and issues related to safety guidelines for power transmission in a home network. Another issue affecting the G.fast deployment is the overlap of its bandwidth with other radio and broadcast services. Radio services overlap a few consecutive tones with the G.fast system throughout the band. These tones need to be either masked or notched such that no interference is experienced by the radio service. Broadcast radios such as FM are broadband services and cover a large bandwidth (20 MHz). The G.fast system has to avoid data transmission over these bands, which limits the rate performance of G.fast. Note that these unused tones can be employed for system provisioning. It should be emphasized that efficient transmissions methods are used to enable the co-existence of the G.fast system with other broadband technologies without disturbing the band profile. 17 The coexistence of the G.fast system with legacy lines is another important issue [82]. Vectored VDSL systems have already been deployed by various service providers and may coexist with G.fast users in the same binder. VDSL fall back and coexistence is necessary for mass deployment of G.fast. Most service providers require that migration from VDSL to G.fast should be seamless, such that the G.fast must be able to peacefully co-exist with VDSL2 from the same DP. A common approach to co-existence is to have both technologies use nonoverlapping spectra. This is a simple approach to avoid any interference between two technologies. However, leaving the lower frequency bands where the spectral efficiency is very high limits the data rate performance of the G.fast technology. The coexistence of G.fast and VDSL in the same DP with an overlapping spectrum is a challenging problem, somewhat similar to the problems faced by ADSL deployment in Japan parallel to TDD based HDSL [83]. J. Crosstalk Cancellation with Discontinuous Operation DSL access networks boast “always on” as a distinguishing feature of their broadband service. However, a typical DSLAM (at the DP) is fully on but does not transmit data all the time, yet most DSL lines do not switch off. Exploiting these low-power modes can be highly effective in creating a green access network. Moreover, energy efficiency is very important for the G.fast DP because they do not have a local power supply, but rather are reverse powered from the subscribers via the copper wires. Discontinuous operation basically means that no data symbols are transmitted when there are no data available. While a VDSL system sends idle data packets, the G.fast system can mute these data symbols and switch off the analog front-end components to enhance energy efficiency [48]. Crosstalk cancellation in conjunction with discontinuous operation has become challenging [84]. A concise problem formulation on the precoded discontinuous process has been presented in [48]. Here crosstalk cancellation must be maintained on active lines, while other lines are in the discontinuous mode. Novel algorithms are required to adapt the linear and non-linear precoder sub-matrices corresponding to active lines in order to enjoy energy savings as well as crosstalk cancellation. VI. D ISCUSSION AND F UTURE D IRECTIONS In this article, we provided an overview of multiuser signal processing techniques for crosstalk cancellation in the next generation G.fast system. We discussed the salient features of this upcoming DSL technology and highlighted the key differences from its predecessors. This tutorial article shows that considerable advances have been made in recent years for crosstalk cancellation in vectored DSL systems. However, the G.fast system poses new challenging problems and further research is still needed to fully realize the goal of achieving gigabit date rates over telephone channels in access networks. The use of wider bandwidth and the TDD duplexing scheme, among others, are the two most distinguishing features in the G.fast that require special attention from the signal processing community. The DSL channel has many specific characteristics that differ from most of the wireless channels. These unique characteristics allowed the implementation of multiuser interference cancellation possible for large number of users. The G.fast channel still integrates these characteristics but loses a key one at higher frequencies: it is no longer diagonal dominant. We showed that the approximate ZF precoder/canceler, which was one of the enabler of massive vectoring, does not perform well enough at the G.fast frequencies. We provided an overview of the most important techniques (linear and nonlinear) and explained them through simple examples. However, all these techniques require high implementation complexity, and more research is required to make multiuser processing work on DSL channel up to 212 MHz. Similarly, we showed that the adaptive schemes designed for the VDSL system do not perform well on the G.fast channel. Additional research is required to address the convergence of these algorithms, in addition to efficient calibration processes to use channel reciprocity in the downstream transmission. Additional issues that require more research include the study of mitigation techniques for interference from uncoordinated lines [85] and noise external to the binder on the vectored G.fast system [86], dynamic spectrum management, and better channel modeling. So far the channel modeling at the higher frequency is less accurate than what we have for VDSL. More measurement campaigns and additional statistical studies are required to improve this modeling. Furthermore, the characterization of the crosstalk channel is just in its early steps and very few publications have addressed it [24], [25] [28]. As G.fast will heavily rely on crosstalk cancellation, a good stochastic modeling is required for developing and testing of G.fast algorithms. The use of G.fast system as an alternative backhauling option for the 5G networks could keep the copper in gold category. R EFERENCES [1] T. Starr, J. M. Cioffi, and P. Silverman, Understanding Digital Subscribe Line Technology. Upper Saddle River & NJ: Prentice-Hall, 1999. [2] M. Timmers, M. Guenach, C. Nuzman, and J. Maes, “G.fast: evolving the copper access network,” IEEE Communications Magazine, vol. 51, no. 8, pp. 74–79, August 2013. [3] ITU-T G. 9701, “ITU-T Recommendation G.9701-2014, Draft Recommendation ITU-T: Fast Access to Subscriber Terminals (FAST) Physical layer specification G.9701,” 2014. [4] V. Oksman, R. Strobel, X. Wang, D. Wei, R. Verbin, R. Goodson, and M. Sorbara, “The ITU-T’s new G.fast standard brings DSL into the gigabit era,” IEEE Communications Magazine, vol. 54, no. 3, pp. 118– 126, March 2016. [5] ITU-T G. 993.1, “Very high speed Digital Subscriber Line,” ITU-T Recommendation G.993.1, Series G: Transmission Systems and Media, Digital Systems and Networks., 2004. [6] ITU-T G. 992.1, “Asymmetric digital subscriber line ADSL,” ITU-T Recommendation G.992.1, Series G: Transmission Systems and Media, Digital Systems and Networks., 1999. [7] J. Cioffi, M. Mosheni, A. Leshem, and Y. Li, “GDSL (Gigabit DSL),” T1E1.4 contribution T1E1.4/2003-487R1, 2003. [8] J. Cioffi, S. Jagannathan, M. Mohseni, and G. Ginis, “CuPON: the Copper alternative to PON 100 Gb/s DSL networks,” IEEE Communications Magazine, vol. 45, no. 6, pp. 132–139, June 2007. [9] G. Ginis and J. Cioffi, “Vectored transmission for digital subscriber line systems,” IEEE Journal on Selected Areas in Communications, vol. 20, no. 5, pp. 1085–1104, June 2002. 18 [10] R. Cendrillon, G. Ginis, E. Van den Bogaert, and M. Moonen, “A nearoptimal linear crosstalk canceler for upstream VDSL,” IEEE Transactions on Signal Processing, vol. 54, no. 8, pp. 3136–3146, 2006. [11] ——, “A near-optimal linear crosstalk precoder for downstream VDSL,” IEEE Transactions on Communications, vol. 55, no. 5, pp. 860–863, May 2007. [12] A. Leshem and Y. Li, “A low complexity linear precoding technique for next generation VDSL downstream transmission over copper,” IEEE Transactions on Signal Processing, vol. 55, no. 11, pp. 5527–5534, Nov. 2007. [13] J. Louveaux and A.-J. van der Veen, “Adaptive precoding for downstream crosstalk precancelation in DSL systems using sign-rrror feedback,” IEEE Transactions on Signal Processing, vol. 58, no. 6, pp. 3173– 3179, June 2010. [14] I. Bergel and A. Leshem, “Convergence analysis of downstream VDSL adaptive multichannel partial FEXT cancellation,” IEEE Transactions on Communications, vol. 58, no. 10, pp. 3021–3027, October 2010. [15] C. E. Shannon, “A mathematical theory of communication,” The Bell System Technical Journal, vol. 27, no. 3, pp. 379–423, July 1948. [16] J. Bingham, “Multicarrier modulation for data transmission: An idea whose time has come,” IEEE Communications Magazine, vol. 28, no. 5, pp. 5–14, 1990. [17] S. Lin, “Statistical behaviour of multipair crosstalk with dominant components,” Bell Systems Technical Journal, vol. 59, no. 6, 1980. [18] J. Werner, “The HDSL environment,” IEEE Journal on Selected areas in Communications, vol. 9, no. 6, pp. 785–800, 1991. [19] BT, “Parametric modeling of twisted pair cables for VDSL,” ANSI contribution, T1E1.4/96-15, Jan 1996. [20] R. Van Den Brink (TNO), “Cable reference models for simulating metallic access networks,” ETSI STC TM6 Permanent Document TM6 (97)2, June 1998. [21] W. Y. Chen, DSL: Simulation Techniques and Standards Development for Digital Subscriber Lines. Indianapolis, IN, USA: Macmillan, 1998. [22] E. Karipidis, N. Sidiropoulos, A. Leshem, and Y. Li, “Experimental evaluation of capacity statistics for short VDSL loops,” IEEE Transactions on Communications, vol. 53, no. 7, pp. 1119–1122, July 2005. [23] E. Karipidis, N. Sidiropoulos, A. Leshem, Y. Li, R. Tarafi, and M. Ouzzif, “Crosstalk models for short VDSL2 lines from measured 30MHz data,” EURASIP Journal on Applied Signal Processing, vol. 2006, no. 1, 2006. [24] R. van den Brink and B. van den Heuvel, “G.fast: far-end crosstalk in twisted pair cabling; measurements and modelling,” ITU-T Contribution 11RV-022, 2011. [25] R. van den Brink, “G.fast: dual slope behaviour of EL-FEXT,” ITU-T Contribution 2012-02-4A-038, 2012, 2012. [26] D. Acatauassu, S. Host, C. Lu, M. Berg, A. Klautau, and P. Borjesson, “Simple and causal copper cable model suitable for G.fast frequencies,” IEEE Transactions on Communications, vol. 62, no. 11, pp. 4040–4051, Nov 2014. [27] L. Humphrey, “G.fast: Release of BT cable measurements for use in simulations,” ITU-T-SG15 contribution 2013-01-Q4-066 to G.fast, January 2013. [28] R. van den Brink, “Modeling the dual-slope behavior of in-quad ELFEXT in twisted pair quad cables,” IEEE Transactions on Communications, vol. PP, no. 99, pp. 1–1, 2017. [29] M. Sorbara, P. Duvaut, F. Shmulyian, S. Singh, and A. Mahadevan, “Construction of a DSL-MIMO channel model for evaluation of FEXT cancellation systems in VDSL2,” in 2007 IEEE Sarnoff Symposium, April 2007, pp. 1–6. [30] J. Maes, M. Guenach, and M. Peeters, “Statistical MIMO channel model for gain quantification of DSL crosstalk mitigation techniques,” in 2009 International Conference on Communications (ICC). Dresden, Germany, June, 2009. [31] W. Xu, C. Schroeder, and P. Hoeher, “A stochastic MIMO model for far-end crosstalk in VDSL cable binders,” in 2009 IEEE International Conference on Communications (ICC). Dresden, Germany, June, 2009. [32] G. Ginis and C.-N. Peng, “Alien crosstalk cancellation for multipair digital subscriber line systems,” EURASIP J. App. Signal Process., vol. 2006, Article ID 16828, 12 pages, 2006. [33] S. Yang and L. Hanzo, “Fifty years of MIMO detection: The road to large-scale MIMOs,” IEEE Communications Surveys Tutorials, vol. 17, no. 4, pp. 1941–1988, Fourth quarter 2015. [34] M. Vu and A. Paulraj, “MIMO wireless linear precoding,” IEEE Signal Processing Magazine, vol. 24, no. 5, pp. 86–105, Sept 2007. [35] D. Gesbert, M. Kountouris, R. Heath Jr., C. Chae, and T. Salzer, “Shifting the MIMO paradigm,” IEEE Signal Processing Magazine, vol. 24, no. 5, pp. 36–46, Sept 2007. [36] F. Rusek, D. Persson, B. Lau, E. Larsson, T. Marzetta, O. Edfors, and F. Tufvesson, “Scaling up MIMO: Opportunities and challenges with very large arrays,” IEEE Signal Processing Magazine, vol. 30, no. 1, pp. 40–60, Jan 2013. [37] T. M. Cover and J. A. Thomas, Elements of Information Theoryy. New York: Wiley, 1991. [38] A. Leshem and E. Zehavi, “Rate control for PSD limited multiple access systems through linear programming,” in 2011 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), May 2011, pp. 3220–3223. [39] C. Chen, K. Seong, R. Zhang, and J. Cioffi, “Optimized resource allocation for upstream vectored DSL systems with zero-forcing generalized decision feedback equalizer,” IEEE Journal of Selected Topics in Signal Processing, vol. 1, no. 4, pp. 686–699, 2007. [40] S. Verdu, Multiuser Detection. Cambridge University Press, New York, 1998. [41] W. Yu and J. M. Cioffi, “Sum capacity of gaussian vector broadcast channels,” IEEE Transactions on Information Theory, vol. 50, no. 9, pp. 1875–1892, Sept 2004. [42] P. Viswanath and D. Tse, “Sum capacity of the vector gaussian broadcast channel and uplink-downlink duality,” IEEE Transactions on Information Theory, vol. 49, no. 8, pp. 1912–1921, Aug 2003. [43] G. Caire and S. Shamai, “On the achievable throughput of a multiantenna gaussian broadcast channel,” IEEE Transactions on Information Theory, vol. 49, no. 7, pp. 1691–1706, July 2003. [44] S. Vishwanath, N. Jindal, and A. Goldsmith, “Duality, achievable rates, and sum-rate capacity of gaussian MIMO broadcast channels,” IEEE Transactions on Information Theory, vol. 49, no. 10, pp. 2658–2668, Oct 2003. [45] H. Weingarten, Y. Steinberg, and S. Shamai, “The capacity region of the gaussian multiple-input multiple-output broadcast channel,” IEEE Transactions on Information Theory, vol. 52, no. 9, pp. 3936–3964, Sept 2006. [46] R. Zamir, S. Shamai, and U. Erez, “Nested linear/lattice codes for structured multiterminal binning,” IEEE Transactions on Information Theory, vol. 48, no. 6, pp. 1250–1276, Jun 2002. [47] P. Patcharamaneepakorn, S. Armour, and A. Doufexi, “On the equivalence between SLNR and MMSE precoding schemes with singleantenna receivers,” IEEE Communications Letters, vol. 16, no. 7, pp. 1034–1037, July 2012. [48] J. Maes and C. Nuzman, “Energy efficient discontinuous operation in vectored G.fast,” in 2014 IEEE International Conference on Communications (ICC), June 2014, pp. 3854–3858. [49] J. Neckebroek, M. Moeneclaey, W. Coomans, M. Guenach, P. Tsiaflakis, R. Moraes, and J. Maes, “Novel bitloading algorithms for coded G.fast DSL transmission with linear and nonlinear precoding,” in 2015 IEEE International Conference on Communications (ICC), June 2015, pp. 945–951. [50] C. Leung, S. Huberman, K. Ho-Van, and T. Le-Ngoc, “Vectored DSL: potential, implementation issues and challenges,” Communications Surveys & Tutorials, IEEE, vol. 15, no. 4, pp. 1907–1923, 2013. [51] I. Bergel and A. Leshem, “Signal processing for vectored multichannel VDSL,” Academic Press Library in Signal Processing: Communications and Radar Signal Processing, vol. 2, p. 295, 2013. [52] S. M. Zafaruddin, S. Prakriya, and S. Prasad, “Performance analysis of zero forcing crosstalk canceler in vectored VDSL2,” IEEE Signal Processing Letters, vol. 19, no. 4, pp. 219–222, April 2012. [53] I. Bergel and A. Leshem, “The performance of zero forcing DSL systems,” IEEE Signal Processing Letters, vol. 20, no. 5, pp. 527–530, May 2013. [54] H. Dai and V. Poor, “Turbo multiuser detection for coded DMT VDSL systems,” IEEE Journal on Selected Areas in Communications, vol. 20, no. 2, pp. 351–362, Feb 2002. [55] S. M. Zafaruddin, S. Prakriya, and S. Prasad, “Iterative receiver based on SAGE algorithm for crosstalk cancellation in upstream vectored VDSL,” ISRN Communications and Networking (Hindawi), vol. 2011, Article ID 586574, 15 pages, 2011. [56] I. Wahibi, M. Ouzzif, J. L. Masson, and S. Saoudi, “Crosstalk cancellation in upstream coordinated DSL using an iterative MMSE receiver,” in 2009 IEEE International Conference on Communications, June 2009, pp. 1–5. [57] B. Widrow and M. Hoff, “Adaptive switching circuits,” 1960. [58] J. Louveaux and A. van der Veen, “Adaptive DSL crosstalk precancellation design using low-rate feedback from end users,” IEEE Signal Processing Letters, vol. 13, no. 11, pp. 665–668, Nov. 2006. 19 [59] I. Binyamini, I. Bergel, and A. Leshem, “Arbitrary partial FEXT cancellation in adaptive precoding for multichannel downstream VDSL,” IEEE Transactions on Signal Processing, vol. 60, no. 11, pp. 5754–5763, 2012. [60] I. Binyamini and I. Bergel, “Adaptive precoder using sign error feedback for FEXT cancellation in multichannel downstream VDSL,” IEEE Transactions on Signal Processing, vol. 61, no. 9, pp. 2383–2393, May 2013. [61] P. Duvaut, P. Biyani, A. Mahadevan, S. Singh, and S. Maheshwari, “Adaptive off-diagonal MIMO canceller (ODMC) for upstream DSL self FEXT cancellation,” in Proceedings of the European Signal Processing Conference (EUSICPCO’08), Laussane, Switzerland, Aug. 25-29 2008. [62] A. Zanko, I. Bergel, and A. Leshem, “Gigabit DSL: a Deep-LMS approach,” in 2016 European Signal Processing Conference (EUSIPCO), 2016. [63] ——, “Deep-LMS for gigabit transmission over unshielded twisted pair cables,” arXiv preprint arXiv:1705.10459, pp. 1–11, 2017. [64] F. Muller, C. Lu, P.-E. Eriksson, S. Host, and A. Klautau, “Optimizing power normalization for G.fast linear precoder by linear programming,” in 2014 IEEE International Conference on Communications (ICC), June 2014, pp. 4160–4165. [65] K. Zu, F. Muller, C. Lu, P. Eriksson, and A. Klautau, “Rate balancing based Tomlinson Harashima precoding for G.Fast systems,” IEEE Communications Letters, vol. 20, no. 8, pp. 1519–1522, Aug 2016. [66] M. Hekrdla, A. Matera, W. Wang, D. Wei, and U. Spagnolini, “Ordered Tomlinson-Harashima precoding in G.fast downstream,” in 2015 IEEE Global Communications Conference (GLOBECOM), Dec 2015, pp. 1–6. [67] R. Strobel, M. Joham, and W. Utschick, “Achievable rates with implementation limitations for G.fast-based hybrid copper/fiber networks,” in 2015 IEEE International Conference on Communications (ICC), June 2015, pp. 958–963. [68] R. Strobel, A. Barthelme, and W. Utschick, “Zero-forcing and MMSE precoding for G.fast,” in 2015 IEEE Global Communications Conference (GLOBECOM), Dec 2015, pp. 1–6. [69] A. Barthelme, R. Strobel, M. Joham, and W. Utschick, “Weighted MMSE Tomlinson-Harashima precoding for G.fast,” in 2016 IEEE Global Communications Conference (GLOBECOM), Dec 2016, pp. 1–6. [70] W. Yu, G. Ginis, and J. M. Cioffi, “Distributed multiuser power control for digital subscriber lines,” IEEE Journal on Selected Areas in Communications, vol. 20, no. 5, pp. 1105–1115, Jun 2002. [71] R. Cendrillon, W. Yu, M. Moonen, J. Verlinden, and T. Bostoen, “Optimal multiuser spectrum balancing for digital subscriber lines,” IEEE Transactions on Communications, vol. 54, no. 5, pp. 922–933, May 2006. [72] P. Tsiaflakis, M. Diehl, and M. Moonen, “Distributed spectrum management algorithms for multiuser DSL networks,” IEEE Transactions on Signal Processing, vol. 56, no. 10, pp. 4825–4843, Oct 2008. [73] S. Huberman, C. Leung, and T. Le-Ngoc, “Dynamic spectrum management (DSM) algorithms for multi-user xDSL,” IEEE Communications Surveys Tutorials, vol. 14, no. 1, pp. 109–130, First 2012. [74] F. Boccardi and H. Huang, “Zero-forcing precoding for the MIMO broadcast channel under per-antenna power constraints,” in 2006 IEEE 7th Workshop on Signal Processing Advances in Wireless Communications, July 2006, pp. 1–5. [75] W. Yu and T. Lan, “Transmitter optimization for the multi-antenna downlink with per-antenna power constraints,” IEEE Transactions on Signal Processing, vol. 55, no. 6, pp. 2646–2660, June 2007. [76] S. Shi, M. Schubert, and H. Boche, “Per-antenna power constrained rate optimization for multiuser MIMO systems,” in 2008 International ITG Workshop on Smart Antennas, Feb 2008, pp. 270–277. [77] S. S. Christensen, R. Agarwal, E. D. Carvalho, and J. M. Cioffi, “Weighted sum-rate maximization using weighted MMSE for MIMOBC beamforming design,” IEEE Transactions on Wireless Communications, vol. 7, no. 12, pp. 4792–4799, December 2008. [78] ITU-T G. 9700, “ITU-T Recommendation G.9700-2014: Fast access to subscriber terminals (G.fast)- Power spectral density specification G.9700,” 2014. [79] S. M. Zafaruddin, U. Klein, I. Bergel, and A. Leshem, “Asymptotic performance analysis of zero forcing DSL systems,” in 2016 IEEE International Conference on the Science of Electrical Engineering (ICSEE), Nov 2016, pp. 1–5. [80] J. Maes, C. Nuzman, and P. Tsiaflakis, “Sensitivity of nonlinear precoding to imperfect channel state information in G.fast,” in 2016 24th European Signal Processing Conference (EUSIPCO), March 2016, pp. 3551–3555. [81] E. Sayag, A. Leshem, and S. N.D., “Finite word length effects on transmission rate in zero forcing linear precoding for multichannel DSL,” [82] [83] [84] [85] [86] IEEE Transactions on Signal Processing, vol. 57, no. 4, pp. 1469–1482, 2009. E. Medeiros, T. Magesacher, P.-E. Eriksson, C. Lu, and P. Odling, “How vectoring in G.fast may cause neighborhood wars,” in 2014 IEEE International Conference on Communications (ICC’14), June 2014, pp. 3859–3864. ITU-T G. 992.3, “Annex J: Symmetric Digital SubscriberLine (ADSL) transceivers,” ITU-T Recommendation G.992.1, SERIES G: Transmission Systems and Media, Digital Systems and Networks., 1999. R. Strobel and W. Utschick, “Discontinuous operation for precoded G.fast,” in 2016 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), March 2016, pp. 3551–3555. S. M. Zafaruddin, S. Prakriya, and S. Prasad, “Performance of linear minimum-output energy receiver for self and alien crosstalk mitigation in upstream vectored very high-speed digital subscriber line,” IET Communications, vol. 9, no. 6, pp. 862–871, 2015. S. M. Zafaruddin and L. Pierrugues, “Performance of a dual sensor based interference cancellation scheme for downstream DSL,” in 2016 IEEE International Conference on Communications (ICC), May 2016, pp. 1–6. AUTHORS ’ B IOGRAPHIES • • • S. M. Zafaruddin ([email protected]) received the B.Tech. degree from Jamia Millia Islamia University, New Delhi, India, in 2003 and M.Tech. degree from Kurukshetra University, Kurukshetra, India, in 2006, both in Electronics and Communication Engineering, and the Ph.D. degree in Electrical Engineering from Indian Institute of Technology Delhi, India, in 2013. His PhD research was on crosstalk cancellation for vectored DSL systems. From 2012 to 2015, he was with the CTO Office (Red Bank, NJ, USA), Ikanos Communications India Pvt. Ltd. (acquired by Qualcomm), Bangalore, India, where he was involved in research and development for xDSL systems. Since 2015, he is with the Faculty of Engineering, Bar-Ilan University, Ramat Gan, Israel as a post-doctoral researcher working on signal processing for wireline and wireless communications. He is an awardee of the PBC (VATAT) Fellowship program for outstanding post-doctoral researchers from China and India from the Council for Higher Education, Israel for two years (20162018). His current research interests include signal processing for communications, communication protocols, multichannel communication, 5G cellular networks, resource-limited sensor networks, and xDSL systems. Itsik Bergel ([email protected]) received the B.Sc. in electrical engineering (magna cum laude) and the B.Sc. in physics (magna cum laude) from Ben Gurion University, Beer-Sheva, Israel, in 1993 and 1994, respectively, and the M.Sc. (summa cum laude) and Ph.D. in electrical engineering from the University of Tel Aviv, Tel-Aviv, Israel, in 2000 and 2005 respectively. From 2001 to 2003, he was a Senior Researcher at INTEL Communications Research Lab. In 2004 he received the Yitzhak and Chaya Weinstein study award. In 2005, he was a Postdoctoral researcher at the Dipartimento di Elettronica of Politecnico di Torino, Italy, working on the capacity of noncoherent channels. He is currently a faculty member in the faculty of engineering at Bar-Ilan University, Ramat-Gan, Israel. His main research interests include multichannel interference mitigation in wireline and wireless communications, cooperative transmission in cellular networks and cross layer optimization of random ad-hoc networks. Since 2015, Dr. Bergel serves as an Associate Editor in the IEEE Transactions on Signal Processing. Amir Leshem ([email protected]) received the B.Sc. (cum laude) in mathematics and physics, the M.Sc. (cum laude) in mathematics, and the Ph.D. degree in mathematics all from the Hebrew University, Jerusalem, Israel, in 1986, 1990, and 1998, respectively. From 1998 to 2000, he was with the Faculty of Information Technology and Systems, Delft University of Technology, The Netherlands, as a postdoctoral fellow working on algorithms for the reduction of terrestrial electromagnetic interference in radio-astronomical radio-telescope antenna arrays and signal processing for communication. From 2000 20 to 2003, he was Director of Advanced Technologies with Metalink Broadband where he was responsible for research and development of new DSL and wireless MIMO modem technologies and served as a member of several international standard setting groups such as ITU-T SG15, ETSI TM06, NIPP-NAI, IEEE 802.3 and 802.11. From 2000 to 2002, he was also a visiting researcher at Delft University of Technology. In 2002 he joined Bar-Ilan University where he is one of the founders of the faculty of engineering and a full professor and head of the communications research track. From 2003 to 2005, he was the technical manager of the U-BROAD consortium developing technologies to provide 100 Mbps and beyond over copper lines. In 2009 he spent his sabbatical at Delft University of Technology and Stanford University. His main research interests include multichannel wireless and wireline communication, applications of game theory to dynamic and adaptive spectrum management of communication networks, array and statistical signal processing with applications to multiple element sensor arrays and networks, wireless communications, radio-astronomical imaging, set theory, logic and foundations of mathematics. Prof. Leshem was an Associate Editor of the IEEE Transactions on Signal Processing from 2008 to 2011, and he was the Leading Guest Editor for special issues on signal processing for astronomy and cosmology in IEEE Signal Processing Magazine and the IEEE Journal of Selected Topics in Signal Processing.
7cs.IT
Liquid-gas-solid flows with lattice Boltzmann: Simulation of floating bodies Simon Bognera , Ulrich Rüdea arXiv:1201.0351v1 [cs.CE] 1 Jan 2012 a Lehrstuhl für Systemsimulation, Universität Erlangen-Nürnberg, Cauerstraße 6, 91058 Erlangen Abstract This paper presents a model for the simulation of liquid-gas-solid flows by means of the lattice Boltzmann method. The approach is built upon previous works for the simulation of liquid-solid particle suspensions on the one hand, and on a liquid-gas free surface model on the other. We show how the two approaches can be unified by a novel set of dynamic cell conversion rules. For evaluation, we concentrate on the rotational stability of non-spherical rigid bodies floating on a plane water surface – a classical hydrostatic problem known from naval architecture. We show the consistency of our method in this kind of flows and obtain convergence towards the ideal solution for the measured heeling stability of a floating box. 1. Introduction Since its establishment the lattice Boltzmann method (LBM) has become a popular alternative in the field of complex flow simulations [33]. Its application to particle suspensions has been propelled to a significant part by the works of Ladd et al. [22, 23] and Aidun et al. [3, 4, 1]. Based on the approach of the so-called momentum exchange method, it is possible to calculate the hydromechanical stresses on the surface of fully resolved solid particles directly from the lattice Boltzmann boundary treatment. In this paper, the aforementioned fluidsolid coupling approach is extended to liquid-gas free surface flows, i.e., the problem of solid bodies moving freely within a flow of two immiscible fluids. We use the free surface model of [21, 30] to simulate a liquid phase in interaction with a gas by means of a volume of fluid approach and a special kinematic free surface boundary condition. I.e., the interface of the two phases is assumed sharp enough to be modeled by a locally defined boundary layer. This boundary layer is updated dynamically according to the liquid advection by a set of cell conversion rules. This paper proposes a unification of the update rules of the free surface model with those of the particulate flow model, which also requires a dynamical mapping of the respective solid boundaries to the lattice Boltzmann grid. As described in [5], the resulting scheme allows full freedom of motion of the solid bodies in the flow, which can be calculated according to rigid body physics as in [20]. We demonstrate the consistency of the combined liquid-gas-solid method by means of a simple advection test with a floating body in a stratified liquid-gas channel flow, and discuss the main source of error in the dynamic boundary handling with particles in motion. Preprint submitted to Elsevier January 4, 2012 Figure 1: D3Q19 stencil. The weights are w0 = 1/3 for C, w1 , .., w6 = 1/18 for W, E, N, S, T, B, and w7 , .., w18 = 1/36 for TW, TE, TN, TS, NW, NE, SW, SE, BW, BE, BN, BS. We further apply our method to the problem of rotational stability of rigid floating structures. This kind of hydromechanical problems typically emerge in marine engineering, where the floating stability of offshore structures is of concern [19, 12], such as the stability of a ship in a heeled position. Because of the static nature of the addressed problems, numerical issues arising from hydro-dynamic effects can be widely discarded, which makes them wellsuited for the verification of the involved force calculations. In addition to that they provide a possibility to check the convergence of the simulated liquid-gas-solid systems into a state of equilibrium. We succeeded in showing that basic convergence is given, provided that adequate spatial resolutions are chosen. For the special problem of the floating stability of cuboid structures, convergence of numerical simulations towards the analytical model was obtained. The idea of evaluating the simulated floating stability of rigid bodies was inspired by [14], who proposed it as a test case for a Navier-Stokes based simulator originally developed for the estimation of “green water” loads on ship decks [13]. As mentioned above, lattice Boltzmann based fluid-structure interaction techniques have been developed for the simulation of particulate flows. We were not able to find publications discussing the application of LBM-based free surface flows in interaction with floating structures. To our knowledge, the only approach to handle similiar problems is the one proposed by Janßen [18]. 2. Method 2.1. Isothermal D3Q19 Lattice BGK Method We assume the D3Q19 lattice model for 3-dimensional flows [31], with a set of N = 19 discrete lattice velocities ci (i = 0, .., N − 1). For the theoretical considerations in this section, however, we will often fall back implicitly to the native D2Q9 model, as it simplifies explanations and figures if they are 2-dimensional. The lattice velocities ~ci (also called lattice directions or lattice links) with their respective weights w ~ i (i = 0, .., N − 1), as shown in Fig 1, are   (0, 0, 0) c~i = (±1, 0, 0), (0, ±1, 0), (0, 0, ±1) (1)   (±1, ±1, 0), (0, ±1, ±1), (±1, 0, ±1). 2 In the following i is used to denote the index of the lattice velocity ~ci with ~ci = −~ci . Let sx , sy , sz be positive real numbers divisible by the spatial resolution, constant δx . The domain [0, sx ] ×[0, sy ] ×[0, sz ] is divided into cells, i.e., cubic volumes of length δx , which yields a computation domain of sδxx × δsxy × δsxz discrete lattice cells. Spatial quantities like sx , sy , sz and δx are commonly given in a certain unit of length (e.g., metres). However – when dealing with LBM specific computations – dimensionless lattice coordinates are used: Spatial coordinates are thus given in the following as multiples of δx . By speaking of a cell (x, y, z), where x, y and z are positive integer numbers we mean the lattice cell with respective volume [x, x + 1] × [y, y + 1] × [z, z + 1] in the lattice. We refer to the point (x + 0.5, y + 0.5, z + 0.5) as the cell center. For each lattice direction i = 0, .., N − 1 we name fi (~x, t) the particle distribution function (PDF) of the direction ci in cell ~x and of time step t. The lattice BGK propagation scheme can be derived from the classic Boltzmann equation with the collision operator substituted by the Bhatnagar Gross Krook (BGK) operator [27]. Including an external force term Fi , the lattice BGK (LBGK) equation reads 1 [fi (~x, t) + feq,i (ρ(~x, t), ~u(~x, t))] − δt Fi . τ τ is the dimensionless relaxation time and related to the kinematic viscosity ν by fi (~x + δt c~i , t + δt ) = fi (~x, t) − τ= (2) ν + 1/2c2s δt . c2s δt The lattice √ speed of sound cs is a model-dependent constant. For the D3Q19 model it is cs = 1/ 3. The equilibrium function is therewith given as a so-called low Mach number expansion of the Maxwell distribution function [17],   ci T ~u)2 ~uT ~u c~i T ~u (~ − 2 , (3) feq,i (ρ, ~u) = ρwi 1 + 2 + cs 2c4s 2cs and is valid only for small flow velocities, where the following constraint holds: Ma := ~uT ~u ≪ 1. c2s (4) The external force term Fi is used to represent gravitation (expressed as acceleration ~a) in the simulation. It is given by [26]   c~i − ~u c~i T ~u + 4 ~a. (5) Fi = wi ρ c2s 2cs The local macroscopic quantities, density ρ and fluid momentum ρ~u, are obtained as moments from the PDFs: N −1 X fi , (6) ρ= i=0 3 ρ~u = N −1 X c~i fi . (7) i=0 ρ~u~uT + p1 + S = N −1 X c~i c~i T fi (8) i=0 The last equation contains the momentum flux tensor ρ~u~uT and the stress tensor, where S represents the shear stresses of the flow. For a system in equlibrium, i.e. fi = feq,i (i = 0..N − 1), the stress tensor S vanishes. Within this lattice Boltzmann model, the pressure is linearly related to the density, by the equation p = c2s ρ. (9) When a simulation includes an external force, e.g. in order to simulate the effect of gravity, stability concerns limit the density gradient and therefore the hydrostatic pressure gradient. Buick and Greated [7] give the following incompressibility condition which relates the external force ~a to the projected height of the simulation domain in the force direction. (lx , ly , lz ) · ~a ≪ c2s . (10) fi′ (~x + c~i , t + 1) = fi (~x, t) (11) lx = sδxx , ly = δsxy and lz = δsxz are the respective numbers of fluid cells cells in the x- , y- and z- direction. In practice, the calculation according to the LBGK equation (2) is split up into two steps. First, a propagation step, the stream step, which propagates the local PDFs of each cell along the corresponding lattice link into the neighboring cell. The central one with zero lattice velocity remains on the same cell. Now, in the collide step, the relaxation towards the local equilibrium is performed for each cell with the set fi′ , i = 0, .., N − 1 of PDFs. The external force Fi is added. This yields the PDFs of the succeeding time step. fi (~x, t + 1) = fi′ (~x, t + 1) − 1 ′ [f (~x, t + 1) − feq,i (ρ, ~u)] − Fi . τ i (12) For a step by step derivation of the lattice Boltzmann method see [16]. 2.2. Previous Work: Free Surface LBM The main characteristic of the free surface model given by [21] is that the dynamics of the second phase are neglected. It assumes a system of two immiscible fluids, in which the dynamics of the first phase govern the flow completely. We refer to this first phase as the liquid phase and to the second phase as the gas phase. The layer where the two phases come 4 Figure 2: 2D-Representation of a free liquid-gas boundary by interface cells. The real interface (dashed line) is captured by assigning the interface cells their liquid fraction. in contact - the free surface - is assumed to be thin in relation to the spatial resolution δx . The separate regions of liquid or gas are on the other hand assumed to be large in comparison to δx . With this assumption, one can simulate the liquid phase by modeling the free surface as a special boundary condition. By means of a volume of fluid approach that introduces a dynamic fill level φ(~x, t) for each lattice cell, partial filling is allowed for cells at the free surface boundary. The fill level is the fraction of cell volume δx3 that is currently filled with liquid, such that the liquid mass in a cell may be calculated as m(~x, t) = φ(~x, t) · ρ(~x, t)δx3 . Cells that have a liquid fraction φ < 1 and φ > 0 thus form a boundary for the fluid referred to as the interface, and need special treatment, which is outlined in the following. We refer to those cells as interface cells. Fig. 2 shows the interface layer between liquid and gas for a virtual free surface, drawn as a dashed line. During the stream step, the fill level may change due to the exchange of PDFs with neighboring cells. The mass balance between two neighboring cells, ~x and ~x + c~i , is given by   if ~x + c~i is gas, 0 ∆mi = fī (~x + c~i , t) − fi (~x, t) (13) if ~x + c~i is liquid,  1 (φ(~x, t) + φ(~x + c~i , t)) · (fī (~x + c~i , t) − fi (~x, t)) if ~x + c~i is interface. 2 The interface must further fulfill the characteristic of a free surface boundary. Because the gas flow is neglected in the model, only the pressure of the gas is taken into account at the interface between the two phases. Apart from that, the interface must freely follow the liquid flow, which is provided by a special free surface boundary condition. Assuming that an approximated normal vector ~n(~x, t) of the free surface is known for the interface cell at position ~x, the PDFs fi with c~i T ~n ≤ 0 (pointing towards the liquid phase) are set to fi′ (~x, t + 1) = feq,i (ρG (~x), ~u(~x)) + feq,ī (ρG (~x), ~u(~x)) − fī′ (~x, t + 1) (14) during the stream step. Here ρG (x) is chosen such that by Eq. 9 it matches the pressure pG of the gas phase, which must be given. Indeed, Körner et al. [21] show that this results in a zero strain rate tensor for the boundary. This can be seen by substituting the reconstructed PDFs from Eq. 14 into the formula for the momentum flux and stress tensor, i.e., the second 5 order moment (Eq. 8) of the PDFs: X ρ~u~uT + p1 + S = c~i c~i T fi′ (~x, t + 1)+ i,~ ci T ~ n>0 X   c~i c~i T feq,i (ρG , ~u) + feq,ī (ρG , ~u) − fī′ (~x, t + 1) X   c~i c~i T feq,i (ρG , ~u) + feq,ī (ρG , ~u) i, c~i T ~ n≤0 = i, c~i T ~ n≤0 = N −1 X c~i c~i T feq,i (ρG , ~u). i=0 Because the last sum resembles a system in equilibrium, it follows S = 0 and p = c2s ρG = pG . The normal vector ~n(~x) is obtained as approximation from the gradient of fill levels within a local neighborhood of the cell. It is also possible to include the effect of surface tension directly in the boundary condition above. If a constant surface tension parameter σ is given and the local curvature of the interface κ(~x, t) is known, the gas pressure is augmented by the Laplace pressure to p′G = pG + 2σκ. Pohl [30] proposed a method for 3D-calculations that include surface tension. His approach is, to extract the local curvature κ from the surface normals in a local neighborhood as a second step after the normal computation. In order to allow free advection of the free boundary between gas and liquid, the state of the interface cells must be tracked carefully. Since the interface cells represent a boundary for the LBM scheme, it is necessary to assure a closed layer of interface cells around the liquid cells. This is facilitated by a set of cell conversion rules. Thus, no direct state transition between gas and liquid is allowed. If an interface cell reaches a fill level φ(~x) ≤ −ǫ or φ(~x) ≥ 1 + ǫ it is converted into a gas cell or a liquid cell, respectively. Since such a conversion could introduce holes in the interface, further cell conversions from either gas or liquid into interface cells may be triggered. The newly generated interface cells are initialized with a fill level φ = 0 or φ = 1, respectively. This cell conversion scheme has to be extended for the incorporation of floating objects, as shown in Sec. 2.4. 2.3. Previous Work: Particulate Flow LBM Walls and other solid obstacles that block the fluid motion must be handled with appropriate boundary conditions. For this paper we assume that all solid boundaries can be modeled by a no-slip condition, i.e. the relative motion of the liquid at the boundary is zero. This can be achieved by reflecting distribution functions, that are hitting an obstacle cell during the stream step, to the opposed direction. If fī (~x) is given with an obstacle cell at ~x + ~cī it is bounced back according to fi′ (~x, t + 1) = fī (~x, t) + 6 2 wi c~i T ~uw ρ, c2s (15) Figure 3: A box-shaped rigid body mapped into the lattice. With a free surface flow, four different cell types have to be distinguished: Liquid, interface, gas and obstacle. where ~uw is the velocity of the obstacle. The second term on the right hand side accelerates the fluid according to the movement of the wall [22]. If the solid is not moving (~uw = ~0), this term will vanish, and the boundary handling is reduced to a pure reflection. From the boundary condition of Eq. 15 one can directly obtain the stresses exerted on the boundary. This is known as momentum exchange [22, 23, 28] in literature. The momentum transferred to the wall must equal the change of momentum which results from the reflection of the PDF, since elastic collisions are assumed. Thus, for a fī reflected to fi′ by Eq. 15, the change in momentum is 1 ci (fī + 2 wi c~i T ~uw ). ∆~ji = fi′ c~i − fī~cī = 2~ cs (16) The simulation of immersed rigid bodies behaving according to Newtonian physics is facilitated by discretizing the shape of a body to the lattice. For every time step the no-slip boundary is set according to the object position and orientation. If the center of a cell is a point within the volume represented by the shape of the body, it is treated as an obstacle cell (Fig. 3). The movement of the rigid bodies resulting from the stresses, Eq. 16, including the resolution of body-body collisions, is realized in practice by coupling the lattice Boltzmann algorithm to a rigid body physics engine as in [20, 11]. The resulting body motion is then fed back to the fluid simulation by setting the boundary condition according to Eq. 15 in the cells covered by the obstacle. Hereby u~w is given by the velocity of the body. A given particle must behave according to the stresses exerted by the fluid. The net force and torque on the particle are obtained from the momentum flux according to Eq. 16, summed over the discretized particle surface. Let No be the set of grid points ~x next to the discretized particle surface. For a cell ~x ∈ No , let Io (~x) be the set of indices i ∈ Io (~x), where ∆~ji (~x) is defined due to a reflection of PDFs as stated above. Then the discrete surface integrals for force F~net and torque T~ , respectively, are given by F~net = X X ~ x∈No i∈Io (~ x) T~ = X X ~ x∈No i∈Io (~ x) δx ∆~ji (~x) · , δt δx (~x − ~o) × ∆~ji (~x) · . δt 7 (17) (18) Obstacle Liquid Interface Gas Free Surface Conversions Figure 4: Allowed state transitions for cell types. With moving obstacles the number of transitions increases from four to ten. The free surface type conversions are framed by a dotted line. The dashed arrows indicate critical state changes from solid to fluid. In the latter sum, ~o is the center of gravity of the object. A non-zero torque acting on a freely moving rigid body will induce rotational movement of the body. The momentum exchange method has become a kind of quasi-standard for the simulation of particle suspensions with Lattice Boltzmann and it has been mentioned in a large number of publications with only slight modifications. The main difference here to the works of Ladd [22, 23] or Aidun et al. [3, 4] is, that in our case the obstacle cells are always fluid blocking nodes. In the mentioned references there are “virtual” fluid nodes inside the discretized object shapes, which can be reactivated when uncovered by from the object. This approach, however, would be difficult to maintain in the presence of a liquid-gas flow, since it is unclear how the liquid-gas interface would have to be treated when intersecting with the volume of a particle. 2.4. A Liquid-Gas-Solid LBM With the free surface model of Sec. 2.2 and the additional presence of moving obstacles from Sec 2.3, there are now two different boundaries for the liquid phase that must be treated dynamically. Fig. 3 illustrates the situation for a box floating on the free surface of a liquid, simulated according to Sec. 2.2. Since there are now four different types of cell states to consider (liquid, interface, gas, and solid) that may change according to fluid flow and object movement, the need for a sophisticated cell conversion algorithm arises. In the following, we show that these conversions can be organized in such a way that a consistent boundary around the liquid phase is assured in every time step. Fig. 4 shows that the total number of conversions consists of ten state transitions. The transitions at the bottom are those of the advection scheme of the free surface model of Sec. 2.2 and need no further examination. The remaining transitions arise from the mapping of the solid to the grid. We assume the velocity of the object is small enough for conversions into obstacle to occur only at positions in the neighborhood of other obstacle cells; while conversions from obstacle to one of the three fluid states (liquid, interface or gas) can occur only at positions in the neighborhood of fluid cells. This is no additional limitation, but a direct consequence of the low Mach number limitation of the lattice Boltzmann scheme. Consider now an object penetrating the free surface as shown in Fig. 3. While conversions into obstacle cells are generally safe, the conversions from obstacle into fluid could lead to invalid lattice configurations with holes in the interface layer. Thus the correct cell type, i.e., liquid, interface or gas, needs to be determined such that a valid lattice configuration 8 is adhered for the next time step. This is achieved by an update rule based on the local neighborhood of a given obstacle cell. We define the non-obstacle neighborhood of a cell as B(~x) := {~x+~ ci | ~x+~ ci is no obstacle}. For a prior obstacle cell ~x to be converted into fluid, the state is determined as follows [5]. • B(~x) contains no liquid: ~x is converted into gas. • B(~x) contains no gas: ~x is converted to liquid, ρ(~x) is interpolated from B(~x), and the fi (~x) are set to feq,i (ρ(~x), ~uw ), where ~uw is the velocity of the point on the object’s surface, which is closest to the cell center of ~x. • B(~x) contains liquid and gas: ~x is converted into interface. ρ(~x) is interpolated from the non-gas cells in B(~x), and the fi (~x) are set as in the preceding case. Additionally a fill level φ(x) is chosen by interpolation of the fill levels of the interface cells in B(~x). It is also possible to include the gas cells with the pressure ρG in the interpolation of ρ, since pressure can be seen as a continuous quantity across the free surface boundary of Eq. 14. With the free surface model of Sec. 2.2, the gas phase is only taken into account in terms of a pressure force exerted onto the free surface. This pressure forces, however, are also acting on the surface of the solid bodies. So, in analogy to the boundary condition for the free surface, Eq. 14, we use the equilibrium function, Eq. 3, to construct PDFs feq,i (ρG , ~0) for the lattice links from gas, or interface cells to the obstacle cell of an object. From these the momentum transferred to the body can be calculated from Eq. 16. The value of the constructed PDF is linearly interpolated with the liquid’s distribution function fi . Thus, in presence of gas in the neighborhood of an obstacle cell, the momentum acting on the body locally is given by   φ T ~ ~ ∆ji = 2~ci φ · fī + (1 − φ) · feq,i (ρG , 0) + 2 wi c~i ~uw . (19) cs For a gas cell, φ = 0, only the equilibrium function of Eq. 16 remains, all other parts vanish. 3. Simulation of Floating Bodies In the following sections we present the results of calculations performed with the method of Sec. 2.4, i.e., various simulations of a rigid body exposed to a free surface flow. Since many details of the method are owed to previous particulate flow simulations, we briefly recapitulate the most relevant results in Sec. 3.1. We then focus on the evaluation of forces and motion of partially immersed rigid bodies, Sec. 3.2, in order to prove the basic consistency of the method. When dealing with floating objects in gravity-stratified free surface flows, the buoyancy forces on the discretized objects turned out to be one of the main sources of error. In the last part, Sec. 3.3, we apply our method to the problem of floating stability of rigid bodies. 9 3.1. Force Computations with Spherical Particles and Staircase Approximation It has to be emphasized that due to the discretization of the body shapes to lattice sites as described in the previous section, a certain a priori error is introduced. This is a well-known issue in LBM-based particulate flows, and there has been a lot of research regarding the treatment of complex, curved boundaries in lattice Boltzmann over the last decades [31, 2]. These schemes allow second order spatial accuracy in the treatment of curved boundaries. Most of them are directly applicable for moving boundaries, such as particles. However, in the kind of flows which we are going to discuss in the final part of the paper, interpolation based schemes like [6], or [35], which have been applied with success to particle simulations in the past, turned out to be little useful. The solid particle model described in Sec. 2.3 which we use throughout this paper is identical to the one used for drag force computations on suspended particle agglomerates in [11, 20], where the net force deviation was studied with spherical particles in stokes flow. The calculations were performed with various degrees of spatial resolution and a set of different lattice relaxation parameters τ in [11] with a sphere fixed to the center of a channel flow. The results were found to be in good agreement with theoretical expectations. Second order boundary conditions surpassed the staircase approximation under all tested circumstances. In [20], sinking sphere simulations were conducted in order to evaluate the method with moving particles as proposed in [1]. These simulations included the influence of gravity, and used the unified boundary treatment by [35] for the solid boundaries: A particle of density ρs > 1 accelerates until the frictional force imposed by the fluid surrounding balances its weight and a terminal sinking velocity is reached. The results showed small periodic oscillations in the measured force on a sphere that moves with a quasi-constant velocity through the lattice. This error can be attributed to the staircase approximation of the boundary of the body. Fig. 5 shows the volume error for a sphere of radius 5 δx when traveling along an axis-aligned path. The number of cells actually covered by the sphere is depending on its exact position relative to the lattice. With the discretized shape of a particle changing, the set of lattice links included in the discrete surface integral around its boundary changes and so does the net force, Eq. 17, and torque, Eq. 18, respectively. The interpolation based schemes applied in [11, 20] however, approximate a curved boundary by calculating its exact distance from the cell center along the lattice link of reflection. This information is used to correct the reflected PDFs from Eq. 15. Hence, the error arising in the buoyancy force from changes in the discrete volume of an object cannot be corrected by purely local refinements. For liqud-solid suspensions without a free surface the problem of buoyancy force fluctuations with fluid-blocking obstacles is usually negligible, or can be corrected by workarounds as reported in [15]. The following subsections discuss this issue for the free surface case. 3.2. Forces on Buoyant Rigid Bodies Due to the staircase approximation of rigid body shapes, not only is the buoyancy force depending on the object’s position, but – for partially immersed objects – a staircase function with respect to draft. This can be best explained for an axis-aligned cube of side length s 10 Volume per timestep volume of discretized sphere 555 550 545 540 535 530 525 520 515 0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 11000 time Figure 5: Discretized volume for a spherical particle traveling along an axis-aligned path with a velocity of 10−4 . Ideal volume: 523.6. The graph repeats periodically every 10000 time steps in a liquid at rest with a constant water level. The buoyant force is then given as a linear function with respect to the draft d: FB = ρgs2 d. Because of the discretization error, d is only exact up to the lattice resolution δx . This can keep buoyant objects from coming to rest at their equilibrium position. Especially for objects with lattice-aligned planar faces such as a cube this would sometimes cause an unphysical “wobbling” behavior with the object jumping between two points slightly below and above the ideal floating position. If on the contrary a fixed cuboid is considered and the gauge of the liquid is varied immersing more or less of the object’s surface, the changes in the buoyant force on the object would be continuous. This is because the volume of fluid-based interface treatment is not limited to the spatial accuracy of the lattice. The fill level is taken into account in the force calculations in the interface cells at the triple line of liquid, gas and solid by Eq. 19. Test cases with a linearly rising water level around a partially immersed, axis-aligned, fixed cuboid led to a linear increase in the buoyant force. 3.2.1. Free Advection Test To test the consistency of the unified liquid-gas-solid algorithm, a free advection test was performed in a channel flow with a constant homogeneous velocity in the laminar regime along the x-direction, and a gravitational field along the z-axis. A spherical particle of density ρs = 0.5 was placed freely floating in the center of the channel to be accelerated by the hydrodynamic forces acting on its surface. Fig. 6 gives an impression of the simulated setup. Because the gas phase is neglected in the model it must not hinder the particle motion in any way. This means, that in both cases the final velocity of the particle must equal the fluid velocity. After the systematic drag force evaluation cited in the preceeding section, this test might seem trivial at the first spot. But in the presence of a density gradient and because of the changes in the discretized particle shape (Sec. 3.1), there are at least two important sources of error to consider. Hence, in the following we also examine the results at critical flow velocities that have the same order of magnitude as the expected errors. The channel size measured 60 × 40 × 30 lattice units, and the particle diameter was 12δx . All long sides of the channel were no-slip moving walls (Eq. 15), in order to obtain a homogeneous velocity profile across the domain with a constant flow velocity u along the 11 Figure 6: Schematic view for a free advection test with a floating sphere in laminar free surface flow. The channel is driven by a moving wall boundary condition at the bottom and its longitudinal side planes. The channel entry and outflow are connected with each other by means of a periodic boundary condition. x-axis. The left (x = 0) - and right (x = sx ) - boundaries were connected periodically, by copying PDFs streamed outside at one end into the cells at the opposing end of the domain. The whole process of testing was performed at four different values of τ1..4 , namely 0.62, 0.8, 1.1, 1.7 a gravitational constant of g = 10−5 , and four different channel velocities u1..4 = 10−4 , 5 · 10−5 , 2.5 · 10−5 , 1 · 10−5 . In order to check for possible sources of errors the scenario was run in a sequence of increasing complexity, starting with a simplified version of the simulation experiment. The first series were the following. • Channel fully filled with liquid without gas; without gravitational field. • Repetition without gas, but with gravitational field as stated above. The particle density was set to 1.0 in this case. In the first run the particle velocity matched the liquid velocity to the last digit without any deviations. For the second run we were expecting errors due to oscillations in the buoyant force as described above. These were clearly measurable, and largest for the lowest lattice viscosity τ1 = 0.62, where the z-component of the object velocity oscillated within the interval [−g, +g]. For larger τ values the effect would be damped (e.g., by a factor of 0.1 in the case of τ4 ). There were no significant deviations in the other velocity components of the particle. The next test series consisted of the channel partially filled with liquid with a planar free surface at z = 19.5 under the influence of gravity. The particle was removed to check the behavior of the interface cells. The free surface remained planar under all tested circumstances, as expected. For the lowest value of τ = 0.62, locally spurious interface velocities were occuring. However, the absolute deviation from the bulk viscosity was always below 10−5 , restricted locally to parts of the interfacial layer, and therewith only critical for low velocities. We finally tested the advection of a solid body in the free surface flow by placing the particle with density ρs = 0.5 inside the channel. The fluctuations in the lifting force were comparable to those measured in the all-liquid domain under gravity with all tested cases. However, here the error also became visible in the in the other components of the net force on the object, and thus introduced an error in the streaming velocity of the particle. We believe that this is caused by the errors introduced by the refilling step of the algorithm, when obstacle-to-fluid conversions occur for an object sticking through the interface layer. As described in Sec. 2.4, we initialize these cells to a local equilibrium with parameters interpolated from a local neighborhood. This is likely to introduce a certain error that cannot 12 be balanced in the asymmetrical case when an obstacle is at the boundary between gas and liquid. Even in case of liquid-solid flows without a gas phase, the problem of initializing new liquid cells is non-trivial [8]. We have not evaluated those cases, where the empty channel showed spurious currents. These were: τ1 = 0.62 with velocities u2 , .., u3 . In the remaining cases the sphere would follow the current with the velocities given in Tab. 1. For higher flow velocities (or lower values of g), this error would no longer be critical, if even apparent in the sphere velocities. Table 1: Errors in the velocity of the sphere for lattice gravity of g = 10−5 : Critical if τ is low and the characteristic flow velocity of the same order as g. τ u1 u2 u3 u4 0.62 1.1e-4 n.e. n.e. n.e. 0.8 1.05e-4 5.5e-5 3.0e-5 2.0e-5 1.1 1.01e-4 5.15e-5 2.8e-5 1.3e-5 1.7 1.e-4 5.05e-5 2.55e-5 1.1e-5 The the systematic error in the staircase approximated objects is negligible as long as the characteristic velocity U of the flow is large in comparison with the gravitational√constant. However, it should be considered in the Froude number scaling [19] (F r = U/ gL, for a characteristic length L) of simulations. On the other hand the question arises, whether a more accurate treatment of particle boundaries can be achieved that does not suffer from the presence of a hydrostatic density gradient. We were unable to find any literature that reports the problem explicitly. Besides increasing the spatial resolution, or applying local grid refinement methods that entail complex restructuring of the whole implementation of the method, we found at least one approach that could provide a significant improvement. Based originally on Chen et al., a volumetric interpretation [9] of the lattice Boltzmann method allows the direct calculation of the momentum flux onto finite surface elements. This can be exploited to realize boundary conditions, like [10, 34, 32], that offer sub-grid scale accuracy. [32] presented a variant that allows an exact description of the surface of obstacles including surface stress calculation which is independent of surface motion. As the free surface boundary treatment, Eq 14, is in principle also a volumetric approach [21], this would yield a further unification of the method described in this paper. We expect to explore this issue in future publications. 3.3. Stability of Floating Bodies We now apply the method on the problem of floating stability of non-spherical rigid bodies. Archimedean law appears to be quite intuitive, which states that the buoyancy experienced by an immersed object is equal to the weight of the liquid displaced by ∇, the immersed volume part of the body (i.e., the part below the water plane). According to that rule, a body with a specific material density ρs < 1.0 will sink down or rise up until buoyant force F~B = ρg∇ and gravitational force F~G balance each other vertically. In practice, however, even if this balance of forces is given, the resulting equilibrium is often found to be unstable. Consider for instance a cube in 2-D as shown in Fig. 7. In both positions exactly 13 Figure 7: For both positions of the cube of specific density ρs = 1/2 hydrostatic equilibrium is given. However the equilibrium on the left hand side is unstable. A stable equilibrium can be found with the cube rotated 45 degrees. Figure 8: Stable floating positions for a cube of material density ρs = 1/4 (left) and ρs = 3/4 (right), respectively. Each time one corner of the cube is in place with the water line while another one is exactly half-immersed. Figure 9: Unstable equilibrium of a cube. Because of the slight horizontal displacement of the center of buoyancy B relative to the center of gravity of the cube G, a moment occurs that pushes the cube further from its upright position. The center of buoyancy B is constructed as the center of gravity of the trapezoid, which the immersed part of the cube makes up together with the fluid surface. To construct B, the base line segment u is elongated in one direction by the parallel opposite segment v, while the latter is again elongated in the opposite direction by base line u. Next, the shifted end points of each line segment are connected. The intersection of the connecting line with the line through the midpoints of u and v gives its center of gravity of the trapezoid, B. 14 Figure 10: Box rotating about its longitudinal axis (rolling motion). half of the body volume is immersed and thus the body floats in hydrostatic equilibrium. However, it can be shown that only the right hand side with an heel angle of 45 degrees is stable. To see this, consider the cube slightly rotated from its upright position, such that its central axis (dashed line in Fig. 7) is heeled by a small angle α. The center of gravity G of the cube is the point on which the gravitational force F~G acts vertically downward. The center of buoyancy B, which is defined as the center of gravity of the immersed part ∇ of the body, is slightly displaced to the left as shown in Fig 9. Thus with F~B acting on B vertically upward, a rotational moment in the heeling direction occurs, pushing the cube further from its upright position. In the same way it can be shown that, starting from the 45 degree rotated position (right in Fig 7), small angles of heel from this position lead to a righting moment in the opposite direction. The result is a stable equilibrium at this position. Fig. 8 shows two more stable floating positions for the cube densities ρs = 1/4 and ρs = 3/4. 3.3.1. Equilibrium Position of Floating Cubes Following [14], we check the rotational equilibrium of floating cubes of density ρs = 0.25, 0.5, and 0.75 in simulations. With the given densities 0.25 and 0.75 a stable angle of heel is found at 26.565◦ from the upright axis of the cube as shown in Fig. 8. The cube of density 0.5 should calibrate to 45◦ . Since we are dealing with 3-dimensional objects, the 2D cube of side length s is represented by a cuboid of dimensions 2s × s × s, that will rotate around its longitudinal axis only, as in the schematic of Fig. 10. Inside a domain of 130 × 40 × 40 cells, the lower half was filled liquid with lattice viscosity τ = 1/1.9 = 0.526 and initialized with hydrostatic pressure (g = 7.5 · 10−4 ). Three boxes with s = 16 were placed inside the basin, slightly heeled from their axis-aligned upright position by an angle of 2.86◦ . The simulation was run until all fluid motions ceased and the objects came to rest. Fig. 11 shows visualizations of the simulated scenario at various time steps. Since the initial positions of the objects were far from the equilibrium state, their motions would cause a wavy disturbance of the liquid in the basin. It can be clearly seen from these visualizations that even at this low resolution a strong convergence towards the ideal equilibrium was given. 3.3.2. Righting Stability Moment of Wall-Sided Structures Consider again a floating structure heeled about a certain angle α about its upright axis. The intersection of the line with direction F~B through B with the upright axis of a body is defined as the metacenter M. If M lies above the center of gravity G then the floating position of the body will be stable, otherwise unstable (see Fig. 9). This concept originates from marine engineering and is commonly used in the characterization the floating stability of ships and other offshore structures. A comprehensive discussion can be found in [19]. The 15 Figure 11: Box objects of density 0.75, 0.5 and 0.25, respectively, striving towards vertical and rotational equilibrium. The first three pictures show the system in motion. The last picture was taken after all visible motions had ceased. All snapshots were visualized from simulation output with the ray tracer [29]. 16 lever arm of the torque arising from the horizontal displacement of the mass centers B and G is given by GM sin α, and hence the righting stability moment of the body can be calculated as ms = F~B · GM sin α. The curve ms (α) = F~B · GM sin α is called the stability curve of the floating object. This curve can be derived analytically for many relevant situations, depending on the shape of the immersed structure. An important case is that of a wall-sided structure, where the points of the structure’s surface sinking under or rising above the water plane upon the considered angles of heel are parallel opposing sides when the structure is upright. If a wall-sided structure is given, then, according to [19, 12], the Scribanti formula states B0 M = 1 I · (1 + tan2 α), ∇ 2 where B0 is the center of buoyancy of the upright position, I is the moment of inertia of the water plane and ∇ stands for the immersed volume of the whole body. In case of a cuboid of length l, width b, height h and draft d (= ρs · h – obtained from the non-heeled position), the formula can be simplified by putting I 1 b2 = , ∇ 12 d and with K as the keel point of the cuboid, an expression for GM can be introduced as GM = KB0 + B0 M − KG. From this, the ideal stability curve of an arbitrary cuboid can be calculated. Fig. 12 shows the schematic stability curves for some cuboid structures of density ρs = 1/2 and various width:height ratio. In case of a cube, the stability curve has a negative slope at the origin. This shows, that the upright position is an unstable equilibrium. Increased width yields a higher floating stability. To further test the force calculation on floating bodies, the righting stability moment of a floating cube at different angles of heel was measured in lattice Boltzmann simulations and compared to the ideal stability curve of the structure. In all of the following cases, the gravitational constant was chosen to be g = 10−4 and a partially filled basin was initialized with a pressure gradient according to hydrostatic equilibrium. The relaxation time was τ = 1.0. The initial width to height ratio of the box was 6 : 4 (a), and then in a second pass a lower ratio of 5 : 4 (b) was chosen. Each time, the error was examined at three different resolutions, i.e., the box size (b × h) in lattice units was 24 × 16, 48 × 32, 96 × 64 and 20 × 16, 40 × 32, 80 × 64, respectively. The length side along the axis of rotation was always chosen as l = 2h. The box was positioned axis-aligned with the lattice, exactly half-immersed relative to the free surface plane. During the simulation, the box was fixed to a constant position and the angle of heel of the half-immersed box was varied with α in 0◦ ..30◦ around the longitudinal axis of the box through its center of gravity. 17 Figure 12: Stability curves for various floating cuboids of density 1/2. From the negative slope of the graph for the cube case (width:height ratio 4 : 4) at 0◦ angle of heel, it can be deduced that the upright position is unstable. The stability increases if the width is enlarged. Figure 13: Stability curve of a heeled cuboid at different resolutions dx = 1, 0.5, 0.25. The legend reads the width of the box in lattice units at the different resolutions. There are significantly less deviations in the torque of the more stable box of width per height ratio 6:3 (a) compared to the box shape of ratio 5:4 (b). (a) width:height = 6:4 (b) width:heigh = 5:4 ideal 24 dx 48 dx 96 dx 0,8 ideal 20 dx 40 dx 80 dx 0,25 0,2 Torque Torque 0,6 0,4 0,15 0,1 0,05 0,2 0 0,0 0 5 10 15 Heeling Angle 20 25 30 0 18 5 10 15 Time 20 25 30 Fig. 13 shows the simulation results compared to the ideal stability curve. The error was much larger in the second case (b), since the stability lever arm of the box is shorter at the lower width per height ratio. Thus even small errors in the box discretization have a visible influence on the behavior of the box. However, in all cases it can be seen that the errors are decreasing at higher resolutions. Convergence towards the ideal values was clearly given. 4. Conclusion In this paper we described a method for the simulation of liquid-gas-solid flows by means of the lattice Boltzmann method. Based on previous works, the momentum exchange method is used to obtain fluid stresses at the surface of rigid bodies, which allows to calculate the resulting net force and torque. A novel set of cell conversion rules (Sec. 2.4) allows unrestricted movement of the solid bodies within the domain, including penetrations of the free surface. We demonstrated the consistency of the method in a free advection test with a particle following a homogeneous free surface channel flow under the influence of gravity in Sec. 3.2. For further validation of force and torque calculations on non-spherical rigid bodies, we applied the method to the classic mechanical problem of floating stability of immersed structures. Basic convergence towards the equlibrium state was successfully checked for the case of box objects with square sides. We took advantage of the fundamental stability formulae for wall-sided structures and validated the righting moment of box shaped objects under varying angles heel. The results were found to converge towards the ideal values with increased spatial resolution. As a next step it would be interesting to move on from these hydrostatic stability examples towards dynamic ones, that include coupled interaction of liquid and solid objects. We will present further results together with method improvements in future publications. 5. Acknowledgements For the simulations presented in this paper, the waLBerla lattice Boltzmann framework [25] and the pe rigid body phisics engine [24] have been used. These software projects are a collaborative effort of the Chair for System Simulation at the University of ErlangenNürnberg. The author would like to thank Jan Götz, Dr. Klaus Iglberger, Daniela Anderl, Dr. Stefan Donath, Matthias Markl, Tobias Preclik and Florian Schornbaum for various discussions and corrections. Finally, many thanks go to Dr. Christian Janßen for his kind correspondence via electronic mail. References [1] C. K. Aidun, Y. Lu, and E.-J. Ding. Direct analysis of particulate suspensions with inertia using the discrete boltzmann equation. J. Fluid Mech, 373, 1998. 19 [2] Cyrus K. Aidun and Jonathan R. Clausen. Lattice-boltzmann method for complex flows. Annu. Rev. Fluid Mech., 42, 2010. [3] Cyrus K. Aidun and Yannan Lu. Lattice boltzmann simulation of solid particles suspended in fluid. Journal of Statistical Physics, 81 (1/2), 1995. [4] Cyrus K. Aidun and Yannan Lu. Extension of the lbm for direct simulation of suspended particles near contact. Journal of Statistical Physics, 112 (3/4), 2003. [5] S. Bogner. Simulation of floating objects in free-surface flows. Master’s thesis, University of Erlangen-Nuremberg, Lehrstuhl für Informatik 10 (Systemsimulation), Institut für Informatik, 2009. [6] M. Bouzidi, M. Firdaouss, and P. Lallemand. Momentum transfer of a boltzmann-lattice fluid with boundaries. Physics of Fluids, 13(11), 2001. [7] J.M. Buick and C.A. Greated. Gravity in a lattice boltzmann model. Phys. Rev. E, 61(5), 2000. [8] A. Caiazzo. Analysis of lattice boltzmann nodes initialization in moving boundary problems. Progress in Computational Fluid Dynamics, 8 (1-4):3, 2008. [9] Hudong Chen. Volumetric formulation of the lattice boltzmann method for fluid dynamics: Basic concept. Physical Review E, 58(3), 1998. [10] Hudong Chen, Chris Teixeira, and Kim Molvig. Realization of fluid boundary conditions via discrete boltzmann dynamics. International Journal of Modern Physics C, 9(8), 1998. [11] Binder Christian, Feichtinger Christian, Schmid Hans-Joachim, Thürey Nils, Peukert Wolfgang, and Rüde Ulrich. Simulation of the hydrodynamic drag of aggregated particles. Journal of Colloid and Interface Science, 301, 2006. [12] Captain D.R. Derrett and C.B. Barrass. Ship Stability for Masters and Mates. Butterworth-Heinemann, 1999 (1964). 5th edition. [13] G. Fekken, A.E.P. Veldman, and B. Buchner. Simulation of green water loading using the navier-stokes equations. In J. Piquet, editor, Proceedings 7th International Conference on Numerical Ship Hydrodynamics, 1999. [14] Geert Fekken. Numerical Simulation of Free-Surface Flow with Moving Rigid Bodies. PhD thesis, Rijksuniversiteit Groningen, 2004. [15] Jan Goetz. Massively Parallel Direct Numerical Simulation of Particulate Flows. PhD thesis, University of Erlangen-Nuremberg, 2011. [16] Dieter Hänel. Molekulare Gasdynamik. Springer, 2004. german. 20 [17] X. He and L.-S. Luo. Theory of the lattice boltzmann method: From the boltzmann equation to the lattice boltzmann equation. Phys. Rev. E, 56(6), 1997. [18] Christian Janßen. Kinetic approaches for the simulation of non-linear free surface flow problems in civil and environmental engineering. PhD thesis, Technische Universität Braunschweig, 2010. [19] J.M.J. Journée and W.W. Massie. Offshore Hydromechanics. Delft University of Technology, 2001. http://www.shipmotions.nl. [20] Iglberger Klaus, Thürey Nils, and Rüde Ulrich. Simulation of moving particles in 3d with the lattice boltzmann method. Computers and Mathematics with Applications, 55 (7), 2008. [21] C. Körner, M. Thies, T. Hofmann, N. Thürey, and U. Rüde. Lattice boltzmann model for free surface flow for modeling foaming. Journal of Statistical Physics, 121 (1/2), 2005. [22] A.J.C. Ladd. Numerical simulations of particulate suspensions via a discretized boltzmann equation part i. theoretical foundation. Lawrence Livermore National Laboratory, 1993. [23] A.J.C. Ladd. Numerical simulations of particulate suspensions via a discretized boltzmann equation part ii. numerical results. Lawrence Livermore National Laboratory, 2007. [24] University of Erlangen-Nuremberg Lehrstuhl für matik 10. pe - rigid body physics engine, 2005-2011. http://www10.informatik.uni-erlangen.de/Research/Projects/pe/. InforURL [25] University of Erlangen-Nuremberg Lehrstuhl für Informatik 10. walberla lattice boltzmann framework, 2006-2011. URL http://www10.informatik.uni-erlangen.de/de/Research/Projects/walberla/. [26] L.-S. Luo. Unified theory of lattice boltzmann models for nonideal gases. Phys. Rev. Lett., 81(8), 1998. [27] L.-S. Luo. Theory of the lattice boltzmann method: Lattice boltzmann models for nonideal gases. Phys. Rev. E, 62(4), 2000. [28] R. Mei, D. Yu, W. Shyy, and L.-S. Luo. Force evaluation in the lattice boltzmann method involving curved geometry. Physical Review E., 65, 2002. [29] Persistence of Vision Pty. Ltd. http://www.povray.org. Persistence of vision (tm) raytracer, 2004. [30] T. Pohl. High Performance Simulation of Free Surface Flows Using the Lattice Boltzmann Method. PhD thesis, University of Erlangen-Nuremberg, 2007. 21 [31] Mei R., Shyy W., Yu D., and Luo L-S. Lattice boltzmann method for 3-d flows with curved boundary. Journal of Computational Physics, 161, 2000. [32] M. Rhode, J.J. Derksen, and H.E.A. Van den Akker. Volumetric method for calculating the flow around moving objects in lattice-boltzmann schemes. Physical Review E., 65, 2002. [33] Sauro Succi. The Lattice Boltzmann Equation for Fluid Dynamics and Beyond. Oxford Science Publications, 2001. [34] R. Verberg and A.J.C. Ladd. Lattice-boltzmann model with sub-grid-scale boundary conditions. Physical Review Letters, 84(10):2148, 2000. [35] D. Yu, R. Mei, and W. Shyy. A unified boundary treatment in lattice boltzmann. In 41st Aerospace Sciences Meeting & Exhibit. American Institute of Aeronautics and Astronautics, Inc., 2003. 22
5cs.CE
arXiv:1606.08708v1 [cs.PL] 25 Jun 2016 Domain Specific Language for Modular Knitting Pattern Definitions: Purl Chelsea Battell McMaster University April 2014 Contents 1 2 Introduction 1 1.1 Knitting Pattern Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1.1 Verification Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.2 Purl Compiler Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.3 Error Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Elements of Knitting 7 2.1 Cast-On . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.1.1 AST Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.1.2 Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.1.3 HTML Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Pick-Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.2.1 AST Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.2.2 Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 2.2.3 HTML Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Row . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.3.1 AST Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.3.2 Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.3.3 HTML Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Row Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.4.1 19 2.2 2.3 2.4 AST Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2.4.2 Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Basic Stitches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.5.1 AST Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2.5.2 Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 2.5.3 HTML Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Compound Stitch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 2.6.1 AST Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 2.6.2 Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 2.6.3 HTML Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Fixed Stitch Repeat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 2.7.1 AST Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 2.7.2 Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 2.7.3 HTML Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Undetermined Stitch Repeat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 2.8.1 AST Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 2.8.2 Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 2.8.3 HTML Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Bind-Off . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 2.9.1 AST Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 2.9.2 Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 2.9.3 HTML Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 2.10 Join . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 2.10.1 AST Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 2.10.2 Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 2.10.3 HTML Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 2.11 Pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 2.11.1 AST Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 2.11.2 Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 2.5 2.6 2.7 2.8 2.9 2 3 4 5 2.11.3 HTML Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 2.12 Pattern Body . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 2.12.1 AST Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 2.12.2 HTML Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 2.13 Row Repeats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 2.13.1 AST Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 2.13.2 HTML Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 2.14 Pattern Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 2.14.1 AST Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 2.14.2 Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 2.14.3 HTML Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 2.15 Pattern Sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 2.15.1 Sample Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 2.15.2 Sample Call . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 2.16 Root . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 2.16.1 AST Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 2.16.2 HTML Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Lexical Analysis 69 3.1 Parser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 3.1.1 Pass 1: AST Construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 3.1.2 Pass 2: Sample Substitution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 3.1.3 Pass 3: Pattern Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 Code Generation 83 4.1 83 HTML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Discussion 88 Appendices 89 3 A Extra Productions 90 A.1 Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 A.2 Condition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 B Compiler Types 95 B.1 Parser Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 B.2 Symbol Lookup Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 C Built-In Examples and Tests 100 D Test Page DOM 108 E Style Sheets 112 E.1 Test Page Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 E.2 Target Language Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 4 Purl is a language to be used for modular definition and verification of knitting patterns. The syntax is similar to the standard knitting pattern notation provided by the Craft Yarn Council (see [1]). Purl provides constructs not available in the standard notation to allow reuse of segments of patterns. This report was written using the literate programming (see [6]) tool Literate Programming for Eclipse (LEP, see [5]). The compiler source code, and HTML and CSS for a web page with rudimentary IDE for Purl are “tangled” by the LEP plugin in the Eclipse IDE [2]. 1 Introduction Knitting is a process by which a strand of yarn can be turned into flexible fabric. Patterns are written to record knitting designs and techniques. Simple project patterns using only a few different stitches may be shared orally, but to knit more complicated objects it becomes necessary to document these instructions. The earliest known example of an object being knit using stitches other than the knit stitch dates from the 16th century (purl stitch and yarn over, see [7]). A popular and once standard instruction reference for knitting [4] written in 1886 lists 12 stitches. The stitch reference [9] published in the last five years lists 30 stitches basic (not all included in this project). Improvements in pattern documentation techniques and tools is both necessary for, and conducive to, increased complexity and innovation in knitting patterns. Patterns are typically written according to the standard [1], and may include extra information, such as the number of active stitches that should be on the needles at the end of each row. This extra information guides the knitter to help avoid mistakes, but this assumes that the pattern has no errors. In the most common case (not including industrial settings), for every pattern written, a pattern designer has to experiment and perform many tedious computations to make sure their pattern is correct. Also, even though segments of a pattern may be reused in many others, they are rewritten in each new pattern. This project implements a compiler for a language called Purl. The syntax is similar to the standard knitting pattern notation [1]. Purl has features to increase reusability of segments of knitting patterns. The compiler performs automatic verification of the number of stitches in each row and displays this guiding information in the output pattern. 1.1 Knitting Pattern Example Below is a knitting pattern for a bag [8] in the standard notation. This pattern is broken into two sections: body and handle. Each section begins with how to add the initial stitches to the needle (cast-on for the body, pick-up stitches for the handles). The rows of the pattern are defined next, and each section ends with either a bind-off or a join. A single asterisk means to repeat stitches as directed. Two asterisks means to repeat the rows betwen the double asterisk and the row repeat instructions. Market Bag 1 Body Cast −on 8 s t s c i r c u l a r . Rnd Rnd Rnd Rnd Rnd Rnd Rnd Rnd Rnd Rnd Rnd Rnd Rnd Rnd Rnd Rnd Rnd Rnd Rnd Rnd Rnd Rnd Rnd Rnd 1 ( RS ) : 2 ( RS ) : 3 ( RS ) : 4 ( RS ) : 5 ( RS ) : 6 ( RS ) : 7 ( RS ) : 8 ( RS ) : 9 ( RS ) : 10 ( RS ) 11 ( RS ) 12 ( RS ) 13 ( RS ) 14 ( RS ) 15 ( RS ) 16 ( RS ) 17 ( RS ) 18 ( RS ) 19 ( RS ) 20 ( RS ) 21 ( RS ) 22 ( RS ) 23 ( RS ) 24 ( RS ) ∗K, yo , K ; rep from ∗ t o end . ∗K ; rep from ∗ t o end . (K, yo , K, yo , K) 4 t im es . ∗K ; rep from ∗ t o end . (K, yo , K3 , yo , K) 4 t im es . ∗K ; rep from ∗ t o end . (K, yo , K5 , yo , K) 4 t im es . ∗K ; rep from ∗ t o end . (K, yo , K7 , yo , K) 4 t im es . : ∗K ; rep from ∗ t o end . : (K, yo , K9 , yo , K) 4 t im es . : ∗K ; rep from ∗ t o end . : (K, yo , K11 , yo , K) 4 t im es . : ∗K ; rep from ∗ t o end . : (K, yo , K13 , yo , K) 4 t im es . : ∗K ; rep from ∗ t o end . : (K, yo , K15 , yo , K) 4 t im es . : ∗K ; rep from ∗ t o end . : (K, yo , K17 , yo , K) 4 t im es . : ∗K ; rep from ∗ t o end . : (K, yo , K19 , yo , K) 4 t im es . : ∗K ; rep from ∗ t o end . : (K, yo , K21 , yo , K) 4 t im es . : ∗K ; rep from ∗ t o end ∗∗ Rnd 25 ( RS ) : ∗ k2tog , yo ; rep from ∗ t o end . Rnd 26 ( RS ) : ∗K ; rep from ∗ t o end . rep from ∗∗ 30 ti me s ∗∗ Rnd 27 (CC) ( RS ) : ∗K ; rep from ∗ t o end . Rnd 28 (CC) ( RS ) : ∗P ; rep from ∗ t o end . rep from ∗∗ 4 ti me s Bind− o f f 100 s t s . Handle Pick −up 10 s t s from body top . ∗∗ Row 1 (CC) ( RS ) : ∗K ; rep from ∗ t o end . Row 2 (CC) (WS) : ∗P ; rep from ∗ t o end . rep from ∗∗ 2 ti me s 2 Row 3 ( RS ) : K, k2tog , K4 , k2tog , K . ∗∗ Row 4 (CC) (WS) : ∗K ; rep from ∗ t o end . Row 5 (CC) ( RS ) : ∗P ; rep from ∗ t o end . rep from ∗∗ 100 ti me s Row 6 (WS) : K, M1, K6 , M1, K . ∗∗ Row 7 (CC) ( RS ) : ∗K ; rep from ∗ t o end . Row 8 (CC) (WS) : ∗P ; rep from ∗ t o end . rep from ∗∗ 2 ti me s J o i n 10 s t s t o o p p o s i t e s i d e o f body top . Pattern Example 1.1: Market Bag The program in Purl to generate this pattern is below. All of the blocks beginning with “sample” are a new construct introduced to increase reusability of parts of knitting patterns. These samples could be used in many other patterns and the definition of the market bag pattern (below the samples) becomes much simpler. sample c i r c l e with n , max | n < max : rnd : [K, YO, K n , YO, K] 4 . rnd : ∗K ; t o end . c i r c l e with n + 2 , max . sample diag onalLa ce with n : ∗∗ rnd : ∗K2T , YO; t o end . rnd : ∗K ; t o end . repeat n sample g a r t e r S t i t c h C C with n , type | type = 0 : ∗∗ row CC : ∗K ; t o end . row CC : ∗P ; t o end . repeat n | type = 1 : ∗∗ 3 rnd CC : ∗K ; t o end . rnd CC : ∗P ; t o end . repeat n p a t t e r n " Market Bag" : s e c t i o n "Body" : CO 8 c i r c u l a r . rnd : ∗K, YO, K ; t o end . rnd : ∗K ; t o end . c i r c l e with 1 , 2 3 . dia gonalLa ce with 3 0 . g a r t e r S t i t c h C C with 4 , 1 . BO 1 0 0 . s e c t i o n " Handle " : PU 10 from "Body top" . g a r t e r S t i t c h C C with 2 , 0 . row : K, K2T , K 4 , K2T , K . g a r t e r S t i t c h C C with 1 0 0 , 0 . row : K, M1, K 6 , M1, K . g a r t e r S t i t c h C C with 2 , 0 . J o i n 10 t o "Body top" . Purl Example 1.2: Market bag pattern The constructs used in this example are discussed in more detail throughout this report. 1.1.1 Verification Example In the section for the body of the bag, the number of stitches is increasing for all but the last couple of rows. It can be difficult for a knitter to keep track of the number of stitches they should have on the needle. Rows in this pattern in the standard notation could be written with the stitch count at the end of each row as: Row 1 : ∗K, yo , K ; rep from ∗ t o end . ( 1 2 s t s ) Pattern Example 1.3: Stitch count This is helpful, but as discussed in the intro, it is tedious (but necessary) for the pattern designer to figure out this value for every row. The Purl compiler computes this value, ensures that each row uses all of the stitches of the row before it, and displays it at the end of every row for reference for the knitter. 4 1.2 Purl Compiler Overview The Purl compiler consists of a three-pass top-down parser and a back-end that generates a knitting pattern in the standard notation in HTML. The first pass constructs an abstract syntax tree according to the provided grammar and is implemented using recursive descent parsing techniques as described in [3]. The lexer is a module used by this pass. Errors and warnings reported by the first pass are only lexical and syntactic errors. Pass two traverses the syntax tree depth first, replacing all variables and constructs that are purely elements of Purl and are not expressible in the standard notation. These constructs will be discussed when exploring the individual pattern elements. In the third pass, the syntax tree is again traversed depth first. All verification occurs in this pass and errors indicate problems in the structure of the knitting pattern. A global State object is used throughout parsing to track information necessary for error reporting, such as section name, position in code, and row number in the generated pattern. It is also used in the verification pass to track the pattern orientation, width, and row index, and to update nodes with these values as necessary. The reason for breaking up parsing into three passes is because a syntax tree representation of the pattern is much easier to manipulate and verify. A main feature of Purl is the ability to define modular and parametrized segments of patterns, through the pattern sample construct introduced by this language (see 2.15), so a second pass is used for trimming nodes representing sample calls. Also, there are some challenges in verifying a pattern. It is necessary that every row works all of the stitches of the previous row, but there are some pattern constructs which work a number of stitches that depends on the width of the current row. Since we allow modular pattern definitions and parameterized segments of patterns, this verification cannot be done in a single pass over the source language. 1.3 Error Handling Below are explanations of many of the strategies used by the compiler for handling errors, including panicmode recovery approximately as discussed in [3]. They are covered here to avoid redundant explanations later. 1. Whenever a character symbol is expected, there are some characters that are considered likely errors. These likely errors will generate a warning, and compilation will continue as usual. Expected : ; . , ** Likely typo ; : , . * 2. If a keyword is expected and an ident is found, then a typo is assumed. In this case a warning is created, and compilation continues. 3. Any other unexpected symbols generate an error and the lexer will scan to the end of the production (usually the period or comma symbols) and return the node to resume compilation at the next sibling. For certain stitches (as will be noted later), there is no reliable symbol delimiting siblings. In this case, the lexer will scan to the end of the parent production. 5 • If an unexpected keyword is found, then the error message reports an invalid use of keyword. • If an unexpected ident symbol is found, then the error message reports an invalid use of ident. • If an unexpected character symbol is found, then the error message reports an invalid use of character. <Unexpected Symbol Error 1> i f (Sym . type == SymType . I d e n t ) { AddMsg( MsgType . Error , node , " Invalid use of ident " + Sym . value + "." ) ; } e l s e i f ( hasOwnValue ( KeywordSym , Sym . type ) ) { AddMsg( MsgType . Error , node , " Invalid use of keyword " + Sym . value + "." ) ; } e l s e i f ( hasOwnValue ( CharSym , Sym . type ) ) { AddMsg( MsgType . Error , node , " Invalid use of \’" + Sym . value + "\’ character ." ) ; } U SED IN: Ast Construction Pass on page 75, Pattern Parse Pattern on page 52, Pattern Parse Title on page 52, Colon Separator on page 15, Cast-On Parse Keyword on page 8, Cast-On Parse Value on page 8, Period Terminator on page 9, Pick-Up Parse Keyword on page 11, Pick-Up Parse Value on page 11, Pick-Up Parse Origin on page 12, Pick-Up Parse Origin on page 12, Row Definition Parse Row Type on page 14, Row Element Parse on page 19, Stitch Op Parse on page 20, Undetermined Stitch Repeat Parse Open on page 42, Undetermined Stitch Repeat Parse Close on page 43, Undetermined Stitch Repeat Parse To on page 43, Undetermined Stitch Repeat Parse Repeat Instruction on page 44, Fixed Stitch Repeat Parse Open on page 39, Fixed Stitch Repeat Parse Close on page 39, Compound Stitch Parse Open on page 36, Compound Stitch Parse Close on page 36, Bind-Off Parse BO on page 46, Bind-Off Parse Count on page 47, Join Parse Keyword on page 49, Join Parse Count on page 49, Join Parse Destination on page 50, Join Parse Destination on page 50, RowRepeatParse_Open on page 57, RowRepeatParse_Close on page 57, Section Parse Section on page 59, Section Parse Title on page 60, Section Content Parse on page 60, Section Content Parse on page 60, Sample Def Parse Sample on page 63, Sample Def Parse Params on page 64, Sample Def Parse Params on page 64, Sample Call Parse Ident on page 66, Sample Call Parse Params on page 66 6 2 Elements of Knitting This section explores each element of a knitting pattern and its corresponding representation throughout compilation. This organization allows for additions of new features in a single location, and provides isolated explanations of each knitting concept. 2.1 Cast-On To begin a knitting project, it is necessary to add stitches on to the needles. This is called a “cast-on”, and is essentially a number of loops made on one of the needles such that each loop is connected to its adjacent loops. 2.1.1 AST Node hcoi ::= ‘CO’ hNati [‘circular’ | ‘provisional’] ‘.’ The syntax for a cast-on is similar to the standard notation, but replacing cast-on with CO (also commonly used in patterns) and not requiring “sts” to be explicit. CO 8 c i r c u l a r . Purl Example 2.1: Market Bag Body Cast-On <Cast-On Parse 2> var CoParse = f u n c t i o n ( ) { var node = { type : NodeType . CastOn , value : 0 , l i n e : S t a t e . l i n e } ; <<Cast −On Parse Keyword 3>> <<Cast −On Parse Value 4>> 7 <<Cast −On Parse CoType 5>> <<Period Terminator 6>> r e t u r n node ; }; U SED IN: Ast Construction Pass on page 75 I NCLUDED B LOCKS: 3 on page 8, 4 on page 8, 5 on page 9, 6 on page 9 The “CO” keyword is used to declare a cast-on for a pattern. <Cast-On Parse Keyword 3> i f (Sym . type == KeywordSym . CastOn ) { nextSym ( ) ; } e l s e i f (Sym . type == SymType . I d e n t ) { var msg = "A cast -on dedlaration must start with \’" + KeywordSym . CastOn + "\’." ; AddMsg( MsgType . Warning , node , msg ) ; nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> var msg = " Missing \’" + KeywordSym . CastOn + "\’ at start of cast -on declaration ." ; AddMsg( MsgType . Error , node , msg ) ; scanToSym ( CharSym . Period ) ; nextSym ( ) ; r e t u r n node ; } U SED IN: Cast-On Parse on page 7 I NCLUDED B LOCKS: 1 on page 6 Following the cast-on keyword, a natural number is given as the number of stitches that will be added to the needle. <Cast-On Parse Value 4> i f (Sym . type == SymType . Nat ) { node . value = Sym . value ; nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> AddMsg( MsgType . Error , node , " Missing cast -on count." ) ; scanToSym ( CharSym . Period ) ; nextSym ( ) ; r e t u r n node ; } U SED IN: Cast-On Parse on page 7 I NCLUDED B LOCKS: 1 on page 6 8 The default cast-on type is flat, but the grammar also allows a circular or provisional cast-on. A circular cast-on is used when knitting a circular-shaped object and beginning knitting from the center of the circle. A provisional cast-on is used if the cast-on will be removed later and the project will be worked in the opposite direction. <Cast-On Parse CoType 5> i f (Sym . type == KeywordSym . CastOnCirc ) { node . coType = CoType . C i r c u l a r ; nextSym ( ) ; } e l s e i f (Sym . type == KeywordSym . CastOnProv ) { node . coType = CoType . P r o v i s i o n a l ; nextSym ( ) ; } else { node . coType = CoType . F l a t ; } U SED IN: Cast-On Parse on page 7 The end of a cast-on is marked by a period. <Period Terminator 6> i f (Sym . type == CharSym . Period ) { nextSym ( ) ; } e l s e i f (Sym . type == CharSym .Comma) { AddMsg( MsgType . Warning , node , "Use \’.\’ symbol at end of " + node . type + "." ) ; nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> AddMsg( MsgType . Error , node , " Missing \’.\’ symbol at end of " + node . type + "." ) ; scanToSym ( CharSym . Period ) ; nextSym ( ) ; } U SED IN: Cast-On Parse on page 7, Pick-Up Parse on page 10, Row Definition Parse on page 13, Bind-Off Parse on page 47, Join Parse on page 50, Sample Call Parse on page 67 I NCLUDED B LOCKS: 1 on page 6 2.1.2 Verification When a cast-on is verified, the initial side, row width, and row index are set in the State object. <Verify Cast-On 7> var VerifyCastOn = f u n c t i o n ( node ) { 9 S t a t e . s i d e = SideType . RS ; S t a t e . width = node . value ; S t a t e . rowIndex = 1 ; }; U SED IN: Verification Pass on page 80 2.1.3 HTML Generation <Write HTML Cast-On 8> var WriteCo = f u n c t i o n ( node ) { var coType = node . coType ! = n u l l && node . coType . l e n g t h > 0 ? " " + node . coType : "" ; r e t u r n AddElement ( TagType . Div , ClassType . CastOn , "Cast -on " + node . value + " sts" + coType + "." ) ; }; U SED IN: code/codegen.js on page 83 2.2 Pick-Up It is possible to begin knitting off of a completed knitted object by picking up stitches. This is done by using one needle to pull loops of yarn through spaces along the edge that stitches are to be picked up from, so that new active stitches are on the needle. 2.2.1 AST Node hpui ::= ‘PU’ hNati ‘from’ hStringi ‘.’ PU 10 from ‘ ‘ Body top ’’ . Purl Example 2.2: Market Bag Handle Pick-Up <Pick-Up Parse 9> var PuParse = f u n c t i o n ( ) { var node = { type : NodeType . PickUp , value : 0 , l i n e : S t a t e . l i n e } ; <<Pick −Up Parse Keyword 10>> <<Pick −Up Parse Value 11>> 10 <<Pick −Up Parse Origin 12>> <<Period Terminator 6>> r e t u r n node ; }; U SED IN: Ast Construction Pass on page 75 I NCLUDED B LOCKS: 10 on page 11, 11 on page 11, 12 on page 12, 6 on page 9 The “PU” keyword is used at the beginning of a declaration to pick-up stitches. <Pick-Up Parse Keyword 10> i f (Sym . type == KeywordSym . PickUp ) { nextSym ( ) ; } e l s e i f (Sym . type == SymType . I d e n t ) { var msg = "A pick -up dedlaration must start with \’" + KeywordSym . PickUp + "\’." ; AddMsg( MsgType . Warning , node , msg ) ; nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> var msg = " Missing \’" + KeywordSym . PickUp + "\’ at start of pick -up declaration ." ; AddMsg( MsgType . Error , node , msg ) ; scanToSym ( CharSym . Period ) ; nextSym ( ) ; r e t u r n node ; } U SED IN: Pick-Up Parse on page 10 I NCLUDED B LOCKS: 1 on page 6 Following the pick-up keyword, a natural number is given as the number of stitches that will be added to the needle. <Pick-Up Parse Value 11> i f (Sym . type == SymType . Nat ) { node . value = Sym . value ; nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> AddMsg( MsgType . Error , node , " Missing pick -up count." ) ; scanToSym ( CharSym . Period ) ; nextSym ( ) ; r e t u r n node ; } U SED IN: Pick-Up Parse on page 10 I NCLUDED B LOCKS: 1 on page 6 11 Next we expect the keyword “from”, followed by a string directing where the stitches should be picked up from. <Pick-Up Parse Origin 12> i f (Sym . type == KeywordSym . From ) { nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> scanToSym ( CharSym . Period ) ; nextSym ( ) ; r e t u r n node ; } i f (Sym . type == SymType . S t r i n g ) { node . o r i g i n = Sym . value ; nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> AddMsg( MsgType . Error , node , " Missing pick -up origin ." ) ; scanToSym ( CharSym . Period ) ; nextSym ( ) ; r e t u r n node ; } U SED IN: Pick-Up Parse on page 10 I NCLUDED B LOCKS: 1 on page 6, 1 on page 6 The end of a pick-up is marked by a period. 2.2.2 Verification When a pick-up is verified, the initial side, row width, and row index are set in the State object. <Verify Pick-Up 13> var VerifyPickUp = f u n c t i o n ( node ) { S t a t e . s i d e = SideType . RS ; S t a t e . width = node . value ; S t a t e . rowIndex = 1 ; }; U SED IN: Verification Pass on page 80 12 2.2.3 HTML Generation <Write HTML Pick-Up 14> var WritePu = f u n c t i o n ( node ) { r e t u r n AddElement ( TagType . Div , ClassType . CastOn , "Pick -up " + node . value + " sts from " + node . o r i g i n + "." ) ; }; U SED IN: code/codegen.js on page 83 2.3 Row Once stitches have been added to the needles, it is possible to begin the body of the pattern. Typically knitting is worked from the left needle to the right needle. Knitting by hand may be done flat or in the round. Both of these methods are worked “horizontally”, meaning an object is created as a sequence of knit rows. Flat knitting is done with two straight needles which can be thought of as two stacks since the first stitch worked in each row is the last created in the previous row. Circular knitting with a circular needle (two needles connected with a cable) can be thought of as two queues since the first stitch worked in each row is the first stitch that was created in the previous row. The “active” stitches are the loops on the needles. These are on the left needle at the start of a row. They are considered active because if removed from the needle, they could be pulled out from whatever stitches they support below. A stitch is worked by pulling a loop of yarn through an active stitch and then dropping that active stitch from the left needle. This previously active stitch will be anchored by the loop pulled through it, and that loop is now an active stitch on the right needle. A row will list the stitches required to work all of the active stitches from the left needle to the right needle. 2.3.1 AST Node hrowDef i ::= (‘row’ | ‘rnd’) [‘MC’ | ‘CC’] ‘:’ hrowElemi (‘,’ hrowElemi)* ‘.’ <Row Definition Parse 15> var RowDefParse = f u n c t i o n ( ) { var node = { type : NodeType . Row, c h i l d r e n : [ ] , l i n e : S t a t e . l i n e } ; <<Row D e f i n i t i o n Parse Row Type 16>> <<Row D e f i n i t i o n Parse Color 17>> <<Colon S e p a r a t o r 18>> <<Row D e f i n i t i o n Parse Row Elements 19>> <<Period Terminator 6>> 13 r e t u r n node ; }; U SED IN: Ast Construction Pass on page 75 I NCLUDED B LOCKS: 16 on page 14, 17 on page 15, 18 on page 15, 19 on page 15, 6 on page 9 A row begins with the row type of either “row” or “rnd”. In flat knitting the row type “row” is used, meaning once all the stitches on the left needle have been worked (or popped), the whole object is turned over, the left and right needles are swapped, and the process can begin again (the last stitch pushed on the right needle is now the first popped off the left). In circular knitting the row type “rnd” is used, meaning once the stitches on the left needle have been worked and new stitches are on the right needle, all the stitches are moved along the cable so that they are worked in a FIFO fashion. A default row type of “row" is assumed if an unexpected symbol is found. The body section in the market bag pattern example is knit in the round, and the handle is knit flat. rnd : ∗K, YO, K ; t o end . Purl Example 2.3: Market Bag Body Row row : K, K2T , K 4 , K2T , K . Purl Example 2.4: Market Bag Handle Row <Row Definition Parse Row Type 16> i f (Sym . type == KeywordSym . Row) { node . rowType = RowType . Row ; nextSym ( ) ; } e l s e i f (Sym . type == KeywordSym . Rnd ) { node . rowType = RowType . Rnd ; nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> AddMsg( MsgType . Error , node , " Invalid row type specified ." ) ; node . rowType = RowType . Rnd ; nextSym ( ) ; } U SED IN: Row Definition Parse on page 13 I NCLUDED B LOCKS: 1 on page 6 14 The pattern writer can optionally specify which yarn color is to be used for a row. Currently only a main color, ‘MC’, and a contrasting color, ‘CC’ are available in the language. The main color is assumed by default. <Row Definition Parse Color 17> i f (Sym . type == KeywordSym . ColorMain ) { node . c o l o r = ColorType . Main ; nextSym ( ) ; } e l s e i f (Sym . type == KeywordSym . C o l o r C o n t r a s t ) { node . c o l o r = ColorType . C o n t r a s t ; nextSym ( ) ; } U SED IN: Row Definition Parse on page 13 A colon symbol separates the row declaration from its content. <Colon Separator 18> i f (Sym . type == CharSym . Colon ) { nextSym ( ) ; } e l s e i f (Sym . type == CharSym . Semicolon ) { var msg = "Use \’:\’ symbol before listing " + node . type + " elements ." ; AddMsg( MsgType . Warning , node , msg ) ; nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> var msg = " Missing \’:\’ symbol before listing " + node . type + " elements ." ; AddMsg( MsgType . Error , node , msg ) ; scanToSym ( CharSym . Period ) ; } U SED IN: Pattern Parse on page 53, Row Definition Parse on page 13, Section Parse on page 61, Sample Branches Parse on page 65, Sample Def Parse on page 65 I NCLUDED B LOCKS: 1 on page 6 The elements of a row of a pattern are separated by commas. The syntax tree node for each row element is added to an array representing the children of the row. <Row Definition Parse Row Elements 19> node . c h i l d r e n . push ( RowElemParse ( ) ) ; while (Sym . type == CharSym .Comma) { nextSym ( ) ; node . c h i l d r e n . push ( RowElemParse ( ) ) ; 15 } U SED IN: Row Definition Parse on page 13 The end of a row definition is marked by a period. 2.3.2 Verification To verify a row, first the node needs to have row index and side properties set, as these are used in pattern output. <Verify Row Setup 20> node . index = S t a t e . rowIndex ; node . s i d e = S t a t e . s i d e ; U SED IN: Verify Row on page 17 The row verification function uses a rowState object that is updated upon verification of each child of the row (stitches, compound stitches, and stitch repeats). <Verify Row Children 21> var rowState = { i n i t i a l W i d t h : S t a t e . width , workedSt : 0 , stChange : 0 } ; VerifyRowElemChildren ( node , rowState ) ; U SED IN: Verify Row on page 17 Details on verification of specific row elements is discussed in the row elements section (see 2.4). <Verify Row Elem Children of Node 22> var VerifyRowElemChildren = f u n c t i o n ( node , rowState_0 ) { var rowState_1 = { i n i t i a l W i d t h : rowState_0 . i n i t i a l W i d t h , workedSt : 0 , stChange : 0}; i f ( node . c h i l d r e n ! = n u l l ) { f o r ( var i = 0 ; i < node . c h i l d r e n . l e n g t h ; i ++) { VerifyRowElem ( node . c h i l d r e n [ i ] , rowState_1 ) ; } } rowState_0 . workedSt += rowState_1 . workedSt ; 16 rowState_0 . stChange += rowState_1 . stChange ; }; U SED IN: Verification Pass on page 80 The verification error that will be caught at this level is an incorrect number of worked stitches. This means that the stitches specified for this row either use less or require more stitches than exist from the previous row. <Verify Row Worked Stitches Error 23> i f ( rowState . workedSt ! = S t a t e . width ) { var msg = rowState . workedSt + " sts worked over " + S t a t e . width + " sts." ; AddMsg( MsgType . V e r i f i c a t i o n , node , msg ) ; } U SED IN: Verify Row on page 17 Once the children of the row have been verified, the row width of the node and the State object are updated according to the stitch change caused by this row. If the row type of this row is “row”, then the project is to be flipped at the end of the row, so the side is changed. The State.rowIndex is also incremented by one before we move to the next sibling. <Verify Row State Update 24> node . width = rowState . workedSt + rowState . stChange ; S t a t e . width = node . width ; i f ( node . rowType == RowType . Row) { i f ( S t a t e . s i d e == SideType . RS ) { S t a t e . s i d e = SideType .WS; } e l s e i f ( S t a t e . s i d e == SideType .WS) { S t a t e . s i d e = SideType . RS ; } } S t a t e . rowIndex += 1 ; U SED IN: Verify Row on page 17 <Verify Row 25> var VerifyRow = f u n c t i o n ( node ) { << V e r i f y Row Setup 20>> 17 << V e r i f y Row Children 21>> << V e r i f y Row Worked S t i t c h e s E r r o r 23>> << V e r i f y Row S t a t e Update 24>> }; U SED IN: Verification Pass on page 80 I NCLUDED B LOCKS: 20 on page 16, 21 on page 16, 23 on page 17, 24 on page 17 2.3.3 HTML Generation The written row includes the row type, side, color if explicitly given, row index, children, and the number of active stitches at the end of the row. <Write HTML Row 26> var WriteRow = f u n c t i o n ( node ) { var r e s u l t = [ ] ; r e s u l t . push ( OpenElement ( TagType . Div , ClassType . Row) ) ; i f ( node . rowType == RowType . Row) { r e s u l t . push ( "Row" ) ; } e l s e i f ( node . rowType == RowType . Rnd ) { r e s u l t . push ( "Rnd" ) ; } r e s u l t . push ( node . index ) ; i f ( node . c o l o r == ColorType . Main ) { r e s u l t . push ( "(MC)" ) ; } e l s e i f ( node . c o l o r == ColorType . C o n t r a s t ) { r e s u l t . push ( "(CC)" ) ; } r e s u l t . push ( "(" + node . s i d e + ")" + ":" ) ; var c o n t e n t = [ ] ; i f ( node . c h i l d r e n ! = n u l l ) { f o r ( var i = 0 ; i < node . c h i l d r e n . l e n g t h ; i ++) { c o n t e n t . push ( WriteNode ( node . c h i l d r e n [ i ] ) ) ; } } 18 r e s u l t . push ( c o n t e n t . j o i n ( ", " ) + "." ) ; var count = "(" + node . width + " sts)" ; r e s u l t . push ( AddElement ( TagType . Span , ClassType . S t i t c h C o u n t , count ) ) ; r e s u l t . push ( CloseElement ( TagType . Div ) ) ; return r e s u l t . j o i n ( " " ) ; }; U SED IN: code/codegen.js on page 83 2.4 Row Elements Children of a row are grouped as row elements. The <rowElem> production is used to provide structure to the language: it is necessary to not allow nesting of undetermined stitch repeats (see 2.8), but it is desirable to allow fixed repeats (see 2.7) to have fixed stitch repeats as children. The bottom-level row elements are basic stitch, compound stitch, fixed stitch repeat, and undetermined stitch repeat. 2.4.1 AST Node hrowElemi ::= hstitchOpi | huStRepi hstitchOpi ::= hfixedStRepi | hcompSti | hbasicSti The parse function corresponding to the <rowElem> production determine what <rowElem> the current symbol is a first symbol of, and passes up the result of the appropriate parse function. If the current symbol is a basic stitch, an open angle bracket, or open parentheses, then we need to then parse according to the <stitchOp> production. An asterisk is the only possible first symbol of an undetermined stitch repeat, so for an asterisk we parse according to the <uStRep> production. <Row Element Parse 27> var RowElemParse = f u n c t i o n ( ) { var node = { } ; i f ( hasOwnValue ( StitchSym , Sym . type ) || Sym . type == CharSym . OpenAngle || Sym . type == CharSym . OpenBrack ) { node = S t i t c h O p P a r s e ( ) ; } e l s e i f (Sym . type == CharSym . A s t e r i s k ) { 19 node = UStRepParse ( ) ; } else { <<Unexpected Symbol E r r o r 1>> AddMsg( MsgType . Error , node , " Invalid row element ." ) ; scanToSym ( CharSym . Period ) ; } r e t u r n node ; }; U SED IN: Ast Construction Pass on page 75 I NCLUDED B LOCKS: 1 on page 6 <Stitch Op Parse 28> var S t i t c h O p P a r s e = f u n c t i o n ( ) { var node = { } ; i f (Sym . type == CharSym . OpenBrack ) { node = FixedStRepParse ( ) ; } e l s e i f (Sym . type == CharSym . OpenAngle ) { node = CompStParse ( ) ; } e l s e i f ( hasOwnValue ( StitchSym , Sym . type ) ) { node = B a s i c S t P a r s e ( ) ; } else { <<Unexpected Symbol E r r o r 1>> var msg = sym . value + " is not a known stitch , start of stitch repeat or compound stitch ." ; AddMsg( MsgType . Error , node , msg ) ; scanToSym ( CharSym . Period ) ; } r e t u r n node ; }; U SED IN: Ast Construction Pass on page 75 I NCLUDED B LOCKS: 1 on page 6 2.4.2 Verification Row elements are verified according to the row element node type. Details are covered in their respective sections. 20 <Verify Row Elem 29> var VerifyRowElem = f u n c t i o n ( node , rowState_0 ) { var rowState_1 = { i n i t i a l W i d t h : rowState_0 . i n i t i a l W i d t h , workedSt : 0 , stChange : 0}; var rep = 1 ; i f ( node . repCount ! = n u l l ) { V e r i f y E x p r e s s i o n ( node . repCount ) ; i f ( node . repCount . value > 1 ) { rep = node . repCount . value ; } } var num = 0 ; i f ( node . num ! = n u l l ) { V e r i f y E x p r e s s i o n ( node . num) ; i f ( node . num . value > 0 ) { num = node . num . value ; } } switch ( node . type ) { c a s e NodeType . FixedStRep : << V e r i f y Fixed S t i t c h Repeat 65>> break ; c a s e NodeType . UStRep : << V e r i f y Undetermined S t i t c h Repeat 73>> break ; c a s e NodeType . CompSt : << V e r i f y Compound S t i t c h 59>> break ; c a s e NodeType . Knit : c a s e NodeType . P u r l : c a s e NodeType . KnitTBL : c a s e NodeType . PurlTBL : c a s e NodeType . KnitBelow : c a s e NodeType . PurlBelow : c a s e NodeType . S l i p : c a s e NodeType . SlipKW : c a s e NodeType . SlipPW : 21 c a s e NodeType . YarnOver : c a s e NodeType . KnitFB : c a s e NodeType . PurlFB : c a s e NodeType . Make : c a s e NodeType . MakeL : c a s e NodeType . MakeR : c a s e NodeType . KnitTog : c a s e NodeType . PurlTog : c a s e NodeType . SSK : c a s e NodeType . SSP : c a s e NodeType . PSSO : << V e r i f y B a s i c S t i t c h 53>> break ; default : break ; } }; U SED IN: Verification Pass on page 80 I NCLUDED B LOCKS: 65 on page 41, 73 on page 45, 59 on page 38, 53 on page 32 2.5 Basic Stitches As discussed in 2.3, a stitch is typically formed by pulling the trailing yarn through an active stitch on the left needle, creating a new stitch to the right needle. Any active stitches on the left needle that the right needle passes through are dropped off the left needle once the stitch is complete. Variations in the direction the right needle passes through the last active stitch and whether the yarn is in front or behind the needle allow for different stitches to be created. More complex stitches are created by pulling the trailing yarn through some other location in the fabric, or through multiple active stitches, rather than a single active stitch. A stitch that adds more new stitches to the right needle than are removed from the left is called an increase. Similarly, a stitch that adds fewer stitches to the right needle than it drops off the left is called a decrease. We will say that the number of stitches dropped off of the left needle is the number of worked stitches, since it is the number of stitches from the previous row that have been processed. We say that the difference a stitch makes to the width is the stitch change. Due to a desire to adhere to the standard knitting pattern and stitch notation [1] and allow flexibility in the naming of identifiers in the language, lexing and parsing of stitches has been treated differently than the rest of the language. Some stitches have numeric parameters in the middle of the stitch notation. Consider the stitch K2T. This represents a knit 2 together stitch, but any natural number is valid. A string of this form is allowed in the structure of identifiers (e.g. K1abc is an acceptable identifier). To reserve certain strings with parameterized segments as stitches, an attempt is made to match an identifier string to regular expressions for each stitch before assuming it is an ident symbol. So the stitch type is determined by the lexer, but the specific information contained in the stitch string is then extracted in the stitch parse function. 22 The example below is a row from the market bag pattern. After the colon is the list of stitches to be created for this row. row : K, K2T , K 4 , K2T , K . Purl Example 2.5: Market Bag Handle Row 2.5.1 AST Node <Stitch Information 30> var s t P a r t s = Sym . value . s p l i t ( / ( [ 1 − 9 ] [ 0 − 9 ] ∗ ) /) ; U SED IN: Basic Stitch Parse on page 23 A stitch may be optionally followed by a natural number expression to indicate the number of times a stitch should be repeated. <Node Rep Count Optional 31> i f (Sym . type == SymType . I d e n t || Sym . type == SymType . Nat ) { node . repCount = E x p r e s s i o n P a r s e ( ) ; } U SED IN: Compound Stitch Parse on page 37, Basic Stitch Parse on page 23 <Basic Stitch Parse 32> var B a s i c S t P a r s e = f u n c t i o n ( ) { var node = { l i n e : S t a t e . l i n e } ; << S t i t c h I n f o r m a t i o n 30>> switch (Sym . type ) { c a s e StitchSym . Knit : <<Knit 33>> break ; c a s e StitchSym . P u r l : <<P u r l 36>> break ; c a s e StitchSym . KnitTBL : 23 <<KnitTBL 34>> break ; c a s e StitchSym . PurlTBL : <<PurlTBL 37>> break ; c a s e StitchSym . KnitBelow : <<KnitBelow 35>> break ; c a s e StitchSym . PurlBelow : <<PurlBelow 38>> break ; c a s e StitchSym . S l i p : << S l i p 39>> break ; c a s e StitchSym . SlipKW : <<SlipKW 40>> break ; c a s e StitchSym . SlipPW : <<SlipPW 41>> break ; c a s e StitchSym . YarnOver : <<YarnOver 42>> break ; c a s e StitchSym . KnitFB : <<KnitFB 43>> break ; c a s e StitchSym . PurlFB : <<PurlFB 44>> break ; c a s e StitchSym . Make : <<Make 45>> break ; c a s e StitchSym . MakeL : <<MakeL 46>> break ; c a s e StitchSym . MakeR : <<MakeR 47>> break ; c a s e StitchSym . KnitTog : <<KnitTog 48>> break ; c a s e StitchSym . PurlTog : <<PurlTog 49>> break ; c a s e StitchSym . SSK : 24 <<SSK 50>> break ; c a s e StitchSym . SSP : <<SSP 51>> break ; c a s e StitchSym . PSSO : <<PSSO 52>> break ; default : node . workedSt = 0 ; node . stChange = 0 ; break ; } nextSym ( ) ; <<Node Rep Count Optional 31>> r e t u r n node ; }; U SED IN: Ast Construction Pass on page 75 I NCLUDED B LOCKS: 30 on page 23, 33 on page 26, 36 on page 27, 34 on page 26, 37 on page 27, 35 on page 26, 38 on page 27, 39 on page 28, 40 on page 28, 41 on page 28, 42 on page 29, 43 on page 29, 44 on page 29, 45 on page 30, 46 on page 30, 47 on page 30, 48 on page 31, 49 on page 31, 50 on page 31, 51 on page 32, 52 on page 32, 31 on page 23 25 Knit The most ubiquitous stitch. Needle Entry Top active stitch, from left Yarn Position Back Effect <Knit 33> node . type = NodeType . Knit ; node . workedSt = 1 ; node . stChange = 0 ; U SED IN: Basic Stitch Parse on page 23 Knit Through Back Loop Needle Entry Top active stitch, from right Yarn Position Back Effect <KnitTBL 34> node . type = NodeType . KnitTBL ; node . workedSt = 1 ; node . stChange = 0 ; U SED IN: Basic Stitch Parse on page 23 Knit Below Stitch with parameter num Needle Entry num stitches below top active stitch, from right Yarn Position Back Effect <KnitBelow 35> node . type = NodeType . KnitBelow ; node . num = s t P a r t s [ 1 ] ; node . workedSt = 1 ; node . stChange = 0 ; U SED IN: Basic Stitch Parse on page 23 26 Purl Needle Entry Top active stitch, from right Yarn Position Front Effect <Purl 36> node . type = NodeType . P u r l ; node . workedSt = 1 ; node . stChange = 0 ; U SED IN: Basic Stitch Parse on page 23 Purl Through Back Loop Needle Entry Top active stitch, from left Yarn Position Front Effect <PurlTBL 37> node . type = NodeType . PurlTBL ; node . workedSt = 1 ; node . stChange = 0 ; U SED IN: Basic Stitch Parse on page 23 Purl Below Stitch with parameter num Needle Entry num below top active stitch, from right Yarn Position Front Effect <PurlBelow 38> node . type = NodeType . PurlBelow ; node . num = s t P a r t s [ 1 ] ; node . workedSt = 1 ; node . stChange = 0 ; U SED IN: Basic Stitch Parse on page 23 27 Slip Needle Entry Top active stitch, from left Yarn Position Back Notes No loop pulled through Effect <Slip 39> node . type = NodeType . S l i p ; node . workedSt = 1 ; node . stChange = 0 ; U SED IN: Basic Stitch Parse on page 23 Slip Knitwise The default slip stitch Needle Entry Top active stitch, from left Yarn Position Back Notes No loop pulled through Effect <SlipKW 40> node . type = NodeType . SlipKW ; node . workedSt = 1 ; node . stChange = 0 ; U SED IN: Basic Stitch Parse on page 23 Slip Purlwise Needle Entry Top active stitch, from right Yarn Position Front Notes No loop pulled through Effect <SlipPW 41> node . type = NodeType . SlipPW ; node . workedSt = 1 ; node . stChange = 0 ; 28 U SED IN: Basic Stitch Parse on page 23 Yarn Over An increase Yarn Position Back Instruction Wrap yarn counterclockwise arount the right needle Effect <YarnOver 42> node . type = NodeType . YarnOver ; node . workedSt = 0 ; node . stChange = 1 ; U SED IN: Basic Stitch Parse on page 23 Knit Front and Back An increase Instruction In the same active stitch, knit then knit through back loop Effect <KnitFB 43> node . type = NodeType . KnitFB ; node . workedSt = 1 ; node . stChange = 1 ; U SED IN: Basic Stitch Parse on page 23 Purl Front and Back An increase Instruction In the same active stitch, purl then purl through back loop Effect <PurlFB 44> node . type = NodeType . PurlFB ; node . workedSt = 1 ; node . stChange = 1 ; U SED IN: Basic Stitch Parse on page 23 Make An increase with parameter num Setup From back, left needle picks up vertical bar between top left and top right active stitches 29 Instruction Knit the stitch picked up by the left needle, repeat num times Effect <Make 45> node . type = NodeType . Make ; node . num = s t P a r t s [ 1 ] ; node . workedSt = 0 ; node . stChange = 1 ; U SED IN: Basic Stitch Parse on page 23 Make Left The default “make” stitch, an increase with parameter num Setup From back, left needle picks up vertical bar between top left and top right active stitches Instruction Knit the stitch picked up by the left needle, repeat num times Effect <MakeL 46> node . type = NodeType . MakeL ; node . num = s t P a r t s [ 1 ] ; node . workedSt = 0 ; node . stChange = 1 ; U SED IN: Basic Stitch Parse on page 23 Make Right An increase with parameter num Setup From front, left needle picks up vertical bar between top left and top right active stitches Instruction Knit through the back loop the stitch picked up by the left needle, repeat num times Effect <MakeR 47> node . type = NodeType . MakeR ; node . num = s t P a r t s [ 1 ] ; node . workedSt = 0 ; node . stChange = 1 ; U SED IN: Basic Stitch Parse on page 23 Knit Together A decrease with parameter num 30 Needle Entry Top num active stitches, from left Yarn Position Back Effect <KnitTog 48> node . type = NodeType . KnitTog ; node . num = s t P a r t s [ 1 ] ; node . workedSt = node . num ; node . stChange = ( − 1) ∗ ( node . num − 1 ) ; U SED IN: Basic Stitch Parse on page 23 Purl Together A decrease with parameter num Needle Entry Top num active stitches, from right Yarn Position Front Effect <PurlTog 49> node . type = NodeType . PurlTog ; node . num = s t P a r t s [ 1 ] ; node . workedSt = node . num ; node . stChange = ( − 1) ∗ ( node . num − 1 ) ; U SED IN: Basic Stitch Parse on page 23 Slip Slip Knit A decrease Instruction Slip knitwise then slip purlwise and knit the two slipped stitches together Effect <SSK 50> node . type = NodeType . SSK ; node . workedSt = 2 ; node . stChange = − 1; U SED IN: Basic Stitch Parse on page 23 Slip Slip Purl A decrease Instruction Slip knitwise then slip purlwise and purl the two slipped stitches together 31 Effect <SSP 51> node . type = NodeType . SSP ; node . workedSt = 2 ; node . stChange = − 1; U SED IN: Basic Stitch Parse on page 23 Pass Slip Stitch Over A decrease Needle Entry On right needle, second active stitch from top, from left Yarn Position Back Instruction Pass stitch over top active stitch on right needle, and off needle Notes Most commonly used after a slip then knit, hence passing the slipped stitch over Effect <PSSO 52> node . type = NodeType . PSSO ; node . workedSt = 0 ; node . stChange = − 1; U SED IN: Basic Stitch Parse on page 23 2.5.2 Verification The role of a basic stitch during the verification pass is to update the row state with the stitch change and number of worked stitches by the given stitch. <Verify Basic Stitch 53> rowState_0 . workedSt += node . workedSt ∗ rep ; rowState_0 . stChange += node . stChange ∗ rep ; U SED IN: Verify Row Elem on page 20 2.5.3 HTML Generation The writing of stitches follows the standard notation [1]. 32 <Write HTML Basic Stitch 54> var W r i t e B a s i c S t i t c h = f u n c t i o n ( node ) { var r e s u l t = [ ] ; var rep = "" ; var num = "" ; i f ( node . repCount ! = n u l l && node . repCount . value > 1 ) { rep = node . repCount . value ; } i f ( node . num ! = n u l l ) { i f ( node . num . value > 0 ) { num = node . num . value ; } e l s e i f ( node . num > 0 ) { num = node . num ; } } switch ( node . type ) { c a s e NodeType . Knit : r e s u l t . push ( AddElement ( TagType . Span , ClassType . S t i t c h , "K" + rep ) ) ; break ; c a s e NodeType . P u r l : r e s u l t . push ( AddElement ( TagType . Span , ClassType . S t i t c h , "P" + rep ) ) ; break ; c a s e NodeType . KnitTBL : r e s u l t . push ( AddElement ( TagType . Span , ClassType . S t i t c h , "K" + rep + " tbl" ) ) ; break ; c a s e NodeType . PurlTBL : r e s u l t . push ( AddElement ( TagType . Span , ClassType . S t i t c h , "P" + rep + " tbl" ) ) ; break ; c a s e NodeType . KnitBelow : r e s u l t . push ( AddElement ( TagType . Span , ClassType . S t i t c h , "K" + num + "B" + rep ) ) ; break ; c a s e NodeType . PurlBelow : r e s u l t . push ( AddElement ( TagType . Span , ClassType . S t i t c h , "P" + num + "B" + rep ) ) ; break ; 33 c a s e NodeType . S l i p : r e s u l t . push ( AddElement ( TagType . Span , ClassType . S t i t c h , "sl" + rep ) ) ; break ; c a s e NodeType . SlipKW : r e s u l t . push ( AddElement ( TagType . Span , ClassType . S t i t c h , "sl" + rep + "k" ) ) ; break ; c a s e NodeType . SlipPW : r e s u l t . push ( AddElement ( TagType . Span , ClassType . S t i t c h , "sl" + rep + "p" ) ) ; break ; c a s e NodeType . YarnOver : r e s u l t . push ( AddElement ( TagType . Span , ClassType . S t i t c h , "yo" + rep ) ) ; break ; c a s e NodeType . KnitFB : r e s u l t . push ( AddElement ( TagType . Span , ClassType . S t i t c h , "KFB" ) ) ; i f ( rep > 0 ) { r e s u l t . push ( rep ) ; } break ; c a s e NodeType . PurlFB : r e s u l t . push ( AddElement ( TagType . Span , ClassType . S t i t c h , "PFB" ) ) ; i f ( rep > 0 ) { r e s u l t . push ( rep ) ; } break ; c a s e NodeType . Make : r e s u l t . push ( AddElement ( TagType . Span , ClassType . S t i t c h , "M" + num) ) ; i f ( rep > 0 ) { r e s u l t . push ( rep ) ; } break ; c a s e NodeType . MakeL : r e s u l t . push ( AddElement ( TagType . Span , ClassType . S t i t c h , "M" + num + "L" ) ) ; i f ( rep > 0 ) { r e s u l t . push ( rep ) ; } break ; c a s e NodeType . MakeR : r e s u l t . push ( AddElement ( TagType . Span , ClassType . S t i t c h , "M" + num + "R" ) ) ; i f ( rep > 0 ) { r e s u l t . push ( rep ) ; } break ; c a s e NodeType . KnitTog : r e s u l t . push ( AddElement ( TagType . Span , ClassType . S t i t c h , "k" + num + "tog" ) ) ; i f ( rep > 0 ) { r e s u l t . push ( rep ) ; } 34 break ; c a s e NodeType . PurlTog : r e s u l t . push ( AddElement ( TagType . Span , ClassType . S t i t c h , "k" + num + "tog" ) ) ; i f ( rep > 0 ) { r e s u l t . push ( rep ) ; } break ; c a s e NodeType . SSK : r e s u l t . push ( AddElement ( TagType . Span , ClassType . S t i t c h , "ssk" ) ) ; i f ( rep > 0 ) { r e s u l t . push ( rep ) ; } break ; c a s e NodeType . SSP : r e s u l t . push ( AddElement ( TagType . Span , ClassType . S t i t c h , "ssp" ) ) ; i f ( rep > 0 ) { r e s u l t . push ( rep ) ; } break ; c a s e NodeType . PSSO : r e s u l t . push ( AddElement ( TagType . Span , ClassType . S t i t c h , "psso" ) ) ; i f ( rep > 0 ) { r e s u l t . push ( rep ) ; } break ; default : break ; } return r e s u l t . j o i n ( " " ) ; }; U SED IN: code/codegen.js on page 83 2.6 Compound Stitch It is possible to work a number of stitches in a single stitch. This means that after the loop has been pulled through an active stitch, that stitch is not dropped off the left needle, but remains until the sequence of stitches have been performed. 2.6.1 AST Node 35 hcompSti ::= ‘<’ hbasicSti ( ‘,’ hbasicSti )* ‘>’ [hexpri] The below example of a compound stitch means to perform the stitches between the angle brackets in one stitch. <K, P , K> Purl Example 2.6: Compound stitch The sequence of stitches of a compound stitch is contained between angle brackets. The use of any other bracket symbols will generate a warning and allow compilation to continue. A compound is separated from its siblings by a comma, but its children are also comma-separated. This is a case where on an error it is necessary for the lexer to scan to the terminator of the parent node production before continuing parsing. <Compound Stitch Parse Open 55> i f (Sym . type == CharSym . OpenAngle ) { nextSym ( ) ; } e l s e i f (Sym . type == CharSym . OpenParen || Sym . type == CharSym . OpenBrace || Sym . type == CharSym . OpenBrack ) { AddMsg( MsgType . Warning , node , "Use \’<\’ symbol at start of compound stitch ." ) ; nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> AddMsg( MsgType . Error , node , " Missing \’<\’ symbol at start of compound stitch ." ) ; scanToSym ( CharSym . Period ) ; r e t u r n node ; } U SED IN: Compound Stitch Parse on page 37 I NCLUDED B LOCKS: 1 on page 6 <Compound Stitch Parse Close 56> i f (Sym . type == CharSym . CloseAngle ) { nextSym ( ) ; } e l s e i f (Sym . type == CharSym . CloseParen || Sym . type == CharSym . C l o s e B r a c e || Sym . type == CharSym . CloseBrack ) { AddMsg( MsgType . Warning , node , "Use \’>\’ symbol at end of compound stitch ." ) ; nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> 36 AddMsg( MsgType . Error , node , " Missing \’>\’ symbol at end of compound stitch ." ) ; scanToSym ( CharSym . Period ) ; r e t u r n node ; } U SED IN: Compound Stitch Parse on page 37 I NCLUDED B LOCKS: 1 on page 6 Between the compound stitch brackets is a comma separated list of basic stitches. <Compound Stitch Parse Children 57> node . c h i l d r e n . push ( B a s i c S t P a r s e ( ) ) ; while (Sym . type == CharSym .Comma) { nextSym ( ) ; node . c h i l d r e n . push ( B a s i c S t P a r s e ( ) ) ; } U SED IN: Compound Stitch Parse on page 37 A compound stitch optionally ends with a natural number or variable indicating how many times the compound stitch should be repeated. Note that a compound stitch works one stitch for every repeat, since all stitches in the sequence are worked into a single active stitch on the left needle. <Compound Stitch Parse 58> var CompStParse = f u n c t i o n ( ) { var node = { type : NodeType . CompSt , c h i l d r e n : [ ] , l i n e : S t a t e . l i n e } ; <<Compound S t i t c h Parse Open 55>> <<Compound S t i t c h Parse Children 57>> <<Compound S t i t c h Parse Close 56>> <<Node Rep Count Optional 31>> r e t u r n node ; }; U SED IN: Ast Construction Pass on page 75 I NCLUDED B LOCKS: 55 on page 36, 57 on page 37, 56 on page 36, 31 on page 23 2.6.2 Verification 37 <Verify Compound Stitch 59> VerifyRowElemChildren ( node , rowState_1 ) ; rowState_0 . workedSt += rep ; rowState_0 . stChange += rowState_1 . stChange ∗ rep ; U SED IN: Verify Row Elem on page 20 2.6.3 HTML Generation <Write HTML Compound Stitch 60> var WriteCompSt = f u n c t i o n ( node ) { var r e s u l t = [ ] ; var s t i t c h e s = [ ] ; i f ( node . c h i l d r e n ! = n u l l ) { f o r ( var i = 0 ; i < node . c h i l d r e n . l e n g t h ; i ++) { s t i t c h e s . push ( WriteNode ( node . c h i l d r e n [ i ] ) ) ; } } r e s u l t . push ( "(" + s t i t c h e s . j o i n ( ", " ) + ")" ) ; i f ( node . repCount ! = n u l l && node . repCount . value > 1 ) { r e s u l t . push ( node . repCount . value + " times " ) ; } r e s u l t . push ( "in next st" ) ; return r e s u l t . j o i n ( " " ) ; }; U SED IN: code/codegen.js on page 83 2.7 Fixed Stitch Repeat A sequence of stitches may be repeated a fixed number of times. 38 2.7.1 AST Node hfixedStRepi ::= ‘[’ hstitchOpi ( ’,’ hstitchOpi )* ‘]’ hexpri The below example means to perform the sequence between brackets (knit then purl) three times. (K, P ) 3 Purl Example 2.7: Fixed repeat The children of a fixed stitch repeat is a sequence of fixed stitch repeats, compound stitches, and basic stitches contained within parentheses. As we saw for compound stitches, we cannot confidently assume the location of the next sibling in an error situation. We again scan to the terminator of the parent node production. <Fixed Stitch Repeat Parse Open 61> i f (Sym . type == CharSym . OpenBrack ) { nextSym ( ) ; } e l s e i f (Sym . type == CharSym . OpenAngle || Sym . type == CharSym . OpenBrace || Sym . type == CharSym . OpenParen ) { AddMsg( MsgType . Warning , node , "Use \’[\’ symbol to start fixed stitch repeat ." ) ; nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> AddMsg( MsgType . Error , node , " Missing \’[\’ symbol to start fixed stitch repeat ." ) ; scanToSym ( CharSym . Period ) ; r e t u r n node ; } U SED IN: Fixed Stitch Repeat Parse on page 40 I NCLUDED B LOCKS: 1 on page 6 <Fixed Stitch Repeat Parse Close 62> i f (Sym . type == CharSym . CloseBrack ) { nextSym ( ) ; } e l s e i f (Sym . type == CharSym . CloseAngle || Sym . type == CharSym . C l o s e B r a c e || Sym . type == CharSym . CloseParen ) { var msg = "Use \’]\’ symbol to end fixed stitch repeat stitches ." ; AddMsg( MsgType . Warning , node , msg ) ; nextSym ( ) ; } else { 39 <<Unexpected Symbol E r r o r 1>> var msg = " Missing \’]\’ symbol to end fixed stitch repeat stitches ." ; AddMsg( MsgType . Error , node , msg ) ; scanToSym ( CharSym . Period ) ; r e t u r n node ; } U SED IN: Fixed Stitch Repeat Parse on page 40 I NCLUDED B LOCKS: 1 on page 6 The children of a fixed stitch repeat node are commma separated. <Fixed Stitch Repeat Parse Children 63> node . c h i l d r e n . push ( S t i t c h O p P a r s e ( ) ) ; while (Sym . type == CharSym .Comma) { nextSym ( ) ; node . c h i l d r e n . push ( S t i t c h O p P a r s e ( ) ) ; } U SED IN: Fixed Stitch Repeat Parse on page 40 A fixed stitch repeat must end with a natural number expression. <Fixed Stitch Repeat Parse 64> var FixedStRepParse = f u n c t i o n ( ) { var node = { type : NodeType . FixedStRep , c h i l d r e n : [ ] , l i n e : S t a t e . l i n e } ; <<Fixed S t i t c h Repeat Parse Open 61>> <<Fixed S t i t c h Repeat Parse Children 63>> <<Fixed S t i t c h Repeat Parse Close 62>> node . repCount = E x p r e s s i o n P a r s e ( CharSym . Period ) ; r e t u r n node ; }; U SED IN: Ast Construction Pass on page 75 I NCLUDED B LOCKS: 61 on page 39, 63 on page 40, 62 on page 39 40 2.7.2 Verification A fixed stitch repeat adds the number of worked stitches and stitch change multiplied by the specified repeat amount to these values for its parent node. <Verify Fixed Stitch Repeat 65> VerifyRowElemChildren ( node , rowState_1 ) ; rowState_0 . workedSt += rowState_1 . workedSt ∗ rep ; rowState_0 . stChange += rowState_1 . stChange ∗ rep ; U SED IN: Verify Row Elem on page 20 2.7.3 HTML Generation <Write HTML Fixed Stitch Repeat 66> var WriteFixedStRep = f u n c t i o n ( node ) { var s t i t c h e s = [ ] ; i f ( node . c h i l d r e n ! = n u l l ) { f o r ( var i = 0 ; i < node . c h i l d r e n . l e n g t h ; i ++) { s t i t c h e s . push ( WriteNode ( node . c h i l d r e n [ i ] ) ) ; } } r e t u r n "[" + s t i t c h e s . j o i n ( ", " ) + "] " + node . repCount . value + " times " ; }; U SED IN: code/codegen.js on page 83 2.8 Undetermined Stitch Repeat A sequence of stitches may be repeated a number of times that depends on the current length of the row. We will call this an undetermined stitch repeat. 2.8.1 AST Node huStRepi : ‘*’ hstitchOpi ( ’,’ hstitchOpi )* ‘;’ ‘to’ (‘last’ hexpri ‘| ‘end’) 41 The first example below means perform the knit stitch as many times as required to get to the end of the row. The second example means perform the knit stitch to the last two stitches, then purl the last two. ∗K ; t o end Purl Example 2.8: Undetermined Stitch Repeat 1 ∗K ; t o l a s t 2 , P 2 . Purl Example 2.9: Undetermined Stitch Repeat 2 An undetermined stitch repeat must begin with an asterisk. As in compound stitches and fixed repeats, if an invalid symbol is used, the lexer scans to the terminator of the parent production to continue parsing. <Undetermined Stitch Repeat Parse Open 67> i f (Sym . type == CharSym . A s t e r i s k ) { nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> var msg = " Missing \’*\’ symbol at start of undetermined stitch repeat ." ; AddMsg( MsgType . Error , node , msg ) ; scanToSym ( CharSym . Period ) ; r e t u r n node ; } U SED IN: Undetermined Stitch Repeat Parse on page 44 I NCLUDED B LOCKS: 1 on page 6 Following the asterisk is a sequence of comma-separated basic stitches, compound stitches, and fixed stitch repeats. <Undetermined Stitch Repeat Parse Children 68> node . c h i l d r e n . push ( S t i t c h O p P a r s e ( ) ) ; while (Sym . type == CharSym .Comma) { nextSym ( ) ; node . c h i l d r e n . push ( S t i t c h O p P a r s e ( ) ) ; } U SED IN: Undetermined Stitch Repeat Parse on page 44 42 The sequence of children is terminated with a semicolon. <Undetermined Stitch Repeat Parse Close 69> i f (Sym . type == CharSym . Semicolon ) { nextSym ( ) ; } e l s e i f (Sym . type == CharSym . Colon ) { var msg = "Use \’;\’ symbol at the end of undetermined stitch repeat stitches ." ; AddMsg( MsgType . Warning , node , msg ) ; nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> var msg = " Missing \’;\’ symbol at the end of undetermined stitch repeat stitches ." ; AddMsg( MsgType . Error , node , msg ) ; scanToSym ( CharSym . Period ) ; r e t u r n node ; } U SED IN: Undetermined Stitch Repeat Parse on page 44 I NCLUDED B LOCKS: 1 on page 6 If there is an error in the remainder of the undeterminded stitch repeat, then since we are past the sequence of children we can assume that the next comma delimits the next sibling, and the next period is the terminator of the parent production. Next, the pattern writer must specify how far along the row this repeat should be performed, beginning with the keyword “to". <Undetermined Stitch Repeat Parse To 70> i f (Sym . type == KeywordSym . To ) { nextSym ( ) ; } e l s e i f (Sym . type == SymType . I d e n t ) { var msg = "Use \’" + KeywordSym . To + "\’ after \’;\’ for undetermined stitch repeat . "; AddMsg( MsgType . Warning , node , msg ) ; nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> var msg = " Missing \’" + KeywordSym . To + "\’ after \’;\’ for undetermined stitch repeat ." ; AddMsg( MsgType . Error , node , msg ) ; scanToSym ( CharSym .Comma || CharSym . Period ) ; } U SED IN: Undetermined Stitch Repeat Parse on page 44 I NCLUDED B LOCKS: 1 on page 6 43 The keyword “end” is used if the sequence should be repeated to the end of the row, and the keyword “last” is used if the sequence should be repeated to within a given number of stitches from the end of the row. For this reason, nesting of undetermined stitch repeats is not possible. An important note is that the number of stitches remaining on the left needle at the end of the last repeat must coincide exactly with the number specified here (0 for “end”). <Undetermined Stitch Repeat Parse Repeat Instruction 71> i f (Sym . type == KeywordSym . L a s t ) { nextSym ( ) ; node . num = E x p r e s s i o n P a r s e ( CharSym .Comma || CharSym . Period ) ; } e l s e i f (Sym . type == KeywordSym . End ) { node . num = { type : NodeType . N a t L i t e r a l , value : 0 } ; nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> var msg = " Missing repeat instructions . Expecting \’" + KeywordSym . L a s t + "\’ or \’" + KeywordSym . End + "\’." ; AddMsg( MsgType . Error , node , msg ) ; scanToSym ( CharSym .Comma || CharSym . Period ) ; } U SED IN: Undetermined Stitch Repeat Parse on page 44 I NCLUDED B LOCKS: 1 on page 6 <Undetermined Stitch Repeat Parse 72> var UStRepParse = f u n c t i o n ( ) { var node = { type : NodeType . UStRep , c h i l d r e n : [ ] , l i n e : S t a t e . l i n e } ; <<Undetermined S t i t c h Repeat Parse Open 67>> <<Undetermined S t i t c h Repeat Parse Children 68>> <<Undetermined S t i t c h Repeat Parse Close 69>> <<Undetermined S t i t c h Repeat Parse To 70>> <<Undetermined S t i t c h Repeat Parse Repeat I n s t r u c t i o n 71>> r e t u r n node ; }; U SED IN: Ast Construction Pass on page 75 I NCLUDED B LOCKS: 67 on page 42, 68 on page 42, 69 on page 43, 70 on page 43, 71 on page 44 44 2.8.2 Verification To verify an undetermined stitch repeat, we first determine the number of stitches the children will be repeated over. If the number of stitches worked over a single repeat does not divide this value, then there will be a number of unworked stitches equal to the division remainder at the end of the row. In this case, an error is generated. Otherwise, the row state of the parent node is updated with the number of worked stitches and stitch change caused by the undetermined stitch repeat. <Verify Undetermined Stitch Repeat 73> VerifyRowElemChildren ( node , rowState_1 ) ; var stToWork = rowState_1 . i n i t i a l W i d t h − rowState_0 . workedSt − node . num . value ; var remainSt = stToWork % rowState_1 . workedSt ; i f ( remainSt ! = 0 ) { var msg = remainSt + " st will remain after the last possible repeat ." ; AddMsg( MsgType . V e r i f i c a t i o n , node , msg ) ; } else { rep = ( stToWork − ( stToWork % rowState_1 . workedSt ) ) / rowState_1 . workedSt ; } rowState_0 . workedSt += rowState_1 . workedSt ∗ rep ; rowState_0 . stChange += rowState_1 . stChange ∗ rep ; U SED IN: Verify Row Elem on page 20 2.8.3 HTML Generation <Write HTML Undetermined Stitch Repeat 74> var WriteUStRep = f u n c t i o n ( node ) { var r e s u l t = [ ] ; var s t i t c h e s = [ ] ; i f ( node . c h i l d r e n ! = n u l l ) { f o r ( var i = 0 ; i < node . c h i l d r e n . l e n g t h ; i ++) { s t i t c h e s . push ( WriteNode ( node . c h i l d r e n [ i ] ) ) ; } } r e s u l t . push ( "*" + s t i t c h e s . j o i n ( ", " ) + "; rep from * to" ) ; var rem = node . num . value ; 45 i f ( rem == 0 ) { r e s u l t . push ( "end" ) ; } e l s e i f ( rem == 1 ) { r e s u l t . push ( "last " + rem + " st" ) ; } e l s e i f ( rem > 1 ) { r e s u l t . push ( "last " + rem + " sts" ) ; } else { r e s u l t . push ( " invalid value" ) ; } return r e s u l t . j o i n ( " " ) ; }; U SED IN: code/codegen.js on page 83 2.9 Bind-Off We have considered cast-ons, rows and stitches. These elements, followed by a bind-off, are sufficient to construct a simple pattern. 2.9.1 AST Node hboi ::= ‘BO’ hNati ‘.’ BO 1 0 0 . Purl Example 2.10: Market Bag Body Bind-off The “BO” keyword is used to declare a bind-off for the pattern. <Bind-Off Parse BO 75> i f (Sym . type == KeywordSym . BindOff ) { nextSym ( ) ; } e l s e i f (Sym . type == SymType . I d e n t ) { var msg = "A bind -off declaration must start with \’" + KeywordSym . BindOff + "\’." ; AddMsg( MsgType . Warning , node , msg ) ; } else { <<Unexpected Symbol E r r o r 1>> var msg = " Missing \’"+ KeywordSym . BindOff + "\’ at start of bind -off declaration ." ; 46 AddMsg( MsgType . Error , node , msg ) ; scanToSym ( CharSym . Period ) ; nextSym ( ) ; r e t u r n node ; } U SED IN: Bind-Off Parse on page 47 I NCLUDED B LOCKS: 1 on page 6 Next, a natural number is given as the number of stitches to bind-off. <Bind-Off Parse Count 76> i f (Sym . type == SymType . Nat ) { node . value = Sym . value ; nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> AddMsg( MsgType . Error , node , "Bind -off count not specified ." ) ; scanToSym ( CharSym . Period ) ; nextSym ( ) ; r e t u r n node ; } U SED IN: Bind-Off Parse on page 47 I NCLUDED B LOCKS: 1 on page 6 A bind-off ends with a period as terminator. <Bind-Off Parse 77> var BoParse = f u n c t i o n ( ) { var node = { type : NodeType . BindOff , value : 0 , l i n e : S t a t e . l i n e } ; <<Bind−Off Parse BO 75>> <<Bind−Off Parse Count 76>> <<Period Terminator 6>> r e t u r n node ; }; U SED IN: Ast Construction Pass on page 75 I NCLUDED B LOCKS: 75 on page 46, 76 on page 47, 6 on page 9 47 2.9.2 Verification The value of a bind-off node must be equivalent to the final width of the row before it, otherwise either some stitches will still be active after completing a pattern, or else there will be too few stitches to bind-off (the former error being much more severe). <Verify Bind-Off 78> var V e r i f y B i n d O f f = f u n c t i o n ( node ) { i f ( node . value ! = S t a t e . width ) { var msg = " Binding off " + node . value + " sts over " + S t a t e . width + " sts." ; AddMsg( MsgType . V e r i f i c a t i o n , node , msg ) ; } }; U SED IN: Verification Pass on page 80 2.9.3 HTML Generation <Write HTML Bind-Off 79> var WriteBo = f u n c t i o n ( node ) { var msg = "Bind -off " + node . value + " sts." ; r e t u r n AddElement ( TagType . Div , ClassType . BindOff , msg ) ; }; U SED IN: code/codegen.js on page 83 2.10 Join An alternative to using a bind-off to finish a pattern is to join the remaining active stitches to some other location on the same section, or another knitted object. If active stitches are to be joined to other active stitches, this is called grafting. 2.10.1 AST Node hjoini ::= ‘Join’ hNati ‘to’ hStringi ‘.’ 48 J o i n 10 t o ‘ ‘ Body top ’’ . Purl Example 2.11: Market Bag Handle Join The “Join” keyword is used to declare a join for the pattern. <Join Parse Keyword 80> i f (Sym . type == KeywordSym . J o i n ) { nextSym ( ) ; } e l s e i f (Sym . type == SymType . I d e n t ) { var msg = "A join declaration must start with \’" + KeywordSym . J o i n + "\’." ; AddMsg( MsgType . Warning , node , msg ) ; } else { <<Unexpected Symbol E r r o r 1>> var msg = " Missing \’"+ KeywordSym . J o i n + "\’ at start of join declaration ." ; AddMsg( MsgType . Error , node , msg ) ; scanToSym ( CharSym . Period ) ; nextSym ( ) ; r e t u r n node ; } U SED IN: Join Parse on page 50 I NCLUDED B LOCKS: 1 on page 6 Next, a natural number is given as the number of stitches to join. <Join Parse Count 81> i f (Sym . type == SymType . Nat ) { node . value = Sym . value ; nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> AddMsg( MsgType . Error , node , "Join count not specified ." ) ; scanToSym ( CharSym . Period ) ; nextSym ( ) ; r e t u r n node ; } U SED IN: Join Parse on page 50 I NCLUDED B LOCKS: 1 on page 6 It is necessary to state where the active stitches should be joined. This begins with the keyword “to” followed by a string with directions on the join. 49 <Join Parse Destination 82> i f (Sym . type == KeywordSym . To ) { nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> scanToSym ( CharSym . Period ) ; nextSym ( ) ; r e t u r n node ; } i f (Sym . type == SymType . S t r i n g ) { node . d e s t i n a t i o n = Sym . value ; nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> AddMsg( MsgType . Error , node , " Missing join destination ." ) ; scanToSym ( CharSym . Period ) ; nextSym ( ) ; r e t u r n node ; } U SED IN: Join Parse on page 50 I NCLUDED B LOCKS: 1 on page 6, 1 on page 6 A join ends with a period as terminator. <Join Parse 83> var J o i n P a r s e = f u n c t i o n ( ) { var node = { type : NodeType . J o i n , value : 0 , l i n e : S t a t e . l i n e } ; << J o i n P arse Keyword 80>> << J o i n P arse Count 81>> << J o i n P arse D e s t i n a t i o n 82>> <<Period Terminator 6>> r e t u r n node ; }; U SED IN: Ast Construction Pass on page 75 I NCLUDED B LOCKS: 80 on page 49, 81 on page 49, 82 on page 50, 6 on page 9 50 2.10.2 Verification The value of a join node must be equivalent to the final width of the row before it, otherwise either some stitches will still be active after completing a pattern, or else there will be too few stitches to bind-off (the former error being much more severe). <Verify Join 84> var V e r i f y J o i n = f u n c t i o n ( node ) { i f ( node . value ! = S t a t e . width ) { var msg = " Joining " + node . value + " sts of " + S t a t e . width + " sts." ; AddMsg( MsgType . V e r i f i c a t i o n , node , msg ) ; } }; U SED IN: Verification Pass on page 80 2.10.3 HTML Generation <Write HTML Join 85> var W r i t e J o i n = f u n c t i o n ( node ) { var msg = "Join " + node . value + " sts to " + node . d e s t i n a t i o n + "." ; r e t u r n AddElement ( TagType . Div , ClassType . J o i n , msg ) ; }; U SED IN: code/codegen.js on page 83 2.11 Pattern Since we have now seen enough to construct a simple patern, we will look at the syntax of a knitting pattern written in Purl. 2.11.1 AST Node hpatterni ::= ‘pattern’ hStringi ‘:’ (hcoi hbodyi hboi | hsectioni+) 51 p a t t e r n ‘ ‘ One Row’’ : CO 1 . row : K . BO 1 . Purl Example 2.12: Simple single row pattern A pattern definition begins with the keyword “pattern”. <Pattern Parse Pattern 86> i f (Sym . type == KeywordSym . P a t t e r n ) { nextSym ( ) ; } e l s e i f (Sym . type == SymType . I d e n t ) { var msg = "A pattern declaration must start with \’" + KeywordSym . P a t t e r n + "\’." ; AddMsg( MsgType . Warning , node , msg ) ; nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> var msg = " Expecting \’" + KeywordSym . P a t t e r n + "\’ to start pattern declaration ." ; AddMsg( MsgType . Error , node , msg ) ; scanToSym ( CharSym . Colon ) ; } U SED IN: Pattern Parse on page 53 I NCLUDED B LOCKS: 1 on page 6 The next requirement is a string in double quotes. This is the title of the patern. The reason for using a string rather than a single identifier is to allow greater flexibility in the naming of patterns. In this way, a pattern can have a multi-word name that can also include any reserved keywords. If an identifier is provided rather than a string, a warning is created and compilation continues. Any other symbol causes an error and the lexer scans to the next colon symbol, which is required following the pattern title. <Pattern Parse Title 87> i f (Sym . type == SymType . S t r i n g ) { node . name = Sym . value ; nextSym ( ) ; } e l s e i f (Sym . type == SymType . I d e n t ) { node . name = Sym . value ; var msg = " Remember to use double quotes around the name of your pattern ." ; AddMsg( MsgType . Warning , node , msg ) ; nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> AddMsg( MsgType . Error , node , "The pattern name is not specified ." ) ; scanToSym ( CharSym . Colon ) ; 52 } U SED IN: Pattern Parse on page 53 I NCLUDED B LOCKS: 1 on page 6 The main content of the pattern may by a cast-on, pattern body, then bind-off for a single-section pattern, or a number of defined sections. If the symbol after the colon is the cast-on keyword “CO”, then we are parsing a simple pattern. A simple pattern provides instructions for a single discrete object. In contrast, a composite pattern provides instructions to knit multiple objects to be joined to form a larger structure. <Pattern Parse Main 88> i f (Sym . type == KeywordSym . CastOn ) { << P a t t e r n Content Parse 89>> } else { << P a t t e r n Parse Composite 99>> } U SED IN: Pattern Parse on page 53 I NCLUDED B LOCKS: 89 on page 53, 99 on page 59 A simple pattern begins with a cast-on or pick-up, followed by a pattern body, and finally a bind-off or a join. <Pattern Content Parse 89> node . s t a r t = CoParse ( ) ; node . c h i l d r e n = BodyParse ( ) ; node . f i n i s h = BoParse ( ) ; U SED IN: Pattern Parse Main on page 53 <Pattern Parse 90> var P a t t e r n P a r s e = f u n c t i o n ( ) { var node = { type : NodeType . P a t t e r n , c h i l d r e n : [ ] , l i n e : S t a t e . l i n e } ; << P a t t e r n Parse P a t t e r n 86>> << P a t t e r n Parse T i t l e 87>> <<Colon S e p a r a t o r 18>> << P a t t e r n Parse Main 88>> r e t u r n node ; }; 53 U SED IN: Ast Construction Pass on page 75 I NCLUDED B LOCKS: 86 on page 52, 87 on page 52, 18 on page 15, 88 on page 53 2.11.2 Verification When the co property is not null, we are verifying a simple pattern, so we verify the cast-on, the children, and then the bind-off. Otherwise, we have a composite pattern and we verify the children (which are pattern sections in this case). <Verify Pattern 91> var V e r i f y P a t t e r n = f u n c t i o n ( node ) { i f ( node . s t a r t ! = n u l l ) { VerifyNode ( node . s t a r t ) ; V e r i f y C h i l d r e n ( node ) ; VerifyNode ( node . f i n i s h ) ; } else { V e r i f y C h i l d r e n ( node ) ; } }; U SED IN: Verification Pass on page 80 2.11.3 HTML Generation <Write HTML Pattern 92> var W r i t e P a t t e r n = f u n c t i o n ( node ) { var r e s u l t = [ ] ; r e s u l t . push ( OpenElement ( TagType . Div , ClassType . P a t t e r n ) ) ; r e s u l t . push ( AddElement ( TagType . Div , ClassType . PatternName , node . name ) ) ; i f ( node . s t a r t ! = n u l l ) { r e s u l t . push ( WriteNode ( node . s t a r t ) ) ; r e s u l t . push ( WriteBody ( node ) ) ; r e s u l t . push ( WriteNode ( node . f i n i s h ) ) ; } e l s e i f ( node . c h i l d r e n ! = n u l l ) { f o r ( var i = 0 ; i < node . c h i l d r e n . l e n g t h ; i ++) { r e s u l t . push ( WriteNode ( node . c h i l d r e n [ i ] ) ) ; } } 54 r e s u l t . push ( CloseElement ( TagType . Div ) ) ; r e t u r n r e s u l t . j o i n ( "" ) }; U SED IN: code/codegen.js on page 83 2.12 Pattern Body The body of a pattern is the main content of the pattern (everything between cast-on and bind-off). This consists of zero or more rows, row repeats (see 2.13), and sample calls (see 2.15.2). Note that <pattern> is not the only production that uses the <body> production to create its child nodes. Row repeats and sample definitions (see 2.15.1) are other constructs that use the <body> production. 2.12.1 AST Node hbodyi ::= (hrowDef i | hrowRepi | hsampleCalli)* The body parse method builds up and returns an array of nodes which make up a pattern body. <Body Parse 93> var BodyParse = f u n c t i o n ( ) { var bodyElems = [ ] ; while (Sym . type ! = SymType . EOF) { switch (Sym . type ) { c a s e KeywordSym . Row : c a s e KeywordSym . Rnd : bodyElems . push ( RowDefParse ( ) ) ; break ; c a s e SymType . RowRep : bodyElems . push ( RowRepeatParse ( ) ) ; break ; c a s e SymType . I d e n t : bodyElems . push ( SampleCallParse ( ) ) ; break ; default : 55 r e t u r n bodyElems ; } } r e t u r n bodyElems ; }; U SED IN: Ast Construction Pass on page 75 2.12.2 HTML Generation <Write HTML Body 94> var WriteBody = f u n c t i o n ( node ) { var r e s u l t = [ ] ; r e s u l t . push ( OpenElement ( TagType . Div , ClassType . Body ) ) ; i f ( node . c h i l d r e n ! = n u l l ) { f o r ( var i = 0 ; i < node . c h i l d r e n . l e n g t h ; i ++) { r e s u l t . push ( WriteNode ( node . c h i l d r e n [ i ] ) ) ; } } r e s u l t . push ( CloseElement ( TagType . Div ) ) ; r e t u r n r e s u l t . j o i n ( "" ) ; }; U SED IN: code/codegen.js on page 83 2.13 Row Repeats If elements of a pattern body are to be repeated a number of times, rather than rewriting those elements, a row repeat may be used for more concise notation. 2.13.1 AST Node hrowRepeati ::= ‘**’ hbodyi ‘repeat’ hexpri 56 The body of the diagonalLace sample used by the market bag pattern uses a row repeat. This means the two rows between the double asterisk and repeat n are to be repeated n times. ∗∗ rnd : ∗K2T , YO; t o end . rnd : ∗K ; t o end . repeat n Purl Example 2.13: Ribbing repeat A row repeat begins with two asterisks. <RowRepeatParse_Open 95> i f (Sym . type == SymType . RowRep ) { nextSym ( ) ; } e l s e i f (Sym . type == CharSym . A s t e r i s k ) { var msg = "Row repeat must begin with \’" + SymType . RowRep + "\’." ; AddMsg( MsgType . Warning , node , msg ) ; nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> var msg = " Missing \’" + SymType . RowRep + "\’ at start of row repeat ." ; AddMsg( MsgType . Error , node , msg ) ; scanToSym ( CharSym . Period ) ; nextSym ( ) ; } U SED IN: Row Repeat Parse on page 58 I NCLUDED B LOCKS: 1 on page 6 The end of a row repeat body is marked by the “repeat” keyword. This must then be followed by a natural number or variable. <RowRepeatParse_Close 96> i f (Sym . type == KeywordSym . Repeat ) { nextSym ( ) ; } e l s e i f (Sym . type == SymType . I d e n t ) { var msg = "Row repeat body must be followed by \’" + KeywordSym . Repeat + "\’." ; AddMsg( MsgType . Warning , node , msg ) ; nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> var msg = " Missing \’" + KeywordSym . Repeat + "\’ after row repeat body." ; 57 AddMsg( MsgType . Error , node , msg ) ; scanToSym ( CharSym . Period ) ; nextSym ( ) ; } U SED IN: Row Repeat Parse on page 58 I NCLUDED B LOCKS: 1 on page 6 The children of a row repeat are represented as an array of nodes. We use the same body parse method as simple patterns and pattern sections. <Row Repeat Parse 97> var RowRepeatParse = f u n c t i o n ( ) { var node = { type : NodeType . RowRep , c h i l d r e n : [ ] , l i n e : S t a t e . l i n e } ; <<RowRepeatParse_Open 95>> node . c h i l d r e n = BodyParse ( ) ; <<RowRepeatParse_Close 96>> node . repCount = E x p r e s s i o n P a r s e ( CharSym . Period ) ; r e t u r n node ; }; U SED IN: Ast Construction Pass on page 75 I NCLUDED B LOCKS: 95 on page 57, 96 on page 57 2.13.2 HTML Generation <Write HTML Row Repeat 98> var WriteRowRep = f u n c t i o n ( node ) { var r e s u l t = [ ] ; r e s u l t . push ( OpenElement ( TagType . Div , ClassType . RowRep ) ) ; r e s u l t . push ( "**" ) ; r e s u l t . push ( WriteBody ( node ) ) ; r e s u l t . push ( "rep from ** " + node . repCount . value + " times " ) ; r e s u l t . push ( CloseElement ( TagType . Div ) ) ; r e t u r n r e s u l t . j o i n ( "" ) ; }; 58 U SED IN: code/codegen.js on page 83 2.14 Pattern Section If writing a pattern to create multiple discrete objects, then the pattern must be made up of a number of pattern sections. In this case, we write a composite pattern, which is a pattern with zero or more pattern sections as its children. <Pattern Parse Composite 99> while (Sym . type == KeywordSym . S e c t i o n ) { node . c h i l d r e n . push ( S e c t i o n P a r s e ( ) ) ; } U SED IN: Pattern Parse Main on page 53 2.14.1 AST Node hsectioni ::= ‘section’ hStringi ‘:’ (hcoi | hpui) hbodyi (hboi | hjoini) The market bag body is a section of the market bag pattern. s e c t i o n "Body" : CO 8 c i r c u l a r . rnd : ∗K, YO, K ; t o end . rnd : ∗K ; t o end . c i r c l e X with 1 , 2 3 . dia gonalLa ce with 3 0 . g a r t e r S t i t c h C C with 4 , 1 . BO 1 0 0 . Purl Example 2.14: Market Bag Body A section definition begins with the “section” keyword. <Section Parse Section 100> i f (Sym . type == KeywordSym . S e c t i o n ) { nextSym ( ) ; } e l s e i f (Sym . type == SymType . I d e n t ) { 59 var msg = "A section declaration must start with \’" + KeywordSym . S e c t i o n + "\’." ; AddMsg( MsgType . Warning , node , msg ) ; nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> var msg = " Missing \’" + KeywordSym . S e c t i o n + "\’ at start of section declaration ." ; AddMsg( MsgType . e r r o r , node , msg ) ; scanToSym ( CharSym . Colon ) ; } U SED IN: Section Parse on page 61 I NCLUDED B LOCKS: 1 on page 6 The title of the section follows, which should be a string enclosed in double quotes. As in the title of a pattern, if an identifier symbol is found instead, then a warning is generated, the name of the section is set to the identifier, and compilation can continue. Any other symbol will cause an error and the lexer will scan to the colon separator that should occur before the section content. <Section Parse Title 101> i f (Sym . type == SymType . S t r i n g ) { node . name = Sym . value ; S t a t e . sectionName = node . name ; nextSym ( ) ; } e l s e i f (Sym . type == SymType . I d e n t ) { node . name = Sym . value ; var msg = " Remember to use double quotes around the name of a section ." ; AddMsg( MsgType . Warning , node , msg ) ; nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> AddMsg( MsgType . Error , node , "The section name is not specified ." ) ; scanToSym ( CharSym . Colon ) ; } U SED IN: Section Parse on page 61 I NCLUDED B LOCKS: 1 on page 6 Parsing of the content of a section is similar to parsing the content of a simple pattern, except that picking up stitches and joining are alternatives for cast-on and bind-off, respectively. <Section Content Parse 102> i f (Sym . type == KeywordSym . CastOn ) { node . s t a r t = CoParse ( ) ; } e l s e i f (Sym . type == KeywordSym . PickUp ) { node . s t a r t = PuParse ( ) ; 60 } else { <<Unexpected Symbol E r r o r 1>> node . s t a r t = { } ; scanToSym ( CharSym . Period ) ; nextSym ( ) ; } node . c h i l d r e n = BodyParse ( ) ; i f (Sym . type == KeywordSym . BindOff ) { node . f i n i s h = BoParse ( ) ; } e l s e i f (Sym . type == KeywordSym . J o i n ) { node . f i n i s h = J o i n P a r s e ( ) ; } else { <<Unexpected Symbol E r r o r 1>> node . f i n i s h = { } ; scanToSym ( CharSym . Period ) ; nextSym ( ) ; } U SED IN: Section Parse on page 61 I NCLUDED B LOCKS: 1 on page 6, 1 on page 6 <Section Parse 103> var S e c t i o n P a r s e = f u n c t i o n ( ) { var node = { type : NodeType . S e c t i o n , l i n e : S t a t e . l i n e } ; << S e c t i o n Parse S e c t i o n 100>> << S e c t i o n Parse T i t l e 101>> <<Colon S e p a r a t o r 18>> << S e c t i o n Content Parse 102>> r e t u r n node ; }; U SED IN: Ast Construction Pass on page 75 I NCLUDED B LOCKS: 100 on page 59, 101 on page 60, 18 on page 15, 102 on page 60 2.14.2 Verification Pattern section verification is very similar to verification of a simple pattern, but first the sectionName property of the State object is set to the name of the current section. This is used in reporting of errors. 61 <Verify Section 104> var V e r i f y S e c t i o n = f u n c t i o n ( node ) { S t a t e . sectionName = node . name ; VerifyNode ( node . s t a r t ) ; V e r i f y C h i l d r e n ( node ) ; VerifyNode ( node . f i n i s h ) ; }; U SED IN: Verification Pass on page 80 2.14.3 HTML Generation <Write HTML Section 105> var W r i t e S e c t i o n = f u n c t i o n ( node ) { var r e s u l t = [ ] ; r e s u l t . push ( OpenElement ( TagType . Div , ClassType . S e c t i o n ) ) ; r e s u l t . push ( AddElement ( TagType . Div , ClassType . SectionName , node . name ) ) ; r e s u l t . push ( WriteNode ( node . s t a r t ) ) ; r e s u l t . push ( WriteBody ( node ) ) ; r e s u l t . push ( WriteNode ( node . f i n i s h ) ) ; r e s u l t . push ( CloseElement ( TagType . Div ) ) ; r e t u r n r e s u l t . j o i n ( "" ) ; }; U SED IN: code/codegen.js on page 83 2.15 Pattern Sample A pattern sample may be thought of as any segment of a knitting pattern between the cast-on and bind-off. In Purl this construct allows pattern samples to be defined with natural number parameters. A pattern sample can be called from any pattern body. There is no analogous concept in the standard notation. 62 2.15.1 Sample Definition In order to use a sample, it must first be defined outside of the pattern definition. hsampleDef i ::= ‘sample’ hIdenti [‘with’ hIdenti (‘,’ hIdenti)*] (hsampleBranchi | ’:’ hbodyi) hsampleBranchi ::= (‘|’ hconditioni ‘:’ hbodyi)+ The “circle” sample used by the market bag pattern is an example of a sample with a branch. For the two parameters n and max given, rows are added to the calling pattern only if n < max. sample c i r c l e with n , max | n < max : rnd : [K, YO, K n , YO, K] 4 . rnd : ∗K ; t o end . c i r c l e with n + 2 , max . Purl Example 2.15: Circle Sample for Market Bag A pattern sample definition begins with the “sample” keyword. <Sample Def Parse Sample 106> i f (Sym . type == KeywordSym . Sample ) { nextSym ( ) ; } e l s e i f (Sym . type == SymType . I d e n t ) { var msg = "A sample definition must start with \’" + KeywordSym . Sample + "\’." ; AddMsg( MsgType . Warning , node , msg ) ; nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> var msg = " Missing \’" + KeywordSym . Sample + "\’ at start of sample definition " ; AddMsg( MsgType . Error , node , msg ) ; scanToSym ( SymType . I d e n t ) ; } U SED IN: Sample Def Parse on page 65 I NCLUDED B LOCKS: 1 on page 6 Next is the sample identifier. Since the sample is not part of the target language, the identifier will not be seen after compilation. So there is no reason to consider aesthetic motivations in sample naming (as there is in pattern and section naming). If the current symbol is not an identifier, then an error is created and the lexer scans to the next colon symbol to continue compilation. 63 <Sample Def Parse Ident 107> i f (Sym . type == SymType . I d e n t ) { node . name = Sym . value ; nextSym ( ) ; } e l s e i f ( hasOwnValue ( KeywordSym , Sym . type ) ) { var msg = Sym . value + " is a reserved keyword and not a valid sample identifier ." ; AddMsg( MsgType . Error , node , msg ) ; scanToSym ( KeywordSym . With || CharSym . Colon ) ; } else { AddMsg( MsgType . Error , node , " Missing or invalid sample identifier ." ) ; scanToSym ( KeywordSym . With || CharSym . Colon ) ; } U SED IN: Sample Def Parse on page 65 If a sample definition uses parameters, the parameter list is prefixed with the keyword “with”, followed by one or more identifiers separated by commas. These are added to the list of parameter names used in the sample definition. <Sample Def Parse Params 108> i f (Sym . type == KeywordSym . With ) { nextSym ( ) ; i f (Sym . type == SymType . I d e n t ) { node . paramNames . push (Sym . value ) ; nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> } while (Sym . type == CharSym .Comma) { nextSym ( ) ; i f (Sym . type == SymType . I d e n t ) { node . paramNames . push (Sym . value ) ; nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> } } } U SED IN: Sample Def Parse on page 65 I NCLUDED B LOCKS: 1 on page 6, 1 on page 6 64 The sample definition node is then added to the collection of samples in the global state object of the parser so that a sample may be used in its own definition. A sample definition can be written to use a specific branch for the sample body if the branch condition is satisfied. For a sample without branching, we expect a colon separator after the parameters, followed by the sample definition body, which is parsed in the same way as simple patterns, pattern sections, and row repeats. <Sample Def Parse 109> var SampleDefParse = f u n c t i o n ( ) { var node = { type : NodeType . SampleDef , paramNames : [ ] , children : [ ] , line : State . line }; <<Sample Def Parse Sample 106>> <<Sample Def Parse I d e n t 107>> <<Sample Def Parse Params 108>> S t a t e . samples [ node . name ] = node ; i f (Sym . type == CharSym . V e r t i c a l B a r ) { <<Sample Branches Parse 110>> } else { <<Colon S e p a r a t o r 18>> node . c h i l d r e n = BodyParse ( ) ; } }; U SED IN: Ast Construction Pass on page 75 I NCLUDED B LOCKS: 106 on page 63, 107 on page 64, 108 on page 64, 110 on page 65, 18 on page 15 If the sample is defined with branches, then a branch begins with ‘|’, followed by a condition, a colon separator, then the sample body. <Sample Branches Parse 110> while (Sym . type == CharSym . V e r t i c a l B a r ) { nextSym ( ) ; var branch = { type : NodeType . Branch } ; branch . c o n d i t i o n = C o n d i t i o n P a r se ( ) ; <<Colon S e p a r a t o r 18>> branch . c h i l d r e n = BodyParse ( ) ; 65 node . c h i l d r e n . push ( branch ) ; } U SED IN: Sample Def Parse on page 65 I NCLUDED B LOCKS: 18 on page 15 2.15.2 Sample Call Once a sample has been defined, it can be called from any pattern body (simple pattern, section, row repeat, sample definition). The sample example in the above section also includes a recursive sample call. hsampleCalli ::= hIdenti [‘with’ hexpri (‘,’ hexpri)+] ‘.’ s t o c k i n e t t e S t i t c h with 1 0 . Purl Example 2.16: Use stockinette stitch sample A sample call begins with an identifier for the sample to be used. <Sample Call Parse Ident 111> i f (Sym . type == SymType . I d e n t ) { node . name = Sym . value ; nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> AddMsg( MsgType . Error , node , " Missing sample call identifier ." ) ; scanToSym ( CharSym . Period ) ; } U SED IN: Sample Call Parse on page 67 I NCLUDED B LOCKS: 1 on page 6 Given the identifier, the details of the corresponding sample definition can be acquired from the global State object. As in a sample definition, the parameter list is comma-separated and prefixed with the keyword “with”. We loop through the array of parameter names from the sample definition and construct a parameter map object which assigns the passed expressions to parameter names. If an incorrect number of parameters is given, an error is created and the lexer scans to the end of the sample call. <Sample Call Parse Params 112> var sampleDef = S t a t e . samples [ node . name ] ; 66 i f (Sym . type == KeywordSym . With ) { nextSym ( ) ; var i ; var r e q u i r e d = sampleDef . paramNames . l e n g t h ; f o r ( i = 0 ; i < r e q u i r e d ; i ++) { i f ( i > 0) { i f (Sym . type == CharSym .Comma) { nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> } } node . paramMap [ sampleDef . paramNames [ i ] ] = E x p r e s s i o n P a r s e ( ) ; } i f ( i ! = sampleDef . paramNames . l e n g t h ) { var msg = node . name + " parameters required : " + r e q u i r e d + ", passed : " + i + "." ; AddMsg( MsgType . Error , node , msg ) ; scanToSym ( CharSym . Period ) ; } } U SED IN: Sample Call Parse on page 67 I NCLUDED B LOCKS: 1 on page 6 A sample call is terminated by a period symbol. <Sample Call Parse 113> var SampleCallParse = f u n c t i o n ( ) { var node = { type : NodeType . SampleCall , paramMap : { } , l i n e : S t a t e . l i n e } ; <<Sample C a l l Parse I d e n t 111>> <<Sample C a l l Parse Params 112>> <<Period Terminator 6>> r e t u r n node ; }; U SED IN: Ast Construction Pass on page 75 I NCLUDED B LOCKS: 111 on page 66, 112 on page 66, 6 on page 9 67 2.16 Root We have now looked at all available knitting pattern constructs in Purl. All that remains is to combine the top level elements of a knitting pattern program: sample definitions and a pattern definition. The market bag pattern given in the introduction is an example of a complete Purl program. 2.16.1 AST Node hprogrami ::= (hsampleDef i)* hpatterni In the present implementation, all sample definitions and one pattern definition must be combined in one file, with all sample definitions above the pattern definition. This is not ideal since Purl is meant to allow modularity and reusability of segments of knitting patterns, but it is sufficient for the initial implementation and experimentation. <Program Parse 114> var ProgramParse = f u n c t i o n ( ) { var program = { type : NodeType . Root , p a t t e r n : null , l i n e : S t a t e . l i n e } ; while (Sym . type == KeywordSym . Sample ) { SampleDefParse ( ) ; } program . p a t t e r n = P a t t e r n P a r s e ( ) ; r e t u r n program ; }; U SED IN: Ast Construction Pass on page 75 2.16.2 HTML Generation <Write HTML Root 115> var WriteRoot = f u n c t i o n ( node ) { r e t u r n WriteNode ( node . p a t t e r n ) ; } U SED IN: code/codegen.js on page 83 68 3 Lexical Analysis The function CreateLexer returns an object that consists of a function to get the next symbol and a function to get the current line in the code. The input is first split into an array. CreateLexer has a private method next to update the current character, position within the array, line, and position on the line. <code/lexer.js 116> var C r e a t e L e x e r = f u n c t i o n ( s r c ) { var s r c A r r = [ ] ; i f ( s r c != null ) { s r c A r r = s r c . s p l i t ( "" ) ; } var ch = s r c A r r [ 0 ] ; i f ( s r c A r r . l e n g t h == 0 ) { ch = SymType . EOF ; } var pos = 0 ; var lineNum = 1 ; var l i n e P o s = 0 ; var ne xt = f u n c t i o n ( ) { i f ( pos < s r c A r r . l e n g t h − 1 ) { pos += 1 ; l i n e P o s += 1 ; ch = s r c A r r [ pos ] ; i f ( / [ \ n\r ] / . t e s t ( ch ) ) { lineNum += 1 ; linePos = 0; 69 } } else { ch = SymType . EOF ; } }; return { <<Lexer GetLine Function 117>> , <<Lexer GetSym Function 118>> }; }; I NCLUDED B LOCKS: 117 on page 70, 118 on page 70 GetLine simply returns an object with properties for line number, line position and character position. <Lexer GetLine Function 117> GetLine : f u n c t i o n ( ) { r e t u r n { num : lineNum , pos : l i n e P o s , charPos : pos } ; } U SED IN: code/lexer.js on page 69 GetSym determines the current token by the value of the current character, skipping any whitespace characters. <Lexer GetSym Function 118> GetSym : f u n c t i o n ( ) { while ( ( / \ s/g ) . t e s t ( ch ) ) { ne xt ( ) ; } i f ( ch == SymType . EOF) { <<Lex EOF 119>> } e l s e i f ( ch == SymType . S t r i n g ) { <<Lex S t r i n g 120>> } e l s e i f (/ [0 − 9] /. t e s t ( ch ) ) { <<Lex Num 121>> } e l s e i f ( / [ a−zA−Z ] / . t e s t ( ch ) ) { <<Lex Alphanum 122>> } else { 70 <<Lex Char 123>> } r e t u r n { type : SymType . Unknown , value : SymType . Unknown } ; } U SED IN: code/lexer.js on page 69 I NCLUDED B LOCKS: 119 on page 71, 120 on page 71, 121 on page 71, 122 on page 72, 123 on page 72 If the lexer reaches the end of the input, an end of file token is returned, and the character will no longer be updated. <Lex EOF 119> r e t u r n { type : SymType . EOF , value : SymType . EOF } ; U SED IN: Lexer GetSym Function on page 70 If the current character is a double quote, then the symbol type is title, and everything until the next double quote is the value. <Lex String 120> ne xt ( ) ; var s t r = "" ; while ( ch ! = SymType . S t r i n g && ch ! = SymType . EOF) { s t r = s t r + ch ; ne xt ( ) ; } i f ( ch == SymType . S t r i n g ) { ne xt ( ) ; } r e t u r n { type : SymType . S t r i n g , value : s t r } ; U SED IN: Lexer GetSym Function on page 70 If the current character is a number, then the symbol type is a natural number and the symbol value is the concatenation of all characters until a non-numeric character. <Lex Num 121> var num = "" ; 71 while (/^[0 − 9] $ / . t e s t ( ch ) ) { num = num + ch ; ne xt ( ) ; } r e t u r n { type : SymType . Nat , value : num } ; U SED IN: Lexer GetSym Function on page 70 If the current character is a letter, concatenate all characters until the next non-alphanumeric character. If this string matches a reserved keyword, then return a symbol representing that keyword. If the string matches a regular expression in the stitch lookup, then return a symbol representing that stitch. Otherwise, return an ident symbol. <Lex Alphanum 122> var id = "" ; while ( / ^ [ a−zA−Z0 − 9]$ / . t e s t ( ch ) ) { id = id + ch ; ne xt ( ) ; } f o r ( var idSym in KeywordSym ) { i f ( id == KeywordSym [ idSym ] ) { r e t u r n { type : id , value : id } ; } } f o r ( var stSym in StitchSym ) { i f ( ( StitchSym [ stSym ] ) . t e s t ( id ) ) { r e t u r n { type : StitchSym [ stSym ] , value : id } ; } } r e t u r n { type : SymType . Ident , value : id } ; U SED IN: Lexer GetSym Function on page 70 If the current symbol is in the char symbol lookup, then if it is an asterisk, first check if the next character is also an asterisk. If a double asterisk, then we have a row repeat symbol, otherwise return the initial character symbol type and value. 72 <Lex Char 123> f o r ( var chSym in CharSym ) { i f ( ch == CharSym [ chSym ] ) { var r e s u l t = ch ; ne xt ( ) ; i f ( r e s u l t == CharSym . A s t e r i s k && ch == CharSym . A s t e r i s k ) { r e s u l t = SymType . RowRep ; ne xt ( ) ; } e l s e i f ( r e s u l t == CharSym . OpenAngle && ch == CharSym . Equal ) { r e s u l t = SymType . LessEq ; ne xt ( ) ; } e l s e i f ( r e s u l t == CharSym . CloseAngle && ch == CharSym . Equal ) { r e s u l t = SymType . GreaterEq ; ne xt ( ) ; } r e t u r n { type : r e s u l t , value : r e s u l t } ; } } U SED IN: Lexer GetSym Function on page 70 3.1 Parser <code/parser.js 124> var P a r s e r = ( f u n c t i o n ( ) { <<Ast C o n s t r u c t i o n Pass 125>> <<Sample S u b s t i t u t i o n Pass 126>> << V e r i f i c a t i o n Pass 131>> var AddMsg = f u n c t i o n ( msgType , node , msgStr ) { var msgObj = { messageType : msgType , sectionName : S t a t e . sectionName , line : State . line , rowIndex : S t a t e . rowIndex , message : msgStr }; 73 S t a t e . messages . push ( msgObj ) ; switch ( msgType ) { c a s e MsgType . E r r o r : node . hasErrorMsg = t r u e ; break ; c a s e MsgType . Warning : node . hasWarningMsg = t r u e ; break ; c a s e MsgType . V e r i f i c a t i o n : node . h a s V e r i f i c a t i o n M s g = t r u e ; break ; default : break ; } }; var S t a t e = { } ; return { P ar s e : f u n c t i o n ( input ) { S t a t e = { sectionName : null , samples : { } , messages : [ ] } ; var a s t = A s t C o n s t r u c t i o n P a s s ( input ) ; console . c l e a r ( ) ; c o n s o l e . l o g ( "PASS 1:------------------------------- \n" + JSON . s t r i n g i f y ( a s t , undefined , 2 ) ) ; c o n s o l e . l o g ( "STATE :------------------------------- \n" + JSON . s t r i n g i f y ( S t a t e , undefined , 2 ) ) ; SampleSubstitutionPass ( ast ) ; c o n s o l e . l o g ( "PASS 2:------------------------------- \n" + JSON . s t r i n g i f y ( a s t , undefined , 2 ) ) ; c o n s o l e . l o g ( "STATE :------------------------------- \n" + JSON . s t r i n g i f y ( S t a t e , undefined , 2 ) ) ; VerificationPass ( ast ) ; c o n s o l e . l o g ( "PASS 3:------------------------------- \n" + JSON . s t r i n g i f y ( a s t , undefined , 2 ) ) ; c o n s o l e . l o g ( "STATE :------------------------------- \n" + JSON . s t r i n g i f y ( S t a t e , undefined , 2 ) ) ; a s t . messages = S t a t e . messages ; State = { } ; return ast ; } }; 74 }() ) ; I NCLUDED B LOCKS: 125 on page 75, 126 on page 77, 131 on page 80 3.1.1 Pass 1: AST Construction The first pass constructs a syntax tree representing the source pattern. See 2 for details on parsing specific pattern elements. <Ast Construction Pass 125> var A s t C o n s t r u c t i o n P a s s = f u n c t i o n ( input ) { var nextSym = f u n c t i o n ( ) { Sym = Lexer . GetSym ( ) ; i f (Sym . type == SymType . EOF) { S t a t e . l i n e = null ; } else { S t a t e . l i n e = Lexer . GetLine ( ) ; } }; var scanToSym = f u n c t i o n ( symType ) { while (Sym . type ! = symType && Sym . type ! = SymType . EOF) { nextSym ( ) ; } }; var hasOwnValue = f u n c t i o n ( obj , v a l ) { f o r ( var prop in o b j ) { i f ( o b j . hasOwnProperty ( prop ) && o b j [ prop ] === v a l ) { return true ; } } return false ; }; var getNatSym = f u n c t i o n ( terminatorSym ) { var r e s u l t = { } ; i f (Sym . type == SymType . Nat ) { r e s u l t = { type : NodeType . N a t L i t e r a l , value : Sym . value } ; nextSym ( ) ; } e l s e i f (Sym . type == SymType . I d e n t ) { 75 r e s u l t = { type : NodeType . NatVariable , value : Sym . value } ; nextSym ( ) ; } else { <<Unexpected Symbol E r r o r 1>> scanToSym ( terminatorSym ) ; } return r e s u l t ; }; <<Program Parse 114>> << P a t t e r n Parse 90>> <<Cast −On Parse 2>> <<Pick −Up Parse 9>> <<Body P arse 93>> <<Row D e f i n i t i o n Parse 15>> <<Row Element Parse 27>> << S t i t c h Op Parse 28>> <<Undetermined S t i t c h Repeat Parse 72>> <<Fixed S t i t c h Repeat Parse 64>> <<Compound S t i t c h Parse 58>> << B a s i c S t i t c h Parse 32>> <<Bind−Off Parse 77>> << J o i n P arse 83>> <<Row Repeat Parse 97>> << S e c t i o n Parse 103>> <<Sample Def Parse 109>> <<Sample C a l l Parse 113>> << E x p r e s s i o n Parse 137>> <<Condition Parse 140>> var Lexer = C r e a t e L e x e r ( input ) ; var Sym ; nextSym ( ) ; i f (Sym . type == SymType . EOF) { AddMsg( MsgType . Warning , { } , "No pattern to compile :(" ) ; return { } ; } else { r e t u r n ProgramParse ( ) ; } }; 76 U SED IN: code/parser.js on page 73 I NCLUDED B LOCKS: 1 on page 6, 114 on page 68, 90 on page 53, 2 on page 7, 9 on page 10, 93 on page 55, 15 on page 13, 27 on page 19, 28 on page 20, 72 on page 44, 64 on page 40, 58 on page 37, 32 on page 23, 77 on page 47, 83 on page 50, 97 on page 58, 103 on page 61, 109 on page 65, 113 on page 67, 137 on page 90, 140 on page 92 3.1.2 Pass 2: Sample Substitution The second pass is responsible for replacing all sample call nodes with the children of the corresponding sample definition, and updating parameter values according to the paramMap object of each sample call. The AST is traversed depth first in this pass and the function SampleSubstitutionPass starts by traversing the children of the pattern node with an empty object as the paramMap. <Sample Substitution Pass 126> var S a m p l e S u b s t i t u t i o n P a s s = f u n c t i o n ( a s t ) { <<Pass 2 T r a v e r s e Children 127>> <<Pass 2 Sample C a l l Children 129>> <<Pass 2 Update E x p r e s s i o n s 130>> <<Pass 2 Update Condition 141>> var paramMap = { } ; i f ( a s t . type == NodeType . Root ) { i f ( a s t . pattern != null ) { T r a v e r s e C h i l d r e n ( a s t . p a t t e r n , paramMap ) ; } } }; U SED IN: code/parser.js on page 73 I NCLUDED B LOCKS: 127 on page 77, 129 on page 79, 130 on page 80, 141 on page 93 All row and stitch constructs require any expressions to have variables updated, and for nodes with children, the child nodes are then traversed. <Pass 2 Traverse Children 127> var T r a v e r s e C h i l d r e n = f u n c t i o n ( node , paramMap ) { i f ( node . c h i l d r e n ! = n u l l ) { f o r ( var i = 0 ; i < node . c h i l d r e n . l e n g t h ; i ++) { var c h i l d = node . c h i l d r e n [ i ] ; switch ( c h i l d . type ) { c a s e NodeType . S e c t i o n : 77 T r a v e r s e C h i l d r e n ( c h i l d , paramMap ) ; break ; c a s e NodeType . SampleCall : <<Pass 2 Replace Sample C a l l 128>> break ; c a s e NodeType . Branch : UpdateCondition ( c h i l d . c o n d i t i o n , paramMap ) ; i f ( c h i l d . c o n d i t i o n . doBranch ) { T r a v e r s e C h i l d r e n ( c h i l d , paramMap ) ; node . c h i l d r e n = c h i l d . c h i l d r e n ; return ; } break ; c a s e NodeType . Row : c a s e NodeType . RowRep : c a s e NodeType . FixedStRep : c a s e NodeType . UStRep : c a s e NodeType . CompSt : UpdateExpressions ( c h i l d , paramMap ) ; T r a v e r s e C h i l d r e n ( c h i l d , paramMap ) ; break ; c a s e NodeType . Knit : c a s e NodeType . P u r l : c a s e NodeType . KnitTBL : c a s e NodeType . PurlTBL : c a s e NodeType . KnitBelow : c a s e NodeType . PurlBelow : c a s e NodeType . S l i p : c a s e NodeType . SlipKW : c a s e NodeType . SlipPW : c a s e NodeType . YarnOver : c a s e NodeType . KnitFB : c a s e NodeType . PurlFB : c a s e NodeType . Make : c a s e NodeType . MakeL : c a s e NodeType . MakeR : c a s e NodeType . KnitTog : c a s e NodeType . PurlTog : c a s e NodeType . SSK : c a s e NodeType . SSP : c a s e NodeType . PSSO : 78 UpdateExpressions ( c h i l d , paramMap ) ; break ; c a s e NodeType . N a t V a r i a b l e : var f i r s t = node . c h i l d r e n . s l i c e ( 0 , i ) ; var l a s t = node . c h i l d r e n . s l i c e ( i + 1 ) ; var exprChildren = paramMap [ c h i l d . value ] . c h i l d r e n ; node . c h i l d r e n = f i r s t . c o n c a t ( exprChildren . c o n c a t ( l a s t ) ) ; i += exprChildren . l e n g t h − 1 ; break ; default : break ; } } } }; U SED IN: Sample Substitution Pass on page 77 I NCLUDED B LOCKS: 128 on page 79 When traversing the children of a node, if we find a sample call then we need to remove the sample call node from the tree. <Pass 2 Replace Sample Call 128> var f i r s t = node . c h i l d r e n . s l i c e ( 0 , i ) ; var l a s t = node . c h i l d r e n . s l i c e ( i + 1 ) ; var sampleChildren = GetSampleCallChildren ( c h i l d , paramMap ) ; node . c h i l d r e n = f i r s t . c o n c a t ( sampleChildren . c o n c a t ( l a s t ) ) ; i += sampleChildren . l e n g t h − 1 U SED IN: Pass 2 Traverse Children on page 77 However, before the sample call node can be replaced we must acquire a deep copy of the children of the corresponding sample definition. These children are set as the children of the sample call node, which we then traverse to update their expressions and sample calls. To avoid naming conflicts, a localMap object is created as a deep copy of the parent node’s paramMap. The paramMap object of the current node must have its expressions updated according to the local map. The localMap is then updated with the current node’s updated paramMap and passed on when traversing the children of the sample call. <Pass 2 Sample Call Children 129> 79 var GetSampleCallChildren = f u n c t i o n ( node , paramMap ) { var localMap = jQuery . extend ( true , { } , paramMap ) ; f o r ( var domainVal in node . paramMap ) { T r a v e r s e C h i l d r e n ( node . paramMap [ domainVal ] , localMap ) ; localMap [ domainVal ] = node . paramMap [ domainVal ] ; } var sampleDef = jQuery . extend ( true , { } , S t a t e . samples [ node . name ] ) ; node . c h i l d r e n = sampleDef . c h i l d r e n ; T r a v e r s e C h i l d r e n ( node , localMap ) ; r e t u r n node . c h i l d r e n ; }; U SED IN: Sample Substitution Pass on page 77 There are only two properties that currently allow natural number expressions: repCount and num. If a node has either of these properties, then the expression is updated according to the passed paramMap. <Pass 2 Update Expressions 130> var UpdateExpressions = f u n c t i o n ( node , paramMap ) { i f ( node . repCount ! = n u l l && node . repCount . type == NodeType . E x p r e s s i o n ) { T r a v e r s e C h i l d r e n ( node . repCount , paramMap ) ; } i f ( node . num ! = n u l l && node . num . type == NodeType . V a r i a b l e ) { T r a v e r s e C h i l d r e n ( node . num, paramMap ) ; } }; U SED IN: Sample Substitution Pass on page 77 3.1.3 Pass 3: Pattern Verification The third pass traverses the syntax tree and determines if there are structural issues with the pattern. See 2 for details on verification of specific pattern elements. <Verification Pass 131> var V e r i f i c a t i o n P a s s = f u n c t i o n ( a s t ) { 80 << V e r i f y P a t t e r n 91>> << V e r i f y S e c t i o n 104>> << V e r i f y Cast −On 7>> << V e r i f y Pick −Up 13>> << V e r i f y Bind−Off 78>> << V e r i f y J o i n 84>> << V e r i f y Row 25>> << V e r i f y Row Elem Children o f Node 22>> << V e r i f y Row Elem 29>> << V e r i f y E x p r e s s i o n 138>> var V e r i f y C h i l d r e n = f u n c t i o n ( node ) { i f ( node . c h i l d r e n ! = n u l l ) { f o r ( var i = 0 ; i < node . c h i l d r e n . l e n g t h ; i ++) { VerifyNode ( node . c h i l d r e n [ i ] ) ; } } }; var VerifyNode = f u n c t i o n ( node ) { S t a t e . l i n e = node . l i n e ; switch ( node . type ) { c a s e NodeType . Root : VerifyNode ( node . p a t t e r n ) ; break ; c a s e NodeType . P a t t e r n : V e r i f y P a t t e r n ( node ) ; break ; c a s e NodeType . S e c t i o n : V e r i f y S e c t i o n ( node ) ; break ; c a s e NodeType . CastOn : VerifyCastOn ( node ) ; break ; c a s e NodeType . PickUp : VerifyPickUp ( node ) ; break ; c a s e NodeType . BindOff : V e r i f y B i n d O f f ( node ) ; break ; c a s e NodeType . J o i n : 81 V e r i f y J o i n ( node ) ; break ; c a s e NodeType . Row : VerifyRow ( node ) ; break ; c a s e NodeType . RowRep : V e r i f y E x p r e s s i o n ( node . repCount ) ; V e r i f y C h i l d r e n ( node ) ; break ; c a s e NodeType . E x p r e s s i o n : V e r i f y E x p r e s s i o n ( node ) ; break ; default : break ; } }; VerifyNode ( a s t ) ; }; U SED IN: code/parser.js on page 73 I NCLUDED B LOCKS: 91 on page 54, 104 on page 62, 7 on page 9, 13 on page 12, 78 on page 48, 84 on page 51, 25 on page 17, 22 on page 16, 29 on page 20, 138 on page 91 82 4 Code Generation 4.1 HTML The back end for the Purl compiler generates HTML code representing the pattern. Given an abstract syntax tree, ast, representing a knitting pattern, PatternTextWriterHTML.Generate(ast) returns HTML to display the knitting pattern according to the knitting pattern standard [1]. Each pattern element is usually contained within a div with a corresponding class name. There are also tags added for pattern and section names. The order in which elements of a pattern are written is the same as has been seen for all passes of the compiler. See 2 for details on code generation of specific pattern elements. <code/codegen.js 132> var PatternTextWriterHTML = ( f u n c t i o n ( ) { <<Code Gen Types 133>> <<Code Gen Tag Writing F u n c t i o n s 134>> <<Write HTML Node 136>> <<Write HTML Root 115>> <<Write HTML P a t t e r n 92>> <<Write HTML S e c t i o n 105>> <<Write HTML Cast −On 8>> <<Write HTML Pick −Up 14>> <<Write HTML Bind−Off 79>> <<Write HTML J o i n 85>> <<Write HTML Body 94>> <<Write HTML Row 26>> <<Write HTML B a s i c S t i t c h 54>> <<Write HTML Undetermined S t i t c h Repeat 74>> <<Write HTML Fixed S t i t c h Repeat 66>> <<Write HTML Compound S t i t c h 60>> <<Write HTML Row Repeat 98>> 83 return { Generate : f u n c t i o n ( a s t ) { r e t u r n WriteRoot ( a s t ) ; } } }) () ; I NCLUDED B LOCKS: 133 on page 84, 134 on page 85, 136 on page 85, 115 on page 68, 92 on page 54, 105 on page 62, 8 on page 10, 14 on page 13, 79 on page 48, 85 on page 51, 94 on page 56, 26 on page 18, 54 on page 33, 74 on page 45, 66 on page 41, 60 on page 38, 98 on page 58 Only div and span tag types are used, and a class type is associated with each pattern node in the output language (used for styling). <Code Gen Types 133> var ClassType = { Pattern : " pattern " , PatternName : " patternname " , P a t t e r n N o te : " patternnote " , SectionName : " sectionname " , S e c t i o n N o t e : " sectionnote " , CastOn : " caston " , CastOnNote : " castonnote " , PickUp : " pickup " , Body : "body" , Row : "row" , RowNote : " rownote " , RowRep : " rowrepeat " , S t i t c h C o u n t : " stitchcount " , S t i t c h : " stitch " , BindOff : " bindoff " , BindOffNote : " bindoffnote " , J o i n : "join" , E r r o r : "error " , Warning : " warning " , V e r i f i c a t i o n : " verification " } var TagType = { Div : "div" , Span : "span" } U SED IN: code/codegen.js on page 83 84 The following functions are used by the code generation module to create the HTML tags. <Code Gen Tag Writing Functions 134> var AddElement = f u n c t i o n ( tag , classType , t e x t ) { r e t u r n OpenElement ( tag , c l a s s T y p e ) + t e x t + CloseElement ( t a g ) ; } var OpenElement = f u n c t i o n ( tag , c l a s s T y p e ) { r e t u r n "<" + t a g + " class =\"" + c l a s s T y p e + "\">" ; } var CloseElement = f u n c t i o n ( t a g ) { r e t u r n " </" + t a g + ">" ; } U SED IN: code/codegen.js on page 83 The function WriteNode first checks if a node has any messages, and if so, an error tag is added to the result. <Mark Node Message 135> i f ( node . hasErrorMsg ) { r e s u l t = AddElement ( TagType . Span , ClassType . Error , "!" ) ; } i f ( node . hasWarningMsg ) { r e s u l t = AddElement ( TagType . Span , ClassType . Warning , "!" ) ; } i f ( node . h a s V e r i f i c a t i o n M s g ) { r e s u l t = AddElement ( TagType . Span , ClassType . V e r i f i c a t i o n , "!" ) ; } U SED IN: Write HTML Node on page 85 The appropriate node writing function is then called based on the node type. <Write HTML Node 136> var WriteNode = f u n c t i o n ( node ) { var r e s u l t = "" ; i f ( node == n u l l ) { 85 return r e s u l t ; } <<Mark Node Message 135>> switch ( node . type ) { c a s e NodeType . Root : r e s u l t += WriteRoot ( node ) ; break ; c a s e NodeType . P a t t e r n : r e s u l t += W r i t e P a t t e r n ( node ) ; break ; c a s e NodeType . S e c t i o n : r e s u l t += W r i t e S e c t i o n ( node ) ; break ; c a s e NodeType . CastOn : r e s u l t += WriteCo ( node ) ; break ; c a s e NodeType . PickUp : r e s u l t += WritePu ( node ) ; break ; c a s e NodeType . BindOff : r e s u l t += WriteBo ( node ) ; break ; c a s e NodeType . J o i n : r e s u l t += W r i t e J o i n ( node ) ; break ; c a s e NodeType . Row : r e s u l t += WriteRow ( node ) ; break ; c a s e NodeType . RowRep : r e s u l t += WriteRowRep ( node ) ; break ; c a s e NodeType . FixedStRep : r e s u l t += WriteFixedStRep ( node ) ; 86 break ; c a s e NodeType . UStRep : r e s u l t += WriteUStRep ( node ) ; break ; c a s e NodeType . CompSt : r e s u l t += WriteCompSt ( node ) ; break ; c a s e NodeType . Knit : c a s e NodeType . P u r l : c a s e NodeType . KnitTBL : c a s e NodeType . PurlTBL : c a s e NodeType . KnitBelow : c a s e NodeType . PurlBelow : c a s e NodeType . S l i p : c a s e NodeType . SlipKW : c a s e NodeType . SlipPW : c a s e NodeType . YarnOver : c a s e NodeType . KnitFB : c a s e NodeType . PurlFB : c a s e NodeType . Make : c a s e NodeType . MakeL : c a s e NodeType . MakeR : c a s e NodeType . KnitTog : c a s e NodeType . PurlTog : c a s e NodeType . SSK : c a s e NodeType . SSP : c a s e NodeType . PSSO : r e s u l t += W r i t e B a s i c S t i t c h ( node ) ; break ; default : break ; } return r e s u l t ; }; U SED IN: code/codegen.js on page 83 I NCLUDED B LOCKS: 135 on page 85 87 5 Discussion The language Purl provides a format for reuse and efficient storage of knitting patterns, with the compiler generating an assembled and formatted pattern for use by a knitter. In its present state, this project is a good foundation for writing knitting patterns, but many desirable features are still missing. Some planned components were removed from this initial implementation due to time constraints and a desire to give each component the time and thought deserved for a proper implementation. Below are listed the postponed features and next steps of this project, in approximate order of priority. Preconditions/Postconditions User defined requirements are a natural component for the knitting pattern samples construct. This concept requires more research and planning than initially anticipated. This is the top priority next large feature. Test Page The test page provided gives an idea of how the language works, but for practical purposes, the following will be necessary: • Load pattern files for compilation • Allow pattern compilation over multiple files (pattern samples would then be reusable in multiple patterns) • Save feature to download target pattern in pdf format Charts Originally the compiler was planned to have code generation to patterns in both the standard text notation and the chart notation [1]. Charts are written and read in a style that is very different from text patterns, with column repeats as well as row repeats, and alternating rows requiring the visual reverse of the written stitch to be performed. A large amount of optimization would have been required to make a pattern that is “concise” in Purl be output in a chart that is a reasonable size. Small Updates In a productive pattern design setting, the following would be desirable: • Display of pattern attributes such as designer name, date, recommended yarn, and needles • Commenting in the pattern source file • Notes on the target pattern 88 Appendices 89 Appendix A Extra Productions A.1 Expressions Expressions currently only allow for addition of natural number literals and variables. hexpri ::= (hIdenti | hNati) ( ‘+’ (hIdenti | hNati) )* An expression node contains children which are objects of type NodeType.NatLiteral or NodeType.NatVariable. <Expression Parse 137> var E x p r e s s i o n P a r s e = f u n c t i o n ( terminatorSym ) { var node = { type : NodeType . Expression , c h i l d r e n : [ ] } ; i f (Sym . type == SymType . Nat || Sym . type == SymType . I d e n t ) { node . c h i l d r e n . push ( getNatSym ( terminatorSym ) ) ; while (Sym . type == CharSym . PlusOp ) { nextSym ( ) ; node . c h i l d r e n . push ( getNatSym ( terminatorSym ) ) ; } } r e t u r n node ; }; U SED IN: Ast Construction Pass on page 75 90 An expression is verified by adding the values of the children (all of which should be natural number literals at the verification pass), and setting the value of the expression node. <Verify Expression 138> var V e r i f y E x p r e s s i o n = f u n c t i o n ( node ) { node . value = 0 ; i f ( node . c h i l d r e n ! = n u l l ) { f o r ( var i = 0 ; i < node . c h i l d r e n . l e n g t h ; i ++) { node . value += p a r s e I n t ( node . c h i l d r e n [ i ] . value , 1 0 ) ; } } }; U SED IN: Verification Pass on page 80 <Write Expression 139> var W r i t e E x p r e s s i o n = f u n c t i o n ( natObj ) { var r e s u l t = [ ] ; var r e s u l t V a l = 0 ; i f ( natObj . c h i l d r e n ! = n u l l ) { f o r ( var i = 0 ; i < natObj . c h i l d r e n . l e n g t h ; i ++) { var c h i l d = natObj . c h i l d r e n [ i ] ; i f ( c h i l d . type == NodeType . NatVar ) { r e s u l t V a l += c h i l d . value ; } e l s e i f ( c h i l d . type == NodeType . N a t L i t ) { r e s u l t . push ( c h i l d . value ) ; } } } r e s u l t . push ( r e s u l t V a l ) ; r e t u r n r e s u l t . j o i n ( "+" ) ; } 91 A.2 Condition hconditioni ::= hexpri ( ‘=’ | ‘<’ | ‘<=’ | ‘>’ | ‘>=’ ) hexpri A condition node includes a property for the comparison operator and a node the the left and a node for the right of the operator. <Condition Parse 140> var C o n d i t i on P a r s e = f u n c t i o n ( ) { var node = { type : NodeType . Condition } ; i f (Sym . type == SymType . Nat || Sym . type == SymType . I d e n t ) { node . nodeL = E x p r e s s i o n P a r s e ( ) ; } switch (Sym . type ) { c a s e CharSym . Equal : node . comparison = CompareType . Equal ; nextSym ( ) ; break ; c a s e CharSym . OpenAngle : node . comparison = CompareType . Less ; nextSym ( ) ; break ; c a s e CharSym . CloseAngle : node . comparison = CompareType . G r e a t e r ; nextSym ( ) ; break ; c a s e SymType . LessEq : node . comparison = CompareType . LessEq ; nextSym ( ) ; break ; c a s e SymType . GreaterEq : node . comparison = CompareType . GreaterEq ; nextSym ( ) ; break ; default : break ; } i f (Sym . type == SymType . Nat || Sym . type == SymType . I d e n t ) { node . nodeR = E x p r e s s i o n P a r s e ( ) ; } 92 r e t u r n node ; }; U SED IN: Ast Construction Pass on page 75 <Pass 2 Update Condition 141> var UpdateCondition = f u n c t i o n ( node , paramMap ) { T r a v e r s e C h i l d r e n ( node . nodeL , paramMap ) ; T r a v e r s e C h i l d r e n ( node . nodeR , paramMap ) ; node . nodeL . value = 0 ; i f ( node . nodeL . c h i l d r e n ! = n u l l ) { f o r ( var i = 0 ; i < node . nodeL . c h i l d r e n . l e n g t h ; i ++) { node . nodeL . value += p a r s e I n t ( node . nodeL . c h i l d r e n [ i ] . value ) ; } } node . nodeR . value = 0 ; i f ( node . nodeR . c h i l d r e n ! = n u l l ) { f o r ( var i = 0 ; i < node . nodeR . c h i l d r e n . l e n g t h ; i ++) { node . nodeR . value += p a r s e I n t ( node . nodeR . c h i l d r e n [ i ] . value ) ; } } switch ( node . comparison ) { c a s e CompareType . Equal : node . doBranch = ( node . nodeL . value == node . nodeR . value ) ; break ; c a s e CompareType . Less : node . doBranch = ( node . nodeL . value < node . nodeR . value ) ; break ; c a s e CompareType . LessEq : node . doBranch = ( node . nodeL . value <= node . nodeR . value ) ; break ; c a s e CompareType . G r e a t e r : node . doBranch = ( node . nodeL . value > node . nodeR . value ) ; break ; c a s e CompareType . GreaterEq : node . doBranch = ( node . nodeL . value >= node . nodeR . value ) ; break ; default : node . doBranch = f a l s e ; 93 break ; } }; U SED IN: Sample Substitution Pass on page 77 94 Appendix B Compiler Types Below are types used throughout the compiler. B.1 Parser Types <code/util.js 142> var SideType = { RS : "RS" , WS : "WS" }; var CoType = { Flat : "flat" , Circular : " circular " , Prov : " provisional " }; var RowType = { Row : "row" , Rnd : "rnd" }; var ColorType = { Main Contrast : "MC" , : "CC" }; var YarnPosType = { Fro nt : "wyif" , 95 Back : "wyib" }; var NodeType = { Root : "Root" , Pattern : " Pattern " , Section : " Section " , CastOn : "CO" , PickUp : "PU" , BindOff Join Row RowRep SampleDef : "BO" , : "Join" , : "Row" , : " RowRepeat " , : " SampleDef " , SampleCall : " SampleCall " , FixedStRep : " FixedStRep " , UStRep : " UndeterminedStRep " , CompSt : " CompSt " , Knit Purl : "K" , : "P" , KnitTBL : "KB" , PurlTBL : "PB" , KnitBelow : " KBelow " , PurlBelow : " PBelow " , Slip : "S" , SlipKW : "SK" , SlipPW : "SP" , YarnOver : "YO" , KnitFB : "KFB" , PurlFB : "PFB" , Make : "M" , MakeL : "ML" , MakeR : "MR" , KnitTog : "KT" , PurlTog : "PT" , SSK : "SSK" , SSP : "SSP" , PSSO : "PSSO" , Expression : "expr" , NatLiteral : " NatLit " , N a t V a r i a b l e : " NatVar " , Branch : " Branch " }; var MsgType = { 96 Error : "error - message " , Warning : "warning - message " , Verification : " verification - message " }; var CompareType = { Equal : "eq" , Less : "lt" , LessEq : "leq" , G r e a t e r : "gt" , GreaterEq : "geq" }; PARTS OF THIS B LOCK: 142 on page 95, 143 on page 97 B.2 Symbol Lookup Types <code/util.js 143> var CharSym = { Comma : ’,’ , Period : ’.’ , Colon : ’:’ , Asterisk : ’*’ , PlusOp : ’+’ , MinusOp : ’-’ , Semicolon : ’;’ , OpenParen : ’(’ , CloseParen : ’)’ , OpenBrack : ’[’ , CloseBrack : ’]’ , OpenAngle : ’<’ , CloseAngle : ’>’ , VerticalBar : ’|’ , Equal : ’=’ }; var SymType = { Nat : "nat" , Ident : "ident" , String RowRep LessEq : "\"" , : "**" , : "leq" , 97 GreaterEq : "geq" , EOF : "!EOF" , Unknown : "? unknown " }; var KeywordSym = { Pattern : " pattern " , CastOn : "CO" , PickUp : "PU" , BindOff : "BO" , Join : "Join" , CastOnCirc : " circular " , CastOnProv : " provisional " , Section : " section " , Sample : " sample " , From : "from" , To : "to" , Last : "last" , End : "end" , Row : "row" , Rnd : "rnd" , Repeat : " repeat " , With : "with" , YarnInFront : "wyif" , YarnInBack : "wyib" , ColorMain : "MC" , C o l o r C o n t r a s t : "CC" }; var StitchSym = { Knit : /^K$/ , Purl : /^P$ / , KnitTBL : /^KB$/ , PurlTBL : /^PB$ / , KnitBelow : /^K[1 − 9][0 − 9]∗ B$ / , PurlBelow : /^P[1 − 9][0 − 9]∗ B$ / , Slip : /^S$ / , SlipKW : /^SK$/ , SlipPW : /^SP$ / , // Increases : YarnOver : /^YO$/ , KnitFB : /^KFB$/ , PurlFB : /^PFB$ / , Make : /^M[1 − 9][0 − 9]∗ $ / , MakeL : /^M[1 − 9][0 − 9]∗ L$ / , 98 MakeR : /^M[1 − 9][0 − 9]∗R$/ , // Decreases : KnitTog : /^K[1 − 9][0 − 9]∗ T$ / , PurlTog : /^P[1 − 9][0 − 9]∗ T$ / , SSK : /^SSK$ / , SSP : /^SSP$ / , PSSO : /^PSSO$/ }; PARTS OF THIS B LOCK: 142 on page 95, 143 on page 97 99 Appendix C Built-In Examples and Tests A number of pattern examples and tests are provided on the web page. These tests are intended to show the variety of features available in the language but are not exhaustive. <Project Display Board Pattern 144> sample edging with r : ∗∗ row : ∗K ; t o end . repeat r sample s e e d S t i t c h B o r d e r e d with r : ∗∗ row : K 2 , ∗P , K ; t o l a s t 3 , P , K 2 . repeat r p a t t e r n " Project Display Board" : CO 7 9 . edging with 4 . s e e d S t i t c h B o r d e r e d with 7 0 . edging with 4 . BO 7 9 . U SED IN: Pattern Tests on page 106 <Market Bag Pattern 145> sample c i r c l e X with n , max | n < max : rnd : [K, YO, K n , YO, K] 4 . rnd : ∗K ; t o end . c i r c l e X with n + 2 , max . 100 sample diagonalLace with n : ∗∗ rnd : ∗K2T , YO; t o end . rnd : ∗K ; t o end . repeat n sample g a r t e r S t i t c h C C with n , type | type = 0 : ∗∗ row CC : ∗K ; t o end . row CC : ∗P ; t o end . repeat n | type = 1 : ∗∗ rnd CC : ∗K ; t o end . rnd CC : ∗P ; t o end . repeat n p a t t e r n " Market Bag" : s e c t i o n "Body" : CO 8 c i r c u l a r . rnd : ∗K, YO, K ; t o end . rnd : ∗K ; t o end . c i r c l e X with 1 , 2 3 . diag onalLa ce with 3 0 . g a r t e r S t i t c h C C with 4 , 1 . BO 1 0 0 . s e c t i o n " Handle " : PU 10 from "Body top" . g a r t e r S t i t c h C C with 2 , 0 . row : K, K2T , K 4 , K2T , K . g a r t e r S t i t c h C C with 1 0 0 , 0 . row : K, M1, K 6 , M1, K . g a r t e r S t i t c h C C with 2 , 0 . J o i n 10 t o "Body top" . U SED IN: Pattern Tests on page 106 <Shawl Pattern 146> sample shawlRep with m: row : K 2 , YO, K m, YO, K, YO, K m, YO, K 2 . 101 row : K 2 , ∗P ; t o l a s t 2 , K 2 . row : K 2 , YO, P m + 2 , YO, K, YO, P m + 2 , YO, K 2 . row : K 2 , ∗P ; t o l a s t 2 , K 2 . sample shawlBody with m | m > 10: shawlRep with m. | m <= 1 0 : shawlRep with m. shawlBody with m + 4 . p a t t e r n " Shawl " : CO 7 . shawlBody with 1 . BO 3 9 . U SED IN: Pattern Tests on page 106 <Basic Stitches Test 147> p a t t e r n " Basic Sts" : CO 4 0 . row : K 4 0 . row : P 4 0 . row : KB 4 0 . row : PB 4 0 . row : K1B 4 0 . row : P1B 4 0 . row : S 4 0 . row : SK 4 0 . row : SP 4 0 . row : K2T 2 0 . row : P2T 1 0 . row : SSK 5 . row : SSP 2 , P . row : S , K, PSSO , K . row : K, YO, K . row : KFB 3 . row : PFB 6 . row : K, M1, K 1 1 . row : K, M1L, K 1 2 . row : K, M1R, K 1 3 . BO 1 5 . 102 U SED IN: Pattern Tests on page 106 <Compound Stitch Test 148> p a t t e r n " Compound Stitch Test" : CO 2 0 . row : & l t K, P &gt , K 1 9 . BO 2 0 . U SED IN: Pattern Tests on page 106 <Fixed Stitch Repeat Test 149> p a t t e r n " Fixed Stitch Repeat Test" : CO 1 8 . row : [K, P , K] 6 . BO 1 8 . U SED IN: Pattern Tests on page 106 <Undetermined Stitch Repeat Test 150> p a t t e r n " Undetermined Stitch Repeat Test" : CO 1 0 0 . row : ∗K, P ; t o end . row : K, ∗P ; t o l a s t 1 , K . BO 1 0 0 . U SED IN: Pattern Tests on page 106 <Row Repeat Test 151> p a t t e r n "Row Repeat Test" : CO 1 0 . ∗∗ row : ∗K ; t o end . repeat 2 BO 1 0 . U SED IN: Pattern Tests on page 106 103 <Section Test 152> p a t t e r n " Section Test" : s e c t i o n " first section " : CO 2 0 . row : K 2 0 . BO 2 0 . s e c t i o n " second section " : CO 5 . row : K, P 3 , K . BO 5 . U SED IN: Pattern Tests on page 106 <Sample Test 153> sample s t o c k i n e t t e with m, n : ∗∗ row : K m. repeat n p a t t e r n " Sample Test" : CO 2 0 . s t o c k i n e t t e with 2 0 , 3 . BO 2 0 . U SED IN: Pattern Tests on page 106 <Sample Branch Test 154> sample sampleBranch with m, n | m = 0: row : K n . | m > 0: row : P n . p a t t e r n " Branch Test" : CO 4 . sampleBranch with 0 , 4 . sampleBranch with 1 , 4 . BO 4 . U SED IN: Pattern Tests on page 106 104 <Recursive Sample Test 155> sample r e c u r s i v e S a m p l e with m, n | m <= n : row : P m, ∗K ; t o end . r e c u r s i v e S a m p l e with m + 1 , n . | m > n: row : ∗K ; t o end . p a t t e r n " Sample Recursion " : CO 2 0 . r e c u r s i v e S a m p l e with 1 , 1 0 . BO 2 0 . U SED IN: Pattern Tests on page 106 <Row Type Test 156> p a t t e r n "Row Type Test" : CO 2 0 . rnd : K 2 0 . row : P 2 0 . BO 2 0 . U SED IN: Pattern Tests on page 106 <Color Options Test 157> p a t t e r n " Color Test" : CO 2 0 . row MC : K 2 0 . row CC : P 2 0 . BO 2 0 . U SED IN: Pattern Tests on page 106 <Errors Test 158> p a t e r n " Error Test" : CO 2 0 . row MC : K 2 0 . row CC : P 1 9 . row : k n i t BO 2 0 . 105 U SED IN: Pattern Tests on page 106 <Pattern Tests 159> <div i d=" tests "> <in pu t type=" button " value="Shawl " o n c l i c k =" javascript : loadTest (test0);" /> <div i d=" test0 " c l a s s ="pattern - example "> <<Shawl P a t t e r n 146>> </div > <in pu t type=" button " value=" Market Bag" o n c l i c k =" javascript : loadTest ( test01 );" /> <div i d=" test01 " c l a s s ="pattern - example "> <<Market Bag P a t t e r n 145>> </div > <in pu t type=" button " value=" Project Display Board" o n c l i c k =" javascript : loadTest ( test02 );" /> <div i d=" test02 " c l a s s ="pattern - example "> << P r o j e c t Display Board P a t t e r n 144>> </div > <in pu t type=" button " value="Basic Stitches " o n c l i c k =" javascript : loadTest (test1);" /> <div i d=" test1 " c l a s s ="test"> << B a s i c S t i t c h e s T e s t 147>> </div > <in pu t type=" button " value=" Compound Stitch " o n c l i c k =" javascript : loadTest (test2);" /> <div i d=" test2 " c l a s s ="test"> <<Compound S t i t c h T e s t 148>> </div > <in pu t type=" button " value="Fixed Stitch Rep" o n c l i c k =" javascript : loadTest (test3);" /> <div i d=" test3 " c l a s s ="test"> <<Fixed S t i t c h Repeat T e s t 149>> </div > <in pu t type=" button " value=" Undetermined Stitch Rep" o n c l i c k =" javascript : loadTest ( test4 );" /> <div i d=" test4 " c l a s s ="test"> <<Undetermined S t i t c h Repeat T e s t 150>> </div > <in pu t type=" button " value="Row Repeat " o n c l i c k =" javascript : loadTest (test5);" /> <div i d=" test5 " c l a s s ="test"> 106 <<Row Repeat T e s t 151>> </div > <in pu t type=" button " value=" Sections " o n c l i c k =" javascript : loadTest (test6);" /> <div i d=" test6 " c l a s s ="test"> << S e c t i o n T e s t 152>> </div > <in pu t type=" button " value=" Sample " o n c l i c k =" javascript : loadTest (test7);" /> <div i d=" test7 " c l a s s ="test"> <<Sample T e s t 153>> </div > <in pu t type=" button " value=" Sample Recursion " o n c l i c k =" javascript : loadTest ( test71 );" /> <div i d=" test71 " c l a s s ="test"> << R e c u r s i v e Sample T e s t 155>> </div > <in pu t type=" button " value=" Sample Branch " o n c l i c k =" javascript : loadTest ( test72 );" /> <div i d=" test72 " c l a s s ="test"> <<Sample Branch T e s t 154>> </div > <in pu t type=" button " value="Row Type" o n c l i c k =" javascript : loadTest (test8);" /> <div i d=" test8 " c l a s s ="test"> <<Row Type T e s t 156>> </div > <in pu t type=" button " value="Color Options " o n c l i c k =" javascript : loadTest (test9);" /> <div i d=" test9 " c l a s s ="test"> <<Color Options T e s t 157>> </div > <in pu t type=" button " value=" Errors " o n c l i c k =" javascript : loadTest ( test10 );" /> <div i d=" test10 " c l a s s ="test"> << E r r o r s T e s t 158>> </div > </div > U SED IN: code/index.html on page 108 I NCLUDED B LOCKS: 146 on page 101, 145 on page 100, 144 on page 100, 147 on page 102, 148 on page 103, 149 on page 103, 150 on page 103, 151 on page 103, 152 on page 104, 153 on page 104, 155 on page 105, 154 on page 104, 156 on page 105, 157 on page 105, 158 on page 105 107 Appendix D Test Page DOM <code/index.html 160> < !DOCTYPE html> <html> <head> < l i n k r e l =" stylesheet " type="text/css" h r e f=" styles /main.css"/> < l i n k r e l =" stylesheet " type="text/css" h r e f=" styles / pattern .css"/> < s c r i p t type="text/ javascript " s r c ="http :// code. jquery .com/jquery -2.1.0. min.js"> </ s c r i p t > < s c r i p t type="text/ javascript " s r c ="util.js"></ s c r i p t > < s c r i p t type="text/ javascript " s r c ="lexer .js"></ s c r i p t > < s c r i p t type="text/ javascript " s r c =" parser .js"></ s c r i p t > < s c r i p t type="text/ javascript " s r c =" codegen .js"></ s c r i p t > <script> function loadTest ( idStr ) { $ ( "#pattern -entry " ) . v a l ( $ ( i d S t r ) . t e x t ( ) . t r i m ( ) ) ; } f u n c t i o n showMessages ( msgArr ) { f o r ( var i = 0 ; i < msgArr . l e n g t h ; i ++) { var msgObj = msgArr [ i ] ; var msg = [ ] ; i f ( msgObj . sectionName ! = n u l l && msgObj . sectionName ! = "" ) { msg . push ( " Section : \’" + msgObj . sectionName + "\’" ) ; } i f ( msgObj . rowIndex > 0 ) { msg . push ( "Row: " + msgObj . rowIndex ) ; 108 } var c u r s o r P o s = 0 ; i f ( msgObj . l i n e ! = n u l l ) { msg . push ( "Line: " + msgObj . l i n e . num + ":" + msgObj . l i n e . pos ) ; c u r s o r P o s = msgObj . l i n e . charPos ; } msg . push ( msgObj . message ) ; var c l a s s S t r = " class =\"" + msgObj . messageType + "\"" ; var v a l u e S t r = " value =\"" + msg.join(" , ") + "\"" ; var o n c l i c k = " onclick =\" j a v a s c r i p t : moveCursor ( " + cursorPos + " ) ; \ "" ; var t a g S t r = "<input type =\" button\"" + c l a s s S t r + v a l u e S t r + o n c l i c k + "/>" ; $ ( "#message - display ul" ) . append ( "<li >" + t a g S t r + " </li >" ) ; } } f u n c t i o n moveCursor ( pos ) { document . getElementById ( "pattern -entry " ) . s e l e c t i o n S t a r t = pos ; document . getElementById ( "pattern -entry " ) . s e l e c t i o n E n d = pos ; $ ( "#pattern -entry " ) . f o c u s ( ) ; } $ ( document ) . ready ( f u n c t i o n ( ) { $ ( "# compile input" ) . c l i c k ( f u n c t i o n ( ) { $ ( "#pattern - display " ) . empty ( ) ; $ ( "#message - display ul" ) . empty ( ) ; var r o o t = P a r s e r . Parse ( $ ( "#pattern -entry " ) . v a l ( ) ) i f ( r o o t . messages . l e n g t h > 0 ) { showMessages ( r o o t . messages ) ; } var output = PatternTextWriterHTML . Generate ( r o o t ) ; $ ( "#pattern - display " ) . prepend ( output ) ; }) ; }) ; </ s c r i p t > </head> <body> <div id=" header "> <h1>P u r l</h1> 109 </div> <div id="left - content "> <div id="left -content - wrapper "> <div id="entry - wrapper "> < t e x t a r e a id="pattern -entry" s p e l l c h e c k ="false "> p a t t e r n " Example Pattern " : s e c t i o n "This is a section of a pattern " : CO 4 . row : P , K, P , K . row : [ P , K] 2 . ∗∗ row : ∗P , K ; t o end . repeat 2 BO 4 . </ t e x t a r e a > <div id=" compile "> <input type=" button " value=" Compile " /> </div> </div> <div id="message - display "> <ul id="message -list"></ul> </div> </div> </div> <div id="center - content "> <div id="center -content - wrapper "> <div c l a s s ="weave -shadow -top"></div> <div c l a s s ="weave -shadow - bottom "></div> <div id="tests - wrapper "> << P a t t e r n T e s t s 159>> </div> </div> </div> <div id="right - content "> <div id="right -content - wrapper "> <div id="pattern - display "> </div> </div> </div> 110 <div id="ast1 - display " c l a s s ="ast - display "></div> <div id="ast2 - display " c l a s s ="ast - display "></div> <div id="ast3 - display " c l a s s ="ast - display "></div> <div id=" footer "> </div> </body> </html> I NCLUDED B LOCKS: 159 on page 106 111 Appendix E Style Sheets E.1 Test Page Styles <code/styles/main.css 161> ∗ { margin : 0 ; padding : 0 ; border : 0 ; box− s i z i n g : border −box ; } html , body { h e i g h t : 100%; } html { background−image : u r l ( "../ img/ knitting .png" ) ; padding−top : 50px ; } # header { position : absolute ; top : 0 ; left : 0; right : 0; t e x t −a l i g n : c e n t e r ; f o n t : 25px o v e r l o c k b l a c k i t ; h e i g h t : 50px ; } 112 # l e f t −c o n t e n t , # r i g h t −c o n t e n t { width : 44%; h e i g h t : 100%; min−width : 150 px ; min−h e i g h t : 300 px ; padding : 10px ; } # c e n t e r −c o n t e n t { f l o a t : l e f t ; width : 12%; h e i g h t : 100%; padding : 0px 0 ; } # c e n t e r −c o n t e n t −wrapper { h e i g h t : 100%; p o s i t i o n : r e l a t i v e ; } # l e f t −c o n t e n t { f l o a t : l e f t ; } # r i g h t −c o n t e n t { f l o a t : r i g h t ; } # l e f t −c o n t e n t −wrapper , # r i g h t −c o n t e n t −wrapper { width : 100%; h e i g h t : 100%; box−shadow : 0px 1px 10px 1px # 8 8 8 8 8 8 ; } /∗ L e f t c o n t e n t ∗/ # p a t t e r n −e n t r y { display : block ; width : 100%; h e i g h t : 100%; padding : 10px ; background−c o l o r : # 3 3 3 3 3 3 ; c o l o r : #E6E6E6 ; box−shadow : i n s e t 0px 1px 10px 1px b l a c k ; f o n t : 16px convergence ; l i n e −h e i g h t : 150%; l e t t e r −s pa cin g : 1px ; } @font−f a c e { f o n t −f a m i l y : " shadows " ; s r c : u r l ( "../ res/ ShadowsIntoLightTwo - Regular .ttf ") ; } @font−f a c e { f o n t −f a m i l y : "sofia " ; s r c : u r l ( "../ res/Sofia - Regular .ttf" ) ; } # entry −wrapper 113 { position : relative ; h e i g h t : 85%; padding−bottom : 80px ; } # compile { position : absolute ; bottom : 0 ; width : 100%; } # compile input , # t e s t s input { c o l o r : white ; background−c o l o r : #6194 FF ; border : 2px s o l i d #286CFC ; } # compile input : hover , # t e s t s input : hover { background−c o l o r : #709 e f f ; } # compile input : a c t i v e , # t e s t s input : a c t i v e { box−shadow : i n s e t 0px 0px 1px 1px #286CFC ; } # compile input { display : table ; margin : 0 auto ; padding : 5px 0 ; width : 100%; h e i g h t : 80px ; f o n t : 30px overlockblackit ; } # message−d i s p l a y { width : 100%; h e i g h t : 15%; min−h e i g h t : 60px ; background−c o l o r : #DBDBDB; border : 1px s o l i d #CCCCCC; overflow −y : auto ; 114 } u l # message− l i s t l i input { white −space : normal ; width : 100%; t e x t −a l i g n : l e f t ; } # message−d i s p l a y . e r r o r −message { border : 1px s o l i d red ; } # message−d i s p l a y . warning−message { border : 1px s o l i d yellow ; } # message−d i s p l a y . v e r i f i c a t i o n −message { border : 1px s o l i d purple ; } /∗ Center c o n t e n t ∗/ # t e s t s −wrapper { h e i g h t : 100%; padding : 10px 0 ; } # t e s t s { width : 100%; h e i g h t : 100%; margin : 0 auto ; padding : 10px ; overflow −y : s c r o l l ; box−shadow : i n s e t 0px 0px 10px 1px # 5 2 5 2 5 2 ; } # t e s t s :: − webkit − s c r o l l b a r { d i s p l a y : none ; } # t e s t s in put { width : 100%; min−h e i g h t : 75px ; padding : 10px ; margin−bottom : 10px ; f o n t : 20px o v e r l o c k b l a c k i t ; white −space : normal ; } . t e s t , . p a t t e r n −example { v i s i b i l i t y : hidden ; d i s p l a y : none ; } /∗ Right c o n t e n t ∗/ # p a t t e r n −d i s p l a y { width : 100%; h e i g h t : 100%; overflow −y : auto ; padding : 10px 10px 0 10px ; background−c o l o r : white ; border : 1px s o l i d #CCCCCC; } 115 /∗Other S t y l e s ∗/ . weave−shadow−top { position : absolute ; width : 100%; h e i g h t : 10px ; z−index : 5 ; border −bottom : 1px s o l i d # b9b9b9 ; −webkit −box−shadow : 0px 6px 10px −3px # 5 2 5 2 5 2 ; box−shadow : 0px 6px 10px −3px # 5 2 5 2 5 2 ; } . weave−shadow−bottom { position : absolute ; width : 100%; h e i g h t : 10px ; bottom : 0%; z−index : 5 ; border −bottom : 1px s o l i d # b9b9b9 ; −webkit −box−shadow : 0px −6px 10px −3px # 5 2 5 2 5 2 ; box−shadow : 0px −6px 10px −3px # 5 2 5 2 5 2 ; } /∗ Fonts ∗/ @font−f a c e { f o n t −f a m i l y : " artifica " ; s r c : u r l ( "../ res/Artifika - Regular .ttf" ) ; } @font−f a c e { f o n t −f a m i l y : " delius " ; s r c : u r l ( "../ res/Delius - Regular .ttf" ) ; } @font−f a c e { f o n t −f a m i l y : " novacut " ; s r c : u r l ( "../ res/ NovaCut .ttf" ) ; } @font−f a c e { f o n t −f a m i l y : " novaslim " ; s r c : u r l ( "../ res/ NovaSlim .ttf" ) ; } @font−f a c e { f o n t −f a m i l y : " radley " ; s r c : u r l ( "../ res/Radley - Italic .ttf" ) ; } @font−f a c e { f o n t −f a m i l y : " convergence " ; s r c : u r l ( "../ res/ Convergence - Regular .ttf" ) ; } @font−f a c e { f o n t −f a m i l y : " overlockreg " ; s r c : u r l ( "../ res/Overlock - Regular .ttf" ) ; } @font−f a c e { f o n t −f a m i l y : " overlockblackit " ; s r c : u r l ( "../ res/Overlock - BlackItalic . ttf" ) ; } @font−f a c e { f o n t −f a m i l y : " overlockit " ; s r c : u r l ( "../ res/Overlock - Italic .ttf" ) ; } @font−f a c e { f o n t −f a m i l y : " overlockblack " ; s r c : u r l ( "../ res/Overlock -Black.ttf" ) ; } @font−f a c e { f o n t −f a m i l y : " overlockbold " ; s r c : u r l ( "../ res/Overlock -Bold.ttf" ) ; } @font−f a c e { f o n t −f a m i l y : " novaround " ; s r c : u r l ( "../ res/ NovaRound .ttf" ) ; } 116 E.2 Target Language Styles <code/styles/pattern.css 162> . p a t t e r n ∗ { f o n t : 20px o v e r l o c k r e g ; } . patternname { f o n t : 30px o v e r l o c k b l a c k ; } . sectionname { f o n t : 24px o v e r l o c k b o l d ; margin−top : 30px ; } . caston , . b i n d o f f , . j o i n , . pickup { margin : 20px 0 ; } . body { margin : 10px 0 15px 0 ; } . row { margin : 5px 0 ; } . rowrepeat { margin : 20px 0 ; } . rowrepeat > ∗ { padding− l e f t : 10px ; } . s t i t c h { f o n t −f a m i l y : o v e r l o c k i t ; } . stitchcount { f o n t : 16px o v e r l o c k i t ; } . v e r i f i c a t i o n , . e r r o r , . warning { f o n t : bold 16px a r i a l ; f l o a t : l e f t ; c l e a r : l e f t ; margin− r i g h t : 5px ; } . v e r i f i c a t i o n { c o l o r : purple ; } . e r r o r { c o l o r : red ; } . warning { c o l o r : yellow ; } . a s t −d i s p l a y { background−c o l o r : white ; c l e a r : both ; d i s p l a y : none ; v i s i b i l i t y : hidden ; } # a s t 1 −d i s p l a y , # a s t 2 −d i s p l a y { margin−bottom : 110 px ; } # a s t 3 −d i s p l a y { margin−bottom : 110 px ; } 117 Bibliography [1] Craft yarn council standards and guidelines for crochet and knitting. http://www.craftyarncouncil. com/standards.html. Accessed: 2014-04-05. [2] Eclipse standard. https://www.eclipse.org/downloads/, 2014. Version: Kepler Service Release 2, Build id: 20140224-0627. [3] Ravi Sethi Jeffrey D. Ullman Alfred V. Aho, Monica S. Lam. Compilers: Principles, Techniques, and Tools (2nd ed). Prentice Hall, 2006. [4] Therese de Dillmont. Encyclopedia of Needlework. Mulhouse (Alsace), 1886. Available free from Project Gutenberg. [5] Seffen Ernst. Literate programming for eclipse. http://lep.sourceforge.net/, 2012. Version: 0.5.21. [6] Donald E. Knuth. Literate programming. The Computer Journal, 1984. [7] Richard Rutt. A History of Hand Knitting. Batsford, Ltd., 1987. [8] Laura Spradin. Grrlfriend market bag. http://www.ravelry.com/patterns/library/ grrlfriend-market-bag, 2014. Knitting pattern, Accessed: 2014-04-12. [9] Lesley Stanfield and Melody Griffiths. The Essential Stitch Collection. Reader’s Digest Association, 2010. 118
6cs.PL
On computing the total displacement number via weighted Motzkin paths Andreas Bärtschi∗1 , Barbara Geissmann†1 , Daniel Graf‡1 , Tomas Hruz§1 , Paolo Penna¶1 , and Thomas Tschagerk1 arXiv:1606.05538v1 [cs.DS] 17 Jun 2016 1 ETH Zürich, Department of Computer Science Abstract Counting the number of permutations of a given total displacement is equivalent to counting weighted Motzkin paths of a given area (Guay-Paquet and Petersen [10]). The former combinatorial problem is still open. In this work we show that this connection allows to construct efficient algorithms for counting and for sampling such permutations. These algorithms provide a tool to better understand the original combinatorial problem. A by-product of our approach is a different way of counting based on certain “building sequences” for Motzkin paths, which may be of independent interest. 1 Introduction Consider the set Sn of all permutations over n elements {1, 2, . . . , n}. Diaconis and Graham [5] studied the disarray statistic of permutations, also called total displacement by Knuth [13, Problem 5.1.1.28], defined as follows. For any permutation π define its distance to the identity permutation as the sum of the displacements of all elements: D(π) := n X i=1 |i − π(i)| = 2 X (π(i) − i). π(i)>i Note that this distance is always even. The following natural question is still unresolved: How many permutations at a given distance 2d from the identity permutation are there? That is, one would like to know the following total displacement number: D(n, d) := |{π ∈ Sn | D(π) = 2d}|, that is the number of permutations of total displacement equal to 2d. So far, a closed formula for arbitrary n is only known for fixed d up to seven (d ≤ 7) [10]. Entry A062869 [7] of the OEIS reports values of D(n, d) for small n and d (n ≤ 30). ∗ [email protected] [email protected][email protected] § [email protected][email protected] k [email protected] † 1 1 2 INTRODUCTION U U H  H U H   H 5 3 4 1 9 8 6 7 2 1  n Figure 1: A permutation and its Motzkin path of width 10 and area 12. Guay-Paquet and Petersen [10] made recently significant progress in this question by showing that these permutations are in correspondence to Motzkin paths whose area is exactly the distance d under consideration. Their result shows that, for any Motzkin path (see below) of area d, one can easily calculate the number of permutations that correspond to this specific path. Therefore the problem above translates into the problem of counting weighted Motzkin paths of a given area. A Motzkin path consists of a sequence of U (Up-right), H (Horizontal-right), and D (Downright) moves over the two-dimensional lattice starting at coordinate (0, 0) and such that the path never goes below the y = 0 axis and ends on the y = 0 axis (see Figure 1 (right) for an example). For any such path, one can consider its width and its area defined as the number of moves and the area of the region between the y = 0 axis and the path. The permutations over n elements with total displacement 2d map into Motzkin paths of width n and area A = d. For instance, the permutation in Figure 1 is mapped into a Motzkin path according to the following rule. The first element π(1) = 5 is mapped into a U because the element at position 1 goes to a higher position (right) and also the number coming into position 1 is higher than 1: π(1) > 1 < π −1 (1). The fourth element is mapped into D because the opposite happens: π(4) = 1 < 4 > 3 = π −1 (4). Finally, elements 3, 5, 7, 10 are mapped into H because neither of the previous cases apply. Let hi denote the maximum height of the path during move i (for U : after the move, for D: before the move, and anytime for H). Then the number ω(mz ) of permutations that map to a certain Motzkin path mz is [10] ( n Y hi if mz i = U or mz i = D, ω(mz ) = ωi where ωi = (1) 2h + 1 if mz = H. i i i We also refer to ω(mz ) as the weight of mz . In the example in Figure 1 this gives 1·2·5·2·3·2·5·2·1·1 = 1200. Note how this formula separates over the moves of the Motzkin path. This independence is what we will exploit in this article. Theorem 1 ([10]). For any n and d, let MZ (n, A) be the set of all Motzkin paths of width n and area A = d. Then it holds that X D(n, d) = ω(mz ). (2) mz ∈MZ (n,A) Corollary 1 (Appendix A). Given a Motzkin path mz of length n, we can sample uniformly at random one of the ω(mz ) many permutations mapping into mz in time O(n). Our contribution. In this work, we address counting and sampling of permutations from both a combinatorial and computational point of view. Specifically: • On the computational side, we show that the total displacement number D(n, d) can be computed efficiently, namely, in time O(n4 ) and O(n3 ) space. 1 INTRODUCTION 3 • On the combinatorial side, we introduce sequences of certain building blocks which provide a different perspective on the problem structure. Moreover, this is a crucial part of a Markov chain sampling method which constitutes the third contribution of this paper. • Finally, we consider the task of sampling permutations of a given total displacement with uniform distribution. To compute the number of permutations efficiently, we look at the paths from left to right. Building on an operation introduced by Barcucci et al. [1], we can provide an elegant dynamic programming formulation which achieves a running time of O(n4 ) and needs space O(n3 ). Consequently, we can compute the sequences A062869 [7] and A129181 [3] to much higher values of n and d than was possible before. Considering the combinatorial aspects, we show that every Motzkin path comes from a sequence a describing its building blocks. We provide an explicit formula for the number m(a) of paths that these building blocks can form. The weights in Equation (1) are preserved in the sense that the weight of a path depends only on its building sequence. Since the exact formula seems to be currently out of reach, to achieve good estimates of D(n, d) for very large n and d, we contribute sampling methods which can also be of independent interest. In particular, the dynamic programming algorithm provides a sampler with the same complexity as the algorithm itself. Further, we show that sampling sequences of building blocks with appropriate distribution automatically gives a sampler for the permutations. One application of the latter result is a Monte Carlo Markov chain (MCMC) method which gives an alternative approach to the dynamic programming. The computational experiments with the MCMC method show a promising convergence speed leading to a sampler with very high values of n and d. The experimental results support a hypothesis that the MCMC method is faster than the method based on dynamic programming and runs in O(n3 ) time. Related Work. Different metrics on permutations have been studied, for a survey see [4]. Sampling and counting of permutations of a fixed distance was studied for several metrics [12] but not for total displacement. The number of Motzkin paths under various conditions were also studied in a more general frame of enumeration of lattice paths [11, 8]. Motzkin numbers play a role in many combinatorial problems as is illustrated for example in [6]. The total area under a set of generalized Motzkin paths, where the horizontal segments have a constant length k (k ≥ 0) have been studied in [16] and [15]. Moreover, the author in [17] studies the moments of generalized Motzkin paths where the first moment describes the area under a Motzkin path. Heinz [3] describes a different algorithm for enumerating unweighted Motzkin paths with a given area, cf. Remark 4 in Section 2.1. The use of Markov chains for sampling and counting combinatorial objects is a very active research area (see e.g. the book [2]), and some works exploit the connection between combinatorial structures and paths of a certain type to accomplish this task (see e.g. [9]). Paper Organization. Section 2 describes the dynamic programming algorithm. Section 3 describes how weighted Motzkin paths can be counted via building block sequences. Section 4 provides a Markov chain sampling algorithm as well as its experimental evaluation. 2 WEIGHTED MOTZKIN PATHS USING DYNAMIC PROGRAMMING 2 4 Weighted Motzkin Paths using Dynamic Programming Recall that we denote by D(n, d) the number of permutations on n elements with total displacement 2d (OEIS A062869 [7]). Let M (n, A) denote the number of Motzkin paths of width n and area A (OEIS A129181 [3]). 2.1 Dynamic Program for Counting Weighted Motzkin Paths Theorem 2. Computing M (n, A) and D(n, d) can be done in time O(n4 ) and space O(n3 ). Proof. The key ingredient is a construction by Barcucci et al. [1] that produces every possible Motzkin path through a unique sequence of insertion steps. Let us look at the last fall of a given Motzkin path, i.e., its suffix of Down-right moves. At one of the positions before or after any of these fall moves, we insert a new peak (a U and a D) or we insert a new flat (an H). Repeatedly inserting peaks and flats this way along the last fall will create our path. See Figure 2 for an example. This construction is complete and unique [1], meaning that every Motzkin path can be created through a unique sequence of such insertions. This allows us to derive a dynamic programming formulation for counting M (n, A). We add the last fall length l to our state and write it as M (n, A, l). So how can we recursively express M (n, A, l)? We undo the last insertion step. If we inserted a flat last, then we were at M (n−1, A−l, l0 ) before the insertion, for some l0 ≥ l, because the last fall was at least as long before the insert. When inserting a peak, we might increase the last fall length by one, but not more. So M (n − 2, A − (2l − 1), l0 ) for all l0 ≥ l − 1 are also possible predecessor states. Together with the base case M (0, 0, 0) = 1 this gives the recurrence M (n, A, l) = n/2 X l0 ≥l M (n − 1, A − l, l0 ) + n/2 X l0 ≥l−1 M (n − 2, A − (2l − 1), l0 ), (3) which allows for O(n4 ) many states as A ≤ n2 and l ≤ n. Hence we immediately get an O(n5 ) time algorithm with O(n4 ) space. We can shave off one factor of n in both time and space as follows: We first note, that we can compute the two sums in constant time if we precompute the prefix Pl 0 sums over the last variable l . Let us denote these prefix sums as SM (n, A, l) = l0 =0 M (n, A, l0 ) = SM (n, A, l − 1) + M (n, A, l). This allows us to compute every value of M (n, A, l) in amortized constant time, so in time O(n4 ) overall. Finally, our recurrence only relies on the last two values of n, so when computing M (n, ·, ·) only the O(n3 ) many values for M (n − 1, ·, ·) and M (n − 2, ·, ·) Figure 2: All six possible flat- and peak-extensions of the last fall of length 2. 2 WEIGHTED MOTZKIN PATHS USING DYNAMIC PROGRAMMING 5 need to be stored. The values M (n, A) are then simply the marginals of M (n, A, l) over all last fall lengths l. We can extend this recurrence to the weighted case which by Corollary 1 gives rise to the total displacement count: We distribute the factors of the weight ω(mz ) (Equation (1)) over the steps of the dynamic program. As l denotes the height of the last flat or peak that we add, we have factors 2l + 1 or l2 : D(n, d, l) =(2l + 1) n/2 X l0 ≥l 0 D(n − 1, d − l, l ) + l 2 n/2 X l0 ≥l−1 D(n − 2, d − (2l − 1), l0 ). Remark 3. The bounds in Theorem 2 assumed that basic operations have unit-cost. The numbers involved can be exponential in n however. We can easily bound M (n, A) ≤ 3n and D(n, d) ≤ n! showing that their bit-representations are at most of length O(n log n). Our dynamic programs only use multiplication with small numbers of size O(log n) and addition. So one can consider a refined analysis by multiplying both the time and space bounds of Theorem 2 by Θ(n polylog n). Finally, as suggested by an anonymous reviewer, the space could be further improved by counting modulo small primes and using the Chinese Reminder Theorem. Remark 4. For computing M (n, A), the OEIS contains a dynamic program by Heinz [3]. It is stated as a Maple code snippet without any further comment or reference. It uses a different state and might have the same time complexity as ours. We believe that our extension to the weights of D(n, d) can also be applied. 2.2 Sampling from the Dynamic Program Theorem 5. After running the dynamic program from Theorem 2, we can sample (weighted) Motzkin paths in time O(n). Proof. Given access to a source of randomness and the filled table for M , we can randomly retrace the steps through the dynamic programming states to sample a Motzkin path from right to left. For the weighted paths according to D(n, d) all the steps will be exactly the same. We first sample the last fall length by picking a random number x ∈u.a.r. {0, . . . , M (n, A) − 1} and then finding the smallest l such that its prefix sum SM (n, A, l) is larger than x. We continue with x−SM (n, A, l−1), the offset within the class of paths with last fall length l. For each step, we first decide whether we are in the flat-case or in the peak-case of the recurrence by comparing x to the left summand of (3). We then know whether the move before the last fall was an H or a U . We increment l0 until we find the last fall length of the previous state. We adapt x and recurse until we end at M (0, 0, 0) with x = 0. Note that the search for the initial l takes linear time. After that, every time we compare x to a value of M , we fix at least one move of the sampled Motzkin path, so sampling takes O(n) time overall. Remark 6. This sampling procedure requires the full table of the dynamic program to be stored. Hence the memory optimization from O(n4 ) to O(n3 ) in Theorem 2 can not be used simultaneously. Remark 7. A C++ implementation of our counting and sampling approaches by Theorems 2 and 5 is available at http: // people. inf. ethz. ch/ grafdan/ motzkin/ . With our code, we can quickly compute for n up to 100 (and all d) the integer sequences A062869 [7] and A129181 [3] which were only known up to n ≤ 30 and n ≤ 50 before. 3 6 COMBINATORIAL STRUCTURE OF MOTZKIN PATHS 0 1 n 1 1 2 2 Figure 3: The Motzkin path on the left can be obtained from its building blocks. 3 Combinatorial Structure of Motzkin Paths In this section, we look at the combinatorial structure of Motzkin paths: There is a natural decomposition of any Motzkin path into “building blocks”, already hinted at in the last section. For each height i of the Motzkin path we count the number of flats fi and peaks pi . Definition 1 (building sequence). For given positive integers n and A, a finite sequence of nonnegative integers a = (f0 , p1 , f1 , p2 , . . . , ph , fh ) is a building sequence if all p-entries are non-zero, p1 , p2 , . . . , ph > 0, and the following two conditions hold: (f0 + f1 + . . . + fh ) + 2(p1 + p2 + . . . + ph ) = n, (4) (0f0 + 1f1 + . . . + hfh ) + (1p1 + 3p2 + . . . + (2h − 1)ph ) = A. (5) The set of all building sequences satisfying (4)-(5) is denoted as S(n, A). Such a sequence has a natural interpretation as a set of “building blocks” that generate a number of Motzkin paths of width n and area A (see Figure 3): We have fi flats and pi peaks of height i which can be split into pieces of width 1 and then rearranged into a Motzkin path. Proposition 1. For any Motzkin path mz of width n and area A there exists a unique building sequence a(mz ) ∈ S(n, A) such that mz can be obtained by splitting and rearranging the blocks of this sequence. Theorem 1 gives a surjective mapping from permutations into Motzkin paths. It is easy to see that the number of permutations ω(mz ) mapping into the same path mz , given by Equation (1), is uniquely determined by the building block sequence a = a(mz ) , since we have Y Y (6) i2pi = ω(mz ). perm(a) := (2i + 1)fi fi pi Hence ω(mz ) is independent of the actual Motzkin path and only depends on its combinatorial structure. This raises the question of whether also the number of Motzkin paths which share a common building sequence a is solely determined by a. We answer this in the positive, deriving a formula for this number, denoted by m(a). We proceed in a top-down fashion by looking at the number of peaks and flats in the highest level and how these can be rearranged. Once a level is fixed, we proceed recursively by arranging the blocks one level below. Theorem 8. For any building sequence a = (f0 , p1 , f1 , . . . , ph , fh ) ∈ S(n, A), the number of Motzkin paths of width n and area A that can be constructed out of the building sequence a is exactly      fh + ph − 1 ph + fh−1 ph + fh−1 + ph−1 − 1 ph−1 + fh−2 m(a) = ··· ph − 1 fh−1 ph−1 − 1 fh−2      p3 + f2 + p2 − 1 p2 + f1 p2 + f1 + p1 − 1 p1 + f0 ··· (7) p2 − 1 f1 p1 − 1 f0 . 3 COMBINATORIAL STRUCTURE OF MOTZKIN PATHS 7 fh ph − 1 ph−1 − 1 ph f0 fh−1 Figure 4: The top down construction of paths from the given sequence (1, 1, 1, 2, 2). Note that p1 − 1 = 0, and thus no DU valley is inserted at height 1. Proof. We start with the highest flats of the sequence a. There are fh of those flats. Two (or more) such flats can either lie directly next to each other, or they might be separated by a Down-right move followed at some point by an Up-right move. We call this setting a DU valley; we get such valleys by splitting peaks of height h and reassembling them the other way round, see Figure 4. A feasible Motzkin path has to have a U slope at the very left and a D slope at the very right of all height h pieces. The remaining ph − 1 DU valleys can be freely placed around the fh flats, that is we choose their places from fh + ph − 1 available positions. The number of ways to do this is   fh + ph − 1 (8) ph − 1 . Now we continue on the second highest level h−1. Naturally, the number of times that our Motzkin path rises above level h − 1 is exactly the number ph of peaks of height h. We can distribute our fh−1 flats of height h − 1 around those peaks, i.e. pick from ph + fh−1 many positions, hence we can choose from   ph + fh−1 (9) fh−1 many possibilities. After placing the flats, we will have to place new valleys down to the next lower level around the existing ph peaks and fh−1 flats. As before, the leftmost up and down slopes are fixed, hence the number of ways to distribute ph−1 − 1 valleys is given by the third factor in Equation (7). Since the choices in different levels are independent, we can iterate this reasoning until we include flats of height 0. We conclude with a corollary of Theorems 1 and 8: Corollary 2. There exists a surjective mapping from permutations over n elements into building sequences satisfying the following condition: For any building sequence a ∈ S(n, A), the number of permutations π which are at distance D(π) = 2d = 2A from the identity permutation and that are mapped into this building sequence a is precisely P (a) := m(a) · perm(a), (10) where m(a) is given by Equation (7) and perm(a) by Equation (6). Therefore the total number of permutations at distance 2d = 2A from the identity permutation satisfies X X (2) D(n, d) = ω(mz ) = P (a). (11) mz ∈MZ (n,A) a∈S(n,A) 4 SAMPLING WEIGHTED MOTZKIN PATHS BY LENGTH AND AREA 8     Example 1. The building blocks in Figure 3 yield 31 31 30 21 = 18 Motzkin paths, and each path corresponds to 1200 permutations. So, there are 1200 · 18 = 21 600 permutations mapping into the building sequence a = (1, 1, 1, 2, 2). Remark 9. Theorem 8 and Corollary 2 allow for a dynamic program for counting and sampling weighted Motzkin paths, similar to Sections 2.1 and 2.2. Additionally, we can easily sample paths with a fixed number of highest peaks and flats, at the cost of an additional O(n3 )-factor in the running time, see Appendix C. 4 Sampling Weighted Motzkin Paths by Length and Area In this section, we consider the task of selecting (sampling) permutations with uniform distribution over all permutations of a given total displacement. By Corollary 1 it is enough to sample Motzkin paths with the proper weights. We have already seen in Section 2.2 that we can sample such weighted Motzkin paths using dynamic programming at the cost of large memory consumption. We will show in Section 4.2 an approach to sample weighted Motzkin paths based on the building sequences introduced in Section 3 that requires only O(n) memory. In general, observe that sampling permutations can be accomplished efficiently if we can sample building sequences with a probability proportional to P (a) = m(a) · perm(a) in polynomial time: Theorem 10. Every polynomial-time algorithm that samples sequences in S(n, A) with probability π(a) ∝ P (a) can be turned into a polynomial-time algorithm for sampling permutations uniformly at random among the permutations over n elements and of total displacement 2d = 2A. Proof. Given a sequence a ∈ S(n, A), the sampler maps this sequence into a random Motzkin path, and then into a random permutation as follows: 1. Pick a Motzkin path mz uniformly at random among those that can be created with a, that 1 is, with probability m(a) . 2. Pick a permutation u.a.r. among those that map into the Motzkin path mz, that is, with 1 probability perm(a) . Step 1 (sequences to Motzkin paths). The top-down construction used to prove Theorem 8 suggests also how to sample one of the m(a) Motzkin paths for a given sequence a with uniform distribution. Namely, we pick the positions of the DU valleys at height h uniformly at random (Equation (8)), then we pick the positions of the fh−1 flats uniformly at random (Equation (9)), and repeat this to the lower level exactly as described in the top-down construction. Since a particular path corresponds to exactly one choice in each of these steps, by Equation (7) its probability is precisely 1/m(a). Step 2 (paths to permutations). 4.1 This is shown in Corollary 1 above. Preliminary definitions on Markov chains In this section, we introduce some of the definitions on Markov chains used throughout this work (see e.g. [14]). A Markov chain over a finite state space S is specified by a transition matrix P , where P (a, a0 ) is the probability of moving from state a to state a0 in one step. The tth power of the transition matrix gives the probability of moving from one state to another state in t steps. The chain studied in this work is ergodic (see below for a proof), meaning that it has a unique stationary distribution π, that is, limt→∞ P t (a, a0 ) = π(a0 ) for any two states a and a0 . 4 SAMPLING WEIGHTED MOTZKIN PATHS BY LENGTH AND AREA 9 Reversible chains. We shall use the definition of a reversible Markov chain, also called detailed balanced condition: If the transition matrix P admits a vector π such that π(a)P (a, a0 ) = π(a0 )P (a0 , a) for all a and a0 , then π is the stationary distribution of the chain with transitions P . Total Variation Distance and Mixing Time. The total variation distance of two distributions µ and π is 1 X dT V (µ, π) := · µ(a) − π(a) . 2 a∈S The mixing time of an ergodic Markov chain with transition matrix P is defined as  tmix () = min t : dT V (P t (a0 , ·), π) ≤  for all a0 ∈ S . It is common to also define the quantity tmix := tmix (1/4), which is justified by the fact that, for any , tmix () ≤ dlog2 1/e · tmix . In our experiments, we shall evaluate the total variation distance for  = 0.05 to get better estimate. 4.2 A Markov Chain Sampler Suppose we have a set of k possible local changes transforming any sequence a into another sequence a0 such that all sequences can be obtained by applying a certain number of such operations. Then the following standard Metropolis chain samples sequences with the desired distribution: 1. With probability 1 2 do nothing. Otherwise, 2. Select one of the k local operations u.a.r. If this operation cannot be applied to the current sequence a (the new sequence is unfeasible) do nothing; Otherwise, let a0 be the sequence obtained from a by applying this operation; 3. Accept the operation transforming a to a0 with probability     P (a0 ) m(a0 ) perm(a0 ) 0 A(a, a ) := min 1, = min 1, · , P (a) m(a) perm(a) (12) and do nothing with remaining probability 1 − A(a, a0 ). Local operations over the sequences We define our Metropolis chain Mblocks through four types of operations: Peak to Flat (PF), Flat to Valley (FV), Flat to Flat (FF), and Peak into Valley (PV). We formally define them as:     p ← p − 1 fi ← fi − 2   i i     f  ← fi−1 + 2 pi ← pi + 1 i−1 P F (i, j) := , F V (i, j) :=   fj ← fj − 1 fj ← fj − 1       f  fj+1 ← fj+1 + 1 j+1 ← fj+1 + 1     ← fi − 1 ← pi − 1   fi pi   f  ← fi+1 + 1 fi−1 ← fi−1 + 2 i+1 F F (i, j) := P V (i, j) :=   fj ← fj − 1 pj ← pj − 1       f  fj ← fj + 2 j−1 ← fj−1 + 1 4 SAMPLING WEIGHTED MOTZKIN PATHS BY LENGTH AND AREA 10 Figure 5: (left, middle) The canonic path for n = 12 and A = 18, resp. A = 21. (right) Building a canonic path (red) from a given path (black) with same area. Note that each type of operation applies to two indices i and j, and we also implicitly consider the reversed operations which “undo” the changes. We now explain step 2 of the chain Mblocks in more detail: The Markov chain Mblocks picks two indices i and j at random, then picks one of the four operations above, and decides with probability 1/2 whether to choose the operation or its reversed version. As for step 3, computing the transitional probability A(a, a0 ) can be done in constant time as only a few of the factors in Equations (6) and (7) change. Theorem 11. The Markov chain Mblocks defined above is ergodic and its unique stationary distribution satisfies π(a) ∝ P (a) for every a ∈ S(n, A). Proof. The proof consists of two steps. First, we have to show that the chain is ergodic, that is, it is aperiodic and connected (see e.g. [14]). Then we use the standard detail balance condition to obtain the stationary distribution. 4.2.1 Connectivity of Mblocks . To prove that the chain Mblocks is connected (from every building sequence a we can reach every other building sequence a0 in a maximum of O(A) operations) we argue in two steps. Intuitively, we show that we can transform any two paths into each other by some operations depicted in Figure 7. Then it can be seen that every operation in Figure 7 corresponds to a sequence of operations in the Markov chain Mblocks , given in Figure 6. Formally:  Every path of width n and area A ≤ n2 /4 can be turned into any other path of the same area and width by using the operations in Figure 7. To prove this we consider a canonic path for a given width n and area A. The canonic path is the uniquely defined path mz ∈ MZ (n, A) for which the following holds: For every i, after i steps (i.e. between x = 0 and x = i) mz has maximum area among all paths in MZ (n, A). The possible forms of the canonic path are shown in Figure 5. Any given path with width n and area A can be transformed into the canonic path of the same area using the steps from Figure 7. We overlay the given path with the canonic path and proceed in steps to the right as is schematically shown in Figure 5 with the black path being the given path and the red path being the canonic path. There are three possibilities. Either the paths coincide, in which case we proceed to the right, or the given path differs proceeding with a D move or with an H move. In both cases the given path must intersect the canonic path on the falling part because otherwise the area cannot be the same. Now we use the operations in Figure 7 in horizontal sweeps from left to right to fill-in the missing area of the canonic path. At the end both paths must coincide because the areas are the same. Each of these operations can be simulated by some operations on the sequences in Figure 6. This can be seen immediately because the four cases in Figure 7 correspond directly to one or two operations in Figure 6. 4 11 SAMPLING WEIGHTED MOTZKIN PATHS BY LENGTH AND AREA pi fi fi−1 fj fj fj+1 (a) Peak to Flat. fi fj+1 (b) Flat to Valley. pi fi−1 fj pi pj fj+1 (c) Flat to Flat. fi−1 fj (d) Peak into Valley. Figure 6: The basic operations over the sequences. or or or (2 operations) or or or Figure 7: Changing the path. The shape on one side is transformed to the shape on the other side. In some cases we need two of the operations defined in Figure 6. 4 SAMPLING WEIGHTED MOTZKIN PATHS BY LENGTH AND AREA 4.2.2 12 Stationary Distribution of Mblocks . n o 0) It is well-known that the Metropolis chains with acceptance probability A(a, a0 ) = min 1, π(a π(a) have stationary distribution π since the detailed balance condition is obviously satisfied: given that the number of operations is k, we have P (a, a0 ) = A(a, a0 ) 2k and P (a0 , a) = A(a0 , a) 2k and the definition of A(·, ·) yields the detailed balance condition, that is, π(a)P (a, a0 ) = π(a0 )P (a0 , a). 4.2.3 Experimental Evaluation of Mblocks We are interested in the required number of steps until the distribution of Mblocks is sufficiently close to its stationary distribution. We measure the distance between two distributions by the total variation distance. The mixing time of a Markov chain is the smallest time t such that the total variation distance between the stationary distribution and the distribution after t steps, starting from any state, is smaller than some small  > 0. We study the mixing time of Mblocks for a given area A and a given width n by running the following experiment. We estimate the distribution after a given number of steps by repeatedly running Mblocks with an initial state √ a0 defined as follows: The building block sequence consists of one peak of height h for every h ≤ b Ac and the remaining area and width is filled greedily with flats of maximal possible height. The total variation distance of the distribution of Mblocks after some number of steps t from its stationary distribution π is dT V (P t (a0 , ·), π) = 1 · 2 X a∈S(n,A) P t (a0 , a) − π(a) . We estimate the mixing time for a given area A and a given width w by computing the total variation distance for increasing t until the total variation distance is below 0.05. Figure 8 (left) illustrates the mixing time for width 8 and every area A with more than one possible building block sequence. The maximal mixing time (400 steps) is necessary for area 9. In fact, for every width smaller than 13, the mixing time is maximal for area A∗n = ((n − 2)/2)2 if n is even and A∗n = ((n − 1)/2)2 otherwise. This is due to our choice of the initial state of Mblocks . We estimate the maximal mixing time for widths larger than 12 by computing the mixing time for A∗n only, as the number of repeats necessary to estimate the distribution of Mblocks after t steps depends on the number of possible building block sequences, which grows exponentially depending on n. Figure 8 (right) shows the maximal mixing time up to width 40. The plot suggests that the number of steps necessary to approximate the stationary distribution does not grow exponentially depending on the width n, the algorithm is probably faster than the sampler based on dynamic programming and the results suggest that the MCMC sampler achieves the mixing time O(n3 ). Conjecture 12. Mblocks mixes in time O(n3 ). Remark 13. The implementation of Mblocks is available at http: // people. inf. ethz. ch/ grafdan/ motzkin/ . 13 ● 30000 20000 10000 0.4 ● Area 2 Area 3 Area 4 Area 5 Area 6 Area 7 Area 8 Area 9 Area 10 Area 11 Area 12 Area 13 Area 14 Mixing time 0.6 ● ● 0.2 Total variation 0.8 1.0 40000 REFERENCES ● ● ● ● 100 ● 200 ● ● ● ● 300 Time ● ● ● 400 ● ● ● 500 0 0.0 ● ●● ● ● ● ● ● 0 10000 20000 30000 40000 50000 60000 70000 3 n Figure 8: (left) Total variation for n = 8 and all A ≤ (n/2)2 with |S(8, A)| > 1. (right) Maximal mixing time for given widths (•), mixing time for areas A∗n (+). References [1] Elena Barcucci, Alberto Del Lungo, Elisa Pergola, and Renzo Pinzani. A construction for enumerating k-coloured motzkin paths. In Computing and Combinatorics, pages 254–263. Springer, 1995. [2] Russ Bubley. Randomized Algorithms: Approximation, Generation and Counting. Springer, 2011. [3] Emeric Deutsch and Alois P Heinz. A129181 motzkin paths by area, Online Encyclopedia of Integer Sequences. http://oeis.org/A129181, June 2012. [4] Michael Deza and Tayuan Huang. Metrics on permutations, a survey. Journal of Combinatorics, Information and System Sciences, 1998. [5] Persi Diaconis and Ronald L Graham. Spearman’s footrule as a measure of disarray. Journal of the Royal Statistical Society. Series B (Methodological), pages 262–268, 1977. [6] Robert Donaghey and Louis W Shapiro. Motzkin numbers. Journal of Combinatorial Theory, Series A, 23(3):291–301, 1977. [7] Olivier Gérard, Mathieu Guay-Paquet, and Alois P Heinz. A062869 permutation with fixed total displacement, Online Encyclopedia of Integer Sequences. https://oeis.org/A062869, May 2014. [8] Ian P Goulden and David M Jackson. Combinatorial enumeration. Dover Publications, 2004. [9] Sam Greenberg, Amanda Pascoe, and Dana Randall. Sampling biased lattice configurations using exponential metrics. In 20th ACM-SIAM Symposium on Discrete Algorithms SODA’09, pages 76–85, 2009. 14 REFERENCES width area runs mixing time 4 to 12 all relevant areas 10 000 200 to 1 200 14 36 100 000 1 700 16 49 100 000 2 350 18 64 100 000 3 200 20 81 100 000 4 250 25 144 100 000 8 900 30 196 100 000 14 300 35 289 400 000 23 350 40 361 500 000 33 600 Table 1: Experimental setup: The distribution after t steps was estimated using 10 000 to 500 000 runs of Mblocks . The maximal mixing time was estimated by computing the mixing time for A∗n for widths larger than 12. [10] Mathieu Guay-Paquet and Kyle Petersen. The generating function for total displacement. The Electronic Journal of Combinatorics, 21(3):P3–37, 2014. [11] Katherine Humphreys. A history and a survey of lattice path enumeration. Journal of statistical planning and inference, 140(8):2237–2254, 2010. [12] Ekhine Irurozki. Sampling and learning distance-based probability models for permutation spaces. PhD thesis, University of the Basque Country, Donostia - San Sebastián, July 2014. [13] Donald E. Knuth. The art of computer programming. Sorting and searching, 3:426–458, 1999. [14] David Asher Levin, Yuval Peres, and Elizabeth Lee Wilmer. Markov chains and mixing times. American Mathematical Soc., 2009. [15] Donatella Merlini. Generating functions for the area below some lattice paths. In Discrete Random Walks, DRW’03, pages 217–228, 2003. [16] E Pergola, R Pinzani, S Rinaldi, and RA Sulanke. A bijective approach to the area of generalized motzkin paths. Advances in Applied Mathematics, 28(3):580–591, 2002. [17] Robert A Sulanke. Moments of generalized motzkin paths. Journal of Integer Sequences, 3(00.1):1–14, 2000. A 15 POSTPONED PROOFS Appendix A Postponed Proofs Corollary 1 (Appendix A). Given a Motzkin path mz of length n, we can sample uniformly at random one of the ω(mz ) many permutations mapping into mz in time O(n). Proof. Given a Motzkin path mz, we can sample a permutation u.a.r. among all permutations that map into mz. For this, consider mz as a (feasible) sequence of letters U , D and H (denoting diagonally Up-right moves, diagonally Down-right moves and Horizontal-right moves). Then do the following: 1. Scan the sequence from left to right. When a new D is found, match it with any of the U on the left that are not yet matched to any D (choose such a U u.a.r.). This step constructs left-to-right edges from U to D: U U U D U ···U D 2. Scan from right to left the sequence, matching a newly encountered U with any D on the right not yet matched in this step (the matchings of the previous “left-to-right” step do not count). This step is the symmetric of the previous one and it constructs right-to-left edges from D to U . 3. For any H we choose a “fixed point”, a “left-to-right” or a “right-to-left” edge, meaning the following: The number of left-to-right edges crossing this H – corresponding to a flat of height i – is equal to the number i of right-to-left edges also crossing this H (this property is due to the “balanced” matchings of U and D). So there are 2i + 1 options for H, where the 2i options correspond to breaking one of the i left-to-right edges, or one of the i right-to-left edges. The last option is to let the H map to a trivial cycle of the permutation. We choose one of these 2i + 1 options u.a.r. B Experiments We estimate the distribution after a given number of steps by repeatedly running Mblocks for an appropriate number of steps depending on the width (cf. Table 1). To compute the total variation distance of the distribution of Mblocks after t steps from its stationary distribution π, i.e. X 1 P t (a0 , a) − π(a) , dT V (P t (a0 , ·), π) = · 2 a∈S(n,A) we do not need to know all building block sequences in S(n, A). Let At ⊆ S(n, A) be the set of all building block sequences reached by Mblocks after t steps in at least one run. Then, the total variation distance after t steps is  X  X t 1  dT V (P t (a0 , ·), π) = · D(n, A) − (m(a) · perm(a)) + P (a0 , a) − π(a) . 2 a∈At a∈At B 16 EXPERIMENTS 5000 2000 ● 1000 Mixing time 20000 Mixing time 30000 20000 50000 Maximal mixing time 40000 Maximal mixing time ● 500 10000 ● 200 ● ● ● ● ● ● ● ● ● 5 10 ● ● 100 0 ● ● 15 20 25 30 35 40 5 10 15 20 Width 25 30 35 40 Width Figure 9: Plot of the maximal mixing time for a given width (filled circle) and mixing times for area A∗n (cross) with a linear y-axis (left) and a logarithmic y-axis (right). The dashed line in the right plot shows f (x) = x3 . Total variation for width 6 1.0 1.0 Total variation for width 5 0.6 0.8 Area 2 Area 3 Area 4 Area 5 Area 6 Area 7 0.0 0.2 0.4 Total variation 0.6 0.4 0.0 0.2 Total variation 0.8 Area 2 Area 3 Area 4 200 400 600 Time 800 1000 200 400 600 800 1000 Time Figure 10: Total variation for width n = 5 (left), respectively n = 6 (right), and every area A ≤ (n/2)2 with |S(n, A)| > 1. B 17 EXPERIMENTS 0.4 ● 0.6 0.8 Area 2 Area 3 Area 4 Area 5 Area 6 Area 7 Area 8 Area 9 Area 10 Area 11 Area 12 Area 13 Area 14 ● ● 0.2 ● Total variation 0.6 0.4 ● 0.2 Total variation 0.8 Area 2 Area 3 Area 4 Area 5 Area 6 Area 7 Area 8 Area 9 Area 10 1.0 Total variation for width 8 1.0 Total variation for width 7 ● ● ● ● ● ● ● ● 0.0 ● 200 ● ● ● ● 400 ● ● ● ● 600 ● ● ● ● 800 0.0 ● ● ● ● 1000 ● ● ● ● ● ● ● 200 ● ● ● ● ● ● ● ● 400 ● ● ● ● ● ● 600 Time ● ● ● ● ● ● 800 ● 1000 Time Figure 11: Total variation for width n = 7 (left), respectively n = 8 (right), and every area A ≤ (n/2)2 with |S(n, A)| > 1. ● ● ● ● 0.2 ● ● ● ● ● ● ● ● 0.8 0.6 ● ● ● ● ● ● 400 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 600 Time ● ● ● ● ● ● ● 800 ● ● ● ● ● ● ● ● 1000 200 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 0.0 0.0 200 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 0.4 ● ● 0.2 0.6 ● ● 0.4 Total variation ● ● Total variation 0.8 Area 2 Area 3 Area 4 Area 5 Area 6 Area 7 Area 8 Area 9 Area 10 Area 11 Area 12 Area 13 Area 14 Area 15 Area 16 Area 17 Area 18 1.0 Total variation for width 10 1.0 Total variation for width 9 ● ● ● ● ● ● ● ● ● 400 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 600 ● ● ● ● ● ● ● ● ● ● ● ● ● 800 Area 2 Area 3 Area 4 Area 5 Area 6 Area 7 Area 8 Area 9 Area 10 Area 11 Area 12 Area 13 Area 14 Area 15 Area 16 Area 17 Area 18 Area 19 Area 20 Area 21 Area 22 Area 23 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 1000 Time Figure 12: Total variation for width n = 9 (left), respectively n = 10 (right), and every area A ≤ (n/2)2 with |S(n, A)| > 1. C 18 TOP-DOWN DYNAMIC PROGRAMMING APPROACH 0.8 0.6 0.0 0.2 0.4 Total variation 0.6 0.4 0.0 0.2 Total variation 0.8 1.0 Total variation for width 12 1.0 Total variation for width 11 0 500 1000 1500 0 500 Time 1000 1500 Time Figure 13: Total variation for width n = 11 (left), respectively n = 12 (right), and every area A ≤ (n/2)2 with |S(n, A)| > 1. C Top-Down Dynamic Programming Approach For the sake of clarity we first describe the dynamic programming procedure for counting unweighted Motzkin paths of any given width n and area A.1 Specifically, we define the following subproblem: M (n, A, h, p) = the number of Motzkin paths of width n, area A, height h and with ph = p and fh = 0. Note that we forbid flats of height h and fix the number of peaks at height h. To count the number of paths of a given n, A and height h including flats at height h (so dropping the fh = 0 condition) and not fixing the number of peaks at height h we can simply compute M (n, A, h) := M (n, A, h + 1, 0). The number of Motzkin paths of given width and area can be obtained by summing over all h: M (n, A) := n X M (n, A, h). h=0 If we also sum over all possible areas, we get the classic Motzkin numbers 2 M (n) := n X M (n, A). A=0 We next show that M can be computed in polynomial time. We make use of Equation (7) in Theorem 8 for the number m(a) of Motzkin paths that can be constructed out of building sequence a. 1 Though this task can be solved by an easier dynamic programming, our approach does extend to the weighted case, which is our main goal. C TOP-DOWN DYNAMIC PROGRAMMING APPROACH 19 Theorem 14. Table M (n, A, h, p) can be computed for all the O(n5 ) many possible parameters in O(n7 ) total time. Proof. Recall that in M we forbid flats of height h and fix the number of peaks of height h. This allows the following recursive counting: Base case. If any of the parameters is equal 0 then ( 1 if n = A = h = p = 0, M (n, A, h, p) := 0 else if n ≤ 0 or A ≤ 0 or h ≤ 0. (13) Recursion. Otherwise, when all parameters are strictly positive, we have M (n, A, h, p) :=  n  X p+f f =0 f   n/2  0 X p+f +p −1 · M (n0 , A0 , h − 1, p0 ) , · 0−1 p 0  (14) p =1 where n0 = n − 2p − f and A0 = A − (2h − 1)p − (h − 1)f . In the recursive case, we enumerate all potential numbers of flats and peaks at height h − 1 so that we can look up the corresponding subproblems. These subproblems are then weighted by the  p+f +p0 −1 which we derived in Equations (8) and (9). We number of possible interleavings p+f 0 p −1 f have thus shown that the table M (n, A, h, p) above can be computed for all the O(n5 ) many possible parameter values in time O(n7 ) with the bottleneck being the two nested sums in Equation (14). Let us now consider the problem of counting weighted Motzkin paths, that is, the function D(n, d) in Equation (2). To this end, we extend the definition of M above so to count each path mz according to its weight perm(a(mz ) ). The resulting table D(n, d, h, p) can be computed recursively in a top-down fashion by incorporating into the recursion of M (n, A, h, p) the two terms defining perm(a(mz ) ) in Equation (6):   n X p+f D(n, d, h, p) := |{z} h2p · (2h − 1)f · · | {z } f peak options f =0 flat options    n/2  0−1 X p + f + p  · D(n0 , d0 , h − 1, p0 ) , 0−1 p 0 (15) p =1 where n0 = n − 2p − f and d0 = d − (2h − 1)p − (h − 1)f . The base case is identical to the unweighted case Equation (13). Again, we can drop the condition that there are no flats on the last level h: D(n, d, h) := D(n, d, h + 1, 0), and count all weighted Motzkin paths of given area and width simply as D(n, d) := n X D(n, d, h). h=0 Both the time for computing D(n, d, h, p) and its overall space are asymptotically the same as those used for M (n, A, h, p). We have thus proven the following: Corollary 2. Table D(n, d, h, p) and its marginals D(n, d, h) and D(n, d) can be computed for all O(n5 ) many possible parameter values in O(n7 ) total time.
8cs.DS
1 Cloud vs Edge Computing for Mobile Services: Delay-aware Decision Making to arXiv:1711.03771v1 [cs.IT] 10 Nov 2017 Minimize Energy Consumption Meysam Masoudi, Student Member, IEEE, Cicek Cavdar, Member, IEEE Abstract A promising technique to provide mobile applications with high computation resources is to offload the processing task to the cloud. Mobile cloud computing enables mobile devices with limited batteries to run resource hungry applications with the help of abundant processing capabilities of the clouds and to save power. However, it is not always true that cloud computing consumes less energy compared to mobile edge computing. It may take more energy for the mobile device to transmit a file to the cloud than running the task itself at the edge. This paper investigates the power minimization problem for the mobile devices by data offloading in multi-cell multi-user OFDMA mobile cloud computing networks. We consider the maximum acceptable delay and tolerable interference as QoS metrics to be satisfied in our network. We formulate the problem as a mixed integer nonlinear problem which is converted into a convex form using D.C. approximation. To solve the optimization problem, we have proposed centralized and distributed algorithms for joint power allocation and channel assignment together with decision making. Our simulation results illustrate that by utilizing the proposed algorithms, considerable power saving could be achieved e.g. about 60% for short delays and large bitstream sizes in comparison with the baselines. Index Terms Offloading, Resource Allocation, Mobile Cloud Computing, Mobile Edge Computing. I. I NTRODUCTION Swift growth in the development of resource hungry mobile applications has motivated users to use smart phones as a platform for running the applications. However mobile devices cannot Part of this work has been accepted in IEEE WCNC2017 [1]. This study is supported by EU Celtic Plus Project SooGREEN Service Oriented Optimization of GREEN mobile networks. 2 always be considered as a platform for resource hungry applications due to their limited power and processing capacity. Moreover, one of the key concerns of users is the battery lifetime of mobile devices [2] while running the applications, knowing the fact that increasing the clock frequency of a CPU increases the power consumption [3]. Therefore, there is a tension between the resource hungry applications and resource poor mobile devices. To tackle the aforementioned problem, one solution is to bridge the gap between available and required resources by offloading the burden from mobile devices to the cloud [4]. Cloud computing with abundant processing resources has become an attractive solution in order to ease this pain for the storage and data processing. Cloud computing for mobile applications will enable new services for mobile users. It is true that cloud computing can potentially save energy for the mobile users [2], however this is not always true when the device consumes more energy to transmit the data to the cloud than to process that data itself [5]. Because of the interference and radio channel conditions, the transmission of the data may consume more energy for the mobile device. However it is not trivial to decide after making a simple comparison of two energy figures for each device served by one base station since the decision may create interference and change the channel conditions for neighboring devices in the surrounding cells. There is also another important factor which has an impact on the decision: delay. A decision making procedure must consider the delay sensitivity of the applications to determine whether to choose local processing or offloading. Mobile devices consume more joules per bit as the delay requirement gets more stringent to process a certain task [6]. Delay requirements from different mobile broadband services can be seen in Table I. In this paper, we investigate the energy saving potential of data offloading in mobile devices under multi-cell multi-user scenario and propose efficient algorithms to make decisions simultaneously for mobile devices to minimize the total energy consumption by meeting the delay requirements from the services. Channel assignment and power allocation problems are considered jointly with the offloading-decision. A. Related Works Mobile cloud computing (MCC) provides infrastructure, platform, and software as services to the mobile users [9]. On the other hand, the interaction between cloud and mobile user is inevitable in MCC. Consequently, once users decide to offload data to the cloud, it is necessary to efficiently utilize the available resources. Otherwise, users can not benefit from the potential advantages of MCC. In other words, resource management schemes are the key techniques to 3 TABLE I: Acceptable delay for different services Service Type Acceptable Delay [7], [8] Online Games < 1000 ms Omnipresent 1000 ms Third person avatar 500 ms First person avatar 100 ms Audio services Voice over IP Video Services Video over IP < 450 ms 200 ms < 70 ms 150 ms Data < 400 ms Non real-time services Few seconds guarantee the quality of service (QoS) in the MCC networks [10]. The conducted surveys in [11] and [12], addressed the existing studies on the integrating mobile edge computing (MEC) to the mobile networks, the computation offloading schemes, resource management problems, and their current challenges. Accordingly, the main focus of [13] is to model the energy consumption of applications in the MCC networks. The authors also proposed an energy aware resource allocation algorithm and scheduling in the cloud. A framework for offloading the computation to the cloud is proposed in [14]. They investigated an offloading infrastructure which eased the migration of the code to the cloud. The main goal of [15] is to study the mobile code offloading architecture. They illustrated that significant energy saving can be obtained by using their offloading methods. Task offloading for different applications for one user case is studied in [16]. In [17], using experimental measurements, it is shown that wireless access has an inevitable effect on the performance of MCC. The authors in [18], considered the problem of resource scheduling for multi-service multi-user MCC networks. Also in [19], a heuristic approach is adopted to minimize the energy consumption of all users while making decision on offloading and resource allocation for each task. The authors in [20], modeled the energy consumption of the mobile devices. They formulated an optimization problem to minimize the energy consumption of a single device by data offloading. A dynamic application’s task offloading algorithm using Lyapunov optimization is proposed in [21], aiming at minimizing the energy 4 consumption of users with constraint on the maximum acceptable delay for the application. The authors in [22], presented a practical offloading framework in a cost aware Wi-Fi system considering the throughput-delay trade offs. In [23], a game theoretic approach is adopted to design an offloading mechanism for mobile devices. In their model, a multi-user case has been considered while the corresponding QoS as well as their effect on the other users are ignored. In [24], a decentralized offloading game is proposed to make decision among mobile devices in a simple single channel scenario. The partitioning problem for mobile data stream application is defined in [25]. They have used genetic algorithm to solve the problem. They also reported that partitioning data can enhance the application performance in terms of throughput. The authors in [26], utilized the Markov decision process approach to solve the problem of task offloading. They have formulated a delay minimization problem to find the optimal task scheduling policy. In [27], the authors studied the problem of network energy minimization in C-RAN based, MCC system. In this study, the authors jointly optimized the beamforming design and power allocation with a decision making strategy. For energy consumption and latency minimization problem, partial computation offloading algorithm to optimize the computational speed of mobile devices and their transmit power is proposed in [28]. In [29], the authors deal with the latency issue by means of cloudlet infrastructure, which is a data center to bring the cloud closer to the users. The authors in [6], proposed a model for the mobile device energy consumption. They have also derived an offloading policy considering delay and energy consumption under single stochastic wireless channel with only ”good” or ”bad” channel state. Their model is limited to singleuser single-channel case and interference and users’ QoS is not addressed in their model. The authors in [30], considered a simple single-user mobile-edge computing system. They proposed an algorithm to optimize the power consumption and to minimize the delay. In this study, the interference analysis and its effect on the offloading decision is missing. The authors in [31], solved the offloading optimization problem to remove the processing burden from mobile devices without considering the resource allocation. The authors in [32], modeled the offloading decision as a competitive game where users try to minimize their energy consumptions. They did not consider the power allocation which has significant impact on the performance of the algorithms. In [33], to minimize the offloading energy consumption, the authors proposed the joint optimization of computing and radio resources considering the latency constraints in a cloud-edge computing network. In [1], we proposed joint power allocation, decision making and channel assignment (J-PAD) algorithm to perform the resource allocation considering interference 5 and delay constraints. B. Contributions There are still plenty of challenges to be tackled in the multi-cell multi-user and multichannel MCC networks. To the best of our knowledge, the problem of resource allocation and decision making for data offloading in multi cell networks considering multi users has not been addressed in the literature. In this paper we aim at minimizing the power consumption of users while considering the user’s QoS in terms of delay and maximum tolerable interference on each channel. We formulate the resource allocation and offloading optimization problem. We show that the problem is mixed integer nonlinear problem (MINLP), where the optimal solution is intractable. To have a tractable solution, we convert the problem to the convex form and propose two algorithms called J-PAD and C-PAD to solve the problem in a polynomial time. The main contribution of this paper can be summarized as follows: • In the context of multi cellular multi user OFDMA MCC networks, we formulate the resource allocation and offloading problem that is aware of network status and users’ demand aiming at minimizing the total power consumption of all users subject to constraints on QoS of users and interference threshold. • We formulated the problem as a mixed integer nonlinear optimization problem (MINLP). To solve the problem, it is converted to the convex form using variable changing, DC approximation, adding penalty factor, and relaxing the binary constraints. Therefore the problem can be solved in a polynomial time. • We also propose two algorithms to solve the problem of resource allocation and decision making. The first algorithm is a centralized scheme, designed to be performed at the base station while the second one is a distributed scheme, which requires a partial information exchange, suitable to be performed at the user terminal. The complexity of these algorithms is also investigated. • Through simulations, we show that there exists an offloading region for each user where offloading can help them to save more power. By comparing the cell edge user and normal user in the network, we show that the optimal region depends not only on delay threshold and bit stream size of users but also on the position and channel condition of the users. The rest of the paper is organized as follows. In Section II, system model is presented. The problem formulation and the solution methodology are discussed in Section II-C. We propose 6 Mobile Device Mobile Device Mobile Device Server Mobile Device Server Mobile Device Mobile Device Mobile Device Mobile Device Mobile Device Mobile Device Server Mobile Device Mobile Device Mobile Device Server Mobile Device Mobile Device Mobile Device Mobile Device Mobile Device Mobile Device Mobile Device Server Mobile Device Server Mobile Device Mobile Device Mobile Device Server Mobile Device Mobile Device Mobile Device Mobile Device Server Mobile Device Mobile Device Server Mobile Device Server Mobile Device Mobile Device Mobile Device Mobile Device Mobile Device Server Mobile Device Server Mobile Device Mobile Device Mobile Device Mobile Device Mobile Device Mobile Device Mobile Device Server Mobile Device Mobile Device Mobile Device Fig. 1: System Model our algorithms and corresponding complexity analysis in Section IV followed by the simulation results presented in Section V. Finally, we bring the concluding remarks in Section VI. II. S YSTEM M ODEL AND P ROBLEM F ORMULATION A. System Description According to Fig.1, we consider a cellular network with Nc base stations where mobile users (MUs) are uniformly distributed within a cell range. Each base station is equipped with a server which is responsible for the offloaded users’ data processing and we assume there is a centralized unit which exchanges the required information between base stations using backhaul. Each cell can serve up to Fi active users. We assume that the available bandwidth B is divided to N subchannels. The sub-channel model is adopted from [34] and is composed of large scale fading, small scale fading, and shadow fading. Also, we consider OFDMA as an access method, hence users in the same cell cannot share same sub-channel with each other; however, each user might experience an interference from neighboring cells. In this model, user j in cell i has a bit stream 7 of size Li,j . We have generated the users’ bit stream size with normal distribution with mean Li,j and variance 1 L . 10 i,j Users can process the data on their own or send it to the cloud. Users can not use both schemes, e.g. sending a portion of the data to the cloud and processing the remaining data locally. The data corresponds to the user j in cell i should be processed within the maximum acceptable delay (delay threshold), Ti,j , generated with normal distribution with mean Ti,j and variance 1 T . 10 i,j As we assume that the processed data is short, the response time delay can be neglected [6]. B. Power Model 1) Local Processing Power Model: When users are supposed to process the data locally, the CPU power consumption is dominant. It is composed of dynamic power, circuit power, and leakage power [28]. The dynamic power as a dominating power in CPU, is function of required CPU cycles which depends on both delay threshold and input data size. Under the optimal value for CPU frequency, the minimum power consumption of CPU is proportional to the (T /L)n , where T is the maximum acceptable delay and L is the users’ bit stream size and n is the scaling factor power [6]. Consequently, we use the following model for local processing power consumption: pLocal i,j Lni,j =M n , Ti,j (1) where pLocal is the local processing power consumption of user j in cell i and M is a constant i,j value that depends on the CPU and application parameters [6]. 2) Offloading Power Model: The transmission power, for sending data to the cloud is, ptx i,j = N X ai,j,n pi,j,n , (2) n=1 where pTi,jx denotes the transmission power consumption of user i in cell j and ai,j,n is a binary variable representing whether the corresponding sub-channel is assigned to the user or not. Therefore, the user’s total transmission power is 1 Tx Pi,j = ptx + pc , η i,j where η is power amplifier coefficient and pc is a constant circuit power. (3) 8 3) Aggregated Power Model: Total power consumption of the active users in the network can be written as: P T otal = Fi Nc X X pi,j (4) i=1 j=1 where pi,j = si,j pTi,jx + (1 − si,j )pLocal i,j N = si,j ( 1X ai,j,n pi,j,n + pc ) η n=1 MLni,j + (1 − si,j ) n . Ti,j (5) The integer variable si,j takes the value of 0 if user j in cell i uses its own processor and takes the value of 1 if the user sends the data to the cloud. Therefore, the total power consumption can be written as: P T otal = Fi X Nc X N X i=1 j=1 1 si,j (ai,j,n pi,j,n + pc ) η n=1 Fi Nc X X MLni,j + (1 − si,j ) n . Ti,j i=1 j=1 (6) Moreover, the signal to noise plus interference ratio at the base station in cell i is given by: γi,j,n = ptx i,j,n hi,j,n (n) σ 2 + Ii , (7) where the channel gain from jth MU of ith cell is denoted by hi,j,n . The channel gain from user m, in cell k to the cell i is denoted by hik,m,n . The first term in the denominator of (7) is the noise power and the second term is the interference from other cells on channel n in cell i which can be calculated as: (n) Ii = Fi Nc X X i ak,m,n sk,m ptx k,m,n hk,m,n . (8) k=1 m=1 k6=i In our assumption, the users must utilize the whole duration. Considering fixed T , power minimization is in line with energy minimization. 9 C. Problem Formulation In this section, we develop the mathematical formulation for decision making and resource allocation problem. The base station determines the offloading users and allocates sub-channels to its users and specifies the suitable power level on each sub-channel. The objective of the resource allocation is to minimize the aggregated power consumption of all users by allocating resources to the offloading users in a way that their delay requirement is satisfied. The optimization problem can be formulated as follows: PT otal min {a,p,s} (9) subject to C1: 0 ≤ pTx i,j ≤ pmax , ∀i, j, C2: Fi Nc X X (n) sk,j ak,j,n pk,j,nhik,j,n ≤ Ith , ∀i, n, k=1 j=1 k6=i C3: Ti,j ≤ Tmax , ∀i, j, C4: Fi X N X P roc , ∀i, si,j ai,j,n log2 (1 + γi,j,n) ≤ Rmax j=1 n=1 C5: Fi X ai,j,n ≤ 1, ∀i, n, j=1 C6: ai,j,n ∈ {0, 1}, ∀i, j, n, C7: si,j ∈ {0, 1}, ∀i, j. In (9), the objective is to minimize the total power consumption of all active MUs in the network. The constraint C1 indicates that the transmit power of each user is limited to pmax . The constraint C2 states that for each base station i, the interference arising from other cells on each sub-channel is restricted to be within a threshold. The constraint C3 restricts the maximum tolerable delay for user j in the i-th cell to Tmax if the aforementioned user sends its data to the cloud. If a user decides to process the data locally, then the CPU will be responsible for satisfying this constraint. In our analysis we assume that CPU uses the entire available time to reduce the power consumption. The constraint C4 addresses the processing limitation at the cloud. The constraint C5 guarantees the OFDMA assumption in each cell where each sub-channel 10 is assigned to at most one user. The constraints C6 and C7 indicate that the sub-channel and data offloading indices are binary variables. It is worth mentioning that the constraint C3 can be written in an equivalent form. Using C3 we will have Li,j Li,j ≥ . Ti,j Tmax Defining Rmin , Li,j Tmax (10) and noting that the left side of (10) is the total data rate of the j-th user in the i-th cell, we obtain the following equivalent constraint for C3: si,j N X ai,j,n log2 (1 + γi,j,n ) ≥ si,j Rmin , ∀i, j. (11) n=1 In the rest of this paper, we consider the constraint C3 in the form presented in (11). The optimization problem defined in (9) is a mixed integer nonlinear problem (MINLP) and finding the optimal solution is NP-hard and cannot be solved in a polynomial time. The nonconvexity is coming from three reasons in the problem. The first and second reasons are the binary inherent of decision making variable, constraint C7, and the combinatorial nature of sub-channel allocation, constraint C6. The third one is due to the constraints C3 and C4 and existence of the power allocation variable in the denominator of SINR formula defined in (7). In the following section, we address how to deal with these variables and solve the problem by converting it into a convex form. III. S OLUTION M ETHODOLOGY In this section, we aim to transform the primary problem defined in Section II-C into a canonical convex form. In this regard, we classify the challenges into two categories, binary variables and non convex functions. To resolve the challenges caused by the binary variables, one approach is to relax the troublesome constraints, sub-channel allocation for instance, to shape the problem into a convex form and then making hard decision in the end as we did in [35]. An alternative approach is to add auxiliary constraints to enforce the solution to be in our desired form as we will describe later. Another approach is to break the problem into sub-problems so that one could successively first solve the problem for the annoying binary variable and consequently, given this variable, solve the rest of the problem. To deal with the non-convex functions, we utilize a theory of optimization for a superclass of convex functions, called Difference of Convex (D.C.) functions [36]. Later we demonstrate that 11 our problem can be written in form of D.C. functions. In the end, applying Taylor approximation enables us to solve the last stage of converting the primary problem defined in (9), into a convex form. Having all these powerful approaches available, we tackle the problem, as follows. In the first step, we break down the problem into two sub-problems and then solve them successively. The first sub-problem is to determine the channel assignment for each user in each cell. The second sub-problem is to find out the decision variable and power allocation. We use the solution of the first sub-problem as an input to the second sub-problem. Also, the results of second sub-problem is used to update the solution for the first sub-problem and this process continues until the convergence. Furthermore, we apply two approaches to solve the second subproblem. The overview of two utilized approaches to solve the problem can be seen in equations (12) and (13). In the first approach, after separating the sub-channel assignment, the problem can be solved jointly for other variables e.g. power allocation and decision variable as follows: Iteration t−1 Initialization }| { }| { z z a[0] → (p[0], s[0]) → . . . → a[t − 1] → (p[t − 1], s[t − 1]) Iteration t Optimal Solution }| { }| { z z → a[t] → (p[t], s[t]) → a⋆ → (p⋆ , s⋆ ) . (12) In the second approach, we separate sub-channel assignment, power allocation, and decision variable from each other as follows: Iteration t−1 Initialization }| { }| { z z a[0] → p̃[0] → s[0] → . . . → a[t − 1] → p̃[t − 1] → s[t − 1] Iteration t Optimal Solution }| { z }| { z → a[t] → p̃[t] → s[t] → a⋆ → p̃⋆ → s⋆ . (13) The main difference between these two approaches is that in the former, we jointly solve the problem of power allocation and decision making; However, in the latter, we divide the second sub-problem into two steps and solve each sub-problem individually. In the following subsections, first we deal with solving the first sub-problem followed by solving the second sub-problem by converting it into a convex from. A. Sub-Problem One: Optimal Sub-channel Assignment Given the power allocation vector p̃[t–1], the optimal sub-channel assignment a[t] for further power allocation and offloading in the next iteration t is as follows: 12 Proposition 1. Given the power vector, minimum power consumption is attained when each sub-channel in each cell is assigned to the MU with the highest effective interference on that sub-channel. Proof. Because the problem is power minimization and also minimum data rate requirement of users should be satisfied, the minimum power is consumed when the inequality of minimum required rate becomes the equality. Now let us assume that all users are given the best possible channel to reach their data rate with minimum power consumption. Also, let a user have a channel with effective interference value lower than a highest value and the user has data rate rmin on that channel. Thus, the consumed power on that channel is log2 (1 + γi,j,n) = rmin C pi,j,n = hi,j,n , (14) (15) σ2 +I n where C here is a constant value. Also from our assumption, we know that the effective interference in a denominator of (15), e.g. hi,j,n , σ2 +I n is not the highest possible value. Hence, if we assign the highest effective interference value to this user, the total power consumption will be lower and this is in contrast with the assumption of minimum power consumption. Therefore, minimum power is consumed when maximum effective interference is the criterion for the channel allocation. In other words, with higher effective interference, less power is consumed to satisfy the minimum required rate. Let EIi,j,n denotes the effective interference vector of a user on the channel n. High effective interference in a channel means that the MU is experiencing a good channel condition with a low interference from other cells. Therefore, the decision for channel allocation will be made based on the following criterion: ãi,j,ñ = 1 ñ=max EIi,j,n ∀i, j. (16) Thus, a channel allocation matrix a[t] at time t, can be formed with the elements obtained from the equation (16). At this stage we have solved the first sub-problem and the results will be available for next steps. In the next two subsections, we solve the second sub-problem introduced in (12) and (13). 13 B. Sub-Problem Two: Power Allocation, and Decision Making In the previous subsection we have solved the problem of sub-channel assignment and therefore one of the challenges of the primary problem (9) is resolved. The results of previous subsection will be used in this section to solve the sub-problem of power allocation and decision making. As in (12) and (13), two approaches are applied to tackle the challenges. These approaches are discussed in the following subsections. 1) Joint Power Allocation and Decision Making (J-PAD): Given a sub-channel assignment, the problem of joint power allocation and data offloading can be rewritten as: minP T otal (17) {p,s} subject to C1: 0 ≤ si,j pTi,jx ≤ pmax , C2: Fi Nc X X ∀i, j, (n) sk,j pk,j,nhik,j,n ≤ Ith , ∀i, n, k=1 j=1 k6=i C3: si,j N X log2 (1 + γi,j,n) ≥ si,j Rmin , ∀i, j, n=1 C4: Fi X N X P roc si,j log2 (1 + γi,j,n) ≤ Rmax , ∀i, j=1 n=1 C7: si,j ∈ {0, 1}, ∀i, j. To solve (17), we first reformulate it to a more mathematically tractable form. Since si,j is a binary variable, we can write si,j log2 (1 + γi,j,n ) = log2 (1 + si,j γi,j,n ). Moreover, the problem consists of the product terms of si,j pi,j,n . We use the following change of variable p̃i,j,n = si,j pi,j,n , (18) to recast the optimization problem. Also, the optimization problem includes integer variable si,j . Hence to convert si,j s into continuous variables, we can express the constraint C7 as the intersection of the following regions: R1 : 0 ≤ si,j ≤ 1, ∀j, i,  P P R2 : j i si,j − s2i,j ≤ 0. (19) 14 Hence, we can write the optimization problem of (17) as follows min PT otal p̃,s s.t. C1–C4, R1 , R2 . (20) The problem of (20) is a continuous optimization problem with respect to all variables. However, we aim to find integer solutions for si,j ’s. To attain this goal, we add a penalty function to the objective function of (20) to penalize it if the values of si,j ’s are not integer. Thus, the problem can be modified to min L(p̃, s, λ) p̃,s s.t. C1–C4, R1 . (21) In (21), L(p̃, s, λ) is the Lagrangian of (20), and is defined as XX  L(p̃, s, λ) , PT otal + λ si,j − s2i,j , j (22) i where λ is the penalty factor which should be λ ≫ 1. It can be shown that, for sufficiently large values of λ, the optimization problem of (21) is equivalent to (20) and attains the same optimal value [37]. Proposition 2. For sufficiently large values of λ, the optimization problem of (21) is equivalent to (20) Proof. We start with this point that the optimization problem of (21) can be expressed as min max L(p̃, s, λ) and its dual problem can be written as max min L(p̃, s, λ). Suppose that p̃,s λ λ p̃,s p̃λ , sλ , and ϕ(λ) denote the optimal solution and the optimal value of of the optimization problem of (21), respectively, i.e. ϕ(λ) = L(p̃λ , sλ , λ) = min L(p̃, s, λ) p̃,s (23) Then, we will have max ϕ(λ) = max L(p̃λ , sλ , λ) = max min L(p̃, s, λ) λ λ λ p̃,s ≤ min max L(p̃, s, λ) = problem(20) p̃,s λ (24) 15 Recall that for ∀ s ∈ D, R1 , we have XX i j  si,j − s2i,j ≥ 0. In other words, ϕ(λ) is an increasing function in λ and according to (24), is bounded by the  P P optimal value of problem (20). If for some 0 ≤ λ∗ < ∞, i j si,j − s2i,j = 0, then (p̃λ∗ , sλ∗ ) is feasible for the main problem, too. As a result, we will have ϕ(λ∗ ) = L(p̃λ∗ , sλ∗ , λ∗ ) = max L(p̃λ∗ , sλ∗ , λ) λ ≥ min max L(p̃λ , sλ , λ) p̃,s λ (25) comparing (25) and (24), we conclude that the strong duality holds and we have ϕ(λ∗ ) = max ϕ(λ), (26) λ since ϕ(λ) is a monotonically increasing function with respect to λ, for ∀λ ≥ λ∗ we have ϕ(λ) = pT otal (p̃λ , sλ ) = min max L(p̃, s, λ) = problem(20) ∗ ∗ p̃,s λ At the optimal point and for the second case where we have P P i j (27)  si,j − s2i,j > 0, ϕ(λ∗ ) goes to ∞ because of the monotonicity of the ϕ(λ) with respect to the λ. This contradicts the max-min  P P inequality which states that ϕ(λ∗ ) is bounded from above. Thus, the term i j si,j − s2i,j should be zero, and the results of the first case hold. 16 Now, the optimization problem can be converted to the following problem min {p̃,s} Fi X Nc X N X p̃i,j,n + i=1 j=1 n=1 +λ ML3i,j (1 − si,j ) 3 Ti,j j=1 i=1 XX i Fi Nc X X (si,j − s2i,j ) j  (28) subject to C1: 0 ≤ N X p̃i,j,n ≤ si,j pmax , ∀i, j, n=1 C2: Fi Nc X X (n) p̃i,j,n hik,j,n ≤ Ith , ∀i, n, k=1 j=1 k6=i C3: N X log2 (1 + n=1 C4: Fi X N X log2 (1 + j=1 n=1 C7: si,j ∈ [0, 1], (n) where I˜i , Fi Nc X X p̃i,j,nhi,j,n ) ≥ si,j Rmin , σ 2 + I˜(n) ∀i, j, p̃i,j,n hi,j,n P roc ) ≤ Rmax , σ 2 + I˜(n) ∀i, ∀i, j, p̃k,m,n hik,m,n . We can write the objective function in (28) as f1 (p̃, s) − k=1 m=1 k6=i f2 (p̃, s), where f1 (p̃, s) , Fi X Nc X N X p̃i,j,n + i=1 j=1 n=1 λ PNc i=1 Fi X Fi Nc X X i=1 ML3i,j ((1 − si,j ) 3 + λsi,j ), and f2 (p̃, s) , Ti,j j=1 s2i,j are two convex functions. In a similar way, for ∀i, j, we define zi,j,n (p̃) and j=1 qi,j,n (p̃) as   Fi Nc X X i 2 zi,j,n (p̃),log2 p̃i,j,nhi,j,n + p̃k,m,n hk,m,n + σ , (29) k=1 m=1 k6=i qi,j,n(p̃) , log2 X Fi Nc X p̃k,m,n hik,m,n k=1 m=1 k6=i  +σ , 2 (30) then, we can write constraints C3 and C4 as follows C3: Zi,j (p̃) − Qi,j (p̃) ≥ si,j Rmin , ∀i, j, C4: P roc Qi (p̃) − Zi (p̃) ≥ −Rmax , ∀i, (31) 17 where Zi,j (p̃) , N X zi,j,n (p̃), Qi,j (p̃) , n=1 Fi X N X N X qi,j,n (p̃), Zi (p̃) , n=1 Fi X N X zi,j,n (p̃), and Qi (p̃) , j=1 n=1 qi,j,n (p̃) are concave functions. Therefore, the problem is in the form of the difference j=1 n=1 of two convex (concave) functions (D.C. programming) [36]. In D.C. programming, we start from a feasible initial point and iteratively solve the optimization problem. Let k denote the iteration number. At the k-th iteration, to make the problem convex, using the first order Taylor approximation for f2 (p̃, s), Qi,j (p̃) and Zi (p̃) as follows f˜2 (p̃, s) ≅ f2 (p̃, sk−1 ) + ∇s f2T (p̃, sk−1 ).(s − sk−1 ), Q̃i,j (p̃) ≅ Qi,j (p̃k−1 ) + ∇p̃ QTi,j (p̃k−1 ).(p̃ − p̃k−1 ), Z̃i (p̃) ≅ Zi (p̃k−1 ) + ∇p̃ ZiT (p̃k−1 ).(p̃ − p̃k−1 ), (32) where p̃k−1 and sk−1 are the solutions of the problem at (k − 1)-th iteration and ∇x denotes the gradient operation with respect to x. Thus, at the k-th iteration, instead of dealing with the problem of (17), we solve the following convex problem min f1 (p̃, s) − f˜2 (p̃, s) (33) {p̃,s} subject to: C1, C2, C7, C3: Zi,j (p̃) − Q̃i,j (p̃) ≥ si,j Rmin , P roc C4: Qi (p̃) − Z̃i (p̃) ≥ −Rmax , ∀i, j, ∀i. It can be shown that the D.C. programming results in a sequence of feasible solutions that iteratively achieves better solutions than previous iteration until it converges. Proposition 3. The D.C. programming results in a sequence of feasible solutions that iteratively decrease the total power consumption of the network. Proof. To show that our solutions are feasible for the original problem, first, we notice that the solution of the approximated problem in the i-th iteration must satisfy the constraint C3 and C4, i.e., Zi,j (p̃t ) − Q̃i,j (p̃t ) = Zi,j (p̃t ) − {Qi,j (p̃t−1 ) + ∇p̃ QTi,j (p̃t ).(p̃t − p̃t−1 )} ≥ Rmin , (34) 18 Qi (p̃t ) − Z̃i (p̃t ) = Qi (p̃t ) − {Zi (p̃t−1 ) + ∇p̃ ZiT (p̃t ).(p̃t − p̃t−1 )} P roc , ≥ −Rmax (35) On the other hand, since Zi,j and Qi are two concave functions with respect to p̃, due to the first order condition for the concave functions [38], we have T Zi,j (p̃) ≤ Zi,j (p̃t−1 ) + ∇p̃ Zi,j (p̃t−1 ).(p̃ − p̃t−1 ). (36) Qi (p̃) ≤ Qi (p̃t−1 ) + ∇p̃ QTi (p̃t−1 ).(p̃ − p̃t−1 ). (37) Substituting p̃ = p̃t into (36) and (37) results in T Zi,j (p̃t ) ≤ Zi,j (p̃t−1 ) + ∇p̃ Zi,j (p̃t−1 ).(p̃t − p̃t−1 ). (38) Qi (p̃t ) ≤ Qi (p̃t−1 ) + ∇p̃ QTi (p̃t−1 ).(p̃t − p̃t−1 ). (39) From (34) and (35), we conclude that Zi,j (p̃t ) − Qi,j (p̃t ) ≥ Zi,j (p̃t ) − {Qi,j (p̃t−1 ) + ∇p̃ QTi,j (p̃t ).(p̃t − p̃t−1 )} ≥ Rmin , (40) Qi (p̃t ) − Zi (p̃t ) ≥ Qi (p̃t ) − {Zi (p̃t−1 ) + ∇p̃ ZiT (p̃t ).(p̃t − p̃t−1 )} P roc ≥ −Rmax , (41) Thus, the solution for the approximated problem is feasible for the original problem too. Now, we show that the total power consumption of the network will decrease iteratively. Since g(s) is a convex function, due to the first order condition for the convex functions [38], we have g(s) ≥ g(s0) + ∇s g T (st−1 ).(s − s0 ). (42) 19 Using (42) and considering the fact that the objective function of (28) can be written as f (s) − g(s), at the (t + 1)-th iteration we have f (st+1 ) − g(st+1 ) ≤ f (st+1 ) − g(st ) − ∇s g T (st).(st+1 −st ) = min f (s) − g(st ) − ∇s g T (st ).(s − st ) s ≤ f (st ) − g(st ) − ∇s g T (st ).(st − st ) = f (st ) − g(st ) Thus, the total power consumption of the network decreases as iterations continue. 2) Channel assignment, Power Allocation, and Decision Making (C-PAD): Similar to subsection III-B1, we assume that channel assignment vector is given based on proposition 1. Given sub-channel assignment, the optimization problem can be rewritten as: minP T otal (43) {p} subject to C1: 0 ≤ si,j pTi,jx ≤ pmax , C2: Fi Nc X X ∀i, j, (n) sk,j pk,j,nhik,j,n ≤ Ith , ∀i, n, k=1 j=1 k6=i C3: si,j N X log2 (1 + γi,j,n) ≥ si,j Rmin , ∀i, j, n=1 C4: Fi X N X P roc si,j log2 (1 + γi,j,n) ≤ Rmax , ∀i, j=1 n=1 By applying the method used in previous section we can formulate the problem as a D.C. programming optimization problem. In other words, similar to (34) and (35) we have: C3: Zi,j (p̃t ) − Qi,j (p̃t ) ≥ Rmin , ∀i, j (44) P roc C4: Qi (p̃t ) − Zi (p̃t ) ≥ −Rmax , ∀i, (45) 20 Applying the first order Taylor approximation, the optimization problem can be written as minP T otal (46) {p} subject to C1: 0 ≤ si,j pTi,jx ≤ pmax , C2: Fi Nc X X ∀i, j, (n) sk,j pk,j,nhik,j,n ≤ Ith , ∀i, n, k=1 j=1 k6=i C3: Zi,j (p̃t ) − {Qi,j (p̃t−1 ) + ∇p̃ QTi,j (p̃t ).(p̃t − p̃t−1 )} ≥ Rmin C4: ∀i, j Qi (p̃t ) − {Zi (p̃t−1 ) + ∇p̃ ZiT (p̃t ).(p̃t − p̃t−1 )} P roc ≥ −Rmax ∀i Given sub-channel assignment and power consumption vectors, offloading decisions can be made by users. Recall the power consumption of user j in cell i in (1) and (3). Each user can compare offloading and local processing power consumption to make the decision si,j as follows: si,j =   1  0 Local Tx Pi,j > Pi,j Local Pi,j ≤ (47) Tx Pi,j IV. A LGORITHM D ESIGN In this section, based on our solutions, we propose two tractable algorithms to solve the optimization problem in a polynomial time. The first algorithm fits well to a situation where information of all cells are available at the centralized unit and base stations are in charge of performing the offloading algorithms. The second algorithm suits well when offloading algorithm is performed at MUs sides and only partial information exchange is required between base stations. 21 A. J-PAD Algorithm Algorithm 1 performs Joint Power Allocation and Decision making and is called J-PAD. J-PAD is designed to solve the convex optimization problem presented in (33). Here, the key idea is to make decision and allocate power simultaneously, while channels are assigned beforehand. Algorithm 1, represents the procedure of solving the optimization problem using J-PAD algorithm. Algorithm 1 Joint Power Allocation and Decision Making (J-PAD) algorithm 1: Initialize power, a, s, Imax , λ, and Counter = 0 2: while Counter ≤ Imax do 3: Channel Allocation 4: Calculate EIi,j,n based on (16) ∀i, j, n 5: Form a[t] based on EIi,j,n 6: Power Allocation and Offloading Decision for i=1 to Nc do 7: 8: 9: a) Solve the problem (33) using interior point method [38] b) Update Power Vector based on the solution of (33) c) Update sk,u,n according to the solution of (33) end for Update λ, Counter = Counter + 1 10: Centralized unit updates the I based on (8) and sends this value back to the base stations. 11: end while J-PAD algorithm is composed of two main sections, channel assignment, based on the equation (16), and power allocation and offloading decision. After performing the second part, the power vectors and offloading decisions are updated at each base station and will be sent to the centralized unit. Then the centralized unit updates the interference value on each channel and sends them back to each base station for next iteration. The problem is solved at the base station where the offloading algorithm is performed. Besides, λ plays an important role in the performance of J-PAD algorithm. It is a penalty factor to punish the objective function for any value of offloading decision variables, which is not equal to 0 or 1. Therefore λ should be large enough e.g. 105 , (λ ≫ 1) [37], to penalize the 22 objective. One can fix this value to a predetermined high value but here we first set the λ to a relatively low value ( λ > 1 ). In this case, the value of s will be a real value in [0,1]. Then in next iterations we tighten the condition on s by choosing larger λ. B. C-PAD Algorithm In this section, we propose an alternative algorithm to J-PAD which has less complexity and the decision making process can be moved to the MUs side instead of the BS. In this situation, MUs only need partial information from other cells. To avoid the integer inherent of the problem, we assign channels and make offloading decision iteratively before allocating the power. Hence, we divide the algorithm into three main parts. 1) Channel allocation which is done based on the (16). 2) Offloading decision which is performed by comparing the alternative solutions power consumption according to the (47). 3) Power allocation. In the latter part, channel allocation and offloading decisions are not optimization variables anymore because they are known for each user beforehand. Therefore, this algorithm performs Channel allocation, Power Allocation and Decision making iteratively and is called C-PAD algorithm. The procedure of finding the solution with C-PAD algorithm is presented in algorithm 2. In the algorithm 2 the channel allocation scheme is the same as algorithm 1. For offloading section, each user compares its power consumption for two possible cases e.g. local processing or offloading and makes decision accordingly. Given these variables, the problem of power minimization can be solved. This segmentation enables us to perform the algorithm at users’ side. In other words, the second algorithm is a distributed scheme with very low data exchange requirements at the expense of losing optimality. Centralized unit sends information about interference to each base station and the base stations relay this information to the users. Afterwards, users can use their local information and make their decisions. The procedure will continue until the convergence criteria is met. The computational complexity of the proposed algorithms will be discussed and compared in the next section. C. Complexity Analysis In this section, we investigate the computational complexity of our proposed algorithms. In both J-PAD and C-PAD, to assign sub-channels to the users, we have to find the user with highest effective interference. Let F denote the maximum number of users existing in a cell, 23 Algorithm 2 Channel allocation, Power Allocation and Decision Making (C-PAD) algorithm 1: Initialize initial points, Imax , λ, and Counter = 0 2: while Counter ≤ Imax do 3: Channel Allocation 4: Calculate EIi,j,n based on (16) ∀i, j, n 5: Form a[t] based on EIi,j,n 6: Offloading Decision 7: Determine the offloading decision based on (47) for each user. 8: Update the channel allocation and offloading decision vector. 9: Power Allocation for i=1 to Nc do 10: Solve the problem (28) with a given channel allocation and offloading decision vector a) using interior point method [38] Update Power Vector based on the solution found from (28) b) 11: end for 12: Counter = Counter + 1 13: Centralized unit updates the parameter I based on (8) and sends this value back to the base stations and base stations distribute it to the users. 14: end while i.e., F = max Fi . Since finding the maximum of a set with K elements requires O(K) i=1,...,Nc operations, the sub-channel assignment phase has the complexity order of O(NF Nc ). For the data offloading and power allocation in J-PAD algorithm, we have totally Nc F (N + 1) decision variables and Nc (3F + N + 1) convex and linear constraints [37]. Therefore, the computational complexity of solving a joint data offloading and power allocation problem is given by O((NcF (N + 1))3 (Nc (3F + N + 1))) ≈ O(Nc4 F 3 N 3 (3F + N)) In C-PAD algorithm, the data offloading and power allocation are separated. To find the data offloading strategy, it is sufficient to compare the power consumption in cases that each user uses its processor or sends its data to the cloud and select the one with lowest power consumption. Since, we have to carry this out for all users in all cells, we need O(Nc F ) operations. For the power allocation, we have totally Nc F N variables and Nc (2F + N + 1) linear and convex 24 constraints. Similar to what has been presented for the first approach, the power allocation computational complexity has the order of O(Nc4 F 3 N 3 (2F +N)). The computational complexity of proposed methods is summarized in table II. TABLE II: Computational Complexity of proposed approaches. Sub-channel Data Offloading Power Allocation Assignment J-PAD O(N F Nc ) C-PAD O(N F Nc )   O Nc4 F 3 N 3 (3F + N )   O(Nc F ) O Nc4 F 3 N 3 (2F + N ) V. S IMULATION R ESULTS A. System Parameters In this section we evaluate the performance of the proposed algorithms using numerical studies after defining the system parameters and base line cases. The scenario as depicted in Fig.1, is multi-cell mobile network where each base station is equipped with a computing server. The simulation parameters and their corresponding values are summarized in Table III. We assume that each cell can serve up to Fi users and their QoS is defined as a maximum acceptable delay. The carrier frequency is set to 2GHz and thermal noise is considered as a zero mean Gaussian random variable with variance of σ 2 and power spectral density of N0 = −174dbm/Hz, so σ 2 = (W/N)N0 . Pathloss model is adopted from [34], shadow fading is modeled as zero mean log normal distribution with variance of 8db, and Rayleigh fading is modeled as a unit-mean exponential distribution. Each cell has a coverage radius of 500m and users are distributed uniformly within a cell coverage. We have compared our results with two baseline cases to understand the main reasons behind the power savings: whether the saving is more dominated by the offloading decisions or it stems from power control on each channel. In the first one, all MUs use local processing and nobody offloads the data to the cloud. Comparing with this scheme, we can observe how much power saving can be obtained by utilizing the proposed algorithms. Second base line is equal power allocation. In this scheme, power is equally allocated on user’s assigned channels such that required QoS is satisfied. According to the given power allocation, channel assignment is performed based on (16). Comparing to this scheme, we can find out the amount of power saving related to the power adjustment on each channel. 25 TABLE III: Simulation parameters values Definition Notation Value Sub-carrier bandwidth B 200 KHz Number of sub-carrier N 25 Number of cells Nc 7 Number of active MUs Fi 5 Circuit power Pc 100 mW Power amplifier efficiency η 0.4 Scaling factor power n 3 Maximum allowable interference Ith −101 dbm Noise power spectral density N0 −174 dbm/Hz Maximum transmit power of users Pmax 23 dbm Maximum delay of user j in cell i Ti,j 100 ms Average bit stream size of user j in cell i Li,j 2000 bits Power Consumption (mW) 2.5 ×10 4 J-PAD C-PAD Equal-Power Local Computing 2 1.5 1 0.5 0 1000 1500 2000 2500 3000 3500 4000 4500 5000 Bit Stream Size (bits) Fig. 2: Aggregate power consumption for different bit stream sizes B. Simulation Results The total power consumption of all users over different bit stream sizes is depicted in Fig.2. The larger bit stream size is, the more power is consumed meanwhile the gap between local computing and proposed algorithms power consumption increases. Fig.3 illustrates how J-PAD and C-PAD could help users to offload and how much power 26 60 J-PAD C-PAD J-PAD C-PAD 90 80 50 40 70 30 60 20 50 10 40 30 1000 1500 2000 2500 3000 3500 4000 4500 Power Saving Percentage Local User Percentage 100 0 5000 Bit Stream Size (bits) Fig. 3: Power saving vs. percentage of local computing users Power Consumption (mW) ×10 5 J-PAD C-PAD Equal-Power Local Computing 4.5 4 3.5 4500 3 4000 3500 2.5 3000 2 2500 2000 1.5 1500 1 1000 0.5 0 500 0.25 0.05 0.1 0.15 0.2 0.3 0.25 0.35 0.3 0.4 0.35 0.45 0.4 0.5 0.45 Maximum Acceptable Delay (s) Fig. 4: Aggregate power consumption for different acceptable delays is saved. As can be seen from the figure, by increasing the bit stream size, the percentage of local computing users decreases. The reason is that local processing of the large bit stream size results in higher power consumption in comparison with sending the data to the cloud. Therefore, confirmed by simulations depicted in Fig.3, users tend to use the alternative option e.g. offloading, to save energy. For large bit stream sizes, using J-PAD and C-PAD, about 30% of users decided local processing and 60% power saving is attained in comparison with local computing base line. Comparing J-PAD and C-PAD, J-PAD slightly outperforms C-PAD in terms of energy saving at most 20%, while it has more complexity. The maximum acceptable delay as a quality of service requirement is another parameter that affects the power consumption and offloading decisions. In Fig.4, we have investigated the 27 70 J-PAD C-PAD J-PAD C-PAD 90 80 60 50 70 40 60 30 50 20 40 10 30 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 Power Saving Percentage Local User Percentage 100 0 0.5 Maximum Acceptable Delay (s) Fig. 5: Power saving vs. percentage of local computing users for different acceptable delays delay impact on our algorithms. Longer acceptable delay for offloading users means lower data rate requirement and consequently lower power consumption for sending data. Also for local computing users, it results in lower power consumption confirmed by power model. The gap between the proposed algorithms and the benchmark is wide at the beginning and becomes tighter as maximum acceptable delay gets longer. To discover why, we have illustrated the percentage of the local computing users and the corresponding power savings in Fig.5. For short delays, the power consumption is relatively high which decays as the acceptable delay becomes longer. It can be seen that users, based on the mobile devices power model, prefer local processing when they can tolerate the considerable delay. Using J-PAD or C-PAD for short delays, about 65% power saving is obtained while for long delays, i.e., when the processing delay requirement can be relaxed, power savings from offloading is diminished because local processing power drops down exponentially with the processing delay due to the power model in Eq. (1), resulting in almost all users processing locally. Users’ offloading decision not only relies on the power model but also depends on the other users’ decisions due to the interference from the neighboring cells. Consequently, the number of active users in the network is also crucial. Fig.6 and Fig.7 address this issue. The more users exist in the network, the higher interference is created which means lower SINR, less data rate and consequently more experienced delay for the users. As a result, the percentage of local users (not necessarily the absolute number) increases with the increasing number of users. For 10 users in cell, proposed algorithms could still achieve about 30% power saving in comparison with local computing base line. 28 Power Consumption(mW) 105 J-PAD C-PAD Local Computing 104 103 102 1 2 3 4 5 6 7 8 9 10 Number of Users in each cell Fig. 6: Aggregate power consumption over different number of users Local User Percentage 70 60 65 50 60 J-PAD C-PAD J-PAD C-PAD 40 30 55 50 45 20 40 10 35 0 1 2 3 4 5 6 7 8 9 Power Saving Percentage 75 70 30 10 Number of Users in each cell Fig. 7: Power saving vs. percentage of local computing users for different number of users In Fig.8, we investigate the offloading region for normal and cell edge users to find out when offloading could save power. For normal users, one can see that for large bit stream size and low acceptable delay, e.g. yellow region in the figures, J-PAD and C-PAD can help mobile devices to save power. For fixed delay, by enlarging the bit stream size we enter to the offloading region. Moreover, C-PAD has a wider region than J-PAD because the offloading decision is made before solving the optimization problem. Our simulation results also reveal that cell edge users with poor channel gain and SINR cannot make benefit from offloading to the cloud. Because with bad channel condition, users need more power than local processing to send data to the cloud with acceptable rate to meet the delay requirements. Here, providing users with better SINR, e.g. using joint transmission, might be helpful. 29 Cloud Computing Local Computing 1 1 0.9 0.9 Maximum Acceptable Delay (s) Maximum Acceptable Delay (s) Local Computing 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 Cloud Computing 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 0 0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 0 Bit Stream Size 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 Bit Stream Size (a) J-PAD offloading regions for normal user (b) C-PAD offloading regions for normal user Fig. 8: Offloading regions for J-PAD and C-PAD VI. C ONCLUSION In this paper, the aggregate power consumption of mobile devices as a crucial aspect of mobile cloud computing networks is considered. Accordingly, an optimization problem aimed at minimizing the aggregate power of all users is formulated. To take into account the practical considerations, maximum allowable interference level on each sub-channel and maximum tolerable delay of users are considered. Knowing the inherent non-convexity of our primary problem, we applied the D.C. approximation to transform the non-convex problem to a convex one. We proposed two algorithms, called J-PAD and C-PAD to solve the problem in polynomial time. J-PAD algorithm is better than C-PAD in terms of power saving but with the cost of complexity; therefore, it is not suitable to be used in the mobile terminal but in the BSs with high processing resources. C-PAD has the advantage of running at the users side at the cost of losing the optimality. Our simulations demonstrated that there exist an offloading region for non-cell edge users where they can benefit from offloading data to the cloud. Finally, confirmed by our results, significant enhancement in terms of power consumption of mobile devices could be achieved using proposed algorithms. R EFERENCES [1] M. Masoudi, B. Khamidehi, and C. Cavdar, “Green cloud computing for multi cell networks,” in 2017 IEEE Wireless Communications and Networking Conference (WCNC) (IEEE WCNC 2017), San Francisco, USA, Mar. 2017. 30 [2] K. Kumar and Y.-H. Lu, “Cloud computing for mobile users: Can offloading computation save energy?” Computer, vol. 43, no. 4, pp. 51–56, 2010. [3] J. Kwak, Y. Kim, J. Lee, and S. Chong, “Dream: dynamic resource and task allocation for energy minimization in mobile cloud systems,” IEEE Journal on Selected Areas in Communications, vol. 33, no. 12, pp. 2510–2523, 2015. [4] R. Kaewpuang, D. Niyato, P. Wang, and E. Hossain, “A framework for cooperative resource management in mobile cloud computing,” IEEE Journal on Selected Areas in Communications, vol. 31, no. 12, pp. 2685–2700, 2013. [5] Y. Zhang, D. Niyato, and P. Wang, “Offloading in mobile cloudlet systems with intermittent connectivity,” IEEE Transactions on Mobile Computing, vol. 14, no. 12, pp. 2516–2529, 2015. [6] W. Zhang, Y. Wen, K. Guan, D. Kilper, H. Luo, and D. O. Wu, “Energy-optimal mobile cloud computing under stochastic wireless channel,” IEEE Transactions on Wireless Communications, vol. 12, no. 9, pp. 4569–4581, 2013. [7] M. Claypool and K. Claypool, “Latency and player actions in online games,” Communications of the ACM, vol. 49, no. 11, pp. 40–45, 2006. [8] M. Dusi, S. Napolitano, S. Niccolini, and S. Longo, “A closer look at thin-client connections: statistical application identification for qoe detection,” IEEE Communications Magazine, vol. 50, no. 11, 2012. [9] Y. Xu and S. Mao, “A survey of mobile cloud computing for rich media applications.” IEEE Wireless Commun., vol. 20, no. 3, pp. 1–0, 2013. [10] P. Piunti, C. Cavdar, S. Morosi, K. E. Teka, E. Del Re, and J. Zander, “Energy efficient adaptive cellular network configuration with qos guarantee,” in IEEE ICC 2015, 2015, pp. 1658–1663. [11] P. Mach and Z. Becvar, “Mobile Edge Computing: A Survey on Architecture and Computation Offloading,” ArXiv e-prints, Feb. 2017. [12] Y. Mao, C. You, J. Zhang, K. Huang, and K. B. Letaief, “Mobile edge computing: Survey and research outlook,” CoRR, vol. abs/1701.01090, 2017. [Online]. Available: http://arxiv.org/abs/1701.01090 [13] X. Xu, W. Dou, X. Zhang, and J. Chen, “Enreal: An energy-aware resource allocation method for scientific workflow executions in cloud environment,” IEEE Transactions on Cloud Computing, vol. 4, no. 2, pp. 166–179, April 2016. [14] S. Kosta, A. Aucinas, P. Hui, R. Mortier, and X. Zhang, “Thinkair: Dynamic resource allocation and parallel execution in the cloud for mobile code offloading,” in INFOCOM, 2012 Proceedings IEEE. IEEE, 2012, pp. 945–953. [15] H. Tout, C. Talhi, N. Kara, and A. Mourad, “Smart mobile computation offloading: Centralized selective and multi-objective approach,” Expert Systems with Applications, pp. –, 2017. [16] A. Ellouze, M. Gagnaire, and A. Haddad, “A mobile application offloading algorithm for mobile cloud computing,” in Mobile Cloud Computing, Services, and Engineering (MobileCloud), 2015 3rd IEEE International Conference on. IEEE, 2015, pp. 34–40. [17] M. V. Barbera, S. Kosta, A. Mei, and J. Stefa, “To offload or not to offload? the bandwidth and energy costs of mobile cloud computing,” in INFOCOM, 2013 Proceedings IEEE. IEEE, 2013, pp. 1285–1293. [18] X. Liu, Y. Li, and H.-H. Chen, “Wireless resource scheduling based on backoff for multi-user multi-service mobile cloud computing,” 2016. [19] M.-H. Chen, B. Liang, and M. Dong, “Joint offloading decision and resource allocation for multi-user multi-task mobile cloud,” in 2016 IEEE International Conference on Communications (ICC). IEEE, 2016, pp. 1–6. [20] S. E. Mahmoodi, K. Subbalakshmi, and V. Sagar, “Cloud offloading for multi-radio enabled mobile devices,” in 2015 IEEE International Conference on Communications (ICC). IEEE, 2015, pp. 5473–5478. [21] D. Huang, P. Wang, and D. Niyato, “A dynamic offloading algorithm for mobile computing,” IEEE Transactions on Wireless Communications, vol. 11, no. 6, pp. 1991–1995, 2012. 31 [22] Y. Im, C. Joe-Wong, S. Ha, S. Sen, M. Chiang et al., “Amuse: Empowering users for cost-aware offloading with throughputdelay tradeoffs,” IEEE Transactions on Mobile Computing, vol. 15, no. 5, pp. 1062–1076, 2016. [23] X. Chen, L. Jiao, W. Li, and X. Fu, “Efficient multi-user computation offloading for mobile-edge cloud computing,” IEEE/ACM Transactions on Networking, vol. PP, no. 99, pp. 1–1, 2015. [24] X. Chen, “Decentralized computation offloading game for mobile cloud computing,” IEEE Transactions on Parallel and Distributed Systems, vol. 26, no. 4, pp. 974–983, 2015. [25] L. Yang, J. Cao, Y. Yuan, T. Li, A. Han, and A. Chan, “A framework for partitioning and execution of data stream applications in mobile cloud computing,” ACM SIGMETRICS Performance Evaluation Review, vol. 40, no. 4, pp. 23–32, 2013. [26] J. Liu, Y. Mao, J. Zhang, and K. B. Letaief, “Delay-optimal computation task scheduling for mobile-edge computing systems,” in 2016 IEEE International Symposium on Information Theory (ISIT), July 2016, pp. 1451–1455. [27] J. Cheng, Y. Shi, B. Bai, and W. Chen, “Computation offloading in cloud-ran based mobile cloud computing system,” in 2016 IEEE International Conference on Communications (ICC). IEEE, 2016, pp. 1–6. [28] Y. Wang, M. Sheng, X. Wang, L. Wang, and J. Li, “Mobile-edge computing: Partial computation offloading using dynamic voltage scaling,” 2016. [29] M. Satyanarayanan, P. Bahl, R. Caceres, and N. Davies, “The case for vm-based cloudlets in mobile computing,” IEEE pervasive Computing, vol. 8, no. 4, pp. 14–23, 2009. [30] Y. Mao, J. Zhang, and K. B. Letaief, “Joint task offloading scheduling and transmit power allocation for mobile-edge computing systems,” CoRR, vol. abs/1701.05055, 2017. [Online]. Available: http://arxiv.org/abs/1701.05055 [31] Y. Liu and M. J. Lee, “An effective dynamic programming offloading algorithm in mobile cloud computing system,” in Wireless Communications and Networking Conference (WCNC), 2014 IEEE. IEEE, 2014, pp. 1868–1873. [32] E. Meskar, T. D. Todd, D. Zhao, and G. Karakostas, “Energy aware offloading for competing users on a shared communication channel,” IEEE Transactions on Mobile Computing, vol. 16, no. 1, pp. 87–96, Jan 2017. [33] A. AL-Shuwaili, O. Simeone, A. Bagheri, and G. Scutari, “Joint uplink/downlink optimization for backhaul-limited mobile cloud computing with user scheduling,” IEEE Transactions on Signal and Information Processing over Networks, vol. PP, no. 99, pp. 1–1, 2017. [34] E. U. T. R. Access, “Further advance-ments for e-utra physical layer aspects,” 3GPP TR 36.814, Tech. Rep., 2010. [35] M. Masoudi, H. Zaefarani, A. Mohammadi, and C. Cavdar, “Energy efficient resource allocation in two-tier ofdma networks with qos guarantees,” Wireless Networks, pp. 1–15, 2017. [36] H. H. Kha, H. D. Tuan, and H. H. Nguyen, “Fast global optimal power allocation in wireless networks by local dc programming,” IEEE Transactions on Wireless Communications, vol. 11, no. 2, pp. 510–515, 2012. [37] E. Che, H. D. Tuan, and H. H. Nguyen, “Joint optimization of cooperative beamforming and relay assignment in multi-user wireless relay networks,” IEEE Transactions on Wireless Communications, vol. 13, no. 10, pp. 5481–5495, 2014. [38] S. Boyd and L. Vandenberghe, Convex optimization. Cambridge university press, 2004.
7cs.IT
Preliminary Notes on Termination and Non-Termination Reasoning arXiv:1309.3128v1 [cs.PL] 12 Sep 2013 Ton Chanh Le Department of Computer Science, National University of Singapore [email protected] Abstract. In this preliminary note, we will illustrate our ideas on automated mechanisms for termination and non-termination reasoning. 1 1.1 Termination and Non-Termination Reasoning with Logical Abduction Introduction Program termination and non-termination reasoning have gained an enormous interest over the last decade. For termination reasoning, beside the traditional approach with ranking functions, there are various new approaches are proposed, such as the size-change principle for functional programs [12], the polyranking principle for multi-path programs [3] and the disjunctive wellfoundedness principle for imperative programs [6]. For non-termination reasoning, Gupta et al. [9] propose a constraint-based approach to find the recurrent set of a loop, which is the initial configuration for infinite executions of this loop. However, in these representative works, termination and non-termination analyses are usually considered as separate mechanisms. In other words, there is no cooperation between termination and non-termination analyses in these works. Inspired from the recent success of the cooperation between safety and termination provers in finding supporting invariants for the validity of termination arguments [4,11,2], we strongly believe that the cooperation between termination and non-termination provers will gain the same success as the termination analysis can benefit from the non-termination analysis by excluding non-terminating behaviors of programs and vice-versa. For example, the idea of excluding non-terminating program behaviors is important for termination analyzers which is based on counterexample to termination to construct termination arguments like ARMC [15]. These tools might not terminate when dealing with non-terminating loops as the number of the generated counterexamples is infinite. There are few past works that take advantage of non-termination analysis in reasoning program termination. In [10], the supporting invariants for termination arguments are synthesized as the complement of unreachable non-terminating conditions by relying on an existing non-termination prover [9] and a safety prover. In [1], the authors determine in which domains the weakest precondition for non-termination is decidable, so does the precondition for termination. [8] is another related approach, which divides a transition relation into two subrelations whose termination is proved and whose behaviors are still unknown by a fixpoint computation. A program is proved to be terminating for all inputs if the set of unknown behaviors is empty. Otherwise, a sufficient condition for termination is returned. As opposed to these approaches, our aim is to solve not only the conditional termination problem [5] but also the conditional non-termination problem so that we can construct a more complete picture about the terminating and non-terminating behaviors of a program. In general, our proposed mechanism will incrementally partition unknown program behaviors into terminating, non-terminating and/or unknown sub-behaviors. The analysis can be facilitated by (safety) preconditions of the program provided by users or by automated safety provers. Otherwise, the analysis will start with the trivial precondition true. Specifically, we initially prove the program non-termination by showing that its exit points are unreachable under the given preconditions. If not, then the program might terminate. Next, a ranking function synthesizer, such as [14], will be invoked to find a termination measure for the program. As the possibility of non-termination is excluded, when the complete method for linear ranking function synthesis [14] fails, there are two remaining possibilities that could happen: (i) the program terminates but a linear ranking function does not exist or (ii) a supporting invariant for termination proving is missing. For both possibilities, we then perform a case analysis on the program preconditions by an auxiliary condition, called potential non-terminating condition and its negation. Intuitively, that condition ensures that the program does not terminate (or the loop condition is not violated) after the current execution and it can be inferred by logical abduction. Here we do not seek an actual non-terminating precondition like [10] as it is still possible that the program terminates (without a linear ranking function). If the inferred condition is an actual precondition for non-termination, it will be proved in the next step of the analysis. Otherwise, it will be continuously refined in further steps. In both cases, the negation of the potential non-terminating condition also facilitate the termination reasoning as it strengthens the precondition in which the program’s exit points are reachable. 1.2 Examples Let consider two resembling examples with different (non-) termination behaviors and their corresponding loop transition relations in Fig. 1. To analyze the termination and non-termination of these loops, we are only interested in the non-trivial cases, i.e., when the loops’ conditions are satisfied and these loops thus execute at least one time. For those examples, we initially prove their non-termination by showing that their exit points are unreachable. This can be done by an unsatisfiability check on the formula ρ ∧ ¬ψ[X ′ /X], where ρ and ψ are the transition relation and the while (x≥0) { x = x−y; y = y+1; } while (x≥0) { x = x−y; y = y−1; } ρa ≡ x≥0 ∧ x′ =x−y ∧ y ′ =y+1 (a) ρb ≡ x≥0 ∧ x′ =x−y ∧ y ′ =y−1 (b) Fig. 1. Examples on numerical programs with different termination behaviors. Example (a) is terminating for any input while example (b) is always nonterminating for the input x≥0 ∧ y≤0. condition of the loop, respectively. For instance, the exit point of the loop in Fig. 1(a) might be reachable from the loop body as the following formula ρa ∧ ¬(x′ ≥ 0) ≡ x ≥ 0 ∧ x′ = x + y ∧ y ′ = y − 1 ∧ x′ < 0 (1) is satisfiable, which means that the program is possibly terminating. We then check whether the loop terminates immediately after the current execution by the validity of the entailment ρa ⊢ ¬(x′ ≥ 0) ≡ x ≥ 0 ∧ x′ = x + y ∧ y ′ = y − 1 ⊢ x′ < 0 (2) The entailment (2) is invalid or the formula ρa ∧ x′ ≥0 is satisfiable. This result shows that with the precondition x≥0, satisfying the loop condition, the loop might execute in more than one steps. We now know that we need a ranking function synthesis tool, such as [14], to find a witness for the program termination, if any. With two above simple checks on (1) and (2), we can avoid to invoke the synthesis tool too early on trivial cases of termination or when the considered loop is non-terminating. However, we receive a failure result from the synthesis tool. Consequently, there is not a linear ranking function for that loop and/or a supporting invariant, which helps to separate terminating and non-terminating execution of the loop, is missing for termination proving on that program. To find out the missing invariant, we firstly infer a potential non-terminating condition, which ensures that the loop condition is not violated after the current execution. As opposed to the condition inferred from the finding of a potential ranking function [5,8], this condition can be logically inferred from the entailment ρ ⊢ ψ[X ′ /X]. Thus, we can handle loop conditions with a more general structure (e.g., disjunctions). A trivial solution for such potential non-terminating condition is ψ[X ′ /X], where ψ is the loop condition. Thus, the negation of this condition is a sufficient condition for program termination, under which the loop terminates after the current execution. However, we need a stronger condition which can be obtained via logical abduction [13]. An abductive constraint φ for the validity of the entailment Γ ⊢ ψ is usually inferred by the quantifier elimination on the universal formula ∀V.(¬Γ ∨ ψ) where the set of variables V can be determined from a minimum satisfying assignment (MSA) of Γ ⊢ ψ as in [7] or defined by users. Another approach which is suitable for abductive inference is constraint solving. In this approach, the unknown constraint φ would be inferred by Farkas’ lemma and a non-linear solver. In contrast, we have designed a lightweight abductive inference for linear arithmetic with a balance between the number of variables and the generality of the inferred constraints. Our approach does not require an expensive quantifier elimination with a calculation of MSA or non-linear constraint solver. Back to the example 1(a), the inferred potential non-terminating condition is y ≤ 0 as ρa ∧ y≤0 ⊢ x′ ≥0. Then we perform a case analysis on this condition by partitioning the transition relation ρa into ρ1a ≡ ρ ∧ y≤0 and ρ2a ≡ ρ ∧ y>0. As opposed to our approach, [8,11] syntacticly partition the transition relation based on the condition for the decrease of a potential ranking function or the boundedness of a quasi-ranking function, respectively. Applying the same procedure for ρ1a and ρ2a , we can prove that the execution corresponding to the relation ρ2a (when x≥0 ∧ y>0) always terminates. The termination proof is successful because the auxiliary condition y > 0 is also proved to be a supporting invariant. The execution corresponding to the relation ρ1a (when x≥0∧y≤0) also terminates and eventually reaches the terminating case x≥0 ∧ y>0. Thus, the program always terminate for any input. For the example 1(b), we can similarly infer the same potential non-terminating condition y ≤ 0. This condition is also the actual non-terminating condition of the loop. For the other case when x≥0 ∧ y>0, we mark it as possibly terminating case as the execution from it can reach either the base case x≥0 or the nonterminating case x≥0 ∧ y≤0 according to the initial reachability checks. Another advantage of this approach is that the (non-) y = f(); termination of each loop is analyzed in a modular fashwhile (x ≥ 0) { ion as the supporting invariants for termination proof are x = x − y; discovered from the loop itself rather than from its initial y = y + 1; } contexts, which might be too complicated to analyze. Let Fig. 2. A modified consider a modified version of an example from [4] in Fig. version of an exam- 2, in which the initial value of y is determined by a compliple from [4] with cated function f . Consequently, the supporting invariant a complicated func- y > 0 for the ranking function x is hard to discover due to the complexity of the analysis on f . For this example, we tion f . analyze the while loop in isolation and show that the loop terminates for all input as with the example in Fig. 1(a). Thus, we can conclude that the whole program terminates with an assumption that the function f also terminates. References 1. M. Bozga, R. Iosif, and F. Konečný. Deciding conditional termination. In Proc. TACAS’12, pages 252–266, 2012. 2. A. R. Bradley, Z. Manna, and H. B. Sipma. Linear ranking with reachability. In Proc. CAV’05, pages 491–504, 2005. 3. A. R. Bradley, Z. Manna, and H. B. Sipma. The polyranking principle. In Proc. ICALP’05, pages 1349–1361, 2005. 4. M. Brockschmidt, B. Cook, and C. Fuhs. Better termination proving through cooperation. In Proc. CAV’13, pages 413–429, 2013. 5. B. Cook, S. Gulwani, T. Lev-Ami, A. Rybalchenko, and M. Sagiv. Proving conditional termination. In Proc. CAV’08, pages 328–340, 2008. 6. B. Cook, A. Podelski, and A. Rybalchenko. Termination proofs for systems code. In Proc. PLDI’06, pages 415–426, 2006. 7. I. Dillig and T. Dillig. Explain: A tool for performing abductive inference. In Proc. CAV’13, pages 684–689, 2013. 8. P. Ganty and S. Genaim. Proving termination starting from the end. In Proc. CAV’13, pages 397–412, 2013. 9. A. Gupta, T. A. Henzinger, R. Majumdar, A. Rybalchenko, and R.-G. Xu. Proving non-termination. In Proc. POPL’08, pages 147–158, 2008. 10. W. R. Harris, A. Lal, A. V. Nori, and S. K. Rajamani. Alternation for termination. In Proc. SAS’10, pages 304–319, 2010. 11. D. Larraz, A. Oliveras, E. Rodrı́guez-Carbonell, and A. Rubio. Proving termination of imperative programs using Max-SMT. In Proc. FMCAD’13, 2013. 12. C. S. Lee, N. D. Jones, and A. M. Ben-Amram. The size-change principle for program termination. In Proc. POPL’01, pages 81–92, 2001. 13. C. S. Peirce. Collected papers of Charles Sanders Peirce, volume 3. Harvard University Press, 1974. 14. A. Podelski and A. Rybalchenko. A complete method for the synthesis of linear ranking functions. In Proc. VMCAI’04, pages 239–251, 2004. 15. A. Podelski and A. Rybalchenko. ARMC: The logical choice for software model checking with abstraction refinement. In Practical Aspects of Declarative Languages, pages 245–259. 2007.
6cs.PL
Time-Varying Control Scheduling in Complex Dynamical Networks Erfan Nozari1,* , Fabio Pasqualetti2 , and Jorge Cortés1 arXiv:1611.06485v2 [math.OC] 11 Nov 2017 1 Department of Mechanical and Aerospace Engineering, University of California, San Diego 2 Department of Mechanical Engineering, University of California, Riverside * Corresponding author (email: [email protected]) Abstract: Despite extensive research and remarkable advancements in the control of complex networks, time-invariant control schedules (TICS) still dominate the literature. This is both due to their simplicity and the fact that the potential benefits of time-varying control schedules (TVCS) have remained largely uncharacterized. Yet, TVCS have the potential to significantly enhance network controllability over TICS, especially when applied to large networks. In this paper we study networks with linear and discrete-time dynamics and analyze the role of network structure in TVCS. Through the analysis of a new scale-dependent notion of nodal communicability, we show that optimal TVCS involves the actuation of the most central nodes at appropriate spatial scales at all times. Consequently, we show that it is the scale-heterogeneity of the central-nodes in a network that determine whether, and to what extent, TVCS outperforms conventional policies based on TICS. Several analytical results and numerical examples support and illustrate this relationship. Many natural and man-made systems, ranging from the nervous system to power and transportation grids to societies, exhibit dynamic behaviors that evolve over a sparse and complex network. The ability to control such network dynamics is not only a theoretically challenging problem but also a barrier to fundamental breakthroughs across science and engineering. While multiple studies have addressed various aspects of this problem, several fundamental questions remain unanswered, including to what extent the capability of controlling a different set of nodes over time can improve the controllability of large-scale, complex networked systems. Controllability of a dynamical network (i.e., a network that supports the temporal evolution of a well-defined set of nodal states) is classically defined as the possibility of steering its state arbitrarily around the state space through the application of external inputs to (i.e., actuation of) certain control nodes [1]. This raises a fundamental question: how does the choice of control nodes affect network controllability? Hereafter, we refer to this as the control scheduling problem [2–4]. Notice that in this classical setting, attention is only paid to the possibility of arbitrarily steering the network state, but not to the difficulty and energy cost of doing so. This has motivated the introduction of several controllability metrics to quantify the required effort in the control scheduling problem [5–9]. While a comprehensive solution has remained elusive, these works have collectively revealed the role of several factors in the control scheduling problem such as the network size and structure [6], nodal dynamics [3] and centralities [2, 7], the number of control nodes [6], and the choice of controllability metric [8]. The majority of the above literature, however, implicitly relies on the assumption of TICS, namely, that the control node(s) is fixed over time. Depending on the specific network structure, this assumption may come at the expense of a significant limitation on its controllability, especially for large-scale systems where distant nodes inevitably exist relative to any control point. Intuitively, the possibility of TVCS, namely, the ability to control different nodes at different times, allows for targeted interventions at different network locations and can ultimately decrease the control effort to accomplish a desired task. On the other hand, from a practical standpoint, the implementation of TVCS requires the ability to geographically relocate actuators or the presence of actuation mechanisms at different, ideally all, network nodes, and more sophisticated control policies. This leads to a critical trade-off between the benefits of TVCS and its implementation costs which has not received enough, if any, attention in the literature. The significant potential of time-varying schedules for control (and also sensing, which has a dual interpretation to control) has led to the design of (sub)optimal sensor and control scheduling algorithms in recent years [10–13]. While constituting a notable leap forward and the benchmark for the methods developed in this paper, these works are oblivious to the fundamental question of whether, and to what extent, TVCS provides an improvement in network controllability compared to TICS. Our previous work [14] has studied the former question (i.e., whether TVCS provides any improvement over TICS) in the case of undirected networks, but did not consider general controllability metrics or, more importantly, addressed the latter question of how large the relative improvement in network controllability is. Given the trade-off between benefits and costs of TVCS, a clear answer to this question is vital for the practical application of TVCS in real-world complex networks. In this paper, we address these two questions in the context of directed discrete-time linear network dynamics. We show that 2k-communicability, a new notion of nodal centrality that we define here, plays a fundamental role in TVCS. This notion measures the centrality of each node in the network at different spatial scales. Based on the distinction between local and global nodal centralities, we show that the optimal control point at every time instance is the node with the largest centrality at the appropriate scale (i.e., the node with the largest 2k-communicability at an appropriate k). Accordingly, our main conclusion is that the benefit of TVCS is directly related to the scaleheterogeneity of central nodes in the network: the most benefit is gained in networks where the highest centrality is attained by various nodes at different spatial scales, while this benefit starts to decay as fewer nodes dominate the network at all scales. We provide analytical results and extensive case studies of synthetic and real networks to support and illustrate this conclusion. 1 Results Model time according to x(k + 1) = Ax(k) + b(k)u(k), k ∈ {0, . . . , K − 1}, (1) where u(k) ∈ R is the control input and b(k) ∈ Rn is the time-varying input vector (both at time k) and K is the time horizon. For simplicity of exposition, we consider only one control input at a time, but the discussion is generalizable to multi-input networks (Supplementary Note 6). If ιk ∈ {1, . . . , n} is the index of the node to which the control signal u(k) is applied at time k, then b(k) is equal to the ιk ’th column of the identity matrix. The purpose of applying the control input {u(k)}K−1 k=0 is to steer the network state from its initial state x(0) = x0 to a desired state x(K) = xf . If this is possible for any x0 and xf , (1) is called “controllable”. It is well-known [15] that this is the case if and only if the “controllability Gramian” WK = K−1 X Ak b(K−1−k)b(K−1−k)T (AT )k , (2) k=0 is invertible, in which case the minimal energy required for steering the network from the origin x0 = 0 to any xf equals xfT WK−1 xf (Methods, xfT and WK−1 denote the transpose of the vector xf and the inverse of the matrix WK , respectively).1 Therefore, the unit-energy reachable set (namely, the set of all xf such that xfT WK−1 xf ≤ 1) is a hyper-ellipsoid, the direction and length of the axes of which are given by the eigenvectors and (square root of) the eigenvalues of WK , respectively (Methods). Intuitively, the “larger” the reachability hyper-ellipsoid, the “more controllable” the network dynamics (equation (1)) are. To quantify how large the hyper-ellipsoid is, several measures based on the eigenvalues of WK have been proposed in the literature [6, 8, 16], including the trace of WK (denoted as tr(WK ), measuring average squared length of hyper-ellipsoid axes), the trace of WK−1 (denoted as tr(WK−1 ), measuring average control energy over random target states), the smallest eigenvalue of WK (denoted as λmin (WK ), measuring worst-case controllability), and the determinant of WK (denoted as det(WK ), measuring the hyper-ellipsoid volume). Each metric has its own benefits and limitations, on which we elaborate more in the following section. We consider a network of n nodes that communicate, in discrete time, over a weighted (in general directed) graph G = (V, E, A), where V = {1, . . . , n} and E ⊆ V × V denote the set of nodes and edges, respectively, and A is the adjacency matrix such that for any i , j ∈ V , aij ≥ 0 denotes the weight of the edge from node j to node i (see Supplementary Note 2 for methods of obtaining A from network connectivity structure). Each node i has a state value xi ∈ R that evolves over time through the interaction of node i with its neighbors in G. We assume each node has linear and time-invariant dynamics and one node can 1 Similar expression holds for arbitrary x , but it is customary to 0 be controlled exogenously at each time. Therefore, the evaluate control energy starting from the network’s unforced equiliboverall network state x = [x1 . . . xn ]T ∈ Rn evolves over rium x = 0. Time-Varying vs. Scheduling Time-Invariant Control all the measures rely heavily on this least-controllable direc- Assume f (WK ) ≥ 0 is any of the aforementioned controllability measures. We seek to choose the control nodes K−1 {ιk }K−1 k=0 (or, equivalently, {b(k)}k=0 ) optimally. The conventional approach in the literature [2–9] to this problem is to reduce the search space to constant choices of the control node (i.e., ι0 = ι1 = · · · = ιK−1 = i ) and then choose i such that f (WK ) is maximized. This, namely, the time-invariant control scheduling (TICS) problem, can be formally specified as max f (WK ) s.t. ι0 = · · · = ιK−1 ι0 ,...,ιK−1 ∈V (3a) tion, while tr(WK ) trades this off for average controllability in all directions in the state space. Despite the significant increase in size and complexity, the same core principles outlined above apply to controllability of real-world networks. The large size of these networks, however, imposes new constraints on the choice of the controllability measure f that make the use of f (·) = λmin (·), tr((·)−1 )−1 , and det(·) numerically infeasible and theoretically over-conservative (Methods). As a result, we resort to the particular choice of controllability measure f (WK ) = tr(WK ), (6) (3b) for networks beyond n ' 15. Since this measure has the smallest sensitivity to the choice of {ιk }K−1 k=0 (Figure 1(b)), The main advantage of TICS is its simplicity, from thewe expect any network that benefits from TVCS using the oretical, computational, and implementation perspectives. choice of equation (6) to also benefit from it using other However, this simplicity comes at a possibly significant cost Gramian-based measures (while the converse is not necesin terms of network controllability, compared to the case sarily true, i.e., there are networks that significantly benewhere the control nodes {ιk }K−1 k=0 are independently chofit from TVCS using other measures but show no benefit sen, namely, in terms of tr(WK )). Figure 1(c) illustrates an air transmax f (WK ). (4) portation network among the busiest airports in the United ι0 ,...,ιK−1 ∈V States, comprising of n = 500 nodes. The size of the This approach, namely, time-varying control scheduling network makes the use of f (·) = λmin (·), tr((·)−1 )−1 , and (TVCS), is at least as good as TICS, but has the potential det(·) infeasible, but using the choice of equation (6) we to improve network controllability. Figure 1(a-b) illustrates see a χ ' 20% improvement in the controllability of the a small network of n = 5 nodes together with the optimal network, verifying our expectation about the benefits of values of equations (3) and (4) and the relative advantage TVCS. of TVCS over TICS, defined as In spite of this potential benefit, TVCS has usually higher TV TI f −f computational and implementation costs that need to be χ = max TI max . (5) fmax taken into account. These include the higher computaThree observations are worth highlighting. First, the value tional cost of computing the optimal TVCS, and that of of χ is extremely dependent on the choice of controllability installing an actuator at several (ideally all) nodes of the measure f , and different choices lead to orders of magni- network. Further, not all networks benefit from TVCS tude change in χ. Second, the relative advantage of TVCS alike. A simple directed chain network with the same size over TICS is significant for all choices of the controllabil- as that of Figure 1(a) gains absolutely no benefit from ity measure, with the minimum improvement of χ = 35% TVCS, independently of the choice of controllability meafor the choice of f (·) = tr(·).2 Finally, even with opti- sure f (Figure 1(d-e)). Similarly, χ values of 0 are also mal TVCS, λmin (WK ) is orders of magnitude less than 1, observed in larger, complex networks, indicating that the indicating the inevitable existence of very hard-to-reach di- optimal TVCS involves the control of a single node at all rections in the state space.3 Note that except for tr(WK ), times (Figure 1(f)). These observations collectively raise a fundamental ques2 The fact that f (·) = tr(·) results in the smallest value of χ relation: which networks do and which networks do not benefit tive to other measures is consistently observed in synthetic and realworld networks, and stems from the fact that tr(WK ) has the smallest from TVCS, and how can one distinguish between them? For ease of reference, we call these networks as class V and sensitivity (greatest robustness) to the choice of control schedule. 3 It is well-known [6] that worst-case controllability improves if a I, respectively. In other words, a network belongs to class larger number of nodes can be simultaneously controlled. However, V if it has χ > 0 and to class I otherwise. In the followthis examples shows that efficient controllability cannot be maintained in all directions in the state space even using TVCS in very small ing, we restrict our attention to the choice of controllability measure in equation (6) due to its applicability to all netnetworks with control over 1/5 = 20% of the nodes. work sizes, and carry a thorough analysis of its properties in ease of reference, let r (k) ∈ V denote the index of the order to address the aforementioned fundamental question node that has the largest value Ri (k). Formally, r (k) = arg maxi Ri (k). Then, according to the discussion above, in the theory of dynamical networks. the relation ι∗k = r (K − 1 − k), 2k-Communicability in Dynamic Networks We introduce here a new notion of nodal communicability which plays a pivotal role in distinguishing between class I and class V networks. It can be shown that the solution to TVCS (equation (4)) with f (·) = tr(·) consists of the indices of the largest diagonal entries of (Ak )T Ak (Methods). In other words, for any k, the optimal control node ι∗K−1−k at time K −1−k is precisely the index of the largest diagonal entry of (Ak )T Ak . This motivates our definition of the 2k-communicability of a node i as Ri (k) = ((Ak )T Ak )ii , i ∈ V, k ≥ 0. (7) It can be shown that as k → ∞, Ri (k) results in the same rankings of the nodes as the left eigenvector centrality squared, which is thus taken as the definition of Ri (∞) (Methods and Supplementary Note 1). Figure 2(a-b) illustrates the evolution of Ri (k) as a function of k for all i ∈ V for a sample network of n = 20 nodes. Perhaps the most salient property of 2k-communicability is the extent to which it relies on the local interactions among the nodes. Recall, cf. [17], that for any k, the (i , j) entry of Ak equals the total number of paths of length k from node i to j (if the graph is weighted, each path counts as its weight, equal to the product of the weights of its edges). From equation (7), we see that Ri (k) then equals the sum of the squares of the total (weighted) number of paths of length k ending in node i . In other words, Ri (k) only depends on connections of node i with its k-hop outneighbors, and is independent of the rest of the network. Therefore, Ri (k) is a local notion of centrality for small k and it incorporates more global information as k grows. In particular, Ri (k) is closely related to • the out-degree centrality of node i for k = 1; • the left eigenvector centrality of node i for k → ∞; (Methods and Supplementary Note 1). This scaling property of 2k-communicability is illustrated in Figure 2(a-d) for an example network of n = 100 nodes. is the core connection between 2k-communicability and TVCS. From this, we see that the optimal TVCS involves the application of u(0) to the node r (K − 1) with the highest global centrality and gradually moving the control point until we apply u(K − 2) to the node r (1) with the highest local centrality.4 The intuition behind this procedure is simple. At k = 0, the control input has enough time to propagate through the network, which is why the highest globally-central node should be controlled. As we reach the control horizon K, the control input has only a few time steps to disseminate through the network, hence the optimality of locally-central nodes. The role of Ri (k) in TVCS has an immediate implication for distinguishing between class V and I networks: a network belongs to class V if the nodes with the highest Ri (1) and Ri (K − 1) are distinct (Supplementary Note 3). Consider again the networks of Figure 1(c and f). Here, the color intensity of each node indicates its value Ri (1) while its size corresponds to its value Ri (K − 1). Clearly, the first few largest and darkest nodes are distinct in Figure 1(c), while there is a close correlation between nodal size and darkness in Figure 1(f), illustrating the root cause of their difference in benefiting from TVCS. If a network has r (0) = r (K − 1), it is still possible that the network belongs to class V. In fact, about half of the networks with r (0) = r (K − 1) still belong to V (Figure 3(a)). However, these networks have a value of χ of no more than 3% on average, and in turn this value quickly decreases with the dominance of the node r (0) over the rest of the network nodes (Figure 3(b)). This is a strong indication that, for most practical purposes, the test based on 2k-communicability is a valid indicator of whether a network benefits from TVCS. Furthermore, in the case of undirected networks, it is possible to analytically prove that a network belongs to class I (χ = 0) if certain conditions based on the eigen-decomposition of the adjacency matrix A are satisfied. As shown in Supplementary Note 4, these conditions include: Distinguishing Between Class V and I Net(i) Networks where the eigenvector centrality of one node is significantly higher than the rest of the network, and works Based on 2k-Communicability 4 Notice that the control node at time K −1 is arbitrary as R (0) = We next use the scaling property of 2k-communicability i to unveil network structures that benefit from TVCS. For 1 for all i. (a) TV TI χ fmax f (·) fmax tr(·) 2.00 2.70 0.35 tr((·)−1 )−1 1.26×10−7 8.22×10−4 6.5×103 det(·) 9.90×10−11 7.42×10−10 6.49 λmin (·) 1.27×10−7 1.10×10−4 8.7×102 (b) (c) (d) TV χ TI fmax f (·) fmax tr(·) 5 5 0 tr((·)−1 )−1 0.2 0.2 0 det(·) 1 1 0 λmin (·) 1 1 0 (e) (f) Figure 1: Advantage of TVCS in dynamic networks. (a) A small example network of n = 5 nodes. The thickness of each edge (i , j) illustrates its weight aij . (b) The optimal values of TICS and TVCS (equations (3) and (4), respectively) and the relative TVCS advantage (equation (5)) for the network in (a). (c) An air transportation network among the busiest airports in the United States (see ’air500’ in Table 1 for details). The network is undirected, and the dynamical adjacency matrix A is computed from static connectivity using the transmission method (Supplementary Note 2). This is an example of a network that significantly benefits from TVCS with χ ' 20%. (d) A small example network of the same size as (a) but with no benefit from TVCS. (e) The optimal values of TICS and TVCS (equations (3) and (4), respectively) and the relative TVCS advantage (equation (5)) for the network in (d). We see that the network does not benefit from TVCS independently of the choice of controllability metric. (f) A social network of students at the University of California, Irvine (see ’UCI Forum’ in Table 1 for details). Similar to (c), the network is undirected and the adjacency matrix is computed using the transmission method (Supplementary Note 2). This network, however, does not benefit from TVCS (χ = 0). In (c) and (f), the controllability measure of equation (6) is used due to the large size of the network. In both cases, the color intensity and size of nodes represent their values of Ri (1) and Ri (K − 1), respectively (K = 10). While there is a close correlation between nodal size and color intensity in (f) (i.e., the darkest nodes are also the largest), this is not the case in (c), which is the root cause for the difference in their χ-values. (a) (b) (c) (d) (e) (f) Figure 2: 2k-communicability of dynamical networks. (a) An example network of n = 20 nodes for illustration of the dependence on k of nodal 2k-communicabilities. The thickness of the edges is proportional to their weights. (b) The evolution of the functions {Ri (k)}ni=1 . Although these functions are originally only defined over integer values of k, we have extended their domain to real numbers for better illustration of their crossings and oscillatory behavior. Oscillatory behavior only arises when A has complex-valued eigenvalues (otherwise, Ri (k) is strictly convex). (c) An example network of n = 100 nodes for illustration of the scaling property of 2k-communicability. The node whose 2k-communicabilities are to be computed (i.e., “node i ”) is depicted in red. (d-f) The 2-, 4-, and 14-communicability of the node depicted in red, as determined by its 1-, 2-, and 7-hop incoming paths. We see that Ri (1) only depends on the immediate (out-)neighbors of i , but as k grows, Ri (k) encodes more global information. A fair concern, however, exists regarding the minimum the network dynamics is dominated by the largest eigenvalue of A. A totally disconnected network (with nonzero size of the manipulation needed to make the TVCS allmanifest. If this is excessively high, the prescribed approach self-loops) is the extreme case of such networks. may be infeasible in practice. Nevertheless, among net(ii) Networks where the eigenvector centrality of all works of various size and structure, random manipulations nodes is determined by the weight of their link to the most with norm of about 10% of the norm of A are on average central one. The canonical example is a star network with sufficient (Figure 4). Here, we see that the largest manipuno (or small) self-loops. lations are needed for manifest subnetworks of about 10% (iii) Networks where A has three distinct eigenvalues the total size of the network. This is because when the (e.g., complete bipartite networks, connected strongly reg- size of the manifest subnetwork is extremely small, manipular networks, and some cones on strongly regular graphs) ulations are focused on this small subset of nodes and thus and r (0) = r (∞). Star networks are also the canonical more efficient, while with extremely large manifest subnetworks, the majority of the nodes are accessible for control example here. and there is little restriction on the TVCS. The general abstraction from these cases is that a network Finally, Figure 4 also shows the comparison, in terms of belongs to class I if it contains a sufficiently distinct central controllability, of the manipulation-based approach against node, which reinforces our main conclusion that V is the the alternative approach of selecting an optimal TVCS with class of networks with multiple scale-heterogeneous cen- the additional constraint that control nodes must be mantral nodes.The inclusion relationships between the various ifest (without any manipulation of the dynamics), which classes of networks introduced in this section are summa- results in a sub-optimal all-manifest TVCS. For the comrized in Figure 3(c). parison to be fair, we normalize each network by its spectral radius (largest magnitude of its eigenvalues), and then The Effects of Network Manipulation on Op- compare the optimal value of their TVCS (equation (4)). We see that the amount of relative advantage produced timal Control Scheduling by manifest subnetwork manipulation is comparable to the In many real-world applications of control scheduling, not relative size of the manipulation, except for medium-sized all the nodes are available/accessible for control. In this manifest subnetworks (5 ∼ 20% of nodes), where the macase, only a “manifest” subset of the nodes are available for nipulation advantage is about two times its size. the application of control inputs, while the remaining nodes are “latent” to the controller. The natural solution would TVCS in Synthetic and Real Networks then be to choose the control nodes optimally among the manifest nodes. Another solution, however, is to manipu- Here, we discuss the benefits of TVCS and its relation to late the dynamics among the manifest nodes such that the network structure for several examples of synthetic and real optimal control nodes (when computed without any restric- networks. We start with the classical deterministic examtions on control scheduling) lie among the manifest nodes ples of undirected line, ring, and star networks (Figure 5). Due to their simple structure, the 2k-communicabilities of for all time, provided that such manipulation is possible. Analytically, we can guarantee that the latter scheme these networks can be analytically computed in closed form (manipulating the manifest-manifest dynamics) can always (Supplementary Note 7). Using these results, it follows enforce an all-manifest (i.e., entirely composed of man- that for the line and star networks, the optimal control ifest nodes) optimal TVCS, provided that the manipula- node is always the center node (or any of the two center tion is sufficiently strong and not acyclic (Supplementary nodes if a line has even number of nodes), while the optiNote 5). Both requirements have clear interpretations. mal control node is arbitrary in a ring network. Notice that First, depending on how large the size of the manifest in all cases, it is the homogeneity of these networks that subnetwork is and how central its nodes already are (pre- results in a single node having the greatest centrality at manipulation), larger manipulation may be necessary to all scales (see Supplementary Note 5 for examples of nonturn them into central nodes at various scales (i.e., r (k) homogeneous star networks that have scale-heterogeneous for k = {0, . . . , K − 1}). Second, for the manifest nodes central nodes and thus belong to class V). Next, we analyze the role of TVCS in three classes of to become central at arbitrarily global scales (i.e., r (k) for k ∼ K → ∞), the manipulation must contain paths of ar- probabilistic complex networks that are widely used to capbitrarily long lengths, which are absent in acyclic networks. ture the behavior of various dynamical networks. These Dynamical Networks I V r(0) = r(K - 1) ( Thm. S3.1) Thm. S4.2 Benefit from TVCS (a) (b) (c) Figure 3: The role of 2k-communicability in distinguishing between networks of class V (χ > 0) and I (χ = 0). (a) The proportion of networks in V and I for 104 randomly generated networks. While more than 80% of all networks belong to class V, this number drops to less than 50% among networks with r (1) = r (K − 1) (i.e., networks where the same node has the greatest local and global centralities). (b) The average χ-value of networks with r (1) = r (K − 1) as a function of the dominance of the node r (0). The vertical bars represent one standard deviation intervals. For the node r (0), its dominance (over the rest of the network) is a measure of how distinctly Rr (0) (1) and Rr (0) (K − 1) are larger than Ri (1) and Ri (K − 1), respectively, for i 6= r (0) (Methods). In both (a) and (b), 104 random connectivity matrices are generated with logarithmically-uniform n in [101 , 103 ], uniform sparsity p in [0, 1], and uniform pairwise connectivity in [0, 1], and then transformed to adjacency matrices A using the transmission method (Supplementary Note 2), and K = 10. (c) A Venn diagram illustrating the decomposition of dynamical networks based on the extent to which they benefit from TVCS. The color gradient is a depiction of this extent, as measured by χ (equation (5)), where darker areas correspond to higher χ. As shown in (a) and (b), the class of networks for which r (0) 6= r (K − 1) is only a subset of V but provides a good approximation for it. include the Erdös-Rényi (ER) random networks, BarabásiAlbert (BA) scale-free networks, and Watts-Strogatz (WS) small-world networks. Each network has its own characteristic properties, and these properties lead to different behaviors under TVCS. The average χ-values of these networks are computed for various values of n and network parameters (Figure 6). For ER networks, χ is in general small, and decays with n. This is because ER networks, especially when n is large, are extremely homogeneous. This homogeneity is further increased during the transmission method, leading to a network matrix A that is extremely insensitive to the choice of control nodes. The connectivity structure of BA networks, in contrast, is extremely inhomogeneous, with one (sometimes 2) highly central nodes and a hierarchy down to peripheral leafs. As one would expect, this implies a small χ-value since the center node has the highest centrality at all scales (Supplementary Figure S1). However, when the connectivity matrix is transformed to A using the transmission method, the incoming links to all nodes are made uniform (adding up to 1). This in turns make the centrality levels of all the nodes comparable, leading to high χ-values observed (notice that the underlying connectivity structures are still highly inhomogeneous, distinguishing them from the ho- mogeneous ER networks). Notice that as the growth rate ma is increased, smaller networks tend towards complete graphs and high χ values shift to larger n. As our last class of probabilistic networks, WS networks have the broadest range of size-parameter values with significant χ. As one would expect, χ is low near β = 0, 1, corresponding to regular ring lattice and ER networks, respectively. For β ∼ 0.2, there is a sufficiently high probability of having multiple nodes that are close to many rewired links (increasing their centrality), yet there is a low probability that these nodes, and the nodes close to them, are rewired all alike, resulting in heterogeneous central nodes and high χ-values. This heterogeneity is increased with n as larger networks have more possibilities of rewiring every edge. Finally, we used the tools and concepts introduced so far to analyze TVCS in several real-world dynamical networks (Table 1). These networks are chosen from a wide range of application domains, from neuronal networks to transportation and social networks. According to the type of dynamics evolving over each network, we have used either the transmission or induction method to obtain its dynamical adjacency matrix from its static connectivity (Supplementary Note 2). a a a a a a a a a a a a a a (a) (b) a a a a a a a a (c) Figure 5: Simple networks with closed-form 2kcommunicabilities. (a) A line network, (b) a ring network, and (c) a star network. All networks are undirected and have homogeneous edge weights a. The 2kcommunicabilities of these networks are analytically computed (Supplementary Note 7), concluding that all networks belong to class I, with the optimal control node depicted in red in each case (the optimal control node is arbitrary in a ring network due to its symmetry). Figure 4: Manipulation of manifest subnetworks in order to obtain an all-manifest optimal TVCS. The horizontal axis represents the percentage of manifest nodes in the network. In red, we show the minimum size of manipulation needed for the optimal TVCS to only include manifest nodes, relative to the size of the initial adjacency matrix (both measured by induced matrix 2-norm). In blue, we depict the optimal (i.e., maximal) value of tr(WK ) for the case where the minimal manifest manipulation is applied, relative to the maximal value of tr(WK ) subject to the constraint that all the control nodes are manifest (the former is with manipulation and without constraints on the control nodes, while the latter has no manipulation but control node constraints). Results are for 103 random networks of logarithmically-uniform sizes in [101 , 103 ] but otherwise similar to Figure 3. Markers (circles/squares) represent average values and bars represent one standard deviation intervals. In both cases, the overall adjacency matrix is normalized by its spectral radius for fairness of comparison. We see that medium-sized manifest subnetworks (5 ∼ 20%) are the hardest yet most fruitful to manipulate. We have computed the χ-value for each network using a variable time horizon K ≤ 50, with the results ranging from 0 to more than 30% for different networks. These large variations even within each category signifies both the potential benefits of TVCS and the possibility of its redundancy, a contrast that has been pivotal to our discussion. In the last column, we have also indicated whether the most local and most global central nodes coincide in each network. Recall that this is a sufficient but not necessary condition for a network to be in class V (Figure 3 and Supplementary Note 3). Though only sufficient, this simple metric can correctly classify class members of V from I among these networks, except for the WesternUS power network, for which r (0) = r (K − 1) only marginally holds (the dominance of r (0) is 0) (cf. Figure 3(b)). Discussion Despite the breadth and depth of existing literature on the controllability of complex networks and control scheduling, the significant potential of TVCS has been greatly overlooked. This work strives to explore the advantages of TVCS in linear dynamical networks and obtaining theoretical and computational relationships between these advantages and network structure. Using Gramian-based measures of controllability, we showed that TVCS can significantly enhance the controllability of many but not all synthetic and real networks. This motivated the pursuit of identifying properties based on network structure that explain when, why, and by how much TVCS is beneficial. Using the newly introduced notion of 2k- Table 1: Characteristics of the real-world networks studied in the paper n |E| Directed C→A χ(%) r (0) = r (K − 1) Dominance of r (0) (×10−3 ) ref. BCTNet fMRI Cocomac BCTNet Cat C. elegans 638 58 95 306 37250 1078 2126 2345 N Y Y Y T T T T 1.8 5.5 1.9 0 N N N Y N/A N/A N/A 0 [18] [19] [18] [20] Transportation air500 airUS airGlobal Chicago 500 1858 7976 1467 5960 28236 30501 2596 N Y Y N T T T T 22.4 0 0 0 N Y Y Y N/A 0 0 0 [21] [22] [22] [23, 24] Gene Regulatory E. coli 4053 127544 N T 0 Y 0 [25] PPI Yeast Stelzl Figeys Vidal 2361 1706 2239 3133 13828 6207 6452 12875 N Y Y N T T T T 0 0 0 0 Y Y Y Y 0 0 0 0 [26] [27] [28] [29] Power WesternUS 4941 13188 N T 33.7 Y 0 [20] Food Florida LRL 128 183 2106 2494 Y Y T T 34.6 27.3 N N N/A N/A [30] [31] Social Facebook group E-mail Southern Women UCI P2P UCI Forum Freeman’s EIES Dolphins 4039 1005 18 1899 899 48 62 176468 25571 278 20296 142760 830 318 N Y N Y N Y N I I I I I I I 0.4 0 0 0 0 0 0 N Y Y Y Y Y Y N/A 40.5 1.6 5.5 2.8 1.4 0.7 [32] [33, 34] [35] [36] [37] [38] [39] Trust Physicians Org. Consult Advice Org. Consult Value Org. R&D Advice Org. R&D Aware 241 46 46 77 77 1098 879 858 2228 2326 Y Y Y Y Y I I I I I 8.8 0 0 6 × 10−3 0 N Y Y N Y N/A 0.1 1.2 N/A 0.3 [40] [41] [41] [41] [41] Category Name Neuronal For each network, we have reported the number of nodes n, number of edges |E| (with each bidirectional edge counted twice), whether the network is directed, the method used for obtaining dynamical adjacency matrix A from static connectivity C (A → C), the χ value (equation (5)), and whether the most local and global central nodes coincide (r (0) = r (K − 1)). Since the value of χ is a function of K, we have chosen the value of K ≤ 50 that has the largest χ for each network. Detailed descriptions of these datasets are provided in Supplementary Note 8. (a) (b) (c) Figure 6: The average χ-value for (a) ER, (b) BA, and (c) WS probabilistic networks. The horizontal axis determines the size of the network n in all cases, while the vertical axis determines the values of the corresponding parameters for each network: edge probability p for ER, growth (link attachment) rate ma for BA, and rewiring probability β for WS. After constructing the unweighted connectivity according to each algorithm (ER, BA, or WS), standard uniformly random weights are assigned to each edge, which is then converted to A using transmission method (Supplementary Note 2). For each value of n and network parameter over a coarse mesh (∼ 100 points), 100 networks are generated and the average of their χ-value is computed, which is then smoothly interpolated over a fine mesh (MATLAB csaps). communicability, we showed that the scale-heterogeneity of central nodes in a network is the main cause and correlate of TVCS advantages. If a network has several distinct central nodes and different scales, the optimal TVCS involves starting the control from the most global central nodes and gradually moving towards most local ones as the time horizon is approached. If, on the other hand, a single node acquires the highest centrality at all scales, optimal TVCS prescribes the sole control of this node over the entire horizon, leading to optimality of TICS. A striking finding that defied our expectations is the effect of network dynamics, beyond its raw connectivity structure, on TVCS. Here, we differentiated between the raw connectivity structure of a network (obtained using specific field knowledge and measure the relative strength of nodal connections) and its dynamical adjacency matrix which determines the evolution of network state over time. Depending on the nature of network state, we proposed two methods, transmission and induction, for obtaining the dynamical adjacency matrix from static connectivity. The effects of these methods, however, is noteworthy on the benefits of TVCS, even though the underlying network connectivity is the same (Table 1 and Supplementary Figure S1). While the transmission method significantly enhances the merit of TVCS, the induction method depresses it (both compared to raw connectivity). We believe the reason for the former is the additional homogeneity that the transmission method introduces among the nodes, while the latter is due to the conversion from continuous to discrete-time dynamics, which enables long-distance connections even over small sampling times (due to the fact that interactions occur over infinitesimal intervals in continuous time). These results suggest that controllability of network dynamics is not only a function of its structural connectivity, but also greatly relies on the type of dynamics evolving over the network, an aspect that has received little attention in the existing literature and warrants future research. The focus of our discussion has so far been on single input networks where one node is controlled at a time, in order to enhance the simplicity and clarity of concepts. Nevertheless, our results have straightforward generalizations to multiple-input networks (Supplementary Note 6). If m denotes the number of control inputs, the optimal TVCS involves applying these control inputs to the m nodes with the highest centralities at the appropriate scale at every time instance (i.e., the m nodes with the largest Ri (K−1−k) have to be controlled at every time instance k). It is clear that the additional flexibility due to the additional inputs makes V larger, i.e., more networks have χ > 0. Nevertheless, this additional flexibility also makes TICS significantly more efficient. Therefore, it is not immediately clear whether this enlargement of V also entails larger χ for networks with the same size and sparsity. In fact, increasing m reduces average χ for all the classes of ER, BA, and WS networks (Supplementary Figure S2), suggesting that the additional flexibility is more advantageous for TICS than TVCS. Regardless of the number of inputs (1 or more), an im- portant implicit assumption of our work is that this number is limited, i.e., no more than m nodes can be controlled at every time instance. This may at first seem over-conservative since TVCS requires, by its essence, the installation of actuators at all (or many) nodes of the network. Therefore, one might wonder why limit the control to only m nodes at every time instance when all the nodes are ready for actuation. The answer lies within the practical limitations of actuators. For ideal actuators, distributing the control energy over as many nodes as possible is indeed optimal. However, this is not possible in many scenarios, including when (i) actuators exhibit nonlinear deadzone behaviors, so that each one requires a sizable activation energy, (ii) actuators are controlled via communication channels with limited capacity, so that only a small number of devices can be simultaneously operated, (iii) actuators are geographically disperse so that precise coordination becomes difficult or time-consuming, and (iv) simultaneous control of proximal nodes results in actuator interference. Although the dynamics of all real networks have some degrees of nonlinearity, the analysis of linear(ized) dynamics is a standard first step in analysis of dynamical properties of complex networks [2–13]. This is mainly due to the fact that stability and controllability of linearized dynamics of a nonlinear network implies the same properties locally for the original nonlinear dynamics, making linear dynamics a powerful tool in analyzing many dynamical properties that are in general intractable for nonlinear dynamics. The local validity of linearization, however, is a main limitation of this work, particularly in networks where the change of state is significant relative to the size of the domain over which the linearization is valid. The generalization of this work to linear time-varying dynamics (namely, A(k) instead of A in equation (1)) is a warranted next step for future exploration of the role of TVCS in general nonlinear networks. Methods Optimal Control of Linear Networks and the Reachability Ellipsoid Assume the linear network dynamics in equation (1) are controllable at time K, i.e., WK is invertible (equivalently, positive definite). While for any xf ∈ Rn , there are usually infinitely many choices of {u(k)}K−1 k=0 that take the network from x(0) = 0 to x(K) = xf , the one that has the smallest energy is given by [15, Thm 6.1] ∗ T T K−1−k u (k) = b(k) (A ) WK−1 xf , k ∈ {0, . . . , K − 1}. It is immediate to verify that this gives the minimal energy PK−1 ∗2 T −1 k=0 u (k) = xf WK xf . Therefore, the unit-energy reach- ability set is given by {xf ∈ Rn | xfT WK−1 xf < 1}. Since WK−1 is positive definite, this is a hyper-ellipsoid in Rn , with axes aligned with the eigenvectors of WK . Let (λi , vi ) be an eigen-pair of WK and xf = cvi . Then, xfT WK−1 xf < 1 ⇔ c 2 λ−1 < 1 ⇔ |c| < λ1/2 i i , showing that the axis lengths of this hyper-ellipsoid are given by the square roots of the eigenvalues of WK . Gramian-based Measures of Controllability Gramian-based measures are the most common measures of network controllability. Due to the relationship between Gramian eigenvalues and minimal control energy (as outlined above), these measures quantify how large the eigenvalues of WK are in different ways. Let λ1 ≥ λ2 ≥ · · · ≥ λn ≥ 0 denote the eigenvalues of WK . The most widely used Gramian-based measures are • tr(WK ) = λ1 + λ2 + · · · + λn , −1 −1 −1 • tr(WK−1 )−1 = (λ−1 1 + λ2 + · · · + λn ) , • det(WK ) = λ1 λ2 · · · λn , • λmin (WK ) = λn . It is clear from these relationships that all these measures, except for tr(WK ), approach 0 if λn → 0. This property, i.e., the behavior of a measure as λn → 0, is the most critical difference between tr(WK ) and the other three measures. For the rest of this discussion, let fc (·) be any of tr((·)−1 )−1 , det(·), or λmin (·). Since the network is (Kalman-) controllable if and only if λn > 0, having fc (WK ) > 0 guarantees network controllability while tr(WK ) > 0 does not. This is a major disadvantage of tr(WK ) for small networks, where controllability in all directions in state space is both achievable and desirable. As the size of the network grows, however, λn typically decays exponentially fast to zero [6], irrespective of network structure. This exponential decay of worst-case controllability is even evident in the example network of Figure 1(a) comprising of only n = 5 nodes. Computationally, this means that λn (and in turn fc (WK )) quickly drops below machine precision as n grows. In fact, for K = 10 and double-precision arithmetics, this happens for n ∼ 15, making the TVCS (equation (4)) with f = fc numerically infeasible (as it involves the comparison of fc (WK ) for different {bk }K−1 k=0 , which are all zero up to machine accuracy). Further, notice that the computational complexity of TVCS for f = fc grows as nK due to the NP-hardness of TVCS, enforcing the use of sub-optimal greedy algorithms even if machine precision was not a concern (see [12] and the references therein for details). In addition to the computational aspects of TVCS, the exponential decay of λn also has theoretical implications for the choice of f . When using f = fc , TVCS seeks to assign the control nodes {ιk }K−1 k=0 such that controllability is maintained in all directions in the state space, with special emphasis on the hardest-to-reach directions. The use of tr(WK ), on the other hand, involves maximizing the average of Gramian eigenvalues, which usually strengthens the largest eigenvalues and spares the few smallest ones. In large networks, the latter is in general more realistic as controllability is hardly needed in all n directions of the state space. As discussed in detail in [42], this seems to be the case in the resting-state structural brain networks: this paper shows that tr(WK ) is maximized by controlling specific brain regions that have long been identified as the structural “core” or “hubs” of the cerebral cortex, while the Gramian is itself close to singular. Finally, due to the same strong dependence of fc (WK ) but not tr(WK ) on λn , we often observe that tr(WK ) is significantly less sensitive to the choice of the control nodes {ιk }K−1 k=0 , leading to orders of magnitude smaller χ than that of fc (WK ) (Figure 1(b)). This means that V is only a small subclass of networks that benefit from TVCS measured by fc . This also has a clear interpretation, since maintaining controllability in all directions in the state space requires a broader distribution of the control nodes that facilitates the reach of the control action {u(k)}K−1 k=0 to all the nodes in the network. Optimal TVCS and TICS Consider the TVCS problem in equation (4) with f (·) = tr(·). Using the definition of the controllability Gramian (equation (2)) and the invariance property of trace under cyclic permutations, we can write tr(WK ) = K−1 X b(K−1−k)T (Ak )T Ak b(K−1−k). k=0 Therefore, max tr(WK ) = ι0 ,...,ιK−1 K−1 X k=0 max b(K−1−k)T (Ak )T Ak b(K−1−k), (see Supplementary Note 1 for the definitions of various eigendecomposition based notions of network centrality). Recall that the out-degree centrality and 2-communicability of a node i ∈ V are defined as, respectively, diout = n X aji , j=1 Ri (1) = n X aji2 . j=1 Therefore, if the network is unweighted (i.e., all the edges have the same weight), then Ri (1) ∝ diout , so 2-communicability and out-degree centrality result in the same ranking of the nodes (in particular, r (1) is the node with the largest out-degree). As edge weights become more heterogenous, these two rankings become less correlated, with 2-communicability putting more emphasis on stronger weights. A similar relation exists between ∞-communicability and left eigenvector centrality, as we show next. Let v1 , u1 ∈ Rn be the right and left Perron-Frobenius eigenvectors of A, respectively, normalized such that v1T v1 = u1T v1 = 1. Since the network is by assumption strongly connected and aperiodic, we have  1 k lim A = v1 u1T . k→∞ ρ(A) Thus for any i ∈ V ,  1 2k  1 2k  lim Ri (k) = lim (Ak )T Ak ii k→∞ ρ(A) k→∞ ρ(A) 2 = (u1 v1T v1 u1T )ii = u1,i . Given that dividing Ri (k) by ρ(A)2k for all i does not change the 2 ranking of nodes, we define Ri (∞) = u1,i for all i. Since squaring non-negative numbers preserves their order, nodal rankings based on ∞-communicability and left eigenvector centrality are identical. ιK−1−k where each term b(K−1−k)T (Ak )T Ak b(K−1−k) is the ιK−1−k ’th diagonal entry of (Ak )T Ak . Therefore, the optimization in equation (4) boils down to finding the largest diagonal element of (Ak )T Ak and applying u(K−1−k) to this node. On the other hand, for the TICS problem (equation (3)), we have ! K−1 X k T k T tr(WK ) = b (A ) A b, k=0 so one has to instead find the largest diagonal entry of PK−1 k T k k=0 (A ) A , and apply all the controls inputs u(0), . . . , u(K− 1) to this same node, which is clearly sub-optimal with respect to TVCS. 2k-Communicability, Degree, and Eigenvector Centrality The notion of 2k-communicability introduced in this article has close connections with the degree and eigenvector centrality in the limit cases of k = 1 and k → ∞, respectively Nodal dominance Among the networks where the nodes with the greatest Ri (1) and Ri (∞) coincide (i.e., r (0) = r (∞)), there is a higher chance (than in general) that any network belongs to class I. However, about half of these networks still belong to class V, meaning that there exists 1 < k < ∞ such that r (k) 6= r (0). To assess the importance of this time-variation of optimal control nodes, we define the dominance of the node r (0) (over the rest of the network) as follows. Let r 0 (0) be the index of the node with the second largest Ri (1) (largest after removing r (0)). Similarly, let r 0 (∞) be the index of the second largest Ri (∞). We define n R (0) − R 0 (0) r (0) r (0) Dominance of r (0) = min , Rr (0) (0) Rr (0) (∞) − Rr 0 (∞) (∞) o . Rr (0) (∞) A small dominance indicates that another node has very similar value Ri (0) or Ri (∞) to r (0), while a large dominance is an indication of a large gap between Rr (0) (k) and the next largest Ri (k) for both k = 0 and k → ∞. References [1] R. E. Kalman, “Mathematical description of linear dynamical systems,” Journal of the Society for Industrial and Applied Mathematics, Series A: Control, vol. 1, no. 2, pp. 152–192, 1963. [2] Y. Y. Liu, J. J. Slotine, and A. L. Barabási, “Controllability of complex networks,” Nature, vol. 473, no. 7346, pp. 167–173, 2011. [3] N. J. Cowan, E. J. Chastain, D. A. Vilhena, J. S. Freudenberg, and C. T. Bergstrom, “Nodal dynamics, not degree distributions, determine the structural controllability of complex networks,” PLoS ONE, vol. 7, no. 6, pp. 1–5, 06 2012. [4] A. Olshevsky, “Minimal controllability problems,” IEEE Transactions on Control of Network Systems, vol. 1, no. 4, pp. 249–258, 2014. [5] G. Yan, J. Ren, Y. Lai, C. Lai, and B. Li, “Controlling complex networks: How much energy is needed?” Physical Review Letters, vol. 108, no. 21, p. 218703, 2012. [14] E. Nozari, F. Pasqualetti, and J. Cortés, “Time-invariant versus time-varying actuator scheduling in complex networks,” in American Control Conference, Seattle, WA, May 2017, pp. 4995–5000. [15] C. T. Chen, Linear System Theory and Design, 3rd ed. New York, NY, USA: Oxford University Press, Inc., 1998. [16] P. C. Müller and H. I. Weber, “Analysis and optimization of certain qualities of controllability and observability for linear dynamical systems,” Automatica, vol. 8, no. 3, pp. 237–246, 1972. [17] C. D. Godsil and G. F. Royle, Algebraic Graph Theory, ser. Graduate Texts in Mathematics. Springer, 2001, vol. 207. [18] M. Rubinov and O. Sporns, “Complex network measures of brain connectivity: uses and interpretations,” Neuroimage, vol. 52, no. 3, pp. 1059–1069, 2010. [19] R. Bakker, T. Wachtler, and M. Diesmann, “CoCoMac 2.0 and the future of tract-tracing databases,” Frontiers in neuroinformatics, vol. 6, 2012. [20] D. J. Watts and S. H. Strogatz, “Collective dynamics of ‘small-world’ networks,” Nature, vol. 393, pp. 440–442, 1998. [6] F. Pasqualetti, S. Zampieri, and F. Bullo, “Controllability metrics, limitations and algorithms for complex networks,” IEEE Transactions on Control of Network Systems, vol. 1, no. 1, pp. 40–52, 2014. [21] V. Colizza, R. Pastor-Satorras, and A. Vespignani, “Reaction–diffusion processes and metapopulation models in heterogeneous networks,” Nature physics, vol. 3, pp. 276–282, 2007. [7] T. H. Summers and J. Lygeros, “Optimal sensor and actuator placement in complex dynamical networks,” in IFAC World Congress, Cape Town, South Africa, 2014, pp. 3784–3789. [22] T. Opsahl, “Why anchorage is not (that) important: Binary ties and sample selection,” 2011, available at http: //wp.me/poFcY-Vw. [8] T. H. Summers, F. L. Cortesi, and J. Lygeros, “On submodularity and controllability in complex dynamical networks,” IEEE Transactions on Control of Network Systems, vol. 3, no. 1, pp. 91–101, 2016. [9] V. Tzoumas, M. A. Rahimian, G. J. Pappas, and A. Jadbabaie, “Minimal actuator placement with bounds on control effort,” IEEE Transactions on Control of Network Systems, vol. 3, pp. 67–78, 2016. [10] L. Zhao, W. Zhang, J. Hu, A. Abate, and C. J. Tomlin, “On the optimal solutions of the infinite-horizon linear sensor scheduling problem,” IEEE Transactions on Automatic Control, vol. 59, no. 10, pp. 2825–2830, 2014. [11] S. T. Jawaid and S. L. Smith, “Submodularity and greedy algorithms in sensor scheduling for linear dynamical systems,” Automatica, vol. 61, pp. 282–288, 2015. [12] Y. Zhao, F. Pasqualetti, and J. Cortés, “Scheduling of control nodes for improved network controllability,” in IEEE Conf. on Decision and Control, Las Vegas, NV, 2016, pp. 1859–1864. [13] D. Han, J. Wu, H. Zhang, and L. Shi, “Optimal sensor scheduling for multiple linear dynamical systems,” Automatica, vol. 75, pp. 260–270, 2017. [23] R. W. Eash, K. S. Chon, Y. J. Lee, and D. E. Boyce, “Equilibrium traffic assignment on an aggregated highway network for sketch planning,” Transportation Research Record, vol. 994, pp. 30–37, 1983. [24] D. E. Boyce, K. S. Chon, M. E. Ferris, Y. J. Lee, K.-T. Lin, and R. W. Eash, “Implementation and evaluation of combined models of urban travel and location on a sketch planning network,” Chicago Area Transportation Study, pp. xii+169, 1985. [25] H. Kim, J. E. Shim, J. Shin, and I. Lee, “Ecolinet: a database of cofunctional gene network for Escherichia coli,” Database, vol. 2015, 2015. [26] D. Bu, Y. Zhao, L. Cai, H. Xue, X. Zhu, H. Lu, J. Zhang, S. Sun, L. Ling, N. Zhang, G. Li, and R. Chen, “Topological structure analysis of the protein–protein interaction network in budding yeast,” Nucleic acids research, vol. 31, no. 9, pp. 2443–2450, 2003. [27] U. Stelzl, U. Worm, M. Lalowski, C. Haenig, F. H. Brembeck, H. Goehler, M. Stroedicke, M. Zenkner, A. Schoenherr, S. Koeppen, J. Timm, S. Mintzlaff, C. Abraham, N. Bock, S. Kietzmann, A. Goedde, E. Toksz, A. Droege, S. Krobitsch, B. Korn, W. Birchmeier, H. Lehrach, and E. E. Wanker, “A human protein-protein interaction network: A resource for annotating the proteome,” Cell, vol. 122, pp. 957–968, 2005. [28] R. M. Ewing, P. Chu, F. Elisma, H. Li, P. Taylor, S. Climie, L. McBroom-Cerajewski, M. D. Robinson, L. O’Connor, M. Li, R. Taylor, M. Dharsee, Y. Ho, A. Heilbut, L. Moore, S. Zhang, O. Ornatsky, Y. V. Bukhman, M. Ethier, Y. Sheng, J. Vasilescu, M. Abu-Farha, J. P. P. Lambert, H. S. Duewel, I. I. Stewart, B. Kuehl, K. Hogue, K. Colwill, K. Gladwish, B. Muskat, R. Kinach, S. L. L. Adams, M. F. Moran, G. B. Morin, T. Topaloglou, and D. Figeys, “Large-scale mapping of human protein-protein interactions by mass spectrometry,” Molecular Systems Biology, vol. 3, 2007. [29] J. Rual, K. Venkatesan, T. Hao, T. Hirozane-Kishikawa, A. Dricot, N. Li, G. F. Berriz, F. D. Gibbons, M. Dreze, and N. Ayivi-Guedehoussou, “Towards a proteome-scale map of the human protein-protein interaction network,” Nature, no. 7062, pp. 1173–1178, 2005. [30] R. E. Ulanowicz, J. J. Heymans, and M. S. Egnotovich, “Network analysis of trophic dynamics in South Florida ecosystems, FY 99: The graminoid ecosystem,” Annual Report to the United States Geological Service Biological Resources Division Ref. No.[UMCES] CBL 00-0176, Chesapeake Biological Laboratory, University of Maryland, 2000. [31] N. D. Martinez, J. J. Magnuson, T. Kratz, and M. Sierszen, “Artifacts or attributes? effects of resolution on the Little Rock Lake food web,” Ecological Monographs, vol. 61, pp. 367–392, 1991. [32] J. Leskovec and J. J. Mcauley, “Learning to discover social circles in ego networks,” in Advances in neural information processing systems (NIPS), 2012, pp. 539–547. [33] H. Yin, A. R. Benson, J. Leskovec, and D. F. Gleich, “Local higher-order graph clustering,” in Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. ACM, 2017, pp. 555– 564. [34] J. Leskovec, J. Kleinberg, and C. Faloutsos, “Graph evolution: Densification and shrinking diameters,” ACM Trans. Knowl. Discov. Data, vol. 1, no. 1, 2007. [35] A. Davis, B. B. Gardner, and M. R. Gardner, Deep South. Chicago, IL: University of Chicago Press, 1941. [36] T. Opsahl and P. Panzarasa, “Clustering in weighted networks,” Social Networks, vol. 31, no. 2, pp. 155–163, 2009. [37] T. Opsahl, “Triadic closure in two-mode networks: Redefining the global and local clustering coefficients,” Social Networks, vol. 35, no. 2, pp. 159–167, 2013. [38] S. C. Freeman and L. C. Freeman, The Networkers Network: A Study of the Impact of a New Communications Medium on Sociometric Structure, ser. Social sciences research reports. School of Social Sciences University of Calif., 1979. [39] D. Lusseau, K. Schneider, O. J. Boisseau, P. Haase, E. Slooten, and S. M. Dawson, “The bottlenose dolphin community of Doubtful Sound features a large proportion of long-lasting associations,” Behavioral Ecology and Sociobiology, vol. 54, pp. 396–405, 2003. [40] J. Coleman, E. Katz, and H. Menzel, “The diffusion of an innovation among physicians,” Sociometry, pp. 253–270, 1957. [41] R. L. Cross and A. Parker, The Hidden Power of Social Networks: Understanding how Work Really Gets Done in Organizations. Harvard Business School Press, 2004. [42] S. Gu, F. Pasqualetti, M. Cieslak, Q. K. Telesford, A. B. Yu, A. E. Kahn, J. D. Medaglia, J. M. Vettel, M. B. Miller, S. T. Grafton, and D. S. Bassett, “Controllability of structural brain networks,” Nature Communications, vol. 6, pp. 8414 EP–, 10 2015. Author Contributions All authors designed and did the research, and wrote the paper. E.N. gathered and analyzed the data of real-world networks. Additional Information Competing financial interests: The authors declare no competing financial interests.
3cs.SY
arXiv:1703.00103v3 [math.GR] 15 Jun 2017 Complete reducibility, Külshammer’s question, conjugacy classes: a D4 example Tomohiro Uchiyama National Center for Theoretical Sciences, Mathematics Division No. 1, Sec. 4, Roosevelt Rd., National Taiwan University, Taipei, Taiwan email:[email protected] June 16, 2017 Abstract Let k be a nonperfect separably closed field. Let G be a connected reductive algebraic group defined over k. We study rationality problems for Serre’s notion of complete reducibility of subgroups of G. In particular, we present a new example of subgroup H of G of type D4 in characteristic 2 such that H is G-completely reducible but not Gcompletely reducible over k (or vice versa). This is new: all known such examples are for G of exceptional type. We also find a new counterexample for Külshammer’s question on representations of finite groups for G of type D4 . A problem concerning the number of conjugacy classes is also considered. The notion of nonseparable subgroups plays a crucial role in all our constructions. Keywords: algebraic groups, complete reducibility, rationality, geometric invariant theory, representations of finite groups, conjugacy classes 1 Introduction Let k be a field. Let k be an algebraic closure of k. Let G be a connected affine algebraic k-group: we regard G as a k-defined algebraic group together with a choice of k-structure in the sense of Borel [8, AG. 11]. We say that G is reductive if the unipotent radical Ru (G) of G is trivial. Throughout, G is always a connected reductive k-group. In this paper, we continue our study of rationality problems for complete reducibility of subgroups of G [36], [33]. By a subgroup of G we mean a (possibly non-k-defined) closed subgroup of G. Following Serre [25, Sec. 3]: Definition 1.1. A subgroup H of G is called G-completely reducible over k (G-cr over k for short) if whenever H is contained in a k-defined parabolic subgroup P of G, then H is contained in a k-defined Levi subgroup of P . In particular if H is not contained in any proper k-defined parabolic subgroup of G, H is called G-irreducible over k (G-ir over k for short). So far, most studies on complete reducibility is for complete reducibility over k only; see [18], [29], [30] for example. We say that a subgroup H of G is G-cr if it is G-cr over k. Not much is known on complete reducibility over k (especially for nonperfect k) except a few theoretical results and important examples; see [3, Sec. 5], [1], [36], [33]. In [35, Thm. 1.10], [34, Thm. 1.8], [36, Thm. 1.2], [6, Sec. 6], Bate et al. and we found several examples of k-subgroups 1 of G that are G-cr over k but not G-cr (or vice versa). All these examples are for G of exceptional type (E6 , E7 , E8 , G2 ) in p = 2 and constructions are very intricate. The first main result in this paper is the following: Theorem 1.2. Let k be a nonperfect separably closed field of characteristic 2. Let G be a simple k-group of type D4 . Then there exists a k-subgroup H of G that is G-cr over k but not G-cr (or vice versa). A few comments are in order. First, one can embed D4 inside E6 , E7 or E8 as a Levi subgroup. Since a subgroup contained in a k-Levi subgroup L of G is G-cr over k if and only if it is L-cr over k (Proposition 2.3), one might argue that our “new example” is not really new. However we have checked that our example is different from any example in [35, Thm. 1.10], [34, Thm. 1.8], [36, Thm. 1.2]. So this is the first such example for classical G. Second, the nonperfectness of k is essential in Theorem 1.2 in view of the following [4, Thm. 1.1]: Proposition 1.3. Let H be a subgroup of G. Then H is G-cr over k if and only if H is G-cr over ks (where ks is a separable closure of k). So in particular if k is perfect, a subgroup of G is G-cr over k if and only if it is G-cr. Proposition 1.3 is deep: it depends on the recently proved 50-years-old center conjecture of Tits (see Conjecture 4.1) in spherical buildings [25], [31], [20]. Third, the k-definedness of H in Theorem 1.2 is important. Actually it is not difficult to find a k-subgroup with the desired property. For our construction of a k-defined subgroup H, it is essential for H to be nonseparable in G. We write Lie(G) or g for the Lie algebra of G. Recall [6, Def. 1.1]: Definition 1.4. A subgroup H of G is nonseparable if the dimension of Lie(CG (H)) is strictly smaller than the dimension of cg (H) (where H acts on g via the adjoint action). In other words, the scheme-theoretic centralizer of H in G (in the sense of [12, Def. A.1.9]) is not smooth. We exhibit the importance of nonseparability of H in the proof of Theorem 1.2. Proper nonseparable k-subgroups of G are hard to find, and only handful examples are known [6, Sec. 7], [35, Thm. 1.10] [34, Thm. 1.8], [36, Thm. 1.2]. It is known that if p is very good for G, every subgroup of G is separable [6, Thm. 1.2]. Thus, to find a nonseparable subgroup we are forced to work in small p. See [6], [14] for more on separability. In the rest of this section we assume k is algebraically closed. In [35], we asked: Question 1.5. Let H ≤ M ≤ G be a triple of reductive groups with G and M connected. If H is G-cr then it is M -cr (and vice versa)? In general, the answer is no in either direction. It is easy to find a counterexample for the reverse direction: take H = M = P GL2 and G = SL3 in p = 2 and H sits inside G via the adjoint representation. For more counterexamples, see [18], [29]. A counterexample for the forward direction is hard to find and only a handful such examples are known [35, Thm. 1.1], [34, Thm. 1.2], [6, Sec. 6]. All these examples are for G of exceptional type (E6 , E7 , E8 , G2 ) in p = 2. Here is our second main result: Theorem 1.6. Let k be of characteristic 2. Let G be simple and of type D4 . Then there exists a pair of reductive subgroups H < M of G such that (G, M ) is a reductive pair and H is G-cr but not M -cr. Recall that a pair of reductive groups G and M is called a reductive pair if LieM is an M -module direct summand of g. See [13] for more on reductive pairs. For our construction, nonseparablity of H is essential [6, Thm. 1.4]: 2 Proposition 1.7. Suppose that (G, M ) is a reductive pair. Let H be a subgroup of M such that H is separable in G. If H is G-cr then H is M -cr. Now we move on to a problem with a slightly different flavor. Let Γ be a finite group. By a representation of Γ in a reductive group G, we mean a homomorphism from Γ to G. We write Hom(Γ, G) for the set of representations ρ of Γ in G. The group G acts on Hom(Γ, G) by conjugation. Let Γp be a Sylow p-subgroup of G. In [16, Sec. 2], Külshammer asked: Question 1.8. Let G be a reductive algebraic group defined over an algebraically closed field of characteristic p. Let ρp ∈ Hom(Γp , G). Then are there only finitely many representations ρ ∈ Hom(Γ, G) such that ρ |Γp is G-conjugate to ρp ? It is known that in general the answer is no. Two counterexamples are known: one in G of type G2 [5] and the other in G of type E6 [34, Thm. 1.14] (both in p = 2). The third main result in this paper is Theorem 1.9. Let k be of characteristic 2. Let G be simple of type D4 . Then there exists a finite group Γ with a Sylow 2-subgroup Γ2 and representations ρa ∈ Hom(Γ, G) for a ∈ k such that ρa is not conjugate to ρb for a 6= b but the restrictions ρa |Γ2 are not pairwise conjugate for all a ∈ k. We note that nonseparability plays a crucial role in the proof of Theorem 1.9. In this paper, the reader will see that seemingly unrelated Questions 1.5 and 1.8 (and the rationality problems for G-complete reducibility above and the problem on conjugacy classes below) are related: all our main results concerning these problems (Theorems 1.2, 1.6, 1.9, 1.11) are based on the same mechanism (nonseparability plus some modifications). However, it is not completely clear yet (at least to the author) how exactly these problems are related. The main purpose of this paper is to give a chance for the reader to look at these problems all in once with a relatively easy example in G of type D4 to stimulate further research on relations between these problems. Finally we consider a problem on the number of conjugacy classes. Given n ∈ N, we let G act on Gn by simultaneous conjugation: g · (g1 , g2 , . . . , gn ) = (gg1 g −1 , gg2 g −1 , . . . , ggn g −1 ). In [26], Slodowy proved the following result, applying Richardson’s beautiful tangent space argument [22, Sec. 3], [23, Lem. 3.1]. Proposition 1.10. Let M be a reductive subgroup of a reductive algebraic group G defined over an algebraically closed field k. Let n ∈ N, let (m1 , . . . , mn ) ∈ M n and let H be the subgroup of M generated by m1 , . . . , mn . Suppose that (G, M ) is a reductive pair and that H is separable in G. Then the intersection G · (m1 , . . . , mn ) ∩ M n is a finite union of M -conjugacy classes. Proposition 1.10 has many consequences; see [3], [26], and [37, Sec. 3] for example. Here is our main result on conjugacy classes: Theorem 1.11. Let k be of characteristic 2. Let G be simple of type D4 . Let M be the subsystem subgroup of type A1 A1 A1 A1 . Then there exists N ∈ N and a tuple m ∈ M N such that G · m ∩ M N is an infinite union of M -conjugacy classes. Here is the structure of the paper. In Section 2, we set out the notation and show some preliminary results. Then in Section 3, we prove our first main result (Theorem 1.2) concerning a rationality problem for complete reducibility. In Section 4, we prove some rationality result (Theorem 4.5) related to the center conjecture. In Section 5, we give a short proof for our second main result on complete reducibility (Theorem 1.6) using a recent result from Geometric Invariant Theory (Proposition 2.7). Then in Section 6, we prove Theorem 1.9 giving a new counterexample to the question of Külshammer. Finally in Section 7 we consider a problem on conjugacy classes and prove Theorem 1.11. 3 2 Preliminaries Throughout, we denote by k a separably closed field. Our references for algebraic groups are [8], [9], [12], [15], and [27]. Let H be a (possibly non-connected) affine algebraic group. We write H ◦ for the identity component of H. We write [H, H] for the derived group of H. A reductive group G is called simple as an algebraic group if G is connected and all proper normal subgroups of G are finite. We write Xk (G) and Yk (G) (X(G) and Y (G)) for the set of k-characters and k-cocharacters (k-characters and k-cocharacters) of G respectively. For k-characters and k-cocharacters G we simply say characters and cocharacters of G. Fix a maximal k-torus T of G (such a T exists by [8, Cor. 18.8]). Then T splits over k since k is separably closed. Let Ψ(G, T ) denote the set of roots of G with respect to T . We sometimes write Ψ(G) for Ψ(G, T ). Let ζ ∈ Ψ(G). We write Uζ for the corresponding root subgroup of G. We define Gζ := hUζ , U−ζ i. Let ζ, ξ ∈ Ψ(G). Let ξ ∨ be the coroot corresponding to ξ. Then ∗ ∗ ζ ◦ ξ ∨ : k → k is a k-homomorphism such that (ζ ◦ ξ ∨ )(a) = an for some n ∈ Z. Let sξ denote the reflection corresponding to ξ in the Weyl group of G. Each sξ acts on the set of roots Ψ(G) by the following formula [27, Lem. 7.1.8]: sξ · ζ = ζ − hζ, ξ ∨ iξ. By [11, Prop. 6.4.2, Lem. 7.2.1] = ǫsξ ·ζ (±a) where nξ = we can choose k-homomorphisms ǫζ : k → Uζ so that nξ ǫζ (a)n−1 ξ ǫξ (1)ǫ−ξ (−1)ǫξ (1). The next result [36, Prop. 1.12] shows complete reducibility behaves nicely under central isogenies. In this paper we do not specify the isogeny type of G. (Our argument works for G of any isogeny type anyway.) Note that if k is algebraically closed, the centrality assumption for f is not necessary in Proposition 2.2. Definition 2.1. Let G1 and G2 be reductive k-groups. A k-isogeny f : G1 → G2 is central if ker df1 is central in g1 where ker df1 is the differential of f at the identity of G1 and g1 is the Lie algebra of G1 . Proposition 2.2. Let G1 and G2 be reductive k-groups. Let H1 and H2 be subgroups of G1 and G2 be subgroups of G1 and G2 respectively. Let f : G1 → G2 be a central k-isogeny. 1. If H1 is G1 -cr over k, then f (H1 ) is G2 -cr over k. 2. If H2 is G2 -cr over k, then f −1 (H2 ) is G1 -cr over k. The next result [2, Thm. 1.4] is used repeatedly to reduce problems on G-complete reducibility to those on L-complete reducibility where L is a Levi subgroup of G. Proposition 2.3. Suppose that a subgroup H of G is contained in a k-defined Levi subgroup of G. Then H is G-cr over k if and only if it is L-cr over k. We recall characterizations of parabolic subgroups, Levi subgroups, and unipotent radicals in terms of cocharacters of G [27, Prop. 8.4.5]. These characterizations are essential to translate results on complete reducibility into the language of GIT; see [3], [7] for example. ∗ Definition 2.4. Let X be a affine k-variety. Let φ : k → X be a k-morphism of affine k-varieties. We say that lim φ(a) exists if there exists a k-morphism φ̂ : k → X (necessarily a→0 ∗ unique) whose restriction to k is φ. If this limit exists, we set lim φ(a) = φ̂(0). a→0 Definition 2.5. Let λ ∈ Y (G). Define Pλ := {g ∈ G | lim λ(a)gλ(a)−1 exists}, a→0 Lλ := {g ∈ G | lim λ(a)gλ(a)−1 = g}, Ru (Pλ ) := {g ∈ G | lim λ(a)gλ(a)−1 = 1}. a→0 a→0 4 Then Pλ is a parabolic subgroup of G, Lλ is a Levi subgroup of Pλ , and Ru (Pλ ) is the unipotent radical of Pλ . If λ is k-defined, Pλ , Lλ , and Ru (Pλ ) are k-defined [24, Sec. 2.12.3]. Any k-defined parabolic subgroups and k-defined Levi subgroups of G arise in this way ∗ since k is separably closed. It is well known that Lλ = CG (λ(k )). Note that k-defined Levi subgroups of a k-defined parabolic subgroup P of G are Ru (P )(k)-conjugate [7, Lem. 2.5(iii)]. Let M be a reductive k-subgroup of G. Then, there is a natural inclusion Yk (M ) ⊆ Yk (G) of k-cocharacter groups. Let λ ∈ Yk (M ). We write Pλ (G) or just Pλ for the parabolic subgroup of G corresponding to λ, and Pλ (M ) for the parabolic subgroup of M corresponding to λ. It is clear that Pλ (M ) = Pλ (G) ∩ M and Ru (Pλ (M )) = Ru (Pλ (G)) ∩ M . Recall the following geometric characterization for complete reducibility via GIT [3]. Suppose that a subgroup H of G is generated by n-tuple h = (h1 , · · · , hn ) of G, and G acts on h by simultaneous conjugation. Proposition 2.6. A subgroup H of G is G-cr if and only if the G-orbit G · h is closed. Combining Proposition 2.6 and a recent result from GIT [7, Thm. 3.3] we have Proposition 2.7. Let H be a subgroup of G. Let λ ∈ Y (G). Suppose that h′ := lima→0 λ(a) · h exists. If H is G-cr, then h′ is Ru (Pλ )-conjugate to h. 3 G-cr vs G-cr over k (Proof of Theorem 1.2) Let G be a simple algebraic group of type D4 defined over a nonperfect field k of characteristic 2. Fix a maximal k-torus of G and a k-defined Borel subgroup of G. let Ψ(G) = Ψ(G, T ) be the set of roots corresponding to T , and Ψ(G)+ = Ψ(G, B, T ) be the set of positive roots of G corresponding to T and B. The following Dynkin diagram defines the set of simple roots of G. γ α β δ We label Ψ(G)+ in the following. The corresponding negative roos are defined accordingly. Note that Roots 1, 2, 3, 4 correspond to α, γ, δ, β respectively. Let λ := (α + 2β + γ + δ)∨ = 1 7 1 0 0 0 0 1 0 1 2 8 0 1 1 0 1 1 0 0 3 9 0 1 0 0 0 1 4 1 10 1 0 0 0 1 1 1 0 1 5 11 1 1 0 1 1 1 0 1 6 12 0 1 1 1 1 2 0 1 α∨ + 2β ∨ + γ ∨ + δ ∨ . Then Pλ = hT, Uζ | ζ ∈ Ψ(G)+ ∪ {−1, −2, −3}i, Lλ = hT, Uζ | ζ ∈ {±1, ±2, ±3}i, Ru√ (Pλ ) = hU√ Ψ(G)+ \{1, 2, 3}i. Let a ∈ k\k 2 . Pick b ∈ k ∗ with b3 = 1 ζ | ζ ∈√ and b 6= 1. Let v( a) := ǫ4 ( a)ǫ11 ( a) ∈ Ru (Pλ )(k). Define √ H := v( a) · hnα nγ nδ , (α + γ + δ)∨ (b)i. Here is our first main result in this section. Proposition 3.1. H is k-defined. Moreover, H is G-cr but not G-cr over k. 5 Proof. First, we have (nα nγ nδ ) · (β) = (nα nγ nδ ) · 4 = 11, (nα nγ nδ ) · 11 = 4. Using this and the commutation relations [15, Lem. 32.5 and Prop. 33.3], we obtain √ v( a) · (nα nγ nδ ) = (nα nγ nδ )ǫ12 (a). √ Since h4, (α + γ + δ)∨ i = −3, h11, (α + γ + δ)∨ i = 3, and b3 = 1, v( a) commutes with (α + γ + δ)∨ (b). Now it is clear that H is k-defined (since it is generated by k-points). √ Now we show that H is G-cr. It is sufficient to show that H ′ := v( a)−1 ·H = hnα nγ nδ , (α+ γ + δ)∨ (b) is G-cr since it is G-conjugate to H. Since H ′ is contained in Lλ , by Proposition 2.3 it is enough to show that H ′ is Lλ -cr. By inspection, H ′ is Lλ -ir (this is easy since Lλ = Lα × Lγ × Lδ = A1 × A1 × A1 ). Next, we show that H is not G-cr over k. Suppose the contrary. Clearly H is contained in Pλ that is k-defined. Then there exists a k-defined Levi subgroup of Pλ containing H. Then by [7, Lem. 2.5(iii)] there exists u ∈ Ru (Pλ )(k) such that H is contained in u · Lλ . ThusQnα nγ nδ ǫ12 (a) < u · Lλ . So u−1 · (nα nγ nδ ǫ12 (a)) < Lλ . By [27, Prop. 8.2.1], we set u := ζ∈Ψ(Ru (Pλ )) ǫζ (xζ ). Using the labelling of the positive roots above, we have Ψ(Ru (Pλ )) = {4, · · · 12}. We compute how nα nγ nδ acts on Ψ(Ru (Pλ )): nα nγ nδ = (4 11)(5 10)(6 9)(7 8)(12). (3.1) Using this and the commutation relations, u−1 · (nα nγ nδ ǫ12 (a)) =nα nγ nδ ǫ4 (x4 + x11 )ǫ5 (x5 + x10 )ǫ6 (x6 + x9 )ǫ7 (x7 + x8 ) ǫ8 (x7 + x8 )ǫ9 (x6 + x9 )ǫ10 (x5 + x10 )ǫ11 (x4 + x11 ) ǫ12 (x24 + x25 + x26 + x27 + a). Thus if u−1 · (nα σǫα+2β+γ+δ (a)) < Lλ we must have x4 = x11 , x5 = x10 , x6 = x9 , x7 = x8 , x24 + x25 + x26 + x27 + a = 0. The last equation gives (x4 + x5 + x6 + x7 )2 = a. This is impossible since a ∈ / k 2 . We are done. Remark 3.2. From the computations above we see that the curve C(x) := {ǫ4 (x)ǫ11 (x) | x ∈ k} is not contained in CG (H), but the corresponding element in Lie(G), that is, e4 +e11 is contained in cg (H). Then the argument in the proof of [35, Prop. 3.3] shows that Dim(CG (H)) is strictly smaller than Dim(cg (H)). So H is non-separable in G. In fact, combining [1, Thm. 1.5] and [1, Thm. 9.3] we have that if a k-subgroup H of G is separable in G and H is G-cr, then it is G-cr over k. Now we move on result in this section. We use the same k, a, b, G, and, √ main√ √ to the second λ as above. Let v( a) := ǫ−11 ( a)ǫ−4 ( a). Let √ K := v( a) · hnα nγ nδ , (α + γ + δ)∨ (b)i = hnα nγ nδ ǫ−12 (a), (α + γ + δ)∨ (b)i. Define H := hK, ǫ5 (1)i. Proposition 3.3. H is k-defined. Moreover, H is G-ir over k but not G-cr. 6 Proof. H is clearly k-defined. First, we show that H is G-ir over k. Note that √ √ v( a)−1 · H = hnα nγ nδ , (α + γ + δ)∨ (b), ǫ5 (1)ǫ1 ( a)i. √ √ Thus we see that v( a)−1 · H is contained in Pλ . So H is contained in v( a) · Pλ . √ Lemma 3.4. v( a) · Pλ is the unique proper parabolic subgroup of G containing H. √ Proof. Suppose that Pµ is a proper parabolic subgroup of G containing v( a)−1 · H. In the proof of Proposition 3.1 we have shown that M := hnα nγ nδ , (α + γ + δ)∨ (b)i is G-cr. Then there exists a Levi subgroup L of Pµ containing M since M is contained in Pµ . Since Levi subgroups of Pµ are Ru (Pµ )-conjugate by [7, Lem. 2.5(iii)], without loss, we set L := Lµ . Then ∗ ∗ M < Lµ = CG (µ(k )), so µ(k ) centralizes M . Recall that by [27, Thm. 13.4.2], CRu (Pλ ) (M )◦ × CLλ (M )◦ × CRu (P − ) (M )◦ is an open set of CG (M )◦ where Pλ− is the opposite of Pλ containing λ Lλ . Lemma 3.5. CG (M )◦ = G12 . Proof. First of all, from Equation (3.1) we see that G12 is contained in CG (nα nγ nδ ). Since ∗ h12, (α + γ + δ)∨ i = 0,QG12 is also contained in CG ((α + γ + δ)∨ (k )). So G12 is contained in CG (M ). Set u := i∈Ψ(Ru (Pλ )) ǫi (xi ) for some xi ∈ k. Using Equation (3.1) and the commutation relations, we obtain (nα nγ nδ ) · u =ǫ4 (x11 )ǫ5 (x10 )ǫ6 (x9 )ǫ7 (x8 )ǫ8 (x7 )ǫ9 (x6 )ǫ10 (x5 )ǫ11 (x4 ) ǫ12 (x4 x11 + x5 x10 + x6 x9 + x7 x8 + x12 ). So, if u ∈ CRu (Pλ ) (nα nγ nδ ) we must have x4 = x11 , x5 = x10 , x6 = x9 , x7 = x8 , and x4 x11 +x5 x10 +x6 x9 +x7 x8 = 0. But hζ, (α+γ+δ)∨ i = −1 for ζ = {5, 6, 7}, so x5 = x6 = x7 = 0 for u ∈ CRu (Pλ ) (M ). Then (nα nγ nδ ) · u = ǫ4 (x4 )ǫ11 (x4 )ǫ12 (x24 + x12 ). So we must have x24 = 0 if u ∈ CRu (Pλ ) (M ). Thus we conclude that CRu (Pλ ) (M ) = U12 . Similarly, we can show that CRu (P − ) (M ) = U−12 . A direct computation shows that CLλ (M ) < λ ∗ T and CT (nα nγ nδ ) = (α + 2β + γ + δ)∨ (k ) < G12 . We are done. ∗ ∗ Since µ(k ) centralizes M , Lemma 3.5 yields µ(k ) < G12 . Then we can set µ := g · (α + 2β + γ + δ)∨ for some g ∈ G12 . By the Bruhat decomposition, g is one of the following forms: (1) g = (α + 2β + γ + δ)∨ (s)ǫ12 (x1 ), (2) g = ǫ12 (x1 )n12 (α + 2β + γ + δ)∨ (s)ǫ12 (x2 ) ∗ for some x1 , x2 ∈ k, s ∈ k . √ We√ rule out the second case. Suppose g is of the second form. Note that ǫ5 (1)ǫ1 ( a) ∈ v( a)−1 · H < Pµ . But Pµ = Pg·(α+2β+γ+δ)∨ = g · P(α+2β+γ+δ)∨ . So it is enough to show √ ∗ that g −1 · (ǫ5 (1)ǫ1 ( a)) ∈ / P(α+2β+γ+δ)∨ . Since U12 and (α + 2β + γ + δ)(k ) are contained in P(α+2β+γ+δ)∨ we can assume g = n12 . We have n12 = nα nβ nα nγ nβ nα nδ nβ nα nγ nβ nδ (the longest element in the Weyl group of D4 ). 7 Using this, we can compute how n12 acts on each root subgroup of G. In particular n−1 12 · U5 = U−5 and n−1 · U = U . Thus 1 −1 12 √ √ n−1 / P(α+2β+γ+δ)∨ . 12 · (ǫ5 (1)ǫ1 ( a)) = ǫ−5 (1)ǫ−1 ( a) ∈ So g must be of the first form. Then g ∈ Pλ . Thus Pµ = Pg·λ = g · Pλ = Pλ . We are done. √ Lemma 3.6. v( a) · Pλ is not k-defined. √ Proof. Suppose the contrary. Since Pλ is√k-defined, v( a) · Pλ is G(k)-conjugate √ to Pλ by [8, Thm. 20.9]. Thus we can put Pλ = gv( a) · Pλ for some g ∈ G(k). So gv( a) ∈ Pλ since √ parabolic subgroups are self-normalizing. Then g = pv( a)−1 for some p ∈ Pλ . Thus g is a kpoint of Pλ Ru (Pλ− ). Then by the rational version of the Bruhat decomposition [8, Thm. 21.15], there exists a unique √ p′ ∈ Pλ (k) and a unique u′ ∈ Ru (Pλ− )(k) such that g = p′ u′ . This is a contradiction since v( a) ∈ / Ru (Pλ− )(k). Now Lemmas 3.4, 3.6 show that H is G-ir over k. Lemma 3.7. H is not G-cr. √ √ Proof. We had CG (M )◦ = G12 . Then CG (v( a)−1 · H)◦√ < G12 since M < v( √a)−1 · H. −1 −1 Using the commutation √ relations, we see that U12 < CG (v( a) · H). Note that v( a) · H contains h := ǫ5 (1)ǫ1 ( a) that does not commute with any non-trivial element of U−12 . Also, ∗ since h5, λi = 4, h does not commute any non-trivial element of (α + 2β + γ + δ)∨ (k ). √ −1 with √ Thus we conclude that CG (v( a) · H)◦ = U12 . So CG (H)◦ = v( a) · U12 which is unipotent. Then by the classical result of Borel-Tits [10, Prop. 3.1], we see that CG (H)◦ is not G-cr. Since CG (H)◦ is a normal subgroup of CG (H), by [7, Ex. 5.20], CG (H) is not G-cr. Then by [3, Cor. 3.17], H is not G-cr. 4 Tits’ center conjecture In [31], Tits conjectured the following: Conjecture 4.1. Let X be a spherical building. Let Y be a convex contractible simplicial subcomplex of X. If H is an automorphism group of X stabilizing Y , then there exists a simplex of Y fixed by H. This so-called center conjecture of Tits was proved by case-by-case analyses by Tits, Mühlherr, Leeb, and Ramos-Cuevas [17], [19], [21]. Recently uniform proof was given in [20]. In relation to the theory of complete reducibility, Serre showed [25]: Proposition 4.2. Let G be a reductive k-group. Let ∆(G) be the building of G. If H is not G-cr, then the fixed point subcomplex ∆(G)H is convex and contractible. We identify the set of proper k-parabolic subgroups of G with ∆(G) in the usual sense of Tits [32]. Note that for a subgroup H of G, NG (H)(k) induces an automorphism group of ∆(G) stabilizing ∆(G)H . Thus, combining the center conjecture with Proposition 4.2 we obtain Proposition 4.3. If a subgroup H of G is not G-cr over k, then there exists a proper k-parabolic subgroup of G containing H and NG (H)(k). 8 Proposition 4.3 was an essential tool to prove various theoretical results on complete reducibility over nonperfect k in [33] and [36]. We have asked the following in [33, Rem. 6.5]: Question 4.4. If H < G is not G-cr over k, then does there exist a proper k-parabolic subgroup of G containing HCG (H)? The answer is yes if CG (H) is k-defined (or k is perfect). Since in that case the set of k points are dense in CG (H) (since we assume k = ks ) and the result follows from Proposition 4.3. The main result in this section is to present a counterexample to Question 4.4 when k is nonperfect. Theorem 4.5. Let k be nonperfect of characteristic 2. Let G be simple of type D4 . Then there exists a non-abelian k-subgroup H of G such that H is not G-cr over k but CG (H) is not contained in any proper k-parabolic subgroup of G. Remark 4.6. Borel-Tits [10, Rem. 2.8] mentioned that if k is nonperfect of characteristic 2 and [k : k 2 ] > 2, there exists a k-plongeable unipotent element u in G of type D4 such that CG (u) is not contained in any proper k-parabolic subgroup of G (with no proof). Note that such u generates a (cyclic) subgroup of G that is not G-cr over k. (Recall that a unipotent element is called k-plongeable if it can be embedded in the unipotent radical of a proper kparabolic subgroup of G [10].) Theorem 4.5 is a nonabelian version of Borel-Tits’ result. Also the assumption [k : k 2 ] > 2 is not necessary here. Proof. We keep √ the same√notation √ from the previous section. Set n := nα nγ∨nδ , t := (α + γ + δ)∨ (b), and v( a) := ǫ4 ( a)ǫ11 ( a). √ Let H := hnα nγ nδ ǫ12 (a), (α + γ + δ) (b)i. Then H is not G-cr over k. We have H ′ := v( a)−1 · H = hn, ti. It is clear that CG (H ′ ) > G12 . Thus hn, t, G12 i < H ′ CG (H ′ ). By running a similar argument as in the proof of Lemma 3.4 in the previous section, we find that the only proper parabolic subgroup of G containing hn, t, U12 i is P(α+2β+γ+δ)∨ (since n12 · 12 = −12). Clearly P(α+2β+γ+δ)∨ does not contain G12 . Therefore there is no proper parabolic subgroup of G containing H ′ CG (H ′ ). Thus there is no proper parabolic subgroup of G containing HCG (H). 5 G-cr vs M-cr (Proof of Theorem 1.6) From this section we assume k is algebraically closed. Let G be as in the hypothesis. Let a, b ∈ k ∗ with b3 = 1 and b 6= 1. Let H ′ := hnα nγ nδ , (α + γ + δ)∨ (b)i. Let v(a) := ǫ4 (a)ǫ11 (a). Define H := v(a) · H ′ = hnα nγ nδ ǫ12 (a2 ), (α + γ + δ)∨ (b)i. Then H is G-cr (by the same argument as in the previous section). Now let M := hGα , Gγ , Gδ , G12 i ∼ = A1 A1 A1 A1 . Proposition 5.1. H is not M -cr. Proof. Let λ := (α + 2β + γ + δ)∨ . Then H < Pλ (M ) = hT, Gα , Gγ , Gδ , U12 i. Let cλ : Pλ → Lλ be the natural projection. Let v := (nα nγ nδ ǫ12 (a2 ), (α + γ + δ)∨ (b)). We have cλ (v) = lim λ(a) · (nα nγ nδ ǫ12 (a2 ), (α + γ + δ)∨ (b)) = (nα nγ nδ , (α + γ + δ)∨ (b)). a→0 We see that v is not Ru (Pλ (M ))-conjugate to cλ (v) since Ru (Pλ (M )) = U12 centralizes nα nγ nδ . By Proposition 2.7, this shows that H is not M -cr. 9 6 Külshammer’s question (Proof of Theorem 1.9) Let d ≥ 5 be odd. Let D2d be the dihedral group of order 2d. Let Γ := D2d × C2 = hr, s, z | rd = s2 = z 2 = 1, srs−1 = r−1 , [r, z] = [s, z] = 1i. Let Γ2 := hs, zi (a Sylow 2-subgroup of Γ). Let G be as in the hypothesis. Choose a, b ∈ k ∗ with bd = 1 and b 6= 1. Let n := nα nγ nδ and t := (α + γ + δ)∨ (b). For each a ∈ k define ρa ∈ Hom(γ, G) by ρa (r) = t, ρa (s) = nǫ12 (a), ρa (z) = ǫ12 (1). √ √ √ An√easy computation shows √ that this is well-defined. Let √ u( a) = ǫ4 ( a)ǫ11 ( a). Then u( a) · n = nǫ12 (a) and u( a) · ǫ12 (1) = ǫ12 (1). Thus u( a) · (ρ0 |Γ2 ) = ρa |Γ2 . So ρa |Γ2 are pairwise conjugate. Now suppose that ρa is conjugate to ρb . Then there exists g ∈ G such that g · ρa = ρb . Since ρa (r) = t, we must have g ∈ CG (t) = T G12 . So let g = hm for some h ∈ T and m ∈ G12 . Then we have hnh−1 (hmǫ12 (a)m−1 h−1 ) = hnmǫ12 (a)m−1 h−1 = hmnǫ12 (a)m−1 h−1 = g · ρa (s) = ρb (s) = nǫ12 (b). Note that hnh−1 ∈ Gα Gγ Gδ and hmǫ12 (a)m−1 h−1 ∈ G12 . Since [Gα Gγ Gδ , G12 ] = 1, we have Gα Gγ Gδ ∩ G12 = 1. This implies hnh−1 = n. Now an easy computation shows h ∈ G12 . Thus g = hm ∈ G12 . Since G12 is a simple group of type A1 , (nǫ12 (a), ǫ12 (1)) cannot be G12 conjugate to (nǫ12 (b), ǫ12 (1)) if a 6= b. We are done. 7 Conjugacy classes (Proof of Theorem 1.11) Proof. Let G be as in the hypothesis. Let λ := (α+2β+γ+δ)∨. Then Ψ(Ru (Pλ )) = {4, · · · , 12}. Using the commutation relations we have Z(Ru (Pλ )) = U12 . Let n := nα nγ nδ . Pick b ∈ k with b3 = 1 and b 6= 1. Let t := (α + γ + δ)∨ (b). Define K := hn, t, U12 i. By the same argument as that in the proof of [35, Lem. 5.1] we obtain CPλ (K) = CRu (Pλ ) (K) (since h12, λi = 2). By a standard result there exists n ∈ N such that Z = hz1 , · · · , zn i. Now let M := hLλ , G12 i. Let m := (n, t, z1 , · · · , zn ) and set N := n + 2. Then by the similar argument to that in the proof of [35, Lem. 5.1] yields that G · m ∩ Pλ (M )N is an infinite union of Pλ (M )-conjugacy classes. (The crucial thing here is the existence of a curve that is tangent to cg (K) but not tangent to CG (K), in other words K is nonseparable in G.) Now let cλ : Pλ → Lλ be the canonical projection. Then cλ (n, t, z1 , · · · , zn ) = (n, t). Since K0 := hn, ti is L-ir as shown in the previous section, by [28, Prop. 3.5.2] we are done. Acknowledgements This research was supported by a postdoctoral fellowship at the National Center for Theoretical Sciences at the National Taiwan University. 10 References [1] M. Bate, S. Herpel, B. Martin, and G. Röhrle. Cocharacter-closure and the rational Hilbert-Mumford theorem. arXiv:1411.7849v4, 2015. To appear in Math. Z. [2] M. Bate, S. Herpel, B. Martin, and G. Röhrle. Cocharacter-closure and spherical buildings. Pacific J. Math., 279:65–85, 2015. [3] M. Bate, B. Martin, and G. Röhrle. A geometric approach to complete reducibility. Invent. Math., 161:177–218, 2005. [4] M. Bate, B. Martin, and G. Röhrle. Complete reducibility and separable field extensions. C. R. Acad. Sci. Paris., 348:495–497, 2010. [5] M. Bate, B. Martin, and G. Röhrle. On a question of Külshammer for representations of finite groups in reductive groups. Israel J. Math., 214:463–470, 2016. [6] M. Bate, B. Martin, G. Röhrle, and R. Tange. Complete reducibility and separability. Trans. Amer. Math. Soc., 362(8):4283–4311, 2010. [7] M. Bate, B. Martin, G. Röhrle, and R. Tange. Closed orbits and uniform S-instability in geometric invariant theory. Trans. Amer. Math. Soc., 365(7):3643–3673, 2013. [8] A. Borel. Linear Algebraic Groups. Springer, Graduate Texts in Mathematics, second enlarged edition, 1991. [9] A. Borel and J. Tits. Groupes réductifs. Publ. Math. IHES, 27:55–150, 1965. [10] A. Borel and J. Tits. Éléments unipotents et sous-groupes paraboliques des groupes réductifs I. Invent. Math, 12:95–104, 1971. [11] R. Carter. Simple Groups of Lie Type. John Wiley & Sons, 1972. [12] B. Conrad, O. Gabber, and G. Prasad. Pseudo-reductive Groups. Cambridge, second edition, 2015. [13] O. Goodbourn. Reductive pairs arising from representations. J. Algebra, 455:93–107, 2016. [14] S. Herpel. On the smoothness of centralizers in reductive groups. Trans. Amer. Math. Soc., 365(7):3753–3774, 2013. [15] J. Humphreys. Linear Algebraic Groups. Springer, Graduate Texts in Mathematics, 1991. [16] B. Külshammer. Donovan’s conjecture, crossed products and algebraic group actions. Israel J. Math, 92(1):295–306, 1995. [17] B. Leeb and C. Ramos-Cuevas. The centre conjecture for spherical buildings of types F4 and E6 . Geom. Funct. Anal., 21(3):525–559, 2011. [18] M. Liebeck and G. Seitz. Reductive subgroups of exceptional algebraic groups. Mem. Amer. Math. Soc., 580, 1996. [19] B. Mühlherr and J. Tits. The centre conjecture for non-exceptional buildings. J. Algebra, 300(2):687–706, 2006. 11 [20] B. Mühlherr and R. Weiss. Receding polar regions of a spherical building and the center conjecture. Ann. Inst. Fourier, 63:479–513, 2013. [21] C. Ramos-Cuevas. The center conjecture for thick spherical buildings. Geom. Dedicata, 166:349–407, 2012. [22] R. Richardson. Conjugacy classes in Lie algebras and algebraic groups. Ann. of Math., 86:1–15, 1967. [23] R. Richardson. On orbits of algebraic groups and Lie groups. Bull. Austral. Math. Soc, 25(1):1–28, 1982. [24] R. Richardson. Conjugacy classes of n-tuples in Lie algebras and algebraic groups. Duke Math. J., 57:1–35, 1988. [25] J.P. Serre. Complète Réductibilité. Séminaire Bourbaki. Vol 2003/2004. Astérisque, 299:195–217, 2005. [26] P. Slodowy. Two notes on a finiteness problem in the representation theory of finite groups, Austral. Math. Soc. Lect. Ser. 9, Algebraic groups and Lie groups, 331-348. Cambridge Univ. Press, Cambridge, 1997. [27] T. Springer. Linear Algebraic Groups. Birkhäuser, Progress in Mathematics, second edition, 1998. [28] D. Stewart. G-completely reducibility and the exceptional algebraic groups. PhD thesis, Imperial College London, UK, 2010. [29] D. Stewart. Non-G-completely reducible subgroups of the exceptional groups. Int. Math. Res. Not., 2014(22):6053–6078, 2014. [30] A. Thomas. Simple irreducible subgroups of exceptional algebraic groups. J. Algebra, 423:190–238, 2015. [31] J. Tits. Groupes semi-simples isotropes. Colloq. Théorie des Groupes Algébriques, Bruxelles, 1962. [32] J. Tits. Buildings of Spherical Type and Finite BN-pairs. Springer, Lecture Notes in Mathematics, 386, first edition, 1974. [33] T. Uchiyama. Complete reducibility of subgroups of reductive algebraic groups over nonperfect fields: II. arXiv: 1512.04616, 2015, To appear in Comm. Algebra. [34] T. Uchiyama. Non-separability and complete reducibility: En examples with an application to a question of Külshammer. arXiv:1510.00997, 2015, To appear in J. Group Theory. [35] T. Uchiyama. Separability and complete reducibility of subgroups of the Weyl group of a simple algebraic group of type E7 . J. Algebra, 422:357–372, 2015. [36] T. Uchiyama. Complete reducibility of subgroups of reductive algebraic groups over nonperfect fields I. J. Algebra, 463:168–187, 2016. [37] E. Vinberg. On invariants of a set of matrices. J. Lie Theory, 6:249–269, 1996. 12
4math.GR
arXiv:1603.09275v1 [math.GR] 30 Mar 2016 A note on the Howson property in inverse semigroups Peter R. Jones Department of Mathematics, Statistics and Computer Science Marquette University Milwaukee, WI 53201, USA [email protected] March 31, 2016 Abstract An algebra has the Howson property if the intersection of any two finitely generated subalgebras is finitely generated. A simple necessary and sufficient condition is given for the Howson property to hold on an inverse semigroup with finitely many idempotents. In addition, it is shown that any monogenic inverse semigroup has the Howson property. Keywords: Howson property; E-unitary; monogenic Mathematics Subject Classification: 20M18 1 Introduction An algebra has the Howson property if the intersection of any two finitely generated subalgebras is again finitely generated. The eponym ‘Howson’ stems from [3], where it was shown that free groups have this property. Motivated by recent work by P.V. Silva and F. Soares [9], we find a remarkably simple characterization of the inverse semigroups having the Howson property, under the assumption that the semilattice of idempotents is finite: the Howson property holds if and only if the same is true for its maximal subgroups. When specialized to E-unitary semigroups, it can immediately be deduced that the Howson property holds if and only if the same is true for its maximal group image. Thus we generalize the main theorem of [9] using only elementary methods based on Green’s relations. Some of the technical ideas were motivated by techniques from the authors work [4] on full inverse subsemigroups. Throughout, inverse semigroups are to be regarded as unary semigroups. Thus a group has the Howson property, regarded as a group, if and only if the same is true regarded as an inverse semigroup. Perhaps the deepest earlier work on the Howson property for inverse semigroups was by P.G. Trotter and the author, who showed [5] that although free inverse semigroups of rank one have the Howson property, the property fails for free inverse semigroups of rank greater than one. Silva also showed [8], however, that the intersection of any two monogenic inverse subsemigroups of any free inverse semigroup is again finitely generated. Before providing technical background, we connect this work with the cited paper [9], which concerns itself with the (E-unitary) inverse semigroups that are the semidirect products of semilattices and groups. Their first main result (Theorem 3.4, that the resulting semigroup has the Howson property if and only if the group itself does) is proved under the hypothesis that the semilattice is finite, and thereby follows 1 from our cited theorem (see Corollary 3.6). Although they do not make this observation, we may note that in fact our corollary may be decuced from their result, by virtue of O’Carroll’s embedding theorem [6]. See the discussion following the cited corollary for more details. 2 Preliminaries We refer the reader to the text by Petrich [7] for inverse semigroups in general, including background on Green’s relations, congruences and so on. The semilattice of idempotents of an inverse semigroup S is denoted ES . If X ⊆ S, then hXi denotes the inverse subsemigroup generated by X. An inverse semigroup is monogenic if it is generated by a single element. The notation T ≤ S means that T is an inverse subsemigroup of S. The Brandt semigroups [7, Section II.3] are the completely 0-simple inverse semigroups. They are the semigroups isomorphic to the following: given a group G and a nonempty set I, B(G, I) consists of the set I × G × I ∪ {0}, where (i, g, j)(j, h, k) = (i, gh, k) and all other products are 0. The nonzero idempotents are therefore in one-one correspondence with the set I. Every primitive inverse semigroup — one in which every nonzero idempotent is minimal — is the 0-direct union of Brandt semigroups. Let S be an inverse semigroup. For each J -class J of S, let P F (J) denote the principal factor associated with J. Formally ([7, Section I.6]), if J = Ja is not the least J -class of S, P F (J) = J(a)/I(a), where J(a) = SaS and I(a) = J(a)\Ja . In practice, we consider P F (J) as J ∪ {0}, with the products from J being those in S, if they lie in J, all other products being 0. If J is the least J -class of S, then P F (J) is defined to be J itself. If J is the least J -class of S (its kernel ), then P F (J) is a group. Otherwise, P F (J) is 0-simple and, if EJ is finite, completely 0-simple and thus a Brandt semigroup. In general, S is completely semisimple if each principal factor is a group or a Brandt semigroup. This holds if and only if S contains no bicyclic subsemigroup. In such a semigroup, D = J . We shall represent the bicyclic semigroup B via the presentation hx : xx−1 ≥ x−1 xi, in which case ES is the chain e0 > e1 > e2 > · · · , where ei = x−i xi (x0 corresponding to the identity element 1 = xx−1 ). For alternative representations, see [7]. An inverse semigroup S is E-unitary if whenever s ∈ S, e ∈ ES and es ∈ ES then s ∈ ES . Let σ = {(s, t) ∈ S × S : es = et for some e ∈ ES } denote the least group congruence on any inverse semigroup, so that S/σ is its maximal group homomorphic image. Then [7, Proposition III.7.2] S is E-unitary if and only if ES is a σ-class of S and if and only if R ∩ σ is the identity relation. Note that if the E-unitary inverse semigroup S has a least idempotent e, say, then its kernel Je = He is isomorphic to S/σ. 3 The main theorem Proposition 3.1. A Brandt semigroup B(G, I) is finitely generated if and only if I is finite and G is finitely generated. Proof. First, suppose I is finite, I = {1, 2, . . . , n}, say, and let A be any generating set for G. As usual, the nonzero R-classes and the nonzero L-classes may be indexed by I and thus the nonzero H-classes by I × I, in such a way that the group H-classes are {Hii : i ∈ I}, all isomorphic with G. Let x1 , x2 , . . . , xn be a transversal of the H-classes H11 , H12 , . . . , H1n , with x1 the identity element e of H11 . By Green’s lemma [7, Lemma I.6.9], Hij = x−1 i H11 xj for each (i, j) ∈ I ×I, so B(G, I) = hA∪{x2 , . . . , xn }i. Clearly, if G is finitely generated, then so is B(G, I). 2 Conversely, if B(G, I) is finitely generated, then I is finite (since any nonzero element is R-related to either a generator or the inverse of a generator). In the notation of the previous paragraph, B(G, I) = hB ∪ {x2 , . . . , xn }i for some finite subset B of A. Now if g ∈ H11 , then the only nonzero products with −1 −1 −1 members of {x2 , . . . , xn } ∪ {x−1 2 , . . . , xn } are of the form gxj , xi g and xi gxj . But the only nonzero −1 −1 −1 −1 products of members of {x2 , . . . , xn }∪{x2 , . . . , xn } are xj xj = e and xj xj ∈ Hjj . Hence H11 = hBi and G is finitely generated. Corollary 3.2. A Brandt semigroup B(G, I) has the Howson property if and only if the same is true of G. Proof. Necessity is clear. To prove the converse, first consider any inverse subsemigroup T of S = B(G, I) that is not just a subgroup. Then T is primitive and thus a 0-direct union of Brandt subsemigroups. Clearly, T is finitely generated if and only if there are finitely many factors, each of which is finitely generated. So by Proposition 3.1 it is finitely generated if and only if each factor has finitely many idempotents and its maximal subgroups (which are subgroups of G) are finite generated. Then let U and V be finitely generated inverse subsemigroups of S that are not just subgroups. If U ∩ V is nonempty and not {0}, first suppose it is a nonzero group, a subgroup of He , say, for some e ∈ ES . Then it is a common subgroup of a 0-direct factor of U and a 0-direct factor of V and therefore it is the intersection of the subgroups U ∩ He and V ∩ He . By the preceding paragraph, each of these subgroups is finitely generated and therefore, by the Howson property, so is U ∩ V . If U ∩ V is not just a subgroup, then, similarly, each factor in its 0-direct union is contained within a 0-direct factor of U and a 0-direct factor of V and so is the intersection of those two factors. Each of its maximal subgroups is therefore the intersection of a maximal subgroup of U with a maximal subgroup of V and is therefore finitely generated. By Proposition 3.1, U ∩ V is finitely generated. Lemma 3.3. Let S be an inverse semigroup, T = hXi an inverse subsemigroup of S, and J a J -class of S. Then T ∩ J ⊆ hEJ X ∩ T ∩ Ji. Proof. Let t ∈ T ∩ J, t = y1 · · · yn , where for each i, yi or yi−1 belongs to X. Then by the result of Hall [2, Lemma 1], t = y¯1 · · · y¯n , where for each i, y¯i = ei yi , ei = yi · · · yn t−1 y1 · · · yi−1 (with the usual provisions in case i = 1 or i = n). By the cited result, each y¯i D t and each ei ∈ EJ . Clearly each ei ∈ T . Note that if yi = x−1 then ei yi = (fi x)−1 , where fi = xei x−1 ∈ EJ ∩ T . Thus t ∈ hEJ X ∩ T ∩ Ji. Let T ≤ S and J = Ja a non-group J -class of S that T meets nontrivially. Then T ∩ I(a) ≤ I(a) and so (T ∩ J) ∪ {0} may be regarded as an inverse subsemigroup of P F (J). Denote it by TJ . If J is a subgroup, put TJ = T ∩ J. Proposition 3.4. Let S be an inverse semigroup with finitely many idempotents and T ≤ S. Then T is finitely generated if and only if TJ is finitely generated for each J -class J of S that meets T nontrivially. Proof. If T is generated by the finite set X then, by Lemma 3.3, each such TJ is generated by the finite set EJ X ∩ T ∩ J. Conversely, if for each such J, TJ = hXJ i, where we may assume XJ does not contain the zero of P F (J) in the non-group case, then when interpreted in S each XJ is contained in T and T ∩ J ⊆ hXJ i. Thus T is generated by the union of the sets XJ . We can now prove the theorem stated in the introduction. Theorem 3.5. Let S be an inverse semigroup with finitely many idempotents. Then S has the Howson property if and only if each of its maximal subgroups has this property. 3 Proof. Necessity is clear. For the converse, let U and V be finitely generated inverse subsemigroups of S. Let J be a J -class of S that meets U ∩ V nontrivially. If J is the minimum J -class of S, then all the relevant intersections are subgroups of J and so (U ∩ V )J is finitely generated, by the Howson property for J. Otherwise, by the direct half of Proposition 3.4, UJ and VJ are finitely generated inverse subsemigroups of P F (J). Applying Proposition 3.2, UJ ∩ VJ is finitely generated. But UJ ∩ VJ = ((U ∩ J) ∩ (V ∩ J)) ∪ {0} = ((U ∩ V ) ∩ J) ∪ {0} = (U ∩ V )J . Applying the reverse half of Proposition 3.4, U ∩ V is therefore finitely generated and the Howson property holds in S. Finiteness of the semilattice of idempotents is necessary: as remarked in the introduction, the free inverse semigroups of rank greater than one do not satisfy the Howson property. But all their subgroups are trivial. Corollary 3.6. Let S be an E-unitary inverse semigroup with finitely many idempotents. Then S has the Howson property if and only if the maximal group image S/σ has this property. In particular [9, Theorem 3.4], the semidirect product of a finite semilattice and a group has the Howson property if and only if the group has this property. Proof. In this special case, the minimum J-class J is isomorphic to S/σ and each maximal subgroup of S embeds in J, so the result is immediate from Theorem 3.5. Remark: in [9, Corollary 4.1], Silva and Soares cleverly apply the last statement of the corollary just stated to extend it to the case of locally finite actions: those for which the orbit of each element of the semilattice under finitely generated subgroups is finite. One application was to actions on ‘strongly finite above semilattices with identity’. These are semilattices possessing a well-defined height function, given by the maximum length of a chain from each element to the identity, and, further, having only finitely many elements of any given height. Note that the semilattice of idempotents of any free inverse semigroup of finite rank has this property. Thus it does not guarantee the Howson property for E-unitary inverse semigroups in general. Another application of the same corollary — to the case that the group is locally finite — is moot: any E-unitary inverse semigroup whose maximal group homomorphic image is locally finite is itself locally finite, by Brown’s lemma [1], and therefore immediately has the Howson property. On the other hand, as remarked in the introduction, Corollary 3.6 may also be deduced from [9, Theorem 3.4]. Sufficiency follows from O’Carroll’s theorem [6] that any E-unitary inverse semigroup S [with finite semilattice of idempotents and] maximum group homomorphic image G embeds in a semidirect product of a [finite] semilattice with G. Necessity follows from the fact that S/σ is isomorphic to the group kernel of S. 4 Monogenic inverse semigroups As remarked in the introduction, the author and P.G. Trotter showed that the free inverse semigroup F I1 of rank one (which is an E-unitary inverse semigroup) has the Howson property. A key tool was the following. Result 4.1. [5, from Proposition 1.5] For any inverse subsemigroup S of the free inverse semigroup of rank one, the inverse subsemigroup generated by the nonidempotents of S is finitely generated. As far as the author is aware, all the inverse semigroups hitherto known to have the Howson property were completely semisimple, so the following results are of special interest. 4 Lemma 4.2. Every inverse subsemigroup of the bicyclic semigroup B that does not consist solely of idempotents is finitely generated. Proof. Let S be such a subsemigroup and let ek be the greatest idempotent for which the associated R-class of S is nontrivial, where k a nonnegative integer. Say ek xm ∈ S, where m is a positive integer. Then for every nonnegative integer r, S contains (ek xm )r = ek xmr and so (ek xm )−r (ek xm )r = ek+rm . Since B is a quotient of the free inverse semigroup of rank one, S is generated by a finite set A of nonidempotents, together with a set F of idempotents. Suppose S contains ek+sm+i for some s and some i, 0 < i < m. Since xsm x−sm = 1, direct calculation shows that S contains (ek xsm )ek+sm+i (ek xsm )−1 = ek+i and ek+i (ek xm ) = ek+i xm , in which case, further, S contains ek+rm+i for every nonnegative r, as in the previous paragraph. Thus S is generated by A together with the finite set of idempotents {ej : 0 ≤ j < k + m} ∩ S. Corollary 4.3. The bicyclic semigroup B has the Howson property. Proof. Let U, V be finitely generated inverse subsemigroups. If either consists solely of idempotents, then it is finite, so assume otherwise. Then for some positive integers m and n and nonnegative integers j and k, u = ej xm ∈ U and v = ek xn ∈ V . By replacing u and v respectively by un and v m , if necessary, we may assume m = n, so that u σ v. If U ∩ V contains a nonidempotent, then Lemma 4.2 applies. In particular, this is the case whenever U ∩ V contains an idempotent ei such that i ≥ max(j, k), that is, ei ≤ uu−1 , vv −1 : for then ei u R ei v and ei u σ ei v, so since B is E-unitary, ei u = ei v is a nonidempotent of U ∩ V . Otherwise, U ∩ V is contained in the finite set {ei : i < max(j, k)}. Apart from the free one, the monogenic inverse semigroups are determined by the following classes of defining relations [7, Theorem IX.3.11], where k, ℓ are positive integers: (1) xk = xk+ℓ ; (2) xk x−1 = x−1 xk ; (3) xk = x−1 xk+1 . The first class consists of the finite instances. The second consists of the the infinite cyclic group (k = 1) and ideal extensions of that group by finite Rees quotients of F I1 . The third consists of the bicyclic semigroup B (k = 1) and ideal extensions of B by finite Rees quotients of F I1 . Proposition 4.4. Every monogenic inverse semigroup has the Howson property. Proof. We have already noted that F I1 has this property. For the first class this is obvious; those in the second class have finitely many idempotents and the maximal subgroups are either trivial or infinite cyclic, so Theorem 3.5 applies. We have just proved that B has the Howson property, so let S be an ideal extension of B by a finite Rees quotient of F I1 , where xn ∈ B, say. Let U, V be finitely generated inverse subsemigroups of S. As in the proof of Corollary 4.3, we may assume that neither U nor V consists of idempotents. Since x is of infinite order, neither U ∩ B nor V ∩ B consists of idempotents. By Lemma 4.2, U ∩ B and V ∩ B finitely generated, so (U ∩ V ) ∩ B is finitely generated and, since (U ∩ V )\B is finite, U ∩ V is also finitely generated. References [1] T.C. Brown, An interesting combinatorial method in the theory of locally finite semigroups, Pacific J. Math. 36 (1971), 285–289. [2] T.E. Hall, On regular semigroups, J. Algebra 24 (1973), 1–24. [3] A.G. Howson, On the intersection of finitely generated free groups, J. London Math. Soc. 29 (1954), 428–434. 5 [4] P.R. Jones, Semimodular inverse semigroups, J. London Math. Soc. (2) 17 (1978), 446–456. [5] P.R. Jones and P.G. Trotter, The Howson property for free inverse semigroups, Simon Stevin 63 (1989), 277–284. [6] L. O’Carroll, Embedding theorems for proper inverse semigroup, J. Algebra 42 (1976), 26 – 40. [7] M. Petrich, Inverse Semigroups, Wiley, New York, 1984. [8] P.V. Silva, ‘Contributions to combinatorial semigroup theory’ (Ph.D. Thesis), University of Glasgow, 1991. [9] P.V. Silva and F. Soares, Howson’s property for semidirect products of semilattices by groups, arXiv:1412.3048v1. 6
4math.GR